@builder.io/dev-tools 1.18.40-dev.202512101354.78246177d → 1.18.40-dev.202512101534.78246177d
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/cli/index.cjs +1841 -1534
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +2 -1
- package/server/index.cjs +676 -306
- package/server/index.mjs +681 -311
- package/types/cli/launch/server.d.ts +0 -1
- package/types/server/source-map-resolver.d.ts +6 -5
- package/types/tsconfig.tsbuildinfo +1 -1
package/server/index.cjs
CHANGED
|
@@ -40,7 +40,7 @@ var builderVersion, pkgVersion;
|
|
|
40
40
|
var init_version = __esm({
|
|
41
41
|
"packages/dev-tools/cli/version.ts"() {
|
|
42
42
|
"use strict";
|
|
43
|
-
builderVersion = true ? "1.18.40-dev.
|
|
43
|
+
builderVersion = true ? "1.18.40-dev.202512101534.78246177d" : "0.0.0";
|
|
44
44
|
pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
45
45
|
}
|
|
46
46
|
});
|
|
@@ -819,7 +819,7 @@ var init_types = __esm({
|
|
|
819
819
|
// packages/dev-tools/common/node-request.ts
|
|
820
820
|
function requestJSON(opts) {
|
|
821
821
|
const startTime = Date.now();
|
|
822
|
-
return new Promise((
|
|
822
|
+
return new Promise((resolve3, reject) => {
|
|
823
823
|
const request2 = getRequestModule(opts.url);
|
|
824
824
|
const req = request2(
|
|
825
825
|
{
|
|
@@ -846,7 +846,7 @@ function requestJSON(opts) {
|
|
|
846
846
|
);
|
|
847
847
|
} else {
|
|
848
848
|
try {
|
|
849
|
-
|
|
849
|
+
resolve3(JSON.parse(data));
|
|
850
850
|
} catch (err) {
|
|
851
851
|
reject(
|
|
852
852
|
`Response from ${opts.url.href} is not valid JSON: ${data}
|
|
@@ -1095,7 +1095,7 @@ async function connectBuilder(ctx, publicApiKey, privateAuthKey, kind) {
|
|
|
1095
1095
|
let MAX_RETRIES = 5;
|
|
1096
1096
|
let retries = 0;
|
|
1097
1097
|
while (!hasContent && retries < MAX_RETRIES) {
|
|
1098
|
-
await new Promise((
|
|
1098
|
+
await new Promise((resolve3) => setTimeout(resolve3, 1e3));
|
|
1099
1099
|
let content = await hasBuilderContentViaQueryAPI({
|
|
1100
1100
|
model: DEFAULT_MODEL_NAME,
|
|
1101
1101
|
pageUrl: frameworkPageOpts.pathname,
|
|
@@ -1131,7 +1131,7 @@ async function connectBuilder(ctx, publicApiKey, privateAuthKey, kind) {
|
|
|
1131
1131
|
`modified files: ${modifiedFiles.map((m2) => m2.displayFilePath).join(", ")}`
|
|
1132
1132
|
);
|
|
1133
1133
|
await ctx.restartAppServer();
|
|
1134
|
-
await new Promise((
|
|
1134
|
+
await new Promise((resolve3) => setTimeout(resolve3, 500));
|
|
1135
1135
|
} else {
|
|
1136
1136
|
ctx.debug(`no modified files`);
|
|
1137
1137
|
}
|
|
@@ -1183,284 +1183,659 @@ var init_builder_connect = __esm({
|
|
|
1183
1183
|
}
|
|
1184
1184
|
});
|
|
1185
1185
|
|
|
1186
|
-
//
|
|
1187
|
-
function
|
|
1188
|
-
let
|
|
1186
|
+
// node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
1187
|
+
function decodeInteger(reader, relative) {
|
|
1188
|
+
let value = 0;
|
|
1189
1189
|
let shift = 0;
|
|
1190
|
-
let
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1190
|
+
let integer = 0;
|
|
1191
|
+
do {
|
|
1192
|
+
const c = reader.next();
|
|
1193
|
+
integer = charToInt[c];
|
|
1194
|
+
value |= (integer & 31) << shift;
|
|
1195
|
+
shift += 5;
|
|
1196
|
+
} while (integer & 32);
|
|
1197
|
+
const shouldNegate = value & 1;
|
|
1198
|
+
value >>>= 1;
|
|
1199
|
+
if (shouldNegate) {
|
|
1200
|
+
value = -2147483648 | -value;
|
|
1201
|
+
}
|
|
1202
|
+
return relative + value;
|
|
1203
|
+
}
|
|
1204
|
+
function hasMoreVlq(reader, max) {
|
|
1205
|
+
if (reader.pos >= max)
|
|
1206
|
+
return false;
|
|
1207
|
+
return reader.peek() !== comma;
|
|
1208
|
+
}
|
|
1209
|
+
function decode(mappings) {
|
|
1210
|
+
const { length } = mappings;
|
|
1211
|
+
const reader = new StringReader(mappings);
|
|
1212
|
+
const decoded = [];
|
|
1213
|
+
let genColumn = 0;
|
|
1214
|
+
let sourcesIndex = 0;
|
|
1215
|
+
let sourceLine = 0;
|
|
1216
|
+
let sourceColumn = 0;
|
|
1217
|
+
let namesIndex = 0;
|
|
1218
|
+
do {
|
|
1219
|
+
const semi = reader.indexOf(";");
|
|
1220
|
+
const line = [];
|
|
1221
|
+
let sorted = true;
|
|
1222
|
+
let lastCol = 0;
|
|
1223
|
+
genColumn = 0;
|
|
1224
|
+
while (reader.pos < semi) {
|
|
1225
|
+
let seg;
|
|
1226
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
1227
|
+
if (genColumn < lastCol)
|
|
1228
|
+
sorted = false;
|
|
1229
|
+
lastCol = genColumn;
|
|
1230
|
+
if (hasMoreVlq(reader, semi)) {
|
|
1231
|
+
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
1232
|
+
sourceLine = decodeInteger(reader, sourceLine);
|
|
1233
|
+
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
1234
|
+
if (hasMoreVlq(reader, semi)) {
|
|
1235
|
+
namesIndex = decodeInteger(reader, namesIndex);
|
|
1236
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
|
|
1237
|
+
} else {
|
|
1238
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
|
|
1239
|
+
}
|
|
1240
|
+
} else {
|
|
1241
|
+
seg = [genColumn];
|
|
1242
|
+
}
|
|
1243
|
+
line.push(seg);
|
|
1244
|
+
reader.pos++;
|
|
1245
|
+
}
|
|
1246
|
+
if (!sorted)
|
|
1247
|
+
sort(line);
|
|
1248
|
+
decoded.push(line);
|
|
1249
|
+
reader.pos = semi + 1;
|
|
1250
|
+
} while (reader.pos <= length);
|
|
1251
|
+
return decoded;
|
|
1252
|
+
}
|
|
1253
|
+
function sort(line) {
|
|
1254
|
+
line.sort(sortComparator);
|
|
1255
|
+
}
|
|
1256
|
+
function sortComparator(a, b3) {
|
|
1257
|
+
return a[0] - b3[0];
|
|
1258
|
+
}
|
|
1259
|
+
var comma, semicolon, chars, intToChar, charToInt, bufLength, StringReader;
|
|
1260
|
+
var init_sourcemap_codec = __esm({
|
|
1261
|
+
"node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs"() {
|
|
1262
|
+
comma = ",".charCodeAt(0);
|
|
1263
|
+
semicolon = ";".charCodeAt(0);
|
|
1264
|
+
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1265
|
+
intToChar = new Uint8Array(64);
|
|
1266
|
+
charToInt = new Uint8Array(128);
|
|
1267
|
+
for (let i = 0; i < chars.length; i++) {
|
|
1268
|
+
const c = chars.charCodeAt(i);
|
|
1269
|
+
intToChar[i] = c;
|
|
1270
|
+
charToInt[c] = i;
|
|
1271
|
+
}
|
|
1272
|
+
bufLength = 1024 * 16;
|
|
1273
|
+
StringReader = class {
|
|
1274
|
+
constructor(buffer) {
|
|
1275
|
+
this.pos = 0;
|
|
1276
|
+
this.buffer = buffer;
|
|
1277
|
+
}
|
|
1278
|
+
next() {
|
|
1279
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
1280
|
+
}
|
|
1281
|
+
peek() {
|
|
1282
|
+
return this.buffer.charCodeAt(this.pos);
|
|
1283
|
+
}
|
|
1284
|
+
indexOf(char) {
|
|
1285
|
+
const { buffer, pos } = this;
|
|
1286
|
+
const idx = buffer.indexOf(char, pos);
|
|
1287
|
+
return idx === -1 ? buffer.length : idx;
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1224
1290
|
}
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1291
|
+
});
|
|
1292
|
+
|
|
1293
|
+
// node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
1294
|
+
function isAbsoluteUrl(input) {
|
|
1295
|
+
return schemeRegex.test(input);
|
|
1296
|
+
}
|
|
1297
|
+
function isSchemeRelativeUrl(input) {
|
|
1298
|
+
return input.startsWith("//");
|
|
1299
|
+
}
|
|
1300
|
+
function isAbsolutePath(input) {
|
|
1301
|
+
return input.startsWith("/");
|
|
1302
|
+
}
|
|
1303
|
+
function isFileUrl(input) {
|
|
1304
|
+
return input.startsWith("file:");
|
|
1305
|
+
}
|
|
1306
|
+
function isRelative(input) {
|
|
1307
|
+
return /^[.?#]/.test(input);
|
|
1308
|
+
}
|
|
1309
|
+
function parseAbsoluteUrl(input) {
|
|
1310
|
+
const match = urlRegex.exec(input);
|
|
1311
|
+
return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
|
|
1312
|
+
}
|
|
1313
|
+
function parseFileUrl(input) {
|
|
1314
|
+
const match = fileRegex.exec(input);
|
|
1315
|
+
const path3 = match[2];
|
|
1316
|
+
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path3) ? path3 : "/" + path3, match[3] || "", match[4] || "");
|
|
1317
|
+
}
|
|
1318
|
+
function makeUrl(scheme, user, host, port, path3, query, hash) {
|
|
1319
|
+
return {
|
|
1320
|
+
scheme,
|
|
1321
|
+
user,
|
|
1322
|
+
host,
|
|
1323
|
+
port,
|
|
1324
|
+
path: path3,
|
|
1325
|
+
query,
|
|
1326
|
+
hash,
|
|
1327
|
+
type: 7
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
function parseUrl(input) {
|
|
1331
|
+
if (isSchemeRelativeUrl(input)) {
|
|
1332
|
+
const url2 = parseAbsoluteUrl("http:" + input);
|
|
1333
|
+
url2.scheme = "";
|
|
1334
|
+
url2.type = 6;
|
|
1335
|
+
return url2;
|
|
1336
|
+
}
|
|
1337
|
+
if (isAbsolutePath(input)) {
|
|
1338
|
+
const url2 = parseAbsoluteUrl("http://foo.com" + input);
|
|
1339
|
+
url2.scheme = "";
|
|
1340
|
+
url2.host = "";
|
|
1341
|
+
url2.type = 5;
|
|
1342
|
+
return url2;
|
|
1343
|
+
}
|
|
1344
|
+
if (isFileUrl(input))
|
|
1345
|
+
return parseFileUrl(input);
|
|
1346
|
+
if (isAbsoluteUrl(input))
|
|
1347
|
+
return parseAbsoluteUrl(input);
|
|
1348
|
+
const url = parseAbsoluteUrl("http://foo.com/" + input);
|
|
1349
|
+
url.scheme = "";
|
|
1350
|
+
url.host = "";
|
|
1351
|
+
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
1352
|
+
return url;
|
|
1353
|
+
}
|
|
1354
|
+
function stripPathFilename(path3) {
|
|
1355
|
+
if (path3.endsWith("/.."))
|
|
1356
|
+
return path3;
|
|
1357
|
+
const index = path3.lastIndexOf("/");
|
|
1358
|
+
return path3.slice(0, index + 1);
|
|
1359
|
+
}
|
|
1360
|
+
function mergePaths(url, base) {
|
|
1361
|
+
normalizePath(base, base.type);
|
|
1362
|
+
if (url.path === "/") {
|
|
1363
|
+
url.path = base.path;
|
|
1364
|
+
} else {
|
|
1365
|
+
url.path = stripPathFilename(base.path) + url.path;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
function normalizePath(url, type) {
|
|
1369
|
+
const rel = type <= 4;
|
|
1370
|
+
const pieces = url.path.split("/");
|
|
1371
|
+
let pointer = 1;
|
|
1372
|
+
let positive = 0;
|
|
1373
|
+
let addTrailingSlash = false;
|
|
1374
|
+
for (let i = 1; i < pieces.length; i++) {
|
|
1375
|
+
const piece = pieces[i];
|
|
1376
|
+
if (!piece) {
|
|
1377
|
+
addTrailingSlash = true;
|
|
1378
|
+
continue;
|
|
1379
|
+
}
|
|
1380
|
+
addTrailingSlash = false;
|
|
1381
|
+
if (piece === ".")
|
|
1382
|
+
continue;
|
|
1383
|
+
if (piece === "..") {
|
|
1384
|
+
if (positive) {
|
|
1385
|
+
addTrailingSlash = true;
|
|
1386
|
+
positive--;
|
|
1387
|
+
pointer--;
|
|
1388
|
+
} else if (rel) {
|
|
1389
|
+
pieces[pointer++] = piece;
|
|
1390
|
+
}
|
|
1391
|
+
continue;
|
|
1245
1392
|
}
|
|
1393
|
+
pieces[pointer++] = piece;
|
|
1394
|
+
positive++;
|
|
1246
1395
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
);
|
|
1251
|
-
return null;
|
|
1396
|
+
let path3 = "";
|
|
1397
|
+
for (let i = 1; i < pointer; i++) {
|
|
1398
|
+
path3 += "/" + pieces[i];
|
|
1252
1399
|
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
);
|
|
1256
|
-
const relativeLine = generatedLine - matchingSection.offset.line;
|
|
1257
|
-
const relativeColumn = generatedLine === matchingSection.offset.line ? generatedColumn - matchingSection.offset.column : generatedColumn;
|
|
1258
|
-
console.log(
|
|
1259
|
-
`[SourceMap] Relative position: ${relativeLine}:${relativeColumn}`
|
|
1260
|
-
);
|
|
1261
|
-
if (!matchingSection.map) {
|
|
1262
|
-
console.log(
|
|
1263
|
-
`[SourceMap] Section ${matchingSectionIndex} has no embedded map (may have URL instead)`
|
|
1264
|
-
);
|
|
1265
|
-
return null;
|
|
1400
|
+
if (!path3 || addTrailingSlash && !path3.endsWith("/..")) {
|
|
1401
|
+
path3 += "/";
|
|
1266
1402
|
}
|
|
1267
|
-
|
|
1268
|
-
matchingSection.map,
|
|
1269
|
-
relativeLine,
|
|
1270
|
-
relativeColumn
|
|
1271
|
-
);
|
|
1403
|
+
url.path = path3;
|
|
1272
1404
|
}
|
|
1273
|
-
function
|
|
1274
|
-
if (
|
|
1275
|
-
return
|
|
1405
|
+
function resolve(input, base) {
|
|
1406
|
+
if (!input && !base)
|
|
1407
|
+
return "";
|
|
1408
|
+
const url = parseUrl(input);
|
|
1409
|
+
let inputType = url.type;
|
|
1410
|
+
if (base && inputType !== 7) {
|
|
1411
|
+
const baseUrl = parseUrl(base);
|
|
1412
|
+
const baseType = baseUrl.type;
|
|
1413
|
+
switch (inputType) {
|
|
1414
|
+
case 1:
|
|
1415
|
+
url.hash = baseUrl.hash;
|
|
1416
|
+
// fall through
|
|
1417
|
+
case 2:
|
|
1418
|
+
url.query = baseUrl.query;
|
|
1419
|
+
// fall through
|
|
1420
|
+
case 3:
|
|
1421
|
+
case 4:
|
|
1422
|
+
mergePaths(url, baseUrl);
|
|
1423
|
+
// fall through
|
|
1424
|
+
case 5:
|
|
1425
|
+
url.user = baseUrl.user;
|
|
1426
|
+
url.host = baseUrl.host;
|
|
1427
|
+
url.port = baseUrl.port;
|
|
1428
|
+
// fall through
|
|
1429
|
+
case 6:
|
|
1430
|
+
url.scheme = baseUrl.scheme;
|
|
1431
|
+
}
|
|
1432
|
+
if (baseType > inputType)
|
|
1433
|
+
inputType = baseType;
|
|
1434
|
+
}
|
|
1435
|
+
normalizePath(url, inputType);
|
|
1436
|
+
const queryHash = url.query + url.hash;
|
|
1437
|
+
switch (inputType) {
|
|
1438
|
+
// This is impossible, because of the empty checks at the start of the function.
|
|
1439
|
+
// case UrlType.Empty:
|
|
1440
|
+
case 2:
|
|
1441
|
+
case 3:
|
|
1442
|
+
return queryHash;
|
|
1443
|
+
case 4: {
|
|
1444
|
+
const path3 = url.path.slice(1);
|
|
1445
|
+
if (!path3)
|
|
1446
|
+
return queryHash || ".";
|
|
1447
|
+
if (isRelative(base || input) && !isRelative(path3)) {
|
|
1448
|
+
return "./" + path3 + queryHash;
|
|
1449
|
+
}
|
|
1450
|
+
return path3 + queryHash;
|
|
1451
|
+
}
|
|
1452
|
+
case 5:
|
|
1453
|
+
return url.path + queryHash;
|
|
1454
|
+
default:
|
|
1455
|
+
return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
|
|
1276
1456
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1457
|
+
}
|
|
1458
|
+
var schemeRegex, urlRegex, fileRegex;
|
|
1459
|
+
var init_resolve_uri = __esm({
|
|
1460
|
+
"node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs"() {
|
|
1461
|
+
schemeRegex = /^[\w+.-]+:\/\//;
|
|
1462
|
+
urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
1463
|
+
fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
1279
1464
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1465
|
+
});
|
|
1466
|
+
|
|
1467
|
+
// node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
1468
|
+
function resolve2(input, base) {
|
|
1469
|
+
if (base && !base.endsWith("/"))
|
|
1470
|
+
base += "/";
|
|
1471
|
+
return resolve(input, base);
|
|
1472
|
+
}
|
|
1473
|
+
function stripFilename(path3) {
|
|
1474
|
+
if (!path3)
|
|
1475
|
+
return "";
|
|
1476
|
+
const index = path3.lastIndexOf("/");
|
|
1477
|
+
return path3.slice(0, index + 1);
|
|
1478
|
+
}
|
|
1479
|
+
function maybeSort(mappings, owned) {
|
|
1480
|
+
const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
|
|
1481
|
+
if (unsortedIndex === mappings.length)
|
|
1482
|
+
return mappings;
|
|
1483
|
+
if (!owned)
|
|
1484
|
+
mappings = mappings.slice();
|
|
1485
|
+
for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
|
|
1486
|
+
mappings[i] = sortSegments(mappings[i], owned);
|
|
1487
|
+
}
|
|
1488
|
+
return mappings;
|
|
1489
|
+
}
|
|
1490
|
+
function nextUnsortedSegmentLine(mappings, start) {
|
|
1491
|
+
for (let i = start; i < mappings.length; i++) {
|
|
1492
|
+
if (!isSorted(mappings[i]))
|
|
1493
|
+
return i;
|
|
1494
|
+
}
|
|
1495
|
+
return mappings.length;
|
|
1496
|
+
}
|
|
1497
|
+
function isSorted(line) {
|
|
1498
|
+
for (let j2 = 1; j2 < line.length; j2++) {
|
|
1499
|
+
if (line[j2][COLUMN] < line[j2 - 1][COLUMN]) {
|
|
1500
|
+
return false;
|
|
1284
1501
|
}
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1502
|
+
}
|
|
1503
|
+
return true;
|
|
1504
|
+
}
|
|
1505
|
+
function sortSegments(line, owned) {
|
|
1506
|
+
if (!owned)
|
|
1507
|
+
line = line.slice();
|
|
1508
|
+
return line.sort(sortComparator2);
|
|
1509
|
+
}
|
|
1510
|
+
function sortComparator2(a, b3) {
|
|
1511
|
+
return a[COLUMN] - b3[COLUMN];
|
|
1512
|
+
}
|
|
1513
|
+
function binarySearch(haystack, needle, low, high) {
|
|
1514
|
+
while (low <= high) {
|
|
1515
|
+
const mid = low + (high - low >> 1);
|
|
1516
|
+
const cmp = haystack[mid][COLUMN] - needle;
|
|
1517
|
+
if (cmp === 0) {
|
|
1518
|
+
found = true;
|
|
1519
|
+
return mid;
|
|
1288
1520
|
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1521
|
+
if (cmp < 0) {
|
|
1522
|
+
low = mid + 1;
|
|
1523
|
+
} else {
|
|
1524
|
+
high = mid - 1;
|
|
1292
1525
|
}
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1526
|
+
}
|
|
1527
|
+
found = false;
|
|
1528
|
+
return low - 1;
|
|
1529
|
+
}
|
|
1530
|
+
function upperBound(haystack, needle, index) {
|
|
1531
|
+
for (let i = index + 1; i < haystack.length; index = i++) {
|
|
1532
|
+
if (haystack[i][COLUMN] !== needle)
|
|
1533
|
+
break;
|
|
1534
|
+
}
|
|
1535
|
+
return index;
|
|
1536
|
+
}
|
|
1537
|
+
function lowerBound(haystack, needle, index) {
|
|
1538
|
+
for (let i = index - 1; i >= 0; index = i--) {
|
|
1539
|
+
if (haystack[i][COLUMN] !== needle)
|
|
1540
|
+
break;
|
|
1541
|
+
}
|
|
1542
|
+
return index;
|
|
1543
|
+
}
|
|
1544
|
+
function memoizedState() {
|
|
1545
|
+
return {
|
|
1546
|
+
lastKey: -1,
|
|
1547
|
+
lastNeedle: -1,
|
|
1548
|
+
lastIndex: -1
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
1552
|
+
const { lastKey, lastNeedle, lastIndex } = state;
|
|
1553
|
+
let low = 0;
|
|
1554
|
+
let high = haystack.length - 1;
|
|
1555
|
+
if (key === lastKey) {
|
|
1556
|
+
if (needle === lastNeedle) {
|
|
1557
|
+
found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
|
|
1558
|
+
return lastIndex;
|
|
1559
|
+
}
|
|
1560
|
+
if (needle >= lastNeedle) {
|
|
1561
|
+
low = lastIndex === -1 ? 0 : lastIndex;
|
|
1562
|
+
} else {
|
|
1563
|
+
high = lastIndex;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
state.lastKey = key;
|
|
1567
|
+
state.lastNeedle = needle;
|
|
1568
|
+
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
1569
|
+
}
|
|
1570
|
+
function cast(map) {
|
|
1571
|
+
return map;
|
|
1572
|
+
}
|
|
1573
|
+
function decodedMappings(map) {
|
|
1574
|
+
var _a;
|
|
1575
|
+
return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
|
|
1576
|
+
}
|
|
1577
|
+
function originalPositionFor(map, needle) {
|
|
1578
|
+
let { line, column, bias } = needle;
|
|
1579
|
+
line--;
|
|
1580
|
+
if (line < 0)
|
|
1581
|
+
throw new Error(LINE_GTR_ZERO);
|
|
1582
|
+
if (column < 0)
|
|
1583
|
+
throw new Error(COL_GTR_EQ_ZERO);
|
|
1584
|
+
const decoded = decodedMappings(map);
|
|
1585
|
+
if (line >= decoded.length)
|
|
1586
|
+
return OMapping(null, null, null, null);
|
|
1587
|
+
const segments = decoded[line];
|
|
1588
|
+
const index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
|
|
1589
|
+
if (index === -1)
|
|
1590
|
+
return OMapping(null, null, null, null);
|
|
1591
|
+
const segment = segments[index];
|
|
1592
|
+
if (segment.length === 1)
|
|
1593
|
+
return OMapping(null, null, null, null);
|
|
1594
|
+
const { names, resolvedSources } = map;
|
|
1595
|
+
return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
|
|
1596
|
+
}
|
|
1597
|
+
function OMapping(source, line, column, name) {
|
|
1598
|
+
return { source, line, column, name };
|
|
1599
|
+
}
|
|
1600
|
+
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
1601
|
+
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
1602
|
+
if (found) {
|
|
1603
|
+
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
|
|
1604
|
+
} else if (bias === LEAST_UPPER_BOUND)
|
|
1605
|
+
index++;
|
|
1606
|
+
if (index === -1 || index === segments.length)
|
|
1607
|
+
return -1;
|
|
1608
|
+
return index;
|
|
1609
|
+
}
|
|
1610
|
+
var COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN, NAMES_INDEX, found, LINE_GTR_ZERO, COL_GTR_EQ_ZERO, LEAST_UPPER_BOUND, GREATEST_LOWER_BOUND, TraceMap;
|
|
1611
|
+
var init_trace_mapping = __esm({
|
|
1612
|
+
"node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs"() {
|
|
1613
|
+
init_sourcemap_codec();
|
|
1614
|
+
init_resolve_uri();
|
|
1615
|
+
COLUMN = 0;
|
|
1616
|
+
SOURCES_INDEX = 1;
|
|
1617
|
+
SOURCE_LINE = 2;
|
|
1618
|
+
SOURCE_COLUMN = 3;
|
|
1619
|
+
NAMES_INDEX = 4;
|
|
1620
|
+
found = false;
|
|
1621
|
+
LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
|
|
1622
|
+
COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
1623
|
+
LEAST_UPPER_BOUND = -1;
|
|
1624
|
+
GREATEST_LOWER_BOUND = 1;
|
|
1625
|
+
TraceMap = class {
|
|
1626
|
+
constructor(map, mapUrl) {
|
|
1627
|
+
const isString2 = typeof map === "string";
|
|
1628
|
+
if (!isString2 && map._decodedMemo)
|
|
1629
|
+
return map;
|
|
1630
|
+
const parsed = isString2 ? JSON.parse(map) : map;
|
|
1631
|
+
const { version: version4, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
1632
|
+
this.version = version4;
|
|
1633
|
+
this.file = file;
|
|
1634
|
+
this.names = names || [];
|
|
1635
|
+
this.sourceRoot = sourceRoot;
|
|
1636
|
+
this.sources = sources;
|
|
1637
|
+
this.sourcesContent = sourcesContent;
|
|
1638
|
+
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
|
1639
|
+
const from = resolve2(sourceRoot || "", stripFilename(mapUrl));
|
|
1640
|
+
this.resolvedSources = sources.map((s2) => resolve2(s2 || "", from));
|
|
1641
|
+
const { mappings } = parsed;
|
|
1642
|
+
if (typeof mappings === "string") {
|
|
1643
|
+
this._encoded = mappings;
|
|
1644
|
+
this._decoded = void 0;
|
|
1645
|
+
} else {
|
|
1646
|
+
this._encoded = void 0;
|
|
1647
|
+
this._decoded = maybeSort(mappings, isString2);
|
|
1323
1648
|
}
|
|
1649
|
+
this._decodedMemo = memoizedState();
|
|
1650
|
+
this._bySources = void 0;
|
|
1651
|
+
this._bySourceMemos = void 0;
|
|
1324
1652
|
}
|
|
1325
|
-
}
|
|
1326
|
-
if (!bestMatch) {
|
|
1327
|
-
return null;
|
|
1328
|
-
}
|
|
1329
|
-
if (!sourceMap.sources || !Array.isArray(sourceMap.sources)) {
|
|
1330
|
-
return null;
|
|
1331
|
-
}
|
|
1332
|
-
const source = sourceMap.sources[bestMatch.sourceFileIndex];
|
|
1333
|
-
if (!source) {
|
|
1334
|
-
return null;
|
|
1335
|
-
}
|
|
1336
|
-
let resolvedSource = source;
|
|
1337
|
-
if (sourceMap.sourceRoot) {
|
|
1338
|
-
resolvedSource = sourceMap.sourceRoot.replace(/\/$/, "") + "/" + source.replace(/^\//, "");
|
|
1339
|
-
}
|
|
1340
|
-
return {
|
|
1341
|
-
source: resolvedSource,
|
|
1342
|
-
line: bestMatch.sourceLineOffset + 1,
|
|
1343
|
-
column: bestMatch.sourceColumnOffset,
|
|
1344
|
-
name: bestMatch.nameIndex !== void 0 && sourceMap.names ? sourceMap.names[bestMatch.nameIndex] : void 0
|
|
1345
1653
|
};
|
|
1346
|
-
} catch (error) {
|
|
1347
|
-
console.error("[SourceMap] Error resolving position:", error);
|
|
1348
|
-
return null;
|
|
1349
1654
|
}
|
|
1655
|
+
});
|
|
1656
|
+
|
|
1657
|
+
// packages/dev-tools/server/source-map-resolver.ts
|
|
1658
|
+
function extractSourceMappingURL(content) {
|
|
1659
|
+
const lines = content.split("\n").slice(-10);
|
|
1660
|
+
for (const line of lines.reverse()) {
|
|
1661
|
+
const match = line.match(/\/\/[#@]\s*sourceMappingURL=(.+)/);
|
|
1662
|
+
if (match) {
|
|
1663
|
+
return match[1].trim();
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
return null;
|
|
1350
1667
|
}
|
|
1351
|
-
async function
|
|
1668
|
+
async function loadSourceMap(projectRoot, devServerUrl, bundledPath, sourceMappingURL) {
|
|
1352
1669
|
try {
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1670
|
+
if (sourceMappingURL.startsWith("data:")) {
|
|
1671
|
+
const base64Match = sourceMappingURL.match(
|
|
1672
|
+
/^data:application\/json;(?:charset=utf-8;)?base64,(.+)$/
|
|
1673
|
+
);
|
|
1674
|
+
if (base64Match) {
|
|
1675
|
+
return Buffer.from(base64Match[1], "base64").toString("utf-8");
|
|
1676
|
+
}
|
|
1677
|
+
console.error(
|
|
1678
|
+
`[SourceMap] Unsupported inline source map format: ${sourceMappingURL.substring(0, 50)}...`
|
|
1679
|
+
);
|
|
1680
|
+
return null;
|
|
1356
1681
|
}
|
|
1357
|
-
|
|
1682
|
+
const bundledDir = path2.dirname(bundledPath);
|
|
1683
|
+
const sourceMapPath = path2.join(bundledDir, sourceMappingURL);
|
|
1684
|
+
const sourceMapUrl = `${devServerUrl}${sourceMapPath.startsWith("/") ? sourceMapPath : "/" + sourceMapPath}`;
|
|
1685
|
+
console.log(`[SourceMap] Fetching source map from: ${sourceMapUrl}`);
|
|
1686
|
+
try {
|
|
1687
|
+
const response2 = await fetch(sourceMapUrl);
|
|
1688
|
+
if (response2.ok) {
|
|
1689
|
+
const content = await response2.text();
|
|
1690
|
+
console.log(
|
|
1691
|
+
`[SourceMap] Successfully fetched source map from dev server`
|
|
1692
|
+
);
|
|
1693
|
+
return content;
|
|
1694
|
+
}
|
|
1695
|
+
console.log(
|
|
1696
|
+
`[SourceMap] Failed to fetch from dev server: ${response2.status}`
|
|
1697
|
+
);
|
|
1698
|
+
} catch (fetchError) {
|
|
1699
|
+
console.log(
|
|
1700
|
+
`[SourceMap] Network error fetching from dev server:`,
|
|
1701
|
+
fetchError
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
const normalizedPath = sourceMappingURL.startsWith("/") ? sourceMappingURL.substring(1) : sourceMappingURL;
|
|
1358
1705
|
const possiblePaths = [
|
|
1359
|
-
path2.join(projectRoot, normalizedPath
|
|
1706
|
+
path2.join(projectRoot, bundledDir, normalizedPath),
|
|
1707
|
+
path2.join(projectRoot, normalizedPath),
|
|
1360
1708
|
path2.join(
|
|
1361
1709
|
projectRoot,
|
|
1362
|
-
".next",
|
|
1363
|
-
|
|
1364
|
-
normalizedPath.replace("_next/static/", "") + ".map"
|
|
1365
|
-
),
|
|
1366
|
-
path2.join(
|
|
1367
|
-
projectRoot,
|
|
1368
|
-
normalizedPath.replace("_next/", ".next/") + ".map"
|
|
1710
|
+
bundledDir.replace("_next/", ".next/"),
|
|
1711
|
+
normalizedPath
|
|
1369
1712
|
)
|
|
1370
1713
|
];
|
|
1371
|
-
console.log(`[SourceMap] Resolving: ${bundledPath}`);
|
|
1372
|
-
console.log(`[SourceMap] projectRoot: ${projectRoot}`);
|
|
1373
|
-
console.log(`[SourceMap] normalizedPath: ${normalizedPath}`);
|
|
1374
|
-
console.log(`[SourceMap] Trying paths:`, possiblePaths);
|
|
1375
1714
|
for (const possiblePath of possiblePaths) {
|
|
1376
|
-
console.log(
|
|
1377
|
-
`[SourceMap] Checking: ${possiblePath} - exists: ${fs.existsSync(possiblePath)}`
|
|
1378
|
-
);
|
|
1379
1715
|
if (fs.existsSync(possiblePath)) {
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1716
|
+
console.log(
|
|
1717
|
+
`[SourceMap] Reading source map from file: ${possiblePath}`
|
|
1718
|
+
);
|
|
1719
|
+
return fs.readFileSync(possiblePath, "utf-8");
|
|
1383
1720
|
}
|
|
1384
1721
|
}
|
|
1385
|
-
|
|
1722
|
+
console.error(
|
|
1723
|
+
`[SourceMap] Source map not found: ${sourceMappingURL} (tried ${possiblePaths.length} paths)`
|
|
1724
|
+
);
|
|
1725
|
+
return null;
|
|
1726
|
+
} catch (error) {
|
|
1727
|
+
console.error(`[SourceMap] Error loading source map:`, error);
|
|
1728
|
+
return null;
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
async function resolveSourceLocation(projectRoot, devServerUrl, bundledPath, line, column) {
|
|
1732
|
+
try {
|
|
1733
|
+
if (bundledPath.includes("file://") || bundledPath.includes("/Server/") || bundledPath.includes(".next/server/") || bundledPath.includes("_next/server/")) {
|
|
1386
1734
|
console.log(
|
|
1387
|
-
`[SourceMap]
|
|
1735
|
+
`[SourceMap] Skipping invalid/server-side path: ${bundledPath}`
|
|
1388
1736
|
);
|
|
1389
1737
|
return null;
|
|
1390
1738
|
}
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
);
|
|
1401
|
-
sourceMapCache.set(cacheKey, null);
|
|
1402
|
-
return null;
|
|
1403
|
-
}
|
|
1404
|
-
if (!sourceMap.mappings && !sourceMap.sections) {
|
|
1405
|
-
console.error(
|
|
1406
|
-
`[SourceMap] Source map missing 'mappings' or 'sections' field in ${sourceMapPath}`
|
|
1407
|
-
);
|
|
1408
|
-
console.error(
|
|
1409
|
-
`[SourceMap] Available fields:`,
|
|
1410
|
-
Object.keys(sourceMap)
|
|
1411
|
-
);
|
|
1412
|
-
sourceMapCache.set(cacheKey, null);
|
|
1413
|
-
return null;
|
|
1414
|
-
}
|
|
1415
|
-
if (sourceMap.mappings && (!sourceMap.sources || !Array.isArray(sourceMap.sources))) {
|
|
1416
|
-
console.error(
|
|
1417
|
-
`[SourceMap] Standard source map missing 'sources' field in ${sourceMapPath}`
|
|
1418
|
-
);
|
|
1419
|
-
sourceMapCache.set(cacheKey, null);
|
|
1420
|
-
return null;
|
|
1421
|
-
}
|
|
1422
|
-
sourceMapCache.set(cacheKey, sourceMap);
|
|
1423
|
-
} catch (error) {
|
|
1739
|
+
console.log(`[SourceMap] Resolving: ${bundledPath} at ${line}:${column}`);
|
|
1740
|
+
console.log(`[SourceMap] Dev server URL: ${devServerUrl}`);
|
|
1741
|
+
console.log(`[SourceMap] Project root: ${projectRoot}`);
|
|
1742
|
+
const fileUrl = `${devServerUrl}${bundledPath.startsWith("/") ? bundledPath : "/" + bundledPath}`;
|
|
1743
|
+
console.log(`[SourceMap] Fetching JS file from: ${fileUrl}`);
|
|
1744
|
+
let jsContent;
|
|
1745
|
+
try {
|
|
1746
|
+
const response2 = await fetch(fileUrl);
|
|
1747
|
+
if (!response2.ok) {
|
|
1424
1748
|
console.error(
|
|
1425
|
-
`[SourceMap]
|
|
1426
|
-
error
|
|
1749
|
+
`[SourceMap] Failed to fetch JS file: ${response2.status} ${response2.statusText}`
|
|
1427
1750
|
);
|
|
1428
|
-
sourceMapCache.set(cacheKey, null);
|
|
1429
1751
|
return null;
|
|
1430
1752
|
}
|
|
1753
|
+
jsContent = await response2.text();
|
|
1754
|
+
console.log(`[SourceMap] Fetched JS file (${jsContent.length} bytes)`);
|
|
1755
|
+
} catch (fetchError) {
|
|
1756
|
+
console.error(`[SourceMap] Network error fetching JS file:`, fetchError);
|
|
1757
|
+
return null;
|
|
1431
1758
|
}
|
|
1432
|
-
|
|
1759
|
+
const sourceMappingURL = extractSourceMappingURL(jsContent);
|
|
1760
|
+
if (!sourceMappingURL) {
|
|
1761
|
+
console.error(`[SourceMap] No sourceMappingURL found in ${bundledPath}`);
|
|
1433
1762
|
return null;
|
|
1434
1763
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1764
|
+
console.log(`[SourceMap] Found sourceMappingURL: ${sourceMappingURL}`);
|
|
1765
|
+
const cacheKey = `${bundledPath}:${sourceMappingURL}`;
|
|
1766
|
+
let tracer = traceMapCache.get(cacheKey);
|
|
1767
|
+
if (tracer === void 0) {
|
|
1768
|
+
const sourceMapContent = await loadSourceMap(
|
|
1769
|
+
projectRoot,
|
|
1770
|
+
devServerUrl,
|
|
1771
|
+
bundledPath,
|
|
1772
|
+
sourceMappingURL
|
|
1442
1773
|
);
|
|
1774
|
+
if (!sourceMapContent) {
|
|
1775
|
+
traceMapCache.set(cacheKey, null);
|
|
1776
|
+
return null;
|
|
1777
|
+
}
|
|
1778
|
+
try {
|
|
1779
|
+
const sourceMapJson = JSON.parse(sourceMapContent);
|
|
1780
|
+
tracer = new TraceMap(sourceMapJson);
|
|
1781
|
+
traceMapCache.set(cacheKey, tracer);
|
|
1782
|
+
console.log(`[SourceMap] Created TraceMap for ${bundledPath}`);
|
|
1783
|
+
} catch (parseError) {
|
|
1784
|
+
console.error(`[SourceMap] Error parsing source map:`, parseError);
|
|
1785
|
+
traceMapCache.set(cacheKey, null);
|
|
1786
|
+
return null;
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
if (!tracer) {
|
|
1443
1790
|
return null;
|
|
1444
1791
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1792
|
+
const original = originalPositionFor(tracer, {
|
|
1793
|
+
line,
|
|
1794
|
+
column
|
|
1795
|
+
});
|
|
1796
|
+
if (!original || !original.source || original.line === null || original.column === null) {
|
|
1797
|
+
console.log(
|
|
1798
|
+
`[SourceMap] Could not resolve position ${line}:${column} in ${bundledPath}`
|
|
1799
|
+
);
|
|
1800
|
+
return null;
|
|
1801
|
+
}
|
|
1802
|
+
let cleanSource = original.source;
|
|
1803
|
+
if (cleanSource.startsWith("webpack://")) {
|
|
1804
|
+
cleanSource = cleanSource.replace(/^webpack:\/\/[^/]*\//, "");
|
|
1805
|
+
}
|
|
1806
|
+
if (cleanSource.startsWith("./")) {
|
|
1807
|
+
cleanSource = cleanSource.substring(2);
|
|
1808
|
+
}
|
|
1809
|
+
if (cleanSource.startsWith("file://")) {
|
|
1810
|
+
cleanSource = decodeURIComponent(cleanSource.replace(/^file:\/\//, ""));
|
|
1811
|
+
if (cleanSource.startsWith(projectRoot)) {
|
|
1812
|
+
cleanSource = cleanSource.substring(projectRoot.length);
|
|
1813
|
+
if (cleanSource.startsWith("/")) {
|
|
1814
|
+
cleanSource = cleanSource.substring(1);
|
|
1815
|
+
}
|
|
1451
1816
|
}
|
|
1452
1817
|
}
|
|
1453
|
-
|
|
1818
|
+
const result = {
|
|
1819
|
+
source: cleanSource,
|
|
1820
|
+
line: original.line,
|
|
1821
|
+
column: original.column,
|
|
1822
|
+
name: original.name || void 0
|
|
1823
|
+
};
|
|
1824
|
+
console.log(
|
|
1825
|
+
`[SourceMap] Resolved to: ${result.source}:${result.line}:${result.column}`
|
|
1826
|
+
);
|
|
1827
|
+
return result;
|
|
1454
1828
|
} catch (error) {
|
|
1455
|
-
console.error(
|
|
1829
|
+
console.error(`[SourceMap] Error resolving source location:`, error);
|
|
1456
1830
|
return null;
|
|
1457
1831
|
}
|
|
1458
1832
|
}
|
|
1459
|
-
async function batchResolveSourceLocations(projectRoot, locations) {
|
|
1833
|
+
async function batchResolveSourceLocations(projectRoot, devServerUrl, locations) {
|
|
1460
1834
|
const results = [];
|
|
1461
1835
|
for (const loc of locations) {
|
|
1462
1836
|
const resolved = await resolveSourceLocation(
|
|
1463
1837
|
projectRoot,
|
|
1838
|
+
devServerUrl,
|
|
1464
1839
|
loc.bundledPath,
|
|
1465
1840
|
loc.line,
|
|
1466
1841
|
loc.column
|
|
@@ -1469,22 +1844,14 @@ async function batchResolveSourceLocations(projectRoot, locations) {
|
|
|
1469
1844
|
}
|
|
1470
1845
|
return results;
|
|
1471
1846
|
}
|
|
1472
|
-
var fs, path2,
|
|
1847
|
+
var fs, path2, traceMapCache;
|
|
1473
1848
|
var init_source_map_resolver = __esm({
|
|
1474
1849
|
"packages/dev-tools/server/source-map-resolver.ts"() {
|
|
1475
1850
|
"use strict";
|
|
1851
|
+
init_trace_mapping();
|
|
1476
1852
|
fs = __toESM(require("fs"), 1);
|
|
1477
1853
|
path2 = __toESM(require("path"), 1);
|
|
1478
|
-
|
|
1479
|
-
VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
1480
|
-
VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
1481
|
-
VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
1482
|
-
BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1483
|
-
BASE64_MAP = {};
|
|
1484
|
-
for (let i = 0; i < BASE64_CHARS.length; i++) {
|
|
1485
|
-
BASE64_MAP[BASE64_CHARS[i]] = i;
|
|
1486
|
-
}
|
|
1487
|
-
sourceMapCache = /* @__PURE__ */ new Map();
|
|
1854
|
+
traceMapCache = /* @__PURE__ */ new Map();
|
|
1488
1855
|
}
|
|
1489
1856
|
});
|
|
1490
1857
|
|
|
@@ -1613,14 +1980,17 @@ async function handleDevApiRequest(ctx, apiReq) {
|
|
|
1613
1980
|
}
|
|
1614
1981
|
case "resolveSourceMap": {
|
|
1615
1982
|
const projectRoot = ctx.getAppRootDir();
|
|
1983
|
+
const devServerUrl = "http://localhost:3000";
|
|
1616
1984
|
if (Array.isArray(apiReq.data)) {
|
|
1617
1985
|
result.data = await batchResolveSourceLocations(
|
|
1618
1986
|
projectRoot,
|
|
1987
|
+
devServerUrl,
|
|
1619
1988
|
apiReq.data
|
|
1620
1989
|
);
|
|
1621
1990
|
} else {
|
|
1622
1991
|
result.data = await resolveSourceLocation(
|
|
1623
1992
|
projectRoot,
|
|
1993
|
+
devServerUrl,
|
|
1624
1994
|
apiReq.data.bundledPath,
|
|
1625
1995
|
apiReq.data.line,
|
|
1626
1996
|
apiReq.data.column
|
|
@@ -1732,7 +2102,7 @@ var init_dev_tools_api = __esm({
|
|
|
1732
2102
|
|
|
1733
2103
|
// packages/dev-tools/server/client-script.ts
|
|
1734
2104
|
async function getClientScript(ctx) {
|
|
1735
|
-
return updateClientRuntimeVariables(ctx, '"use strict";\n(() => {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n };\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. "__esModule" has not been set), then set\n // "default" to the CommonJS "module.exports" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,\n mod\n ));\n\n // node_modules/@amplitude/ua-parser-js/src/ua-parser.js\n var require_ua_parser = __commonJS({\n "node_modules/@amplitude/ua-parser-js/src/ua-parser.js"(exports, module) {\n (function(window2, undefined2) {\n "use strict";\n var LIBVERSION = "0.7.33", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION2 = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 350;\n var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook";\n var extend = function(regexes2, extensions) {\n var mergedRegexes = {};\n for (var i in regexes2) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes2[i]);\n } else {\n mergedRegexes[i] = regexes2[i];\n }\n }\n return mergedRegexes;\n }, enumerize = function(arr) {\n var enums = {};\n for (var i = 0; i < arr.length; i++) {\n enums[arr[i].toUpperCase()] = arr[i];\n }\n return enums;\n }, has = function(str1, str2) {\n return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n }, lowerize = function(str) {\n return str.toLowerCase();\n }, majorize = function(version) {\n return typeof version === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split(".")[0] : undefined2;\n }, trim = function(str, len) {\n if (typeof str === STR_TYPE) {\n str = str.replace(/^\\s\\s*/, EMPTY);\n return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n }\n };\n var rgxMapper = function(ua, arrays) {\n var i = 0, j, k, p, q, matches, match;\n while (i < arrays.length && !matches) {\n var regex = arrays[i], props = arrays[i + 1];\n j = k = 0;\n while (j < regex.length && !matches) {\n matches = regex[j++].exec(ua);\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length === 2) {\n if (typeof q[1] == FUNC_TYPE) {\n this[q[0]] = q[1].call(this, match);\n } else {\n this[q[0]] = q[1];\n }\n } else if (q.length === 3) {\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;\n } else {\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;\n }\n } else if (q.length === 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;\n }\n } else {\n this[q] = match ? match : undefined2;\n }\n }\n }\n }\n i += 2;\n }\n }, strMapper = function(str, map) {\n for (var i in map) {\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (has(map[i][j], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n } else if (has(map[i], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n return str;\n };\n var oldSafariMap = {\n "1.0": "/8",\n 1.2: "/1",\n 1.3: "/3",\n "2.0": "/412",\n "2.0.2": "/416",\n "2.0.3": "/417",\n "2.0.4": "/419",\n "?": "/"\n }, windowsVersionMap = {\n ME: "4.90",\n "NT 3.11": "NT3.51",\n "NT 4.0": "NT4.0",\n 2e3: "NT 5.0",\n XP: ["NT 5.1", "NT 5.2"],\n Vista: "NT 6.0",\n 7: "NT 6.1",\n 8: "NT 6.2",\n 8.1: "NT 6.3",\n 10: ["NT 6.4", "NT 10.0"],\n RT: "ARM"\n };\n var regexes = {\n browser: [\n [\n /\\b(?:crmo|crios)\\/([\\w\\.]+)/i\n // Chrome for Android/iOS\n ],\n [VERSION2, [NAME, "Chrome"]],\n [\n /edg(?:e|ios|a)?\\/([\\w\\.]+)/i\n // Microsoft Edge\n ],\n [VERSION2, [NAME, "Edge"]],\n [\n // Presto based\n /(opera mini)\\/([-\\w\\.]+)/i,\n // Opera Mini\n /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,\n // Opera Mobi/Tablet\n /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i\n // Opera\n ],\n [NAME, VERSION2],\n [\n /opios[\\/ ]+([\\w\\.]+)/i\n // Opera mini on iphone >= 8.0\n ],\n [VERSION2, [NAME, OPERA + " Mini"]],\n [\n /\\bopr\\/([\\w\\.]+)/i\n // Opera Webkit\n ],\n [VERSION2, [NAME, OPERA]],\n [\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,\n // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,\n // Avant/IEMobile/SlimBrowser\n /(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,\n // Baidu Browser\n /(?:ms|\\()(ie) ([\\w\\.]+)/i,\n // Internet Explorer\n // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,\n // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n /(weibo)__([\\d\\.]+)/i\n // Weibo\n ],\n [NAME, VERSION2],\n [\n /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i\n // UCBrowser\n ],\n [VERSION2, [NAME, "UC" + BROWSER]],\n [\n /microm.+\\bqbcore\\/([\\w\\.]+)/i,\n // WeChat Desktop for Windows Built-in Browser\n /\\bqbcore\\/([\\w\\.]+).+microm/i\n ],\n [VERSION2, [NAME, "WeChat(Win) Desktop"]],\n [\n /micromessenger\\/([\\w\\.]+)/i\n // WeChat\n ],\n [VERSION2, [NAME, "WeChat"]],\n [\n /konqueror\\/([\\w\\.]+)/i\n // Konqueror\n ],\n [VERSION2, [NAME, "Konqueror"]],\n [\n /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i\n // IE11\n ],\n [VERSION2, [NAME, "IE"]],\n [\n /yabrowser\\/([\\w\\.]+)/i\n // Yandex\n ],\n [VERSION2, [NAME, "Yandex"]],\n [\n /(avast|avg)\\/([\\w\\.]+)/i\n // Avast/AVG Secure Browser\n ],\n [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION2],\n [\n /\\bfocus\\/([\\w\\.]+)/i\n // Firefox Focus\n ],\n [VERSION2, [NAME, FIREFOX + " Focus"]],\n [\n /\\bopt\\/([\\w\\.]+)/i\n // Opera Touch\n ],\n [VERSION2, [NAME, OPERA + " Touch"]],\n [\n /coc_coc\\w+\\/([\\w\\.]+)/i\n // Coc Coc Browser\n ],\n [VERSION2, [NAME, "Coc Coc"]],\n [\n /dolfin\\/([\\w\\.]+)/i\n // Dolphin\n ],\n [VERSION2, [NAME, "Dolphin"]],\n [\n /coast\\/([\\w\\.]+)/i\n // Opera Coast\n ],\n [VERSION2, [NAME, OPERA + " Coast"]],\n [\n /miuibrowser\\/([\\w\\.]+)/i\n // MIUI Browser\n ],\n [VERSION2, [NAME, "MIUI " + BROWSER]],\n [\n /fxios\\/([-\\w\\.]+)/i\n // Firefox for iOS\n ],\n [VERSION2, [NAME, FIREFOX]],\n [\n /\\bqihu|(qi?ho?o?|360)browser/i\n // 360\n ],\n [[NAME, "360 " + BROWSER]],\n [/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],\n [[NAME, /(.+)/, "$1 " + BROWSER], VERSION2],\n [\n // Oculus/Samsung/Sailfish/Huawei Browser\n /(comodo_dragon)\\/([\\w\\.]+)/i\n // Comodo Dragon\n ],\n [[NAME, /_/g, " "], VERSION2],\n [\n /(electron)\\/([\\w\\.]+) safari/i,\n // Electron-based App\n /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,\n // Tesla\n /m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i\n // QQBrowser/Baidu App/2345 Browser\n ],\n [NAME, VERSION2],\n [\n /(metasr)[\\/ ]?([\\w\\.]+)/i,\n // SouGouBrowser\n /(lbbrowser)/i,\n // LieBao Browser\n /\\[(linkedin)app\\]/i\n // LinkedIn App for iOS & Android\n ],\n [NAME],\n [\n // WebView\n /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i\n // Facebook App for iOS & Android\n ],\n [[NAME, FACEBOOK], VERSION2],\n [\n /safari (line)\\/([\\w\\.]+)/i,\n // Line App for iOS\n /\\b(line)\\/([\\w\\.]+)\\/iab/i,\n // Line App for Android\n /(chromium|instagram)[\\/ ]([-\\w\\.]+)/i\n // Chromium/Instagram\n ],\n [NAME, VERSION2],\n [\n /\\bgsa\\/([\\w\\.]+) .*safari\\//i\n // Google Search Appliance on iOS\n ],\n [VERSION2, [NAME, "GSA"]],\n [\n /headlesschrome(?:\\/([\\w\\.]+)| )/i\n // Chrome Headless\n ],\n [VERSION2, [NAME, CHROME + " Headless"]],\n [\n / wv\\).+(chrome)\\/([\\w\\.]+)/i\n // Chrome WebView\n ],\n [[NAME, CHROME + " WebView"], VERSION2],\n [\n /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i\n // Android Browser\n ],\n [VERSION2, [NAME, "Android " + BROWSER]],\n [\n /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i\n // Chrome/OmniWeb/Arora/Tizen/Nokia\n ],\n [NAME, VERSION2],\n [\n /version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i\n // Mobile Safari\n ],\n [VERSION2, [NAME, "Mobile Safari"]],\n [\n /version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i\n // Safari & Safari Mobile\n ],\n [VERSION2, NAME],\n [\n /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i\n // Safari < 3.0\n ],\n [NAME, [VERSION2, strMapper, oldSafariMap]],\n [/(webkit|khtml)\\/([\\w\\.]+)/i],\n [NAME, VERSION2],\n [\n // Gecko based\n /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i\n // Netscape\n ],\n [[NAME, "Netscape"], VERSION2],\n [\n /mobile vr; rv:([\\w\\.]+)\\).+firefox/i\n // Firefox Reality\n ],\n [VERSION2, [NAME, FIREFOX + " Reality"]],\n [\n /ekiohf.+(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(swiftfox)/i,\n // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(firefox)\\/([\\w\\.]+)/i,\n // Other Firefox-based\n /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,\n // Mozilla\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n /(links) \\(([\\w\\.]+)/i\n // Links\n ],\n [NAME, VERSION2],\n [\n /(cobalt)\\/([\\w\\.]+)/i\n // Cobalt\n ],\n [NAME, [VERSION2, /master.|lts./, ""]]\n ],\n cpu: [\n [\n /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i\n // AMD64 (x64)\n ],\n [[ARCHITECTURE, "amd64"]],\n [\n /(ia32(?=;))/i\n // IA32 (quicktime)\n ],\n [[ARCHITECTURE, lowerize]],\n [\n /((?:i[346]|x)86)[;\\)]/i\n // IA32 (x86)\n ],\n [[ARCHITECTURE, "ia32"]],\n [\n /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i\n // ARM64\n ],\n [[ARCHITECTURE, "arm64"]],\n [\n /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i\n // ARMHF\n ],\n [[ARCHITECTURE, "armhf"]],\n [\n // PocketPC mistakenly identified as PowerPC\n /windows (ce|mobile); ppc;/i\n ],\n [[ARCHITECTURE, "arm"]],\n [\n /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i\n // PowerPC\n ],\n [[ARCHITECTURE, /ower/, EMPTY, lowerize]],\n [\n /(sun4\\w)[;\\)]/i\n // SPARC\n ],\n [[ARCHITECTURE, "sparc"]],\n [\n /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ],\n [[ARCHITECTURE, lowerize]]\n ],\n device: [\n [\n //////////////////////////\n // MOBILES & TABLETS\n // Ordered by popularity\n /////////////////////////\n // Samsung\n /\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]],\n [\n /\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,\n /samsung[- ]([-\\w]+)/i,\n /sec-(sgh\\w+)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]],\n [\n // Apple\n /((ipod|iphone)\\d+,\\d+)/i\n // iPod/iPhone model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /(ipad\\d+,\\d+)/i\n // iPad model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [\n /\\((ip(?:hone|od)[\\w ]*);/i\n // iPod/iPhone\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /\\((ipad);[-\\w\\),; ]+apple/i,\n // iPad\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [/(macintosh);/i],\n [MODEL, [VENDOR, APPLE]],\n [\n // Huawei\n /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]],\n [\n /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n /\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]],\n [\n // Xiaomi\n /\\b(poco[\\w ]+)(?: bui|\\))/i,\n // Xiaomi POCO\n /\\b; (\\w+) build\\/hm\\1/i,\n // Xiaomi Hongmi \'numeric\' models\n /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,\n // Xiaomi Hongmi\n /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,\n // Xiaomi Redmi\n /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i\n // Xiaomi Mi\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, MOBILE]\n ],\n [\n /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i\n // Mi Pad tablets\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, TABLET]\n ],\n [\n // OPPO\n /; (\\w+) bui.+ oppo/i,\n /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i\n ],\n [MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]],\n [\n // Vivo\n /vivo (\\w+)(?: bui|\\))/i,\n /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n ],\n [MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]],\n [\n // Realme\n /\\b(rmx[12]\\d{3})(?: bui|;|\\))/i\n ],\n [MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]],\n [\n // Motorola\n /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n /\\bmot(?:orola)?[- ](\\w*)/i,\n /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n ],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]],\n [/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]],\n [\n // LG\n /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, TABLET]],\n [\n /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n /\\blg-?([\\d\\w]+) bui/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, MOBILE]],\n [\n // Lenovo\n /(ideatab[-\\w ]+)/i,\n /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n ],\n [MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]],\n [\n // Nokia\n /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n /nokia[-_ ]?([-\\w\\.]*)/i\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, "Nokia"],\n [TYPE, MOBILE]\n ],\n [\n // Google\n /(pixel c)\\b/i\n // Google Pixel C\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]],\n [\n /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i\n // Google Pixel\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]],\n [\n // Sony\n /droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ],\n [MODEL, [VENDOR, SONY], [TYPE, MOBILE]],\n [/sony tablet [ps]/i, /\\b(?:sony)?sgp\\w+(?: bui|\\))/i],\n [\n [MODEL, "Xperia Tablet"],\n [VENDOR, SONY],\n [TYPE, TABLET]\n ],\n [\n // OnePlus\n / (kb2005|in20[12]5|be20[12][59])\\b/i,\n /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n ],\n [MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]],\n [\n // Amazon\n /(alexa)webm/i,\n /(kf[a-z]{2}wi)( bui|\\))/i,\n // Kindle Fire without Silk\n /(kf[a-z]+)( bui|\\)).+silk\\//i\n // Kindle Fire HD\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]],\n [\n /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i\n // Fire Phone\n ],\n [\n [MODEL, /(.+)/g, "Fire Phone $1"],\n [VENDOR, AMAZON],\n [TYPE, MOBILE]\n ],\n [\n // BlackBerry\n /(playbook);[-\\w\\),; ]+(rim)/i\n // BlackBerry PlayBook\n ],\n [MODEL, VENDOR, [TYPE, TABLET]],\n [\n /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n /\\(bb10; (\\w+)/i\n // BlackBerry 10\n ],\n [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]],\n [\n // Asus\n /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n ],\n [MODEL, [VENDOR, ASUS], [TYPE, TABLET]],\n [/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],\n [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]],\n [\n // HTC\n /(nexus 9)/i\n // HTC Nexus 9\n ],\n [MODEL, [VENDOR, "HTC"], [TYPE, TABLET]],\n [\n /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,\n // HTC\n // ZTE\n /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n /(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i\n // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ],\n [VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]],\n [\n // Acer\n /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n ],\n [MODEL, [VENDOR, "Acer"], [TYPE, TABLET]],\n [\n // Meizu\n /droid.+; (m[1-5] note) bui/i,\n /\\bmz-([-\\w]{2,})/i\n ],\n [MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]],\n [\n // Sharp\n /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]],\n [\n // MIXED\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,\n // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp) ([\\w ]+\\w)/i,\n // HP iPAQ\n /(asus)-?(\\w+)/i,\n // Asus\n /(microsoft); (lumia[\\w ]+)/i,\n // Microsoft Lumia\n /(lenovo)[-_ ]?([-\\w]+)/i,\n // Lenovo\n /(jolla)/i,\n // Jolla\n /(oppo) ?([\\w ]+) bui/i\n // OPPO\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(archos) (gamepad2?)/i,\n // Archos\n /(hp).+(touchpad(?!.+tablet)|tablet)/i,\n // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(nook)[\\w ]+build\\/(\\w+)/i,\n // Nook\n /(dell) (strea[kpr\\d ]*[\\dko])/i,\n // Dell Streak\n /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,\n // Le Pan Tablets\n /(trinity)[- ]*(t\\d{3}) bui/i,\n // Trinity Tablets\n /(gigaset)[- ]+(q\\w{1,9}) bui/i,\n // Gigaset Tablets\n /(vodafone) ([\\w ]+)(?:\\)| bui)/i\n // Vodafone\n ],\n [VENDOR, MODEL, [TYPE, TABLET]],\n [\n /(surface duo)/i\n // Surface Duo\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]],\n [\n /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i\n // Fairphone\n ],\n [MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]],\n [\n /(u304aa)/i\n // AT&T\n ],\n [MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]],\n [\n /\\bsie-(\\w*)/i\n // Siemens\n ],\n [MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]],\n [\n /\\b(rct\\w+) b/i\n // RCA Tablets\n ],\n [MODEL, [VENDOR, "RCA"], [TYPE, TABLET]],\n [\n /\\b(venue[\\d ]{2,7}) b/i\n // Dell Venue Tablets\n ],\n [MODEL, [VENDOR, "Dell"], [TYPE, TABLET]],\n [\n /\\b(q(?:mv|ta)\\w+) b/i\n // Verizon Tablet\n ],\n [MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]],\n [\n /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i\n // Barnes & Noble Tablet\n ],\n [MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]],\n [/\\b(tm\\d{3}\\w+) b/i],\n [MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]],\n [\n /\\b(k88) b/i\n // ZTE K Series Tablet\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]],\n [\n /\\b(nx\\d{3}j) b/i\n // ZTE Nubia\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]],\n [\n /\\b(gen\\d{3}) b.+49h/i\n // Swiss GEN Mobile\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]],\n [\n /\\b(zur\\d{3}) b/i\n // Swiss ZUR Tablet\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]],\n [\n /\\b((zeki)?tb.*\\b) b/i\n // Zeki Tablets\n ],\n [MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]],\n [\n /\\b([yr]\\d{2}) b/i,\n /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i\n // Dragon Touch Tablet\n ],\n [[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]],\n [\n /\\b(ns-?\\w{0,9}) b/i\n // Insignia Tablets\n ],\n [MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]],\n [\n /\\b((nxa|next)-?\\w{0,9}) b/i\n // NextBook Tablets\n ],\n [MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]],\n [\n /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i\n // Voice Xtreme Phones\n ],\n [[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(lvtel\\-)?(v1[12]) b/i\n // LvTel Phones\n ],\n [[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(ph-1) /i\n // Essential PH-1\n ],\n [MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]],\n [\n /\\b(v(100md|700na|7011|917g).*\\b) b/i\n // Envizen Tablets\n ],\n [MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]],\n [\n /\\b(trio[-\\w\\. ]+) b/i\n // MachSpeed Tablets\n ],\n [MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]],\n [\n /\\btu_(1491) b/i\n // Rotor Tablets\n ],\n [MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]],\n [\n /(shield[\\w ]+) b/i\n // Nvidia Shield Tablets\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]],\n [\n /(sprint) (\\w+)/i\n // Sprint Phones\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(kin\\.[onetw]{3})/i\n // Microsoft Kin\n ],\n [\n [MODEL, /\\./g, " "],\n [VENDOR, MICROSOFT],\n [TYPE, MOBILE]\n ],\n [\n /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i\n // Zebra\n ],\n [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]],\n [/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]],\n [\n ///////////////////\n // CONSOLES\n ///////////////////\n /(ouya)/i,\n // Ouya\n /(nintendo) ([wids3utch]+)/i\n // Nintendo\n ],\n [VENDOR, MODEL, [TYPE, CONSOLE]],\n [\n /droid.+; (shield) bui/i\n // Nvidia\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]],\n [\n /(playstation [345portablevi]+)/i\n // Playstation\n ],\n [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]],\n [\n /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i\n // Microsoft Xbox\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]],\n [\n ///////////////////\n // SMARTTVS\n ///////////////////\n /smart-tv.+(samsung)/i\n // Samsung\n ],\n [VENDOR, [TYPE, SMARTTV]],\n [/hbbtv.+maple;(\\d+)/i],\n [\n [MODEL, /^/, "SmartTV"],\n [VENDOR, SAMSUNG],\n [TYPE, SMARTTV]\n ],\n [\n /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i\n // LG SmartTV\n ],\n [\n [VENDOR, LG],\n [TYPE, SMARTTV]\n ],\n [\n /(apple) ?tv/i\n // Apple TV\n ],\n [VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]],\n [\n /crkey/i\n // Google Chromecast\n ],\n [\n [MODEL, CHROME + "cast"],\n [VENDOR, GOOGLE],\n [TYPE, SMARTTV]\n ],\n [\n /droid.+aft(\\w)( bui|\\))/i\n // Fire TV\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]],\n [\n /\\(dtv[\\);].+(aquos)/i,\n /(aquos-tv[\\w ]+)\\)/i\n // Sharp\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],\n [\n /(bravia[\\w ]+)( bui|\\))/i\n // Sony\n ],\n [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]],\n [\n /(mitv-\\w{5}) bui/i\n // Xiaomi\n ],\n [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]],\n [\n /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,\n // Roku\n /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i\n // HbbTV devices\n ],\n [\n [VENDOR, trim],\n [MODEL, trim],\n [TYPE, SMARTTV]\n ],\n [\n /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i\n // SmartTV from Unidentified Vendors\n ],\n [[TYPE, SMARTTV]],\n [\n ///////////////////\n // WEARABLES\n ///////////////////\n /((pebble))app/i\n // Pebble\n ],\n [VENDOR, MODEL, [TYPE, WEARABLE]],\n [\n /droid.+; (glass) \\d/i\n // Google Glass\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]],\n [/droid.+; (wt63?0{2,3})\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]],\n [\n /(quest( 2)?)/i\n // Oculus Quest\n ],\n [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]],\n [\n ///////////////////\n // EMBEDDED\n ///////////////////\n /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i\n // Tesla\n ],\n [VENDOR, [TYPE, EMBEDDED]],\n [\n ////////////////////\n // MIXED (GENERIC)\n ///////////////////\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i\n // Android Phones from Unidentified Vendors\n ],\n [MODEL, [TYPE, MOBILE]],\n [\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i\n // Android Tablets from Unidentified Vendors\n ],\n [MODEL, [TYPE, TABLET]],\n [\n /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i\n // Unidentifiable Tablet\n ],\n [[TYPE, TABLET]],\n [\n /(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i\n // Unidentifiable Mobile\n ],\n [[TYPE, MOBILE]],\n [\n /(android[-\\w\\. ]{0,9});.+buil/i\n // Generic Android Device\n ],\n [MODEL, [VENDOR, "Generic"]]\n ],\n engine: [\n [\n /windows.+ edge\\/([\\w\\.]+)/i\n // EdgeHTML\n ],\n [VERSION2, [NAME, EDGE + "HTML"]],\n [\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i\n // Blink\n ],\n [VERSION2, [NAME, "Blink"]],\n [\n /(presto)\\/([\\w\\.]+)/i,\n // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,\n // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /ekioh(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,\n // KHTML/Tasman/Links\n /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i\n // iCab\n ],\n [NAME, VERSION2],\n [\n /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i\n // Gecko\n ],\n [VERSION2, NAME]\n ],\n os: [\n [\n // Windows\n /microsoft (windows) (vista|xp)/i\n // Windows (iTunes)\n ],\n [NAME, VERSION2],\n [\n /(windows) nt 6\\.2; (arm)/i,\n // Windows RT\n /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,\n // Windows Phone\n /(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i\n ],\n [NAME, [VERSION2, strMapper, windowsVersionMap]],\n [/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],\n [\n [NAME, "Windows"],\n [VERSION2, strMapper, windowsVersionMap]\n ],\n [\n // iOS/macOS\n /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,\n // iOS\n /cfnetwork\\/.+darwin/i\n ],\n [\n [VERSION2, /_/g, "."],\n [NAME, "iOS"]\n ],\n [\n /(mac os x) ?([\\w\\. ]*)/i,\n /(macintosh|mac_powerpc\\b)(?!.+haiku)/i\n // Mac OS\n ],\n [\n [NAME, "Mac OS"],\n [VERSION2, /_/g, "."]\n ],\n [\n // Mobile OSes\n /droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i\n // Android-x86/HarmonyOS\n ],\n [VERSION2, NAME],\n [\n // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n /(blackberry)\\w*\\/([\\w\\.]*)/i,\n // Blackberry\n /(tizen|kaios)[\\/ ]([\\w\\.]+)/i,\n // Tizen/KaiOS\n /\\((series40);/i\n // Series 40\n ],\n [NAME, VERSION2],\n [\n /\\(bb(10);/i\n // BlackBerry 10\n ],\n [VERSION2, [NAME, BLACKBERRY]],\n [\n /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i\n // Symbian\n ],\n [VERSION2, [NAME, "Symbian"]],\n [\n /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i\n // Firefox OS\n ],\n [VERSION2, [NAME, FIREFOX + " OS"]],\n [\n /web0s;.+rt(tv)/i,\n /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i\n // WebOS\n ],\n [VERSION2, [NAME, "webOS"]],\n [\n // Google Chromecast\n /crkey\\/([\\d\\.]+)/i\n // Google Chromecast\n ],\n [VERSION2, [NAME, CHROME + "cast"]],\n [\n /(cros) [\\w]+ ([\\w\\.]+\\w)/i\n // Chromium OS\n ],\n [[NAME, "Chromium OS"], VERSION2],\n [\n // Console\n /(nintendo|playstation) ([wids345portablevuch]+)/i,\n // Nintendo/Playstation\n /(xbox); +xbox ([^\\);]+)/i,\n // Microsoft Xbox (360, One, X, S, Series X, Series S)\n // Other\n /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,\n // Joli/Palm\n /(mint)[\\/\\(\\) ]?(\\w*)/i,\n // Mint\n /(mageia|vectorlinux)[; ]/i,\n // Mageia/VectorLinux\n /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n /(hurd|linux) ?([\\w\\.]*)/i,\n // Hurd/Linux\n /(gnu) ?([\\w\\.]*)/i,\n // GNU\n /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,\n // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n /(haiku) (\\w+)/i\n // Haiku\n ],\n [NAME, VERSION2],\n [\n /(sunos) ?([\\w\\.\\d]*)/i\n // Solaris\n ],\n [[NAME, "Solaris"], VERSION2],\n [\n /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,\n // Solaris\n /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,\n // AIX\n /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,\n // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX\n /(unix) ?([\\w\\.]*)/i\n // UNIX\n ],\n [NAME, VERSION2]\n ]\n };\n var UAParser2 = function(ua, extensions) {\n if (typeof ua === OBJ_TYPE) {\n extensions = ua;\n ua = undefined2;\n }\n if (!(this instanceof UAParser2)) {\n return new UAParser2(ua, extensions).getResult();\n }\n var _ua = ua || (typeof window2 !== UNDEF_TYPE && window2.navigator && window2.navigator.userAgent ? window2.navigator.userAgent : EMPTY);\n var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n this.getBrowser = function() {\n var _browser = {};\n _browser[NAME] = undefined2;\n _browser[VERSION2] = undefined2;\n rgxMapper.call(_browser, _ua, _rgxmap.browser);\n _browser.major = majorize(_browser.version);\n return _browser;\n };\n this.getCPU = function() {\n var _cpu = {};\n _cpu[ARCHITECTURE] = undefined2;\n rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n return _cpu;\n };\n this.getDevice = function() {\n var _device = {};\n _device[VENDOR] = undefined2;\n _device[MODEL] = undefined2;\n _device[TYPE] = undefined2;\n rgxMapper.call(_device, _ua, _rgxmap.device);\n return _device;\n };\n this.getEngine = function() {\n var _engine = {};\n _engine[NAME] = undefined2;\n _engine[VERSION2] = undefined2;\n rgxMapper.call(_engine, _ua, _rgxmap.engine);\n return _engine;\n };\n this.getOS = function() {\n var _os = {};\n _os[NAME] = undefined2;\n _os[VERSION2] = undefined2;\n rgxMapper.call(_os, _ua, _rgxmap.os);\n return _os;\n };\n this.getResult = function() {\n return {\n ua: this.getUA(),\n browser: this.getBrowser(),\n engine: this.getEngine(),\n os: this.getOS(),\n device: this.getDevice(),\n cpu: this.getCPU()\n };\n };\n this.getUA = function() {\n return _ua;\n };\n this.setUA = function(ua2) {\n _ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;\n return this;\n };\n this.setUA(_ua);\n return this;\n };\n UAParser2.VERSION = LIBVERSION;\n UAParser2.BROWSER = enumerize([NAME, VERSION2, MAJOR]);\n UAParser2.CPU = enumerize([ARCHITECTURE]);\n UAParser2.DEVICE = enumerize([\n MODEL,\n VENDOR,\n TYPE,\n CONSOLE,\n MOBILE,\n SMARTTV,\n TABLET,\n WEARABLE,\n EMBEDDED\n ]);\n UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION2]);\n if (typeof exports !== UNDEF_TYPE) {\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser2;\n }\n exports.UAParser = UAParser2;\n } else {\n if (typeof define === FUNC_TYPE && define.amd) {\n define(function() {\n return UAParser2;\n });\n } else if (typeof window2 !== UNDEF_TYPE) {\n window2.UAParser = UAParser2;\n }\n }\n var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser2();\n $.ua = parser.getResult();\n $.ua.get = function() {\n return parser.getUA();\n };\n $.ua.set = function(ua) {\n parser.setUA(ua);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n })(typeof window === "object" ? window : exports);\n }\n });\n\n // packages/dev-tools/client/utils.ts\n var goToSection = (shadow, view) => {\n closeToasts(shadow);\n const aside = shadow.querySelector("aside");\n aside.dataset.view = view;\n aside.classList.remove("section-ready");\n setTimeout(() => {\n aside.classList.add("section-ready");\n }, 200);\n };\n var initBackButtons = (shadow) => {\n Array.from(shadow.querySelectorAll(".back-button")).forEach((elm) => {\n elm.addEventListener("click", (ev) => {\n closeToasts(shadow);\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n goToSection(shadow, target?.dataset.back || "nav-home");\n });\n });\n };\n var showToast = (shadow, html) => {\n closeToasts(shadow);\n const aside = shadow.querySelector("aside");\n const toast = document.createElement("div");\n toast.className = `ui-toast`;\n toast.innerHTML = html;\n aside.appendChild(toast);\n setTimeout(() => {\n toast.classList.add("ui-toast-show");\n setTimeout(() => {\n toast.classList.remove("ui-toast-show");\n setTimeout(() => {\n toast.remove();\n }, 500);\n }, 4e3);\n }, 30);\n };\n var closeToasts = (shadow) => {\n const aside = shadow.querySelector("aside");\n const existing = Array.from(aside.querySelectorAll(".ui-toast"));\n existing.forEach((el) => {\n el.classList.remove("ui-toast-show");\n });\n };\n var isEditEnabled = () => {\n const key = getDisableEditKey();\n return localStorage.getItem(key) !== "true";\n };\n var enableEdit = (enable) => {\n const key = getDisableEditKey();\n if (enable) {\n localStorage.removeItem(key);\n } else {\n localStorage.setItem(key, "true");\n }\n };\n var getDisableEditKey = () => getLocalStorageKey("disableEdit");\n var getLocalStorageKey = (name) => `builder.__LOCAL_APP_ID__.${name}`;\n var getEditorUrl = () => {\n const contentElm = document.body.querySelector("[builder-content-id]");\n const contentId = contentElm?.getAttribute("builder-content-id");\n return getBuilderContentUrl(contentId);\n };\n var getBuilderContentUrl = (contentId, blockId) => {\n let pathname = "/content";\n if (contentId) {\n pathname += "/" + contentId + "/edit";\n }\n const url = new URL(pathname, "https://builder.io");\n if (contentId && blockId) {\n url.searchParams.set("selectedBlock", blockId);\n }\n const previewUrl = new URL(location.pathname, location.href);\n url.searchParams.set("overridePreviewUrl", previewUrl.href);\n return url.href;\n };\n var DEV_TOOLS_URL = "__DEV_TOOLS_URL__";\n var APP_STATE = {\n components: [],\n registryPath: "",\n registryDisplayPath: "",\n frameworks: [],\n dependencies: [],\n publicApiKey: void 0,\n devToolsVersion: ""\n };\n var updateAppState = (registry) => {\n APP_STATE.components = registry.components;\n APP_STATE.registryPath = registry.registryPath;\n APP_STATE.registryDisplayPath = registry.registryDisplayPath;\n APP_STATE.dependencies = registry.dependencies;\n APP_STATE.publicApiKey = registry.publicApiKey;\n };\n\n // packages/dev-tools/client/edit-button/document-listeners.ts\n function initDocumentListeners(editButton) {\n let lastBlockId = null;\n const menu = document.querySelector(\n "builder-dev-tools-menu"\n );\n const hideEditButton = () => {\n editButton.hide();\n };\n const onPointerOver = (ev) => {\n const hoverElm = ev.target;\n if (!hoverElm) {\n hideEditButton();\n return;\n }\n if (hoverElm.closest("builder-dev-tools-edit")) {\n return;\n }\n const contentElm = hoverElm.closest("[builder-content-id]");\n const blockElm = hoverElm.closest("[builder-id]");\n if (!contentElm || !blockElm) {\n editButton.hide();\n return;\n }\n const blockId = editButton.show(contentElm, blockElm);\n if (!blockId || blockId === lastBlockId) {\n return;\n }\n menu.highlightOpener();\n lastBlockId = blockId;\n };\n document.addEventListener("pointerover", onPointerOver, { passive: true });\n document.addEventListener("pointerleave", hideEditButton, {\n passive: true\n });\n document.addEventListener("pointercancel", hideEditButton, {\n passive: true\n });\n document.addEventListener("visibilitychange", hideEditButton, {\n passive: true\n });\n window.addEventListener("popstate", hideEditButton, { passive: true });\n const originalPushState = history.pushState;\n history.pushState = function(...args) {\n editButton.hide();\n originalPushState.apply(this, args);\n };\n const originalReplaceState = history.replaceState;\n history.replaceState = function(...args) {\n editButton.hide();\n originalReplaceState.apply(this, args);\n };\n }\n\n // packages/dev-tools/client/edit-button/index.ts\n var BuilderDevToolsEditButton = class extends HTMLElement {\n openInBuilder = null;\n block = null;\n constructor() {\n super();\n }\n connectedCallback() {\n this.setAttribute("aria-hidden", "true");\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = \'<style>/* packages/dev-tools/client/common.css */\\n*,\\n*::before,\\n*::after {\\n box-sizing: border-box;\\n}\\n:host {\\n --background-color: rgba(40, 40, 40, 1);\\n --primary-color: rgba(72, 161, 255, 1);\\n --primary-color-subdued: rgb(72, 161, 255, 0.6);\\n --primary-color-highlight: rgb(126, 188, 255);\\n --primary-contrast-color: white;\\n --edit-color: #1d74e2;\\n --edit-color-highlight: #1c6bd1;\\n --edit-color-alpha: rgb(72, 161, 255, 0.15);\\n --error-color: #ff2b55;\\n --text-color: white;\\n --text-color-highlight: white;\\n --border-color: #454545;\\n --button-background-color-hover: rgba(255, 255, 255, 0.1);\\n --menu-width: 320px;\\n --transition-time: 150ms;\\n --font-family:\\n ui-sans-serif,\\n system-ui,\\n -apple-system,\\n BlinkMacSystemFont,\\n "Segoe UI",\\n Roboto,\\n "Helvetica Neue",\\n Arial,\\n "Noto Sans",\\n sans-serif,\\n "Apple Color Emoji",\\n "Segoe UI Emoji",\\n "Segoe UI Symbol",\\n "Noto Color Emoji";\\n font-family: var(--font-family);\\n line-height: 1.6;\\n}\\nbutton {\\n cursor: pointer;\\n color: var(--text-color);\\n -webkit-tap-highlight-color: transparent;\\n}\\ninput,\\nselect,\\nbutton {\\n font-family: var(--font-family);\\n}\\n\\n/* packages/dev-tools/client/edit-button/edit-button.css */\\n:host {\\n display: none;\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n z-index: 2147483646;\\n user-select: none;\\n pointer-events: none;\\n color: var(--text-color);\\n}\\n#content-highlight,\\n#block {\\n position: absolute;\\n}\\n#content-highlight {\\n border: 3px solid var(--primary-color);\\n background-color: var(--primary-color-alpha);\\n}\\na {\\n position: absolute;\\n top: -33px;\\n left: 0;\\n display: block;\\n padding: 5px 10px 8px 10px;\\n pointer-events: auto;\\n z-index: 100;\\n text-decoration: none;\\n}\\na:hover {\\n text-decoration: none;\\n}\\na span {\\n display: block;\\n padding: 3px 6px;\\n font-size: 10px;\\n font-weight: 300;\\n border-radius: 3px;\\n text-align: center;\\n text-decoration: none;\\n pointer-events: none;\\n background-color: var(--edit-color);\\n color: var(--text-color);\\n white-space: nowrap;\\n}\\na:hover span {\\n background-color: var(--edit-color-highlight);\\n}\\na:hover ~ .outline {\\n border-color: var(--edit-color-highlight);\\n}\\n#open-in-editor {\\n display: none;\\n}\\n.outline {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n border: 1px solid var(--edit-color);\\n background-color: var(--edit-color-alpha);\\n}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>\';\n this.openInBuilder = shadow.getElementById(\n "open-in-builder"\n );\n this.block = shadow.getElementById("block");\n initDocumentListeners(this);\n }\n show(contentElm, blockElm) {\n if (!isEditEnabled()) {\n this.hide();\n return null;\n }\n const contentId = contentElm.getAttribute("builder-content-id");\n const blockId = blockElm.getAttribute("builder-id");\n if (!contentId || !blockId) {\n this.hide();\n return null;\n }\n const block = this.block;\n const openInBuilder = this.openInBuilder;\n const builderRect = blockElm.getBoundingClientRect();\n block.style.top = builderRect.top + window.scrollY - 1 + "px";\n block.style.left = builderRect.left + window.scrollX + "px";\n block.style.width = builderRect.width + "px";\n block.style.height = builderRect.height + 1 + "px";\n const openInBuilderRect = openInBuilder.getBoundingClientRect();\n if (openInBuilderRect.width > builderRect.width) {\n const diff = openInBuilderRect.width - builderRect.width;\n openInBuilder.style.left = diff / 2 * -1 + "px";\n } else {\n openInBuilder.style.left = "";\n }\n openInBuilder.href = getBuilderContentUrl(contentId, blockId);\n this.style.display = "block";\n return blockId;\n }\n hide() {\n this.style.display = "";\n }\n };\n\n // packages/dev-tools/common/constants.ts\n var PREVIEW_URL_QS = `preview-url`;\n var CONNECTED_USER_ID_QS = "_b-uid";\n var BUILDER_AUTH_CONNECT_PATH = "/~builder-connect";\n var DEV_TOOLS_API_PATH = "/~builder-dev-tools";\n var AMPLITUDE_PROXY_URL = "https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";\n\n // packages/dev-tools/client/client-api.ts\n var apiValidateBuilder = () => apiFetch({\n type: "validateBuilder"\n });\n var apiLaunchEditor = (file) => apiFetch({\n type: "launchEditor",\n data: file\n });\n var apiRegistry = (opts) => apiFetch({\n type: "getRegistry",\n data: opts\n });\n var apiLoadComponent = (opts) => apiFetch({\n type: "loadComponent",\n data: opts\n });\n var apiRegisterComponent = (opts) => apiFetch({\n type: "registerComponent",\n data: opts\n });\n var apiSetComponentInfo = (opts) => apiFetch({\n type: "setComponentInfo",\n data: opts\n });\n var apiSetComponentInput = (opts) => apiFetch({\n type: "setComponentInput",\n data: opts\n });\n var apiUnregisterComponent = (opts) => apiFetch({\n type: "unregisterComponent",\n data: opts\n });\n var apiDevToolsEnabled = (enabled) => apiFetch({\n type: "enableDevTools",\n data: { enabled }\n });\n var apiLocalConfig = () => apiFetch({ type: "localConfig" });\n var apiFetch = async (data) => {\n const url = new URL(DEV_TOOLS_API_PATH, DEV_TOOLS_URL);\n let rsp;\n try {\n rsp = await fetch(url, {\n method: "POST",\n body: JSON.stringify(data)\n });\n } catch (e) {\n console.error(`Devtools Fetch Error, ${url.href}`, e);\n throw new Error(`Builder Devtools Fetch Error`);\n }\n const contentType = rsp.headers.get("content-type") || "";\n if (contentType.includes("application/json")) {\n const r = await rsp.json();\n if (rsp.ok) {\n return r.data;\n }\n if (Array.isArray(r.errors) && r.errors.length > 0) {\n r.errors.forEach((e) => console.error(e));\n throw new Error(`Builder Devtools Fetch Error: ${r.errors[0]}`);\n }\n }\n throw new Error(\n `Builder Devtools Fetch Error: ${rsp.status}, ${await rsp.text()}`\n );\n };\n\n // packages/dev-tools/common/ast/component-input-types.ts\n var INPUT_TYPES = [\n { value: "boolean", text: "boolean" },\n { value: "color", text: "color (provides a color in hex or rgb)" },\n { value: "date", text: "date (same format as the Date constructor)" },\n { value: "email", text: "email" },\n { value: "file", text: "file (uploads a file and provides a url)" },\n { value: "list", text: "list (collection of items)" },\n { value: "longText", text: "longText (multiline text editor)" },\n { value: "number", text: "number" },\n { value: "object", text: "object (set of specific names and values)" },\n { value: "richText", text: "richText (provides value as html)" },\n { value: "string", text: "string" }\n ];\n var STRING_TYPES = [\n "color",\n "date",\n "email",\n "file",\n "longText",\n "richText",\n "string"\n ];\n var NUMBER_TYPES = ["number"];\n var BOOLEAN_TYPES = ["boolean"];\n var ARRAY_TYPES = ["list"];\n var OBJECT_TYPES = ["object"];\n function getPrimitiveType(t) {\n if (STRING_TYPES.includes(t)) {\n return "string";\n } else if (NUMBER_TYPES.includes(t)) {\n return "number";\n } else if (BOOLEAN_TYPES.includes(t)) {\n return "boolean";\n } else if (ARRAY_TYPES.includes(t)) {\n return "array";\n } else if (OBJECT_TYPES.includes(t)) {\n return "object";\n } else {\n return "string";\n }\n }\n var PROP_BLACKLIST = new Set(\n [\n "about",\n "accessKey",\n "accessKeyLabel",\n "asChild",\n "autoCapitalize",\n "autoCorrect",\n "autoFocus",\n "autoSave",\n "blur",\n "contentEditable",\n "contextMenu",\n "dangerouslySetInnerHTML",\n "datatype",\n "defaultChecked",\n "defaultValue",\n "dir",\n "draggable",\n "enterKeyHint",\n "focus",\n "form",\n "formAction",\n "formEncType",\n "formMethod",\n "formNoValidate",\n "formTarget",\n "inlist",\n "innerText",\n "inputMode",\n "is",\n "isContentEditable",\n "itemID",\n "itemProp",\n "itemRef",\n "itemScope",\n "itemType",\n "lang",\n "nonce",\n "offsetHeight",\n "offsetLeft",\n "offsetTop",\n "offsetWidth",\n "outerText",\n "prefix",\n "property",\n "radioGroup",\n "rel",\n "resource",\n "results",\n "rev",\n "role",\n "security",\n "slot",\n "spellCheck",\n "suppressContentEditableWarning",\n "suppressHydrationWarning",\n "tabIndex",\n "translate",\n "typeof",\n "unselectable",\n "vocab"\n ].map((s) => s.toLowerCase())\n );\n\n // node_modules/tslib/tslib.es6.mjs\n var extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {\n d2.__proto__ = b2;\n } || function(d2, b2) {\n for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];\n };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function() {\n __assign = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function(resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function(resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator["throw"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() {\n if (t[0] & 1) throw t[1];\n return t[1];\n }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);\n return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {\n return this;\n }), g;\n function verb(n) {\n return function(v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n function __values(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = { error };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n }\n\n // node_modules/@amplitude/analytics-types/lib/esm/index.js\n var esm_exports = {};\n __export(esm_exports, {\n IdentifyOperation: () => IdentifyOperation,\n LogLevel: () => LogLevel,\n PluginType: () => PluginType,\n RevenueProperty: () => RevenueProperty,\n ServerZone: () => ServerZone,\n SpecialEventType: () => SpecialEventType,\n Status: () => Status,\n TransportType: () => TransportType\n });\n\n // node_modules/@amplitude/analytics-types/lib/esm/event.js\n var IdentifyOperation;\n (function(IdentifyOperation2) {\n IdentifyOperation2["SET"] = "$set";\n IdentifyOperation2["SET_ONCE"] = "$setOnce";\n IdentifyOperation2["ADD"] = "$add";\n IdentifyOperation2["APPEND"] = "$append";\n IdentifyOperation2["PREPEND"] = "$prepend";\n IdentifyOperation2["REMOVE"] = "$remove";\n IdentifyOperation2["PREINSERT"] = "$preInsert";\n IdentifyOperation2["POSTINSERT"] = "$postInsert";\n IdentifyOperation2["UNSET"] = "$unset";\n IdentifyOperation2["CLEAR_ALL"] = "$clearAll";\n })(IdentifyOperation || (IdentifyOperation = {}));\n var RevenueProperty;\n (function(RevenueProperty2) {\n RevenueProperty2["REVENUE_PRODUCT_ID"] = "$productId";\n RevenueProperty2["REVENUE_QUANTITY"] = "$quantity";\n RevenueProperty2["REVENUE_PRICE"] = "$price";\n RevenueProperty2["REVENUE_TYPE"] = "$revenueType";\n RevenueProperty2["REVENUE_CURRENCY"] = "$currency";\n RevenueProperty2["REVENUE"] = "$revenue";\n })(RevenueProperty || (RevenueProperty = {}));\n var SpecialEventType;\n (function(SpecialEventType2) {\n SpecialEventType2["IDENTIFY"] = "$identify";\n SpecialEventType2["GROUP_IDENTIFY"] = "$groupidentify";\n SpecialEventType2["REVENUE"] = "revenue_amount";\n })(SpecialEventType || (SpecialEventType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/logger.js\n var LogLevel;\n (function(LogLevel2) {\n LogLevel2[LogLevel2["None"] = 0] = "None";\n LogLevel2[LogLevel2["Error"] = 1] = "Error";\n LogLevel2[LogLevel2["Warn"] = 2] = "Warn";\n LogLevel2[LogLevel2["Verbose"] = 3] = "Verbose";\n LogLevel2[LogLevel2["Debug"] = 4] = "Debug";\n })(LogLevel || (LogLevel = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/plugin.js\n var PluginType;\n (function(PluginType2) {\n PluginType2["BEFORE"] = "before";\n PluginType2["ENRICHMENT"] = "enrichment";\n PluginType2["DESTINATION"] = "destination";\n })(PluginType || (PluginType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/server-zone.js\n var ServerZone;\n (function(ServerZone2) {\n ServerZone2["US"] = "US";\n ServerZone2["EU"] = "EU";\n ServerZone2["STAGING"] = "STAGING";\n })(ServerZone || (ServerZone = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/status.js\n var Status;\n (function(Status2) {\n Status2["Unknown"] = "unknown";\n Status2["Skipped"] = "skipped";\n Status2["Success"] = "success";\n Status2["RateLimit"] = "rate_limit";\n Status2["PayloadTooLarge"] = "payload_too_large";\n Status2["Invalid"] = "invalid";\n Status2["Failed"] = "failed";\n Status2["Timeout"] = "Timeout";\n Status2["SystemError"] = "SystemError";\n })(Status || (Status = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/transport.js\n var TransportType;\n (function(TransportType2) {\n TransportType2["XHR"] = "xhr";\n TransportType2["SendBeacon"] = "beacon";\n TransportType2["Fetch"] = "fetch";\n })(TransportType || (TransportType = {}));\n\n // node_modules/@amplitude/analytics-core/lib/esm/constants.js\n var UNSET_VALUE = "-";\n var AMPLITUDE_PREFIX = "AMP";\n var STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");\n var AMPLITUDE_SERVER_URL = "https://api2.amplitude.com/2/httpapi";\n var EU_AMPLITUDE_SERVER_URL = "https://api.eu.amplitude.com/2/httpapi";\n var AMPLITUDE_BATCH_SERVER_URL = "https://api2.amplitude.com/batch";\n var EU_AMPLITUDE_BATCH_SERVER_URL = "https://api.eu.amplitude.com/batch";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js\n var MAX_PROPERTY_KEYS = 1e3;\n var isValidObject = function(properties) {\n if (Object.keys(properties).length > MAX_PROPERTY_KEYS) {\n return false;\n }\n for (var key in properties) {\n var value = properties[key];\n if (!isValidProperties(key, value))\n return false;\n }\n return true;\n };\n var isValidProperties = function(property, value) {\n var e_1, _a;\n if (typeof property !== "string")\n return false;\n if (Array.isArray(value)) {\n var isValid = true;\n try {\n for (var value_1 = __values(value), value_1_1 = value_1.next(); !value_1_1.done; value_1_1 = value_1.next()) {\n var valueElement = value_1_1.value;\n if (Array.isArray(valueElement)) {\n return false;\n } else if (typeof valueElement === "object") {\n isValid = isValid && isValidObject(valueElement);\n } else if (!["number", "string"].includes(typeof valueElement)) {\n return false;\n }\n if (!isValid) {\n return false;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (value_1_1 && !value_1_1.done && (_a = value_1.return)) _a.call(value_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else if (value === null || value === void 0) {\n return false;\n } else if (typeof value === "object") {\n return isValidObject(value);\n } else if (!["number", "string", "boolean"].includes(typeof value)) {\n return false;\n }\n return true;\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/identify.js\n var Identify = (\n /** @class */\n (function() {\n function Identify2() {\n this._propertySet = /* @__PURE__ */ new Set();\n this._properties = {};\n }\n Identify2.prototype.getUserProperties = function() {\n return __assign({}, this._properties);\n };\n Identify2.prototype.set = function(property, value) {\n this._safeSet(IdentifyOperation.SET, property, value);\n return this;\n };\n Identify2.prototype.setOnce = function(property, value) {\n this._safeSet(IdentifyOperation.SET_ONCE, property, value);\n return this;\n };\n Identify2.prototype.append = function(property, value) {\n this._safeSet(IdentifyOperation.APPEND, property, value);\n return this;\n };\n Identify2.prototype.prepend = function(property, value) {\n this._safeSet(IdentifyOperation.PREPEND, property, value);\n return this;\n };\n Identify2.prototype.postInsert = function(property, value) {\n this._safeSet(IdentifyOperation.POSTINSERT, property, value);\n return this;\n };\n Identify2.prototype.preInsert = function(property, value) {\n this._safeSet(IdentifyOperation.PREINSERT, property, value);\n return this;\n };\n Identify2.prototype.remove = function(property, value) {\n this._safeSet(IdentifyOperation.REMOVE, property, value);\n return this;\n };\n Identify2.prototype.add = function(property, value) {\n this._safeSet(IdentifyOperation.ADD, property, value);\n return this;\n };\n Identify2.prototype.unset = function(property) {\n this._safeSet(IdentifyOperation.UNSET, property, UNSET_VALUE);\n return this;\n };\n Identify2.prototype.clearAll = function() {\n this._properties = {};\n this._properties[IdentifyOperation.CLEAR_ALL] = UNSET_VALUE;\n return this;\n };\n Identify2.prototype._safeSet = function(operation, property, value) {\n if (this._validate(operation, property, value)) {\n var userPropertyMap = this._properties[operation];\n if (userPropertyMap === void 0) {\n userPropertyMap = {};\n this._properties[operation] = userPropertyMap;\n }\n userPropertyMap[property] = value;\n this._propertySet.add(property);\n return true;\n }\n return false;\n };\n Identify2.prototype._validate = function(operation, property, value) {\n if (this._properties[IdentifyOperation.CLEAR_ALL] !== void 0) {\n return false;\n }\n if (this._propertySet.has(property)) {\n return false;\n }\n if (operation === IdentifyOperation.ADD) {\n return typeof value === "number";\n }\n if (operation !== IdentifyOperation.UNSET && operation !== IdentifyOperation.REMOVE) {\n return isValidProperties(property, value);\n }\n return true;\n };\n return Identify2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js\n var createTrackEvent = function(eventInput, eventProperties, eventOptions) {\n var baseEvent = typeof eventInput === "string" ? { event_type: eventInput } : eventInput;\n return __assign(__assign(__assign({}, baseEvent), eventOptions), eventProperties && { event_properties: eventProperties });\n };\n var createIdentifyEvent = function(identify2, eventOptions) {\n var identifyEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties() });\n return identifyEvent;\n };\n var createGroupIdentifyEvent = function(groupType, groupName, identify2, eventOptions) {\n var _a;\n var groupIdentify2 = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.GROUP_IDENTIFY, group_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupIdentify2;\n };\n var createGroupEvent = function(groupType, groupName, eventOptions) {\n var _a;\n var identify2 = new Identify();\n identify2.set(groupType, groupName);\n var groupEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupEvent;\n };\n var createRevenueEvent = function(revenue2, eventOptions) {\n return __assign(__assign({}, eventOptions), { event_type: SpecialEventType.REVENUE, event_properties: revenue2.getEventProperties() });\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js\n var buildResult = function(event, code, message) {\n if (code === void 0) {\n code = 0;\n }\n if (message === void 0) {\n message = Status.Unknown;\n }\n return { event, code, message };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/timeline.js\n var Timeline = (\n /** @class */\n (function() {\n function Timeline2(client) {\n this.client = client;\n this.queue = [];\n this.applying = false;\n this.plugins = [];\n }\n Timeline2.prototype.register = function(plugin, config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, plugin.setup(config, this.client)];\n case 1:\n _a.sent();\n this.plugins.push(plugin);\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.deregister = function(pluginName, config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var index, plugin;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n index = this.plugins.findIndex(function(plugin2) {\n return plugin2.name === pluginName;\n });\n if (index === -1) {\n config.loggerProvider.warn("Plugin with name ".concat(pluginName, " does not exist, skipping deregistration"));\n return [\n 2\n /*return*/\n ];\n }\n plugin = this.plugins[index];\n this.plugins.splice(index, 1);\n return [4, (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin)];\n case 1:\n _b.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.reset = function(client) {\n this.applying = false;\n var plugins = this.plugins;\n plugins.map(function(plugin) {\n var _a;\n return (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin);\n });\n this.plugins = [];\n this.client = client;\n };\n Timeline2.prototype.push = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n _this.queue.push([event, resolve]);\n _this.scheduleApply(0);\n });\n };\n Timeline2.prototype.scheduleApply = function(timeout) {\n var _this = this;\n if (this.applying)\n return;\n this.applying = true;\n setTimeout(function() {\n void _this.apply(_this.queue.shift()).then(function() {\n _this.applying = false;\n if (_this.queue.length > 0) {\n _this.scheduleApply(0);\n }\n });\n }, timeout);\n };\n Timeline2.prototype.apply = function(item) {\n return __awaiter(this, void 0, void 0, function() {\n var _a, event, _b, resolve, before, before_1, before_1_1, plugin, e, e_1_1, enrichment, enrichment_1, enrichment_1_1, plugin, e, e_2_1, destination, executeDestinations;\n var e_1, _c, e_2, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n if (!item) {\n return [\n 2\n /*return*/\n ];\n }\n _a = __read(item, 1), event = _a[0];\n _b = __read(item, 2), resolve = _b[1];\n before = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.BEFORE;\n });\n _e.label = 1;\n case 1:\n _e.trys.push([1, 6, 7, 8]);\n before_1 = __values(before), before_1_1 = before_1.next();\n _e.label = 2;\n case 2:\n if (!!before_1_1.done) return [3, 5];\n plugin = before_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 3:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 4;\n case 4:\n before_1_1 = before_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (before_1_1 && !before_1_1.done && (_c = before_1.return)) _c.call(before_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n enrichment = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.ENRICHMENT;\n });\n _e.label = 9;\n case 9:\n _e.trys.push([9, 14, 15, 16]);\n enrichment_1 = __values(enrichment), enrichment_1_1 = enrichment_1.next();\n _e.label = 10;\n case 10:\n if (!!enrichment_1_1.done) return [3, 13];\n plugin = enrichment_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 11:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 12;\n case 12:\n enrichment_1_1 = enrichment_1.next();\n return [3, 10];\n case 13:\n return [3, 16];\n case 14:\n e_2_1 = _e.sent();\n e_2 = { error: e_2_1 };\n return [3, 16];\n case 15:\n try {\n if (enrichment_1_1 && !enrichment_1_1.done && (_d = enrichment_1.return)) _d.call(enrichment_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 16:\n destination = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin2) {\n var eventClone = __assign({}, event);\n return plugin2.execute(eventClone).catch(function(e2) {\n return buildResult(eventClone, 0, String(e2));\n });\n });\n void Promise.all(executeDestinations).then(function(_a2) {\n var _b2 = __read(_a2, 1), result = _b2[0];\n resolve(result);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.flush = function() {\n return __awaiter(this, void 0, void 0, function() {\n var queue, destination, executeDestinations;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n queue = this.queue;\n this.queue = [];\n return [4, Promise.all(queue.map(function(item) {\n return _this.apply(item);\n }))];\n case 1:\n _a.sent();\n destination = this.plugins.filter(function(plugin) {\n return plugin.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin) {\n return plugin.flush && plugin.flush();\n });\n return [4, Promise.all(executeDestinations)];\n case 2:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return Timeline2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/messages.js\n var SUCCESS_MESSAGE = "Event tracked successfully";\n var UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";\n var MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";\n var OPT_OUT_MESSAGE = "Event skipped due to optOut config";\n var MISSING_API_KEY_MESSAGE = "Event rejected due to missing API key";\n var INVALID_API_KEY = "Invalid API key";\n var CLIENT_NOT_INITIALIZED = "Client not initialized";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js\n var returnWrapper = function(awaitable) {\n return {\n promise: awaitable || Promise.resolve()\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/core-client.js\n var AmplitudeCore = (\n /** @class */\n (function() {\n function AmplitudeCore2(name) {\n if (name === void 0) {\n name = "$default";\n }\n this.initializing = false;\n this.q = [];\n this.dispatchQ = [];\n this.logEvent = this.track.bind(this);\n this.timeline = new Timeline(this);\n this.name = name;\n }\n AmplitudeCore2.prototype._init = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n this.config = config;\n this.timeline.reset(this);\n return [4, this.runQueuedFunctions("q")];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.runQueuedFunctions = function(queueName) {\n return __awaiter(this, void 0, void 0, function() {\n var queuedFunctions, queuedFunctions_1, queuedFunctions_1_1, queuedFunction, e_1_1;\n var e_1, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n queuedFunctions = this[queueName];\n this[queueName] = [];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 6, 7, 8]);\n queuedFunctions_1 = __values(queuedFunctions), queuedFunctions_1_1 = queuedFunctions_1.next();\n _b.label = 2;\n case 2:\n if (!!queuedFunctions_1_1.done) return [3, 5];\n queuedFunction = queuedFunctions_1_1.value;\n return [4, queuedFunction()];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n queuedFunctions_1_1 = queuedFunctions_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _b.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (queuedFunctions_1_1 && !queuedFunctions_1_1.done && (_a = queuedFunctions_1.return)) _a.call(queuedFunctions_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.track = function(eventInput, eventProperties, eventOptions) {\n var event = createTrackEvent(eventInput, eventProperties, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.identify = function(identify2, eventOptions) {\n var event = createIdentifyEvent(identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n var event = createGroupIdentifyEvent(groupType, groupName, identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.setGroup = function(groupType, groupName, eventOptions) {\n var event = createGroupEvent(groupType, groupName, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.revenue = function(revenue2, eventOptions) {\n var event = createRevenueEvent(revenue2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.add = function(plugin) {\n if (!this.config) {\n this.q.push(this.add.bind(this, plugin));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.register(plugin, this.config));\n };\n AmplitudeCore2.prototype.remove = function(pluginName) {\n if (!this.config) {\n this.q.push(this.remove.bind(this, pluginName));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.deregister(pluginName, this.config));\n };\n AmplitudeCore2.prototype.dispatchWithCallback = function(event, callback) {\n if (!this.config) {\n return callback(buildResult(event, 0, CLIENT_NOT_INITIALIZED));\n }\n void this.process(event).then(callback);\n };\n AmplitudeCore2.prototype.dispatch = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n if (!this.config) {\n return [2, new Promise(function(resolve) {\n _this.dispatchQ.push(_this.dispatchWithCallback.bind(_this, event, resolve));\n })];\n }\n return [2, this.process(event)];\n });\n });\n };\n AmplitudeCore2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var result, e_2, message, result;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n if (this.config.optOut) {\n return [2, buildResult(event, 0, OPT_OUT_MESSAGE)];\n }\n return [4, this.timeline.push(event)];\n case 1:\n result = _a.sent();\n result.code === 200 ? this.config.loggerProvider.log(result.message) : this.config.loggerProvider.error(result.message);\n return [2, result];\n case 2:\n e_2 = _a.sent();\n this.config.loggerProvider.error(e_2);\n message = String(e_2);\n result = buildResult(event, 0, message);\n return [2, result];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.setOptOut = function(optOut) {\n if (!this.config) {\n this.q.push(this.setOptOut.bind(this, Boolean(optOut)));\n return;\n }\n this.config.optOut = Boolean(optOut);\n };\n AmplitudeCore2.prototype.flush = function() {\n return returnWrapper(this.timeline.flush());\n };\n return AmplitudeCore2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/revenue.js\n var Revenue = (\n /** @class */\n (function() {\n function Revenue2() {\n this.productId = "";\n this.quantity = 1;\n this.price = 0;\n }\n Revenue2.prototype.setProductId = function(productId) {\n this.productId = productId;\n return this;\n };\n Revenue2.prototype.setQuantity = function(quantity) {\n if (quantity > 0) {\n this.quantity = quantity;\n }\n return this;\n };\n Revenue2.prototype.setPrice = function(price) {\n this.price = price;\n return this;\n };\n Revenue2.prototype.setRevenueType = function(revenueType) {\n this.revenueType = revenueType;\n return this;\n };\n Revenue2.prototype.setCurrency = function(currency) {\n this.currency = currency;\n return this;\n };\n Revenue2.prototype.setRevenue = function(revenue2) {\n this.revenue = revenue2;\n return this;\n };\n Revenue2.prototype.setEventProperties = function(properties) {\n if (isValidObject(properties)) {\n this.properties = properties;\n }\n return this;\n };\n Revenue2.prototype.getEventProperties = function() {\n var eventProperties = this.properties ? __assign({}, this.properties) : {};\n eventProperties[RevenueProperty.REVENUE_PRODUCT_ID] = this.productId;\n eventProperties[RevenueProperty.REVENUE_QUANTITY] = this.quantity;\n eventProperties[RevenueProperty.REVENUE_PRICE] = this.price;\n eventProperties[RevenueProperty.REVENUE_TYPE] = this.revenueType;\n eventProperties[RevenueProperty.REVENUE_CURRENCY] = this.currency;\n eventProperties[RevenueProperty.REVENUE] = this.revenue;\n return eventProperties;\n };\n return Revenue2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js\n var chunk = function(arr, size) {\n var chunkSize = Math.max(size, 1);\n return arr.reduce(function(chunks, element, index) {\n var chunkIndex = Math.floor(index / chunkSize);\n if (!chunks[chunkIndex]) {\n chunks[chunkIndex] = [];\n }\n chunks[chunkIndex].push(element);\n return chunks;\n }, []);\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/logger.js\n var PREFIX = "Amplitude Logger ";\n var Logger = (\n /** @class */\n (function() {\n function Logger2() {\n this.logLevel = LogLevel.None;\n }\n Logger2.prototype.disable = function() {\n this.logLevel = LogLevel.None;\n };\n Logger2.prototype.enable = function(logLevel) {\n if (logLevel === void 0) {\n logLevel = LogLevel.Warn;\n }\n this.logLevel = logLevel;\n };\n Logger2.prototype.log = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Verbose) {\n return;\n }\n console.log("".concat(PREFIX, "[Log]: ").concat(args.join(" ")));\n };\n Logger2.prototype.warn = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Warn) {\n return;\n }\n console.warn("".concat(PREFIX, "[Warn]: ").concat(args.join(" ")));\n };\n Logger2.prototype.error = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Error) {\n return;\n }\n console.error("".concat(PREFIX, "[Error]: ").concat(args.join(" ")));\n };\n Logger2.prototype.debug = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Debug) {\n return;\n }\n console.log("".concat(PREFIX, "[Debug]: ").concat(args.join(" ")));\n };\n return Logger2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/config.js\n var getDefaultConfig = function() {\n return {\n flushMaxRetries: 12,\n flushQueueSize: 200,\n flushIntervalMillis: 1e4,\n instanceName: "$default_instance",\n logLevel: LogLevel.Warn,\n loggerProvider: new Logger(),\n optOut: false,\n serverUrl: AMPLITUDE_SERVER_URL,\n serverZone: ServerZone.US,\n useBatch: false\n };\n };\n var Config = (\n /** @class */\n (function() {\n function Config2(options) {\n var _a, _b, _c, _d;\n this._optOut = false;\n var defaultConfig = getDefaultConfig();\n this.apiKey = options.apiKey;\n this.flushIntervalMillis = (_a = options.flushIntervalMillis) !== null && _a !== void 0 ? _a : defaultConfig.flushIntervalMillis;\n this.flushMaxRetries = options.flushMaxRetries || defaultConfig.flushMaxRetries;\n this.flushQueueSize = options.flushQueueSize || defaultConfig.flushQueueSize;\n this.instanceName = options.instanceName || defaultConfig.instanceName;\n this.loggerProvider = options.loggerProvider || defaultConfig.loggerProvider;\n this.logLevel = (_b = options.logLevel) !== null && _b !== void 0 ? _b : defaultConfig.logLevel;\n this.minIdLength = options.minIdLength;\n this.plan = options.plan;\n this.ingestionMetadata = options.ingestionMetadata;\n this.optOut = (_c = options.optOut) !== null && _c !== void 0 ? _c : defaultConfig.optOut;\n this.serverUrl = options.serverUrl;\n this.serverZone = options.serverZone || defaultConfig.serverZone;\n this.storageProvider = options.storageProvider;\n this.transportProvider = options.transportProvider;\n this.useBatch = (_d = options.useBatch) !== null && _d !== void 0 ? _d : defaultConfig.useBatch;\n this.loggerProvider.enable(this.logLevel);\n var serverConfig = createServerConfig(options.serverUrl, options.serverZone, options.useBatch);\n this.serverZone = serverConfig.serverZone;\n this.serverUrl = serverConfig.serverUrl;\n }\n Object.defineProperty(Config2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n this._optOut = optOut;\n },\n enumerable: false,\n configurable: true\n });\n return Config2;\n })()\n );\n var getServerUrl = function(serverZone, useBatch) {\n if (serverZone === ServerZone.EU) {\n return useBatch ? EU_AMPLITUDE_BATCH_SERVER_URL : EU_AMPLITUDE_SERVER_URL;\n }\n return useBatch ? AMPLITUDE_BATCH_SERVER_URL : AMPLITUDE_SERVER_URL;\n };\n var createServerConfig = function(serverUrl, serverZone, useBatch) {\n if (serverUrl === void 0) {\n serverUrl = "";\n }\n if (serverZone === void 0) {\n serverZone = getDefaultConfig().serverZone;\n }\n if (useBatch === void 0) {\n useBatch = getDefaultConfig().useBatch;\n }\n if (serverUrl) {\n return { serverUrl, serverZone: void 0 };\n }\n var _serverZone = ["US", "EU"].includes(serverZone) ? serverZone : getDefaultConfig().serverZone;\n return {\n serverZone: _serverZone,\n serverUrl: getServerUrl(_serverZone, useBatch)\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js\n function getErrorMessage(error) {\n if (error instanceof Error)\n return error.message;\n return String(error);\n }\n function getResponseBodyString(res) {\n var responseBodyString = "";\n try {\n if ("body" in res) {\n responseBodyString = JSON.stringify(res.body);\n }\n } catch (_a) {\n }\n return responseBodyString;\n }\n var Destination = (\n /** @class */\n (function() {\n function Destination2() {\n this.name = "amplitude";\n this.type = PluginType.DESTINATION;\n this.retryTimeout = 1e3;\n this.throttleTimeout = 3e4;\n this.storageKey = "";\n this.scheduled = null;\n this.queue = [];\n }\n Destination2.prototype.setup = function(config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var unsent;\n var _this = this;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n this.config = config;\n this.storageKey = "".concat(STORAGE_PREFIX, "_").concat(this.config.apiKey.substring(0, 10));\n return [4, (_a = this.config.storageProvider) === null || _a === void 0 ? void 0 : _a.get(this.storageKey)];\n case 1:\n unsent = _b.sent();\n this.saveEvents();\n if (unsent && unsent.length > 0) {\n void Promise.all(unsent.map(function(event) {\n return _this.execute(event);\n })).catch();\n }\n return [2, Promise.resolve(void 0)];\n }\n });\n });\n };\n Destination2.prototype.execute = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n var context = {\n event,\n attempts: 0,\n callback: function(result) {\n return resolve(result);\n },\n timeout: 0\n };\n void _this.addToQueue(context);\n });\n };\n Destination2.prototype.addToQueue = function() {\n var _this = this;\n var list = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n list[_i] = arguments[_i];\n }\n var tryable = list.filter(function(context) {\n if (context.attempts < _this.config.flushMaxRetries) {\n context.attempts += 1;\n return true;\n }\n void _this.fulfillRequest([context], 500, MAX_RETRIES_EXCEEDED_MESSAGE);\n return false;\n });\n tryable.forEach(function(context) {\n _this.queue = _this.queue.concat(context);\n if (context.timeout === 0) {\n _this.schedule(_this.config.flushIntervalMillis);\n return;\n }\n setTimeout(function() {\n context.timeout = 0;\n _this.schedule(0);\n }, context.timeout);\n });\n this.saveEvents();\n };\n Destination2.prototype.schedule = function(timeout) {\n var _this = this;\n if (this.scheduled)\n return;\n this.scheduled = setTimeout(function() {\n void _this.flush(true).then(function() {\n if (_this.queue.length > 0) {\n _this.schedule(timeout);\n }\n });\n }, timeout);\n };\n Destination2.prototype.flush = function(useRetry) {\n if (useRetry === void 0) {\n useRetry = false;\n }\n return __awaiter(this, void 0, void 0, function() {\n var list, later, batches;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n list = [];\n later = [];\n this.queue.forEach(function(context) {\n return context.timeout === 0 ? list.push(context) : later.push(context);\n });\n this.queue = later;\n if (this.scheduled) {\n clearTimeout(this.scheduled);\n this.scheduled = null;\n }\n batches = chunk(list, this.config.flushQueueSize);\n return [4, Promise.all(batches.map(function(batch) {\n return _this.send(batch, useRetry);\n }))];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.send = function(list, useRetry) {\n if (useRetry === void 0) {\n useRetry = true;\n }\n return __awaiter(this, void 0, void 0, function() {\n var payload, serverUrl, res, e_1, errorMessage;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (!this.config.apiKey) {\n return [2, this.fulfillRequest(list, 400, MISSING_API_KEY_MESSAGE)];\n }\n payload = {\n api_key: this.config.apiKey,\n events: list.map(function(context) {\n var _a2 = context.event, extra = _a2.extra, eventWithoutExtra = __rest(_a2, ["extra"]);\n return eventWithoutExtra;\n }),\n options: {\n min_id_length: this.config.minIdLength\n }\n };\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n serverUrl = createServerConfig(this.config.serverUrl, this.config.serverZone, this.config.useBatch).serverUrl;\n return [4, this.config.transportProvider.send(serverUrl, payload)];\n case 2:\n res = _a.sent();\n if (res === null) {\n this.fulfillRequest(list, 0, UNEXPECTED_ERROR_MESSAGE);\n return [\n 2\n /*return*/\n ];\n }\n if (!useRetry) {\n if ("body" in res) {\n this.fulfillRequest(list, res.statusCode, "".concat(res.status, ": ").concat(getResponseBodyString(res)));\n } else {\n this.fulfillRequest(list, res.statusCode, res.status);\n }\n return [\n 2\n /*return*/\n ];\n }\n this.handleResponse(res, list);\n return [3, 4];\n case 3:\n e_1 = _a.sent();\n this.config.loggerProvider.error(e_1);\n errorMessage = getErrorMessage(e_1);\n this.fulfillRequest(list, 0, errorMessage);\n return [3, 4];\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.handleResponse = function(res, list) {\n var status = res.status;\n switch (status) {\n case Status.Success: {\n this.handleSuccessResponse(res, list);\n break;\n }\n case Status.Invalid: {\n this.handleInvalidResponse(res, list);\n break;\n }\n case Status.PayloadTooLarge: {\n this.handlePayloadTooLargeResponse(res, list);\n break;\n }\n case Status.RateLimit: {\n this.handleRateLimitResponse(res, list);\n break;\n }\n default: {\n this.config.loggerProvider.warn(`{code: 0, error: "Status \'`.concat(status, "\' provided for ").concat(list.length, \' events"}\'));\n this.handleOtherResponse(list);\n break;\n }\n }\n };\n Destination2.prototype.handleSuccessResponse = function(res, list) {\n this.fulfillRequest(list, res.statusCode, SUCCESS_MESSAGE);\n };\n Destination2.prototype.handleInvalidResponse = function(res, list) {\n var _this = this;\n if (res.body.missingField || res.body.error.startsWith(INVALID_API_KEY)) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n var dropIndex = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(Object.values(res.body.eventsWithInvalidFields)), false), __read(Object.values(res.body.eventsWithMissingFields)), false), __read(Object.values(res.body.eventsWithInvalidIdLengths)), false), __read(res.body.silencedEvents), false).flat();\n var dropIndexSet = new Set(dropIndex);\n var retry = list.filter(function(context, index) {\n if (dropIndexSet.has(index)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handlePayloadTooLargeResponse = function(res, list) {\n if (list.length === 1) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n this.config.loggerProvider.warn(getResponseBodyString(res));\n this.config.flushQueueSize /= 2;\n this.addToQueue.apply(this, __spreadArray([], __read(list), false));\n };\n Destination2.prototype.handleRateLimitResponse = function(res, list) {\n var _this = this;\n var dropUserIds = Object.keys(res.body.exceededDailyQuotaUsers);\n var dropDeviceIds = Object.keys(res.body.exceededDailyQuotaDevices);\n var throttledIndex = res.body.throttledEvents;\n var dropUserIdsSet = new Set(dropUserIds);\n var dropDeviceIdsSet = new Set(dropDeviceIds);\n var throttledIndexSet = new Set(throttledIndex);\n var retry = list.filter(function(context, index) {\n if (context.event.user_id && dropUserIdsSet.has(context.event.user_id) || context.event.device_id && dropDeviceIdsSet.has(context.event.device_id)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n if (throttledIndexSet.has(index)) {\n context.timeout = _this.throttleTimeout;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handleOtherResponse = function(list) {\n var _this = this;\n this.addToQueue.apply(this, __spreadArray([], __read(list.map(function(context) {\n context.timeout = context.attempts * _this.retryTimeout;\n return context;\n })), false));\n };\n Destination2.prototype.fulfillRequest = function(list, code, message) {\n this.saveEvents();\n list.forEach(function(context) {\n return context.callback(buildResult(context.event, code, message));\n });\n };\n Destination2.prototype.saveEvents = function() {\n if (!this.config.storageProvider) {\n return;\n }\n var events = Array.from(this.queue.map(function(context) {\n return context.event;\n }));\n void this.config.storageProvider.set(this.storageKey, events);\n };\n return Destination2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js\n var getStacktrace = function(ignoreDepth) {\n if (ignoreDepth === void 0) {\n ignoreDepth = 0;\n }\n var trace = new Error().stack || "";\n return trace.split("\\n").slice(2 + ignoreDepth).map(function(text) {\n return text.trim();\n });\n };\n var getClientLogConfig = function(client) {\n return function() {\n var _a = __assign({}, client.config), logger = _a.loggerProvider, logLevel = _a.logLevel;\n return {\n logger,\n logLevel\n };\n };\n };\n var getValueByStringPath = function(obj, path) {\n var e_1, _a;\n path = path.replace(/\\[(\\w+)\\]/g, ".$1");\n path = path.replace(/^\\./, "");\n try {\n for (var _b = __values(path.split(".")), _c = _b.next(); !_c.done; _c = _b.next()) {\n var attr = _c.value;\n if (attr in obj) {\n obj = obj[attr];\n } else {\n return;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n return obj;\n };\n var getClientStates = function(client, paths) {\n return function() {\n var e_2, _a;\n var res = {};\n try {\n for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var path = paths_1_1.value;\n res[path] = getValueByStringPath(client, path);\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n return res;\n };\n };\n var debugWrapper = function(fn, fnName, getLogConfig, getStates, fnContext) {\n if (fnContext === void 0) {\n fnContext = null;\n }\n return function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var _a = getLogConfig(), logger = _a.logger, logLevel = _a.logLevel;\n if (logLevel && logLevel < LogLevel.Debug || !logLevel || !logger) {\n return fn.apply(fnContext, args);\n }\n var debugContext = {\n type: "invoke public method",\n name: fnName,\n args,\n stacktrace: getStacktrace(1),\n time: {\n start: (/* @__PURE__ */ new Date()).toISOString()\n },\n states: {}\n };\n if (getStates && debugContext.states) {\n debugContext.states.before = getStates();\n }\n var result = fn.apply(fnContext, args);\n if (result && result.promise) {\n result.promise.then(function() {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n });\n } else {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n }\n return result;\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js\n var UUID = function(a) {\n return a ? (\n // a random number from 0 to 15\n (a ^ // unless b is 8,\n Math.random() * // in which case\n 16 >> // a random number from\n a / 4).toString(16)\n ) : (\n // or otherwise a concatenated string:\n (String(1e7) + // 10000000 +\n String(-1e3) + // -1000 +\n String(-4e3) + // -4000 +\n String(-8e3) + // -80000000 +\n String(-1e11)).replace(\n // replacing\n /[018]/g,\n // zeroes, ones, and eights with\n UUID\n )\n );\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js\n var MemoryStorage = (\n /** @class */\n (function() {\n function MemoryStorage2() {\n this.memoryStorage = /* @__PURE__ */ new Map();\n }\n MemoryStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, true];\n });\n });\n };\n MemoryStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, this.memoryStorage.get(key)];\n });\n });\n };\n MemoryStorage2.prototype.getRaw = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.get(key)];\n case 1:\n value = _a.sent();\n return [2, value ? JSON.stringify(value) : void 0];\n }\n });\n });\n };\n MemoryStorage2.prototype.set = function(key, value) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.set(key, value);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.delete(key);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.clear();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return MemoryStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/transports/base.js\n var BaseTransport = (\n /** @class */\n (function() {\n function BaseTransport2() {\n }\n BaseTransport2.prototype.send = function(_serverUrl, _payload) {\n return Promise.resolve(null);\n };\n BaseTransport2.prototype.buildResponse = function(responseJSON) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;\n if (typeof responseJSON !== "object") {\n return null;\n }\n var statusCode = responseJSON.code || 0;\n var status = this.buildStatus(statusCode);\n switch (status) {\n case Status.Success:\n return {\n status,\n statusCode,\n body: {\n eventsIngested: (_a = responseJSON.events_ingested) !== null && _a !== void 0 ? _a : 0,\n payloadSizeBytes: (_b = responseJSON.payload_size_bytes) !== null && _b !== void 0 ? _b : 0,\n serverUploadTime: (_c = responseJSON.server_upload_time) !== null && _c !== void 0 ? _c : 0\n }\n };\n case Status.Invalid:\n return {\n status,\n statusCode,\n body: {\n error: (_d = responseJSON.error) !== null && _d !== void 0 ? _d : "",\n missingField: (_e = responseJSON.missing_field) !== null && _e !== void 0 ? _e : "",\n eventsWithInvalidFields: (_f = responseJSON.events_with_invalid_fields) !== null && _f !== void 0 ? _f : {},\n eventsWithMissingFields: (_g = responseJSON.events_with_missing_fields) !== null && _g !== void 0 ? _g : {},\n eventsWithInvalidIdLengths: (_h = responseJSON.events_with_invalid_id_lengths) !== null && _h !== void 0 ? _h : {},\n epsThreshold: (_j = responseJSON.eps_threshold) !== null && _j !== void 0 ? _j : 0,\n exceededDailyQuotaDevices: (_k = responseJSON.exceeded_daily_quota_devices) !== null && _k !== void 0 ? _k : {},\n silencedDevices: (_l = responseJSON.silenced_devices) !== null && _l !== void 0 ? _l : [],\n silencedEvents: (_m = responseJSON.silenced_events) !== null && _m !== void 0 ? _m : [],\n throttledDevices: (_o = responseJSON.throttled_devices) !== null && _o !== void 0 ? _o : {},\n throttledEvents: (_p = responseJSON.throttled_events) !== null && _p !== void 0 ? _p : []\n }\n };\n case Status.PayloadTooLarge:\n return {\n status,\n statusCode,\n body: {\n error: (_q = responseJSON.error) !== null && _q !== void 0 ? _q : ""\n }\n };\n case Status.RateLimit:\n return {\n status,\n statusCode,\n body: {\n error: (_r = responseJSON.error) !== null && _r !== void 0 ? _r : "",\n epsThreshold: (_s = responseJSON.eps_threshold) !== null && _s !== void 0 ? _s : 0,\n throttledDevices: (_t = responseJSON.throttled_devices) !== null && _t !== void 0 ? _t : {},\n throttledUsers: (_u = responseJSON.throttled_users) !== null && _u !== void 0 ? _u : {},\n exceededDailyQuotaDevices: (_v = responseJSON.exceeded_daily_quota_devices) !== null && _v !== void 0 ? _v : {},\n exceededDailyQuotaUsers: (_w = responseJSON.exceeded_daily_quota_users) !== null && _w !== void 0 ? _w : {},\n throttledEvents: (_x = responseJSON.throttled_events) !== null && _x !== void 0 ? _x : []\n }\n };\n case Status.Timeout:\n default:\n return {\n status,\n statusCode\n };\n }\n };\n BaseTransport2.prototype.buildStatus = function(code) {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n if (code === 429) {\n return Status.RateLimit;\n }\n if (code === 413) {\n return Status.PayloadTooLarge;\n }\n if (code === 408) {\n return Status.Timeout;\n }\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n if (code >= 500) {\n return Status.Failed;\n }\n return Status.Unknown;\n };\n return BaseTransport2;\n })()\n );\n\n // node_modules/@amplitude/analytics-connector/dist/analytics-connector.esm.js\n var ApplicationContextProviderImpl = (\n /** @class */\n (function() {\n function ApplicationContextProviderImpl2() {\n }\n ApplicationContextProviderImpl2.prototype.getApplicationContext = function() {\n return {\n versionName: this.versionName,\n language: getLanguage(),\n platform: "Web",\n os: void 0,\n deviceModel: void 0\n };\n };\n return ApplicationContextProviderImpl2;\n })()\n );\n var getLanguage = function() {\n return typeof navigator !== "undefined" && (navigator.languages && navigator.languages[0] || navigator.language) || "";\n };\n var EventBridgeImpl = (\n /** @class */\n (function() {\n function EventBridgeImpl2() {\n this.queue = [];\n }\n EventBridgeImpl2.prototype.logEvent = function(event) {\n if (!this.receiver) {\n if (this.queue.length < 512) {\n this.queue.push(event);\n }\n } else {\n this.receiver(event);\n }\n };\n EventBridgeImpl2.prototype.setEventReceiver = function(receiver) {\n this.receiver = receiver;\n if (this.queue.length > 0) {\n this.queue.forEach(function(event) {\n receiver(event);\n });\n this.queue = [];\n }\n };\n return EventBridgeImpl2;\n })()\n );\n var __assign2 = function() {\n __assign2 = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign2.apply(this, arguments);\n };\n function __values2(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read2(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = {\n error\n };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n var isEqual = function(obj1, obj2) {\n var e_1, _a;\n var primitive = ["string", "number", "boolean", "undefined"];\n var typeA = typeof obj1;\n var typeB = typeof obj2;\n if (typeA !== typeB) {\n return false;\n }\n try {\n for (var primitive_1 = __values2(primitive), primitive_1_1 = primitive_1.next(); !primitive_1_1.done; primitive_1_1 = primitive_1.next()) {\n var p = primitive_1_1.value;\n if (p === typeA) {\n return obj1 === obj2;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (primitive_1_1 && !primitive_1_1.done && (_a = primitive_1.return)) _a.call(primitive_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n if (obj1 == null && obj2 == null) {\n return true;\n } else if (obj1 == null || obj2 == null) {\n return false;\n }\n if (obj1.length !== obj2.length) {\n return false;\n }\n var isArrayA = Array.isArray(obj1);\n var isArrayB = Array.isArray(obj2);\n if (isArrayA !== isArrayB) {\n return false;\n }\n if (isArrayA && isArrayB) {\n for (var i = 0; i < obj1.length; i++) {\n if (!isEqual(obj1[i], obj2[i])) {\n return false;\n }\n }\n } else {\n var sorted1 = Object.keys(obj1).sort();\n var sorted2 = Object.keys(obj2).sort();\n if (!isEqual(sorted1, sorted2)) {\n return false;\n }\n var result_1 = true;\n Object.keys(obj1).forEach(function(key) {\n if (!isEqual(obj1[key], obj2[key])) {\n result_1 = false;\n }\n });\n return result_1;\n }\n return true;\n };\n var ID_OP_SET = "$set";\n var ID_OP_UNSET = "$unset";\n var ID_OP_CLEAR_ALL = "$clearAll";\n if (!Object.entries) {\n Object.entries = function(obj) {\n var ownProps = Object.keys(obj);\n var i = ownProps.length;\n var resArray = new Array(i);\n while (i--) {\n resArray[i] = [ownProps[i], obj[ownProps[i]]];\n }\n return resArray;\n };\n }\n var IdentityStoreImpl = (\n /** @class */\n (function() {\n function IdentityStoreImpl2() {\n this.identity = { userProperties: {} };\n this.listeners = /* @__PURE__ */ new Set();\n }\n IdentityStoreImpl2.prototype.editIdentity = function() {\n var self2 = this;\n var actingUserProperties = __assign2({}, this.identity.userProperties);\n var actingIdentity = __assign2(__assign2({}, this.identity), { userProperties: actingUserProperties });\n return {\n setUserId: function(userId) {\n actingIdentity.userId = userId;\n return this;\n },\n setDeviceId: function(deviceId) {\n actingIdentity.deviceId = deviceId;\n return this;\n },\n setUserProperties: function(userProperties) {\n actingIdentity.userProperties = userProperties;\n return this;\n },\n setOptOut: function(optOut) {\n actingIdentity.optOut = optOut;\n return this;\n },\n updateUserProperties: function(actions) {\n var e_1, _a, e_2, _b, e_3, _c;\n var actingProperties = actingIdentity.userProperties || {};\n try {\n for (var _d = __values2(Object.entries(actions)), _e = _d.next(); !_e.done; _e = _d.next()) {\n var _f = __read2(_e.value, 2), action = _f[0], properties = _f[1];\n switch (action) {\n case ID_OP_SET:\n try {\n for (var _g = (e_2 = void 0, __values2(Object.entries(properties))), _h = _g.next(); !_h.done; _h = _g.next()) {\n var _j = __read2(_h.value, 2), key = _j[0], value = _j[1];\n actingProperties[key] = value;\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n break;\n case ID_OP_UNSET:\n try {\n for (var _k = (e_3 = void 0, __values2(Object.keys(properties))), _l = _k.next(); !_l.done; _l = _k.next()) {\n var key = _l.value;\n delete actingProperties[key];\n }\n } catch (e_3_1) {\n e_3 = { error: e_3_1 };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n break;\n case ID_OP_CLEAR_ALL:\n actingProperties = {};\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n actingIdentity.userProperties = actingProperties;\n return this;\n },\n commit: function() {\n self2.setIdentity(actingIdentity);\n return this;\n }\n };\n };\n IdentityStoreImpl2.prototype.getIdentity = function() {\n return __assign2({}, this.identity);\n };\n IdentityStoreImpl2.prototype.setIdentity = function(identity) {\n var originalIdentity = __assign2({}, this.identity);\n this.identity = __assign2({}, identity);\n if (!isEqual(originalIdentity, this.identity)) {\n this.listeners.forEach(function(listener) {\n listener(identity);\n });\n }\n };\n IdentityStoreImpl2.prototype.addIdentityListener = function(listener) {\n this.listeners.add(listener);\n };\n IdentityStoreImpl2.prototype.removeIdentityListener = function(listener) {\n this.listeners.delete(listener);\n };\n return IdentityStoreImpl2;\n })()\n );\n var safeGlobal = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self;\n var AnalyticsConnector = (\n /** @class */\n (function() {\n function AnalyticsConnector2() {\n this.identityStore = new IdentityStoreImpl();\n this.eventBridge = new EventBridgeImpl();\n this.applicationContextProvider = new ApplicationContextProviderImpl();\n }\n AnalyticsConnector2.getInstance = function(instanceName) {\n if (!safeGlobal["analyticsConnectorInstances"]) {\n safeGlobal["analyticsConnectorInstances"] = {};\n }\n if (!safeGlobal["analyticsConnectorInstances"][instanceName]) {\n safeGlobal["analyticsConnectorInstances"][instanceName] = new AnalyticsConnector2();\n }\n return safeGlobal["analyticsConnectorInstances"][instanceName];\n };\n return AnalyticsConnector2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/analytics-connector.js\n var getAnalyticsConnector = function(instanceName) {\n if (instanceName === void 0) {\n instanceName = "$default_instance";\n }\n return AnalyticsConnector.getInstance(instanceName);\n };\n var setConnectorUserId = function(userId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setUserId(userId).commit();\n };\n var setConnectorDeviceId = function(deviceId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setDeviceId(deviceId).commit();\n };\n var setConnectorOptOut = function(optOut, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setOptOut(optOut).commit();\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/global-scope.js\n var getGlobalScope = function() {\n if (typeof globalThis !== "undefined") {\n return globalThis;\n }\n if (typeof window !== "undefined") {\n return window;\n }\n if (typeof self !== "undefined") {\n return self;\n }\n if (typeof global !== "undefined") {\n return global;\n }\n return void 0;\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/query-params.js\n var getQueryParams = function() {\n var _a;\n var globalScope = getGlobalScope();\n if (!((_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.location) === null || _a === void 0 ? void 0 : _a.search)) {\n return {};\n }\n var pairs = globalScope.location.search.substring(1).split("&").filter(Boolean);\n var params = pairs.reduce(function(acc, curr) {\n var query = curr.split("=", 2);\n var key = tryDecodeURIComponent(query[0]);\n var value = tryDecodeURIComponent(query[1]);\n if (!value) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n return params;\n };\n var tryDecodeURIComponent = function(value) {\n if (value === void 0) {\n value = "";\n }\n try {\n return decodeURIComponent(value);\n } catch (_a) {\n return "";\n }\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/constants.js\n var UTM_CAMPAIGN = "utm_campaign";\n var UTM_CONTENT = "utm_content";\n var UTM_ID = "utm_id";\n var UTM_MEDIUM = "utm_medium";\n var UTM_SOURCE = "utm_source";\n var UTM_TERM = "utm_term";\n var DCLID = "dclid";\n var FBCLID = "fbclid";\n var GBRAID = "gbraid";\n var GCLID = "gclid";\n var KO_CLICK_ID = "ko_click_id";\n var LI_FAT_ID = "li_fat_id";\n var MSCLKID = "msclkid";\n var RDT_CID = "rtd_cid";\n var TTCLID = "ttclid";\n var TWCLID = "twclid";\n var WBRAID = "wbraid";\n var BASE_CAMPAIGN = {\n utm_campaign: void 0,\n utm_content: void 0,\n utm_id: void 0,\n utm_medium: void 0,\n utm_source: void 0,\n utm_term: void 0,\n referrer: void 0,\n referring_domain: void 0,\n dclid: void 0,\n gbraid: void 0,\n gclid: void 0,\n fbclid: void 0,\n ko_click_id: void 0,\n li_fat_id: void 0,\n msclkid: void 0,\n rtd_cid: void 0,\n ttclid: void 0,\n twclid: void 0,\n wbraid: void 0\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/campaign-parser.js\n var CampaignParser = (\n /** @class */\n (function() {\n function CampaignParser2() {\n }\n CampaignParser2.prototype.parse = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, __assign(__assign(__assign(__assign({}, BASE_CAMPAIGN), this.getUtmParam()), this.getReferrer()), this.getClickIds())];\n });\n });\n };\n CampaignParser2.prototype.getUtmParam = function() {\n var params = getQueryParams();\n var utmCampaign = params[UTM_CAMPAIGN];\n var utmContent = params[UTM_CONTENT];\n var utmId = params[UTM_ID];\n var utmMedium = params[UTM_MEDIUM];\n var utmSource = params[UTM_SOURCE];\n var utmTerm = params[UTM_TERM];\n return {\n utm_campaign: utmCampaign,\n utm_content: utmContent,\n utm_id: utmId,\n utm_medium: utmMedium,\n utm_source: utmSource,\n utm_term: utmTerm\n };\n };\n CampaignParser2.prototype.getReferrer = function() {\n var _a, _b;\n var data = {\n referrer: void 0,\n referring_domain: void 0\n };\n try {\n data.referrer = document.referrer || void 0;\n data.referring_domain = (_b = (_a = data.referrer) === null || _a === void 0 ? void 0 : _a.split("/")[2]) !== null && _b !== void 0 ? _b : void 0;\n } catch (_c) {\n }\n return data;\n };\n CampaignParser2.prototype.getClickIds = function() {\n var _a;\n var params = getQueryParams();\n return _a = {}, _a[DCLID] = params[DCLID], _a[FBCLID] = params[FBCLID], _a[GBRAID] = params[GBRAID], _a[GCLID] = params[GCLID], _a[KO_CLICK_ID] = params[KO_CLICK_ID], _a[LI_FAT_ID] = params[LI_FAT_ID], _a[MSCLKID] = params[MSCLKID], _a[RDT_CID] = params[RDT_CID], _a[TTCLID] = params[TTCLID], _a[TWCLID] = params[TWCLID], _a[WBRAID] = params[WBRAID], _a;\n };\n return CampaignParser2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/cookie-name.js\n var getCookieName = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var getOldCookieName = function(apiKey) {\n return "".concat(AMPLITUDE_PREFIX.toLowerCase(), "_").concat(apiKey.substring(0, 6));\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/default-tracking.js\n var isFileDownloadTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.fileDownloads) {\n return true;\n }\n return false;\n };\n var isFormInteractionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.formInteractions) {\n return true;\n }\n return false;\n };\n var isPageViewTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if ((defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) === true || (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) && typeof defaultTracking.pageViews === "object") {\n return true;\n }\n return false;\n };\n var isSessionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.sessions) {\n return true;\n }\n return false;\n };\n var getPageViewTrackingConfig = function(config) {\n var _a;\n var trackOn = ((_a = config.attribution) === null || _a === void 0 ? void 0 : _a.trackPageViews) ? "attribution" : function() {\n return false;\n };\n var trackHistoryChanges = void 0;\n var eventType = "Page View";\n var isDefaultPageViewTrackingEnabled = isPageViewTrackingEnabled(config.defaultTracking);\n if (isDefaultPageViewTrackingEnabled) {\n trackOn = void 0;\n eventType = void 0;\n if (config.defaultTracking && typeof config.defaultTracking === "object" && config.defaultTracking.pageViews && typeof config.defaultTracking.pageViews === "object") {\n if ("trackOn" in config.defaultTracking.pageViews) {\n trackOn = config.defaultTracking.pageViews.trackOn;\n }\n if ("trackHistoryChanges" in config.defaultTracking.pageViews) {\n trackHistoryChanges = config.defaultTracking.pageViews.trackHistoryChanges;\n }\n if ("eventType" in config.defaultTracking.pageViews && config.defaultTracking.pageViews.eventType) {\n eventType = config.defaultTracking.pageViews.eventType;\n }\n }\n }\n return {\n trackOn,\n trackHistoryChanges,\n eventType\n };\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/language.js\n var getLanguage2 = function() {\n var _a, _b, _c, _d;\n if (typeof navigator === "undefined")\n return "";\n var userLanguage = navigator.userLanguage;\n return (_d = (_c = (_b = (_a = navigator.languages) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : navigator.language) !== null && _c !== void 0 ? _c : userLanguage) !== null && _d !== void 0 ? _d : "";\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/plugins/identity.js\n var IdentityEventSender = (\n /** @class */\n (function() {\n function IdentityEventSender2() {\n this.name = "identity";\n this.type = PluginType.BEFORE;\n this.identityStore = getAnalyticsConnector().identityStore;\n }\n IdentityEventSender2.prototype.execute = function(context) {\n return __awaiter(this, void 0, void 0, function() {\n var userProperties;\n return __generator(this, function(_a) {\n userProperties = context.user_properties;\n if (userProperties) {\n this.identityStore.editIdentity().updateUserProperties(userProperties).commit();\n }\n return [2, context];\n });\n });\n };\n IdentityEventSender2.prototype.setup = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (config.instanceName) {\n this.identityStore = getAnalyticsConnector(config.instanceName).identityStore;\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return IdentityEventSender2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/storage/cookie.js\n var CookieStorage = (\n /** @class */\n (function() {\n function CookieStorage2(options) {\n this.options = __assign({}, options);\n }\n CookieStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var testStrorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n CookieStorage2.testValue = String(Date.now());\n testStrorage = new CookieStorage2(this.options);\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStrorage.set(testKey, CookieStorage2.testValue)];\n case 2:\n _b.sent();\n return [4, testStrorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === CookieStorage2.testValue];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStrorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.getRaw(key)];\n case 1:\n value = _a.sent();\n if (!value) {\n return [2, void 0];\n }\n try {\n try {\n value = decodeURIComponent(atob(value));\n } catch (_b) {\n }\n return [2, JSON.parse(value)];\n } catch (_c) {\n return [2, void 0];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var globalScope, cookie, match;\n return __generator(this, function(_b) {\n globalScope = getGlobalScope();\n cookie = (_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.document.cookie.split("; ")) !== null && _a !== void 0 ? _a : [];\n match = cookie.find(function(c) {\n return c.indexOf(key + "=") === 0;\n });\n if (!match) {\n return [2, void 0];\n }\n return [2, match.substring(key.length + 1)];\n });\n });\n };\n CookieStorage2.prototype.set = function(key, value) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var expirationDays, expires, expireDate, date, str, globalScope;\n return __generator(this, function(_b) {\n try {\n expirationDays = (_a = this.options.expirationDays) !== null && _a !== void 0 ? _a : 0;\n expires = value !== null ? expirationDays : -1;\n expireDate = void 0;\n if (expires) {\n date = /* @__PURE__ */ new Date();\n date.setTime(date.getTime() + expires * 24 * 60 * 60 * 1e3);\n expireDate = date;\n }\n str = "".concat(key, "=").concat(btoa(encodeURIComponent(JSON.stringify(value))));\n if (expireDate) {\n str += "; expires=".concat(expireDate.toUTCString());\n }\n str += "; path=/";\n if (this.options.domain) {\n str += "; domain=".concat(this.options.domain);\n }\n if (this.options.secure) {\n str += "; Secure";\n }\n if (this.options.sameSite) {\n str += "; SameSite=".concat(this.options.sameSite);\n }\n globalScope = getGlobalScope();\n if (globalScope) {\n globalScope.document.cookie = str;\n }\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n CookieStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.set(key, null)];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return CookieStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/transports/fetch.js\n var FetchTransport = (\n /** @class */\n (function(_super) {\n __extends(FetchTransport2, _super);\n function FetchTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FetchTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var options, response, responseText;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (typeof fetch === "undefined") {\n throw new Error("FetchTransport is not supported");\n }\n options = {\n headers: {\n "Content-Type": "application/json",\n Accept: "*/*"\n },\n body: JSON.stringify(payload),\n method: "POST"\n };\n return [4, fetch(serverUrl, options)];\n case 1:\n response = _a.sent();\n return [4, response.text()];\n case 2:\n responseText = _a.sent();\n try {\n return [2, this.buildResponse(JSON.parse(responseText))];\n } catch (_b) {\n return [2, this.buildResponse({ code: response.status })];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return FetchTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js\n var omitUndefined = function(input) {\n var obj = {};\n for (var key in input) {\n var val = input[key];\n if (val) {\n obj[key] = val;\n }\n }\n return obj;\n };\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js\n var pageViewTrackingPlugin = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var globalScope = getGlobalScope();\n var loggerProvider = void 0;\n var pushState;\n var _a = __read(args, 2), clientOrOptions = _a[0], configOrUndefined = _a[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var createPageViewEvent = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a2;\n var _b;\n var _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n _b = {\n event_type: (_c = options.eventType) !== null && _c !== void 0 ? _c : "Page View"\n };\n _a2 = [{}];\n return [4, getCampaignParams()];\n case 1:\n return [2, (_b.event_properties = __assign.apply(void 0, [__assign.apply(void 0, _a2.concat([_d.sent()])), { page_domain: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.hostname || ""\n ), page_location: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href || ""\n ), page_path: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.pathname || ""\n ), page_title: (\n /* istanbul ignore next */\n typeof document !== "undefined" && document.title || ""\n ), page_url: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href.split("?")[0] || ""\n ) }]), _b)];\n }\n });\n });\n };\n var shouldTrackOnPageLoad = function() {\n return typeof options.trackOn === "undefined" || typeof options.trackOn === "function" && options.trackOn();\n };\n var previousURL = typeof location !== "undefined" ? location.href : null;\n var trackHistoryPageView = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var newURL, shouldTrackPageView, _a2, _b, _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n newURL = location.href;\n shouldTrackPageView = shouldTrackHistoryPageView(options.trackHistoryChanges, newURL, previousURL || "") && shouldTrackOnPageLoad();\n previousURL = newURL;\n if (!shouldTrackPageView) return [3, 4];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Tracking page view event");\n if (!(amplitude === null || amplitude === void 0)) return [3, 1];\n _a2 = void 0;\n return [3, 3];\n case 1:\n _c = (_b = amplitude).track;\n return [4, createPageViewEvent()];\n case 2:\n _a2 = _c.apply(_b, [_d.sent()]);\n _d.label = 3;\n case 3:\n _a2;\n _d.label = 4;\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n var trackHistoryPageViewWrapper = function() {\n void trackHistoryPageView();\n };\n var plugin = {\n name: "page-view-tracking",\n type: PluginType.ENRICHMENT,\n setup: function(config, client) {\n return __awaiter(void 0, void 0, void 0, function() {\n var receivedType, _a2, _b;\n var _c, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n loggerProvider = config.loggerProvider;\n loggerProvider.log("Installing @amplitude/plugin-page-view-tracking-browser");\n options.trackOn = ((_c = config.attribution) === null || _c === void 0 ? void 0 : _c.trackPageViews) ? "attribution" : options.trackOn;\n if (!client && ((_d = config.attribution) === null || _d === void 0 ? void 0 : _d.trackPageViews)) {\n loggerProvider.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser.");\n config.attribution.trackPageViews = false;\n }\n if (options.trackHistoryChanges && globalScope) {\n globalScope.addEventListener("popstate", trackHistoryPageViewWrapper);\n pushState = globalScope.history.pushState;\n globalScope.history.pushState = new Proxy(globalScope.history.pushState, {\n apply: function(target, thisArg, _a3) {\n var _b2 = __read(_a3, 3), state = _b2[0], unused = _b2[1], url = _b2[2];\n target.apply(thisArg, [state, unused, url]);\n void trackHistoryPageView();\n }\n });\n }\n if (!shouldTrackOnPageLoad()) return [3, 2];\n loggerProvider.log("Tracking page view event");\n _b = (_a2 = amplitude).track;\n return [4, createPageViewEvent()];\n case 1:\n _b.apply(_a2, [_e.sent()]);\n _e.label = 2;\n case 2:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n var pageViewEvent;\n return __generator(this, function(_a2) {\n switch (_a2.label) {\n case 0:\n if (!(options.trackOn === "attribution" && isCampaignEvent(event))) return [3, 2];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Enriching campaign event to page view event with campaign parameters");\n return [4, createPageViewEvent()];\n case 1:\n pageViewEvent = _a2.sent();\n event.event_type = pageViewEvent.event_type;\n event.event_properties = __assign(__assign({}, event.event_properties), pageViewEvent.event_properties);\n _a2.label = 2;\n case 2:\n return [2, event];\n }\n });\n });\n },\n teardown: function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n if (globalScope) {\n globalScope.removeEventListener("popstate", trackHistoryPageViewWrapper);\n if (pushState) {\n globalScope.history.pushState = pushState;\n }\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n }\n };\n plugin.__trackHistoryPageView = trackHistoryPageView;\n return plugin;\n };\n var getCampaignParams = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _a = omitUndefined;\n return [4, new CampaignParser().parse()];\n case 1:\n return [2, _a.apply(void 0, [_b.sent()])];\n }\n });\n });\n };\n var isCampaignEvent = function(event) {\n if (event.event_type === "$identify" && event.user_properties) {\n var properties = event.user_properties;\n var $set = properties[IdentifyOperation.SET] || {};\n var $unset = properties[IdentifyOperation.UNSET] || {};\n var userProperties_1 = __spreadArray(__spreadArray([], __read(Object.keys($set)), false), __read(Object.keys($unset)), false);\n return Object.keys(BASE_CAMPAIGN).every(function(value) {\n return userProperties_1.includes(value);\n });\n }\n return false;\n };\n var shouldTrackHistoryPageView = function(trackingOption, newURL, oldURL) {\n switch (trackingOption) {\n case "pathOnly":\n return newURL.split("?")[0] !== oldURL.split("?")[0];\n default:\n return newURL !== oldURL;\n }\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/helpers.js\n var getStorageKey = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var domainWithoutSubdomain = function(domain) {\n var parts = domain.split(".");\n if (parts.length <= 2) {\n return domain;\n }\n return parts.slice(parts.length - 2, parts.length).join(".");\n };\n var isNewCampaign = function(current, previous, options) {\n var _a;\n var referrer = current.referrer, referring_domain = current.referring_domain, currentCampaign = __rest(current, ["referrer", "referring_domain"]);\n var _b = previous || {}, _previous_referrer = _b.referrer, prevReferringDomain = _b.referring_domain, previousCampaign = __rest(_b, ["referrer", "referring_domain"]);\n if (current.referring_domain && ((_a = options.excludeReferrers) === null || _a === void 0 ? void 0 : _a.includes(current.referring_domain))) {\n return false;\n }\n var hasNewCampaign = JSON.stringify(currentCampaign) !== JSON.stringify(previousCampaign);\n var hasNewDomain = domainWithoutSubdomain(referring_domain || "") !== domainWithoutSubdomain(prevReferringDomain || "");\n return !previous || hasNewCampaign || hasNewDomain;\n };\n var createCampaignEvent = function(campaign, options) {\n var campaignParameters = __assign(__assign({}, BASE_CAMPAIGN), campaign);\n var identifyEvent = Object.entries(campaignParameters).reduce(function(identify2, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n identify2.setOnce("initial_".concat(key), (_b = value !== null && value !== void 0 ? value : options.initialEmptyValue) !== null && _b !== void 0 ? _b : "EMPTY");\n if (value) {\n return identify2.set(key, value);\n }\n return identify2.unset(key);\n }, new Identify());\n return createIdentifyEvent(identifyEvent);\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/web-attribution.js\n var webAttributionPlugin = function() {\n var _this = this;\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var _b = __read(args, 2), clientOrOptions = _b[0], configOrUndefined = _b[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var excludeReferrers = (_a = options.excludeReferrers) !== null && _a !== void 0 ? _a : [];\n if (typeof location !== "undefined") {\n excludeReferrers.unshift(location.hostname);\n }\n options = __assign(__assign({ disabled: false, initialEmptyValue: "EMPTY", resetSessionOnNewCampaign: false }, options), { excludeReferrers });\n var plugin = {\n name: "web-attribution",\n type: PluginType.BEFORE,\n setup: function(config, client) {\n var _a2;\n return __awaiter(this, void 0, void 0, function() {\n var receivedType, storage, storageKey, _b2, currentCampaign, previousCampaign, pluginEnabledOverride, campaignEvent;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n if (options.disabled) {\n config.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n config.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser.");\n if (!client && !((_a2 = config.attribution) === null || _a2 === void 0 ? void 0 : _a2.disabled)) {\n config.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser.");\n config.attribution = {\n disabled: true\n };\n }\n storage = config.cookieStorage;\n storageKey = getStorageKey(config.apiKey, "MKTG");\n return [4, Promise.all([\n new CampaignParser().parse(),\n storage.get(storageKey)\n ])];\n case 1:\n _b2 = __read.apply(void 0, [_c.sent(), 2]), currentCampaign = _b2[0], previousCampaign = _b2[1];\n pluginEnabledOverride = this.__pluginEnabledOverride;\n if (pluginEnabledOverride !== null && pluginEnabledOverride !== void 0 ? pluginEnabledOverride : isNewCampaign(currentCampaign, previousCampaign, options)) {\n if (options.resetSessionOnNewCampaign) {\n amplitude.setSessionId(Date.now());\n config.loggerProvider.log("Created a new session for new campaign.");\n }\n config.loggerProvider.log("Tracking attribution.");\n campaignEvent = createCampaignEvent(currentCampaign, options);\n amplitude.track(campaignEvent);\n void storage.set(storageKey, currentCampaign);\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(_this, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n return [2, event];\n });\n });\n }\n };\n plugin.__pluginEnabledOverride = void 0;\n return plugin;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js\n var MAX_ARRAY_LENGTH = 1e3;\n var LocalStorage = (\n /** @class */\n (function() {\n function LocalStorage2(config) {\n this.loggerProvider = config === null || config === void 0 ? void 0 : config.loggerProvider;\n }\n LocalStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var random, testStorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n random = String(Date.now());\n testStorage = new LocalStorage2();\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStorage.set(testKey, random)];\n case 2:\n _b.sent();\n return [4, testStorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === random];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n return [4, this.getRaw(key)];\n case 1:\n value = _b.sent();\n if (!value) {\n return [2, void 0];\n }\n return [2, JSON.parse(value)];\n case 2:\n _a = _b.sent();\n return [2, void 0];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n return [2, ((_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.getItem(key)) || void 0];\n });\n });\n };\n LocalStorage2.prototype.set = function(key, value) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var isExceededArraySize, serializedValue, droppedEventsCount;\n return __generator(this, function(_c) {\n isExceededArraySize = Array.isArray(value) && value.length > MAX_ARRAY_LENGTH;\n try {\n serializedValue = isExceededArraySize ? JSON.stringify(value.slice(0, MAX_ARRAY_LENGTH)) : JSON.stringify(value);\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.setItem(key, serializedValue);\n } catch (_d) {\n }\n if (isExceededArraySize) {\n droppedEventsCount = value.length - MAX_ARRAY_LENGTH;\n (_b = this.loggerProvider) === null || _b === void 0 ? void 0 : _b.error("Failed to save ".concat(droppedEventsCount, " events because the queue length exceeded ").concat(MAX_ARRAY_LENGTH, "."));\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.remove = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.removeItem(key);\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.reset = function() {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.clear();\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return LocalStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js\n var XHRTransport = (\n /** @class */\n (function(_super) {\n __extends(XHRTransport2, _super);\n function XHRTransport2() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n done: 4\n };\n return _this;\n }\n XHRTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n if (typeof XMLHttpRequest === "undefined") {\n reject(new Error("XHRTransport is not supported."));\n }\n var xhr = new XMLHttpRequest();\n xhr.open("POST", serverUrl, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === _this.state.done) {\n try {\n var responsePayload = xhr.responseText;\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n xhr.setRequestHeader("Content-Type", "application/json");\n xhr.setRequestHeader("Accept", "*/*");\n xhr.send(JSON.stringify(payload));\n })];\n });\n });\n };\n return XHRTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js\n var SendBeaconTransport = (\n /** @class */\n (function(_super) {\n __extends(SendBeaconTransport2, _super);\n function SendBeaconTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SendBeaconTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n var globalScope = getGlobalScope();\n if (!(globalScope === null || globalScope === void 0 ? void 0 : globalScope.navigator.sendBeacon)) {\n throw new Error("SendBeaconTransport is not supported");\n }\n try {\n var data = JSON.stringify(payload);\n var success = globalScope.navigator.sendBeacon(serverUrl, JSON.stringify(payload));\n if (success) {\n return resolve(_this.buildResponse({\n code: 200,\n events_ingested: payload.events.length,\n payload_size_bytes: data.length,\n server_upload_time: Date.now()\n }));\n }\n return resolve(_this.buildResponse({ code: 500 }));\n } catch (e) {\n reject(e);\n }\n })];\n });\n });\n };\n return SendBeaconTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/config.js\n var getDefaultConfig2 = function() {\n var cookieStorage = new MemoryStorage();\n var trackingOptions = {\n deviceManufacturer: true,\n deviceModel: true,\n ipAddress: true,\n language: true,\n osName: true,\n osVersion: true,\n platform: true\n };\n return {\n cookieExpiration: 365,\n cookieSameSite: "Lax",\n cookieSecure: false,\n cookieStorage,\n cookieUpgrade: true,\n disableCookies: false,\n domain: "",\n sessionTimeout: 30 * 60 * 1e3,\n trackingOptions,\n transportProvider: new FetchTransport()\n };\n };\n var BrowserConfig = (\n /** @class */\n (function(_super) {\n __extends(BrowserConfig2, _super);\n function BrowserConfig2(apiKey, options) {\n var _this = this;\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n var defaultConfig = getDefaultConfig2();\n _this = _super.call(this, __assign(__assign({ flushIntervalMillis: 1e3, flushMaxRetries: 5, flushQueueSize: 30, transportProvider: defaultConfig.transportProvider }, options), { apiKey })) || this;\n _this._optOut = false;\n _this.cookieStorage = (_a = options === null || options === void 0 ? void 0 : options.cookieStorage) !== null && _a !== void 0 ? _a : defaultConfig.cookieStorage;\n _this.deviceId = options === null || options === void 0 ? void 0 : options.deviceId;\n _this.lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n _this.lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n _this.optOut = Boolean(options === null || options === void 0 ? void 0 : options.optOut);\n _this.sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n _this.userId = options === null || options === void 0 ? void 0 : options.userId;\n _this.appVersion = options === null || options === void 0 ? void 0 : options.appVersion;\n _this.attribution = options === null || options === void 0 ? void 0 : options.attribution;\n _this.cookieExpiration = (_b = options === null || options === void 0 ? void 0 : options.cookieExpiration) !== null && _b !== void 0 ? _b : defaultConfig.cookieExpiration;\n _this.cookieSameSite = (_c = options === null || options === void 0 ? void 0 : options.cookieSameSite) !== null && _c !== void 0 ? _c : defaultConfig.cookieSameSite;\n _this.cookieSecure = (_d = options === null || options === void 0 ? void 0 : options.cookieSecure) !== null && _d !== void 0 ? _d : defaultConfig.cookieSecure;\n _this.cookieUpgrade = (_e = options === null || options === void 0 ? void 0 : options.cookieUpgrade) !== null && _e !== void 0 ? _e : defaultConfig.cookieUpgrade;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.disableCookies = (_f = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _f !== void 0 ? _f : defaultConfig.disableCookies;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.domain = (_g = options === null || options === void 0 ? void 0 : options.domain) !== null && _g !== void 0 ? _g : defaultConfig.domain;\n _this.partnerId = options === null || options === void 0 ? void 0 : options.partnerId;\n _this.sessionTimeout = (_h = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _h !== void 0 ? _h : defaultConfig.sessionTimeout;\n _this.trackingOptions = (_j = options === null || options === void 0 ? void 0 : options.trackingOptions) !== null && _j !== void 0 ? _j : defaultConfig.trackingOptions;\n return _this;\n }\n Object.defineProperty(BrowserConfig2.prototype, "deviceId", {\n get: function() {\n return this._deviceId;\n },\n set: function(deviceId) {\n if (this._deviceId !== deviceId) {\n this._deviceId = deviceId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "userId", {\n get: function() {\n return this._userId;\n },\n set: function(userId) {\n if (this._userId !== userId) {\n this._userId = userId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "sessionId", {\n get: function() {\n return this._sessionId;\n },\n set: function(sessionId) {\n if (this._sessionId !== sessionId) {\n this._sessionId = sessionId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n if (this._optOut !== optOut) {\n this._optOut = optOut;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventTime", {\n get: function() {\n return this._lastEventTime;\n },\n set: function(lastEventTime) {\n if (this._lastEventTime !== lastEventTime) {\n this._lastEventTime = lastEventTime;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventId", {\n get: function() {\n return this._lastEventId;\n },\n set: function(lastEventId) {\n if (this._lastEventId !== lastEventId) {\n this._lastEventId = lastEventId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n BrowserConfig2.prototype.updateStorage = function() {\n var _a;\n var cache = {\n deviceId: this._deviceId,\n userId: this._userId,\n sessionId: this._sessionId,\n optOut: this._optOut,\n lastEventTime: this._lastEventTime,\n lastEventId: this._lastEventId\n };\n void ((_a = this.cookieStorage) === null || _a === void 0 ? void 0 : _a.set(getCookieName(this.apiKey), cache));\n };\n return BrowserConfig2;\n })(Config)\n );\n var useBrowserConfig = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var defaultConfig, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, cookieStorage, domain, _a, _b, _c;\n var _d;\n var _e, _f;\n return __generator(this, function(_g) {\n switch (_g.label) {\n case 0:\n defaultConfig = getDefaultConfig2();\n deviceId = (_e = options === null || options === void 0 ? void 0 : options.deviceId) !== null && _e !== void 0 ? _e : UUID();\n lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n optOut = options === null || options === void 0 ? void 0 : options.optOut;\n sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n userId = options === null || options === void 0 ? void 0 : options.userId;\n cookieStorage = options === null || options === void 0 ? void 0 : options.cookieStorage;\n domain = options === null || options === void 0 ? void 0 : options.domain;\n _a = BrowserConfig.bind;\n _b = [void 0, apiKey];\n _c = [__assign({}, options)];\n _d = { cookieStorage, deviceId, domain, lastEventId, lastEventTime, optOut, sessionId };\n return [4, createEventsStorage(options)];\n case 1:\n return [2, new (_a.apply(BrowserConfig, _b.concat([__assign.apply(void 0, _c.concat([(_d.storageProvider = _g.sent(), _d.trackingOptions = __assign(__assign({}, defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions), _d.transportProvider = (_f = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _f !== void 0 ? _f : createTransport(options === null || options === void 0 ? void 0 : options.transport), _d.userId = userId, _d)]))])))()];\n }\n });\n });\n };\n var createCookieStorage = function(overrides, baseConfig) {\n if (baseConfig === void 0) {\n baseConfig = getDefaultConfig2();\n }\n return __awaiter(void 0, void 0, void 0, function() {\n var options, cookieStorage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n options = __assign(__assign({}, baseConfig), overrides);\n cookieStorage = overrides === null || overrides === void 0 ? void 0 : overrides.cookieStorage;\n _a = !cookieStorage;\n if (_a) return [3, 2];\n return [4, cookieStorage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (_a) {\n return [2, createFlexibleStorage(options)];\n }\n return [2, cookieStorage];\n }\n });\n });\n };\n var createFlexibleStorage = function(options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n storage = new CookieStorage({\n domain: options.domain,\n expirationDays: options.cookieExpiration,\n sameSite: options.cookieSameSite,\n secure: options.cookieSecure\n });\n _a = options.disableCookies;\n if (_a) return [3, 2];\n return [4, storage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (!_a) return [3, 4];\n storage = new LocalStorage();\n return [4, storage.isEnabled()];\n case 3:\n if (!_b.sent()) {\n storage = new MemoryStorage();\n }\n _b.label = 4;\n case 4:\n return [2, storage];\n }\n });\n });\n };\n var createEventsStorage = function(overrides) {\n return __awaiter(void 0, void 0, void 0, function() {\n var hasStorageProviderProperty, loggerProvider, _a, _b, storage, _c, e_1_1;\n var e_1, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n hasStorageProviderProperty = overrides && Object.prototype.hasOwnProperty.call(overrides, "storageProvider");\n loggerProvider = overrides && overrides.loggerProvider;\n if (!(!hasStorageProviderProperty || overrides.storageProvider)) return [3, 9];\n _e.label = 1;\n case 1:\n _e.trys.push([1, 7, 8, 9]);\n _a = __values([overrides === null || overrides === void 0 ? void 0 : overrides.storageProvider, new LocalStorage({ loggerProvider })]), _b = _a.next();\n _e.label = 2;\n case 2:\n if (!!_b.done) return [3, 6];\n storage = _b.value;\n _c = storage;\n if (!_c) return [3, 4];\n return [4, storage.isEnabled()];\n case 3:\n _c = _e.sent();\n _e.label = 4;\n case 4:\n if (_c) {\n return [2, storage];\n }\n _e.label = 5;\n case 5:\n _b = _a.next();\n return [3, 2];\n case 6:\n return [3, 9];\n case 7:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 9];\n case 8:\n try {\n if (_b && !_b.done && (_d = _a.return)) _d.call(_a);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 9:\n return [2, void 0];\n }\n });\n });\n };\n var createTransport = function(transport) {\n if (transport === TransportType.XHR) {\n return new XHRTransport();\n }\n if (transport === TransportType.SendBeacon) {\n return new SendBeaconTransport();\n }\n return getDefaultConfig2().transportProvider;\n };\n var getTopLevelDomain = function(url) {\n return __awaiter(void 0, void 0, void 0, function() {\n var host, parts, levels, storageKey, i, i, domain, options, storage, value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, new CookieStorage().isEnabled()];\n case 1:\n if (!_a.sent() || !url && typeof location === "undefined") {\n return [2, ""];\n }\n host = url !== null && url !== void 0 ? url : location.hostname;\n parts = host.split(".");\n levels = [];\n storageKey = "AMP_TLDTEST";\n for (i = parts.length - 2; i >= 0; --i) {\n levels.push(parts.slice(i).join("."));\n }\n i = 0;\n _a.label = 2;\n case 2:\n if (!(i < levels.length)) return [3, 7];\n domain = levels[i];\n options = { domain: "." + domain };\n storage = new CookieStorage(options);\n return [4, storage.set(storageKey, 1)];\n case 3:\n _a.sent();\n return [4, storage.get(storageKey)];\n case 4:\n value = _a.sent();\n if (!value) return [3, 6];\n return [4, storage.remove(storageKey)];\n case 5:\n _a.sent();\n return [2, "." + domain];\n case 6:\n i++;\n return [3, 2];\n case 7:\n return [2, ""];\n }\n });\n });\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/constants.js\n var DEFAULT_EVENT_PREFIX = "[Amplitude]";\n var DEFAULT_PAGE_VIEW_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Page Viewed");\n var DEFAULT_FORM_START_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Started");\n var DEFAULT_FORM_SUBMIT_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Submitted");\n var DEFAULT_FILE_DOWNLOAD_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " File Downloaded");\n var DEFAULT_SESSION_START_EVENT = "session_start";\n var DEFAULT_SESSION_END_EVENT = "session_end";\n var FILE_EXTENSION = "".concat(DEFAULT_EVENT_PREFIX, " File Extension");\n var FILE_NAME = "".concat(DEFAULT_EVENT_PREFIX, " File Name");\n var LINK_ID = "".concat(DEFAULT_EVENT_PREFIX, " Link ID");\n var LINK_TEXT = "".concat(DEFAULT_EVENT_PREFIX, " Link Text");\n var LINK_URL = "".concat(DEFAULT_EVENT_PREFIX, " Link URL");\n var FORM_ID = "".concat(DEFAULT_EVENT_PREFIX, " Form ID");\n var FORM_NAME = "".concat(DEFAULT_EVENT_PREFIX, " Form Name");\n var FORM_DESTINATION = "".concat(DEFAULT_EVENT_PREFIX, " Form Destination");\n\n // node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js\n var parseLegacyCookies = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, oldCookieName, cookies, _a, deviceId, userId, optOut, sessionId, lastEventTime, lastEventId;\n var _b;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n return [4, createCookieStorage(options)];\n case 1:\n storage = _c.sent();\n oldCookieName = getOldCookieName(apiKey);\n return [4, storage.getRaw(oldCookieName)];\n case 2:\n cookies = _c.sent();\n if (!cookies) {\n return [2, {\n optOut: false\n }];\n }\n if (!((_b = options.cookieUpgrade) !== null && _b !== void 0 ? _b : getDefaultConfig2().cookieUpgrade)) return [3, 4];\n return [4, storage.remove(oldCookieName)];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4:\n _a = __read(cookies.split("."), 6), deviceId = _a[0], userId = _a[1], optOut = _a[2], sessionId = _a[3], lastEventTime = _a[4], lastEventId = _a[5];\n return [2, {\n deviceId,\n userId: decode(userId),\n sessionId: parseTime(sessionId),\n lastEventId: parseTime(lastEventId),\n lastEventTime: parseTime(lastEventTime),\n optOut: Boolean(optOut)\n }];\n }\n });\n });\n };\n var parseTime = function(num) {\n var integer = parseInt(num, 32);\n if (isNaN(integer)) {\n return void 0;\n }\n return integer;\n };\n var decode = function(value) {\n if (!atob || !escape || !value) {\n return void 0;\n }\n try {\n return decodeURIComponent(escape(atob(value)));\n } catch (_a) {\n return void 0;\n }\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var import_ua_parser_js = __toESM(require_ua_parser());\n\n // node_modules/@amplitude/analytics-browser/lib/esm/version.js\n var VERSION = "1.13.4";\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var BROWSER_PLATFORM = "Web";\n var IP_ADDRESS = "$remote";\n var Context = (\n /** @class */\n (function() {\n function Context2() {\n this.name = "context";\n this.type = PluginType.BEFORE;\n this.library = "amplitude-ts/".concat(VERSION);\n if (typeof navigator !== "undefined") {\n this.userAgent = navigator.userAgent;\n }\n this.uaResult = new import_ua_parser_js.default(this.userAgent).getResult();\n }\n Context2.prototype.setup = function(config) {\n this.config = config;\n return Promise.resolve(void 0);\n };\n Context2.prototype.execute = function(context) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var time, osName, osVersion, deviceModel, deviceVendor, lastEventId, nextEventId, event;\n return __generator(this, function(_c) {\n time = (/* @__PURE__ */ new Date()).getTime();\n osName = this.uaResult.browser.name;\n osVersion = this.uaResult.browser.version;\n deviceModel = this.uaResult.device.model || this.uaResult.os.name;\n deviceVendor = this.uaResult.device.vendor;\n lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n nextEventId = (_b = context.event_id) !== null && _b !== void 0 ? _b : lastEventId + 1;\n this.config.lastEventId = nextEventId;\n if (!context.time) {\n this.config.lastEventTime = time;\n }\n event = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ user_id: this.config.userId, device_id: this.config.deviceId, session_id: this.config.sessionId, time }, this.config.appVersion && { app_version: this.config.appVersion }), this.config.trackingOptions.platform && { platform: BROWSER_PLATFORM }), this.config.trackingOptions.osName && { os_name: osName }), this.config.trackingOptions.osVersion && { os_version: osVersion }), this.config.trackingOptions.deviceManufacturer && { device_manufacturer: deviceVendor }), this.config.trackingOptions.deviceModel && { device_model: deviceModel }), this.config.trackingOptions.language && { language: getLanguage2() }), this.config.trackingOptions.ipAddress && { ip: IP_ADDRESS }), { insert_id: UUID(), partner_id: this.config.partnerId, plan: this.config.plan }), this.config.ingestionMetadata && {\n ingestion_metadata: {\n source_name: this.config.ingestionMetadata.sourceName,\n source_version: this.config.ingestionMetadata.sourceVersion\n }\n }), context), { event_id: nextEventId, library: this.library, user_agent: this.userAgent });\n return [2, event];\n });\n });\n };\n return Context2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/default-page-view-event-enrichment.js\n var eventPropertyMap = {\n page_domain: "".concat(DEFAULT_EVENT_PREFIX, " Page Domain"),\n page_location: "".concat(DEFAULT_EVENT_PREFIX, " Page Location"),\n page_path: "".concat(DEFAULT_EVENT_PREFIX, " Page Path"),\n page_title: "".concat(DEFAULT_EVENT_PREFIX, " Page Title"),\n page_url: "".concat(DEFAULT_EVENT_PREFIX, " Page URL")\n };\n var defaultPageViewEventEnrichment = function() {\n var name = "@amplitude/plugin-default-page-view-event-enrichment-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, void 0];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (event.event_type === DEFAULT_PAGE_VIEW_EVENT && event.event_properties) {\n event.event_properties = Object.entries(event.event_properties).reduce(function(acc, _a2) {\n var _b = __read(_a2, 2), key = _b[0], value = _b[1];\n var transformedPropertyName = eventPropertyMap[key];\n if (transformedPropertyName) {\n acc[transformedPropertyName] = value;\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n }\n return [2, event];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js\n var fileDownloadTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-file-download-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFileDownloadListener, ext, links;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFileDownloadListener = function(a) {\n var url;\n try {\n url = new URL(a.href, window.location.href);\n } catch (_a2) {\n return;\n }\n var result = ext.exec(url.href);\n var fileExtension = result === null || result === void 0 ? void 0 : result[1];\n if (fileExtension) {\n addEventListener(a, "click", function() {\n var _a2;\n if (fileExtension) {\n amplitude.track(DEFAULT_FILE_DOWNLOAD_EVENT, (_a2 = {}, _a2[FILE_EXTENSION] = fileExtension, _a2[FILE_NAME] = url.pathname, _a2[LINK_ID] = a.id, _a2[LINK_TEXT] = a.text, _a2[LINK_URL] = a.href, _a2));\n }\n });\n }\n };\n ext = /\\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/;\n links = Array.from(document.getElementsByTagName("a"));\n links.forEach(addFileDownloadListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "A") {\n addFileDownloadListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("a")).map(addFileDownloadListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js\n var formInteractionTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-form-interaction-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFormInteractionListener, forms;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFormInteractionListener = function(form) {\n var hasFormChanged = false;\n addEventListener(form, "change", function() {\n var _a2;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n hasFormChanged = true;\n });\n addEventListener(form, "submit", function() {\n var _a2, _b;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n amplitude.track(DEFAULT_FORM_SUBMIT_EVENT, (_b = {}, _b[FORM_ID] = form.id, _b[FORM_NAME] = form.name, _b[FORM_DESTINATION] = form.action, _b));\n hasFormChanged = false;\n });\n };\n forms = Array.from(document.getElementsByTagName("form"));\n forms.forEach(addFormInteractionListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "FORM") {\n addFormInteractionListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("form")).map(addFormInteractionListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js\n var convertProxyObjectToRealObject = function(instance, queue) {\n for (var i = 0; i < queue.length; i++) {\n var _a = queue[i], name_1 = _a.name, args = _a.args, resolve = _a.resolve;\n var fn = instance && instance[name_1];\n if (typeof fn === "function") {\n var result = fn.apply(instance, args);\n if (typeof resolve === "function") {\n resolve(result === null || result === void 0 ? void 0 : result.promise);\n }\n }\n }\n return instance;\n };\n var isInstanceProxy = function(instance) {\n var instanceProxy = instance;\n return instanceProxy && instanceProxy._q !== void 0;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js\n var AmplitudeBrowser = (\n /** @class */\n (function(_super) {\n __extends(AmplitudeBrowser2, _super);\n function AmplitudeBrowser2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AmplitudeBrowser2.prototype.init = function(apiKey, userId, options) {\n if (apiKey === void 0) {\n apiKey = "";\n }\n return returnWrapper(this._init(__assign(__assign({}, options), { userId, apiKey })));\n };\n AmplitudeBrowser2.prototype._init = function(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _r, _s, _t, _u, _v, _w;\n return __awaiter(this, void 0, void 0, function() {\n var _x, _y, _z, legacyCookies, cookieStorage, previousCookies, queryParams, deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, browserOptions, isNewSession, connector, webAttribution, pageViewTrackingOptions;\n var _this = this;\n return __generator(this, function(_0) {\n switch (_0.label) {\n case 0:\n if (this.initializing) {\n return [\n 2\n /*return*/\n ];\n }\n this.initializing = true;\n _x = options;\n if (!options.disableCookies) return [3, 1];\n _y = "";\n return [3, 5];\n case 1:\n if (!((_a = options.domain) !== null && _a !== void 0)) return [3, 2];\n _z = _a;\n return [3, 4];\n case 2:\n return [4, getTopLevelDomain()];\n case 3:\n _z = _0.sent();\n _0.label = 4;\n case 4:\n _y = _z;\n _0.label = 5;\n case 5:\n _x.domain = _y;\n return [4, parseLegacyCookies(options.apiKey, options)];\n case 6:\n legacyCookies = _0.sent();\n return [4, createCookieStorage(options)];\n case 7:\n cookieStorage = _0.sent();\n return [4, cookieStorage.get(getCookieName(options.apiKey))];\n case 8:\n previousCookies = _0.sent();\n queryParams = getQueryParams();\n deviceId = (_d = (_c = (_b = options.deviceId) !== null && _b !== void 0 ? _b : queryParams.deviceId) !== null && _c !== void 0 ? _c : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _d !== void 0 ? _d : legacyCookies.deviceId;\n sessionId = (_e = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _e !== void 0 ? _e : legacyCookies.sessionId;\n optOut = (_g = (_f = options.optOut) !== null && _f !== void 0 ? _f : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _g !== void 0 ? _g : legacyCookies.optOut;\n lastEventId = (_h = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _h !== void 0 ? _h : legacyCookies.lastEventId;\n lastEventTime = (_j = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _j !== void 0 ? _j : legacyCookies.lastEventTime;\n userId = (_l = (_k = options.userId) !== null && _k !== void 0 ? _k : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _l !== void 0 ? _l : legacyCookies.userId;\n this.previousSessionDeviceId = (_m = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _m !== void 0 ? _m : legacyCookies.deviceId;\n this.previousSessionUserId = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _o !== void 0 ? _o : legacyCookies.userId;\n return [4, useBrowserConfig(options.apiKey, __assign(__assign({}, options), { deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, cookieStorage }))];\n case 9:\n browserOptions = _0.sent();\n return [4, _super.prototype._init.call(this, browserOptions)];\n case 10:\n _0.sent();\n isNewSession = false;\n if (\n // user has never sent an event\n !this.config.lastEventTime || // user has no previous session ID\n !this.config.sessionId || // has sent an event and has previous session but expired\n this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout\n ) {\n this.setSessionId((_r = (_p = options.sessionId) !== null && _p !== void 0 ? _p : this.config.sessionId) !== null && _r !== void 0 ? _r : Date.now());\n isNewSession = true;\n }\n connector = getAnalyticsConnector(options.instanceName);\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId\n });\n return [4, this.add(new Destination()).promise];\n case 11:\n _0.sent();\n return [4, this.add(new Context()).promise];\n case 12:\n _0.sent();\n return [4, this.add(new IdentityEventSender()).promise];\n case 13:\n _0.sent();\n if (!isFileDownloadTrackingEnabled(this.config.defaultTracking)) return [3, 15];\n return [4, this.add(fileDownloadTracking()).promise];\n case 14:\n _0.sent();\n _0.label = 15;\n case 15:\n if (!isFormInteractionTrackingEnabled(this.config.defaultTracking)) return [3, 17];\n return [4, this.add(formInteractionTracking()).promise];\n case 16:\n _0.sent();\n _0.label = 17;\n case 17:\n if (!!((_s = this.config.attribution) === null || _s === void 0 ? void 0 : _s.disabled)) return [3, 19];\n webAttribution = webAttributionPlugin({\n excludeReferrers: (_t = this.config.attribution) === null || _t === void 0 ? void 0 : _t.excludeReferrers,\n initialEmptyValue: (_u = this.config.attribution) === null || _u === void 0 ? void 0 : _u.initialEmptyValue,\n resetSessionOnNewCampaign: (_v = this.config.attribution) === null || _v === void 0 ? void 0 : _v.resetSessionOnNewCampaign\n });\n webAttribution.__pluginEnabledOverride = isNewSession || ((_w = this.config.attribution) === null || _w === void 0 ? void 0 : _w.trackNewCampaigns) ? void 0 : false;\n return [4, this.add(webAttribution).promise];\n case 18:\n _0.sent();\n _0.label = 19;\n case 19:\n pageViewTrackingOptions = getPageViewTrackingConfig(this.config);\n pageViewTrackingOptions.eventType = pageViewTrackingOptions.eventType || DEFAULT_PAGE_VIEW_EVENT;\n return [4, this.add(pageViewTrackingPlugin(pageViewTrackingOptions)).promise];\n case 20:\n _0.sent();\n return [4, this.add(defaultPageViewEventEnrichment()).promise];\n case 21:\n _0.sent();\n this.initializing = false;\n return [4, this.runQueuedFunctions("dispatchQ")];\n case 22:\n _0.sent();\n connector.eventBridge.setEventReceiver(function(event) {\n void _this.track(event.eventType, event.eventProperties);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeBrowser2.prototype.getUserId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.userId;\n };\n AmplitudeBrowser2.prototype.setUserId = function(userId) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n if (userId !== this.config.userId || userId === void 0) {\n this.config.userId = userId;\n setConnectorUserId(userId, this.config.instanceName);\n }\n };\n AmplitudeBrowser2.prototype.getDeviceId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.deviceId;\n };\n AmplitudeBrowser2.prototype.setDeviceId = function(deviceId) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n setConnectorDeviceId(deviceId, this.config.instanceName);\n };\n AmplitudeBrowser2.prototype.setOptOut = function(optOut) {\n setConnectorOptOut(optOut, this.config.instanceName);\n _super.prototype.setOptOut.call(this, optOut);\n };\n AmplitudeBrowser2.prototype.reset = function() {\n this.setDeviceId(UUID());\n this.setUserId(void 0);\n };\n AmplitudeBrowser2.prototype.getSessionId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionId;\n };\n AmplitudeBrowser2.prototype.setSessionId = function(sessionId) {\n var _a;\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n if (sessionId === this.config.sessionId) {\n return;\n }\n var previousSessionId = this.getSessionId();\n var lastEventTime = this.config.lastEventTime;\n var lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n this.config.sessionId = sessionId;\n this.config.lastEventTime = void 0;\n if (isSessionTrackingEnabled(this.config.defaultTracking)) {\n if (previousSessionId && lastEventTime) {\n this.track(DEFAULT_SESSION_END_EVENT, void 0, {\n device_id: this.previousSessionDeviceId,\n event_id: ++lastEventId,\n session_id: previousSessionId,\n time: lastEventTime + 1,\n user_id: this.previousSessionUserId\n });\n }\n this.config.lastEventTime = this.config.sessionId;\n this.track(DEFAULT_SESSION_START_EVENT, void 0, {\n event_id: ++lastEventId,\n session_id: this.config.sessionId,\n time: this.config.lastEventTime\n });\n }\n this.previousSessionDeviceId = this.config.deviceId;\n this.previousSessionUserId = this.config.userId;\n };\n AmplitudeBrowser2.prototype.extendSession = function() {\n if (!this.config) {\n this.q.push(this.extendSession.bind(this));\n return;\n }\n this.config.lastEventTime = Date.now();\n };\n AmplitudeBrowser2.prototype.setTransport = function(transport) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n };\n AmplitudeBrowser2.prototype.identify = function(identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return _super.prototype.identify.call(this, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return _super.prototype.groupIdentify.call(this, groupType, groupName, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.revenue = function(revenue2, eventOptions) {\n if (isInstanceProxy(revenue2)) {\n var queue = revenue2._q;\n revenue2._q = [];\n revenue2 = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return _super.prototype.revenue.call(this, revenue2, eventOptions);\n };\n AmplitudeBrowser2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var currentTime, lastEventTime, timeSinceLastEvent;\n return __generator(this, function(_a) {\n currentTime = Date.now();\n lastEventTime = this.config.lastEventTime || Date.now();\n timeSinceLastEvent = currentTime - lastEventTime;\n if (event.event_type !== DEFAULT_SESSION_START_EVENT && event.event_type !== DEFAULT_SESSION_END_EVENT && (!event.session_id || event.session_id === this.getSessionId()) && timeSinceLastEvent > this.config.sessionTimeout) {\n this.setSessionId(currentTime);\n }\n return [2, _super.prototype.process.call(this, event)];\n });\n });\n };\n return AmplitudeBrowser2;\n })(AmplitudeCore)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js\n var createInstance = function() {\n var client = new AmplitudeBrowser();\n return {\n init: debugWrapper(client.init.bind(client), "init", getClientLogConfig(client), getClientStates(client, ["config"])),\n add: debugWrapper(client.add.bind(client), "add", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n remove: debugWrapper(client.remove.bind(client), "remove", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n track: debugWrapper(client.track.bind(client), "track", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n logEvent: debugWrapper(client.logEvent.bind(client), "logEvent", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n identify: debugWrapper(client.identify.bind(client), "identify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n groupIdentify: debugWrapper(client.groupIdentify.bind(client), "groupIdentify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n setGroup: debugWrapper(client.setGroup.bind(client), "setGroup", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n revenue: debugWrapper(client.revenue.bind(client), "revenue", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n flush: debugWrapper(client.flush.bind(client), "flush", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n getUserId: debugWrapper(client.getUserId.bind(client), "getUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n setUserId: debugWrapper(client.setUserId.bind(client), "setUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n getDeviceId: debugWrapper(client.getDeviceId.bind(client), "getDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n setDeviceId: debugWrapper(client.setDeviceId.bind(client), "setDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n reset: debugWrapper(client.reset.bind(client), "reset", getClientLogConfig(client), getClientStates(client, ["config", "config.userId", "config.deviceId"])),\n getSessionId: debugWrapper(client.getSessionId.bind(client), "getSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n setSessionId: debugWrapper(client.setSessionId.bind(client), "setSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n extendSession: debugWrapper(client.extendSession.bind(client), "extendSession", getClientLogConfig(client), getClientStates(client, ["config"])),\n setOptOut: debugWrapper(client.setOptOut.bind(client), "setOptOut", getClientLogConfig(client), getClientStates(client, ["config"])),\n setTransport: debugWrapper(client.setTransport.bind(client), "setTransport", getClientLogConfig(client), getClientStates(client, ["config"]))\n };\n };\n var browser_client_factory_default = createInstance();\n\n // node_modules/@amplitude/analytics-browser/lib/esm/index.js\n var add = browser_client_factory_default.add;\n var extendSession = browser_client_factory_default.extendSession;\n var flush = browser_client_factory_default.flush;\n var getDeviceId = browser_client_factory_default.getDeviceId;\n var getSessionId = browser_client_factory_default.getSessionId;\n var getUserId = browser_client_factory_default.getUserId;\n var groupIdentify = browser_client_factory_default.groupIdentify;\n var identify = browser_client_factory_default.identify;\n var init = browser_client_factory_default.init;\n var logEvent = browser_client_factory_default.logEvent;\n var remove = browser_client_factory_default.remove;\n var reset = browser_client_factory_default.reset;\n var revenue = browser_client_factory_default.revenue;\n var setDeviceId = browser_client_factory_default.setDeviceId;\n var setGroup = browser_client_factory_default.setGroup;\n var setOptOut = browser_client_factory_default.setOptOut;\n var setSessionId = browser_client_factory_default.setSessionId;\n var setTransport = browser_client_factory_default.setTransport;\n var setUserId = browser_client_factory_default.setUserId;\n var track = browser_client_factory_default.track;\n\n // packages/dev-tools/client/tracking.ts\n var dispatch = (eventName) => {\n window.dispatchEvent(\n new CustomEvent(`builderdevtools`, { detail: { eventName } })\n );\n };\n async function loadUserDataFromLocal() {\n return apiLocalConfig();\n }\n var initTracking = async () => {\n const url = new URL(window.location.href);\n const hash = url.hash;\n const userIdHash = `#${CONNECTED_USER_ID_QS}=`;\n const uniqueId = Math.random().toString(36).substring(2, 15);\n const localConfig = await loadUserDataFromLocal();\n init("f1d2eb79aecd01b28c8a371ea5d1751c", localConfig?.userId || uniqueId, {\n logLevel: esm_exports.LogLevel.None,\n serverUrl: AMPLITUDE_PROXY_URL,\n flushIntervalMillis: 500\n });\n const identifyObj = new Identify();\n identify(identifyObj, {\n device_id: localConfig?.deviceId,\n user_id: localConfig?.userId || uniqueId\n });\n let builderUserId = `anonymous`;\n if (hash.startsWith(userIdHash)) {\n builderUserId = hash.slice(userIdHash.length);\n if (builderUserId) {\n setBuilderUserId(builderUserId);\n url.hash = "";\n window.history.replaceState({}, "", url.href);\n }\n }\n dispatch("init");\n };\n var setBuilderUserId = (builderUserId) => {\n if (typeof builderUserId === "string" && builderUserId.length > 0) {\n const t = getTracking();\n setTracking({\n ...t,\n builderUserId\n });\n }\n };\n var getTracking = () => {\n const ls = localStorage.getItem(TRACKING_KEY);\n if (ls) {\n try {\n let t = JSON.parse(ls);\n if (!t.ctas || typeof t.ctas !== "object") {\n t = setTracking({\n ...t,\n ctas: {}\n });\n }\n if (t.menuOpenedTs) {\n t = setTracking({\n ...t,\n ctas: {\n ...t.ctas,\n menuOpened: t.menuOpenedTs\n }\n });\n delete t.menuOpenedTs;\n }\n return t;\n } catch (e) {\n console.error(e);\n }\n }\n return setTracking({\n firstVisitTs: Date.now(),\n ctas: {},\n builderUserId: ""\n });\n };\n var setTracking = (t) => {\n try {\n localStorage.setItem(TRACKING_KEY, JSON.stringify(t));\n } catch (e) {\n console.error(e);\n }\n return t;\n };\n var hasCTA = (ctaName) => {\n const t = getTracking();\n return !!t.ctas[ctaName];\n };\n var setCTA = (ctaName) => {\n const t = getTracking();\n return setTracking({\n ...t,\n ctas: {\n ...t.ctas,\n [ctaName]: Date.now()\n }\n });\n };\n var TRACKING_KEY = "builderDevtools";\n\n // packages/dev-tools/client/menu/pages/component-input.ts\n function initComponentInputSection(shadow) {\n initRegisterInput(shadow);\n initComponentOpenSource(shadow);\n initComponentInputName(shadow);\n initComponentInputType(shadow);\n }\n function initRegisterInput(shadow) {\n const inputReg = shadow.getElementById("input-register");\n inputReg.addEventListener("change", async (ev) => {\n ev.stopPropagation();\n const inputName = shadow.getElementById("input-name");\n const nav = shadow.querySelector(".nav-cmp-input");\n nav.classList.add("input-loading");\n nav.classList.remove("input-enabled");\n const cmpId = inputName.dataset.id;\n const propName = inputName.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name: propName,\n registerInput: inputReg.checked\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentInput(shadow, cmpId, propName);\n renderComponentDetail(shadow, cmpId);\n nav.classList.remove("input-loading");\n });\n }\n function initComponentOpenSource(shadow) {\n const openSourceBtn = shadow.getElementById(\n "input-open-source"\n );\n openSourceBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmp = APP_STATE.components.find((c) => c.id === target?.dataset.id);\n if (cmp) {\n apiLaunchEditor({ filePath: cmp.filePath });\n }\n });\n }\n function initComponentInputName(shadow) {\n const inputName = shadow.getElementById("input-name");\n const inputWrapper = inputName.closest(".ui-text-input");\n let initInputName = "";\n let savedTmr;\n inputName.addEventListener("focus", (ev) => {\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n ev.stopPropagation();\n initInputName = inputName.value;\n });\n inputName.addEventListener("blur", async (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (inputName.value !== initInputName) {\n if (inputName.value.trim().length < 3) {\n inputName.value = initInputName;\n return;\n }\n inputWrapper.classList.add("saved");\n savedTmr = setTimeout(() => {\n inputWrapper.classList.remove("saved");\n }, 3e3);\n const cmpId = inputName.dataset.id;\n const name = inputName.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name,\n friendlyName: inputName.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n renderComponentInput(shadow, cmpId, name);\n }\n });\n inputName.addEventListener("keyup", (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (ev.key === "Escape") {\n inputName.value = initInputName;\n inputName.blur();\n } else if (ev.key === "Enter") {\n inputName.blur();\n }\n });\n }\n function initComponentInputType(shadow) {\n const inputType = shadow.getElementById("input-type");\n inputType.addEventListener("change", async (ev) => {\n ev.stopPropagation();\n const cmpId = inputType.dataset.id;\n const name = inputType.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name,\n type: inputType.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n renderComponentInput(shadow, cmpId, name);\n });\n }\n function renderComponentInput(shadow, cmpId, propName) {\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (!cmp) {\n return null;\n }\n const regInput = cmp.inputs.find((i) => i.name === propName);\n if (!regInput) {\n return null;\n }\n const nav = shadow.querySelector(".nav-cmp-input");\n if (regInput.isRegistered) {\n nav.classList.add("input-enabled");\n } else {\n nav.classList.remove("input-enabled");\n }\n const inputReg = shadow.getElementById("input-register");\n inputReg.checked = !!regInput.isRegistered;\n const title = shadow.getElementById("cmp-input-title");\n title.innerText = cmp.name + ": " + (regInput.friendlyName || regInput.name);\n const openSource = shadow.getElementById("input-open-source");\n openSource.innerText = `Open ${cmp.displayFilePath}`;\n openSource.dataset.id = cmp.id;\n const propNameText = shadow.getElementById("cmp-prop-name");\n propNameText.innerText = regInput.name;\n const propType = shadow.getElementById("cmp-prop-type");\n propType.innerText = getPrimitiveType(regInput.type);\n const inputName = shadow.getElementById("input-name");\n inputName.dataset.id = cmp.id;\n inputName.dataset.prop = regInput.name;\n inputName.value = regInput.friendlyName || regInput.name;\n renderInputTypeSelect(shadow, cmp, regInput);\n return regInput;\n }\n function renderInputTypeSelect(shadow, cmp, cmpInput) {\n const typeSelect = shadow.getElementById("input-type");\n typeSelect.dataset.id = cmp.id;\n typeSelect.dataset.prop = cmpInput.name;\n typeSelect.innerHTML = "";\n const inputType = cmpInput.type;\n const isString = STRING_TYPES.includes(inputType);\n const isNumber = NUMBER_TYPES.includes(inputType);\n const isBoolean = BOOLEAN_TYPES.includes(inputType);\n const isArray = ARRAY_TYPES.includes(inputType);\n const isObject = OBJECT_TYPES.includes(inputType);\n INPUT_TYPES.forEach((t) => {\n const option = document.createElement("option");\n option.value = t.value;\n option.innerText = t.text;\n option.disabled = STRING_TYPES.includes(t.value) && !isString || NUMBER_TYPES.includes(t.value) && !isNumber || BOOLEAN_TYPES.includes(t.value) && !isBoolean || ARRAY_TYPES.includes(t.value) && !isArray || OBJECT_TYPES.includes(t.value) && !isObject;\n typeSelect.appendChild(option);\n });\n typeSelect.value = inputType;\n }\n\n // packages/dev-tools/client/menu/pages/component-detail.ts\n function initComponentDetailSection(shadow) {\n initRegisterComponent(shadow);\n initComponentName(shadow);\n initComponentOpenSource2(shadow);\n initComponentInputList(shadow);\n initInputReload(shadow);\n }\n function initRegisterComponent(shadow) {\n const cmpReg = shadow.getElementById("cmp-register");\n cmpReg.addEventListener("change", (ev) => {\n ev.stopPropagation();\n loadComponentDetail(shadow, "update");\n });\n }\n async function loadComponentDetail(shadow, opt) {\n const cmpDetail = shadow.querySelector(".nav-cmp-detail");\n const cmpError = shadow.getElementById("cmp-error");\n const cmpReg = shadow.getElementById("cmp-register");\n const regSwitchLabel = cmpReg.closest(".ui-switch");\n cmpDetail.classList.remove("cmp-enabled");\n if (cmpReg.checked) {\n cmpDetail.classList.add("cmp-loading");\n }\n try {\n const cmpId = cmpReg.dataset.id;\n let registry;\n if (opt === "load") {\n registry = await apiLoadComponent({ cmpId });\n } else if (cmpReg.checked) {\n registry = await apiRegisterComponent({ cmpId });\n dispatch("registryUpdate");\n track("interaction", {\n type: "click",\n name: "register component",\n detail: cmpId\n });\n } else {\n registry = await apiUnregisterComponent({ cmpId });\n dispatch("registryUpdate");\n track("interaction", {\n type: "click",\n name: "unregister component",\n detail: cmpId\n });\n }\n updateAppState(registry);\n renderComponentList(shadow);\n const cmp = renderComponentDetail(shadow, cmpId);\n if (opt === "update" && cmp) {\n if (cmpReg.checked) {\n cmpDetail.classList.add("cmp-enabled");\n showToast(\n shadow,\n `<strong>${cmp.name}</strong> is now registered in <strong>${APP_STATE.registryDisplayPath}</strong> and available for use in the Builder Visual Editor`\n );\n } else {\n showToast(\n shadow,\n `<strong>${cmp.name}</strong> has been unregistered from <strong>${APP_STATE.registryDisplayPath}</strong> and removed from the Builder Visual Editor`\n );\n }\n }\n } catch (e) {\n console.error(e);\n cmpError.innerHTML = `<p class="error">Error loading components</p><p class="error">${e.message || e}</p>`;\n regSwitchLabel.style.display = "none";\n }\n cmpDetail.classList.remove("cmp-loading");\n }\n function initComponentName(shadow) {\n const cmpName = shadow.getElementById("cmp-name");\n const inputWrapper = cmpName.closest(".ui-text-input");\n let initComponentName2 = "";\n let savedTmr;\n cmpName.addEventListener("focus", (ev) => {\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n ev.stopPropagation();\n initComponentName2 = cmpName.value;\n });\n cmpName.addEventListener("blur", async (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (cmpName.value !== initComponentName2) {\n if (cmpName.value.trim().length < 3) {\n cmpName.value = initComponentName2;\n return;\n }\n inputWrapper.classList.add("saved");\n savedTmr = setTimeout(() => {\n inputWrapper.classList.remove("saved");\n }, 3e3);\n const cmpId = cmpName.dataset.id;\n const registry = await apiSetComponentInfo({\n cmpId,\n name: cmpName.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n }\n });\n cmpName.addEventListener("keyup", (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (ev.key === "Escape") {\n cmpName.value = initComponentName2;\n cmpName.blur();\n } else if (ev.key === "Enter") {\n cmpName.blur();\n }\n });\n }\n function renderComponentDetail(shadow, cmpId) {\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (!cmp) {\n return null;\n }\n const cmpReg = shadow.getElementById("cmp-register");\n const cmpError = shadow.getElementById("cmp-error");\n const regSwitchLabel = cmpReg.closest(".ui-switch");\n regSwitchLabel.style.display = "";\n cmpError.innerHTML = "";\n cmpReg.dataset.id = cmp.id;\n cmpReg.checked = !!cmp.isRegistered;\n const cmpDetail = shadow.querySelector(".nav-cmp-detail");\n if (cmp.isRegistered) {\n cmpDetail.classList.add("cmp-enabled");\n } else {\n cmpDetail.classList.remove("cmp-enabled");\n }\n const cmpName = shadow.getElementById("cmp-name");\n cmpName.dataset.id = cmp.id;\n cmpName.value = cmp.name;\n const openSource = shadow.getElementById("cmp-open-source");\n openSource.innerText = `Open ${cmp.displayFilePath}`;\n openSource.dataset.id = cmp.id;\n const title = shadow.getElementById("cmp-detail-title");\n title.innerText = `${cmp.name} Component`;\n renderComponentDetailInputs(shadow, cmp);\n return cmp;\n }\n function initComponentOpenSource2(shadow) {\n const openSourceBtn = shadow.getElementById(\n "cmp-open-source"\n );\n openSourceBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmp = APP_STATE.components.find((c) => c.id === target?.dataset.id);\n if (cmp) {\n apiLaunchEditor({ filePath: cmp.filePath });\n track("interaction", {\n type: "click",\n name: "open component source file",\n detail: cmp.filePath\n });\n }\n });\n }\n function initInputReload(shadow) {\n const reloadBtn = shadow.getElementById(\n "btn-inputs-reload"\n );\n reloadBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n loadComponentDetail(shadow, "load");\n });\n }\n function initComponentInputList(shadow) {\n const cmpInputList = shadow.getElementById(\n "cmp-detail-inputs"\n );\n cmpInputList.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const button = target?.closest("button");\n const cmpId = button?.dataset.id;\n const propName = button?.dataset.propName;\n const cmpInput = renderComponentInput(shadow, cmpId, propName);\n if (cmpInput) {\n goToSection(shadow, "nav-cmp-input");\n }\n });\n }\n function renderComponentDetailInputs(shadow, cmp) {\n const cmpInputList = shadow.getElementById(\n "cmp-detail-inputs"\n );\n const filteredInputList = cmp.inputs.filter((input) => !input.hideFromUI);\n if (filteredInputList.length > 0) {\n cmpInputList.innerHTML = "";\n filteredInputList.forEach((input) => {\n cmpInputList.appendChild(renderComponentDetailInputItem(cmp, input));\n });\n } else {\n cmpInputList.innerHTML = `<p class="cmp-inputs-empty">${cmp.name} component does not have any props</p>`;\n }\n }\n function renderComponentDetailInputItem(cmp, cmpInput) {\n const item = document.createElement("button");\n item.dataset.id = cmp.id;\n item.dataset.propName = cmpInput.name;\n item.className = "cmp-input-item nav-list-item";\n if (!cmpInput.isRegistered) {\n item.classList.add("cmp-input-item-unregistered");\n }\n const itemIcon = document.createElement("span");\n const type = getPrimitiveType(cmpInput.type);\n itemIcon.className = `nav-list-item-icon input-icon input-icon-${type}`;\n item.appendChild(itemIcon);\n const itemName = document.createElement("span");\n itemName.innerText = cmpInput.friendlyName || cmpInput.name;\n item.appendChild(itemName);\n const itemNote = document.createElement("span");\n itemNote.className = "nav-list-item-note";\n itemNote.innerText = cmpInput.type;\n item.appendChild(itemNote);\n return item;\n }\n\n // packages/dev-tools/client/menu/pages/component-list.ts\n function initComponentListSection(shadow) {\n const openRegistryFile = shadow.getElementById("open-builder-registry");\n openRegistryFile.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n apiLaunchEditor({ filePath: APP_STATE.registryPath, line: 1, column: 1 });\n });\n const cmpList = shadow.getElementById("cmp-list");\n cmpList.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmpId = target?.dataset.id;\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (cmp) {\n const cmpDetail = shadow.querySelector(\n ".nav-cmp-detail .section-content"\n );\n cmpDetail.scrollTop = 0;\n renderComponentDetail(shadow, cmp.id);\n goToSection(shadow, "nav-cmp-detail");\n if (cmp.isRegistered) {\n loadComponentDetail(shadow, "load");\n }\n }\n });\n const searchInput = shadow.getElementById(\n "component-search"\n );\n const clearSearchButton = shadow.getElementById(\n "clear-search"\n );\n searchInput?.addEventListener("input", (event) => {\n const searchTerm = event.target.value.toLowerCase();\n const filteredComponents = searchTerm ? APP_STATE.components.filter(\n (component) => component.name.toLowerCase().includes(searchTerm) || component.displayFilePath?.toLowerCase().includes(searchTerm)\n ) : APP_STATE.components;\n renderComponentList(shadow, filteredComponents);\n clearSearchButton.style.display = searchTerm ? "flex" : "none";\n });\n clearSearchButton?.addEventListener("click", () => {\n searchInput.value = "";\n renderComponentList(shadow);\n clearSearchButton.style.display = "none";\n });\n searchInput?.addEventListener("keydown", (event) => {\n if (event.key === "Escape") {\n searchInput.value = "";\n renderComponentList(shadow);\n clearSearchButton.style.display = "none";\n }\n });\n }\n function loadComponentsSection(shadow) {\n const loadRegistry = apiRegistry();\n renderComponents(shadow, loadRegistry);\n }\n async function renderComponents(shadow, loadRegistry) {\n const cmpList = shadow.getElementById("cmp-list");\n const cmpListSection = shadow.querySelector(".nav-cmp-list");\n cmpListSection.classList.add("nav-loading");\n const openRegistryFile = shadow.getElementById("open-builder-registry");\n try {\n const registry = await loadRegistry;\n updateAppState(registry);\n renderComponentList(shadow);\n if (APP_STATE.registryDisplayPath) {\n openRegistryFile.innerText = "Open " + registry.registryDisplayPath;\n } else {\n openRegistryFile.innerText = "";\n }\n } catch (e) {\n cmpList.innerHTML = `<p class="error">Error loading components</p><p class="error">${e.message || e}</p>`;\n console.error(e);\n }\n cmpListSection.classList.remove("nav-loading");\n }\n function renderComponentList(shadow, filteredComponents) {\n const cmpList = shadow.getElementById("cmp-list");\n cmpList.innerHTML = "";\n const componentsToRender = filteredComponents || APP_STATE.components;\n const registered = componentsToRender.filter((c) => c.isRegistered);\n const unregistered = componentsToRender.filter((c) => !c.isRegistered);\n if (filteredComponents && filteredComponents.length === 0) {\n const noResults = document.createElement("p");\n noResults.className = "no-results";\n noResults.innerText = "No matching components found";\n cmpList.appendChild(noResults);\n return;\n }\n renderComponentListSection(cmpList, "Registered Components", registered);\n renderComponentListSection(cmpList, "Unregistered Components", unregistered);\n }\n function renderComponentListSection(cmpList, listTitle, cmps) {\n if (cmps.length > 0) {\n const cmpsTitle = document.createElement("h4");\n cmpsTitle.innerText = listTitle;\n cmpList.appendChild(cmpsTitle);\n cmps.forEach((c) => {\n cmpList.appendChild(renderComponentListItem(c));\n });\n }\n }\n function renderComponentListItem(cmp) {\n const searchTerm = document.getElementById("component-search")?.value.toLowerCase();\n const item = document.createElement("button");\n item.dataset.id = cmp.id;\n item.className = "cmp-item nav-list-item";\n if (cmp.isRegistered) {\n item.classList.add("registered");\n }\n const itemIcon = document.createElement("span");\n itemIcon.className = "nav-list-item-icon";\n if (cmp.image) {\n itemIcon.style.backgroundImage = `url(${cmp.image})`;\n }\n item.appendChild(itemIcon);\n const itemName = document.createElement("span");\n itemName.className = "nav-list-item-name";\n itemName.innerHTML = highlightMatches(cmp.name, searchTerm);\n item.appendChild(itemName);\n const itemNote = document.createElement("span");\n itemNote.className = "nav-list-item-note";\n itemNote.innerHTML = highlightMatches(cmp.displayFilePath || "", searchTerm);\n item.appendChild(itemNote);\n return item;\n }\n function highlightMatches(text, searchTerm) {\n if (!searchTerm) return text;\n const regex = new RegExp(`(${searchTerm})`, "gi");\n return text.replace(regex, \'<span class="search-highlight">$1</span>\');\n }\n\n // packages/dev-tools/client/menu/toggle/menu-toggle.ts\n var initMenuToggle = (shadow) => {\n shadow.querySelector(".menu-toggle").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, true);\n });\n shadow.getElementById("close").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n });\n shadow.getElementById("hit").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n });\n initBackButtons(shadow);\n shadow.addEventListener("click", (ev) => ev.stopPropagation());\n checkCTAs(shadow);\n };\n var openMenu = (shadow, openDevToolsMenu) => {\n if (openDevToolsMenu) {\n document.body.classList.add("builder-no-scroll");\n shadow.host.classList.add("show-builder-menu");\n dispatch("menuOpen");\n setCTA("menuOpened");\n track("interaction", {\n type: "click",\n name: "open dev-tools menu"\n });\n } else {\n document.body.classList.remove("builder-no-scroll");\n shadow.host.classList.remove("show-builder-menu");\n dispatch("menuClose");\n setTimeout(() => {\n goToSection(shadow, "nav-home");\n }, 300);\n }\n apiDevToolsEnabled(openDevToolsMenu);\n };\n var checkCTAs = (shadow) => {\n if (!hasCTA("menuOpened")) {\n menuToggleToolTipCta(shadow);\n return;\n }\n const t = getTracking();\n const minutesSinceFirstVisit = (Date.now() - t.firstVisitTs) / 1e3 / 60;\n if (minutesSinceFirstVisit < 10) {\n return;\n }\n if (!hasCTA("feedback")) {\n setCTA("feedback");\n feedbackToolTipCta(shadow);\n return;\n }\n };\n var menuToggleToolTipCta = (shadow) => {\n const tooltip = document.createElement("a");\n tooltip.classList.add("menu-toggle-tooltip");\n tooltip.href = `#open-dev-tools`;\n tooltip.innerHTML = `\n <div class="menu-toggle-tooltip-content">\n <h3>Open Builder Devtools</h3>\n <p>Start registering your components</p>\n </div>\n `;\n shadow.appendChild(tooltip);\n setTimeout(() => {\n tooltip.classList.add("menu-toggle-tooltip-show");\n tooltip.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n tooltip.classList.remove("menu-toggle-tooltip-show");\n openMenu(shadow, true);\n });\n }, 1e3);\n };\n var feedbackToolTipCta = (shadow) => {\n const tooltip = document.createElement("a");\n tooltip.classList.add("menu-toggle-tooltip");\n tooltip.href = `https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform`;\n tooltip.target = "_blank";\n tooltip.innerHTML = `\n <div class="menu-toggle-tooltip-content">\n <h3>How\'s Devtools working for you?</h3>\n <p>We\'d love your feedback!</p>\n </div>\n `;\n shadow.appendChild(tooltip);\n setTimeout(() => {\n tooltip.classList.add("menu-toggle-tooltip-show");\n tooltip.addEventListener("click", () => {\n tooltip.classList.remove("menu-toggle-tooltip-show");\n });\n }, 1e3);\n };\n\n // packages/dev-tools/client/menu/pages/home.ts\n function initHomeSection(shadow) {\n const goToBuilder = shadow.getElementById("go-to-builder");\n goToBuilder.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(getEditorUrl(), "builder");\n });\n const componentsLink = shadow.getElementById("components-link");\n componentsLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const cmpList = shadow.querySelector(\n ".nav-cmp-list .section-content"\n );\n cmpList.scrollTop = 0;\n goToSection(shadow, "nav-cmp-list");\n loadComponentsSection(shadow);\n });\n const settingsLink = shadow.getElementById("settings-link");\n settingsLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n goToSection(shadow, "nav-settings");\n });\n const addPageLink = shadow.getElementById("add-page-link");\n addPageLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(getBuilderContentUrl(), "builder");\n });\n const importFromFigma = shadow.getElementById("import-from-figma");\n importFromFigma.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(\n "https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more"\n );\n });\n }\n\n // packages/dev-tools/client/menu/pages/settings.ts\n function initSettingsSection(shadow) {\n const s = shadow.getElementById("enable-edit");\n s.addEventListener("change", (ev) => {\n ev.stopPropagation();\n enableEdit(s.checked);\n });\n s.checked = isEditEnabled();\n enableEdit(s.checked);\n }\n\n // packages/dev-tools/client/menu/index.ts\n var BuilderDevToolsMenu = class extends HTMLElement {\n constructor() {\n super();\n }\n connectedCallback() {\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = `<style>/* packages/dev-tools/client/common.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n:host {\n --background-color: rgba(40, 40, 40, 1);\n --primary-color: rgba(72, 161, 255, 1);\n --primary-color-subdued: rgb(72, 161, 255, 0.6);\n --primary-color-highlight: rgb(126, 188, 255);\n --primary-contrast-color: white;\n --edit-color: #1d74e2;\n --edit-color-highlight: #1c6bd1;\n --edit-color-alpha: rgb(72, 161, 255, 0.15);\n --error-color: #ff2b55;\n --text-color: white;\n --text-color-highlight: white;\n --border-color: #454545;\n --button-background-color-hover: rgba(255, 255, 255, 0.1);\n --menu-width: 320px;\n --transition-time: 150ms;\n --font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n font-family: var(--font-family);\n line-height: 1.6;\n}\nbutton {\n cursor: pointer;\n color: var(--text-color);\n -webkit-tap-highlight-color: transparent;\n}\ninput,\nselect,\nbutton {\n font-family: var(--font-family);\n}\n\n/* packages/dev-tools/client/menu/toggle/menu-toggle.css */\n.menu-toggle {\n position: absolute;\n right: 0;\n bottom: 0;\n pointer-events: auto;\n padding: 8px;\n background: transparent;\n border: none;\n appearance: none;\n}\n.menu-toggle div {\n position: relative;\n width: 64px;\n height: 64px;\n pointer-events: none;\n border-radius: 50%;\n background: black;\n border: 1px solid white;\n box-shadow: rgba(0, 0, 0, 33%) 0px 0 8px;\n}\n.menu-toggle:hover div {\n background-color: var(--background-color);\n border: 1px solid rgb(220, 220, 220);\n}\n.menu-toggle svg {\n position: absolute;\n top: 15px;\n left: 15px;\n width: 33px;\n height: 32px;\n}\ndiv.highlight-bg {\n position: absolute;\n top: -1px;\n left: -1px;\n background-color: rgb(26, 26, 26);\n pointer-events: none;\n transition: all 400ms ease-out;\n opacity: 0;\n}\n.menu-toggle-highlight-no-transition div.highlight-bg {\n transition: none;\n}\n.menu-toggle-highlight div.highlight-bg {\n opacity: 1;\n}\n.menu-toggle-tooltip {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 382px;\n height: 72px;\n padding: 0;\n text-align: left;\n appearance: none;\n background-color: transparent;\n border: none;\n pointer-events: none;\n transform: translate3d(320px, 0, 0);\n opacity: 0;\n transition: all 150ms ease-in-out;\n color: white;\n}\n.menu-toggle-tooltip.menu-toggle-tooltip-show {\n pointer-events: auto;\n opacity: 1;\n transform: translate3d(0, 0, 0);\n}\n.menu-toggle-tooltip-content {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 10px;\n right: 95px;\n padding: 8px 12px;\n background-color: var(--primary-color);\n box-shadow: rgba(0, 0, 0, 33%) 0px 0 20px;\n border-radius: 2px;\n}\n.menu-toggle-tooltip-content::before {\n content: "";\n position: absolute;\n bottom: 15px;\n right: -6px;\n width: 30px;\n height: 30px;\n background-color: var(--primary-color);\n transform: rotate(45deg);\n}\n.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,\n.menu-toggle-tooltip:hover .menu-toggle-tooltip-content::before {\n background-color: var(--primary-color-highlight);\n}\n.menu-toggle-tooltip-content h3 {\n margin: 0;\n font-size: 16px;\n}\n.menu-toggle-tooltip-content p {\n margin: 0;\n font-size: 12px;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-page.css */\nsection {\n position: absolute;\n display: grid;\n grid-template-rows: 64px auto 64px;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n pointer-events: none;\n}\n.section-content {\n margin: 0;\n padding: 0 0 10px 0;\n font-weight: 300;\n transform: translate3d(105%, 0, 0);\n transition: transform var(--transition-time) ease-in-out;\n overflow-y: auto;\n}\n.section-content .error {\n color: var(--error-color);\n font-weight: bold;\n}\nsection a {\n text-decoration: none;\n color: var(--text-color);\n}\nsection h3,\nsection p {\n margin-left: 16px;\n margin-right: 16px;\n}\n.info {\n font-size: 12px;\n}\nul.list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\nul.list li {\n display: block;\n padding: 0;\n margin: 0;\n}\nul.list a,\nul.list button {\n display: grid;\n grid-template-columns: 24px auto;\n grid-gap: 16px;\n padding: 12px;\n margin: 8px 0;\n border: none;\n background: transparent;\n appearance: none;\n width: 100%;\n font-weight: 300;\n text-align: left;\n text-decoration: none;\n color: var(--text-color);\n}\nul.list a:hover,\nul.list button:hover {\n text-decoration: none;\n color: var(--text-color);\n background-color: var(--button-background-color-hover);\n}\nul.list a span,\nul.list button span {\n display: block;\n font-size: 16px;\n font-weight: 500;\n line-height: 1.5;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-header.css */\nheader {\n position: relative;\n display: grid;\n grid-template-columns: 44px 1fr;\n gap: 8px;\n padding-left: 8px;\n border-bottom: 1px solid var(--border-color);\n transition: opacity var(--transition-time) ease-in-out;\n opacity: 0;\n pointer-events: none;\n}\nheader > div {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.nav-home header > div {\n margin-right: 56px;\n}\nheader h2 {\n margin: 7px 0 0 0;\n font-size: 18px;\n font-weight: 500;\n line-height: 1.5;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p {\n margin: 2px 0 0 0;\n font-size: 12px;\n font-weight: 300;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p button {\n display: block;\n margin: 0;\n padding: 0;\n width: 100%;\n text-align: left;\n font-size: 12px;\n font-weight: 300;\n text-decoration: none;\n appearance: none;\n text-align: left;\n background-color: transparent;\n border: none;\n color: var(--primary-color);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p button:hover {\n text-decoration: underline;\n color: var(--primary-color);\n}\n.builder-logo {\n margin: 12px 0 0 8px;\n}\n#close {\n display: block;\n position: absolute;\n appearance: none;\n background: transparent;\n border: none;\n border-radius: 50%;\n margin: 0;\n padding: 0;\n right: 4px;\n top: 8px;\n width: 48px;\n height: 48px;\n z-index: 1;\n opacity: 0.7;\n}\n#close:hover {\n opacity: 1;\n background-color: var(--button-background-color-hover);\n}\n#close svg {\n position: absolute;\n top: 12px;\n left: 12px;\n width: 24px;\n height: 24px;\n fill: currentColor;\n pointer-events: none;\n}\n.back-button {\n position: relative;\n display: block;\n margin: 7px 0 0 -2px;\n width: 48px;\n height: 48px;\n background: transparent;\n border: none;\n appearance: none;\n border-radius: 50%;\n}\n.back-button:hover {\n background-color: var(--button-background-color-hover);\n}\n.back-button svg {\n position: absolute;\n top: 12px;\n left: 12px;\n width: 24px;\n height: 24px;\n fill: currentColor;\n pointer-events: none;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-footer.css */\nfooter {\n border-top: 1px solid var(--border-color);\n transition: opacity var(--transition-time) ease-in-out;\n opacity: 0;\n pointer-events: none;\n}\nsection.nav-cmp-list {\n grid-template-rows: 64px auto 120px;\n}\nfooter a {\n text-decoration: underline;\n color: var(--primary-color);\n}\nfooter a:hover {\n color: var(--primary-color);\n text-decoration: none;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-nav-list.css */\n.nav-list {\n padding: 2px 0;\n}\n.nav-loading {\n pointer-events: none;\n}\n.nav-loading-icon {\n position: absolute;\n display: inline-block;\n top: 170px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.nav-loading .nav-loading-icon {\n opacity: 0.5;\n}\n.nav-list h4 {\n margin: 8px 8px 8px 10px;\n font-size: 14px;\n font-weight: 600;\n}\n.nav-list .nav-list-item + h4 {\n margin-top: 30px;\n}\n.nav-list-item {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n position: relative;\n margin: 2px 0;\n padding: 8px 28px 8px 46px;\n width: 100%;\n font-size: 14px;\n font-weight: 300;\n text-align: left;\n border: none;\n background: transparent;\n appearance: none;\n}\n.nav-list-item:hover {\n background-color: var(--button-background-color-hover);\n}\n.nav-list-item-icon {\n position: absolute;\n top: 4px;\n left: 10px;\n width: 24px;\n height: 24px;\n object-fit: contain;\n filter: invert(100%);\n background-size: 24px 24px;\n background-repeat: no-repeat;\n background-position: center center;\n}\n.nav-list-item span {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n}\n.nav-list-item::after {\n display: block;\n position: absolute;\n content: "";\n background-image: url(\'data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>\');\n background-repeat: no-repeat;\n background-position: 12px 9px;\n top: 0;\n right: 0;\n width: 32px;\n height: 32px;\n pointer-events: none;\n}\n.nav-list-item-note {\n opacity: 0;\n font-size: 12px;\n padding-top: 1px;\n text-align: right;\n}\n.nav-list-item:hover .nav-list-item-note {\n opacity: 0.5;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-select.css */\n.ui-select {\n display: block;\n margin: 8px 0 16px 0;\n padding: 8px 16px 8px 16px;\n cursor: pointer;\n}\n.ui-select h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-select p {\n margin: 8px 0 8px 0;\n font-size: 12px;\n font-weight: 300;\n}\n.ui-select .select {\n position: relative;\n margin: 8px 0 8px 0;\n border-radius: 4px;\n padding: 0;\n line-height: 1.1;\n overflow: hidden;\n border: 1px solid var(--border-color);\n}\n.ui-select select {\n appearance: none;\n background-color: transparent;\n border: none;\n outline: none;\n padding: 8px 32px 8px 8px;\n margin: 0;\n width: 100%;\n font-size: 14px;\n cursor: pointer;\n text-overflow: ellipsis;\n opacity: 0.6;\n color: var(--text-color);\n}\n.ui-select .select::after {\n content: "";\n top: 6px;\n right: 5px;\n width: 24px;\n height: 24px;\n position: absolute;\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n opacity: 0.6;\n}\n.ui-select .select:hover {\n border-color: var(--primary-color-subdued);\n}\n.ui-text-input .select:focus-within {\n border-color: var(--primary-color);\n}\n.ui-text-input .select:focus-within select {\n opacity: 1;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-spinner.css */\n.spinner:after {\n content: " ";\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 auto;\n pointer-events: auto;\n border-radius: 50%;\n border: 3px solid var(--text-color);\n border-color: var(--text-color) transparent var(--text-color) transparent;\n animation: spinner 750ms linear infinite;\n}\n@keyframes spinner {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* packages/dev-tools/client/menu/ui/ui-switch.css */\n.ui-switch {\n display: grid;\n grid-template-columns: auto 48px;\n grid-gap: 20px;\n margin: 8px 0 16px 0;\n padding: 8px 0 8px 16px;\n cursor: pointer;\n}\n.ui-switch > * {\n pointer-events: none;\n}\n.ui-switch input {\n display: none;\n visibility: hidden;\n}\n.ui-switch .switcher {\n display: inline-block;\n border-radius: 100px;\n width: 35px;\n height: 14px;\n background-color: #ccc;\n position: relative;\n top: 6px;\n vertical-align: middle;\n cursor: pointer;\n}\n.ui-switch input[type=checkbox]:checked + .switcher {\n background-color: var(--primary-color-subdued);\n}\n.ui-switch .switcher:before {\n content: "";\n display: block;\n width: 20px;\n height: 20px;\n background-color: var(--text-color);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n position: absolute;\n top: -3px;\n left: 0;\n margin-right: 0;\n transition: all 150ms;\n}\n.ui-switch input[type=checkbox]:checked + .switcher:before {\n left: 100%;\n margin-left: -20px;\n background-color: var(--primary-color);\n}\n.ui-switch h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-switch p {\n margin: 4px 0 0 0;\n font-size: 12px;\n font-weight: 300;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-text-input.css */\n.ui-text-input {\n display: block;\n margin: 8px 0 16px 0;\n padding: 8px 16px 8px 16px;\n cursor: pointer;\n}\n.ui-text-input h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-text-input p {\n margin: 8px 0 8px 0;\n font-size: 12px;\n font-weight: 300;\n}\n.ui-text-input .input {\n position: relative;\n margin: 8px 0 8px 0;\n border: 1px solid var(--border-color);\n border-radius: 4px;\n background: transparent;\n padding: 2px;\n overflow: hidden;\n}\n.ui-text-input input {\n display: block;\n width: 235px;\n font-size: 14px;\n border: none;\n background: transparent;\n padding: 6px;\n appearance: none;\n color: var(--text-color);\n opacity: 0.6;\n outline: none;\n}\n.ui-text-input .input:hover {\n border-color: var(--primary-color-subdued);\n}\n.ui-text-input .input:focus-within {\n border-color: var(--primary-color);\n}\n.ui-text-input .input:focus-within input {\n opacity: 1;\n}\n.ui-text-input .input::after {\n content: "";\n position: absolute;\n top: 5px;\n right: 14px;\n width: 8px;\n height: 17px;\n border: 2px solid rgba(51, 181, 51, 1);\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n opacity: 0;\n transition: opacity 80ms ease-in-out;\n pointer-events: none;\n}\n.ui-text-input.saved .input::after {\n opacity: 1;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-toast.css */\n.ui-toast {\n position: fixed;\n bottom: 8px;\n left: 8px;\n right: 8px;\n padding: 6px 12px;\n font-size: 14px;\n border-radius: 4px;\n transform: translate3d(0, 150%, 0);\n opacity: 0;\n transition: all var(--transition-time) ease-in-out;\n background-color: var(--primary-color-subdued);\n color: var(--text-color);\n pointer-events: none;\n}\n.ui-toast.ui-toast-show {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n pointer-events: auto;\n}\n\n/* packages/dev-tools/client/menu/nav.css */\n[data-view=nav-home] .nav-home .section-content,\n[data-view=nav-cmp-list] .nav-cmp-list .section-content,\n[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,\n[data-view=nav-cmp-input] .nav-cmp-input .section-content,\n[data-view=nav-settings] .nav-settings .section-content {\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n}\n[data-view=nav-home] .nav-home header,\n[data-view=nav-home] .nav-home footer,\n[data-view=nav-cmp-list] .nav-cmp-list header,\n[data-view=nav-cmp-list] .nav-cmp-list footer,\n[data-view=nav-cmp-detail] .nav-cmp-detail header,\n[data-view=nav-cmp-detail] .nav-cmp-detail footer,\n[data-view=nav-cmp-input] .nav-cmp-input header,\n[data-view=nav-cmp-input] .nav-cmp-input footer,\n[data-view=nav-settings] .nav-settings header,\n[data-view=nav-settings] .nav-settings footer {\n opacity: 1;\n pointer-events: auto;\n}\n[data-view=nav-cmp-list] .nav-home .section-content,\n[data-view=nav-cmp-detail] .nav-home .section-content,\n[data-view=nav-cmp-detail] .nav-cmp-list .section-content,\n[data-view=nav-cmp-input] .nav-home .section-content,\n[data-view=nav-cmp-input] .nav-cmp-list .section-content,\n[data-view=nav-cmp-input] .nav-cmp-detail .section-content,\n[data-view=nav-settings] .nav-home .section-content {\n transform: translate3d(-105%, 0, 0);\n}\n\n/* packages/dev-tools/client/menu/pages/component-list.css */\n.cmp-item .nav-list-item-icon {\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>\');\n opacity: 0.3;\n}\n.cmp-item.registered .nav-list-item-icon {\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>\');\n opacity: 0.8;\n}\n.search-highlight {\n background-color: var(--primary-color-alpha);\n padding: 0 2px;\n border-radius: 2px;\n font-weight: 500;\n}\n.search-container {\n position: sticky;\n top: 0;\n z-index: 10;\n padding: 12px 16px;\n background: var(--background-color);\n border-bottom: 1px solid var(--border-color);\n}\n.search-input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n}\n.search-icon {\n position: absolute;\n left: 12px;\n color: var(--text-color-secondary);\n pointer-events: none;\n}\n.component-search-input {\n width: 100%;\n height: 36px;\n padding: 8px 36px;\n border: 1px solid var(--border-color);\n border-radius: 6px;\n background: var(--input-background);\n color: var(--text-color);\n font-size: 14px;\n transition: border-color 0.2s, box-shadow 0.2s;\n}\n.component-search-input:focus {\n outline: none;\n border-color: var(--primary-color);\n box-shadow: 0 0 0 2px var(--primary-color-alpha);\n}\n.component-search-input::placeholder {\n color: var(--text-color-tertiary);\n}\n.clear-search-button {\n position: absolute;\n right: 8px;\n padding: 4px;\n color: var(--text-color-secondary);\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.2s, background-color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.clear-search-button:hover {\n background-color: var(--hover-color);\n}\n.component-search-input:not(:placeholder-shown) + .clear-search-button {\n opacity: 1;\n}\n.no-results {\n padding: 32px 16px;\n text-align: center;\n color: var(--text-color-secondary);\n font-size: 14px;\n}\n\n/* packages/dev-tools/client/menu/pages/component-detail.css */\n#cmp-detail {\n position: relative;\n}\n.cmp-loading {\n pointer-events: none !important;\n}\n.cmp-loading-icon {\n position: absolute;\n display: inline-block;\n top: 170px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.cmp-loading .cmp-loading-icon {\n opacity: 0.5;\n}\n.cmp-cover {\n position: absolute;\n top: 160px;\n left: 0;\n width: 100%;\n height: 100vh;\n background: var(--background-color);\n transform: translate3d(0, 0, 0);\n pointer-events: none;\n display: none;\n}\n[data-view=nav-cmp-detail] .cmp-cover {\n display: block;\n pointer-events: auto;\n}\n.cmp-enabled .cmp-cover {\n transform: translate3d(0, 105%, 0);\n pointer-events: none;\n}\n.section-ready .cmp-cover {\n transition: all var(--transition-time) ease-in-out;\n}\n.cmp-detail-inputs-container {\n margin: 8px 0 16px 0;\n padding: 0;\n}\n.cmp-detail-inputs-container h3 {\n margin: 0 0 6px 0;\n padding-left: 16px;\n padding-right: 8px;\n font-size: 14px;\n font-weight: 500;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.cmp-detail-inputs-reload {\n font-weight: 300;\n font-size: 0.9em;\n text-decoration: none;\n appearance: none;\n text-align: left;\n background-color: transparent;\n border: none;\n color: var(--primary-color);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cmp-detail-inputs-reload:hover {\n text-decoration: underline;\n color: var(--primary-color);\n}\n.cmp-detail-inputs-container .cmp-inputs-empty {\n padding: 0;\n margin-top: 12px;\n font-size: 12px;\n font-weight: 300;\n opacity: 0.5;\n font-style: italic;\n}\n.cmp-detail-inputs-container .nav-list-item-icon {\n opacity: 0.8;\n background-size: 20px 20px;\n background-position: 4px center;\n}\n.input-icon {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>\');\n}\n.input-icon-array {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>\');\n}\n.input-icon-boolean {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>\');\n}\n.input-icon-number {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>\');\n}\n.input-icon-object {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>\');\n}\n.input-icon-string {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>\');\n}\n.cmp-input-item-unregistered {\n opacity: 0.4;\n}\n.cmp-input-item-unregistered .input-icon::after {\n content: "";\n position: absolute;\n top: 11px;\n left: 4px;\n width: 20px;\n height: 2px;\n background-color: black;\n transform: rotate(-45deg);\n}\n\n/* packages/dev-tools/client/menu/pages/component-input.css */\n.cmp-prop-info {\n border-bottom: 1px solid var(--border-color);\n}\n.cmp-input-readonly {\n margin: 16px 0;\n padding: 0 16px;\n display: grid;\n grid-template-columns: 50% 50%;\n gap: 12px;\n}\n.cmp-input-readonly h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.cmp-input-readonly span {\n margin-top: 2px;\n font-size: 12px;\n font-weight: 300;\n opacity: 0.8;\n}\n.cmp-input-detail {\n margin: 16px 0;\n}\n.cmp-input-detail a {\n color: var(--primary-color);\n text-decoration: none;\n}\n.cmp-input-detail a:hover {\n text-decoration: underline;\n}\n.input-cover {\n position: absolute;\n top: 175px;\n left: 0;\n width: 100%;\n height: 100%;\n background: var(--background-color);\n transform: translate3d(0, 0, 0);\n transition: all var(--transition-time) ease-in-out;\n pointer-events: auto;\n}\n.input-enabled .input-cover {\n transform: translate3d(0, 105%, 0);\n pointer-events: none;\n}\n.input-loading-icon {\n position: absolute;\n display: inline-block;\n top: 190px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.input-loading .input-loading-icon {\n opacity: 0.5;\n}\n\n/* packages/dev-tools/client/menu/menu.css */\n:host {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 2147483646;\n user-select: none;\n pointer-events: none;\n color: var(--text-color);\n}\naside {\n position: absolute;\n top: 0;\n right: 0;\n width: var(--menu-width);\n height: 100%;\n transform: translate3d(105%, 0, 0);\n transition: transform var(--transition-time) ease-in-out;\n background: var(--background-color);\n box-shadow: #000000c9 5px 0 20px;\n overflow: hidden;\n z-index: 1;\n}\n:host(.show-builder-menu) aside {\n pointer-events: auto;\n transform: translate3d(0, 0, 0);\n}\n#hit {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: none;\n}\n:host(.show-builder-menu) #hit {\n display: block;\n pointer-events: auto;\n}\n#version {\n position: absolute;\n bottom: 6px;\n right: 6px;\n font-size: 8px;\n color: #9b9b9b;\n}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder\'s selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder\'s Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder\'s Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>`;\n initMenuToggle(shadow);\n initHomeSection(shadow);\n initComponentListSection(shadow);\n initComponentDetailSection(shadow);\n initComponentInputSection(shadow);\n initSettingsSection(shadow);\n this.setAttribute("aria-hidden", "true");\n shadow.getElementById("version").textContent = "v1.18.40-dev.202512101354.78246177d";\n }\n highlightOpener() {\n const menuToggle = this.shadowRoot.querySelector(".menu-toggle");\n menuToggle.classList.add("menu-toggle-highlight");\n menuToggle.classList.add("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight");\n }, 20);\n }, 20);\n }\n };\n\n // packages/dev-tools/client/setup-ui/overview.ts\n var STEP_CSS = `<style>/* packages/dev-tools/client/setup-ui/styles.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml,\nbody,\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n z-index: 2147483646;\n margin: 0;\n padding: 0;\n line-height: 1.8;\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n background-color: rgba(37, 37, 37, 1);\n color: white;\n transition: opacity 250ms ease-in-out;\n}\n:host([aria-hidden="true"]) {\n opacity: 0;\n pointer-events: none;\n}\nmain {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n}\nh1 {\n margin-top: 0;\n font-size: 24px;\n font-weight: 300;\n line-height: 1.4;\n}\np {\n margin: 20px 0;\n font-weight: 300;\n}\nbutton {\n cursor: pointer;\n}\naside {\n position: absolute;\n top: 0;\n left: 0;\n width: 350px;\n height: 100vh;\n padding: 60px 0 0 50px;\n background-color: rgba(18, 18, 18, 1);\n}\naside ul {\n margin: 30px 0 0 0px;\n padding: 0;\n list-style: none;\n}\naside li {\n position: relative;\n margin: 0;\n padding: 20px 10px;\n font-weight: 300;\n}\naside li.highlight {\n color: rgba(72, 161, 255, 1);\n}\naside li.active {\n font-weight: 700;\n}\naside li .circle {\n position: absolute;\n top: 20px;\n left: 10px;\n width: 24px;\n height: 24px;\n border: 3px solid white;\n border-radius: 50%;\n font-size: 14px;\n}\naside li.highlight .circle {\n border-color: rgba(72, 161, 255, 1);\n}\naside li.active .circle::after {\n content: "";\n position: absolute;\n top: 3px;\n left: 3px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle {\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle::after {\n content: "";\n position: absolute;\n top: 2px;\n left: 6px;\n width: 6px;\n height: 13px;\n border: 3px solid black;\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n}\naside li .line {\n position: absolute;\n top: 44px;\n left: 21px;\n width: 3px;\n height: 45px;\n background-color: white;\n}\naside li.completed .line {\n background-color: rgba(72, 161, 255, 1);\n}\naside li span {\n display: block;\n margin-left: 44px;\n}\nnav {\n margin-top: 30px;\n}\nsection {\n position: absolute;\n top: 135px;\n left: 350px;\n padding: 0 80px 0 140px;\n transition: opacity 150ms ease-in-out;\n}\nsection[aria-hidden=true] {\n pointer-events: none;\n opacity: 0;\n}\nsection h1,\nsection p {\n min-width: 300px;\n max-width: 600px;\n}\n.button {\n position: relative;\n display: inline-block;\n color: white;\n background-color: rgba(72, 161, 255, 1);\n border-radius: 4px;\n text-decoration: none;\n padding: 10px 40px 10px 20px;\n white-space: nowrap;\n}\n.button:hover {\n background-color: rgba(72, 161, 255, 0.85);\n}\n#button-icon {\n position: absolute;\n top: 1px;\n right: 5px;\n bottom: 0;\n width: 30px;\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 24px 24px;\n}\n.button[aria-disabled=true] {\n opacity: 0.9;\n background-color: rgba(255, 255, 255, 0.3);\n pointer-events: none;\n padding-right: 60px;\n}\n.button[aria-disabled=true] #button-icon {\n top: 21px;\n right: 29px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background: white;\n color: white;\n animation: dot-flashing 0.5s infinite linear alternate;\n animation-delay: 0.25s;\n}\n.button[aria-disabled=true] #button-icon::before,\n.button[aria-disabled=true] #button-icon::after {\n content: "";\n display: inline-block;\n position: absolute;\n top: 0;\n}\n.button[aria-disabled=true] #button-icon::before {\n left: -12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0s;\n}\n.button[aria-disabled=true] #button-icon::after {\n left: 12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0.5s;\n}\n@keyframes dot-flashing {\n 0% {\n background-color: white;\n }\n 50%, 100% {\n background-color: rgba(255, 255, 255, 0.3);\n }\n}\n.logo {\n margin-left: 9px;\n background: url(\'data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>\');\n background-repeat: no-repeat;\n width: 150px;\n height: 32px;\n}\n@media (max-width: 840px) {\n aside {\n width: 250px;\n padding: 60px 0 0 20px;\n }\n section {\n left: 250px;\n padding: 0 80px;\n }\n}\n@media (max-width: 590px) {\n aside {\n width: 230px;\n padding: 60px 0 0 10px;\n }\n section {\n left: 230px;\n padding: 0 40px;\n }\n}\n#modified-files-message a {\n color: #cbcbcb;\n font-weight: 300;\n text-decoration: underline;\n}\n#modified-files-message a:hover {\n color: white;\n text-decoration: none;\n}\n#restart-warning {\n border-radius: 4px;\n padding: 8px 16px;\n border: 1px solid #fd6b3c;\n background: rgba(253, 107, 60, 0.1);\n}\n#react-router-steps {\n margin: 0px;\n margin-bottom: 5px;\n padding: 0px 20px;\n}\n#need-help {\n color: #48a1ff;\n text-decoration: none;\n}\n#router-message {\n border-radius: 4px;\n padding: 16px;\n border: 1px solid #48a1ff;\n}\n#router-finish-button {\n margin-top: 12px;\n}\n#router-checkbox-div {\n display: flex;\n align-items: center;\n}\n#router-checkbox {\n margin-right: 10px;\n width: 15px;\n height: 15px;\n}\n#success-title {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n#success-title .check-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 2px solid #28a745;\n border-radius: 50%;\n position: relative;\n}\n#success-title .check-icon::before {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 6px;\n height: 12px;\n border: solid #28a745;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -60%) rotate(45deg);\n}\n</style>`;\n var BuilderOverviewStep = class extends HTMLElement {\n constructor() {\n super();\n }\n connectedCallback() {\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = STEP_CSS + `<main>\n <aside>\n <div class="logo"></div>\n\n <ul>\n <li class="highlight active">\n <div class="circle"></div>\n <div class="line"></div>\n <span>Connect Builder.io</span>\n </li>\n <li>\n <div class="circle"></div>\n <div class="line"></div>\n <span>Update App</span>\n </li>\n <li>\n <div class="circle"></div>\n <span>Setup Complete</span>\n </li>\n </ul>\n </aside>\n\n <section>\n <h1>Integrate Builder.io with your project</h1>\n\n <p>\n First, let\'s connect to your Builder.io space to continue with the\n integration\n </p>\n\n <nav>\n <a class="button next-step" href="#">\n <span id="button-text">Get Started</span>\n <span id="button-icon"></span>\n </a>\n </nav>\n </section>\n</main>\n`;\n setBuilderHead();\n const authPath = new URL(BUILDER_AUTH_CONNECT_PATH, DEV_TOOLS_URL);\n authPath.searchParams.set(PREVIEW_URL_QS, location.href);\n const nextStepLinks = shadow.querySelectorAll(".next-step");\n for (const nextStepLink of nextStepLinks) {\n nextStepLink.setAttribute("href", authPath.href);\n }\n track("overview step viewed");\n }\n };\n var setBuilderHead = () => {\n let favicon = document.head.querySelector(\n "link[rel=\'icon\'], link[rel=\'icon shortcut\']"\n );\n if (favicon) {\n favicon.href = "https://cdn.builder.io/favicon.ico";\n favicon.removeAttribute("type");\n } else {\n favicon = document.createElement("link");\n favicon.rel = "icon";\n favicon.href = "https://cdn.builder.io/favicon.ico";\n document.head.appendChild(favicon);\n }\n };\n\n // packages/dev-tools/client/setup-ui/index.ts\n var checkBuilderIntegration = async () => {\n const validatedBuilder = await apiValidateBuilder();\n if (!validatedBuilder.isValid) {\n showOverviewStep();\n }\n };\n var showOverviewStep = () => {\n if (!customElements.get("builder-dev-tools-overview")) {\n customElements.define("builder-dev-tools-overview", BuilderOverviewStep);\n }\n let overview = document.querySelector(\n "builder-dev-tools-overview"\n );\n if (!overview) {\n overview = document.createElement(\n "builder-dev-tools-overview"\n );\n overview.setAttribute("aria-hidden", "true");\n document.body.appendChild(overview);\n }\n setTimeout(() => {\n overview.removeAttribute("aria-hidden");\n }, 32);\n };\n\n // packages/dev-tools/client/index.ts\n var initDevToolsApp = () => {\n try {\n if (!customElements.get("builder-dev-tools-edit")) {\n customElements.define(\n "builder-dev-tools-edit",\n BuilderDevToolsEditButton\n );\n }\n if (!customElements.get("builder-dev-tools-menu")) {\n customElements.define("builder-dev-tools-menu", BuilderDevToolsMenu);\n }\n let menu = document.querySelector("builder-dev-tools-menu");\n if (!menu) {\n menu = document.createElement("builder-dev-tools-menu");\n menu.setAttribute("data-version", "1.18.40-dev.202512101354.78246177d");\n document.body.appendChild(menu);\n }\n let editButton = document.querySelector("builder-dev-tools-edit");\n if (!editButton) {\n editButton = document.createElement("builder-dev-tools-edit");\n document.body.appendChild(editButton);\n }\n let builderStyles = document.getElementById("builder-dev-tools-style");\n if (!builderStyles) {\n builderStyles = document.createElement("style");\n builderStyles.id = "builder-dev-tools-style";\n builderStyles.innerHTML = `.builder-no-scroll{overflow:hidden !important}`;\n document.head.appendChild(builderStyles);\n }\n checkBuilderIntegration();\n initTracking();\n } catch (e) {\n console.error("Builder Devtools:", e);\n }\n };\n if (window.location === window.parent.location) {\n console.debug(`Builder.io Devtools v${"1.18.40-dev.202512101354.78246177d"}`);\n initDevToolsApp();\n }\n})();');
|
|
2105
|
+
return updateClientRuntimeVariables(ctx, '"use strict";\n(() => {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n };\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. "__esModule" has not been set), then set\n // "default" to the CommonJS "module.exports" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,\n mod\n ));\n\n // node_modules/@amplitude/ua-parser-js/src/ua-parser.js\n var require_ua_parser = __commonJS({\n "node_modules/@amplitude/ua-parser-js/src/ua-parser.js"(exports, module) {\n (function(window2, undefined2) {\n "use strict";\n var LIBVERSION = "0.7.33", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION2 = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 350;\n var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook";\n var extend = function(regexes2, extensions) {\n var mergedRegexes = {};\n for (var i in regexes2) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes2[i]);\n } else {\n mergedRegexes[i] = regexes2[i];\n }\n }\n return mergedRegexes;\n }, enumerize = function(arr) {\n var enums = {};\n for (var i = 0; i < arr.length; i++) {\n enums[arr[i].toUpperCase()] = arr[i];\n }\n return enums;\n }, has = function(str1, str2) {\n return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n }, lowerize = function(str) {\n return str.toLowerCase();\n }, majorize = function(version) {\n return typeof version === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split(".")[0] : undefined2;\n }, trim = function(str, len) {\n if (typeof str === STR_TYPE) {\n str = str.replace(/^\\s\\s*/, EMPTY);\n return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n }\n };\n var rgxMapper = function(ua, arrays) {\n var i = 0, j, k, p, q, matches, match;\n while (i < arrays.length && !matches) {\n var regex = arrays[i], props = arrays[i + 1];\n j = k = 0;\n while (j < regex.length && !matches) {\n matches = regex[j++].exec(ua);\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length === 2) {\n if (typeof q[1] == FUNC_TYPE) {\n this[q[0]] = q[1].call(this, match);\n } else {\n this[q[0]] = q[1];\n }\n } else if (q.length === 3) {\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;\n } else {\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;\n }\n } else if (q.length === 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;\n }\n } else {\n this[q] = match ? match : undefined2;\n }\n }\n }\n }\n i += 2;\n }\n }, strMapper = function(str, map) {\n for (var i in map) {\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (has(map[i][j], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n } else if (has(map[i], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n return str;\n };\n var oldSafariMap = {\n "1.0": "/8",\n 1.2: "/1",\n 1.3: "/3",\n "2.0": "/412",\n "2.0.2": "/416",\n "2.0.3": "/417",\n "2.0.4": "/419",\n "?": "/"\n }, windowsVersionMap = {\n ME: "4.90",\n "NT 3.11": "NT3.51",\n "NT 4.0": "NT4.0",\n 2e3: "NT 5.0",\n XP: ["NT 5.1", "NT 5.2"],\n Vista: "NT 6.0",\n 7: "NT 6.1",\n 8: "NT 6.2",\n 8.1: "NT 6.3",\n 10: ["NT 6.4", "NT 10.0"],\n RT: "ARM"\n };\n var regexes = {\n browser: [\n [\n /\\b(?:crmo|crios)\\/([\\w\\.]+)/i\n // Chrome for Android/iOS\n ],\n [VERSION2, [NAME, "Chrome"]],\n [\n /edg(?:e|ios|a)?\\/([\\w\\.]+)/i\n // Microsoft Edge\n ],\n [VERSION2, [NAME, "Edge"]],\n [\n // Presto based\n /(opera mini)\\/([-\\w\\.]+)/i,\n // Opera Mini\n /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,\n // Opera Mobi/Tablet\n /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i\n // Opera\n ],\n [NAME, VERSION2],\n [\n /opios[\\/ ]+([\\w\\.]+)/i\n // Opera mini on iphone >= 8.0\n ],\n [VERSION2, [NAME, OPERA + " Mini"]],\n [\n /\\bopr\\/([\\w\\.]+)/i\n // Opera Webkit\n ],\n [VERSION2, [NAME, OPERA]],\n [\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,\n // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,\n // Avant/IEMobile/SlimBrowser\n /(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,\n // Baidu Browser\n /(?:ms|\\()(ie) ([\\w\\.]+)/i,\n // Internet Explorer\n // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,\n // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n /(weibo)__([\\d\\.]+)/i\n // Weibo\n ],\n [NAME, VERSION2],\n [\n /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i\n // UCBrowser\n ],\n [VERSION2, [NAME, "UC" + BROWSER]],\n [\n /microm.+\\bqbcore\\/([\\w\\.]+)/i,\n // WeChat Desktop for Windows Built-in Browser\n /\\bqbcore\\/([\\w\\.]+).+microm/i\n ],\n [VERSION2, [NAME, "WeChat(Win) Desktop"]],\n [\n /micromessenger\\/([\\w\\.]+)/i\n // WeChat\n ],\n [VERSION2, [NAME, "WeChat"]],\n [\n /konqueror\\/([\\w\\.]+)/i\n // Konqueror\n ],\n [VERSION2, [NAME, "Konqueror"]],\n [\n /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i\n // IE11\n ],\n [VERSION2, [NAME, "IE"]],\n [\n /yabrowser\\/([\\w\\.]+)/i\n // Yandex\n ],\n [VERSION2, [NAME, "Yandex"]],\n [\n /(avast|avg)\\/([\\w\\.]+)/i\n // Avast/AVG Secure Browser\n ],\n [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION2],\n [\n /\\bfocus\\/([\\w\\.]+)/i\n // Firefox Focus\n ],\n [VERSION2, [NAME, FIREFOX + " Focus"]],\n [\n /\\bopt\\/([\\w\\.]+)/i\n // Opera Touch\n ],\n [VERSION2, [NAME, OPERA + " Touch"]],\n [\n /coc_coc\\w+\\/([\\w\\.]+)/i\n // Coc Coc Browser\n ],\n [VERSION2, [NAME, "Coc Coc"]],\n [\n /dolfin\\/([\\w\\.]+)/i\n // Dolphin\n ],\n [VERSION2, [NAME, "Dolphin"]],\n [\n /coast\\/([\\w\\.]+)/i\n // Opera Coast\n ],\n [VERSION2, [NAME, OPERA + " Coast"]],\n [\n /miuibrowser\\/([\\w\\.]+)/i\n // MIUI Browser\n ],\n [VERSION2, [NAME, "MIUI " + BROWSER]],\n [\n /fxios\\/([-\\w\\.]+)/i\n // Firefox for iOS\n ],\n [VERSION2, [NAME, FIREFOX]],\n [\n /\\bqihu|(qi?ho?o?|360)browser/i\n // 360\n ],\n [[NAME, "360 " + BROWSER]],\n [/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],\n [[NAME, /(.+)/, "$1 " + BROWSER], VERSION2],\n [\n // Oculus/Samsung/Sailfish/Huawei Browser\n /(comodo_dragon)\\/([\\w\\.]+)/i\n // Comodo Dragon\n ],\n [[NAME, /_/g, " "], VERSION2],\n [\n /(electron)\\/([\\w\\.]+) safari/i,\n // Electron-based App\n /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,\n // Tesla\n /m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i\n // QQBrowser/Baidu App/2345 Browser\n ],\n [NAME, VERSION2],\n [\n /(metasr)[\\/ ]?([\\w\\.]+)/i,\n // SouGouBrowser\n /(lbbrowser)/i,\n // LieBao Browser\n /\\[(linkedin)app\\]/i\n // LinkedIn App for iOS & Android\n ],\n [NAME],\n [\n // WebView\n /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i\n // Facebook App for iOS & Android\n ],\n [[NAME, FACEBOOK], VERSION2],\n [\n /safari (line)\\/([\\w\\.]+)/i,\n // Line App for iOS\n /\\b(line)\\/([\\w\\.]+)\\/iab/i,\n // Line App for Android\n /(chromium|instagram)[\\/ ]([-\\w\\.]+)/i\n // Chromium/Instagram\n ],\n [NAME, VERSION2],\n [\n /\\bgsa\\/([\\w\\.]+) .*safari\\//i\n // Google Search Appliance on iOS\n ],\n [VERSION2, [NAME, "GSA"]],\n [\n /headlesschrome(?:\\/([\\w\\.]+)| )/i\n // Chrome Headless\n ],\n [VERSION2, [NAME, CHROME + " Headless"]],\n [\n / wv\\).+(chrome)\\/([\\w\\.]+)/i\n // Chrome WebView\n ],\n [[NAME, CHROME + " WebView"], VERSION2],\n [\n /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i\n // Android Browser\n ],\n [VERSION2, [NAME, "Android " + BROWSER]],\n [\n /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i\n // Chrome/OmniWeb/Arora/Tizen/Nokia\n ],\n [NAME, VERSION2],\n [\n /version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i\n // Mobile Safari\n ],\n [VERSION2, [NAME, "Mobile Safari"]],\n [\n /version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i\n // Safari & Safari Mobile\n ],\n [VERSION2, NAME],\n [\n /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i\n // Safari < 3.0\n ],\n [NAME, [VERSION2, strMapper, oldSafariMap]],\n [/(webkit|khtml)\\/([\\w\\.]+)/i],\n [NAME, VERSION2],\n [\n // Gecko based\n /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i\n // Netscape\n ],\n [[NAME, "Netscape"], VERSION2],\n [\n /mobile vr; rv:([\\w\\.]+)\\).+firefox/i\n // Firefox Reality\n ],\n [VERSION2, [NAME, FIREFOX + " Reality"]],\n [\n /ekiohf.+(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(swiftfox)/i,\n // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(firefox)\\/([\\w\\.]+)/i,\n // Other Firefox-based\n /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,\n // Mozilla\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n /(links) \\(([\\w\\.]+)/i\n // Links\n ],\n [NAME, VERSION2],\n [\n /(cobalt)\\/([\\w\\.]+)/i\n // Cobalt\n ],\n [NAME, [VERSION2, /master.|lts./, ""]]\n ],\n cpu: [\n [\n /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i\n // AMD64 (x64)\n ],\n [[ARCHITECTURE, "amd64"]],\n [\n /(ia32(?=;))/i\n // IA32 (quicktime)\n ],\n [[ARCHITECTURE, lowerize]],\n [\n /((?:i[346]|x)86)[;\\)]/i\n // IA32 (x86)\n ],\n [[ARCHITECTURE, "ia32"]],\n [\n /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i\n // ARM64\n ],\n [[ARCHITECTURE, "arm64"]],\n [\n /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i\n // ARMHF\n ],\n [[ARCHITECTURE, "armhf"]],\n [\n // PocketPC mistakenly identified as PowerPC\n /windows (ce|mobile); ppc;/i\n ],\n [[ARCHITECTURE, "arm"]],\n [\n /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i\n // PowerPC\n ],\n [[ARCHITECTURE, /ower/, EMPTY, lowerize]],\n [\n /(sun4\\w)[;\\)]/i\n // SPARC\n ],\n [[ARCHITECTURE, "sparc"]],\n [\n /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ],\n [[ARCHITECTURE, lowerize]]\n ],\n device: [\n [\n //////////////////////////\n // MOBILES & TABLETS\n // Ordered by popularity\n /////////////////////////\n // Samsung\n /\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]],\n [\n /\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,\n /samsung[- ]([-\\w]+)/i,\n /sec-(sgh\\w+)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]],\n [\n // Apple\n /((ipod|iphone)\\d+,\\d+)/i\n // iPod/iPhone model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /(ipad\\d+,\\d+)/i\n // iPad model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [\n /\\((ip(?:hone|od)[\\w ]*);/i\n // iPod/iPhone\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /\\((ipad);[-\\w\\),; ]+apple/i,\n // iPad\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [/(macintosh);/i],\n [MODEL, [VENDOR, APPLE]],\n [\n // Huawei\n /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]],\n [\n /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n /\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]],\n [\n // Xiaomi\n /\\b(poco[\\w ]+)(?: bui|\\))/i,\n // Xiaomi POCO\n /\\b; (\\w+) build\\/hm\\1/i,\n // Xiaomi Hongmi \'numeric\' models\n /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,\n // Xiaomi Hongmi\n /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,\n // Xiaomi Redmi\n /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i\n // Xiaomi Mi\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, MOBILE]\n ],\n [\n /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i\n // Mi Pad tablets\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, TABLET]\n ],\n [\n // OPPO\n /; (\\w+) bui.+ oppo/i,\n /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i\n ],\n [MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]],\n [\n // Vivo\n /vivo (\\w+)(?: bui|\\))/i,\n /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n ],\n [MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]],\n [\n // Realme\n /\\b(rmx[12]\\d{3})(?: bui|;|\\))/i\n ],\n [MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]],\n [\n // Motorola\n /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n /\\bmot(?:orola)?[- ](\\w*)/i,\n /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n ],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]],\n [/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]],\n [\n // LG\n /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, TABLET]],\n [\n /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n /\\blg-?([\\d\\w]+) bui/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, MOBILE]],\n [\n // Lenovo\n /(ideatab[-\\w ]+)/i,\n /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n ],\n [MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]],\n [\n // Nokia\n /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n /nokia[-_ ]?([-\\w\\.]*)/i\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, "Nokia"],\n [TYPE, MOBILE]\n ],\n [\n // Google\n /(pixel c)\\b/i\n // Google Pixel C\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]],\n [\n /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i\n // Google Pixel\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]],\n [\n // Sony\n /droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ],\n [MODEL, [VENDOR, SONY], [TYPE, MOBILE]],\n [/sony tablet [ps]/i, /\\b(?:sony)?sgp\\w+(?: bui|\\))/i],\n [\n [MODEL, "Xperia Tablet"],\n [VENDOR, SONY],\n [TYPE, TABLET]\n ],\n [\n // OnePlus\n / (kb2005|in20[12]5|be20[12][59])\\b/i,\n /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n ],\n [MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]],\n [\n // Amazon\n /(alexa)webm/i,\n /(kf[a-z]{2}wi)( bui|\\))/i,\n // Kindle Fire without Silk\n /(kf[a-z]+)( bui|\\)).+silk\\//i\n // Kindle Fire HD\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]],\n [\n /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i\n // Fire Phone\n ],\n [\n [MODEL, /(.+)/g, "Fire Phone $1"],\n [VENDOR, AMAZON],\n [TYPE, MOBILE]\n ],\n [\n // BlackBerry\n /(playbook);[-\\w\\),; ]+(rim)/i\n // BlackBerry PlayBook\n ],\n [MODEL, VENDOR, [TYPE, TABLET]],\n [\n /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n /\\(bb10; (\\w+)/i\n // BlackBerry 10\n ],\n [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]],\n [\n // Asus\n /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n ],\n [MODEL, [VENDOR, ASUS], [TYPE, TABLET]],\n [/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],\n [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]],\n [\n // HTC\n /(nexus 9)/i\n // HTC Nexus 9\n ],\n [MODEL, [VENDOR, "HTC"], [TYPE, TABLET]],\n [\n /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,\n // HTC\n // ZTE\n /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n /(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i\n // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ],\n [VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]],\n [\n // Acer\n /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n ],\n [MODEL, [VENDOR, "Acer"], [TYPE, TABLET]],\n [\n // Meizu\n /droid.+; (m[1-5] note) bui/i,\n /\\bmz-([-\\w]{2,})/i\n ],\n [MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]],\n [\n // Sharp\n /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]],\n [\n // MIXED\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,\n // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp) ([\\w ]+\\w)/i,\n // HP iPAQ\n /(asus)-?(\\w+)/i,\n // Asus\n /(microsoft); (lumia[\\w ]+)/i,\n // Microsoft Lumia\n /(lenovo)[-_ ]?([-\\w]+)/i,\n // Lenovo\n /(jolla)/i,\n // Jolla\n /(oppo) ?([\\w ]+) bui/i\n // OPPO\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(archos) (gamepad2?)/i,\n // Archos\n /(hp).+(touchpad(?!.+tablet)|tablet)/i,\n // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(nook)[\\w ]+build\\/(\\w+)/i,\n // Nook\n /(dell) (strea[kpr\\d ]*[\\dko])/i,\n // Dell Streak\n /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,\n // Le Pan Tablets\n /(trinity)[- ]*(t\\d{3}) bui/i,\n // Trinity Tablets\n /(gigaset)[- ]+(q\\w{1,9}) bui/i,\n // Gigaset Tablets\n /(vodafone) ([\\w ]+)(?:\\)| bui)/i\n // Vodafone\n ],\n [VENDOR, MODEL, [TYPE, TABLET]],\n [\n /(surface duo)/i\n // Surface Duo\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]],\n [\n /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i\n // Fairphone\n ],\n [MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]],\n [\n /(u304aa)/i\n // AT&T\n ],\n [MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]],\n [\n /\\bsie-(\\w*)/i\n // Siemens\n ],\n [MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]],\n [\n /\\b(rct\\w+) b/i\n // RCA Tablets\n ],\n [MODEL, [VENDOR, "RCA"], [TYPE, TABLET]],\n [\n /\\b(venue[\\d ]{2,7}) b/i\n // Dell Venue Tablets\n ],\n [MODEL, [VENDOR, "Dell"], [TYPE, TABLET]],\n [\n /\\b(q(?:mv|ta)\\w+) b/i\n // Verizon Tablet\n ],\n [MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]],\n [\n /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i\n // Barnes & Noble Tablet\n ],\n [MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]],\n [/\\b(tm\\d{3}\\w+) b/i],\n [MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]],\n [\n /\\b(k88) b/i\n // ZTE K Series Tablet\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]],\n [\n /\\b(nx\\d{3}j) b/i\n // ZTE Nubia\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]],\n [\n /\\b(gen\\d{3}) b.+49h/i\n // Swiss GEN Mobile\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]],\n [\n /\\b(zur\\d{3}) b/i\n // Swiss ZUR Tablet\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]],\n [\n /\\b((zeki)?tb.*\\b) b/i\n // Zeki Tablets\n ],\n [MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]],\n [\n /\\b([yr]\\d{2}) b/i,\n /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i\n // Dragon Touch Tablet\n ],\n [[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]],\n [\n /\\b(ns-?\\w{0,9}) b/i\n // Insignia Tablets\n ],\n [MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]],\n [\n /\\b((nxa|next)-?\\w{0,9}) b/i\n // NextBook Tablets\n ],\n [MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]],\n [\n /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i\n // Voice Xtreme Phones\n ],\n [[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(lvtel\\-)?(v1[12]) b/i\n // LvTel Phones\n ],\n [[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(ph-1) /i\n // Essential PH-1\n ],\n [MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]],\n [\n /\\b(v(100md|700na|7011|917g).*\\b) b/i\n // Envizen Tablets\n ],\n [MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]],\n [\n /\\b(trio[-\\w\\. ]+) b/i\n // MachSpeed Tablets\n ],\n [MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]],\n [\n /\\btu_(1491) b/i\n // Rotor Tablets\n ],\n [MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]],\n [\n /(shield[\\w ]+) b/i\n // Nvidia Shield Tablets\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]],\n [\n /(sprint) (\\w+)/i\n // Sprint Phones\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(kin\\.[onetw]{3})/i\n // Microsoft Kin\n ],\n [\n [MODEL, /\\./g, " "],\n [VENDOR, MICROSOFT],\n [TYPE, MOBILE]\n ],\n [\n /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i\n // Zebra\n ],\n [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]],\n [/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]],\n [\n ///////////////////\n // CONSOLES\n ///////////////////\n /(ouya)/i,\n // Ouya\n /(nintendo) ([wids3utch]+)/i\n // Nintendo\n ],\n [VENDOR, MODEL, [TYPE, CONSOLE]],\n [\n /droid.+; (shield) bui/i\n // Nvidia\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]],\n [\n /(playstation [345portablevi]+)/i\n // Playstation\n ],\n [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]],\n [\n /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i\n // Microsoft Xbox\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]],\n [\n ///////////////////\n // SMARTTVS\n ///////////////////\n /smart-tv.+(samsung)/i\n // Samsung\n ],\n [VENDOR, [TYPE, SMARTTV]],\n [/hbbtv.+maple;(\\d+)/i],\n [\n [MODEL, /^/, "SmartTV"],\n [VENDOR, SAMSUNG],\n [TYPE, SMARTTV]\n ],\n [\n /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i\n // LG SmartTV\n ],\n [\n [VENDOR, LG],\n [TYPE, SMARTTV]\n ],\n [\n /(apple) ?tv/i\n // Apple TV\n ],\n [VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]],\n [\n /crkey/i\n // Google Chromecast\n ],\n [\n [MODEL, CHROME + "cast"],\n [VENDOR, GOOGLE],\n [TYPE, SMARTTV]\n ],\n [\n /droid.+aft(\\w)( bui|\\))/i\n // Fire TV\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]],\n [\n /\\(dtv[\\);].+(aquos)/i,\n /(aquos-tv[\\w ]+)\\)/i\n // Sharp\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],\n [\n /(bravia[\\w ]+)( bui|\\))/i\n // Sony\n ],\n [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]],\n [\n /(mitv-\\w{5}) bui/i\n // Xiaomi\n ],\n [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]],\n [\n /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,\n // Roku\n /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i\n // HbbTV devices\n ],\n [\n [VENDOR, trim],\n [MODEL, trim],\n [TYPE, SMARTTV]\n ],\n [\n /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i\n // SmartTV from Unidentified Vendors\n ],\n [[TYPE, SMARTTV]],\n [\n ///////////////////\n // WEARABLES\n ///////////////////\n /((pebble))app/i\n // Pebble\n ],\n [VENDOR, MODEL, [TYPE, WEARABLE]],\n [\n /droid.+; (glass) \\d/i\n // Google Glass\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]],\n [/droid.+; (wt63?0{2,3})\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]],\n [\n /(quest( 2)?)/i\n // Oculus Quest\n ],\n [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]],\n [\n ///////////////////\n // EMBEDDED\n ///////////////////\n /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i\n // Tesla\n ],\n [VENDOR, [TYPE, EMBEDDED]],\n [\n ////////////////////\n // MIXED (GENERIC)\n ///////////////////\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i\n // Android Phones from Unidentified Vendors\n ],\n [MODEL, [TYPE, MOBILE]],\n [\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i\n // Android Tablets from Unidentified Vendors\n ],\n [MODEL, [TYPE, TABLET]],\n [\n /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i\n // Unidentifiable Tablet\n ],\n [[TYPE, TABLET]],\n [\n /(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i\n // Unidentifiable Mobile\n ],\n [[TYPE, MOBILE]],\n [\n /(android[-\\w\\. ]{0,9});.+buil/i\n // Generic Android Device\n ],\n [MODEL, [VENDOR, "Generic"]]\n ],\n engine: [\n [\n /windows.+ edge\\/([\\w\\.]+)/i\n // EdgeHTML\n ],\n [VERSION2, [NAME, EDGE + "HTML"]],\n [\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i\n // Blink\n ],\n [VERSION2, [NAME, "Blink"]],\n [\n /(presto)\\/([\\w\\.]+)/i,\n // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,\n // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /ekioh(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,\n // KHTML/Tasman/Links\n /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i\n // iCab\n ],\n [NAME, VERSION2],\n [\n /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i\n // Gecko\n ],\n [VERSION2, NAME]\n ],\n os: [\n [\n // Windows\n /microsoft (windows) (vista|xp)/i\n // Windows (iTunes)\n ],\n [NAME, VERSION2],\n [\n /(windows) nt 6\\.2; (arm)/i,\n // Windows RT\n /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,\n // Windows Phone\n /(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i\n ],\n [NAME, [VERSION2, strMapper, windowsVersionMap]],\n [/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],\n [\n [NAME, "Windows"],\n [VERSION2, strMapper, windowsVersionMap]\n ],\n [\n // iOS/macOS\n /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,\n // iOS\n /cfnetwork\\/.+darwin/i\n ],\n [\n [VERSION2, /_/g, "."],\n [NAME, "iOS"]\n ],\n [\n /(mac os x) ?([\\w\\. ]*)/i,\n /(macintosh|mac_powerpc\\b)(?!.+haiku)/i\n // Mac OS\n ],\n [\n [NAME, "Mac OS"],\n [VERSION2, /_/g, "."]\n ],\n [\n // Mobile OSes\n /droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i\n // Android-x86/HarmonyOS\n ],\n [VERSION2, NAME],\n [\n // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n /(blackberry)\\w*\\/([\\w\\.]*)/i,\n // Blackberry\n /(tizen|kaios)[\\/ ]([\\w\\.]+)/i,\n // Tizen/KaiOS\n /\\((series40);/i\n // Series 40\n ],\n [NAME, VERSION2],\n [\n /\\(bb(10);/i\n // BlackBerry 10\n ],\n [VERSION2, [NAME, BLACKBERRY]],\n [\n /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i\n // Symbian\n ],\n [VERSION2, [NAME, "Symbian"]],\n [\n /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i\n // Firefox OS\n ],\n [VERSION2, [NAME, FIREFOX + " OS"]],\n [\n /web0s;.+rt(tv)/i,\n /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i\n // WebOS\n ],\n [VERSION2, [NAME, "webOS"]],\n [\n // Google Chromecast\n /crkey\\/([\\d\\.]+)/i\n // Google Chromecast\n ],\n [VERSION2, [NAME, CHROME + "cast"]],\n [\n /(cros) [\\w]+ ([\\w\\.]+\\w)/i\n // Chromium OS\n ],\n [[NAME, "Chromium OS"], VERSION2],\n [\n // Console\n /(nintendo|playstation) ([wids345portablevuch]+)/i,\n // Nintendo/Playstation\n /(xbox); +xbox ([^\\);]+)/i,\n // Microsoft Xbox (360, One, X, S, Series X, Series S)\n // Other\n /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,\n // Joli/Palm\n /(mint)[\\/\\(\\) ]?(\\w*)/i,\n // Mint\n /(mageia|vectorlinux)[; ]/i,\n // Mageia/VectorLinux\n /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n /(hurd|linux) ?([\\w\\.]*)/i,\n // Hurd/Linux\n /(gnu) ?([\\w\\.]*)/i,\n // GNU\n /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,\n // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n /(haiku) (\\w+)/i\n // Haiku\n ],\n [NAME, VERSION2],\n [\n /(sunos) ?([\\w\\.\\d]*)/i\n // Solaris\n ],\n [[NAME, "Solaris"], VERSION2],\n [\n /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,\n // Solaris\n /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,\n // AIX\n /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,\n // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX\n /(unix) ?([\\w\\.]*)/i\n // UNIX\n ],\n [NAME, VERSION2]\n ]\n };\n var UAParser2 = function(ua, extensions) {\n if (typeof ua === OBJ_TYPE) {\n extensions = ua;\n ua = undefined2;\n }\n if (!(this instanceof UAParser2)) {\n return new UAParser2(ua, extensions).getResult();\n }\n var _ua = ua || (typeof window2 !== UNDEF_TYPE && window2.navigator && window2.navigator.userAgent ? window2.navigator.userAgent : EMPTY);\n var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n this.getBrowser = function() {\n var _browser = {};\n _browser[NAME] = undefined2;\n _browser[VERSION2] = undefined2;\n rgxMapper.call(_browser, _ua, _rgxmap.browser);\n _browser.major = majorize(_browser.version);\n return _browser;\n };\n this.getCPU = function() {\n var _cpu = {};\n _cpu[ARCHITECTURE] = undefined2;\n rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n return _cpu;\n };\n this.getDevice = function() {\n var _device = {};\n _device[VENDOR] = undefined2;\n _device[MODEL] = undefined2;\n _device[TYPE] = undefined2;\n rgxMapper.call(_device, _ua, _rgxmap.device);\n return _device;\n };\n this.getEngine = function() {\n var _engine = {};\n _engine[NAME] = undefined2;\n _engine[VERSION2] = undefined2;\n rgxMapper.call(_engine, _ua, _rgxmap.engine);\n return _engine;\n };\n this.getOS = function() {\n var _os = {};\n _os[NAME] = undefined2;\n _os[VERSION2] = undefined2;\n rgxMapper.call(_os, _ua, _rgxmap.os);\n return _os;\n };\n this.getResult = function() {\n return {\n ua: this.getUA(),\n browser: this.getBrowser(),\n engine: this.getEngine(),\n os: this.getOS(),\n device: this.getDevice(),\n cpu: this.getCPU()\n };\n };\n this.getUA = function() {\n return _ua;\n };\n this.setUA = function(ua2) {\n _ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;\n return this;\n };\n this.setUA(_ua);\n return this;\n };\n UAParser2.VERSION = LIBVERSION;\n UAParser2.BROWSER = enumerize([NAME, VERSION2, MAJOR]);\n UAParser2.CPU = enumerize([ARCHITECTURE]);\n UAParser2.DEVICE = enumerize([\n MODEL,\n VENDOR,\n TYPE,\n CONSOLE,\n MOBILE,\n SMARTTV,\n TABLET,\n WEARABLE,\n EMBEDDED\n ]);\n UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION2]);\n if (typeof exports !== UNDEF_TYPE) {\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser2;\n }\n exports.UAParser = UAParser2;\n } else {\n if (typeof define === FUNC_TYPE && define.amd) {\n define(function() {\n return UAParser2;\n });\n } else if (typeof window2 !== UNDEF_TYPE) {\n window2.UAParser = UAParser2;\n }\n }\n var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser2();\n $.ua = parser.getResult();\n $.ua.get = function() {\n return parser.getUA();\n };\n $.ua.set = function(ua) {\n parser.setUA(ua);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n })(typeof window === "object" ? window : exports);\n }\n });\n\n // packages/dev-tools/client/utils.ts\n var goToSection = (shadow, view) => {\n closeToasts(shadow);\n const aside = shadow.querySelector("aside");\n aside.dataset.view = view;\n aside.classList.remove("section-ready");\n setTimeout(() => {\n aside.classList.add("section-ready");\n }, 200);\n };\n var initBackButtons = (shadow) => {\n Array.from(shadow.querySelectorAll(".back-button")).forEach((elm) => {\n elm.addEventListener("click", (ev) => {\n closeToasts(shadow);\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n goToSection(shadow, target?.dataset.back || "nav-home");\n });\n });\n };\n var showToast = (shadow, html) => {\n closeToasts(shadow);\n const aside = shadow.querySelector("aside");\n const toast = document.createElement("div");\n toast.className = `ui-toast`;\n toast.innerHTML = html;\n aside.appendChild(toast);\n setTimeout(() => {\n toast.classList.add("ui-toast-show");\n setTimeout(() => {\n toast.classList.remove("ui-toast-show");\n setTimeout(() => {\n toast.remove();\n }, 500);\n }, 4e3);\n }, 30);\n };\n var closeToasts = (shadow) => {\n const aside = shadow.querySelector("aside");\n const existing = Array.from(aside.querySelectorAll(".ui-toast"));\n existing.forEach((el) => {\n el.classList.remove("ui-toast-show");\n });\n };\n var isEditEnabled = () => {\n const key = getDisableEditKey();\n return localStorage.getItem(key) !== "true";\n };\n var enableEdit = (enable) => {\n const key = getDisableEditKey();\n if (enable) {\n localStorage.removeItem(key);\n } else {\n localStorage.setItem(key, "true");\n }\n };\n var getDisableEditKey = () => getLocalStorageKey("disableEdit");\n var getLocalStorageKey = (name) => `builder.__LOCAL_APP_ID__.${name}`;\n var getEditorUrl = () => {\n const contentElm = document.body.querySelector("[builder-content-id]");\n const contentId = contentElm?.getAttribute("builder-content-id");\n return getBuilderContentUrl(contentId);\n };\n var getBuilderContentUrl = (contentId, blockId) => {\n let pathname = "/content";\n if (contentId) {\n pathname += "/" + contentId + "/edit";\n }\n const url = new URL(pathname, "https://builder.io");\n if (contentId && blockId) {\n url.searchParams.set("selectedBlock", blockId);\n }\n const previewUrl = new URL(location.pathname, location.href);\n url.searchParams.set("overridePreviewUrl", previewUrl.href);\n return url.href;\n };\n var DEV_TOOLS_URL = "__DEV_TOOLS_URL__";\n var APP_STATE = {\n components: [],\n registryPath: "",\n registryDisplayPath: "",\n frameworks: [],\n dependencies: [],\n publicApiKey: void 0,\n devToolsVersion: ""\n };\n var updateAppState = (registry) => {\n APP_STATE.components = registry.components;\n APP_STATE.registryPath = registry.registryPath;\n APP_STATE.registryDisplayPath = registry.registryDisplayPath;\n APP_STATE.dependencies = registry.dependencies;\n APP_STATE.publicApiKey = registry.publicApiKey;\n };\n\n // packages/dev-tools/client/edit-button/document-listeners.ts\n function initDocumentListeners(editButton) {\n let lastBlockId = null;\n const menu = document.querySelector(\n "builder-dev-tools-menu"\n );\n const hideEditButton = () => {\n editButton.hide();\n };\n const onPointerOver = (ev) => {\n const hoverElm = ev.target;\n if (!hoverElm) {\n hideEditButton();\n return;\n }\n if (hoverElm.closest("builder-dev-tools-edit")) {\n return;\n }\n const contentElm = hoverElm.closest("[builder-content-id]");\n const blockElm = hoverElm.closest("[builder-id]");\n if (!contentElm || !blockElm) {\n editButton.hide();\n return;\n }\n const blockId = editButton.show(contentElm, blockElm);\n if (!blockId || blockId === lastBlockId) {\n return;\n }\n menu.highlightOpener();\n lastBlockId = blockId;\n };\n document.addEventListener("pointerover", onPointerOver, { passive: true });\n document.addEventListener("pointerleave", hideEditButton, {\n passive: true\n });\n document.addEventListener("pointercancel", hideEditButton, {\n passive: true\n });\n document.addEventListener("visibilitychange", hideEditButton, {\n passive: true\n });\n window.addEventListener("popstate", hideEditButton, { passive: true });\n const originalPushState = history.pushState;\n history.pushState = function(...args) {\n editButton.hide();\n originalPushState.apply(this, args);\n };\n const originalReplaceState = history.replaceState;\n history.replaceState = function(...args) {\n editButton.hide();\n originalReplaceState.apply(this, args);\n };\n }\n\n // packages/dev-tools/client/edit-button/index.ts\n var BuilderDevToolsEditButton = class extends HTMLElement {\n openInBuilder = null;\n block = null;\n constructor() {\n super();\n }\n connectedCallback() {\n this.setAttribute("aria-hidden", "true");\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = \'<style>/* packages/dev-tools/client/common.css */\\n*,\\n*::before,\\n*::after {\\n box-sizing: border-box;\\n}\\n:host {\\n --background-color: rgba(40, 40, 40, 1);\\n --primary-color: rgba(72, 161, 255, 1);\\n --primary-color-subdued: rgb(72, 161, 255, 0.6);\\n --primary-color-highlight: rgb(126, 188, 255);\\n --primary-contrast-color: white;\\n --edit-color: #1d74e2;\\n --edit-color-highlight: #1c6bd1;\\n --edit-color-alpha: rgb(72, 161, 255, 0.15);\\n --error-color: #ff2b55;\\n --text-color: white;\\n --text-color-highlight: white;\\n --border-color: #454545;\\n --button-background-color-hover: rgba(255, 255, 255, 0.1);\\n --menu-width: 320px;\\n --transition-time: 150ms;\\n --font-family:\\n ui-sans-serif,\\n system-ui,\\n -apple-system,\\n BlinkMacSystemFont,\\n "Segoe UI",\\n Roboto,\\n "Helvetica Neue",\\n Arial,\\n "Noto Sans",\\n sans-serif,\\n "Apple Color Emoji",\\n "Segoe UI Emoji",\\n "Segoe UI Symbol",\\n "Noto Color Emoji";\\n font-family: var(--font-family);\\n line-height: 1.6;\\n}\\nbutton {\\n cursor: pointer;\\n color: var(--text-color);\\n -webkit-tap-highlight-color: transparent;\\n}\\ninput,\\nselect,\\nbutton {\\n font-family: var(--font-family);\\n}\\n\\n/* packages/dev-tools/client/edit-button/edit-button.css */\\n:host {\\n display: none;\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n z-index: 2147483646;\\n user-select: none;\\n pointer-events: none;\\n color: var(--text-color);\\n}\\n#content-highlight,\\n#block {\\n position: absolute;\\n}\\n#content-highlight {\\n border: 3px solid var(--primary-color);\\n background-color: var(--primary-color-alpha);\\n}\\na {\\n position: absolute;\\n top: -33px;\\n left: 0;\\n display: block;\\n padding: 5px 10px 8px 10px;\\n pointer-events: auto;\\n z-index: 100;\\n text-decoration: none;\\n}\\na:hover {\\n text-decoration: none;\\n}\\na span {\\n display: block;\\n padding: 3px 6px;\\n font-size: 10px;\\n font-weight: 300;\\n border-radius: 3px;\\n text-align: center;\\n text-decoration: none;\\n pointer-events: none;\\n background-color: var(--edit-color);\\n color: var(--text-color);\\n white-space: nowrap;\\n}\\na:hover span {\\n background-color: var(--edit-color-highlight);\\n}\\na:hover ~ .outline {\\n border-color: var(--edit-color-highlight);\\n}\\n#open-in-editor {\\n display: none;\\n}\\n.outline {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n border: 1px solid var(--edit-color);\\n background-color: var(--edit-color-alpha);\\n}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>\';\n this.openInBuilder = shadow.getElementById(\n "open-in-builder"\n );\n this.block = shadow.getElementById("block");\n initDocumentListeners(this);\n }\n show(contentElm, blockElm) {\n if (!isEditEnabled()) {\n this.hide();\n return null;\n }\n const contentId = contentElm.getAttribute("builder-content-id");\n const blockId = blockElm.getAttribute("builder-id");\n if (!contentId || !blockId) {\n this.hide();\n return null;\n }\n const block = this.block;\n const openInBuilder = this.openInBuilder;\n const builderRect = blockElm.getBoundingClientRect();\n block.style.top = builderRect.top + window.scrollY - 1 + "px";\n block.style.left = builderRect.left + window.scrollX + "px";\n block.style.width = builderRect.width + "px";\n block.style.height = builderRect.height + 1 + "px";\n const openInBuilderRect = openInBuilder.getBoundingClientRect();\n if (openInBuilderRect.width > builderRect.width) {\n const diff = openInBuilderRect.width - builderRect.width;\n openInBuilder.style.left = diff / 2 * -1 + "px";\n } else {\n openInBuilder.style.left = "";\n }\n openInBuilder.href = getBuilderContentUrl(contentId, blockId);\n this.style.display = "block";\n return blockId;\n }\n hide() {\n this.style.display = "";\n }\n };\n\n // packages/dev-tools/common/constants.ts\n var PREVIEW_URL_QS = `preview-url`;\n var CONNECTED_USER_ID_QS = "_b-uid";\n var BUILDER_AUTH_CONNECT_PATH = "/~builder-connect";\n var DEV_TOOLS_API_PATH = "/~builder-dev-tools";\n var AMPLITUDE_PROXY_URL = "https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";\n\n // packages/dev-tools/client/client-api.ts\n var apiValidateBuilder = () => apiFetch({\n type: "validateBuilder"\n });\n var apiLaunchEditor = (file) => apiFetch({\n type: "launchEditor",\n data: file\n });\n var apiRegistry = (opts) => apiFetch({\n type: "getRegistry",\n data: opts\n });\n var apiLoadComponent = (opts) => apiFetch({\n type: "loadComponent",\n data: opts\n });\n var apiRegisterComponent = (opts) => apiFetch({\n type: "registerComponent",\n data: opts\n });\n var apiSetComponentInfo = (opts) => apiFetch({\n type: "setComponentInfo",\n data: opts\n });\n var apiSetComponentInput = (opts) => apiFetch({\n type: "setComponentInput",\n data: opts\n });\n var apiUnregisterComponent = (opts) => apiFetch({\n type: "unregisterComponent",\n data: opts\n });\n var apiDevToolsEnabled = (enabled) => apiFetch({\n type: "enableDevTools",\n data: { enabled }\n });\n var apiLocalConfig = () => apiFetch({ type: "localConfig" });\n var apiFetch = async (data) => {\n const url = new URL(DEV_TOOLS_API_PATH, DEV_TOOLS_URL);\n let rsp;\n try {\n rsp = await fetch(url, {\n method: "POST",\n body: JSON.stringify(data)\n });\n } catch (e) {\n console.error(`Devtools Fetch Error, ${url.href}`, e);\n throw new Error(`Builder Devtools Fetch Error`);\n }\n const contentType = rsp.headers.get("content-type") || "";\n if (contentType.includes("application/json")) {\n const r = await rsp.json();\n if (rsp.ok) {\n return r.data;\n }\n if (Array.isArray(r.errors) && r.errors.length > 0) {\n r.errors.forEach((e) => console.error(e));\n throw new Error(`Builder Devtools Fetch Error: ${r.errors[0]}`);\n }\n }\n throw new Error(\n `Builder Devtools Fetch Error: ${rsp.status}, ${await rsp.text()}`\n );\n };\n\n // packages/dev-tools/common/ast/component-input-types.ts\n var INPUT_TYPES = [\n { value: "boolean", text: "boolean" },\n { value: "color", text: "color (provides a color in hex or rgb)" },\n { value: "date", text: "date (same format as the Date constructor)" },\n { value: "email", text: "email" },\n { value: "file", text: "file (uploads a file and provides a url)" },\n { value: "list", text: "list (collection of items)" },\n { value: "longText", text: "longText (multiline text editor)" },\n { value: "number", text: "number" },\n { value: "object", text: "object (set of specific names and values)" },\n { value: "richText", text: "richText (provides value as html)" },\n { value: "string", text: "string" }\n ];\n var STRING_TYPES = [\n "color",\n "date",\n "email",\n "file",\n "longText",\n "richText",\n "string"\n ];\n var NUMBER_TYPES = ["number"];\n var BOOLEAN_TYPES = ["boolean"];\n var ARRAY_TYPES = ["list"];\n var OBJECT_TYPES = ["object"];\n function getPrimitiveType(t) {\n if (STRING_TYPES.includes(t)) {\n return "string";\n } else if (NUMBER_TYPES.includes(t)) {\n return "number";\n } else if (BOOLEAN_TYPES.includes(t)) {\n return "boolean";\n } else if (ARRAY_TYPES.includes(t)) {\n return "array";\n } else if (OBJECT_TYPES.includes(t)) {\n return "object";\n } else {\n return "string";\n }\n }\n var PROP_BLACKLIST = new Set(\n [\n "about",\n "accessKey",\n "accessKeyLabel",\n "asChild",\n "autoCapitalize",\n "autoCorrect",\n "autoFocus",\n "autoSave",\n "blur",\n "contentEditable",\n "contextMenu",\n "dangerouslySetInnerHTML",\n "datatype",\n "defaultChecked",\n "defaultValue",\n "dir",\n "draggable",\n "enterKeyHint",\n "focus",\n "form",\n "formAction",\n "formEncType",\n "formMethod",\n "formNoValidate",\n "formTarget",\n "inlist",\n "innerText",\n "inputMode",\n "is",\n "isContentEditable",\n "itemID",\n "itemProp",\n "itemRef",\n "itemScope",\n "itemType",\n "lang",\n "nonce",\n "offsetHeight",\n "offsetLeft",\n "offsetTop",\n "offsetWidth",\n "outerText",\n "prefix",\n "property",\n "radioGroup",\n "rel",\n "resource",\n "results",\n "rev",\n "role",\n "security",\n "slot",\n "spellCheck",\n "suppressContentEditableWarning",\n "suppressHydrationWarning",\n "tabIndex",\n "translate",\n "typeof",\n "unselectable",\n "vocab"\n ].map((s) => s.toLowerCase())\n );\n\n // node_modules/tslib/tslib.es6.mjs\n var extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {\n d2.__proto__ = b2;\n } || function(d2, b2) {\n for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];\n };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function() {\n __assign = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function(resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function(resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator["throw"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() {\n if (t[0] & 1) throw t[1];\n return t[1];\n }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);\n return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {\n return this;\n }), g;\n function verb(n) {\n return function(v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n function __values(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = { error };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n }\n\n // node_modules/@amplitude/analytics-types/lib/esm/index.js\n var esm_exports = {};\n __export(esm_exports, {\n IdentifyOperation: () => IdentifyOperation,\n LogLevel: () => LogLevel,\n PluginType: () => PluginType,\n RevenueProperty: () => RevenueProperty,\n ServerZone: () => ServerZone,\n SpecialEventType: () => SpecialEventType,\n Status: () => Status,\n TransportType: () => TransportType\n });\n\n // node_modules/@amplitude/analytics-types/lib/esm/event.js\n var IdentifyOperation;\n (function(IdentifyOperation2) {\n IdentifyOperation2["SET"] = "$set";\n IdentifyOperation2["SET_ONCE"] = "$setOnce";\n IdentifyOperation2["ADD"] = "$add";\n IdentifyOperation2["APPEND"] = "$append";\n IdentifyOperation2["PREPEND"] = "$prepend";\n IdentifyOperation2["REMOVE"] = "$remove";\n IdentifyOperation2["PREINSERT"] = "$preInsert";\n IdentifyOperation2["POSTINSERT"] = "$postInsert";\n IdentifyOperation2["UNSET"] = "$unset";\n IdentifyOperation2["CLEAR_ALL"] = "$clearAll";\n })(IdentifyOperation || (IdentifyOperation = {}));\n var RevenueProperty;\n (function(RevenueProperty2) {\n RevenueProperty2["REVENUE_PRODUCT_ID"] = "$productId";\n RevenueProperty2["REVENUE_QUANTITY"] = "$quantity";\n RevenueProperty2["REVENUE_PRICE"] = "$price";\n RevenueProperty2["REVENUE_TYPE"] = "$revenueType";\n RevenueProperty2["REVENUE_CURRENCY"] = "$currency";\n RevenueProperty2["REVENUE"] = "$revenue";\n })(RevenueProperty || (RevenueProperty = {}));\n var SpecialEventType;\n (function(SpecialEventType2) {\n SpecialEventType2["IDENTIFY"] = "$identify";\n SpecialEventType2["GROUP_IDENTIFY"] = "$groupidentify";\n SpecialEventType2["REVENUE"] = "revenue_amount";\n })(SpecialEventType || (SpecialEventType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/logger.js\n var LogLevel;\n (function(LogLevel2) {\n LogLevel2[LogLevel2["None"] = 0] = "None";\n LogLevel2[LogLevel2["Error"] = 1] = "Error";\n LogLevel2[LogLevel2["Warn"] = 2] = "Warn";\n LogLevel2[LogLevel2["Verbose"] = 3] = "Verbose";\n LogLevel2[LogLevel2["Debug"] = 4] = "Debug";\n })(LogLevel || (LogLevel = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/plugin.js\n var PluginType;\n (function(PluginType2) {\n PluginType2["BEFORE"] = "before";\n PluginType2["ENRICHMENT"] = "enrichment";\n PluginType2["DESTINATION"] = "destination";\n })(PluginType || (PluginType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/server-zone.js\n var ServerZone;\n (function(ServerZone2) {\n ServerZone2["US"] = "US";\n ServerZone2["EU"] = "EU";\n ServerZone2["STAGING"] = "STAGING";\n })(ServerZone || (ServerZone = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/status.js\n var Status;\n (function(Status2) {\n Status2["Unknown"] = "unknown";\n Status2["Skipped"] = "skipped";\n Status2["Success"] = "success";\n Status2["RateLimit"] = "rate_limit";\n Status2["PayloadTooLarge"] = "payload_too_large";\n Status2["Invalid"] = "invalid";\n Status2["Failed"] = "failed";\n Status2["Timeout"] = "Timeout";\n Status2["SystemError"] = "SystemError";\n })(Status || (Status = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/transport.js\n var TransportType;\n (function(TransportType2) {\n TransportType2["XHR"] = "xhr";\n TransportType2["SendBeacon"] = "beacon";\n TransportType2["Fetch"] = "fetch";\n })(TransportType || (TransportType = {}));\n\n // node_modules/@amplitude/analytics-core/lib/esm/constants.js\n var UNSET_VALUE = "-";\n var AMPLITUDE_PREFIX = "AMP";\n var STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");\n var AMPLITUDE_SERVER_URL = "https://api2.amplitude.com/2/httpapi";\n var EU_AMPLITUDE_SERVER_URL = "https://api.eu.amplitude.com/2/httpapi";\n var AMPLITUDE_BATCH_SERVER_URL = "https://api2.amplitude.com/batch";\n var EU_AMPLITUDE_BATCH_SERVER_URL = "https://api.eu.amplitude.com/batch";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js\n var MAX_PROPERTY_KEYS = 1e3;\n var isValidObject = function(properties) {\n if (Object.keys(properties).length > MAX_PROPERTY_KEYS) {\n return false;\n }\n for (var key in properties) {\n var value = properties[key];\n if (!isValidProperties(key, value))\n return false;\n }\n return true;\n };\n var isValidProperties = function(property, value) {\n var e_1, _a;\n if (typeof property !== "string")\n return false;\n if (Array.isArray(value)) {\n var isValid = true;\n try {\n for (var value_1 = __values(value), value_1_1 = value_1.next(); !value_1_1.done; value_1_1 = value_1.next()) {\n var valueElement = value_1_1.value;\n if (Array.isArray(valueElement)) {\n return false;\n } else if (typeof valueElement === "object") {\n isValid = isValid && isValidObject(valueElement);\n } else if (!["number", "string"].includes(typeof valueElement)) {\n return false;\n }\n if (!isValid) {\n return false;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (value_1_1 && !value_1_1.done && (_a = value_1.return)) _a.call(value_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else if (value === null || value === void 0) {\n return false;\n } else if (typeof value === "object") {\n return isValidObject(value);\n } else if (!["number", "string", "boolean"].includes(typeof value)) {\n return false;\n }\n return true;\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/identify.js\n var Identify = (\n /** @class */\n (function() {\n function Identify2() {\n this._propertySet = /* @__PURE__ */ new Set();\n this._properties = {};\n }\n Identify2.prototype.getUserProperties = function() {\n return __assign({}, this._properties);\n };\n Identify2.prototype.set = function(property, value) {\n this._safeSet(IdentifyOperation.SET, property, value);\n return this;\n };\n Identify2.prototype.setOnce = function(property, value) {\n this._safeSet(IdentifyOperation.SET_ONCE, property, value);\n return this;\n };\n Identify2.prototype.append = function(property, value) {\n this._safeSet(IdentifyOperation.APPEND, property, value);\n return this;\n };\n Identify2.prototype.prepend = function(property, value) {\n this._safeSet(IdentifyOperation.PREPEND, property, value);\n return this;\n };\n Identify2.prototype.postInsert = function(property, value) {\n this._safeSet(IdentifyOperation.POSTINSERT, property, value);\n return this;\n };\n Identify2.prototype.preInsert = function(property, value) {\n this._safeSet(IdentifyOperation.PREINSERT, property, value);\n return this;\n };\n Identify2.prototype.remove = function(property, value) {\n this._safeSet(IdentifyOperation.REMOVE, property, value);\n return this;\n };\n Identify2.prototype.add = function(property, value) {\n this._safeSet(IdentifyOperation.ADD, property, value);\n return this;\n };\n Identify2.prototype.unset = function(property) {\n this._safeSet(IdentifyOperation.UNSET, property, UNSET_VALUE);\n return this;\n };\n Identify2.prototype.clearAll = function() {\n this._properties = {};\n this._properties[IdentifyOperation.CLEAR_ALL] = UNSET_VALUE;\n return this;\n };\n Identify2.prototype._safeSet = function(operation, property, value) {\n if (this._validate(operation, property, value)) {\n var userPropertyMap = this._properties[operation];\n if (userPropertyMap === void 0) {\n userPropertyMap = {};\n this._properties[operation] = userPropertyMap;\n }\n userPropertyMap[property] = value;\n this._propertySet.add(property);\n return true;\n }\n return false;\n };\n Identify2.prototype._validate = function(operation, property, value) {\n if (this._properties[IdentifyOperation.CLEAR_ALL] !== void 0) {\n return false;\n }\n if (this._propertySet.has(property)) {\n return false;\n }\n if (operation === IdentifyOperation.ADD) {\n return typeof value === "number";\n }\n if (operation !== IdentifyOperation.UNSET && operation !== IdentifyOperation.REMOVE) {\n return isValidProperties(property, value);\n }\n return true;\n };\n return Identify2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js\n var createTrackEvent = function(eventInput, eventProperties, eventOptions) {\n var baseEvent = typeof eventInput === "string" ? { event_type: eventInput } : eventInput;\n return __assign(__assign(__assign({}, baseEvent), eventOptions), eventProperties && { event_properties: eventProperties });\n };\n var createIdentifyEvent = function(identify2, eventOptions) {\n var identifyEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties() });\n return identifyEvent;\n };\n var createGroupIdentifyEvent = function(groupType, groupName, identify2, eventOptions) {\n var _a;\n var groupIdentify2 = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.GROUP_IDENTIFY, group_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupIdentify2;\n };\n var createGroupEvent = function(groupType, groupName, eventOptions) {\n var _a;\n var identify2 = new Identify();\n identify2.set(groupType, groupName);\n var groupEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupEvent;\n };\n var createRevenueEvent = function(revenue2, eventOptions) {\n return __assign(__assign({}, eventOptions), { event_type: SpecialEventType.REVENUE, event_properties: revenue2.getEventProperties() });\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js\n var buildResult = function(event, code, message) {\n if (code === void 0) {\n code = 0;\n }\n if (message === void 0) {\n message = Status.Unknown;\n }\n return { event, code, message };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/timeline.js\n var Timeline = (\n /** @class */\n (function() {\n function Timeline2(client) {\n this.client = client;\n this.queue = [];\n this.applying = false;\n this.plugins = [];\n }\n Timeline2.prototype.register = function(plugin, config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, plugin.setup(config, this.client)];\n case 1:\n _a.sent();\n this.plugins.push(plugin);\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.deregister = function(pluginName, config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var index, plugin;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n index = this.plugins.findIndex(function(plugin2) {\n return plugin2.name === pluginName;\n });\n if (index === -1) {\n config.loggerProvider.warn("Plugin with name ".concat(pluginName, " does not exist, skipping deregistration"));\n return [\n 2\n /*return*/\n ];\n }\n plugin = this.plugins[index];\n this.plugins.splice(index, 1);\n return [4, (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin)];\n case 1:\n _b.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.reset = function(client) {\n this.applying = false;\n var plugins = this.plugins;\n plugins.map(function(plugin) {\n var _a;\n return (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin);\n });\n this.plugins = [];\n this.client = client;\n };\n Timeline2.prototype.push = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n _this.queue.push([event, resolve]);\n _this.scheduleApply(0);\n });\n };\n Timeline2.prototype.scheduleApply = function(timeout) {\n var _this = this;\n if (this.applying)\n return;\n this.applying = true;\n setTimeout(function() {\n void _this.apply(_this.queue.shift()).then(function() {\n _this.applying = false;\n if (_this.queue.length > 0) {\n _this.scheduleApply(0);\n }\n });\n }, timeout);\n };\n Timeline2.prototype.apply = function(item) {\n return __awaiter(this, void 0, void 0, function() {\n var _a, event, _b, resolve, before, before_1, before_1_1, plugin, e, e_1_1, enrichment, enrichment_1, enrichment_1_1, plugin, e, e_2_1, destination, executeDestinations;\n var e_1, _c, e_2, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n if (!item) {\n return [\n 2\n /*return*/\n ];\n }\n _a = __read(item, 1), event = _a[0];\n _b = __read(item, 2), resolve = _b[1];\n before = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.BEFORE;\n });\n _e.label = 1;\n case 1:\n _e.trys.push([1, 6, 7, 8]);\n before_1 = __values(before), before_1_1 = before_1.next();\n _e.label = 2;\n case 2:\n if (!!before_1_1.done) return [3, 5];\n plugin = before_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 3:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 4;\n case 4:\n before_1_1 = before_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (before_1_1 && !before_1_1.done && (_c = before_1.return)) _c.call(before_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n enrichment = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.ENRICHMENT;\n });\n _e.label = 9;\n case 9:\n _e.trys.push([9, 14, 15, 16]);\n enrichment_1 = __values(enrichment), enrichment_1_1 = enrichment_1.next();\n _e.label = 10;\n case 10:\n if (!!enrichment_1_1.done) return [3, 13];\n plugin = enrichment_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 11:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 12;\n case 12:\n enrichment_1_1 = enrichment_1.next();\n return [3, 10];\n case 13:\n return [3, 16];\n case 14:\n e_2_1 = _e.sent();\n e_2 = { error: e_2_1 };\n return [3, 16];\n case 15:\n try {\n if (enrichment_1_1 && !enrichment_1_1.done && (_d = enrichment_1.return)) _d.call(enrichment_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 16:\n destination = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin2) {\n var eventClone = __assign({}, event);\n return plugin2.execute(eventClone).catch(function(e2) {\n return buildResult(eventClone, 0, String(e2));\n });\n });\n void Promise.all(executeDestinations).then(function(_a2) {\n var _b2 = __read(_a2, 1), result = _b2[0];\n resolve(result);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.flush = function() {\n return __awaiter(this, void 0, void 0, function() {\n var queue, destination, executeDestinations;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n queue = this.queue;\n this.queue = [];\n return [4, Promise.all(queue.map(function(item) {\n return _this.apply(item);\n }))];\n case 1:\n _a.sent();\n destination = this.plugins.filter(function(plugin) {\n return plugin.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin) {\n return plugin.flush && plugin.flush();\n });\n return [4, Promise.all(executeDestinations)];\n case 2:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return Timeline2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/messages.js\n var SUCCESS_MESSAGE = "Event tracked successfully";\n var UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";\n var MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";\n var OPT_OUT_MESSAGE = "Event skipped due to optOut config";\n var MISSING_API_KEY_MESSAGE = "Event rejected due to missing API key";\n var INVALID_API_KEY = "Invalid API key";\n var CLIENT_NOT_INITIALIZED = "Client not initialized";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js\n var returnWrapper = function(awaitable) {\n return {\n promise: awaitable || Promise.resolve()\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/core-client.js\n var AmplitudeCore = (\n /** @class */\n (function() {\n function AmplitudeCore2(name) {\n if (name === void 0) {\n name = "$default";\n }\n this.initializing = false;\n this.q = [];\n this.dispatchQ = [];\n this.logEvent = this.track.bind(this);\n this.timeline = new Timeline(this);\n this.name = name;\n }\n AmplitudeCore2.prototype._init = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n this.config = config;\n this.timeline.reset(this);\n return [4, this.runQueuedFunctions("q")];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.runQueuedFunctions = function(queueName) {\n return __awaiter(this, void 0, void 0, function() {\n var queuedFunctions, queuedFunctions_1, queuedFunctions_1_1, queuedFunction, e_1_1;\n var e_1, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n queuedFunctions = this[queueName];\n this[queueName] = [];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 6, 7, 8]);\n queuedFunctions_1 = __values(queuedFunctions), queuedFunctions_1_1 = queuedFunctions_1.next();\n _b.label = 2;\n case 2:\n if (!!queuedFunctions_1_1.done) return [3, 5];\n queuedFunction = queuedFunctions_1_1.value;\n return [4, queuedFunction()];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n queuedFunctions_1_1 = queuedFunctions_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _b.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (queuedFunctions_1_1 && !queuedFunctions_1_1.done && (_a = queuedFunctions_1.return)) _a.call(queuedFunctions_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.track = function(eventInput, eventProperties, eventOptions) {\n var event = createTrackEvent(eventInput, eventProperties, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.identify = function(identify2, eventOptions) {\n var event = createIdentifyEvent(identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n var event = createGroupIdentifyEvent(groupType, groupName, identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.setGroup = function(groupType, groupName, eventOptions) {\n var event = createGroupEvent(groupType, groupName, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.revenue = function(revenue2, eventOptions) {\n var event = createRevenueEvent(revenue2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.add = function(plugin) {\n if (!this.config) {\n this.q.push(this.add.bind(this, plugin));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.register(plugin, this.config));\n };\n AmplitudeCore2.prototype.remove = function(pluginName) {\n if (!this.config) {\n this.q.push(this.remove.bind(this, pluginName));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.deregister(pluginName, this.config));\n };\n AmplitudeCore2.prototype.dispatchWithCallback = function(event, callback) {\n if (!this.config) {\n return callback(buildResult(event, 0, CLIENT_NOT_INITIALIZED));\n }\n void this.process(event).then(callback);\n };\n AmplitudeCore2.prototype.dispatch = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n if (!this.config) {\n return [2, new Promise(function(resolve) {\n _this.dispatchQ.push(_this.dispatchWithCallback.bind(_this, event, resolve));\n })];\n }\n return [2, this.process(event)];\n });\n });\n };\n AmplitudeCore2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var result, e_2, message, result;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n if (this.config.optOut) {\n return [2, buildResult(event, 0, OPT_OUT_MESSAGE)];\n }\n return [4, this.timeline.push(event)];\n case 1:\n result = _a.sent();\n result.code === 200 ? this.config.loggerProvider.log(result.message) : this.config.loggerProvider.error(result.message);\n return [2, result];\n case 2:\n e_2 = _a.sent();\n this.config.loggerProvider.error(e_2);\n message = String(e_2);\n result = buildResult(event, 0, message);\n return [2, result];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.setOptOut = function(optOut) {\n if (!this.config) {\n this.q.push(this.setOptOut.bind(this, Boolean(optOut)));\n return;\n }\n this.config.optOut = Boolean(optOut);\n };\n AmplitudeCore2.prototype.flush = function() {\n return returnWrapper(this.timeline.flush());\n };\n return AmplitudeCore2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/revenue.js\n var Revenue = (\n /** @class */\n (function() {\n function Revenue2() {\n this.productId = "";\n this.quantity = 1;\n this.price = 0;\n }\n Revenue2.prototype.setProductId = function(productId) {\n this.productId = productId;\n return this;\n };\n Revenue2.prototype.setQuantity = function(quantity) {\n if (quantity > 0) {\n this.quantity = quantity;\n }\n return this;\n };\n Revenue2.prototype.setPrice = function(price) {\n this.price = price;\n return this;\n };\n Revenue2.prototype.setRevenueType = function(revenueType) {\n this.revenueType = revenueType;\n return this;\n };\n Revenue2.prototype.setCurrency = function(currency) {\n this.currency = currency;\n return this;\n };\n Revenue2.prototype.setRevenue = function(revenue2) {\n this.revenue = revenue2;\n return this;\n };\n Revenue2.prototype.setEventProperties = function(properties) {\n if (isValidObject(properties)) {\n this.properties = properties;\n }\n return this;\n };\n Revenue2.prototype.getEventProperties = function() {\n var eventProperties = this.properties ? __assign({}, this.properties) : {};\n eventProperties[RevenueProperty.REVENUE_PRODUCT_ID] = this.productId;\n eventProperties[RevenueProperty.REVENUE_QUANTITY] = this.quantity;\n eventProperties[RevenueProperty.REVENUE_PRICE] = this.price;\n eventProperties[RevenueProperty.REVENUE_TYPE] = this.revenueType;\n eventProperties[RevenueProperty.REVENUE_CURRENCY] = this.currency;\n eventProperties[RevenueProperty.REVENUE] = this.revenue;\n return eventProperties;\n };\n return Revenue2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js\n var chunk = function(arr, size) {\n var chunkSize = Math.max(size, 1);\n return arr.reduce(function(chunks, element, index) {\n var chunkIndex = Math.floor(index / chunkSize);\n if (!chunks[chunkIndex]) {\n chunks[chunkIndex] = [];\n }\n chunks[chunkIndex].push(element);\n return chunks;\n }, []);\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/logger.js\n var PREFIX = "Amplitude Logger ";\n var Logger = (\n /** @class */\n (function() {\n function Logger2() {\n this.logLevel = LogLevel.None;\n }\n Logger2.prototype.disable = function() {\n this.logLevel = LogLevel.None;\n };\n Logger2.prototype.enable = function(logLevel) {\n if (logLevel === void 0) {\n logLevel = LogLevel.Warn;\n }\n this.logLevel = logLevel;\n };\n Logger2.prototype.log = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Verbose) {\n return;\n }\n console.log("".concat(PREFIX, "[Log]: ").concat(args.join(" ")));\n };\n Logger2.prototype.warn = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Warn) {\n return;\n }\n console.warn("".concat(PREFIX, "[Warn]: ").concat(args.join(" ")));\n };\n Logger2.prototype.error = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Error) {\n return;\n }\n console.error("".concat(PREFIX, "[Error]: ").concat(args.join(" ")));\n };\n Logger2.prototype.debug = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Debug) {\n return;\n }\n console.log("".concat(PREFIX, "[Debug]: ").concat(args.join(" ")));\n };\n return Logger2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/config.js\n var getDefaultConfig = function() {\n return {\n flushMaxRetries: 12,\n flushQueueSize: 200,\n flushIntervalMillis: 1e4,\n instanceName: "$default_instance",\n logLevel: LogLevel.Warn,\n loggerProvider: new Logger(),\n optOut: false,\n serverUrl: AMPLITUDE_SERVER_URL,\n serverZone: ServerZone.US,\n useBatch: false\n };\n };\n var Config = (\n /** @class */\n (function() {\n function Config2(options) {\n var _a, _b, _c, _d;\n this._optOut = false;\n var defaultConfig = getDefaultConfig();\n this.apiKey = options.apiKey;\n this.flushIntervalMillis = (_a = options.flushIntervalMillis) !== null && _a !== void 0 ? _a : defaultConfig.flushIntervalMillis;\n this.flushMaxRetries = options.flushMaxRetries || defaultConfig.flushMaxRetries;\n this.flushQueueSize = options.flushQueueSize || defaultConfig.flushQueueSize;\n this.instanceName = options.instanceName || defaultConfig.instanceName;\n this.loggerProvider = options.loggerProvider || defaultConfig.loggerProvider;\n this.logLevel = (_b = options.logLevel) !== null && _b !== void 0 ? _b : defaultConfig.logLevel;\n this.minIdLength = options.minIdLength;\n this.plan = options.plan;\n this.ingestionMetadata = options.ingestionMetadata;\n this.optOut = (_c = options.optOut) !== null && _c !== void 0 ? _c : defaultConfig.optOut;\n this.serverUrl = options.serverUrl;\n this.serverZone = options.serverZone || defaultConfig.serverZone;\n this.storageProvider = options.storageProvider;\n this.transportProvider = options.transportProvider;\n this.useBatch = (_d = options.useBatch) !== null && _d !== void 0 ? _d : defaultConfig.useBatch;\n this.loggerProvider.enable(this.logLevel);\n var serverConfig = createServerConfig(options.serverUrl, options.serverZone, options.useBatch);\n this.serverZone = serverConfig.serverZone;\n this.serverUrl = serverConfig.serverUrl;\n }\n Object.defineProperty(Config2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n this._optOut = optOut;\n },\n enumerable: false,\n configurable: true\n });\n return Config2;\n })()\n );\n var getServerUrl = function(serverZone, useBatch) {\n if (serverZone === ServerZone.EU) {\n return useBatch ? EU_AMPLITUDE_BATCH_SERVER_URL : EU_AMPLITUDE_SERVER_URL;\n }\n return useBatch ? AMPLITUDE_BATCH_SERVER_URL : AMPLITUDE_SERVER_URL;\n };\n var createServerConfig = function(serverUrl, serverZone, useBatch) {\n if (serverUrl === void 0) {\n serverUrl = "";\n }\n if (serverZone === void 0) {\n serverZone = getDefaultConfig().serverZone;\n }\n if (useBatch === void 0) {\n useBatch = getDefaultConfig().useBatch;\n }\n if (serverUrl) {\n return { serverUrl, serverZone: void 0 };\n }\n var _serverZone = ["US", "EU"].includes(serverZone) ? serverZone : getDefaultConfig().serverZone;\n return {\n serverZone: _serverZone,\n serverUrl: getServerUrl(_serverZone, useBatch)\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js\n function getErrorMessage(error) {\n if (error instanceof Error)\n return error.message;\n return String(error);\n }\n function getResponseBodyString(res) {\n var responseBodyString = "";\n try {\n if ("body" in res) {\n responseBodyString = JSON.stringify(res.body);\n }\n } catch (_a) {\n }\n return responseBodyString;\n }\n var Destination = (\n /** @class */\n (function() {\n function Destination2() {\n this.name = "amplitude";\n this.type = PluginType.DESTINATION;\n this.retryTimeout = 1e3;\n this.throttleTimeout = 3e4;\n this.storageKey = "";\n this.scheduled = null;\n this.queue = [];\n }\n Destination2.prototype.setup = function(config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var unsent;\n var _this = this;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n this.config = config;\n this.storageKey = "".concat(STORAGE_PREFIX, "_").concat(this.config.apiKey.substring(0, 10));\n return [4, (_a = this.config.storageProvider) === null || _a === void 0 ? void 0 : _a.get(this.storageKey)];\n case 1:\n unsent = _b.sent();\n this.saveEvents();\n if (unsent && unsent.length > 0) {\n void Promise.all(unsent.map(function(event) {\n return _this.execute(event);\n })).catch();\n }\n return [2, Promise.resolve(void 0)];\n }\n });\n });\n };\n Destination2.prototype.execute = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n var context = {\n event,\n attempts: 0,\n callback: function(result) {\n return resolve(result);\n },\n timeout: 0\n };\n void _this.addToQueue(context);\n });\n };\n Destination2.prototype.addToQueue = function() {\n var _this = this;\n var list = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n list[_i] = arguments[_i];\n }\n var tryable = list.filter(function(context) {\n if (context.attempts < _this.config.flushMaxRetries) {\n context.attempts += 1;\n return true;\n }\n void _this.fulfillRequest([context], 500, MAX_RETRIES_EXCEEDED_MESSAGE);\n return false;\n });\n tryable.forEach(function(context) {\n _this.queue = _this.queue.concat(context);\n if (context.timeout === 0) {\n _this.schedule(_this.config.flushIntervalMillis);\n return;\n }\n setTimeout(function() {\n context.timeout = 0;\n _this.schedule(0);\n }, context.timeout);\n });\n this.saveEvents();\n };\n Destination2.prototype.schedule = function(timeout) {\n var _this = this;\n if (this.scheduled)\n return;\n this.scheduled = setTimeout(function() {\n void _this.flush(true).then(function() {\n if (_this.queue.length > 0) {\n _this.schedule(timeout);\n }\n });\n }, timeout);\n };\n Destination2.prototype.flush = function(useRetry) {\n if (useRetry === void 0) {\n useRetry = false;\n }\n return __awaiter(this, void 0, void 0, function() {\n var list, later, batches;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n list = [];\n later = [];\n this.queue.forEach(function(context) {\n return context.timeout === 0 ? list.push(context) : later.push(context);\n });\n this.queue = later;\n if (this.scheduled) {\n clearTimeout(this.scheduled);\n this.scheduled = null;\n }\n batches = chunk(list, this.config.flushQueueSize);\n return [4, Promise.all(batches.map(function(batch) {\n return _this.send(batch, useRetry);\n }))];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.send = function(list, useRetry) {\n if (useRetry === void 0) {\n useRetry = true;\n }\n return __awaiter(this, void 0, void 0, function() {\n var payload, serverUrl, res, e_1, errorMessage;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (!this.config.apiKey) {\n return [2, this.fulfillRequest(list, 400, MISSING_API_KEY_MESSAGE)];\n }\n payload = {\n api_key: this.config.apiKey,\n events: list.map(function(context) {\n var _a2 = context.event, extra = _a2.extra, eventWithoutExtra = __rest(_a2, ["extra"]);\n return eventWithoutExtra;\n }),\n options: {\n min_id_length: this.config.minIdLength\n }\n };\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n serverUrl = createServerConfig(this.config.serverUrl, this.config.serverZone, this.config.useBatch).serverUrl;\n return [4, this.config.transportProvider.send(serverUrl, payload)];\n case 2:\n res = _a.sent();\n if (res === null) {\n this.fulfillRequest(list, 0, UNEXPECTED_ERROR_MESSAGE);\n return [\n 2\n /*return*/\n ];\n }\n if (!useRetry) {\n if ("body" in res) {\n this.fulfillRequest(list, res.statusCode, "".concat(res.status, ": ").concat(getResponseBodyString(res)));\n } else {\n this.fulfillRequest(list, res.statusCode, res.status);\n }\n return [\n 2\n /*return*/\n ];\n }\n this.handleResponse(res, list);\n return [3, 4];\n case 3:\n e_1 = _a.sent();\n this.config.loggerProvider.error(e_1);\n errorMessage = getErrorMessage(e_1);\n this.fulfillRequest(list, 0, errorMessage);\n return [3, 4];\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.handleResponse = function(res, list) {\n var status = res.status;\n switch (status) {\n case Status.Success: {\n this.handleSuccessResponse(res, list);\n break;\n }\n case Status.Invalid: {\n this.handleInvalidResponse(res, list);\n break;\n }\n case Status.PayloadTooLarge: {\n this.handlePayloadTooLargeResponse(res, list);\n break;\n }\n case Status.RateLimit: {\n this.handleRateLimitResponse(res, list);\n break;\n }\n default: {\n this.config.loggerProvider.warn(`{code: 0, error: "Status \'`.concat(status, "\' provided for ").concat(list.length, \' events"}\'));\n this.handleOtherResponse(list);\n break;\n }\n }\n };\n Destination2.prototype.handleSuccessResponse = function(res, list) {\n this.fulfillRequest(list, res.statusCode, SUCCESS_MESSAGE);\n };\n Destination2.prototype.handleInvalidResponse = function(res, list) {\n var _this = this;\n if (res.body.missingField || res.body.error.startsWith(INVALID_API_KEY)) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n var dropIndex = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(Object.values(res.body.eventsWithInvalidFields)), false), __read(Object.values(res.body.eventsWithMissingFields)), false), __read(Object.values(res.body.eventsWithInvalidIdLengths)), false), __read(res.body.silencedEvents), false).flat();\n var dropIndexSet = new Set(dropIndex);\n var retry = list.filter(function(context, index) {\n if (dropIndexSet.has(index)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handlePayloadTooLargeResponse = function(res, list) {\n if (list.length === 1) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n this.config.loggerProvider.warn(getResponseBodyString(res));\n this.config.flushQueueSize /= 2;\n this.addToQueue.apply(this, __spreadArray([], __read(list), false));\n };\n Destination2.prototype.handleRateLimitResponse = function(res, list) {\n var _this = this;\n var dropUserIds = Object.keys(res.body.exceededDailyQuotaUsers);\n var dropDeviceIds = Object.keys(res.body.exceededDailyQuotaDevices);\n var throttledIndex = res.body.throttledEvents;\n var dropUserIdsSet = new Set(dropUserIds);\n var dropDeviceIdsSet = new Set(dropDeviceIds);\n var throttledIndexSet = new Set(throttledIndex);\n var retry = list.filter(function(context, index) {\n if (context.event.user_id && dropUserIdsSet.has(context.event.user_id) || context.event.device_id && dropDeviceIdsSet.has(context.event.device_id)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n if (throttledIndexSet.has(index)) {\n context.timeout = _this.throttleTimeout;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handleOtherResponse = function(list) {\n var _this = this;\n this.addToQueue.apply(this, __spreadArray([], __read(list.map(function(context) {\n context.timeout = context.attempts * _this.retryTimeout;\n return context;\n })), false));\n };\n Destination2.prototype.fulfillRequest = function(list, code, message) {\n this.saveEvents();\n list.forEach(function(context) {\n return context.callback(buildResult(context.event, code, message));\n });\n };\n Destination2.prototype.saveEvents = function() {\n if (!this.config.storageProvider) {\n return;\n }\n var events = Array.from(this.queue.map(function(context) {\n return context.event;\n }));\n void this.config.storageProvider.set(this.storageKey, events);\n };\n return Destination2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js\n var getStacktrace = function(ignoreDepth) {\n if (ignoreDepth === void 0) {\n ignoreDepth = 0;\n }\n var trace = new Error().stack || "";\n return trace.split("\\n").slice(2 + ignoreDepth).map(function(text) {\n return text.trim();\n });\n };\n var getClientLogConfig = function(client) {\n return function() {\n var _a = __assign({}, client.config), logger = _a.loggerProvider, logLevel = _a.logLevel;\n return {\n logger,\n logLevel\n };\n };\n };\n var getValueByStringPath = function(obj, path) {\n var e_1, _a;\n path = path.replace(/\\[(\\w+)\\]/g, ".$1");\n path = path.replace(/^\\./, "");\n try {\n for (var _b = __values(path.split(".")), _c = _b.next(); !_c.done; _c = _b.next()) {\n var attr = _c.value;\n if (attr in obj) {\n obj = obj[attr];\n } else {\n return;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n return obj;\n };\n var getClientStates = function(client, paths) {\n return function() {\n var e_2, _a;\n var res = {};\n try {\n for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var path = paths_1_1.value;\n res[path] = getValueByStringPath(client, path);\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n return res;\n };\n };\n var debugWrapper = function(fn, fnName, getLogConfig, getStates, fnContext) {\n if (fnContext === void 0) {\n fnContext = null;\n }\n return function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var _a = getLogConfig(), logger = _a.logger, logLevel = _a.logLevel;\n if (logLevel && logLevel < LogLevel.Debug || !logLevel || !logger) {\n return fn.apply(fnContext, args);\n }\n var debugContext = {\n type: "invoke public method",\n name: fnName,\n args,\n stacktrace: getStacktrace(1),\n time: {\n start: (/* @__PURE__ */ new Date()).toISOString()\n },\n states: {}\n };\n if (getStates && debugContext.states) {\n debugContext.states.before = getStates();\n }\n var result = fn.apply(fnContext, args);\n if (result && result.promise) {\n result.promise.then(function() {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n });\n } else {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n }\n return result;\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js\n var UUID = function(a) {\n return a ? (\n // a random number from 0 to 15\n (a ^ // unless b is 8,\n Math.random() * // in which case\n 16 >> // a random number from\n a / 4).toString(16)\n ) : (\n // or otherwise a concatenated string:\n (String(1e7) + // 10000000 +\n String(-1e3) + // -1000 +\n String(-4e3) + // -4000 +\n String(-8e3) + // -80000000 +\n String(-1e11)).replace(\n // replacing\n /[018]/g,\n // zeroes, ones, and eights with\n UUID\n )\n );\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js\n var MemoryStorage = (\n /** @class */\n (function() {\n function MemoryStorage2() {\n this.memoryStorage = /* @__PURE__ */ new Map();\n }\n MemoryStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, true];\n });\n });\n };\n MemoryStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, this.memoryStorage.get(key)];\n });\n });\n };\n MemoryStorage2.prototype.getRaw = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.get(key)];\n case 1:\n value = _a.sent();\n return [2, value ? JSON.stringify(value) : void 0];\n }\n });\n });\n };\n MemoryStorage2.prototype.set = function(key, value) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.set(key, value);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.delete(key);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.clear();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return MemoryStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/transports/base.js\n var BaseTransport = (\n /** @class */\n (function() {\n function BaseTransport2() {\n }\n BaseTransport2.prototype.send = function(_serverUrl, _payload) {\n return Promise.resolve(null);\n };\n BaseTransport2.prototype.buildResponse = function(responseJSON) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;\n if (typeof responseJSON !== "object") {\n return null;\n }\n var statusCode = responseJSON.code || 0;\n var status = this.buildStatus(statusCode);\n switch (status) {\n case Status.Success:\n return {\n status,\n statusCode,\n body: {\n eventsIngested: (_a = responseJSON.events_ingested) !== null && _a !== void 0 ? _a : 0,\n payloadSizeBytes: (_b = responseJSON.payload_size_bytes) !== null && _b !== void 0 ? _b : 0,\n serverUploadTime: (_c = responseJSON.server_upload_time) !== null && _c !== void 0 ? _c : 0\n }\n };\n case Status.Invalid:\n return {\n status,\n statusCode,\n body: {\n error: (_d = responseJSON.error) !== null && _d !== void 0 ? _d : "",\n missingField: (_e = responseJSON.missing_field) !== null && _e !== void 0 ? _e : "",\n eventsWithInvalidFields: (_f = responseJSON.events_with_invalid_fields) !== null && _f !== void 0 ? _f : {},\n eventsWithMissingFields: (_g = responseJSON.events_with_missing_fields) !== null && _g !== void 0 ? _g : {},\n eventsWithInvalidIdLengths: (_h = responseJSON.events_with_invalid_id_lengths) !== null && _h !== void 0 ? _h : {},\n epsThreshold: (_j = responseJSON.eps_threshold) !== null && _j !== void 0 ? _j : 0,\n exceededDailyQuotaDevices: (_k = responseJSON.exceeded_daily_quota_devices) !== null && _k !== void 0 ? _k : {},\n silencedDevices: (_l = responseJSON.silenced_devices) !== null && _l !== void 0 ? _l : [],\n silencedEvents: (_m = responseJSON.silenced_events) !== null && _m !== void 0 ? _m : [],\n throttledDevices: (_o = responseJSON.throttled_devices) !== null && _o !== void 0 ? _o : {},\n throttledEvents: (_p = responseJSON.throttled_events) !== null && _p !== void 0 ? _p : []\n }\n };\n case Status.PayloadTooLarge:\n return {\n status,\n statusCode,\n body: {\n error: (_q = responseJSON.error) !== null && _q !== void 0 ? _q : ""\n }\n };\n case Status.RateLimit:\n return {\n status,\n statusCode,\n body: {\n error: (_r = responseJSON.error) !== null && _r !== void 0 ? _r : "",\n epsThreshold: (_s = responseJSON.eps_threshold) !== null && _s !== void 0 ? _s : 0,\n throttledDevices: (_t = responseJSON.throttled_devices) !== null && _t !== void 0 ? _t : {},\n throttledUsers: (_u = responseJSON.throttled_users) !== null && _u !== void 0 ? _u : {},\n exceededDailyQuotaDevices: (_v = responseJSON.exceeded_daily_quota_devices) !== null && _v !== void 0 ? _v : {},\n exceededDailyQuotaUsers: (_w = responseJSON.exceeded_daily_quota_users) !== null && _w !== void 0 ? _w : {},\n throttledEvents: (_x = responseJSON.throttled_events) !== null && _x !== void 0 ? _x : []\n }\n };\n case Status.Timeout:\n default:\n return {\n status,\n statusCode\n };\n }\n };\n BaseTransport2.prototype.buildStatus = function(code) {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n if (code === 429) {\n return Status.RateLimit;\n }\n if (code === 413) {\n return Status.PayloadTooLarge;\n }\n if (code === 408) {\n return Status.Timeout;\n }\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n if (code >= 500) {\n return Status.Failed;\n }\n return Status.Unknown;\n };\n return BaseTransport2;\n })()\n );\n\n // node_modules/@amplitude/analytics-connector/dist/analytics-connector.esm.js\n var ApplicationContextProviderImpl = (\n /** @class */\n (function() {\n function ApplicationContextProviderImpl2() {\n }\n ApplicationContextProviderImpl2.prototype.getApplicationContext = function() {\n return {\n versionName: this.versionName,\n language: getLanguage(),\n platform: "Web",\n os: void 0,\n deviceModel: void 0\n };\n };\n return ApplicationContextProviderImpl2;\n })()\n );\n var getLanguage = function() {\n return typeof navigator !== "undefined" && (navigator.languages && navigator.languages[0] || navigator.language) || "";\n };\n var EventBridgeImpl = (\n /** @class */\n (function() {\n function EventBridgeImpl2() {\n this.queue = [];\n }\n EventBridgeImpl2.prototype.logEvent = function(event) {\n if (!this.receiver) {\n if (this.queue.length < 512) {\n this.queue.push(event);\n }\n } else {\n this.receiver(event);\n }\n };\n EventBridgeImpl2.prototype.setEventReceiver = function(receiver) {\n this.receiver = receiver;\n if (this.queue.length > 0) {\n this.queue.forEach(function(event) {\n receiver(event);\n });\n this.queue = [];\n }\n };\n return EventBridgeImpl2;\n })()\n );\n var __assign2 = function() {\n __assign2 = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign2.apply(this, arguments);\n };\n function __values2(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read2(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = {\n error\n };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n var isEqual = function(obj1, obj2) {\n var e_1, _a;\n var primitive = ["string", "number", "boolean", "undefined"];\n var typeA = typeof obj1;\n var typeB = typeof obj2;\n if (typeA !== typeB) {\n return false;\n }\n try {\n for (var primitive_1 = __values2(primitive), primitive_1_1 = primitive_1.next(); !primitive_1_1.done; primitive_1_1 = primitive_1.next()) {\n var p = primitive_1_1.value;\n if (p === typeA) {\n return obj1 === obj2;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (primitive_1_1 && !primitive_1_1.done && (_a = primitive_1.return)) _a.call(primitive_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n if (obj1 == null && obj2 == null) {\n return true;\n } else if (obj1 == null || obj2 == null) {\n return false;\n }\n if (obj1.length !== obj2.length) {\n return false;\n }\n var isArrayA = Array.isArray(obj1);\n var isArrayB = Array.isArray(obj2);\n if (isArrayA !== isArrayB) {\n return false;\n }\n if (isArrayA && isArrayB) {\n for (var i = 0; i < obj1.length; i++) {\n if (!isEqual(obj1[i], obj2[i])) {\n return false;\n }\n }\n } else {\n var sorted1 = Object.keys(obj1).sort();\n var sorted2 = Object.keys(obj2).sort();\n if (!isEqual(sorted1, sorted2)) {\n return false;\n }\n var result_1 = true;\n Object.keys(obj1).forEach(function(key) {\n if (!isEqual(obj1[key], obj2[key])) {\n result_1 = false;\n }\n });\n return result_1;\n }\n return true;\n };\n var ID_OP_SET = "$set";\n var ID_OP_UNSET = "$unset";\n var ID_OP_CLEAR_ALL = "$clearAll";\n if (!Object.entries) {\n Object.entries = function(obj) {\n var ownProps = Object.keys(obj);\n var i = ownProps.length;\n var resArray = new Array(i);\n while (i--) {\n resArray[i] = [ownProps[i], obj[ownProps[i]]];\n }\n return resArray;\n };\n }\n var IdentityStoreImpl = (\n /** @class */\n (function() {\n function IdentityStoreImpl2() {\n this.identity = { userProperties: {} };\n this.listeners = /* @__PURE__ */ new Set();\n }\n IdentityStoreImpl2.prototype.editIdentity = function() {\n var self2 = this;\n var actingUserProperties = __assign2({}, this.identity.userProperties);\n var actingIdentity = __assign2(__assign2({}, this.identity), { userProperties: actingUserProperties });\n return {\n setUserId: function(userId) {\n actingIdentity.userId = userId;\n return this;\n },\n setDeviceId: function(deviceId) {\n actingIdentity.deviceId = deviceId;\n return this;\n },\n setUserProperties: function(userProperties) {\n actingIdentity.userProperties = userProperties;\n return this;\n },\n setOptOut: function(optOut) {\n actingIdentity.optOut = optOut;\n return this;\n },\n updateUserProperties: function(actions) {\n var e_1, _a, e_2, _b, e_3, _c;\n var actingProperties = actingIdentity.userProperties || {};\n try {\n for (var _d = __values2(Object.entries(actions)), _e = _d.next(); !_e.done; _e = _d.next()) {\n var _f = __read2(_e.value, 2), action = _f[0], properties = _f[1];\n switch (action) {\n case ID_OP_SET:\n try {\n for (var _g = (e_2 = void 0, __values2(Object.entries(properties))), _h = _g.next(); !_h.done; _h = _g.next()) {\n var _j = __read2(_h.value, 2), key = _j[0], value = _j[1];\n actingProperties[key] = value;\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n break;\n case ID_OP_UNSET:\n try {\n for (var _k = (e_3 = void 0, __values2(Object.keys(properties))), _l = _k.next(); !_l.done; _l = _k.next()) {\n var key = _l.value;\n delete actingProperties[key];\n }\n } catch (e_3_1) {\n e_3 = { error: e_3_1 };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n break;\n case ID_OP_CLEAR_ALL:\n actingProperties = {};\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n actingIdentity.userProperties = actingProperties;\n return this;\n },\n commit: function() {\n self2.setIdentity(actingIdentity);\n return this;\n }\n };\n };\n IdentityStoreImpl2.prototype.getIdentity = function() {\n return __assign2({}, this.identity);\n };\n IdentityStoreImpl2.prototype.setIdentity = function(identity) {\n var originalIdentity = __assign2({}, this.identity);\n this.identity = __assign2({}, identity);\n if (!isEqual(originalIdentity, this.identity)) {\n this.listeners.forEach(function(listener) {\n listener(identity);\n });\n }\n };\n IdentityStoreImpl2.prototype.addIdentityListener = function(listener) {\n this.listeners.add(listener);\n };\n IdentityStoreImpl2.prototype.removeIdentityListener = function(listener) {\n this.listeners.delete(listener);\n };\n return IdentityStoreImpl2;\n })()\n );\n var safeGlobal = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self;\n var AnalyticsConnector = (\n /** @class */\n (function() {\n function AnalyticsConnector2() {\n this.identityStore = new IdentityStoreImpl();\n this.eventBridge = new EventBridgeImpl();\n this.applicationContextProvider = new ApplicationContextProviderImpl();\n }\n AnalyticsConnector2.getInstance = function(instanceName) {\n if (!safeGlobal["analyticsConnectorInstances"]) {\n safeGlobal["analyticsConnectorInstances"] = {};\n }\n if (!safeGlobal["analyticsConnectorInstances"][instanceName]) {\n safeGlobal["analyticsConnectorInstances"][instanceName] = new AnalyticsConnector2();\n }\n return safeGlobal["analyticsConnectorInstances"][instanceName];\n };\n return AnalyticsConnector2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/analytics-connector.js\n var getAnalyticsConnector = function(instanceName) {\n if (instanceName === void 0) {\n instanceName = "$default_instance";\n }\n return AnalyticsConnector.getInstance(instanceName);\n };\n var setConnectorUserId = function(userId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setUserId(userId).commit();\n };\n var setConnectorDeviceId = function(deviceId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setDeviceId(deviceId).commit();\n };\n var setConnectorOptOut = function(optOut, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setOptOut(optOut).commit();\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/global-scope.js\n var getGlobalScope = function() {\n if (typeof globalThis !== "undefined") {\n return globalThis;\n }\n if (typeof window !== "undefined") {\n return window;\n }\n if (typeof self !== "undefined") {\n return self;\n }\n if (typeof global !== "undefined") {\n return global;\n }\n return void 0;\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/query-params.js\n var getQueryParams = function() {\n var _a;\n var globalScope = getGlobalScope();\n if (!((_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.location) === null || _a === void 0 ? void 0 : _a.search)) {\n return {};\n }\n var pairs = globalScope.location.search.substring(1).split("&").filter(Boolean);\n var params = pairs.reduce(function(acc, curr) {\n var query = curr.split("=", 2);\n var key = tryDecodeURIComponent(query[0]);\n var value = tryDecodeURIComponent(query[1]);\n if (!value) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n return params;\n };\n var tryDecodeURIComponent = function(value) {\n if (value === void 0) {\n value = "";\n }\n try {\n return decodeURIComponent(value);\n } catch (_a) {\n return "";\n }\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/constants.js\n var UTM_CAMPAIGN = "utm_campaign";\n var UTM_CONTENT = "utm_content";\n var UTM_ID = "utm_id";\n var UTM_MEDIUM = "utm_medium";\n var UTM_SOURCE = "utm_source";\n var UTM_TERM = "utm_term";\n var DCLID = "dclid";\n var FBCLID = "fbclid";\n var GBRAID = "gbraid";\n var GCLID = "gclid";\n var KO_CLICK_ID = "ko_click_id";\n var LI_FAT_ID = "li_fat_id";\n var MSCLKID = "msclkid";\n var RDT_CID = "rtd_cid";\n var TTCLID = "ttclid";\n var TWCLID = "twclid";\n var WBRAID = "wbraid";\n var BASE_CAMPAIGN = {\n utm_campaign: void 0,\n utm_content: void 0,\n utm_id: void 0,\n utm_medium: void 0,\n utm_source: void 0,\n utm_term: void 0,\n referrer: void 0,\n referring_domain: void 0,\n dclid: void 0,\n gbraid: void 0,\n gclid: void 0,\n fbclid: void 0,\n ko_click_id: void 0,\n li_fat_id: void 0,\n msclkid: void 0,\n rtd_cid: void 0,\n ttclid: void 0,\n twclid: void 0,\n wbraid: void 0\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/campaign-parser.js\n var CampaignParser = (\n /** @class */\n (function() {\n function CampaignParser2() {\n }\n CampaignParser2.prototype.parse = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, __assign(__assign(__assign(__assign({}, BASE_CAMPAIGN), this.getUtmParam()), this.getReferrer()), this.getClickIds())];\n });\n });\n };\n CampaignParser2.prototype.getUtmParam = function() {\n var params = getQueryParams();\n var utmCampaign = params[UTM_CAMPAIGN];\n var utmContent = params[UTM_CONTENT];\n var utmId = params[UTM_ID];\n var utmMedium = params[UTM_MEDIUM];\n var utmSource = params[UTM_SOURCE];\n var utmTerm = params[UTM_TERM];\n return {\n utm_campaign: utmCampaign,\n utm_content: utmContent,\n utm_id: utmId,\n utm_medium: utmMedium,\n utm_source: utmSource,\n utm_term: utmTerm\n };\n };\n CampaignParser2.prototype.getReferrer = function() {\n var _a, _b;\n var data = {\n referrer: void 0,\n referring_domain: void 0\n };\n try {\n data.referrer = document.referrer || void 0;\n data.referring_domain = (_b = (_a = data.referrer) === null || _a === void 0 ? void 0 : _a.split("/")[2]) !== null && _b !== void 0 ? _b : void 0;\n } catch (_c) {\n }\n return data;\n };\n CampaignParser2.prototype.getClickIds = function() {\n var _a;\n var params = getQueryParams();\n return _a = {}, _a[DCLID] = params[DCLID], _a[FBCLID] = params[FBCLID], _a[GBRAID] = params[GBRAID], _a[GCLID] = params[GCLID], _a[KO_CLICK_ID] = params[KO_CLICK_ID], _a[LI_FAT_ID] = params[LI_FAT_ID], _a[MSCLKID] = params[MSCLKID], _a[RDT_CID] = params[RDT_CID], _a[TTCLID] = params[TTCLID], _a[TWCLID] = params[TWCLID], _a[WBRAID] = params[WBRAID], _a;\n };\n return CampaignParser2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/cookie-name.js\n var getCookieName = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var getOldCookieName = function(apiKey) {\n return "".concat(AMPLITUDE_PREFIX.toLowerCase(), "_").concat(apiKey.substring(0, 6));\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/default-tracking.js\n var isFileDownloadTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.fileDownloads) {\n return true;\n }\n return false;\n };\n var isFormInteractionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.formInteractions) {\n return true;\n }\n return false;\n };\n var isPageViewTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if ((defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) === true || (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) && typeof defaultTracking.pageViews === "object") {\n return true;\n }\n return false;\n };\n var isSessionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.sessions) {\n return true;\n }\n return false;\n };\n var getPageViewTrackingConfig = function(config) {\n var _a;\n var trackOn = ((_a = config.attribution) === null || _a === void 0 ? void 0 : _a.trackPageViews) ? "attribution" : function() {\n return false;\n };\n var trackHistoryChanges = void 0;\n var eventType = "Page View";\n var isDefaultPageViewTrackingEnabled = isPageViewTrackingEnabled(config.defaultTracking);\n if (isDefaultPageViewTrackingEnabled) {\n trackOn = void 0;\n eventType = void 0;\n if (config.defaultTracking && typeof config.defaultTracking === "object" && config.defaultTracking.pageViews && typeof config.defaultTracking.pageViews === "object") {\n if ("trackOn" in config.defaultTracking.pageViews) {\n trackOn = config.defaultTracking.pageViews.trackOn;\n }\n if ("trackHistoryChanges" in config.defaultTracking.pageViews) {\n trackHistoryChanges = config.defaultTracking.pageViews.trackHistoryChanges;\n }\n if ("eventType" in config.defaultTracking.pageViews && config.defaultTracking.pageViews.eventType) {\n eventType = config.defaultTracking.pageViews.eventType;\n }\n }\n }\n return {\n trackOn,\n trackHistoryChanges,\n eventType\n };\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/language.js\n var getLanguage2 = function() {\n var _a, _b, _c, _d;\n if (typeof navigator === "undefined")\n return "";\n var userLanguage = navigator.userLanguage;\n return (_d = (_c = (_b = (_a = navigator.languages) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : navigator.language) !== null && _c !== void 0 ? _c : userLanguage) !== null && _d !== void 0 ? _d : "";\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/plugins/identity.js\n var IdentityEventSender = (\n /** @class */\n (function() {\n function IdentityEventSender2() {\n this.name = "identity";\n this.type = PluginType.BEFORE;\n this.identityStore = getAnalyticsConnector().identityStore;\n }\n IdentityEventSender2.prototype.execute = function(context) {\n return __awaiter(this, void 0, void 0, function() {\n var userProperties;\n return __generator(this, function(_a) {\n userProperties = context.user_properties;\n if (userProperties) {\n this.identityStore.editIdentity().updateUserProperties(userProperties).commit();\n }\n return [2, context];\n });\n });\n };\n IdentityEventSender2.prototype.setup = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (config.instanceName) {\n this.identityStore = getAnalyticsConnector(config.instanceName).identityStore;\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return IdentityEventSender2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/storage/cookie.js\n var CookieStorage = (\n /** @class */\n (function() {\n function CookieStorage2(options) {\n this.options = __assign({}, options);\n }\n CookieStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var testStrorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n CookieStorage2.testValue = String(Date.now());\n testStrorage = new CookieStorage2(this.options);\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStrorage.set(testKey, CookieStorage2.testValue)];\n case 2:\n _b.sent();\n return [4, testStrorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === CookieStorage2.testValue];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStrorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.getRaw(key)];\n case 1:\n value = _a.sent();\n if (!value) {\n return [2, void 0];\n }\n try {\n try {\n value = decodeURIComponent(atob(value));\n } catch (_b) {\n }\n return [2, JSON.parse(value)];\n } catch (_c) {\n return [2, void 0];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var globalScope, cookie, match;\n return __generator(this, function(_b) {\n globalScope = getGlobalScope();\n cookie = (_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.document.cookie.split("; ")) !== null && _a !== void 0 ? _a : [];\n match = cookie.find(function(c) {\n return c.indexOf(key + "=") === 0;\n });\n if (!match) {\n return [2, void 0];\n }\n return [2, match.substring(key.length + 1)];\n });\n });\n };\n CookieStorage2.prototype.set = function(key, value) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var expirationDays, expires, expireDate, date, str, globalScope;\n return __generator(this, function(_b) {\n try {\n expirationDays = (_a = this.options.expirationDays) !== null && _a !== void 0 ? _a : 0;\n expires = value !== null ? expirationDays : -1;\n expireDate = void 0;\n if (expires) {\n date = /* @__PURE__ */ new Date();\n date.setTime(date.getTime() + expires * 24 * 60 * 60 * 1e3);\n expireDate = date;\n }\n str = "".concat(key, "=").concat(btoa(encodeURIComponent(JSON.stringify(value))));\n if (expireDate) {\n str += "; expires=".concat(expireDate.toUTCString());\n }\n str += "; path=/";\n if (this.options.domain) {\n str += "; domain=".concat(this.options.domain);\n }\n if (this.options.secure) {\n str += "; Secure";\n }\n if (this.options.sameSite) {\n str += "; SameSite=".concat(this.options.sameSite);\n }\n globalScope = getGlobalScope();\n if (globalScope) {\n globalScope.document.cookie = str;\n }\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n CookieStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.set(key, null)];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return CookieStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/transports/fetch.js\n var FetchTransport = (\n /** @class */\n (function(_super) {\n __extends(FetchTransport2, _super);\n function FetchTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FetchTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var options, response, responseText;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (typeof fetch === "undefined") {\n throw new Error("FetchTransport is not supported");\n }\n options = {\n headers: {\n "Content-Type": "application/json",\n Accept: "*/*"\n },\n body: JSON.stringify(payload),\n method: "POST"\n };\n return [4, fetch(serverUrl, options)];\n case 1:\n response = _a.sent();\n return [4, response.text()];\n case 2:\n responseText = _a.sent();\n try {\n return [2, this.buildResponse(JSON.parse(responseText))];\n } catch (_b) {\n return [2, this.buildResponse({ code: response.status })];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return FetchTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js\n var omitUndefined = function(input) {\n var obj = {};\n for (var key in input) {\n var val = input[key];\n if (val) {\n obj[key] = val;\n }\n }\n return obj;\n };\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js\n var pageViewTrackingPlugin = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var globalScope = getGlobalScope();\n var loggerProvider = void 0;\n var pushState;\n var _a = __read(args, 2), clientOrOptions = _a[0], configOrUndefined = _a[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var createPageViewEvent = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a2;\n var _b;\n var _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n _b = {\n event_type: (_c = options.eventType) !== null && _c !== void 0 ? _c : "Page View"\n };\n _a2 = [{}];\n return [4, getCampaignParams()];\n case 1:\n return [2, (_b.event_properties = __assign.apply(void 0, [__assign.apply(void 0, _a2.concat([_d.sent()])), { page_domain: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.hostname || ""\n ), page_location: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href || ""\n ), page_path: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.pathname || ""\n ), page_title: (\n /* istanbul ignore next */\n typeof document !== "undefined" && document.title || ""\n ), page_url: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href.split("?")[0] || ""\n ) }]), _b)];\n }\n });\n });\n };\n var shouldTrackOnPageLoad = function() {\n return typeof options.trackOn === "undefined" || typeof options.trackOn === "function" && options.trackOn();\n };\n var previousURL = typeof location !== "undefined" ? location.href : null;\n var trackHistoryPageView = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var newURL, shouldTrackPageView, _a2, _b, _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n newURL = location.href;\n shouldTrackPageView = shouldTrackHistoryPageView(options.trackHistoryChanges, newURL, previousURL || "") && shouldTrackOnPageLoad();\n previousURL = newURL;\n if (!shouldTrackPageView) return [3, 4];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Tracking page view event");\n if (!(amplitude === null || amplitude === void 0)) return [3, 1];\n _a2 = void 0;\n return [3, 3];\n case 1:\n _c = (_b = amplitude).track;\n return [4, createPageViewEvent()];\n case 2:\n _a2 = _c.apply(_b, [_d.sent()]);\n _d.label = 3;\n case 3:\n _a2;\n _d.label = 4;\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n var trackHistoryPageViewWrapper = function() {\n void trackHistoryPageView();\n };\n var plugin = {\n name: "page-view-tracking",\n type: PluginType.ENRICHMENT,\n setup: function(config, client) {\n return __awaiter(void 0, void 0, void 0, function() {\n var receivedType, _a2, _b;\n var _c, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n loggerProvider = config.loggerProvider;\n loggerProvider.log("Installing @amplitude/plugin-page-view-tracking-browser");\n options.trackOn = ((_c = config.attribution) === null || _c === void 0 ? void 0 : _c.trackPageViews) ? "attribution" : options.trackOn;\n if (!client && ((_d = config.attribution) === null || _d === void 0 ? void 0 : _d.trackPageViews)) {\n loggerProvider.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser.");\n config.attribution.trackPageViews = false;\n }\n if (options.trackHistoryChanges && globalScope) {\n globalScope.addEventListener("popstate", trackHistoryPageViewWrapper);\n pushState = globalScope.history.pushState;\n globalScope.history.pushState = new Proxy(globalScope.history.pushState, {\n apply: function(target, thisArg, _a3) {\n var _b2 = __read(_a3, 3), state = _b2[0], unused = _b2[1], url = _b2[2];\n target.apply(thisArg, [state, unused, url]);\n void trackHistoryPageView();\n }\n });\n }\n if (!shouldTrackOnPageLoad()) return [3, 2];\n loggerProvider.log("Tracking page view event");\n _b = (_a2 = amplitude).track;\n return [4, createPageViewEvent()];\n case 1:\n _b.apply(_a2, [_e.sent()]);\n _e.label = 2;\n case 2:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n var pageViewEvent;\n return __generator(this, function(_a2) {\n switch (_a2.label) {\n case 0:\n if (!(options.trackOn === "attribution" && isCampaignEvent(event))) return [3, 2];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Enriching campaign event to page view event with campaign parameters");\n return [4, createPageViewEvent()];\n case 1:\n pageViewEvent = _a2.sent();\n event.event_type = pageViewEvent.event_type;\n event.event_properties = __assign(__assign({}, event.event_properties), pageViewEvent.event_properties);\n _a2.label = 2;\n case 2:\n return [2, event];\n }\n });\n });\n },\n teardown: function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n if (globalScope) {\n globalScope.removeEventListener("popstate", trackHistoryPageViewWrapper);\n if (pushState) {\n globalScope.history.pushState = pushState;\n }\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n }\n };\n plugin.__trackHistoryPageView = trackHistoryPageView;\n return plugin;\n };\n var getCampaignParams = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _a = omitUndefined;\n return [4, new CampaignParser().parse()];\n case 1:\n return [2, _a.apply(void 0, [_b.sent()])];\n }\n });\n });\n };\n var isCampaignEvent = function(event) {\n if (event.event_type === "$identify" && event.user_properties) {\n var properties = event.user_properties;\n var $set = properties[IdentifyOperation.SET] || {};\n var $unset = properties[IdentifyOperation.UNSET] || {};\n var userProperties_1 = __spreadArray(__spreadArray([], __read(Object.keys($set)), false), __read(Object.keys($unset)), false);\n return Object.keys(BASE_CAMPAIGN).every(function(value) {\n return userProperties_1.includes(value);\n });\n }\n return false;\n };\n var shouldTrackHistoryPageView = function(trackingOption, newURL, oldURL) {\n switch (trackingOption) {\n case "pathOnly":\n return newURL.split("?")[0] !== oldURL.split("?")[0];\n default:\n return newURL !== oldURL;\n }\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/helpers.js\n var getStorageKey = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var domainWithoutSubdomain = function(domain) {\n var parts = domain.split(".");\n if (parts.length <= 2) {\n return domain;\n }\n return parts.slice(parts.length - 2, parts.length).join(".");\n };\n var isNewCampaign = function(current, previous, options) {\n var _a;\n var referrer = current.referrer, referring_domain = current.referring_domain, currentCampaign = __rest(current, ["referrer", "referring_domain"]);\n var _b = previous || {}, _previous_referrer = _b.referrer, prevReferringDomain = _b.referring_domain, previousCampaign = __rest(_b, ["referrer", "referring_domain"]);\n if (current.referring_domain && ((_a = options.excludeReferrers) === null || _a === void 0 ? void 0 : _a.includes(current.referring_domain))) {\n return false;\n }\n var hasNewCampaign = JSON.stringify(currentCampaign) !== JSON.stringify(previousCampaign);\n var hasNewDomain = domainWithoutSubdomain(referring_domain || "") !== domainWithoutSubdomain(prevReferringDomain || "");\n return !previous || hasNewCampaign || hasNewDomain;\n };\n var createCampaignEvent = function(campaign, options) {\n var campaignParameters = __assign(__assign({}, BASE_CAMPAIGN), campaign);\n var identifyEvent = Object.entries(campaignParameters).reduce(function(identify2, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n identify2.setOnce("initial_".concat(key), (_b = value !== null && value !== void 0 ? value : options.initialEmptyValue) !== null && _b !== void 0 ? _b : "EMPTY");\n if (value) {\n return identify2.set(key, value);\n }\n return identify2.unset(key);\n }, new Identify());\n return createIdentifyEvent(identifyEvent);\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/web-attribution.js\n var webAttributionPlugin = function() {\n var _this = this;\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var _b = __read(args, 2), clientOrOptions = _b[0], configOrUndefined = _b[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var excludeReferrers = (_a = options.excludeReferrers) !== null && _a !== void 0 ? _a : [];\n if (typeof location !== "undefined") {\n excludeReferrers.unshift(location.hostname);\n }\n options = __assign(__assign({ disabled: false, initialEmptyValue: "EMPTY", resetSessionOnNewCampaign: false }, options), { excludeReferrers });\n var plugin = {\n name: "web-attribution",\n type: PluginType.BEFORE,\n setup: function(config, client) {\n var _a2;\n return __awaiter(this, void 0, void 0, function() {\n var receivedType, storage, storageKey, _b2, currentCampaign, previousCampaign, pluginEnabledOverride, campaignEvent;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n if (options.disabled) {\n config.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n config.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser.");\n if (!client && !((_a2 = config.attribution) === null || _a2 === void 0 ? void 0 : _a2.disabled)) {\n config.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser.");\n config.attribution = {\n disabled: true\n };\n }\n storage = config.cookieStorage;\n storageKey = getStorageKey(config.apiKey, "MKTG");\n return [4, Promise.all([\n new CampaignParser().parse(),\n storage.get(storageKey)\n ])];\n case 1:\n _b2 = __read.apply(void 0, [_c.sent(), 2]), currentCampaign = _b2[0], previousCampaign = _b2[1];\n pluginEnabledOverride = this.__pluginEnabledOverride;\n if (pluginEnabledOverride !== null && pluginEnabledOverride !== void 0 ? pluginEnabledOverride : isNewCampaign(currentCampaign, previousCampaign, options)) {\n if (options.resetSessionOnNewCampaign) {\n amplitude.setSessionId(Date.now());\n config.loggerProvider.log("Created a new session for new campaign.");\n }\n config.loggerProvider.log("Tracking attribution.");\n campaignEvent = createCampaignEvent(currentCampaign, options);\n amplitude.track(campaignEvent);\n void storage.set(storageKey, currentCampaign);\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(_this, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n return [2, event];\n });\n });\n }\n };\n plugin.__pluginEnabledOverride = void 0;\n return plugin;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js\n var MAX_ARRAY_LENGTH = 1e3;\n var LocalStorage = (\n /** @class */\n (function() {\n function LocalStorage2(config) {\n this.loggerProvider = config === null || config === void 0 ? void 0 : config.loggerProvider;\n }\n LocalStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var random, testStorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n random = String(Date.now());\n testStorage = new LocalStorage2();\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStorage.set(testKey, random)];\n case 2:\n _b.sent();\n return [4, testStorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === random];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n return [4, this.getRaw(key)];\n case 1:\n value = _b.sent();\n if (!value) {\n return [2, void 0];\n }\n return [2, JSON.parse(value)];\n case 2:\n _a = _b.sent();\n return [2, void 0];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n return [2, ((_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.getItem(key)) || void 0];\n });\n });\n };\n LocalStorage2.prototype.set = function(key, value) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var isExceededArraySize, serializedValue, droppedEventsCount;\n return __generator(this, function(_c) {\n isExceededArraySize = Array.isArray(value) && value.length > MAX_ARRAY_LENGTH;\n try {\n serializedValue = isExceededArraySize ? JSON.stringify(value.slice(0, MAX_ARRAY_LENGTH)) : JSON.stringify(value);\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.setItem(key, serializedValue);\n } catch (_d) {\n }\n if (isExceededArraySize) {\n droppedEventsCount = value.length - MAX_ARRAY_LENGTH;\n (_b = this.loggerProvider) === null || _b === void 0 ? void 0 : _b.error("Failed to save ".concat(droppedEventsCount, " events because the queue length exceeded ").concat(MAX_ARRAY_LENGTH, "."));\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.remove = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.removeItem(key);\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.reset = function() {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.clear();\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return LocalStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js\n var XHRTransport = (\n /** @class */\n (function(_super) {\n __extends(XHRTransport2, _super);\n function XHRTransport2() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n done: 4\n };\n return _this;\n }\n XHRTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n if (typeof XMLHttpRequest === "undefined") {\n reject(new Error("XHRTransport is not supported."));\n }\n var xhr = new XMLHttpRequest();\n xhr.open("POST", serverUrl, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === _this.state.done) {\n try {\n var responsePayload = xhr.responseText;\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n xhr.setRequestHeader("Content-Type", "application/json");\n xhr.setRequestHeader("Accept", "*/*");\n xhr.send(JSON.stringify(payload));\n })];\n });\n });\n };\n return XHRTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js\n var SendBeaconTransport = (\n /** @class */\n (function(_super) {\n __extends(SendBeaconTransport2, _super);\n function SendBeaconTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SendBeaconTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n var globalScope = getGlobalScope();\n if (!(globalScope === null || globalScope === void 0 ? void 0 : globalScope.navigator.sendBeacon)) {\n throw new Error("SendBeaconTransport is not supported");\n }\n try {\n var data = JSON.stringify(payload);\n var success = globalScope.navigator.sendBeacon(serverUrl, JSON.stringify(payload));\n if (success) {\n return resolve(_this.buildResponse({\n code: 200,\n events_ingested: payload.events.length,\n payload_size_bytes: data.length,\n server_upload_time: Date.now()\n }));\n }\n return resolve(_this.buildResponse({ code: 500 }));\n } catch (e) {\n reject(e);\n }\n })];\n });\n });\n };\n return SendBeaconTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/config.js\n var getDefaultConfig2 = function() {\n var cookieStorage = new MemoryStorage();\n var trackingOptions = {\n deviceManufacturer: true,\n deviceModel: true,\n ipAddress: true,\n language: true,\n osName: true,\n osVersion: true,\n platform: true\n };\n return {\n cookieExpiration: 365,\n cookieSameSite: "Lax",\n cookieSecure: false,\n cookieStorage,\n cookieUpgrade: true,\n disableCookies: false,\n domain: "",\n sessionTimeout: 30 * 60 * 1e3,\n trackingOptions,\n transportProvider: new FetchTransport()\n };\n };\n var BrowserConfig = (\n /** @class */\n (function(_super) {\n __extends(BrowserConfig2, _super);\n function BrowserConfig2(apiKey, options) {\n var _this = this;\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n var defaultConfig = getDefaultConfig2();\n _this = _super.call(this, __assign(__assign({ flushIntervalMillis: 1e3, flushMaxRetries: 5, flushQueueSize: 30, transportProvider: defaultConfig.transportProvider }, options), { apiKey })) || this;\n _this._optOut = false;\n _this.cookieStorage = (_a = options === null || options === void 0 ? void 0 : options.cookieStorage) !== null && _a !== void 0 ? _a : defaultConfig.cookieStorage;\n _this.deviceId = options === null || options === void 0 ? void 0 : options.deviceId;\n _this.lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n _this.lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n _this.optOut = Boolean(options === null || options === void 0 ? void 0 : options.optOut);\n _this.sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n _this.userId = options === null || options === void 0 ? void 0 : options.userId;\n _this.appVersion = options === null || options === void 0 ? void 0 : options.appVersion;\n _this.attribution = options === null || options === void 0 ? void 0 : options.attribution;\n _this.cookieExpiration = (_b = options === null || options === void 0 ? void 0 : options.cookieExpiration) !== null && _b !== void 0 ? _b : defaultConfig.cookieExpiration;\n _this.cookieSameSite = (_c = options === null || options === void 0 ? void 0 : options.cookieSameSite) !== null && _c !== void 0 ? _c : defaultConfig.cookieSameSite;\n _this.cookieSecure = (_d = options === null || options === void 0 ? void 0 : options.cookieSecure) !== null && _d !== void 0 ? _d : defaultConfig.cookieSecure;\n _this.cookieUpgrade = (_e = options === null || options === void 0 ? void 0 : options.cookieUpgrade) !== null && _e !== void 0 ? _e : defaultConfig.cookieUpgrade;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.disableCookies = (_f = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _f !== void 0 ? _f : defaultConfig.disableCookies;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.domain = (_g = options === null || options === void 0 ? void 0 : options.domain) !== null && _g !== void 0 ? _g : defaultConfig.domain;\n _this.partnerId = options === null || options === void 0 ? void 0 : options.partnerId;\n _this.sessionTimeout = (_h = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _h !== void 0 ? _h : defaultConfig.sessionTimeout;\n _this.trackingOptions = (_j = options === null || options === void 0 ? void 0 : options.trackingOptions) !== null && _j !== void 0 ? _j : defaultConfig.trackingOptions;\n return _this;\n }\n Object.defineProperty(BrowserConfig2.prototype, "deviceId", {\n get: function() {\n return this._deviceId;\n },\n set: function(deviceId) {\n if (this._deviceId !== deviceId) {\n this._deviceId = deviceId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "userId", {\n get: function() {\n return this._userId;\n },\n set: function(userId) {\n if (this._userId !== userId) {\n this._userId = userId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "sessionId", {\n get: function() {\n return this._sessionId;\n },\n set: function(sessionId) {\n if (this._sessionId !== sessionId) {\n this._sessionId = sessionId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n if (this._optOut !== optOut) {\n this._optOut = optOut;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventTime", {\n get: function() {\n return this._lastEventTime;\n },\n set: function(lastEventTime) {\n if (this._lastEventTime !== lastEventTime) {\n this._lastEventTime = lastEventTime;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventId", {\n get: function() {\n return this._lastEventId;\n },\n set: function(lastEventId) {\n if (this._lastEventId !== lastEventId) {\n this._lastEventId = lastEventId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n BrowserConfig2.prototype.updateStorage = function() {\n var _a;\n var cache = {\n deviceId: this._deviceId,\n userId: this._userId,\n sessionId: this._sessionId,\n optOut: this._optOut,\n lastEventTime: this._lastEventTime,\n lastEventId: this._lastEventId\n };\n void ((_a = this.cookieStorage) === null || _a === void 0 ? void 0 : _a.set(getCookieName(this.apiKey), cache));\n };\n return BrowserConfig2;\n })(Config)\n );\n var useBrowserConfig = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var defaultConfig, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, cookieStorage, domain, _a, _b, _c;\n var _d;\n var _e, _f;\n return __generator(this, function(_g) {\n switch (_g.label) {\n case 0:\n defaultConfig = getDefaultConfig2();\n deviceId = (_e = options === null || options === void 0 ? void 0 : options.deviceId) !== null && _e !== void 0 ? _e : UUID();\n lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n optOut = options === null || options === void 0 ? void 0 : options.optOut;\n sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n userId = options === null || options === void 0 ? void 0 : options.userId;\n cookieStorage = options === null || options === void 0 ? void 0 : options.cookieStorage;\n domain = options === null || options === void 0 ? void 0 : options.domain;\n _a = BrowserConfig.bind;\n _b = [void 0, apiKey];\n _c = [__assign({}, options)];\n _d = { cookieStorage, deviceId, domain, lastEventId, lastEventTime, optOut, sessionId };\n return [4, createEventsStorage(options)];\n case 1:\n return [2, new (_a.apply(BrowserConfig, _b.concat([__assign.apply(void 0, _c.concat([(_d.storageProvider = _g.sent(), _d.trackingOptions = __assign(__assign({}, defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions), _d.transportProvider = (_f = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _f !== void 0 ? _f : createTransport(options === null || options === void 0 ? void 0 : options.transport), _d.userId = userId, _d)]))])))()];\n }\n });\n });\n };\n var createCookieStorage = function(overrides, baseConfig) {\n if (baseConfig === void 0) {\n baseConfig = getDefaultConfig2();\n }\n return __awaiter(void 0, void 0, void 0, function() {\n var options, cookieStorage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n options = __assign(__assign({}, baseConfig), overrides);\n cookieStorage = overrides === null || overrides === void 0 ? void 0 : overrides.cookieStorage;\n _a = !cookieStorage;\n if (_a) return [3, 2];\n return [4, cookieStorage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (_a) {\n return [2, createFlexibleStorage(options)];\n }\n return [2, cookieStorage];\n }\n });\n });\n };\n var createFlexibleStorage = function(options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n storage = new CookieStorage({\n domain: options.domain,\n expirationDays: options.cookieExpiration,\n sameSite: options.cookieSameSite,\n secure: options.cookieSecure\n });\n _a = options.disableCookies;\n if (_a) return [3, 2];\n return [4, storage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (!_a) return [3, 4];\n storage = new LocalStorage();\n return [4, storage.isEnabled()];\n case 3:\n if (!_b.sent()) {\n storage = new MemoryStorage();\n }\n _b.label = 4;\n case 4:\n return [2, storage];\n }\n });\n });\n };\n var createEventsStorage = function(overrides) {\n return __awaiter(void 0, void 0, void 0, function() {\n var hasStorageProviderProperty, loggerProvider, _a, _b, storage, _c, e_1_1;\n var e_1, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n hasStorageProviderProperty = overrides && Object.prototype.hasOwnProperty.call(overrides, "storageProvider");\n loggerProvider = overrides && overrides.loggerProvider;\n if (!(!hasStorageProviderProperty || overrides.storageProvider)) return [3, 9];\n _e.label = 1;\n case 1:\n _e.trys.push([1, 7, 8, 9]);\n _a = __values([overrides === null || overrides === void 0 ? void 0 : overrides.storageProvider, new LocalStorage({ loggerProvider })]), _b = _a.next();\n _e.label = 2;\n case 2:\n if (!!_b.done) return [3, 6];\n storage = _b.value;\n _c = storage;\n if (!_c) return [3, 4];\n return [4, storage.isEnabled()];\n case 3:\n _c = _e.sent();\n _e.label = 4;\n case 4:\n if (_c) {\n return [2, storage];\n }\n _e.label = 5;\n case 5:\n _b = _a.next();\n return [3, 2];\n case 6:\n return [3, 9];\n case 7:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 9];\n case 8:\n try {\n if (_b && !_b.done && (_d = _a.return)) _d.call(_a);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 9:\n return [2, void 0];\n }\n });\n });\n };\n var createTransport = function(transport) {\n if (transport === TransportType.XHR) {\n return new XHRTransport();\n }\n if (transport === TransportType.SendBeacon) {\n return new SendBeaconTransport();\n }\n return getDefaultConfig2().transportProvider;\n };\n var getTopLevelDomain = function(url) {\n return __awaiter(void 0, void 0, void 0, function() {\n var host, parts, levels, storageKey, i, i, domain, options, storage, value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, new CookieStorage().isEnabled()];\n case 1:\n if (!_a.sent() || !url && typeof location === "undefined") {\n return [2, ""];\n }\n host = url !== null && url !== void 0 ? url : location.hostname;\n parts = host.split(".");\n levels = [];\n storageKey = "AMP_TLDTEST";\n for (i = parts.length - 2; i >= 0; --i) {\n levels.push(parts.slice(i).join("."));\n }\n i = 0;\n _a.label = 2;\n case 2:\n if (!(i < levels.length)) return [3, 7];\n domain = levels[i];\n options = { domain: "." + domain };\n storage = new CookieStorage(options);\n return [4, storage.set(storageKey, 1)];\n case 3:\n _a.sent();\n return [4, storage.get(storageKey)];\n case 4:\n value = _a.sent();\n if (!value) return [3, 6];\n return [4, storage.remove(storageKey)];\n case 5:\n _a.sent();\n return [2, "." + domain];\n case 6:\n i++;\n return [3, 2];\n case 7:\n return [2, ""];\n }\n });\n });\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/constants.js\n var DEFAULT_EVENT_PREFIX = "[Amplitude]";\n var DEFAULT_PAGE_VIEW_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Page Viewed");\n var DEFAULT_FORM_START_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Started");\n var DEFAULT_FORM_SUBMIT_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Submitted");\n var DEFAULT_FILE_DOWNLOAD_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " File Downloaded");\n var DEFAULT_SESSION_START_EVENT = "session_start";\n var DEFAULT_SESSION_END_EVENT = "session_end";\n var FILE_EXTENSION = "".concat(DEFAULT_EVENT_PREFIX, " File Extension");\n var FILE_NAME = "".concat(DEFAULT_EVENT_PREFIX, " File Name");\n var LINK_ID = "".concat(DEFAULT_EVENT_PREFIX, " Link ID");\n var LINK_TEXT = "".concat(DEFAULT_EVENT_PREFIX, " Link Text");\n var LINK_URL = "".concat(DEFAULT_EVENT_PREFIX, " Link URL");\n var FORM_ID = "".concat(DEFAULT_EVENT_PREFIX, " Form ID");\n var FORM_NAME = "".concat(DEFAULT_EVENT_PREFIX, " Form Name");\n var FORM_DESTINATION = "".concat(DEFAULT_EVENT_PREFIX, " Form Destination");\n\n // node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js\n var parseLegacyCookies = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, oldCookieName, cookies, _a, deviceId, userId, optOut, sessionId, lastEventTime, lastEventId;\n var _b;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n return [4, createCookieStorage(options)];\n case 1:\n storage = _c.sent();\n oldCookieName = getOldCookieName(apiKey);\n return [4, storage.getRaw(oldCookieName)];\n case 2:\n cookies = _c.sent();\n if (!cookies) {\n return [2, {\n optOut: false\n }];\n }\n if (!((_b = options.cookieUpgrade) !== null && _b !== void 0 ? _b : getDefaultConfig2().cookieUpgrade)) return [3, 4];\n return [4, storage.remove(oldCookieName)];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4:\n _a = __read(cookies.split("."), 6), deviceId = _a[0], userId = _a[1], optOut = _a[2], sessionId = _a[3], lastEventTime = _a[4], lastEventId = _a[5];\n return [2, {\n deviceId,\n userId: decode(userId),\n sessionId: parseTime(sessionId),\n lastEventId: parseTime(lastEventId),\n lastEventTime: parseTime(lastEventTime),\n optOut: Boolean(optOut)\n }];\n }\n });\n });\n };\n var parseTime = function(num) {\n var integer = parseInt(num, 32);\n if (isNaN(integer)) {\n return void 0;\n }\n return integer;\n };\n var decode = function(value) {\n if (!atob || !escape || !value) {\n return void 0;\n }\n try {\n return decodeURIComponent(escape(atob(value)));\n } catch (_a) {\n return void 0;\n }\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var import_ua_parser_js = __toESM(require_ua_parser());\n\n // node_modules/@amplitude/analytics-browser/lib/esm/version.js\n var VERSION = "1.13.4";\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var BROWSER_PLATFORM = "Web";\n var IP_ADDRESS = "$remote";\n var Context = (\n /** @class */\n (function() {\n function Context2() {\n this.name = "context";\n this.type = PluginType.BEFORE;\n this.library = "amplitude-ts/".concat(VERSION);\n if (typeof navigator !== "undefined") {\n this.userAgent = navigator.userAgent;\n }\n this.uaResult = new import_ua_parser_js.default(this.userAgent).getResult();\n }\n Context2.prototype.setup = function(config) {\n this.config = config;\n return Promise.resolve(void 0);\n };\n Context2.prototype.execute = function(context) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var time, osName, osVersion, deviceModel, deviceVendor, lastEventId, nextEventId, event;\n return __generator(this, function(_c) {\n time = (/* @__PURE__ */ new Date()).getTime();\n osName = this.uaResult.browser.name;\n osVersion = this.uaResult.browser.version;\n deviceModel = this.uaResult.device.model || this.uaResult.os.name;\n deviceVendor = this.uaResult.device.vendor;\n lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n nextEventId = (_b = context.event_id) !== null && _b !== void 0 ? _b : lastEventId + 1;\n this.config.lastEventId = nextEventId;\n if (!context.time) {\n this.config.lastEventTime = time;\n }\n event = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ user_id: this.config.userId, device_id: this.config.deviceId, session_id: this.config.sessionId, time }, this.config.appVersion && { app_version: this.config.appVersion }), this.config.trackingOptions.platform && { platform: BROWSER_PLATFORM }), this.config.trackingOptions.osName && { os_name: osName }), this.config.trackingOptions.osVersion && { os_version: osVersion }), this.config.trackingOptions.deviceManufacturer && { device_manufacturer: deviceVendor }), this.config.trackingOptions.deviceModel && { device_model: deviceModel }), this.config.trackingOptions.language && { language: getLanguage2() }), this.config.trackingOptions.ipAddress && { ip: IP_ADDRESS }), { insert_id: UUID(), partner_id: this.config.partnerId, plan: this.config.plan }), this.config.ingestionMetadata && {\n ingestion_metadata: {\n source_name: this.config.ingestionMetadata.sourceName,\n source_version: this.config.ingestionMetadata.sourceVersion\n }\n }), context), { event_id: nextEventId, library: this.library, user_agent: this.userAgent });\n return [2, event];\n });\n });\n };\n return Context2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/default-page-view-event-enrichment.js\n var eventPropertyMap = {\n page_domain: "".concat(DEFAULT_EVENT_PREFIX, " Page Domain"),\n page_location: "".concat(DEFAULT_EVENT_PREFIX, " Page Location"),\n page_path: "".concat(DEFAULT_EVENT_PREFIX, " Page Path"),\n page_title: "".concat(DEFAULT_EVENT_PREFIX, " Page Title"),\n page_url: "".concat(DEFAULT_EVENT_PREFIX, " Page URL")\n };\n var defaultPageViewEventEnrichment = function() {\n var name = "@amplitude/plugin-default-page-view-event-enrichment-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, void 0];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (event.event_type === DEFAULT_PAGE_VIEW_EVENT && event.event_properties) {\n event.event_properties = Object.entries(event.event_properties).reduce(function(acc, _a2) {\n var _b = __read(_a2, 2), key = _b[0], value = _b[1];\n var transformedPropertyName = eventPropertyMap[key];\n if (transformedPropertyName) {\n acc[transformedPropertyName] = value;\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n }\n return [2, event];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js\n var fileDownloadTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-file-download-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFileDownloadListener, ext, links;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFileDownloadListener = function(a) {\n var url;\n try {\n url = new URL(a.href, window.location.href);\n } catch (_a2) {\n return;\n }\n var result = ext.exec(url.href);\n var fileExtension = result === null || result === void 0 ? void 0 : result[1];\n if (fileExtension) {\n addEventListener(a, "click", function() {\n var _a2;\n if (fileExtension) {\n amplitude.track(DEFAULT_FILE_DOWNLOAD_EVENT, (_a2 = {}, _a2[FILE_EXTENSION] = fileExtension, _a2[FILE_NAME] = url.pathname, _a2[LINK_ID] = a.id, _a2[LINK_TEXT] = a.text, _a2[LINK_URL] = a.href, _a2));\n }\n });\n }\n };\n ext = /\\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/;\n links = Array.from(document.getElementsByTagName("a"));\n links.forEach(addFileDownloadListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "A") {\n addFileDownloadListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("a")).map(addFileDownloadListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js\n var formInteractionTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-form-interaction-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFormInteractionListener, forms;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFormInteractionListener = function(form) {\n var hasFormChanged = false;\n addEventListener(form, "change", function() {\n var _a2;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n hasFormChanged = true;\n });\n addEventListener(form, "submit", function() {\n var _a2, _b;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n amplitude.track(DEFAULT_FORM_SUBMIT_EVENT, (_b = {}, _b[FORM_ID] = form.id, _b[FORM_NAME] = form.name, _b[FORM_DESTINATION] = form.action, _b));\n hasFormChanged = false;\n });\n };\n forms = Array.from(document.getElementsByTagName("form"));\n forms.forEach(addFormInteractionListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "FORM") {\n addFormInteractionListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("form")).map(addFormInteractionListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js\n var convertProxyObjectToRealObject = function(instance, queue) {\n for (var i = 0; i < queue.length; i++) {\n var _a = queue[i], name_1 = _a.name, args = _a.args, resolve = _a.resolve;\n var fn = instance && instance[name_1];\n if (typeof fn === "function") {\n var result = fn.apply(instance, args);\n if (typeof resolve === "function") {\n resolve(result === null || result === void 0 ? void 0 : result.promise);\n }\n }\n }\n return instance;\n };\n var isInstanceProxy = function(instance) {\n var instanceProxy = instance;\n return instanceProxy && instanceProxy._q !== void 0;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js\n var AmplitudeBrowser = (\n /** @class */\n (function(_super) {\n __extends(AmplitudeBrowser2, _super);\n function AmplitudeBrowser2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AmplitudeBrowser2.prototype.init = function(apiKey, userId, options) {\n if (apiKey === void 0) {\n apiKey = "";\n }\n return returnWrapper(this._init(__assign(__assign({}, options), { userId, apiKey })));\n };\n AmplitudeBrowser2.prototype._init = function(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _r, _s, _t, _u, _v, _w;\n return __awaiter(this, void 0, void 0, function() {\n var _x, _y, _z, legacyCookies, cookieStorage, previousCookies, queryParams, deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, browserOptions, isNewSession, connector, webAttribution, pageViewTrackingOptions;\n var _this = this;\n return __generator(this, function(_0) {\n switch (_0.label) {\n case 0:\n if (this.initializing) {\n return [\n 2\n /*return*/\n ];\n }\n this.initializing = true;\n _x = options;\n if (!options.disableCookies) return [3, 1];\n _y = "";\n return [3, 5];\n case 1:\n if (!((_a = options.domain) !== null && _a !== void 0)) return [3, 2];\n _z = _a;\n return [3, 4];\n case 2:\n return [4, getTopLevelDomain()];\n case 3:\n _z = _0.sent();\n _0.label = 4;\n case 4:\n _y = _z;\n _0.label = 5;\n case 5:\n _x.domain = _y;\n return [4, parseLegacyCookies(options.apiKey, options)];\n case 6:\n legacyCookies = _0.sent();\n return [4, createCookieStorage(options)];\n case 7:\n cookieStorage = _0.sent();\n return [4, cookieStorage.get(getCookieName(options.apiKey))];\n case 8:\n previousCookies = _0.sent();\n queryParams = getQueryParams();\n deviceId = (_d = (_c = (_b = options.deviceId) !== null && _b !== void 0 ? _b : queryParams.deviceId) !== null && _c !== void 0 ? _c : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _d !== void 0 ? _d : legacyCookies.deviceId;\n sessionId = (_e = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _e !== void 0 ? _e : legacyCookies.sessionId;\n optOut = (_g = (_f = options.optOut) !== null && _f !== void 0 ? _f : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _g !== void 0 ? _g : legacyCookies.optOut;\n lastEventId = (_h = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _h !== void 0 ? _h : legacyCookies.lastEventId;\n lastEventTime = (_j = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _j !== void 0 ? _j : legacyCookies.lastEventTime;\n userId = (_l = (_k = options.userId) !== null && _k !== void 0 ? _k : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _l !== void 0 ? _l : legacyCookies.userId;\n this.previousSessionDeviceId = (_m = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _m !== void 0 ? _m : legacyCookies.deviceId;\n this.previousSessionUserId = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _o !== void 0 ? _o : legacyCookies.userId;\n return [4, useBrowserConfig(options.apiKey, __assign(__assign({}, options), { deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, cookieStorage }))];\n case 9:\n browserOptions = _0.sent();\n return [4, _super.prototype._init.call(this, browserOptions)];\n case 10:\n _0.sent();\n isNewSession = false;\n if (\n // user has never sent an event\n !this.config.lastEventTime || // user has no previous session ID\n !this.config.sessionId || // has sent an event and has previous session but expired\n this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout\n ) {\n this.setSessionId((_r = (_p = options.sessionId) !== null && _p !== void 0 ? _p : this.config.sessionId) !== null && _r !== void 0 ? _r : Date.now());\n isNewSession = true;\n }\n connector = getAnalyticsConnector(options.instanceName);\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId\n });\n return [4, this.add(new Destination()).promise];\n case 11:\n _0.sent();\n return [4, this.add(new Context()).promise];\n case 12:\n _0.sent();\n return [4, this.add(new IdentityEventSender()).promise];\n case 13:\n _0.sent();\n if (!isFileDownloadTrackingEnabled(this.config.defaultTracking)) return [3, 15];\n return [4, this.add(fileDownloadTracking()).promise];\n case 14:\n _0.sent();\n _0.label = 15;\n case 15:\n if (!isFormInteractionTrackingEnabled(this.config.defaultTracking)) return [3, 17];\n return [4, this.add(formInteractionTracking()).promise];\n case 16:\n _0.sent();\n _0.label = 17;\n case 17:\n if (!!((_s = this.config.attribution) === null || _s === void 0 ? void 0 : _s.disabled)) return [3, 19];\n webAttribution = webAttributionPlugin({\n excludeReferrers: (_t = this.config.attribution) === null || _t === void 0 ? void 0 : _t.excludeReferrers,\n initialEmptyValue: (_u = this.config.attribution) === null || _u === void 0 ? void 0 : _u.initialEmptyValue,\n resetSessionOnNewCampaign: (_v = this.config.attribution) === null || _v === void 0 ? void 0 : _v.resetSessionOnNewCampaign\n });\n webAttribution.__pluginEnabledOverride = isNewSession || ((_w = this.config.attribution) === null || _w === void 0 ? void 0 : _w.trackNewCampaigns) ? void 0 : false;\n return [4, this.add(webAttribution).promise];\n case 18:\n _0.sent();\n _0.label = 19;\n case 19:\n pageViewTrackingOptions = getPageViewTrackingConfig(this.config);\n pageViewTrackingOptions.eventType = pageViewTrackingOptions.eventType || DEFAULT_PAGE_VIEW_EVENT;\n return [4, this.add(pageViewTrackingPlugin(pageViewTrackingOptions)).promise];\n case 20:\n _0.sent();\n return [4, this.add(defaultPageViewEventEnrichment()).promise];\n case 21:\n _0.sent();\n this.initializing = false;\n return [4, this.runQueuedFunctions("dispatchQ")];\n case 22:\n _0.sent();\n connector.eventBridge.setEventReceiver(function(event) {\n void _this.track(event.eventType, event.eventProperties);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeBrowser2.prototype.getUserId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.userId;\n };\n AmplitudeBrowser2.prototype.setUserId = function(userId) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n if (userId !== this.config.userId || userId === void 0) {\n this.config.userId = userId;\n setConnectorUserId(userId, this.config.instanceName);\n }\n };\n AmplitudeBrowser2.prototype.getDeviceId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.deviceId;\n };\n AmplitudeBrowser2.prototype.setDeviceId = function(deviceId) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n setConnectorDeviceId(deviceId, this.config.instanceName);\n };\n AmplitudeBrowser2.prototype.setOptOut = function(optOut) {\n setConnectorOptOut(optOut, this.config.instanceName);\n _super.prototype.setOptOut.call(this, optOut);\n };\n AmplitudeBrowser2.prototype.reset = function() {\n this.setDeviceId(UUID());\n this.setUserId(void 0);\n };\n AmplitudeBrowser2.prototype.getSessionId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionId;\n };\n AmplitudeBrowser2.prototype.setSessionId = function(sessionId) {\n var _a;\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n if (sessionId === this.config.sessionId) {\n return;\n }\n var previousSessionId = this.getSessionId();\n var lastEventTime = this.config.lastEventTime;\n var lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n this.config.sessionId = sessionId;\n this.config.lastEventTime = void 0;\n if (isSessionTrackingEnabled(this.config.defaultTracking)) {\n if (previousSessionId && lastEventTime) {\n this.track(DEFAULT_SESSION_END_EVENT, void 0, {\n device_id: this.previousSessionDeviceId,\n event_id: ++lastEventId,\n session_id: previousSessionId,\n time: lastEventTime + 1,\n user_id: this.previousSessionUserId\n });\n }\n this.config.lastEventTime = this.config.sessionId;\n this.track(DEFAULT_SESSION_START_EVENT, void 0, {\n event_id: ++lastEventId,\n session_id: this.config.sessionId,\n time: this.config.lastEventTime\n });\n }\n this.previousSessionDeviceId = this.config.deviceId;\n this.previousSessionUserId = this.config.userId;\n };\n AmplitudeBrowser2.prototype.extendSession = function() {\n if (!this.config) {\n this.q.push(this.extendSession.bind(this));\n return;\n }\n this.config.lastEventTime = Date.now();\n };\n AmplitudeBrowser2.prototype.setTransport = function(transport) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n };\n AmplitudeBrowser2.prototype.identify = function(identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return _super.prototype.identify.call(this, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return _super.prototype.groupIdentify.call(this, groupType, groupName, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.revenue = function(revenue2, eventOptions) {\n if (isInstanceProxy(revenue2)) {\n var queue = revenue2._q;\n revenue2._q = [];\n revenue2 = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return _super.prototype.revenue.call(this, revenue2, eventOptions);\n };\n AmplitudeBrowser2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var currentTime, lastEventTime, timeSinceLastEvent;\n return __generator(this, function(_a) {\n currentTime = Date.now();\n lastEventTime = this.config.lastEventTime || Date.now();\n timeSinceLastEvent = currentTime - lastEventTime;\n if (event.event_type !== DEFAULT_SESSION_START_EVENT && event.event_type !== DEFAULT_SESSION_END_EVENT && (!event.session_id || event.session_id === this.getSessionId()) && timeSinceLastEvent > this.config.sessionTimeout) {\n this.setSessionId(currentTime);\n }\n return [2, _super.prototype.process.call(this, event)];\n });\n });\n };\n return AmplitudeBrowser2;\n })(AmplitudeCore)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js\n var createInstance = function() {\n var client = new AmplitudeBrowser();\n return {\n init: debugWrapper(client.init.bind(client), "init", getClientLogConfig(client), getClientStates(client, ["config"])),\n add: debugWrapper(client.add.bind(client), "add", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n remove: debugWrapper(client.remove.bind(client), "remove", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n track: debugWrapper(client.track.bind(client), "track", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n logEvent: debugWrapper(client.logEvent.bind(client), "logEvent", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n identify: debugWrapper(client.identify.bind(client), "identify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n groupIdentify: debugWrapper(client.groupIdentify.bind(client), "groupIdentify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n setGroup: debugWrapper(client.setGroup.bind(client), "setGroup", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n revenue: debugWrapper(client.revenue.bind(client), "revenue", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n flush: debugWrapper(client.flush.bind(client), "flush", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n getUserId: debugWrapper(client.getUserId.bind(client), "getUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n setUserId: debugWrapper(client.setUserId.bind(client), "setUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n getDeviceId: debugWrapper(client.getDeviceId.bind(client), "getDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n setDeviceId: debugWrapper(client.setDeviceId.bind(client), "setDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n reset: debugWrapper(client.reset.bind(client), "reset", getClientLogConfig(client), getClientStates(client, ["config", "config.userId", "config.deviceId"])),\n getSessionId: debugWrapper(client.getSessionId.bind(client), "getSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n setSessionId: debugWrapper(client.setSessionId.bind(client), "setSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n extendSession: debugWrapper(client.extendSession.bind(client), "extendSession", getClientLogConfig(client), getClientStates(client, ["config"])),\n setOptOut: debugWrapper(client.setOptOut.bind(client), "setOptOut", getClientLogConfig(client), getClientStates(client, ["config"])),\n setTransport: debugWrapper(client.setTransport.bind(client), "setTransport", getClientLogConfig(client), getClientStates(client, ["config"]))\n };\n };\n var browser_client_factory_default = createInstance();\n\n // node_modules/@amplitude/analytics-browser/lib/esm/index.js\n var add = browser_client_factory_default.add;\n var extendSession = browser_client_factory_default.extendSession;\n var flush = browser_client_factory_default.flush;\n var getDeviceId = browser_client_factory_default.getDeviceId;\n var getSessionId = browser_client_factory_default.getSessionId;\n var getUserId = browser_client_factory_default.getUserId;\n var groupIdentify = browser_client_factory_default.groupIdentify;\n var identify = browser_client_factory_default.identify;\n var init = browser_client_factory_default.init;\n var logEvent = browser_client_factory_default.logEvent;\n var remove = browser_client_factory_default.remove;\n var reset = browser_client_factory_default.reset;\n var revenue = browser_client_factory_default.revenue;\n var setDeviceId = browser_client_factory_default.setDeviceId;\n var setGroup = browser_client_factory_default.setGroup;\n var setOptOut = browser_client_factory_default.setOptOut;\n var setSessionId = browser_client_factory_default.setSessionId;\n var setTransport = browser_client_factory_default.setTransport;\n var setUserId = browser_client_factory_default.setUserId;\n var track = browser_client_factory_default.track;\n\n // packages/dev-tools/client/tracking.ts\n var dispatch = (eventName) => {\n window.dispatchEvent(\n new CustomEvent(`builderdevtools`, { detail: { eventName } })\n );\n };\n async function loadUserDataFromLocal() {\n return apiLocalConfig();\n }\n var initTracking = async () => {\n const url = new URL(window.location.href);\n const hash = url.hash;\n const userIdHash = `#${CONNECTED_USER_ID_QS}=`;\n const uniqueId = Math.random().toString(36).substring(2, 15);\n const localConfig = await loadUserDataFromLocal();\n init("f1d2eb79aecd01b28c8a371ea5d1751c", localConfig?.userId || uniqueId, {\n logLevel: esm_exports.LogLevel.None,\n serverUrl: AMPLITUDE_PROXY_URL,\n flushIntervalMillis: 500\n });\n const identifyObj = new Identify();\n identify(identifyObj, {\n device_id: localConfig?.deviceId,\n user_id: localConfig?.userId || uniqueId\n });\n let builderUserId = `anonymous`;\n if (hash.startsWith(userIdHash)) {\n builderUserId = hash.slice(userIdHash.length);\n if (builderUserId) {\n setBuilderUserId(builderUserId);\n url.hash = "";\n window.history.replaceState({}, "", url.href);\n }\n }\n dispatch("init");\n };\n var setBuilderUserId = (builderUserId) => {\n if (typeof builderUserId === "string" && builderUserId.length > 0) {\n const t = getTracking();\n setTracking({\n ...t,\n builderUserId\n });\n }\n };\n var getTracking = () => {\n const ls = localStorage.getItem(TRACKING_KEY);\n if (ls) {\n try {\n let t = JSON.parse(ls);\n if (!t.ctas || typeof t.ctas !== "object") {\n t = setTracking({\n ...t,\n ctas: {}\n });\n }\n if (t.menuOpenedTs) {\n t = setTracking({\n ...t,\n ctas: {\n ...t.ctas,\n menuOpened: t.menuOpenedTs\n }\n });\n delete t.menuOpenedTs;\n }\n return t;\n } catch (e) {\n console.error(e);\n }\n }\n return setTracking({\n firstVisitTs: Date.now(),\n ctas: {},\n builderUserId: ""\n });\n };\n var setTracking = (t) => {\n try {\n localStorage.setItem(TRACKING_KEY, JSON.stringify(t));\n } catch (e) {\n console.error(e);\n }\n return t;\n };\n var hasCTA = (ctaName) => {\n const t = getTracking();\n return !!t.ctas[ctaName];\n };\n var setCTA = (ctaName) => {\n const t = getTracking();\n return setTracking({\n ...t,\n ctas: {\n ...t.ctas,\n [ctaName]: Date.now()\n }\n });\n };\n var TRACKING_KEY = "builderDevtools";\n\n // packages/dev-tools/client/menu/pages/component-input.ts\n function initComponentInputSection(shadow) {\n initRegisterInput(shadow);\n initComponentOpenSource(shadow);\n initComponentInputName(shadow);\n initComponentInputType(shadow);\n }\n function initRegisterInput(shadow) {\n const inputReg = shadow.getElementById("input-register");\n inputReg.addEventListener("change", async (ev) => {\n ev.stopPropagation();\n const inputName = shadow.getElementById("input-name");\n const nav = shadow.querySelector(".nav-cmp-input");\n nav.classList.add("input-loading");\n nav.classList.remove("input-enabled");\n const cmpId = inputName.dataset.id;\n const propName = inputName.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name: propName,\n registerInput: inputReg.checked\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentInput(shadow, cmpId, propName);\n renderComponentDetail(shadow, cmpId);\n nav.classList.remove("input-loading");\n });\n }\n function initComponentOpenSource(shadow) {\n const openSourceBtn = shadow.getElementById(\n "input-open-source"\n );\n openSourceBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmp = APP_STATE.components.find((c) => c.id === target?.dataset.id);\n if (cmp) {\n apiLaunchEditor({ filePath: cmp.filePath });\n }\n });\n }\n function initComponentInputName(shadow) {\n const inputName = shadow.getElementById("input-name");\n const inputWrapper = inputName.closest(".ui-text-input");\n let initInputName = "";\n let savedTmr;\n inputName.addEventListener("focus", (ev) => {\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n ev.stopPropagation();\n initInputName = inputName.value;\n });\n inputName.addEventListener("blur", async (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (inputName.value !== initInputName) {\n if (inputName.value.trim().length < 3) {\n inputName.value = initInputName;\n return;\n }\n inputWrapper.classList.add("saved");\n savedTmr = setTimeout(() => {\n inputWrapper.classList.remove("saved");\n }, 3e3);\n const cmpId = inputName.dataset.id;\n const name = inputName.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name,\n friendlyName: inputName.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n renderComponentInput(shadow, cmpId, name);\n }\n });\n inputName.addEventListener("keyup", (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (ev.key === "Escape") {\n inputName.value = initInputName;\n inputName.blur();\n } else if (ev.key === "Enter") {\n inputName.blur();\n }\n });\n }\n function initComponentInputType(shadow) {\n const inputType = shadow.getElementById("input-type");\n inputType.addEventListener("change", async (ev) => {\n ev.stopPropagation();\n const cmpId = inputType.dataset.id;\n const name = inputType.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name,\n type: inputType.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n renderComponentInput(shadow, cmpId, name);\n });\n }\n function renderComponentInput(shadow, cmpId, propName) {\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (!cmp) {\n return null;\n }\n const regInput = cmp.inputs.find((i) => i.name === propName);\n if (!regInput) {\n return null;\n }\n const nav = shadow.querySelector(".nav-cmp-input");\n if (regInput.isRegistered) {\n nav.classList.add("input-enabled");\n } else {\n nav.classList.remove("input-enabled");\n }\n const inputReg = shadow.getElementById("input-register");\n inputReg.checked = !!regInput.isRegistered;\n const title = shadow.getElementById("cmp-input-title");\n title.innerText = cmp.name + ": " + (regInput.friendlyName || regInput.name);\n const openSource = shadow.getElementById("input-open-source");\n openSource.innerText = `Open ${cmp.displayFilePath}`;\n openSource.dataset.id = cmp.id;\n const propNameText = shadow.getElementById("cmp-prop-name");\n propNameText.innerText = regInput.name;\n const propType = shadow.getElementById("cmp-prop-type");\n propType.innerText = getPrimitiveType(regInput.type);\n const inputName = shadow.getElementById("input-name");\n inputName.dataset.id = cmp.id;\n inputName.dataset.prop = regInput.name;\n inputName.value = regInput.friendlyName || regInput.name;\n renderInputTypeSelect(shadow, cmp, regInput);\n return regInput;\n }\n function renderInputTypeSelect(shadow, cmp, cmpInput) {\n const typeSelect = shadow.getElementById("input-type");\n typeSelect.dataset.id = cmp.id;\n typeSelect.dataset.prop = cmpInput.name;\n typeSelect.innerHTML = "";\n const inputType = cmpInput.type;\n const isString = STRING_TYPES.includes(inputType);\n const isNumber = NUMBER_TYPES.includes(inputType);\n const isBoolean = BOOLEAN_TYPES.includes(inputType);\n const isArray = ARRAY_TYPES.includes(inputType);\n const isObject = OBJECT_TYPES.includes(inputType);\n INPUT_TYPES.forEach((t) => {\n const option = document.createElement("option");\n option.value = t.value;\n option.innerText = t.text;\n option.disabled = STRING_TYPES.includes(t.value) && !isString || NUMBER_TYPES.includes(t.value) && !isNumber || BOOLEAN_TYPES.includes(t.value) && !isBoolean || ARRAY_TYPES.includes(t.value) && !isArray || OBJECT_TYPES.includes(t.value) && !isObject;\n typeSelect.appendChild(option);\n });\n typeSelect.value = inputType;\n }\n\n // packages/dev-tools/client/menu/pages/component-detail.ts\n function initComponentDetailSection(shadow) {\n initRegisterComponent(shadow);\n initComponentName(shadow);\n initComponentOpenSource2(shadow);\n initComponentInputList(shadow);\n initInputReload(shadow);\n }\n function initRegisterComponent(shadow) {\n const cmpReg = shadow.getElementById("cmp-register");\n cmpReg.addEventListener("change", (ev) => {\n ev.stopPropagation();\n loadComponentDetail(shadow, "update");\n });\n }\n async function loadComponentDetail(shadow, opt) {\n const cmpDetail = shadow.querySelector(".nav-cmp-detail");\n const cmpError = shadow.getElementById("cmp-error");\n const cmpReg = shadow.getElementById("cmp-register");\n const regSwitchLabel = cmpReg.closest(".ui-switch");\n cmpDetail.classList.remove("cmp-enabled");\n if (cmpReg.checked) {\n cmpDetail.classList.add("cmp-loading");\n }\n try {\n const cmpId = cmpReg.dataset.id;\n let registry;\n if (opt === "load") {\n registry = await apiLoadComponent({ cmpId });\n } else if (cmpReg.checked) {\n registry = await apiRegisterComponent({ cmpId });\n dispatch("registryUpdate");\n track("interaction", {\n type: "click",\n name: "register component",\n detail: cmpId\n });\n } else {\n registry = await apiUnregisterComponent({ cmpId });\n dispatch("registryUpdate");\n track("interaction", {\n type: "click",\n name: "unregister component",\n detail: cmpId\n });\n }\n updateAppState(registry);\n renderComponentList(shadow);\n const cmp = renderComponentDetail(shadow, cmpId);\n if (opt === "update" && cmp) {\n if (cmpReg.checked) {\n cmpDetail.classList.add("cmp-enabled");\n showToast(\n shadow,\n `<strong>${cmp.name}</strong> is now registered in <strong>${APP_STATE.registryDisplayPath}</strong> and available for use in the Builder Visual Editor`\n );\n } else {\n showToast(\n shadow,\n `<strong>${cmp.name}</strong> has been unregistered from <strong>${APP_STATE.registryDisplayPath}</strong> and removed from the Builder Visual Editor`\n );\n }\n }\n } catch (e) {\n console.error(e);\n cmpError.innerHTML = `<p class="error">Error loading components</p><p class="error">${e.message || e}</p>`;\n regSwitchLabel.style.display = "none";\n }\n cmpDetail.classList.remove("cmp-loading");\n }\n function initComponentName(shadow) {\n const cmpName = shadow.getElementById("cmp-name");\n const inputWrapper = cmpName.closest(".ui-text-input");\n let initComponentName2 = "";\n let savedTmr;\n cmpName.addEventListener("focus", (ev) => {\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n ev.stopPropagation();\n initComponentName2 = cmpName.value;\n });\n cmpName.addEventListener("blur", async (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (cmpName.value !== initComponentName2) {\n if (cmpName.value.trim().length < 3) {\n cmpName.value = initComponentName2;\n return;\n }\n inputWrapper.classList.add("saved");\n savedTmr = setTimeout(() => {\n inputWrapper.classList.remove("saved");\n }, 3e3);\n const cmpId = cmpName.dataset.id;\n const registry = await apiSetComponentInfo({\n cmpId,\n name: cmpName.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n }\n });\n cmpName.addEventListener("keyup", (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (ev.key === "Escape") {\n cmpName.value = initComponentName2;\n cmpName.blur();\n } else if (ev.key === "Enter") {\n cmpName.blur();\n }\n });\n }\n function renderComponentDetail(shadow, cmpId) {\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (!cmp) {\n return null;\n }\n const cmpReg = shadow.getElementById("cmp-register");\n const cmpError = shadow.getElementById("cmp-error");\n const regSwitchLabel = cmpReg.closest(".ui-switch");\n regSwitchLabel.style.display = "";\n cmpError.innerHTML = "";\n cmpReg.dataset.id = cmp.id;\n cmpReg.checked = !!cmp.isRegistered;\n const cmpDetail = shadow.querySelector(".nav-cmp-detail");\n if (cmp.isRegistered) {\n cmpDetail.classList.add("cmp-enabled");\n } else {\n cmpDetail.classList.remove("cmp-enabled");\n }\n const cmpName = shadow.getElementById("cmp-name");\n cmpName.dataset.id = cmp.id;\n cmpName.value = cmp.name;\n const openSource = shadow.getElementById("cmp-open-source");\n openSource.innerText = `Open ${cmp.displayFilePath}`;\n openSource.dataset.id = cmp.id;\n const title = shadow.getElementById("cmp-detail-title");\n title.innerText = `${cmp.name} Component`;\n renderComponentDetailInputs(shadow, cmp);\n return cmp;\n }\n function initComponentOpenSource2(shadow) {\n const openSourceBtn = shadow.getElementById(\n "cmp-open-source"\n );\n openSourceBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmp = APP_STATE.components.find((c) => c.id === target?.dataset.id);\n if (cmp) {\n apiLaunchEditor({ filePath: cmp.filePath });\n track("interaction", {\n type: "click",\n name: "open component source file",\n detail: cmp.filePath\n });\n }\n });\n }\n function initInputReload(shadow) {\n const reloadBtn = shadow.getElementById(\n "btn-inputs-reload"\n );\n reloadBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n loadComponentDetail(shadow, "load");\n });\n }\n function initComponentInputList(shadow) {\n const cmpInputList = shadow.getElementById(\n "cmp-detail-inputs"\n );\n cmpInputList.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const button = target?.closest("button");\n const cmpId = button?.dataset.id;\n const propName = button?.dataset.propName;\n const cmpInput = renderComponentInput(shadow, cmpId, propName);\n if (cmpInput) {\n goToSection(shadow, "nav-cmp-input");\n }\n });\n }\n function renderComponentDetailInputs(shadow, cmp) {\n const cmpInputList = shadow.getElementById(\n "cmp-detail-inputs"\n );\n const filteredInputList = cmp.inputs.filter((input) => !input.hideFromUI);\n if (filteredInputList.length > 0) {\n cmpInputList.innerHTML = "";\n filteredInputList.forEach((input) => {\n cmpInputList.appendChild(renderComponentDetailInputItem(cmp, input));\n });\n } else {\n cmpInputList.innerHTML = `<p class="cmp-inputs-empty">${cmp.name} component does not have any props</p>`;\n }\n }\n function renderComponentDetailInputItem(cmp, cmpInput) {\n const item = document.createElement("button");\n item.dataset.id = cmp.id;\n item.dataset.propName = cmpInput.name;\n item.className = "cmp-input-item nav-list-item";\n if (!cmpInput.isRegistered) {\n item.classList.add("cmp-input-item-unregistered");\n }\n const itemIcon = document.createElement("span");\n const type = getPrimitiveType(cmpInput.type);\n itemIcon.className = `nav-list-item-icon input-icon input-icon-${type}`;\n item.appendChild(itemIcon);\n const itemName = document.createElement("span");\n itemName.innerText = cmpInput.friendlyName || cmpInput.name;\n item.appendChild(itemName);\n const itemNote = document.createElement("span");\n itemNote.className = "nav-list-item-note";\n itemNote.innerText = cmpInput.type;\n item.appendChild(itemNote);\n return item;\n }\n\n // packages/dev-tools/client/menu/pages/component-list.ts\n function initComponentListSection(shadow) {\n const openRegistryFile = shadow.getElementById("open-builder-registry");\n openRegistryFile.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n apiLaunchEditor({ filePath: APP_STATE.registryPath, line: 1, column: 1 });\n });\n const cmpList = shadow.getElementById("cmp-list");\n cmpList.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmpId = target?.dataset.id;\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (cmp) {\n const cmpDetail = shadow.querySelector(\n ".nav-cmp-detail .section-content"\n );\n cmpDetail.scrollTop = 0;\n renderComponentDetail(shadow, cmp.id);\n goToSection(shadow, "nav-cmp-detail");\n if (cmp.isRegistered) {\n loadComponentDetail(shadow, "load");\n }\n }\n });\n const searchInput = shadow.getElementById(\n "component-search"\n );\n const clearSearchButton = shadow.getElementById(\n "clear-search"\n );\n searchInput?.addEventListener("input", (event) => {\n const searchTerm = event.target.value.toLowerCase();\n const filteredComponents = searchTerm ? APP_STATE.components.filter(\n (component) => component.name.toLowerCase().includes(searchTerm) || component.displayFilePath?.toLowerCase().includes(searchTerm)\n ) : APP_STATE.components;\n renderComponentList(shadow, filteredComponents);\n clearSearchButton.style.display = searchTerm ? "flex" : "none";\n });\n clearSearchButton?.addEventListener("click", () => {\n searchInput.value = "";\n renderComponentList(shadow);\n clearSearchButton.style.display = "none";\n });\n searchInput?.addEventListener("keydown", (event) => {\n if (event.key === "Escape") {\n searchInput.value = "";\n renderComponentList(shadow);\n clearSearchButton.style.display = "none";\n }\n });\n }\n function loadComponentsSection(shadow) {\n const loadRegistry = apiRegistry();\n renderComponents(shadow, loadRegistry);\n }\n async function renderComponents(shadow, loadRegistry) {\n const cmpList = shadow.getElementById("cmp-list");\n const cmpListSection = shadow.querySelector(".nav-cmp-list");\n cmpListSection.classList.add("nav-loading");\n const openRegistryFile = shadow.getElementById("open-builder-registry");\n try {\n const registry = await loadRegistry;\n updateAppState(registry);\n renderComponentList(shadow);\n if (APP_STATE.registryDisplayPath) {\n openRegistryFile.innerText = "Open " + registry.registryDisplayPath;\n } else {\n openRegistryFile.innerText = "";\n }\n } catch (e) {\n cmpList.innerHTML = `<p class="error">Error loading components</p><p class="error">${e.message || e}</p>`;\n console.error(e);\n }\n cmpListSection.classList.remove("nav-loading");\n }\n function renderComponentList(shadow, filteredComponents) {\n const cmpList = shadow.getElementById("cmp-list");\n cmpList.innerHTML = "";\n const componentsToRender = filteredComponents || APP_STATE.components;\n const registered = componentsToRender.filter((c) => c.isRegistered);\n const unregistered = componentsToRender.filter((c) => !c.isRegistered);\n if (filteredComponents && filteredComponents.length === 0) {\n const noResults = document.createElement("p");\n noResults.className = "no-results";\n noResults.innerText = "No matching components found";\n cmpList.appendChild(noResults);\n return;\n }\n renderComponentListSection(cmpList, "Registered Components", registered);\n renderComponentListSection(cmpList, "Unregistered Components", unregistered);\n }\n function renderComponentListSection(cmpList, listTitle, cmps) {\n if (cmps.length > 0) {\n const cmpsTitle = document.createElement("h4");\n cmpsTitle.innerText = listTitle;\n cmpList.appendChild(cmpsTitle);\n cmps.forEach((c) => {\n cmpList.appendChild(renderComponentListItem(c));\n });\n }\n }\n function renderComponentListItem(cmp) {\n const searchTerm = document.getElementById("component-search")?.value.toLowerCase();\n const item = document.createElement("button");\n item.dataset.id = cmp.id;\n item.className = "cmp-item nav-list-item";\n if (cmp.isRegistered) {\n item.classList.add("registered");\n }\n const itemIcon = document.createElement("span");\n itemIcon.className = "nav-list-item-icon";\n if (cmp.image) {\n itemIcon.style.backgroundImage = `url(${cmp.image})`;\n }\n item.appendChild(itemIcon);\n const itemName = document.createElement("span");\n itemName.className = "nav-list-item-name";\n itemName.innerHTML = highlightMatches(cmp.name, searchTerm);\n item.appendChild(itemName);\n const itemNote = document.createElement("span");\n itemNote.className = "nav-list-item-note";\n itemNote.innerHTML = highlightMatches(cmp.displayFilePath || "", searchTerm);\n item.appendChild(itemNote);\n return item;\n }\n function highlightMatches(text, searchTerm) {\n if (!searchTerm) return text;\n const regex = new RegExp(`(${searchTerm})`, "gi");\n return text.replace(regex, \'<span class="search-highlight">$1</span>\');\n }\n\n // packages/dev-tools/client/menu/toggle/menu-toggle.ts\n var initMenuToggle = (shadow) => {\n shadow.querySelector(".menu-toggle").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, true);\n });\n shadow.getElementById("close").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n });\n shadow.getElementById("hit").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n });\n initBackButtons(shadow);\n shadow.addEventListener("click", (ev) => ev.stopPropagation());\n checkCTAs(shadow);\n };\n var openMenu = (shadow, openDevToolsMenu) => {\n if (openDevToolsMenu) {\n document.body.classList.add("builder-no-scroll");\n shadow.host.classList.add("show-builder-menu");\n dispatch("menuOpen");\n setCTA("menuOpened");\n track("interaction", {\n type: "click",\n name: "open dev-tools menu"\n });\n } else {\n document.body.classList.remove("builder-no-scroll");\n shadow.host.classList.remove("show-builder-menu");\n dispatch("menuClose");\n setTimeout(() => {\n goToSection(shadow, "nav-home");\n }, 300);\n }\n apiDevToolsEnabled(openDevToolsMenu);\n };\n var checkCTAs = (shadow) => {\n if (!hasCTA("menuOpened")) {\n menuToggleToolTipCta(shadow);\n return;\n }\n const t = getTracking();\n const minutesSinceFirstVisit = (Date.now() - t.firstVisitTs) / 1e3 / 60;\n if (minutesSinceFirstVisit < 10) {\n return;\n }\n if (!hasCTA("feedback")) {\n setCTA("feedback");\n feedbackToolTipCta(shadow);\n return;\n }\n };\n var menuToggleToolTipCta = (shadow) => {\n const tooltip = document.createElement("a");\n tooltip.classList.add("menu-toggle-tooltip");\n tooltip.href = `#open-dev-tools`;\n tooltip.innerHTML = `\n <div class="menu-toggle-tooltip-content">\n <h3>Open Builder Devtools</h3>\n <p>Start registering your components</p>\n </div>\n `;\n shadow.appendChild(tooltip);\n setTimeout(() => {\n tooltip.classList.add("menu-toggle-tooltip-show");\n tooltip.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n tooltip.classList.remove("menu-toggle-tooltip-show");\n openMenu(shadow, true);\n });\n }, 1e3);\n };\n var feedbackToolTipCta = (shadow) => {\n const tooltip = document.createElement("a");\n tooltip.classList.add("menu-toggle-tooltip");\n tooltip.href = `https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform`;\n tooltip.target = "_blank";\n tooltip.innerHTML = `\n <div class="menu-toggle-tooltip-content">\n <h3>How\'s Devtools working for you?</h3>\n <p>We\'d love your feedback!</p>\n </div>\n `;\n shadow.appendChild(tooltip);\n setTimeout(() => {\n tooltip.classList.add("menu-toggle-tooltip-show");\n tooltip.addEventListener("click", () => {\n tooltip.classList.remove("menu-toggle-tooltip-show");\n });\n }, 1e3);\n };\n\n // packages/dev-tools/client/menu/pages/home.ts\n function initHomeSection(shadow) {\n const goToBuilder = shadow.getElementById("go-to-builder");\n goToBuilder.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(getEditorUrl(), "builder");\n });\n const componentsLink = shadow.getElementById("components-link");\n componentsLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const cmpList = shadow.querySelector(\n ".nav-cmp-list .section-content"\n );\n cmpList.scrollTop = 0;\n goToSection(shadow, "nav-cmp-list");\n loadComponentsSection(shadow);\n });\n const settingsLink = shadow.getElementById("settings-link");\n settingsLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n goToSection(shadow, "nav-settings");\n });\n const addPageLink = shadow.getElementById("add-page-link");\n addPageLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(getBuilderContentUrl(), "builder");\n });\n const importFromFigma = shadow.getElementById("import-from-figma");\n importFromFigma.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(\n "https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more"\n );\n });\n }\n\n // packages/dev-tools/client/menu/pages/settings.ts\n function initSettingsSection(shadow) {\n const s = shadow.getElementById("enable-edit");\n s.addEventListener("change", (ev) => {\n ev.stopPropagation();\n enableEdit(s.checked);\n });\n s.checked = isEditEnabled();\n enableEdit(s.checked);\n }\n\n // packages/dev-tools/client/menu/index.ts\n var BuilderDevToolsMenu = class extends HTMLElement {\n constructor() {\n super();\n }\n connectedCallback() {\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = `<style>/* packages/dev-tools/client/common.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n:host {\n --background-color: rgba(40, 40, 40, 1);\n --primary-color: rgba(72, 161, 255, 1);\n --primary-color-subdued: rgb(72, 161, 255, 0.6);\n --primary-color-highlight: rgb(126, 188, 255);\n --primary-contrast-color: white;\n --edit-color: #1d74e2;\n --edit-color-highlight: #1c6bd1;\n --edit-color-alpha: rgb(72, 161, 255, 0.15);\n --error-color: #ff2b55;\n --text-color: white;\n --text-color-highlight: white;\n --border-color: #454545;\n --button-background-color-hover: rgba(255, 255, 255, 0.1);\n --menu-width: 320px;\n --transition-time: 150ms;\n --font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n font-family: var(--font-family);\n line-height: 1.6;\n}\nbutton {\n cursor: pointer;\n color: var(--text-color);\n -webkit-tap-highlight-color: transparent;\n}\ninput,\nselect,\nbutton {\n font-family: var(--font-family);\n}\n\n/* packages/dev-tools/client/menu/toggle/menu-toggle.css */\n.menu-toggle {\n position: absolute;\n right: 0;\n bottom: 0;\n pointer-events: auto;\n padding: 8px;\n background: transparent;\n border: none;\n appearance: none;\n}\n.menu-toggle div {\n position: relative;\n width: 64px;\n height: 64px;\n pointer-events: none;\n border-radius: 50%;\n background: black;\n border: 1px solid white;\n box-shadow: rgba(0, 0, 0, 33%) 0px 0 8px;\n}\n.menu-toggle:hover div {\n background-color: var(--background-color);\n border: 1px solid rgb(220, 220, 220);\n}\n.menu-toggle svg {\n position: absolute;\n top: 15px;\n left: 15px;\n width: 33px;\n height: 32px;\n}\ndiv.highlight-bg {\n position: absolute;\n top: -1px;\n left: -1px;\n background-color: rgb(26, 26, 26);\n pointer-events: none;\n transition: all 400ms ease-out;\n opacity: 0;\n}\n.menu-toggle-highlight-no-transition div.highlight-bg {\n transition: none;\n}\n.menu-toggle-highlight div.highlight-bg {\n opacity: 1;\n}\n.menu-toggle-tooltip {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 382px;\n height: 72px;\n padding: 0;\n text-align: left;\n appearance: none;\n background-color: transparent;\n border: none;\n pointer-events: none;\n transform: translate3d(320px, 0, 0);\n opacity: 0;\n transition: all 150ms ease-in-out;\n color: white;\n}\n.menu-toggle-tooltip.menu-toggle-tooltip-show {\n pointer-events: auto;\n opacity: 1;\n transform: translate3d(0, 0, 0);\n}\n.menu-toggle-tooltip-content {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 10px;\n right: 95px;\n padding: 8px 12px;\n background-color: var(--primary-color);\n box-shadow: rgba(0, 0, 0, 33%) 0px 0 20px;\n border-radius: 2px;\n}\n.menu-toggle-tooltip-content::before {\n content: "";\n position: absolute;\n bottom: 15px;\n right: -6px;\n width: 30px;\n height: 30px;\n background-color: var(--primary-color);\n transform: rotate(45deg);\n}\n.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,\n.menu-toggle-tooltip:hover .menu-toggle-tooltip-content::before {\n background-color: var(--primary-color-highlight);\n}\n.menu-toggle-tooltip-content h3 {\n margin: 0;\n font-size: 16px;\n}\n.menu-toggle-tooltip-content p {\n margin: 0;\n font-size: 12px;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-page.css */\nsection {\n position: absolute;\n display: grid;\n grid-template-rows: 64px auto 64px;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n pointer-events: none;\n}\n.section-content {\n margin: 0;\n padding: 0 0 10px 0;\n font-weight: 300;\n transform: translate3d(105%, 0, 0);\n transition: transform var(--transition-time) ease-in-out;\n overflow-y: auto;\n}\n.section-content .error {\n color: var(--error-color);\n font-weight: bold;\n}\nsection a {\n text-decoration: none;\n color: var(--text-color);\n}\nsection h3,\nsection p {\n margin-left: 16px;\n margin-right: 16px;\n}\n.info {\n font-size: 12px;\n}\nul.list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\nul.list li {\n display: block;\n padding: 0;\n margin: 0;\n}\nul.list a,\nul.list button {\n display: grid;\n grid-template-columns: 24px auto;\n grid-gap: 16px;\n padding: 12px;\n margin: 8px 0;\n border: none;\n background: transparent;\n appearance: none;\n width: 100%;\n font-weight: 300;\n text-align: left;\n text-decoration: none;\n color: var(--text-color);\n}\nul.list a:hover,\nul.list button:hover {\n text-decoration: none;\n color: var(--text-color);\n background-color: var(--button-background-color-hover);\n}\nul.list a span,\nul.list button span {\n display: block;\n font-size: 16px;\n font-weight: 500;\n line-height: 1.5;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-header.css */\nheader {\n position: relative;\n display: grid;\n grid-template-columns: 44px 1fr;\n gap: 8px;\n padding-left: 8px;\n border-bottom: 1px solid var(--border-color);\n transition: opacity var(--transition-time) ease-in-out;\n opacity: 0;\n pointer-events: none;\n}\nheader > div {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.nav-home header > div {\n margin-right: 56px;\n}\nheader h2 {\n margin: 7px 0 0 0;\n font-size: 18px;\n font-weight: 500;\n line-height: 1.5;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p {\n margin: 2px 0 0 0;\n font-size: 12px;\n font-weight: 300;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p button {\n display: block;\n margin: 0;\n padding: 0;\n width: 100%;\n text-align: left;\n font-size: 12px;\n font-weight: 300;\n text-decoration: none;\n appearance: none;\n text-align: left;\n background-color: transparent;\n border: none;\n color: var(--primary-color);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p button:hover {\n text-decoration: underline;\n color: var(--primary-color);\n}\n.builder-logo {\n margin: 12px 0 0 8px;\n}\n#close {\n display: block;\n position: absolute;\n appearance: none;\n background: transparent;\n border: none;\n border-radius: 50%;\n margin: 0;\n padding: 0;\n right: 4px;\n top: 8px;\n width: 48px;\n height: 48px;\n z-index: 1;\n opacity: 0.7;\n}\n#close:hover {\n opacity: 1;\n background-color: var(--button-background-color-hover);\n}\n#close svg {\n position: absolute;\n top: 12px;\n left: 12px;\n width: 24px;\n height: 24px;\n fill: currentColor;\n pointer-events: none;\n}\n.back-button {\n position: relative;\n display: block;\n margin: 7px 0 0 -2px;\n width: 48px;\n height: 48px;\n background: transparent;\n border: none;\n appearance: none;\n border-radius: 50%;\n}\n.back-button:hover {\n background-color: var(--button-background-color-hover);\n}\n.back-button svg {\n position: absolute;\n top: 12px;\n left: 12px;\n width: 24px;\n height: 24px;\n fill: currentColor;\n pointer-events: none;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-footer.css */\nfooter {\n border-top: 1px solid var(--border-color);\n transition: opacity var(--transition-time) ease-in-out;\n opacity: 0;\n pointer-events: none;\n}\nsection.nav-cmp-list {\n grid-template-rows: 64px auto 120px;\n}\nfooter a {\n text-decoration: underline;\n color: var(--primary-color);\n}\nfooter a:hover {\n color: var(--primary-color);\n text-decoration: none;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-nav-list.css */\n.nav-list {\n padding: 2px 0;\n}\n.nav-loading {\n pointer-events: none;\n}\n.nav-loading-icon {\n position: absolute;\n display: inline-block;\n top: 170px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.nav-loading .nav-loading-icon {\n opacity: 0.5;\n}\n.nav-list h4 {\n margin: 8px 8px 8px 10px;\n font-size: 14px;\n font-weight: 600;\n}\n.nav-list .nav-list-item + h4 {\n margin-top: 30px;\n}\n.nav-list-item {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n position: relative;\n margin: 2px 0;\n padding: 8px 28px 8px 46px;\n width: 100%;\n font-size: 14px;\n font-weight: 300;\n text-align: left;\n border: none;\n background: transparent;\n appearance: none;\n}\n.nav-list-item:hover {\n background-color: var(--button-background-color-hover);\n}\n.nav-list-item-icon {\n position: absolute;\n top: 4px;\n left: 10px;\n width: 24px;\n height: 24px;\n object-fit: contain;\n filter: invert(100%);\n background-size: 24px 24px;\n background-repeat: no-repeat;\n background-position: center center;\n}\n.nav-list-item span {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n}\n.nav-list-item::after {\n display: block;\n position: absolute;\n content: "";\n background-image: url(\'data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>\');\n background-repeat: no-repeat;\n background-position: 12px 9px;\n top: 0;\n right: 0;\n width: 32px;\n height: 32px;\n pointer-events: none;\n}\n.nav-list-item-note {\n opacity: 0;\n font-size: 12px;\n padding-top: 1px;\n text-align: right;\n}\n.nav-list-item:hover .nav-list-item-note {\n opacity: 0.5;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-select.css */\n.ui-select {\n display: block;\n margin: 8px 0 16px 0;\n padding: 8px 16px 8px 16px;\n cursor: pointer;\n}\n.ui-select h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-select p {\n margin: 8px 0 8px 0;\n font-size: 12px;\n font-weight: 300;\n}\n.ui-select .select {\n position: relative;\n margin: 8px 0 8px 0;\n border-radius: 4px;\n padding: 0;\n line-height: 1.1;\n overflow: hidden;\n border: 1px solid var(--border-color);\n}\n.ui-select select {\n appearance: none;\n background-color: transparent;\n border: none;\n outline: none;\n padding: 8px 32px 8px 8px;\n margin: 0;\n width: 100%;\n font-size: 14px;\n cursor: pointer;\n text-overflow: ellipsis;\n opacity: 0.6;\n color: var(--text-color);\n}\n.ui-select .select::after {\n content: "";\n top: 6px;\n right: 5px;\n width: 24px;\n height: 24px;\n position: absolute;\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n opacity: 0.6;\n}\n.ui-select .select:hover {\n border-color: var(--primary-color-subdued);\n}\n.ui-text-input .select:focus-within {\n border-color: var(--primary-color);\n}\n.ui-text-input .select:focus-within select {\n opacity: 1;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-spinner.css */\n.spinner:after {\n content: " ";\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 auto;\n pointer-events: auto;\n border-radius: 50%;\n border: 3px solid var(--text-color);\n border-color: var(--text-color) transparent var(--text-color) transparent;\n animation: spinner 750ms linear infinite;\n}\n@keyframes spinner {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* packages/dev-tools/client/menu/ui/ui-switch.css */\n.ui-switch {\n display: grid;\n grid-template-columns: auto 48px;\n grid-gap: 20px;\n margin: 8px 0 16px 0;\n padding: 8px 0 8px 16px;\n cursor: pointer;\n}\n.ui-switch > * {\n pointer-events: none;\n}\n.ui-switch input {\n display: none;\n visibility: hidden;\n}\n.ui-switch .switcher {\n display: inline-block;\n border-radius: 100px;\n width: 35px;\n height: 14px;\n background-color: #ccc;\n position: relative;\n top: 6px;\n vertical-align: middle;\n cursor: pointer;\n}\n.ui-switch input[type=checkbox]:checked + .switcher {\n background-color: var(--primary-color-subdued);\n}\n.ui-switch .switcher:before {\n content: "";\n display: block;\n width: 20px;\n height: 20px;\n background-color: var(--text-color);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n position: absolute;\n top: -3px;\n left: 0;\n margin-right: 0;\n transition: all 150ms;\n}\n.ui-switch input[type=checkbox]:checked + .switcher:before {\n left: 100%;\n margin-left: -20px;\n background-color: var(--primary-color);\n}\n.ui-switch h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-switch p {\n margin: 4px 0 0 0;\n font-size: 12px;\n font-weight: 300;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-text-input.css */\n.ui-text-input {\n display: block;\n margin: 8px 0 16px 0;\n padding: 8px 16px 8px 16px;\n cursor: pointer;\n}\n.ui-text-input h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-text-input p {\n margin: 8px 0 8px 0;\n font-size: 12px;\n font-weight: 300;\n}\n.ui-text-input .input {\n position: relative;\n margin: 8px 0 8px 0;\n border: 1px solid var(--border-color);\n border-radius: 4px;\n background: transparent;\n padding: 2px;\n overflow: hidden;\n}\n.ui-text-input input {\n display: block;\n width: 235px;\n font-size: 14px;\n border: none;\n background: transparent;\n padding: 6px;\n appearance: none;\n color: var(--text-color);\n opacity: 0.6;\n outline: none;\n}\n.ui-text-input .input:hover {\n border-color: var(--primary-color-subdued);\n}\n.ui-text-input .input:focus-within {\n border-color: var(--primary-color);\n}\n.ui-text-input .input:focus-within input {\n opacity: 1;\n}\n.ui-text-input .input::after {\n content: "";\n position: absolute;\n top: 5px;\n right: 14px;\n width: 8px;\n height: 17px;\n border: 2px solid rgba(51, 181, 51, 1);\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n opacity: 0;\n transition: opacity 80ms ease-in-out;\n pointer-events: none;\n}\n.ui-text-input.saved .input::after {\n opacity: 1;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-toast.css */\n.ui-toast {\n position: fixed;\n bottom: 8px;\n left: 8px;\n right: 8px;\n padding: 6px 12px;\n font-size: 14px;\n border-radius: 4px;\n transform: translate3d(0, 150%, 0);\n opacity: 0;\n transition: all var(--transition-time) ease-in-out;\n background-color: var(--primary-color-subdued);\n color: var(--text-color);\n pointer-events: none;\n}\n.ui-toast.ui-toast-show {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n pointer-events: auto;\n}\n\n/* packages/dev-tools/client/menu/nav.css */\n[data-view=nav-home] .nav-home .section-content,\n[data-view=nav-cmp-list] .nav-cmp-list .section-content,\n[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,\n[data-view=nav-cmp-input] .nav-cmp-input .section-content,\n[data-view=nav-settings] .nav-settings .section-content {\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n}\n[data-view=nav-home] .nav-home header,\n[data-view=nav-home] .nav-home footer,\n[data-view=nav-cmp-list] .nav-cmp-list header,\n[data-view=nav-cmp-list] .nav-cmp-list footer,\n[data-view=nav-cmp-detail] .nav-cmp-detail header,\n[data-view=nav-cmp-detail] .nav-cmp-detail footer,\n[data-view=nav-cmp-input] .nav-cmp-input header,\n[data-view=nav-cmp-input] .nav-cmp-input footer,\n[data-view=nav-settings] .nav-settings header,\n[data-view=nav-settings] .nav-settings footer {\n opacity: 1;\n pointer-events: auto;\n}\n[data-view=nav-cmp-list] .nav-home .section-content,\n[data-view=nav-cmp-detail] .nav-home .section-content,\n[data-view=nav-cmp-detail] .nav-cmp-list .section-content,\n[data-view=nav-cmp-input] .nav-home .section-content,\n[data-view=nav-cmp-input] .nav-cmp-list .section-content,\n[data-view=nav-cmp-input] .nav-cmp-detail .section-content,\n[data-view=nav-settings] .nav-home .section-content {\n transform: translate3d(-105%, 0, 0);\n}\n\n/* packages/dev-tools/client/menu/pages/component-list.css */\n.cmp-item .nav-list-item-icon {\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>\');\n opacity: 0.3;\n}\n.cmp-item.registered .nav-list-item-icon {\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>\');\n opacity: 0.8;\n}\n.search-highlight {\n background-color: var(--primary-color-alpha);\n padding: 0 2px;\n border-radius: 2px;\n font-weight: 500;\n}\n.search-container {\n position: sticky;\n top: 0;\n z-index: 10;\n padding: 12px 16px;\n background: var(--background-color);\n border-bottom: 1px solid var(--border-color);\n}\n.search-input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n}\n.search-icon {\n position: absolute;\n left: 12px;\n color: var(--text-color-secondary);\n pointer-events: none;\n}\n.component-search-input {\n width: 100%;\n height: 36px;\n padding: 8px 36px;\n border: 1px solid var(--border-color);\n border-radius: 6px;\n background: var(--input-background);\n color: var(--text-color);\n font-size: 14px;\n transition: border-color 0.2s, box-shadow 0.2s;\n}\n.component-search-input:focus {\n outline: none;\n border-color: var(--primary-color);\n box-shadow: 0 0 0 2px var(--primary-color-alpha);\n}\n.component-search-input::placeholder {\n color: var(--text-color-tertiary);\n}\n.clear-search-button {\n position: absolute;\n right: 8px;\n padding: 4px;\n color: var(--text-color-secondary);\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.2s, background-color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.clear-search-button:hover {\n background-color: var(--hover-color);\n}\n.component-search-input:not(:placeholder-shown) + .clear-search-button {\n opacity: 1;\n}\n.no-results {\n padding: 32px 16px;\n text-align: center;\n color: var(--text-color-secondary);\n font-size: 14px;\n}\n\n/* packages/dev-tools/client/menu/pages/component-detail.css */\n#cmp-detail {\n position: relative;\n}\n.cmp-loading {\n pointer-events: none !important;\n}\n.cmp-loading-icon {\n position: absolute;\n display: inline-block;\n top: 170px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.cmp-loading .cmp-loading-icon {\n opacity: 0.5;\n}\n.cmp-cover {\n position: absolute;\n top: 160px;\n left: 0;\n width: 100%;\n height: 100vh;\n background: var(--background-color);\n transform: translate3d(0, 0, 0);\n pointer-events: none;\n display: none;\n}\n[data-view=nav-cmp-detail] .cmp-cover {\n display: block;\n pointer-events: auto;\n}\n.cmp-enabled .cmp-cover {\n transform: translate3d(0, 105%, 0);\n pointer-events: none;\n}\n.section-ready .cmp-cover {\n transition: all var(--transition-time) ease-in-out;\n}\n.cmp-detail-inputs-container {\n margin: 8px 0 16px 0;\n padding: 0;\n}\n.cmp-detail-inputs-container h3 {\n margin: 0 0 6px 0;\n padding-left: 16px;\n padding-right: 8px;\n font-size: 14px;\n font-weight: 500;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.cmp-detail-inputs-reload {\n font-weight: 300;\n font-size: 0.9em;\n text-decoration: none;\n appearance: none;\n text-align: left;\n background-color: transparent;\n border: none;\n color: var(--primary-color);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cmp-detail-inputs-reload:hover {\n text-decoration: underline;\n color: var(--primary-color);\n}\n.cmp-detail-inputs-container .cmp-inputs-empty {\n padding: 0;\n margin-top: 12px;\n font-size: 12px;\n font-weight: 300;\n opacity: 0.5;\n font-style: italic;\n}\n.cmp-detail-inputs-container .nav-list-item-icon {\n opacity: 0.8;\n background-size: 20px 20px;\n background-position: 4px center;\n}\n.input-icon {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>\');\n}\n.input-icon-array {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>\');\n}\n.input-icon-boolean {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>\');\n}\n.input-icon-number {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>\');\n}\n.input-icon-object {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>\');\n}\n.input-icon-string {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>\');\n}\n.cmp-input-item-unregistered {\n opacity: 0.4;\n}\n.cmp-input-item-unregistered .input-icon::after {\n content: "";\n position: absolute;\n top: 11px;\n left: 4px;\n width: 20px;\n height: 2px;\n background-color: black;\n transform: rotate(-45deg);\n}\n\n/* packages/dev-tools/client/menu/pages/component-input.css */\n.cmp-prop-info {\n border-bottom: 1px solid var(--border-color);\n}\n.cmp-input-readonly {\n margin: 16px 0;\n padding: 0 16px;\n display: grid;\n grid-template-columns: 50% 50%;\n gap: 12px;\n}\n.cmp-input-readonly h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.cmp-input-readonly span {\n margin-top: 2px;\n font-size: 12px;\n font-weight: 300;\n opacity: 0.8;\n}\n.cmp-input-detail {\n margin: 16px 0;\n}\n.cmp-input-detail a {\n color: var(--primary-color);\n text-decoration: none;\n}\n.cmp-input-detail a:hover {\n text-decoration: underline;\n}\n.input-cover {\n position: absolute;\n top: 175px;\n left: 0;\n width: 100%;\n height: 100%;\n background: var(--background-color);\n transform: translate3d(0, 0, 0);\n transition: all var(--transition-time) ease-in-out;\n pointer-events: auto;\n}\n.input-enabled .input-cover {\n transform: translate3d(0, 105%, 0);\n pointer-events: none;\n}\n.input-loading-icon {\n position: absolute;\n display: inline-block;\n top: 190px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.input-loading .input-loading-icon {\n opacity: 0.5;\n}\n\n/* packages/dev-tools/client/menu/menu.css */\n:host {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 2147483646;\n user-select: none;\n pointer-events: none;\n color: var(--text-color);\n}\naside {\n position: absolute;\n top: 0;\n right: 0;\n width: var(--menu-width);\n height: 100%;\n transform: translate3d(105%, 0, 0);\n transition: transform var(--transition-time) ease-in-out;\n background: var(--background-color);\n box-shadow: #000000c9 5px 0 20px;\n overflow: hidden;\n z-index: 1;\n}\n:host(.show-builder-menu) aside {\n pointer-events: auto;\n transform: translate3d(0, 0, 0);\n}\n#hit {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: none;\n}\n:host(.show-builder-menu) #hit {\n display: block;\n pointer-events: auto;\n}\n#version {\n position: absolute;\n bottom: 6px;\n right: 6px;\n font-size: 8px;\n color: #9b9b9b;\n}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder\'s selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder\'s Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder\'s Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>`;\n initMenuToggle(shadow);\n initHomeSection(shadow);\n initComponentListSection(shadow);\n initComponentDetailSection(shadow);\n initComponentInputSection(shadow);\n initSettingsSection(shadow);\n this.setAttribute("aria-hidden", "true");\n shadow.getElementById("version").textContent = "v1.18.40-dev.202512101534.78246177d";\n }\n highlightOpener() {\n const menuToggle = this.shadowRoot.querySelector(".menu-toggle");\n menuToggle.classList.add("menu-toggle-highlight");\n menuToggle.classList.add("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight");\n }, 20);\n }, 20);\n }\n };\n\n // packages/dev-tools/client/setup-ui/overview.ts\n var STEP_CSS = `<style>/* packages/dev-tools/client/setup-ui/styles.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml,\nbody,\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n z-index: 2147483646;\n margin: 0;\n padding: 0;\n line-height: 1.8;\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n background-color: rgba(37, 37, 37, 1);\n color: white;\n transition: opacity 250ms ease-in-out;\n}\n:host([aria-hidden="true"]) {\n opacity: 0;\n pointer-events: none;\n}\nmain {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n}\nh1 {\n margin-top: 0;\n font-size: 24px;\n font-weight: 300;\n line-height: 1.4;\n}\np {\n margin: 20px 0;\n font-weight: 300;\n}\nbutton {\n cursor: pointer;\n}\naside {\n position: absolute;\n top: 0;\n left: 0;\n width: 350px;\n height: 100vh;\n padding: 60px 0 0 50px;\n background-color: rgba(18, 18, 18, 1);\n}\naside ul {\n margin: 30px 0 0 0px;\n padding: 0;\n list-style: none;\n}\naside li {\n position: relative;\n margin: 0;\n padding: 20px 10px;\n font-weight: 300;\n}\naside li.highlight {\n color: rgba(72, 161, 255, 1);\n}\naside li.active {\n font-weight: 700;\n}\naside li .circle {\n position: absolute;\n top: 20px;\n left: 10px;\n width: 24px;\n height: 24px;\n border: 3px solid white;\n border-radius: 50%;\n font-size: 14px;\n}\naside li.highlight .circle {\n border-color: rgba(72, 161, 255, 1);\n}\naside li.active .circle::after {\n content: "";\n position: absolute;\n top: 3px;\n left: 3px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle {\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle::after {\n content: "";\n position: absolute;\n top: 2px;\n left: 6px;\n width: 6px;\n height: 13px;\n border: 3px solid black;\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n}\naside li .line {\n position: absolute;\n top: 44px;\n left: 21px;\n width: 3px;\n height: 45px;\n background-color: white;\n}\naside li.completed .line {\n background-color: rgba(72, 161, 255, 1);\n}\naside li span {\n display: block;\n margin-left: 44px;\n}\nnav {\n margin-top: 30px;\n}\nsection {\n position: absolute;\n top: 135px;\n left: 350px;\n padding: 0 80px 0 140px;\n transition: opacity 150ms ease-in-out;\n}\nsection[aria-hidden=true] {\n pointer-events: none;\n opacity: 0;\n}\nsection h1,\nsection p {\n min-width: 300px;\n max-width: 600px;\n}\n.button {\n position: relative;\n display: inline-block;\n color: white;\n background-color: rgba(72, 161, 255, 1);\n border-radius: 4px;\n text-decoration: none;\n padding: 10px 40px 10px 20px;\n white-space: nowrap;\n}\n.button:hover {\n background-color: rgba(72, 161, 255, 0.85);\n}\n#button-icon {\n position: absolute;\n top: 1px;\n right: 5px;\n bottom: 0;\n width: 30px;\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 24px 24px;\n}\n.button[aria-disabled=true] {\n opacity: 0.9;\n background-color: rgba(255, 255, 255, 0.3);\n pointer-events: none;\n padding-right: 60px;\n}\n.button[aria-disabled=true] #button-icon {\n top: 21px;\n right: 29px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background: white;\n color: white;\n animation: dot-flashing 0.5s infinite linear alternate;\n animation-delay: 0.25s;\n}\n.button[aria-disabled=true] #button-icon::before,\n.button[aria-disabled=true] #button-icon::after {\n content: "";\n display: inline-block;\n position: absolute;\n top: 0;\n}\n.button[aria-disabled=true] #button-icon::before {\n left: -12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0s;\n}\n.button[aria-disabled=true] #button-icon::after {\n left: 12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0.5s;\n}\n@keyframes dot-flashing {\n 0% {\n background-color: white;\n }\n 50%, 100% {\n background-color: rgba(255, 255, 255, 0.3);\n }\n}\n.logo {\n margin-left: 9px;\n background: url(\'data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>\');\n background-repeat: no-repeat;\n width: 150px;\n height: 32px;\n}\n@media (max-width: 840px) {\n aside {\n width: 250px;\n padding: 60px 0 0 20px;\n }\n section {\n left: 250px;\n padding: 0 80px;\n }\n}\n@media (max-width: 590px) {\n aside {\n width: 230px;\n padding: 60px 0 0 10px;\n }\n section {\n left: 230px;\n padding: 0 40px;\n }\n}\n#modified-files-message a {\n color: #cbcbcb;\n font-weight: 300;\n text-decoration: underline;\n}\n#modified-files-message a:hover {\n color: white;\n text-decoration: none;\n}\n#restart-warning {\n border-radius: 4px;\n padding: 8px 16px;\n border: 1px solid #fd6b3c;\n background: rgba(253, 107, 60, 0.1);\n}\n#react-router-steps {\n margin: 0px;\n margin-bottom: 5px;\n padding: 0px 20px;\n}\n#need-help {\n color: #48a1ff;\n text-decoration: none;\n}\n#router-message {\n border-radius: 4px;\n padding: 16px;\n border: 1px solid #48a1ff;\n}\n#router-finish-button {\n margin-top: 12px;\n}\n#router-checkbox-div {\n display: flex;\n align-items: center;\n}\n#router-checkbox {\n margin-right: 10px;\n width: 15px;\n height: 15px;\n}\n#success-title {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n#success-title .check-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 2px solid #28a745;\n border-radius: 50%;\n position: relative;\n}\n#success-title .check-icon::before {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 6px;\n height: 12px;\n border: solid #28a745;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -60%) rotate(45deg);\n}\n</style>`;\n var BuilderOverviewStep = class extends HTMLElement {\n constructor() {\n super();\n }\n connectedCallback() {\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = STEP_CSS + `<main>\n <aside>\n <div class="logo"></div>\n\n <ul>\n <li class="highlight active">\n <div class="circle"></div>\n <div class="line"></div>\n <span>Connect Builder.io</span>\n </li>\n <li>\n <div class="circle"></div>\n <div class="line"></div>\n <span>Update App</span>\n </li>\n <li>\n <div class="circle"></div>\n <span>Setup Complete</span>\n </li>\n </ul>\n </aside>\n\n <section>\n <h1>Integrate Builder.io with your project</h1>\n\n <p>\n First, let\'s connect to your Builder.io space to continue with the\n integration\n </p>\n\n <nav>\n <a class="button next-step" href="#">\n <span id="button-text">Get Started</span>\n <span id="button-icon"></span>\n </a>\n </nav>\n </section>\n</main>\n`;\n setBuilderHead();\n const authPath = new URL(BUILDER_AUTH_CONNECT_PATH, DEV_TOOLS_URL);\n authPath.searchParams.set(PREVIEW_URL_QS, location.href);\n const nextStepLinks = shadow.querySelectorAll(".next-step");\n for (const nextStepLink of nextStepLinks) {\n nextStepLink.setAttribute("href", authPath.href);\n }\n track("overview step viewed");\n }\n };\n var setBuilderHead = () => {\n let favicon = document.head.querySelector(\n "link[rel=\'icon\'], link[rel=\'icon shortcut\']"\n );\n if (favicon) {\n favicon.href = "https://cdn.builder.io/favicon.ico";\n favicon.removeAttribute("type");\n } else {\n favicon = document.createElement("link");\n favicon.rel = "icon";\n favicon.href = "https://cdn.builder.io/favicon.ico";\n document.head.appendChild(favicon);\n }\n };\n\n // packages/dev-tools/client/setup-ui/index.ts\n var checkBuilderIntegration = async () => {\n const validatedBuilder = await apiValidateBuilder();\n if (!validatedBuilder.isValid) {\n showOverviewStep();\n }\n };\n var showOverviewStep = () => {\n if (!customElements.get("builder-dev-tools-overview")) {\n customElements.define("builder-dev-tools-overview", BuilderOverviewStep);\n }\n let overview = document.querySelector(\n "builder-dev-tools-overview"\n );\n if (!overview) {\n overview = document.createElement(\n "builder-dev-tools-overview"\n );\n overview.setAttribute("aria-hidden", "true");\n document.body.appendChild(overview);\n }\n setTimeout(() => {\n overview.removeAttribute("aria-hidden");\n }, 32);\n };\n\n // packages/dev-tools/client/index.ts\n var initDevToolsApp = () => {\n try {\n if (!customElements.get("builder-dev-tools-edit")) {\n customElements.define(\n "builder-dev-tools-edit",\n BuilderDevToolsEditButton\n );\n }\n if (!customElements.get("builder-dev-tools-menu")) {\n customElements.define("builder-dev-tools-menu", BuilderDevToolsMenu);\n }\n let menu = document.querySelector("builder-dev-tools-menu");\n if (!menu) {\n menu = document.createElement("builder-dev-tools-menu");\n menu.setAttribute("data-version", "1.18.40-dev.202512101534.78246177d");\n document.body.appendChild(menu);\n }\n let editButton = document.querySelector("builder-dev-tools-edit");\n if (!editButton) {\n editButton = document.createElement("builder-dev-tools-edit");\n document.body.appendChild(editButton);\n }\n let builderStyles = document.getElementById("builder-dev-tools-style");\n if (!builderStyles) {\n builderStyles = document.createElement("style");\n builderStyles.id = "builder-dev-tools-style";\n builderStyles.innerHTML = `.builder-no-scroll{overflow:hidden !important}`;\n document.head.appendChild(builderStyles);\n }\n checkBuilderIntegration();\n initTracking();\n } catch (e) {\n console.error("Builder Devtools:", e);\n }\n };\n if (window.location === window.parent.location) {\n console.debug(`Builder.io Devtools v${"1.18.40-dev.202512101534.78246177d"}`);\n initDevToolsApp();\n }\n})();');
|
|
1736
2106
|
}
|
|
1737
2107
|
async function getConnectedStepHtml(ctx) {
|
|
1738
2108
|
return updateClientRuntimeVariables(ctx, '<!doctype html>\n<html lang="en" dir="ltr">\n <head>\n <meta charset="utf-8" />\n <script>\n (function (window) {\n if (window.location !== window.top.location) {\n window.top.location = window.location;\n }\n })(this);\n </script>\n <title>Successfully Connected With Builder.io</title>\n <style>/* packages/dev-tools/client/setup-ui/styles.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml,\nbody,\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n z-index: 2147483646;\n margin: 0;\n padding: 0;\n line-height: 1.8;\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n background-color: rgba(37, 37, 37, 1);\n color: white;\n transition: opacity 250ms ease-in-out;\n}\n:host([aria-hidden="true"]) {\n opacity: 0;\n pointer-events: none;\n}\nmain {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n}\nh1 {\n margin-top: 0;\n font-size: 24px;\n font-weight: 300;\n line-height: 1.4;\n}\np {\n margin: 20px 0;\n font-weight: 300;\n}\nbutton {\n cursor: pointer;\n}\naside {\n position: absolute;\n top: 0;\n left: 0;\n width: 350px;\n height: 100vh;\n padding: 60px 0 0 50px;\n background-color: rgba(18, 18, 18, 1);\n}\naside ul {\n margin: 30px 0 0 0px;\n padding: 0;\n list-style: none;\n}\naside li {\n position: relative;\n margin: 0;\n padding: 20px 10px;\n font-weight: 300;\n}\naside li.highlight {\n color: rgba(72, 161, 255, 1);\n}\naside li.active {\n font-weight: 700;\n}\naside li .circle {\n position: absolute;\n top: 20px;\n left: 10px;\n width: 24px;\n height: 24px;\n border: 3px solid white;\n border-radius: 50%;\n font-size: 14px;\n}\naside li.highlight .circle {\n border-color: rgba(72, 161, 255, 1);\n}\naside li.active .circle::after {\n content: "";\n position: absolute;\n top: 3px;\n left: 3px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle {\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle::after {\n content: "";\n position: absolute;\n top: 2px;\n left: 6px;\n width: 6px;\n height: 13px;\n border: 3px solid black;\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n}\naside li .line {\n position: absolute;\n top: 44px;\n left: 21px;\n width: 3px;\n height: 45px;\n background-color: white;\n}\naside li.completed .line {\n background-color: rgba(72, 161, 255, 1);\n}\naside li span {\n display: block;\n margin-left: 44px;\n}\nnav {\n margin-top: 30px;\n}\nsection {\n position: absolute;\n top: 135px;\n left: 350px;\n padding: 0 80px 0 140px;\n transition: opacity 150ms ease-in-out;\n}\nsection[aria-hidden=true] {\n pointer-events: none;\n opacity: 0;\n}\nsection h1,\nsection p {\n min-width: 300px;\n max-width: 600px;\n}\n.button {\n position: relative;\n display: inline-block;\n color: white;\n background-color: rgba(72, 161, 255, 1);\n border-radius: 4px;\n text-decoration: none;\n padding: 10px 40px 10px 20px;\n white-space: nowrap;\n}\n.button:hover {\n background-color: rgba(72, 161, 255, 0.85);\n}\n#button-icon {\n position: absolute;\n top: 1px;\n right: 5px;\n bottom: 0;\n width: 30px;\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 24px 24px;\n}\n.button[aria-disabled=true] {\n opacity: 0.9;\n background-color: rgba(255, 255, 255, 0.3);\n pointer-events: none;\n padding-right: 60px;\n}\n.button[aria-disabled=true] #button-icon {\n top: 21px;\n right: 29px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background: white;\n color: white;\n animation: dot-flashing 0.5s infinite linear alternate;\n animation-delay: 0.25s;\n}\n.button[aria-disabled=true] #button-icon::before,\n.button[aria-disabled=true] #button-icon::after {\n content: "";\n display: inline-block;\n position: absolute;\n top: 0;\n}\n.button[aria-disabled=true] #button-icon::before {\n left: -12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0s;\n}\n.button[aria-disabled=true] #button-icon::after {\n left: 12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0.5s;\n}\n@keyframes dot-flashing {\n 0% {\n background-color: white;\n }\n 50%, 100% {\n background-color: rgba(255, 255, 255, 0.3);\n }\n}\n.logo {\n margin-left: 9px;\n background: url(\'data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>\');\n background-repeat: no-repeat;\n width: 150px;\n height: 32px;\n}\n@media (max-width: 840px) {\n aside {\n width: 250px;\n padding: 60px 0 0 20px;\n }\n section {\n left: 250px;\n padding: 0 80px;\n }\n}\n@media (max-width: 590px) {\n aside {\n width: 230px;\n padding: 60px 0 0 10px;\n }\n section {\n left: 230px;\n padding: 0 40px;\n }\n}\n#modified-files-message a {\n color: #cbcbcb;\n font-weight: 300;\n text-decoration: underline;\n}\n#modified-files-message a:hover {\n color: white;\n text-decoration: none;\n}\n#restart-warning {\n border-radius: 4px;\n padding: 8px 16px;\n border: 1px solid #fd6b3c;\n background: rgba(253, 107, 60, 0.1);\n}\n#react-router-steps {\n margin: 0px;\n margin-bottom: 5px;\n padding: 0px 20px;\n}\n#need-help {\n color: #48a1ff;\n text-decoration: none;\n}\n#router-message {\n border-radius: 4px;\n padding: 16px;\n border: 1px solid #48a1ff;\n}\n#router-finish-button {\n margin-top: 12px;\n}\n#router-checkbox-div {\n display: flex;\n align-items: center;\n}\n#router-checkbox {\n margin-right: 10px;\n width: 15px;\n height: 15px;\n}\n#success-title {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n#success-title .check-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 2px solid #28a745;\n border-radius: 50%;\n position: relative;\n}\n#success-title .check-icon::before {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 6px;\n height: 12px;\n border: solid #28a745;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -60%) rotate(45deg);\n}\n</style>\n <link rel="icon shortcut" href="https://cdn.builder.io/favicon.ico" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n </head>\n <body>\n <main>\n <aside>\n <div class="logo"></div>\n\n <ul>\n <li class="highlight completed">\n <div class="circle"></div>\n <div class="line"></div>\n <span>Connect Builder.io</span>\n </li>\n <li id="step-update-app" class="highlight active">\n <div class="circle"></div>\n <div class="line"></div>\n <span>Update App</span>\n </li>\n <li id="step-setup-complete">\n <div class="circle"></div>\n <span>Setup Complete</span>\n </li>\n </ul>\n </aside>\n\n <section id="updating" aria-hidden="false">\n <h1>Updating App to include Builder.io</h1>\n <p>\n We\'re making some updates so Builder can be used within this\n project.<br />\n This usually takes less than a minute to complete.\n </p>\n\n <nav>\n <p>\n <a id="completing" class="button" aria-disabled="true" href="#">\n <span id="button-text">Updating</span>\n <span id="button-icon"></span>\n </a>\n </p>\n </nav>\n </section>\n\n <section id="success" aria-hidden="true">\n <h1 id="success-title">\n Connection Successful\n <div class="check-icon"></div>\n </h1>\n\n <p>\n Your project is now ready to work with Builder! You can close this tab\n and return to Builder or your development project to continue.\n </p>\n\n <div id="modified-files-message" hidden>\n <p>\n We\'ve made a few updates to your app to help integrate Builder.io:\n </p>\n <ul id="modified-files-list"></ul>\n </div>\n\n <p id="restart-warning" hidden>\n Please restart the dev server to ensure the changes take effect, then\n reload this page.\n </p>\n\n <div id="router-message" hidden>\n <!-- Route message for react -->\n <div id="react-message-section" hidden>\n <span\n >Next, add the following path and component in your React app\n routing setup</span\n >\n <ol id="react-router-steps">\n <li>\n Update path to <strong>\'/builder-demo\'</strong> or\n <strong>\'/*\'</strong>\n </li>\n <li>\n Add <strong>\'BuilderPage\'</strong> component from\n <code>builder-page</code> file\n </li>\n </ol>\n </div>\n\n <!-- Route message for angular -->\n <div id="angular-message-section" hidden>\n <span\n >Next, add the following path for Builder page in your Angular\n routes</span\n >\n <ol id="angular-router-steps">\n <li>\n Update path to <strong>\'builder-demo\'</strong> or\n <strong>\'**\'</strong>\n </li>\n <li>\n Add <strong>\'BuilderPage\'</strong> component from\n <code>builder-page.component</code> file\n </li>\n </ol>\n </div>\n\n <a id="need-help" href="#" hidden>\n <span id="help-text">Need help?</span>\n <span id="help-icon"></span>\n </a>\n <div id="router-checkbox-div"></div>\n </div>\n <div id="router-finish-button" hidden>\n <a class="button next-step" href="#">\n <span id="button-text">Finish</span>\n <span id="button-icon"></span>\n </a>\n </div>\n\n <nav id="go-to-app" hidden>\n <p hidden>Your new app is ready for Builder content! Let\'s go!</p>\n <p>\n <a class="button next-step" href="#">\n <span id="button-text">Go</span>\n <span id="button-icon"></span>\n </a>\n </p>\n </nav>\n </section>\n\n <section id="error" aria-hidden="true">\n <h1>Oops!</h1>\n <p>Looks like we tripped up on an issue!</p>\n <ul id="error-messages"></ul>\n </section>\n\n <section id="restart-server" aria-hidden="true">\n <h1>Please Restart Your Dev Server</h1>\n <p>\n We\'ve made updates to your application, please restart your dev server\n to ensure the changes take effect.\n </p>\n <p>\n <a id="completing" class="button" aria-disabled="true" href="#">\n <span id="button-text">Please restart your dev server</span>\n <span id="button-icon"></span>\n </a>\n </p>\n </section>\n </main>\n <script>"use strict";\n(() => {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. "__esModule" has not been set), then set\n // "default" to the CommonJS "module.exports" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,\n mod\n ));\n\n // node_modules/@amplitude/ua-parser-js/src/ua-parser.js\n var require_ua_parser = __commonJS({\n "node_modules/@amplitude/ua-parser-js/src/ua-parser.js"(exports, module) {\n (function(window2, undefined2) {\n "use strict";\n var LIBVERSION = "0.7.33", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION2 = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 350;\n var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook";\n var extend = function(regexes2, extensions) {\n var mergedRegexes = {};\n for (var i in regexes2) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes2[i]);\n } else {\n mergedRegexes[i] = regexes2[i];\n }\n }\n return mergedRegexes;\n }, enumerize = function(arr) {\n var enums = {};\n for (var i = 0; i < arr.length; i++) {\n enums[arr[i].toUpperCase()] = arr[i];\n }\n return enums;\n }, has = function(str1, str2) {\n return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n }, lowerize = function(str) {\n return str.toLowerCase();\n }, majorize = function(version) {\n return typeof version === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split(".")[0] : undefined2;\n }, trim = function(str, len) {\n if (typeof str === STR_TYPE) {\n str = str.replace(/^\\s\\s*/, EMPTY);\n return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n }\n };\n var rgxMapper = function(ua, arrays) {\n var i = 0, j, k, p, q, matches, match;\n while (i < arrays.length && !matches) {\n var regex = arrays[i], props = arrays[i + 1];\n j = k = 0;\n while (j < regex.length && !matches) {\n matches = regex[j++].exec(ua);\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length === 2) {\n if (typeof q[1] == FUNC_TYPE) {\n this[q[0]] = q[1].call(this, match);\n } else {\n this[q[0]] = q[1];\n }\n } else if (q.length === 3) {\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;\n } else {\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;\n }\n } else if (q.length === 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;\n }\n } else {\n this[q] = match ? match : undefined2;\n }\n }\n }\n }\n i += 2;\n }\n }, strMapper = function(str, map) {\n for (var i in map) {\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (has(map[i][j], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n } else if (has(map[i], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n return str;\n };\n var oldSafariMap = {\n "1.0": "/8",\n 1.2: "/1",\n 1.3: "/3",\n "2.0": "/412",\n "2.0.2": "/416",\n "2.0.3": "/417",\n "2.0.4": "/419",\n "?": "/"\n }, windowsVersionMap = {\n ME: "4.90",\n "NT 3.11": "NT3.51",\n "NT 4.0": "NT4.0",\n 2e3: "NT 5.0",\n XP: ["NT 5.1", "NT 5.2"],\n Vista: "NT 6.0",\n 7: "NT 6.1",\n 8: "NT 6.2",\n 8.1: "NT 6.3",\n 10: ["NT 6.4", "NT 10.0"],\n RT: "ARM"\n };\n var regexes = {\n browser: [\n [\n /\\b(?:crmo|crios)\\/([\\w\\.]+)/i\n // Chrome for Android/iOS\n ],\n [VERSION2, [NAME, "Chrome"]],\n [\n /edg(?:e|ios|a)?\\/([\\w\\.]+)/i\n // Microsoft Edge\n ],\n [VERSION2, [NAME, "Edge"]],\n [\n // Presto based\n /(opera mini)\\/([-\\w\\.]+)/i,\n // Opera Mini\n /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,\n // Opera Mobi/Tablet\n /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i\n // Opera\n ],\n [NAME, VERSION2],\n [\n /opios[\\/ ]+([\\w\\.]+)/i\n // Opera mini on iphone >= 8.0\n ],\n [VERSION2, [NAME, OPERA + " Mini"]],\n [\n /\\bopr\\/([\\w\\.]+)/i\n // Opera Webkit\n ],\n [VERSION2, [NAME, OPERA]],\n [\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,\n // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,\n // Avant/IEMobile/SlimBrowser\n /(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,\n // Baidu Browser\n /(?:ms|\\()(ie) ([\\w\\.]+)/i,\n // Internet Explorer\n // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,\n // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n /(weibo)__([\\d\\.]+)/i\n // Weibo\n ],\n [NAME, VERSION2],\n [\n /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i\n // UCBrowser\n ],\n [VERSION2, [NAME, "UC" + BROWSER]],\n [\n /microm.+\\bqbcore\\/([\\w\\.]+)/i,\n // WeChat Desktop for Windows Built-in Browser\n /\\bqbcore\\/([\\w\\.]+).+microm/i\n ],\n [VERSION2, [NAME, "WeChat(Win) Desktop"]],\n [\n /micromessenger\\/([\\w\\.]+)/i\n // WeChat\n ],\n [VERSION2, [NAME, "WeChat"]],\n [\n /konqueror\\/([\\w\\.]+)/i\n // Konqueror\n ],\n [VERSION2, [NAME, "Konqueror"]],\n [\n /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i\n // IE11\n ],\n [VERSION2, [NAME, "IE"]],\n [\n /yabrowser\\/([\\w\\.]+)/i\n // Yandex\n ],\n [VERSION2, [NAME, "Yandex"]],\n [\n /(avast|avg)\\/([\\w\\.]+)/i\n // Avast/AVG Secure Browser\n ],\n [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION2],\n [\n /\\bfocus\\/([\\w\\.]+)/i\n // Firefox Focus\n ],\n [VERSION2, [NAME, FIREFOX + " Focus"]],\n [\n /\\bopt\\/([\\w\\.]+)/i\n // Opera Touch\n ],\n [VERSION2, [NAME, OPERA + " Touch"]],\n [\n /coc_coc\\w+\\/([\\w\\.]+)/i\n // Coc Coc Browser\n ],\n [VERSION2, [NAME, "Coc Coc"]],\n [\n /dolfin\\/([\\w\\.]+)/i\n // Dolphin\n ],\n [VERSION2, [NAME, "Dolphin"]],\n [\n /coast\\/([\\w\\.]+)/i\n // Opera Coast\n ],\n [VERSION2, [NAME, OPERA + " Coast"]],\n [\n /miuibrowser\\/([\\w\\.]+)/i\n // MIUI Browser\n ],\n [VERSION2, [NAME, "MIUI " + BROWSER]],\n [\n /fxios\\/([-\\w\\.]+)/i\n // Firefox for iOS\n ],\n [VERSION2, [NAME, FIREFOX]],\n [\n /\\bqihu|(qi?ho?o?|360)browser/i\n // 360\n ],\n [[NAME, "360 " + BROWSER]],\n [/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],\n [[NAME, /(.+)/, "$1 " + BROWSER], VERSION2],\n [\n // Oculus/Samsung/Sailfish/Huawei Browser\n /(comodo_dragon)\\/([\\w\\.]+)/i\n // Comodo Dragon\n ],\n [[NAME, /_/g, " "], VERSION2],\n [\n /(electron)\\/([\\w\\.]+) safari/i,\n // Electron-based App\n /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,\n // Tesla\n /m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i\n // QQBrowser/Baidu App/2345 Browser\n ],\n [NAME, VERSION2],\n [\n /(metasr)[\\/ ]?([\\w\\.]+)/i,\n // SouGouBrowser\n /(lbbrowser)/i,\n // LieBao Browser\n /\\[(linkedin)app\\]/i\n // LinkedIn App for iOS & Android\n ],\n [NAME],\n [\n // WebView\n /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i\n // Facebook App for iOS & Android\n ],\n [[NAME, FACEBOOK], VERSION2],\n [\n /safari (line)\\/([\\w\\.]+)/i,\n // Line App for iOS\n /\\b(line)\\/([\\w\\.]+)\\/iab/i,\n // Line App for Android\n /(chromium|instagram)[\\/ ]([-\\w\\.]+)/i\n // Chromium/Instagram\n ],\n [NAME, VERSION2],\n [\n /\\bgsa\\/([\\w\\.]+) .*safari\\//i\n // Google Search Appliance on iOS\n ],\n [VERSION2, [NAME, "GSA"]],\n [\n /headlesschrome(?:\\/([\\w\\.]+)| )/i\n // Chrome Headless\n ],\n [VERSION2, [NAME, CHROME + " Headless"]],\n [\n / wv\\).+(chrome)\\/([\\w\\.]+)/i\n // Chrome WebView\n ],\n [[NAME, CHROME + " WebView"], VERSION2],\n [\n /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i\n // Android Browser\n ],\n [VERSION2, [NAME, "Android " + BROWSER]],\n [\n /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i\n // Chrome/OmniWeb/Arora/Tizen/Nokia\n ],\n [NAME, VERSION2],\n [\n /version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i\n // Mobile Safari\n ],\n [VERSION2, [NAME, "Mobile Safari"]],\n [\n /version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i\n // Safari & Safari Mobile\n ],\n [VERSION2, NAME],\n [\n /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i\n // Safari < 3.0\n ],\n [NAME, [VERSION2, strMapper, oldSafariMap]],\n [/(webkit|khtml)\\/([\\w\\.]+)/i],\n [NAME, VERSION2],\n [\n // Gecko based\n /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i\n // Netscape\n ],\n [[NAME, "Netscape"], VERSION2],\n [\n /mobile vr; rv:([\\w\\.]+)\\).+firefox/i\n // Firefox Reality\n ],\n [VERSION2, [NAME, FIREFOX + " Reality"]],\n [\n /ekiohf.+(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(swiftfox)/i,\n // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(firefox)\\/([\\w\\.]+)/i,\n // Other Firefox-based\n /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,\n // Mozilla\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n /(links) \\(([\\w\\.]+)/i\n // Links\n ],\n [NAME, VERSION2],\n [\n /(cobalt)\\/([\\w\\.]+)/i\n // Cobalt\n ],\n [NAME, [VERSION2, /master.|lts./, ""]]\n ],\n cpu: [\n [\n /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i\n // AMD64 (x64)\n ],\n [[ARCHITECTURE, "amd64"]],\n [\n /(ia32(?=;))/i\n // IA32 (quicktime)\n ],\n [[ARCHITECTURE, lowerize]],\n [\n /((?:i[346]|x)86)[;\\)]/i\n // IA32 (x86)\n ],\n [[ARCHITECTURE, "ia32"]],\n [\n /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i\n // ARM64\n ],\n [[ARCHITECTURE, "arm64"]],\n [\n /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i\n // ARMHF\n ],\n [[ARCHITECTURE, "armhf"]],\n [\n // PocketPC mistakenly identified as PowerPC\n /windows (ce|mobile); ppc;/i\n ],\n [[ARCHITECTURE, "arm"]],\n [\n /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i\n // PowerPC\n ],\n [[ARCHITECTURE, /ower/, EMPTY, lowerize]],\n [\n /(sun4\\w)[;\\)]/i\n // SPARC\n ],\n [[ARCHITECTURE, "sparc"]],\n [\n /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ],\n [[ARCHITECTURE, lowerize]]\n ],\n device: [\n [\n //////////////////////////\n // MOBILES & TABLETS\n // Ordered by popularity\n /////////////////////////\n // Samsung\n /\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]],\n [\n /\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,\n /samsung[- ]([-\\w]+)/i,\n /sec-(sgh\\w+)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]],\n [\n // Apple\n /((ipod|iphone)\\d+,\\d+)/i\n // iPod/iPhone model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /(ipad\\d+,\\d+)/i\n // iPad model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [\n /\\((ip(?:hone|od)[\\w ]*);/i\n // iPod/iPhone\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /\\((ipad);[-\\w\\),; ]+apple/i,\n // iPad\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [/(macintosh);/i],\n [MODEL, [VENDOR, APPLE]],\n [\n // Huawei\n /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]],\n [\n /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n /\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]],\n [\n // Xiaomi\n /\\b(poco[\\w ]+)(?: bui|\\))/i,\n // Xiaomi POCO\n /\\b; (\\w+) build\\/hm\\1/i,\n // Xiaomi Hongmi \'numeric\' models\n /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,\n // Xiaomi Hongmi\n /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,\n // Xiaomi Redmi\n /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i\n // Xiaomi Mi\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, MOBILE]\n ],\n [\n /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i\n // Mi Pad tablets\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, TABLET]\n ],\n [\n // OPPO\n /; (\\w+) bui.+ oppo/i,\n /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i\n ],\n [MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]],\n [\n // Vivo\n /vivo (\\w+)(?: bui|\\))/i,\n /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n ],\n [MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]],\n [\n // Realme\n /\\b(rmx[12]\\d{3})(?: bui|;|\\))/i\n ],\n [MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]],\n [\n // Motorola\n /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n /\\bmot(?:orola)?[- ](\\w*)/i,\n /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n ],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]],\n [/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]],\n [\n // LG\n /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, TABLET]],\n [\n /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n /\\blg-?([\\d\\w]+) bui/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, MOBILE]],\n [\n // Lenovo\n /(ideatab[-\\w ]+)/i,\n /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n ],\n [MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]],\n [\n // Nokia\n /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n /nokia[-_ ]?([-\\w\\.]*)/i\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, "Nokia"],\n [TYPE, MOBILE]\n ],\n [\n // Google\n /(pixel c)\\b/i\n // Google Pixel C\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]],\n [\n /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i\n // Google Pixel\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]],\n [\n // Sony\n /droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ],\n [MODEL, [VENDOR, SONY], [TYPE, MOBILE]],\n [/sony tablet [ps]/i, /\\b(?:sony)?sgp\\w+(?: bui|\\))/i],\n [\n [MODEL, "Xperia Tablet"],\n [VENDOR, SONY],\n [TYPE, TABLET]\n ],\n [\n // OnePlus\n / (kb2005|in20[12]5|be20[12][59])\\b/i,\n /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n ],\n [MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]],\n [\n // Amazon\n /(alexa)webm/i,\n /(kf[a-z]{2}wi)( bui|\\))/i,\n // Kindle Fire without Silk\n /(kf[a-z]+)( bui|\\)).+silk\\//i\n // Kindle Fire HD\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]],\n [\n /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i\n // Fire Phone\n ],\n [\n [MODEL, /(.+)/g, "Fire Phone $1"],\n [VENDOR, AMAZON],\n [TYPE, MOBILE]\n ],\n [\n // BlackBerry\n /(playbook);[-\\w\\),; ]+(rim)/i\n // BlackBerry PlayBook\n ],\n [MODEL, VENDOR, [TYPE, TABLET]],\n [\n /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n /\\(bb10; (\\w+)/i\n // BlackBerry 10\n ],\n [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]],\n [\n // Asus\n /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n ],\n [MODEL, [VENDOR, ASUS], [TYPE, TABLET]],\n [/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],\n [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]],\n [\n // HTC\n /(nexus 9)/i\n // HTC Nexus 9\n ],\n [MODEL, [VENDOR, "HTC"], [TYPE, TABLET]],\n [\n /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,\n // HTC\n // ZTE\n /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n /(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i\n // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ],\n [VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]],\n [\n // Acer\n /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n ],\n [MODEL, [VENDOR, "Acer"], [TYPE, TABLET]],\n [\n // Meizu\n /droid.+; (m[1-5] note) bui/i,\n /\\bmz-([-\\w]{2,})/i\n ],\n [MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]],\n [\n // Sharp\n /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]],\n [\n // MIXED\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,\n // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp) ([\\w ]+\\w)/i,\n // HP iPAQ\n /(asus)-?(\\w+)/i,\n // Asus\n /(microsoft); (lumia[\\w ]+)/i,\n // Microsoft Lumia\n /(lenovo)[-_ ]?([-\\w]+)/i,\n // Lenovo\n /(jolla)/i,\n // Jolla\n /(oppo) ?([\\w ]+) bui/i\n // OPPO\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(archos) (gamepad2?)/i,\n // Archos\n /(hp).+(touchpad(?!.+tablet)|tablet)/i,\n // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(nook)[\\w ]+build\\/(\\w+)/i,\n // Nook\n /(dell) (strea[kpr\\d ]*[\\dko])/i,\n // Dell Streak\n /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,\n // Le Pan Tablets\n /(trinity)[- ]*(t\\d{3}) bui/i,\n // Trinity Tablets\n /(gigaset)[- ]+(q\\w{1,9}) bui/i,\n // Gigaset Tablets\n /(vodafone) ([\\w ]+)(?:\\)| bui)/i\n // Vodafone\n ],\n [VENDOR, MODEL, [TYPE, TABLET]],\n [\n /(surface duo)/i\n // Surface Duo\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]],\n [\n /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i\n // Fairphone\n ],\n [MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]],\n [\n /(u304aa)/i\n // AT&T\n ],\n [MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]],\n [\n /\\bsie-(\\w*)/i\n // Siemens\n ],\n [MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]],\n [\n /\\b(rct\\w+) b/i\n // RCA Tablets\n ],\n [MODEL, [VENDOR, "RCA"], [TYPE, TABLET]],\n [\n /\\b(venue[\\d ]{2,7}) b/i\n // Dell Venue Tablets\n ],\n [MODEL, [VENDOR, "Dell"], [TYPE, TABLET]],\n [\n /\\b(q(?:mv|ta)\\w+) b/i\n // Verizon Tablet\n ],\n [MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]],\n [\n /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i\n // Barnes & Noble Tablet\n ],\n [MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]],\n [/\\b(tm\\d{3}\\w+) b/i],\n [MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]],\n [\n /\\b(k88) b/i\n // ZTE K Series Tablet\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]],\n [\n /\\b(nx\\d{3}j) b/i\n // ZTE Nubia\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]],\n [\n /\\b(gen\\d{3}) b.+49h/i\n // Swiss GEN Mobile\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]],\n [\n /\\b(zur\\d{3}) b/i\n // Swiss ZUR Tablet\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]],\n [\n /\\b((zeki)?tb.*\\b) b/i\n // Zeki Tablets\n ],\n [MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]],\n [\n /\\b([yr]\\d{2}) b/i,\n /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i\n // Dragon Touch Tablet\n ],\n [[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]],\n [\n /\\b(ns-?\\w{0,9}) b/i\n // Insignia Tablets\n ],\n [MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]],\n [\n /\\b((nxa|next)-?\\w{0,9}) b/i\n // NextBook Tablets\n ],\n [MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]],\n [\n /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i\n // Voice Xtreme Phones\n ],\n [[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(lvtel\\-)?(v1[12]) b/i\n // LvTel Phones\n ],\n [[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(ph-1) /i\n // Essential PH-1\n ],\n [MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]],\n [\n /\\b(v(100md|700na|7011|917g).*\\b) b/i\n // Envizen Tablets\n ],\n [MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]],\n [\n /\\b(trio[-\\w\\. ]+) b/i\n // MachSpeed Tablets\n ],\n [MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]],\n [\n /\\btu_(1491) b/i\n // Rotor Tablets\n ],\n [MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]],\n [\n /(shield[\\w ]+) b/i\n // Nvidia Shield Tablets\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]],\n [\n /(sprint) (\\w+)/i\n // Sprint Phones\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(kin\\.[onetw]{3})/i\n // Microsoft Kin\n ],\n [\n [MODEL, /\\./g, " "],\n [VENDOR, MICROSOFT],\n [TYPE, MOBILE]\n ],\n [\n /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i\n // Zebra\n ],\n [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]],\n [/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]],\n [\n ///////////////////\n // CONSOLES\n ///////////////////\n /(ouya)/i,\n // Ouya\n /(nintendo) ([wids3utch]+)/i\n // Nintendo\n ],\n [VENDOR, MODEL, [TYPE, CONSOLE]],\n [\n /droid.+; (shield) bui/i\n // Nvidia\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]],\n [\n /(playstation [345portablevi]+)/i\n // Playstation\n ],\n [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]],\n [\n /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i\n // Microsoft Xbox\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]],\n [\n ///////////////////\n // SMARTTVS\n ///////////////////\n /smart-tv.+(samsung)/i\n // Samsung\n ],\n [VENDOR, [TYPE, SMARTTV]],\n [/hbbtv.+maple;(\\d+)/i],\n [\n [MODEL, /^/, "SmartTV"],\n [VENDOR, SAMSUNG],\n [TYPE, SMARTTV]\n ],\n [\n /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i\n // LG SmartTV\n ],\n [\n [VENDOR, LG],\n [TYPE, SMARTTV]\n ],\n [\n /(apple) ?tv/i\n // Apple TV\n ],\n [VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]],\n [\n /crkey/i\n // Google Chromecast\n ],\n [\n [MODEL, CHROME + "cast"],\n [VENDOR, GOOGLE],\n [TYPE, SMARTTV]\n ],\n [\n /droid.+aft(\\w)( bui|\\))/i\n // Fire TV\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]],\n [\n /\\(dtv[\\);].+(aquos)/i,\n /(aquos-tv[\\w ]+)\\)/i\n // Sharp\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],\n [\n /(bravia[\\w ]+)( bui|\\))/i\n // Sony\n ],\n [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]],\n [\n /(mitv-\\w{5}) bui/i\n // Xiaomi\n ],\n [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]],\n [\n /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,\n // Roku\n /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i\n // HbbTV devices\n ],\n [\n [VENDOR, trim],\n [MODEL, trim],\n [TYPE, SMARTTV]\n ],\n [\n /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i\n // SmartTV from Unidentified Vendors\n ],\n [[TYPE, SMARTTV]],\n [\n ///////////////////\n // WEARABLES\n ///////////////////\n /((pebble))app/i\n // Pebble\n ],\n [VENDOR, MODEL, [TYPE, WEARABLE]],\n [\n /droid.+; (glass) \\d/i\n // Google Glass\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]],\n [/droid.+; (wt63?0{2,3})\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]],\n [\n /(quest( 2)?)/i\n // Oculus Quest\n ],\n [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]],\n [\n ///////////////////\n // EMBEDDED\n ///////////////////\n /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i\n // Tesla\n ],\n [VENDOR, [TYPE, EMBEDDED]],\n [\n ////////////////////\n // MIXED (GENERIC)\n ///////////////////\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i\n // Android Phones from Unidentified Vendors\n ],\n [MODEL, [TYPE, MOBILE]],\n [\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i\n // Android Tablets from Unidentified Vendors\n ],\n [MODEL, [TYPE, TABLET]],\n [\n /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i\n // Unidentifiable Tablet\n ],\n [[TYPE, TABLET]],\n [\n /(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i\n // Unidentifiable Mobile\n ],\n [[TYPE, MOBILE]],\n [\n /(android[-\\w\\. ]{0,9});.+buil/i\n // Generic Android Device\n ],\n [MODEL, [VENDOR, "Generic"]]\n ],\n engine: [\n [\n /windows.+ edge\\/([\\w\\.]+)/i\n // EdgeHTML\n ],\n [VERSION2, [NAME, EDGE + "HTML"]],\n [\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i\n // Blink\n ],\n [VERSION2, [NAME, "Blink"]],\n [\n /(presto)\\/([\\w\\.]+)/i,\n // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,\n // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /ekioh(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,\n // KHTML/Tasman/Links\n /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i\n // iCab\n ],\n [NAME, VERSION2],\n [\n /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i\n // Gecko\n ],\n [VERSION2, NAME]\n ],\n os: [\n [\n // Windows\n /microsoft (windows) (vista|xp)/i\n // Windows (iTunes)\n ],\n [NAME, VERSION2],\n [\n /(windows) nt 6\\.2; (arm)/i,\n // Windows RT\n /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,\n // Windows Phone\n /(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i\n ],\n [NAME, [VERSION2, strMapper, windowsVersionMap]],\n [/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],\n [\n [NAME, "Windows"],\n [VERSION2, strMapper, windowsVersionMap]\n ],\n [\n // iOS/macOS\n /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,\n // iOS\n /cfnetwork\\/.+darwin/i\n ],\n [\n [VERSION2, /_/g, "."],\n [NAME, "iOS"]\n ],\n [\n /(mac os x) ?([\\w\\. ]*)/i,\n /(macintosh|mac_powerpc\\b)(?!.+haiku)/i\n // Mac OS\n ],\n [\n [NAME, "Mac OS"],\n [VERSION2, /_/g, "."]\n ],\n [\n // Mobile OSes\n /droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i\n // Android-x86/HarmonyOS\n ],\n [VERSION2, NAME],\n [\n // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n /(blackberry)\\w*\\/([\\w\\.]*)/i,\n // Blackberry\n /(tizen|kaios)[\\/ ]([\\w\\.]+)/i,\n // Tizen/KaiOS\n /\\((series40);/i\n // Series 40\n ],\n [NAME, VERSION2],\n [\n /\\(bb(10);/i\n // BlackBerry 10\n ],\n [VERSION2, [NAME, BLACKBERRY]],\n [\n /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i\n // Symbian\n ],\n [VERSION2, [NAME, "Symbian"]],\n [\n /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i\n // Firefox OS\n ],\n [VERSION2, [NAME, FIREFOX + " OS"]],\n [\n /web0s;.+rt(tv)/i,\n /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i\n // WebOS\n ],\n [VERSION2, [NAME, "webOS"]],\n [\n // Google Chromecast\n /crkey\\/([\\d\\.]+)/i\n // Google Chromecast\n ],\n [VERSION2, [NAME, CHROME + "cast"]],\n [\n /(cros) [\\w]+ ([\\w\\.]+\\w)/i\n // Chromium OS\n ],\n [[NAME, "Chromium OS"], VERSION2],\n [\n // Console\n /(nintendo|playstation) ([wids345portablevuch]+)/i,\n // Nintendo/Playstation\n /(xbox); +xbox ([^\\);]+)/i,\n // Microsoft Xbox (360, One, X, S, Series X, Series S)\n // Other\n /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,\n // Joli/Palm\n /(mint)[\\/\\(\\) ]?(\\w*)/i,\n // Mint\n /(mageia|vectorlinux)[; ]/i,\n // Mageia/VectorLinux\n /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n /(hurd|linux) ?([\\w\\.]*)/i,\n // Hurd/Linux\n /(gnu) ?([\\w\\.]*)/i,\n // GNU\n /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,\n // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n /(haiku) (\\w+)/i\n // Haiku\n ],\n [NAME, VERSION2],\n [\n /(sunos) ?([\\w\\.\\d]*)/i\n // Solaris\n ],\n [[NAME, "Solaris"], VERSION2],\n [\n /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,\n // Solaris\n /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,\n // AIX\n /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,\n // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX\n /(unix) ?([\\w\\.]*)/i\n // UNIX\n ],\n [NAME, VERSION2]\n ]\n };\n var UAParser2 = function(ua, extensions) {\n if (typeof ua === OBJ_TYPE) {\n extensions = ua;\n ua = undefined2;\n }\n if (!(this instanceof UAParser2)) {\n return new UAParser2(ua, extensions).getResult();\n }\n var _ua = ua || (typeof window2 !== UNDEF_TYPE && window2.navigator && window2.navigator.userAgent ? window2.navigator.userAgent : EMPTY);\n var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n this.getBrowser = function() {\n var _browser = {};\n _browser[NAME] = undefined2;\n _browser[VERSION2] = undefined2;\n rgxMapper.call(_browser, _ua, _rgxmap.browser);\n _browser.major = majorize(_browser.version);\n return _browser;\n };\n this.getCPU = function() {\n var _cpu = {};\n _cpu[ARCHITECTURE] = undefined2;\n rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n return _cpu;\n };\n this.getDevice = function() {\n var _device = {};\n _device[VENDOR] = undefined2;\n _device[MODEL] = undefined2;\n _device[TYPE] = undefined2;\n rgxMapper.call(_device, _ua, _rgxmap.device);\n return _device;\n };\n this.getEngine = function() {\n var _engine = {};\n _engine[NAME] = undefined2;\n _engine[VERSION2] = undefined2;\n rgxMapper.call(_engine, _ua, _rgxmap.engine);\n return _engine;\n };\n this.getOS = function() {\n var _os = {};\n _os[NAME] = undefined2;\n _os[VERSION2] = undefined2;\n rgxMapper.call(_os, _ua, _rgxmap.os);\n return _os;\n };\n this.getResult = function() {\n return {\n ua: this.getUA(),\n browser: this.getBrowser(),\n engine: this.getEngine(),\n os: this.getOS(),\n device: this.getDevice(),\n cpu: this.getCPU()\n };\n };\n this.getUA = function() {\n return _ua;\n };\n this.setUA = function(ua2) {\n _ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;\n return this;\n };\n this.setUA(_ua);\n return this;\n };\n UAParser2.VERSION = LIBVERSION;\n UAParser2.BROWSER = enumerize([NAME, VERSION2, MAJOR]);\n UAParser2.CPU = enumerize([ARCHITECTURE]);\n UAParser2.DEVICE = enumerize([\n MODEL,\n VENDOR,\n TYPE,\n CONSOLE,\n MOBILE,\n SMARTTV,\n TABLET,\n WEARABLE,\n EMBEDDED\n ]);\n UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION2]);\n if (typeof exports !== UNDEF_TYPE) {\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser2;\n }\n exports.UAParser = UAParser2;\n } else {\n if (typeof define === FUNC_TYPE && define.amd) {\n define(function() {\n return UAParser2;\n });\n } else if (typeof window2 !== UNDEF_TYPE) {\n window2.UAParser = UAParser2;\n }\n }\n var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser2();\n $.ua = parser.getResult();\n $.ua.get = function() {\n return parser.getUA();\n };\n $.ua.set = function(ua) {\n parser.setUA(ua);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n })(typeof window === "object" ? window : exports);\n }\n });\n\n // packages/dev-tools/common/constants.ts\n var PUBLIC_API_KEY_QS = `api-key`;\n var PRIVATE_AUTH_KEY_QS = `p-key`;\n var PREVIEW_URL_QS = `preview-url`;\n var USER_ID_QS = `user-id`;\n var CONNECTED_USER_ID_QS = "_b-uid";\n var FRAMEWORK_QS = `framework`;\n var PLATFORM_QS = `platform`;\n var NODE_VERSION_QS = `node`;\n var DEV_TOOLS_API_PATH = "/~builder-dev-tools";\n var SPACE_KIND_QS = `kind`;\n\n // packages/dev-tools/client/utils.ts\n var DEV_TOOLS_URL = "__DEV_TOOLS_URL__";\n\n // packages/dev-tools/client/client-api.ts\n var apiConnectBuilder = (publicApiKey, privateAuthKey, kind) => apiFetch({\n type: "connectBuilder",\n data: {\n publicApiKey,\n privateAuthKey,\n kind\n }\n });\n var apiValidateBuilder = () => apiFetch({\n type: "validateBuilder"\n });\n var apiLaunchEditor = (file) => apiFetch({\n type: "launchEditor",\n data: file\n });\n var apiFetch = async (data) => {\n const url = new URL(DEV_TOOLS_API_PATH, DEV_TOOLS_URL);\n let rsp;\n try {\n rsp = await fetch(url, {\n method: "POST",\n body: JSON.stringify(data)\n });\n } catch (e) {\n console.error(`Devtools Fetch Error, ${url.href}`, e);\n throw new Error(`Builder Devtools Fetch Error`);\n }\n const contentType = rsp.headers.get("content-type") || "";\n if (contentType.includes("application/json")) {\n const r = await rsp.json();\n if (rsp.ok) {\n return r.data;\n }\n if (Array.isArray(r.errors) && r.errors.length > 0) {\n r.errors.forEach((e) => console.error(e));\n throw new Error(`Builder Devtools Fetch Error: ${r.errors[0]}`);\n }\n }\n throw new Error(\n `Builder Devtools Fetch Error: ${rsp.status}, ${await rsp.text()}`\n );\n };\n\n // node_modules/tslib/tslib.es6.mjs\n var extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {\n d2.__proto__ = b2;\n } || function(d2, b2) {\n for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];\n };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function() {\n __assign = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function(resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function(resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator["throw"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() {\n if (t[0] & 1) throw t[1];\n return t[1];\n }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);\n return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {\n return this;\n }), g;\n function verb(n) {\n return function(v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n function __values(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = { error };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n }\n\n // node_modules/@amplitude/analytics-types/lib/esm/event.js\n var IdentifyOperation;\n (function(IdentifyOperation2) {\n IdentifyOperation2["SET"] = "$set";\n IdentifyOperation2["SET_ONCE"] = "$setOnce";\n IdentifyOperation2["ADD"] = "$add";\n IdentifyOperation2["APPEND"] = "$append";\n IdentifyOperation2["PREPEND"] = "$prepend";\n IdentifyOperation2["REMOVE"] = "$remove";\n IdentifyOperation2["PREINSERT"] = "$preInsert";\n IdentifyOperation2["POSTINSERT"] = "$postInsert";\n IdentifyOperation2["UNSET"] = "$unset";\n IdentifyOperation2["CLEAR_ALL"] = "$clearAll";\n })(IdentifyOperation || (IdentifyOperation = {}));\n var RevenueProperty;\n (function(RevenueProperty2) {\n RevenueProperty2["REVENUE_PRODUCT_ID"] = "$productId";\n RevenueProperty2["REVENUE_QUANTITY"] = "$quantity";\n RevenueProperty2["REVENUE_PRICE"] = "$price";\n RevenueProperty2["REVENUE_TYPE"] = "$revenueType";\n RevenueProperty2["REVENUE_CURRENCY"] = "$currency";\n RevenueProperty2["REVENUE"] = "$revenue";\n })(RevenueProperty || (RevenueProperty = {}));\n var SpecialEventType;\n (function(SpecialEventType2) {\n SpecialEventType2["IDENTIFY"] = "$identify";\n SpecialEventType2["GROUP_IDENTIFY"] = "$groupidentify";\n SpecialEventType2["REVENUE"] = "revenue_amount";\n })(SpecialEventType || (SpecialEventType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/logger.js\n var LogLevel;\n (function(LogLevel2) {\n LogLevel2[LogLevel2["None"] = 0] = "None";\n LogLevel2[LogLevel2["Error"] = 1] = "Error";\n LogLevel2[LogLevel2["Warn"] = 2] = "Warn";\n LogLevel2[LogLevel2["Verbose"] = 3] = "Verbose";\n LogLevel2[LogLevel2["Debug"] = 4] = "Debug";\n })(LogLevel || (LogLevel = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/plugin.js\n var PluginType;\n (function(PluginType2) {\n PluginType2["BEFORE"] = "before";\n PluginType2["ENRICHMENT"] = "enrichment";\n PluginType2["DESTINATION"] = "destination";\n })(PluginType || (PluginType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/server-zone.js\n var ServerZone;\n (function(ServerZone2) {\n ServerZone2["US"] = "US";\n ServerZone2["EU"] = "EU";\n ServerZone2["STAGING"] = "STAGING";\n })(ServerZone || (ServerZone = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/status.js\n var Status;\n (function(Status2) {\n Status2["Unknown"] = "unknown";\n Status2["Skipped"] = "skipped";\n Status2["Success"] = "success";\n Status2["RateLimit"] = "rate_limit";\n Status2["PayloadTooLarge"] = "payload_too_large";\n Status2["Invalid"] = "invalid";\n Status2["Failed"] = "failed";\n Status2["Timeout"] = "Timeout";\n Status2["SystemError"] = "SystemError";\n })(Status || (Status = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/transport.js\n var TransportType;\n (function(TransportType2) {\n TransportType2["XHR"] = "xhr";\n TransportType2["SendBeacon"] = "beacon";\n TransportType2["Fetch"] = "fetch";\n })(TransportType || (TransportType = {}));\n\n // node_modules/@amplitude/analytics-core/lib/esm/constants.js\n var UNSET_VALUE = "-";\n var AMPLITUDE_PREFIX = "AMP";\n var STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");\n var AMPLITUDE_SERVER_URL = "https://api2.amplitude.com/2/httpapi";\n var EU_AMPLITUDE_SERVER_URL = "https://api.eu.amplitude.com/2/httpapi";\n var AMPLITUDE_BATCH_SERVER_URL = "https://api2.amplitude.com/batch";\n var EU_AMPLITUDE_BATCH_SERVER_URL = "https://api.eu.amplitude.com/batch";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js\n var MAX_PROPERTY_KEYS = 1e3;\n var isValidObject = function(properties) {\n if (Object.keys(properties).length > MAX_PROPERTY_KEYS) {\n return false;\n }\n for (var key in properties) {\n var value = properties[key];\n if (!isValidProperties(key, value))\n return false;\n }\n return true;\n };\n var isValidProperties = function(property, value) {\n var e_1, _a;\n if (typeof property !== "string")\n return false;\n if (Array.isArray(value)) {\n var isValid = true;\n try {\n for (var value_1 = __values(value), value_1_1 = value_1.next(); !value_1_1.done; value_1_1 = value_1.next()) {\n var valueElement = value_1_1.value;\n if (Array.isArray(valueElement)) {\n return false;\n } else if (typeof valueElement === "object") {\n isValid = isValid && isValidObject(valueElement);\n } else if (!["number", "string"].includes(typeof valueElement)) {\n return false;\n }\n if (!isValid) {\n return false;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (value_1_1 && !value_1_1.done && (_a = value_1.return)) _a.call(value_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else if (value === null || value === void 0) {\n return false;\n } else if (typeof value === "object") {\n return isValidObject(value);\n } else if (!["number", "string", "boolean"].includes(typeof value)) {\n return false;\n }\n return true;\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/identify.js\n var Identify = (\n /** @class */\n (function() {\n function Identify2() {\n this._propertySet = /* @__PURE__ */ new Set();\n this._properties = {};\n }\n Identify2.prototype.getUserProperties = function() {\n return __assign({}, this._properties);\n };\n Identify2.prototype.set = function(property, value) {\n this._safeSet(IdentifyOperation.SET, property, value);\n return this;\n };\n Identify2.prototype.setOnce = function(property, value) {\n this._safeSet(IdentifyOperation.SET_ONCE, property, value);\n return this;\n };\n Identify2.prototype.append = function(property, value) {\n this._safeSet(IdentifyOperation.APPEND, property, value);\n return this;\n };\n Identify2.prototype.prepend = function(property, value) {\n this._safeSet(IdentifyOperation.PREPEND, property, value);\n return this;\n };\n Identify2.prototype.postInsert = function(property, value) {\n this._safeSet(IdentifyOperation.POSTINSERT, property, value);\n return this;\n };\n Identify2.prototype.preInsert = function(property, value) {\n this._safeSet(IdentifyOperation.PREINSERT, property, value);\n return this;\n };\n Identify2.prototype.remove = function(property, value) {\n this._safeSet(IdentifyOperation.REMOVE, property, value);\n return this;\n };\n Identify2.prototype.add = function(property, value) {\n this._safeSet(IdentifyOperation.ADD, property, value);\n return this;\n };\n Identify2.prototype.unset = function(property) {\n this._safeSet(IdentifyOperation.UNSET, property, UNSET_VALUE);\n return this;\n };\n Identify2.prototype.clearAll = function() {\n this._properties = {};\n this._properties[IdentifyOperation.CLEAR_ALL] = UNSET_VALUE;\n return this;\n };\n Identify2.prototype._safeSet = function(operation, property, value) {\n if (this._validate(operation, property, value)) {\n var userPropertyMap = this._properties[operation];\n if (userPropertyMap === void 0) {\n userPropertyMap = {};\n this._properties[operation] = userPropertyMap;\n }\n userPropertyMap[property] = value;\n this._propertySet.add(property);\n return true;\n }\n return false;\n };\n Identify2.prototype._validate = function(operation, property, value) {\n if (this._properties[IdentifyOperation.CLEAR_ALL] !== void 0) {\n return false;\n }\n if (this._propertySet.has(property)) {\n return false;\n }\n if (operation === IdentifyOperation.ADD) {\n return typeof value === "number";\n }\n if (operation !== IdentifyOperation.UNSET && operation !== IdentifyOperation.REMOVE) {\n return isValidProperties(property, value);\n }\n return true;\n };\n return Identify2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js\n var createTrackEvent = function(eventInput, eventProperties, eventOptions) {\n var baseEvent = typeof eventInput === "string" ? { event_type: eventInput } : eventInput;\n return __assign(__assign(__assign({}, baseEvent), eventOptions), eventProperties && { event_properties: eventProperties });\n };\n var createIdentifyEvent = function(identify2, eventOptions) {\n var identifyEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties() });\n return identifyEvent;\n };\n var createGroupIdentifyEvent = function(groupType, groupName, identify2, eventOptions) {\n var _a;\n var groupIdentify2 = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.GROUP_IDENTIFY, group_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupIdentify2;\n };\n var createGroupEvent = function(groupType, groupName, eventOptions) {\n var _a;\n var identify2 = new Identify();\n identify2.set(groupType, groupName);\n var groupEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupEvent;\n };\n var createRevenueEvent = function(revenue2, eventOptions) {\n return __assign(__assign({}, eventOptions), { event_type: SpecialEventType.REVENUE, event_properties: revenue2.getEventProperties() });\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js\n var buildResult = function(event, code, message) {\n if (code === void 0) {\n code = 0;\n }\n if (message === void 0) {\n message = Status.Unknown;\n }\n return { event, code, message };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/timeline.js\n var Timeline = (\n /** @class */\n (function() {\n function Timeline2(client) {\n this.client = client;\n this.queue = [];\n this.applying = false;\n this.plugins = [];\n }\n Timeline2.prototype.register = function(plugin, config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, plugin.setup(config, this.client)];\n case 1:\n _a.sent();\n this.plugins.push(plugin);\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.deregister = function(pluginName, config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var index, plugin;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n index = this.plugins.findIndex(function(plugin2) {\n return plugin2.name === pluginName;\n });\n if (index === -1) {\n config.loggerProvider.warn("Plugin with name ".concat(pluginName, " does not exist, skipping deregistration"));\n return [\n 2\n /*return*/\n ];\n }\n plugin = this.plugins[index];\n this.plugins.splice(index, 1);\n return [4, (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin)];\n case 1:\n _b.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.reset = function(client) {\n this.applying = false;\n var plugins = this.plugins;\n plugins.map(function(plugin) {\n var _a;\n return (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin);\n });\n this.plugins = [];\n this.client = client;\n };\n Timeline2.prototype.push = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n _this.queue.push([event, resolve]);\n _this.scheduleApply(0);\n });\n };\n Timeline2.prototype.scheduleApply = function(timeout) {\n var _this = this;\n if (this.applying)\n return;\n this.applying = true;\n setTimeout(function() {\n void _this.apply(_this.queue.shift()).then(function() {\n _this.applying = false;\n if (_this.queue.length > 0) {\n _this.scheduleApply(0);\n }\n });\n }, timeout);\n };\n Timeline2.prototype.apply = function(item) {\n return __awaiter(this, void 0, void 0, function() {\n var _a, event, _b, resolve, before, before_1, before_1_1, plugin, e, e_1_1, enrichment, enrichment_1, enrichment_1_1, plugin, e, e_2_1, destination, executeDestinations;\n var e_1, _c, e_2, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n if (!item) {\n return [\n 2\n /*return*/\n ];\n }\n _a = __read(item, 1), event = _a[0];\n _b = __read(item, 2), resolve = _b[1];\n before = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.BEFORE;\n });\n _e.label = 1;\n case 1:\n _e.trys.push([1, 6, 7, 8]);\n before_1 = __values(before), before_1_1 = before_1.next();\n _e.label = 2;\n case 2:\n if (!!before_1_1.done) return [3, 5];\n plugin = before_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 3:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 4;\n case 4:\n before_1_1 = before_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (before_1_1 && !before_1_1.done && (_c = before_1.return)) _c.call(before_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n enrichment = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.ENRICHMENT;\n });\n _e.label = 9;\n case 9:\n _e.trys.push([9, 14, 15, 16]);\n enrichment_1 = __values(enrichment), enrichment_1_1 = enrichment_1.next();\n _e.label = 10;\n case 10:\n if (!!enrichment_1_1.done) return [3, 13];\n plugin = enrichment_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 11:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 12;\n case 12:\n enrichment_1_1 = enrichment_1.next();\n return [3, 10];\n case 13:\n return [3, 16];\n case 14:\n e_2_1 = _e.sent();\n e_2 = { error: e_2_1 };\n return [3, 16];\n case 15:\n try {\n if (enrichment_1_1 && !enrichment_1_1.done && (_d = enrichment_1.return)) _d.call(enrichment_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 16:\n destination = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin2) {\n var eventClone = __assign({}, event);\n return plugin2.execute(eventClone).catch(function(e2) {\n return buildResult(eventClone, 0, String(e2));\n });\n });\n void Promise.all(executeDestinations).then(function(_a2) {\n var _b2 = __read(_a2, 1), result = _b2[0];\n resolve(result);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.flush = function() {\n return __awaiter(this, void 0, void 0, function() {\n var queue, destination, executeDestinations;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n queue = this.queue;\n this.queue = [];\n return [4, Promise.all(queue.map(function(item) {\n return _this.apply(item);\n }))];\n case 1:\n _a.sent();\n destination = this.plugins.filter(function(plugin) {\n return plugin.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin) {\n return plugin.flush && plugin.flush();\n });\n return [4, Promise.all(executeDestinations)];\n case 2:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return Timeline2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/messages.js\n var SUCCESS_MESSAGE = "Event tracked successfully";\n var UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";\n var MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";\n var OPT_OUT_MESSAGE = "Event skipped due to optOut config";\n var MISSING_API_KEY_MESSAGE = "Event rejected due to missing API key";\n var INVALID_API_KEY = "Invalid API key";\n var CLIENT_NOT_INITIALIZED = "Client not initialized";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js\n var returnWrapper = function(awaitable) {\n return {\n promise: awaitable || Promise.resolve()\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/core-client.js\n var AmplitudeCore = (\n /** @class */\n (function() {\n function AmplitudeCore2(name) {\n if (name === void 0) {\n name = "$default";\n }\n this.initializing = false;\n this.q = [];\n this.dispatchQ = [];\n this.logEvent = this.track.bind(this);\n this.timeline = new Timeline(this);\n this.name = name;\n }\n AmplitudeCore2.prototype._init = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n this.config = config;\n this.timeline.reset(this);\n return [4, this.runQueuedFunctions("q")];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.runQueuedFunctions = function(queueName) {\n return __awaiter(this, void 0, void 0, function() {\n var queuedFunctions, queuedFunctions_1, queuedFunctions_1_1, queuedFunction, e_1_1;\n var e_1, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n queuedFunctions = this[queueName];\n this[queueName] = [];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 6, 7, 8]);\n queuedFunctions_1 = __values(queuedFunctions), queuedFunctions_1_1 = queuedFunctions_1.next();\n _b.label = 2;\n case 2:\n if (!!queuedFunctions_1_1.done) return [3, 5];\n queuedFunction = queuedFunctions_1_1.value;\n return [4, queuedFunction()];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n queuedFunctions_1_1 = queuedFunctions_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _b.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (queuedFunctions_1_1 && !queuedFunctions_1_1.done && (_a = queuedFunctions_1.return)) _a.call(queuedFunctions_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.track = function(eventInput, eventProperties, eventOptions) {\n var event = createTrackEvent(eventInput, eventProperties, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.identify = function(identify2, eventOptions) {\n var event = createIdentifyEvent(identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n var event = createGroupIdentifyEvent(groupType, groupName, identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.setGroup = function(groupType, groupName, eventOptions) {\n var event = createGroupEvent(groupType, groupName, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.revenue = function(revenue2, eventOptions) {\n var event = createRevenueEvent(revenue2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.add = function(plugin) {\n if (!this.config) {\n this.q.push(this.add.bind(this, plugin));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.register(plugin, this.config));\n };\n AmplitudeCore2.prototype.remove = function(pluginName) {\n if (!this.config) {\n this.q.push(this.remove.bind(this, pluginName));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.deregister(pluginName, this.config));\n };\n AmplitudeCore2.prototype.dispatchWithCallback = function(event, callback) {\n if (!this.config) {\n return callback(buildResult(event, 0, CLIENT_NOT_INITIALIZED));\n }\n void this.process(event).then(callback);\n };\n AmplitudeCore2.prototype.dispatch = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n if (!this.config) {\n return [2, new Promise(function(resolve) {\n _this.dispatchQ.push(_this.dispatchWithCallback.bind(_this, event, resolve));\n })];\n }\n return [2, this.process(event)];\n });\n });\n };\n AmplitudeCore2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var result, e_2, message, result;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n if (this.config.optOut) {\n return [2, buildResult(event, 0, OPT_OUT_MESSAGE)];\n }\n return [4, this.timeline.push(event)];\n case 1:\n result = _a.sent();\n result.code === 200 ? this.config.loggerProvider.log(result.message) : this.config.loggerProvider.error(result.message);\n return [2, result];\n case 2:\n e_2 = _a.sent();\n this.config.loggerProvider.error(e_2);\n message = String(e_2);\n result = buildResult(event, 0, message);\n return [2, result];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.setOptOut = function(optOut) {\n if (!this.config) {\n this.q.push(this.setOptOut.bind(this, Boolean(optOut)));\n return;\n }\n this.config.optOut = Boolean(optOut);\n };\n AmplitudeCore2.prototype.flush = function() {\n return returnWrapper(this.timeline.flush());\n };\n return AmplitudeCore2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/revenue.js\n var Revenue = (\n /** @class */\n (function() {\n function Revenue2() {\n this.productId = "";\n this.quantity = 1;\n this.price = 0;\n }\n Revenue2.prototype.setProductId = function(productId) {\n this.productId = productId;\n return this;\n };\n Revenue2.prototype.setQuantity = function(quantity) {\n if (quantity > 0) {\n this.quantity = quantity;\n }\n return this;\n };\n Revenue2.prototype.setPrice = function(price) {\n this.price = price;\n return this;\n };\n Revenue2.prototype.setRevenueType = function(revenueType) {\n this.revenueType = revenueType;\n return this;\n };\n Revenue2.prototype.setCurrency = function(currency) {\n this.currency = currency;\n return this;\n };\n Revenue2.prototype.setRevenue = function(revenue2) {\n this.revenue = revenue2;\n return this;\n };\n Revenue2.prototype.setEventProperties = function(properties) {\n if (isValidObject(properties)) {\n this.properties = properties;\n }\n return this;\n };\n Revenue2.prototype.getEventProperties = function() {\n var eventProperties = this.properties ? __assign({}, this.properties) : {};\n eventProperties[RevenueProperty.REVENUE_PRODUCT_ID] = this.productId;\n eventProperties[RevenueProperty.REVENUE_QUANTITY] = this.quantity;\n eventProperties[RevenueProperty.REVENUE_PRICE] = this.price;\n eventProperties[RevenueProperty.REVENUE_TYPE] = this.revenueType;\n eventProperties[RevenueProperty.REVENUE_CURRENCY] = this.currency;\n eventProperties[RevenueProperty.REVENUE] = this.revenue;\n return eventProperties;\n };\n return Revenue2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js\n var chunk = function(arr, size) {\n var chunkSize = Math.max(size, 1);\n return arr.reduce(function(chunks, element, index) {\n var chunkIndex = Math.floor(index / chunkSize);\n if (!chunks[chunkIndex]) {\n chunks[chunkIndex] = [];\n }\n chunks[chunkIndex].push(element);\n return chunks;\n }, []);\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/logger.js\n var PREFIX = "Amplitude Logger ";\n var Logger = (\n /** @class */\n (function() {\n function Logger2() {\n this.logLevel = LogLevel.None;\n }\n Logger2.prototype.disable = function() {\n this.logLevel = LogLevel.None;\n };\n Logger2.prototype.enable = function(logLevel) {\n if (logLevel === void 0) {\n logLevel = LogLevel.Warn;\n }\n this.logLevel = logLevel;\n };\n Logger2.prototype.log = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Verbose) {\n return;\n }\n console.log("".concat(PREFIX, "[Log]: ").concat(args.join(" ")));\n };\n Logger2.prototype.warn = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Warn) {\n return;\n }\n console.warn("".concat(PREFIX, "[Warn]: ").concat(args.join(" ")));\n };\n Logger2.prototype.error = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Error) {\n return;\n }\n console.error("".concat(PREFIX, "[Error]: ").concat(args.join(" ")));\n };\n Logger2.prototype.debug = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Debug) {\n return;\n }\n console.log("".concat(PREFIX, "[Debug]: ").concat(args.join(" ")));\n };\n return Logger2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/config.js\n var getDefaultConfig = function() {\n return {\n flushMaxRetries: 12,\n flushQueueSize: 200,\n flushIntervalMillis: 1e4,\n instanceName: "$default_instance",\n logLevel: LogLevel.Warn,\n loggerProvider: new Logger(),\n optOut: false,\n serverUrl: AMPLITUDE_SERVER_URL,\n serverZone: ServerZone.US,\n useBatch: false\n };\n };\n var Config = (\n /** @class */\n (function() {\n function Config2(options) {\n var _a, _b, _c, _d;\n this._optOut = false;\n var defaultConfig = getDefaultConfig();\n this.apiKey = options.apiKey;\n this.flushIntervalMillis = (_a = options.flushIntervalMillis) !== null && _a !== void 0 ? _a : defaultConfig.flushIntervalMillis;\n this.flushMaxRetries = options.flushMaxRetries || defaultConfig.flushMaxRetries;\n this.flushQueueSize = options.flushQueueSize || defaultConfig.flushQueueSize;\n this.instanceName = options.instanceName || defaultConfig.instanceName;\n this.loggerProvider = options.loggerProvider || defaultConfig.loggerProvider;\n this.logLevel = (_b = options.logLevel) !== null && _b !== void 0 ? _b : defaultConfig.logLevel;\n this.minIdLength = options.minIdLength;\n this.plan = options.plan;\n this.ingestionMetadata = options.ingestionMetadata;\n this.optOut = (_c = options.optOut) !== null && _c !== void 0 ? _c : defaultConfig.optOut;\n this.serverUrl = options.serverUrl;\n this.serverZone = options.serverZone || defaultConfig.serverZone;\n this.storageProvider = options.storageProvider;\n this.transportProvider = options.transportProvider;\n this.useBatch = (_d = options.useBatch) !== null && _d !== void 0 ? _d : defaultConfig.useBatch;\n this.loggerProvider.enable(this.logLevel);\n var serverConfig = createServerConfig(options.serverUrl, options.serverZone, options.useBatch);\n this.serverZone = serverConfig.serverZone;\n this.serverUrl = serverConfig.serverUrl;\n }\n Object.defineProperty(Config2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n this._optOut = optOut;\n },\n enumerable: false,\n configurable: true\n });\n return Config2;\n })()\n );\n var getServerUrl = function(serverZone, useBatch) {\n if (serverZone === ServerZone.EU) {\n return useBatch ? EU_AMPLITUDE_BATCH_SERVER_URL : EU_AMPLITUDE_SERVER_URL;\n }\n return useBatch ? AMPLITUDE_BATCH_SERVER_URL : AMPLITUDE_SERVER_URL;\n };\n var createServerConfig = function(serverUrl, serverZone, useBatch) {\n if (serverUrl === void 0) {\n serverUrl = "";\n }\n if (serverZone === void 0) {\n serverZone = getDefaultConfig().serverZone;\n }\n if (useBatch === void 0) {\n useBatch = getDefaultConfig().useBatch;\n }\n if (serverUrl) {\n return { serverUrl, serverZone: void 0 };\n }\n var _serverZone = ["US", "EU"].includes(serverZone) ? serverZone : getDefaultConfig().serverZone;\n return {\n serverZone: _serverZone,\n serverUrl: getServerUrl(_serverZone, useBatch)\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js\n function getErrorMessage(error) {\n if (error instanceof Error)\n return error.message;\n return String(error);\n }\n function getResponseBodyString(res) {\n var responseBodyString = "";\n try {\n if ("body" in res) {\n responseBodyString = JSON.stringify(res.body);\n }\n } catch (_a) {\n }\n return responseBodyString;\n }\n var Destination = (\n /** @class */\n (function() {\n function Destination2() {\n this.name = "amplitude";\n this.type = PluginType.DESTINATION;\n this.retryTimeout = 1e3;\n this.throttleTimeout = 3e4;\n this.storageKey = "";\n this.scheduled = null;\n this.queue = [];\n }\n Destination2.prototype.setup = function(config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var unsent;\n var _this = this;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n this.config = config;\n this.storageKey = "".concat(STORAGE_PREFIX, "_").concat(this.config.apiKey.substring(0, 10));\n return [4, (_a = this.config.storageProvider) === null || _a === void 0 ? void 0 : _a.get(this.storageKey)];\n case 1:\n unsent = _b.sent();\n this.saveEvents();\n if (unsent && unsent.length > 0) {\n void Promise.all(unsent.map(function(event) {\n return _this.execute(event);\n })).catch();\n }\n return [2, Promise.resolve(void 0)];\n }\n });\n });\n };\n Destination2.prototype.execute = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n var context = {\n event,\n attempts: 0,\n callback: function(result) {\n return resolve(result);\n },\n timeout: 0\n };\n void _this.addToQueue(context);\n });\n };\n Destination2.prototype.addToQueue = function() {\n var _this = this;\n var list = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n list[_i] = arguments[_i];\n }\n var tryable = list.filter(function(context) {\n if (context.attempts < _this.config.flushMaxRetries) {\n context.attempts += 1;\n return true;\n }\n void _this.fulfillRequest([context], 500, MAX_RETRIES_EXCEEDED_MESSAGE);\n return false;\n });\n tryable.forEach(function(context) {\n _this.queue = _this.queue.concat(context);\n if (context.timeout === 0) {\n _this.schedule(_this.config.flushIntervalMillis);\n return;\n }\n setTimeout(function() {\n context.timeout = 0;\n _this.schedule(0);\n }, context.timeout);\n });\n this.saveEvents();\n };\n Destination2.prototype.schedule = function(timeout) {\n var _this = this;\n if (this.scheduled)\n return;\n this.scheduled = setTimeout(function() {\n void _this.flush(true).then(function() {\n if (_this.queue.length > 0) {\n _this.schedule(timeout);\n }\n });\n }, timeout);\n };\n Destination2.prototype.flush = function(useRetry) {\n if (useRetry === void 0) {\n useRetry = false;\n }\n return __awaiter(this, void 0, void 0, function() {\n var list, later, batches;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n list = [];\n later = [];\n this.queue.forEach(function(context) {\n return context.timeout === 0 ? list.push(context) : later.push(context);\n });\n this.queue = later;\n if (this.scheduled) {\n clearTimeout(this.scheduled);\n this.scheduled = null;\n }\n batches = chunk(list, this.config.flushQueueSize);\n return [4, Promise.all(batches.map(function(batch) {\n return _this.send(batch, useRetry);\n }))];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.send = function(list, useRetry) {\n if (useRetry === void 0) {\n useRetry = true;\n }\n return __awaiter(this, void 0, void 0, function() {\n var payload, serverUrl, res, e_1, errorMessage;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (!this.config.apiKey) {\n return [2, this.fulfillRequest(list, 400, MISSING_API_KEY_MESSAGE)];\n }\n payload = {\n api_key: this.config.apiKey,\n events: list.map(function(context) {\n var _a2 = context.event, extra = _a2.extra, eventWithoutExtra = __rest(_a2, ["extra"]);\n return eventWithoutExtra;\n }),\n options: {\n min_id_length: this.config.minIdLength\n }\n };\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n serverUrl = createServerConfig(this.config.serverUrl, this.config.serverZone, this.config.useBatch).serverUrl;\n return [4, this.config.transportProvider.send(serverUrl, payload)];\n case 2:\n res = _a.sent();\n if (res === null) {\n this.fulfillRequest(list, 0, UNEXPECTED_ERROR_MESSAGE);\n return [\n 2\n /*return*/\n ];\n }\n if (!useRetry) {\n if ("body" in res) {\n this.fulfillRequest(list, res.statusCode, "".concat(res.status, ": ").concat(getResponseBodyString(res)));\n } else {\n this.fulfillRequest(list, res.statusCode, res.status);\n }\n return [\n 2\n /*return*/\n ];\n }\n this.handleResponse(res, list);\n return [3, 4];\n case 3:\n e_1 = _a.sent();\n this.config.loggerProvider.error(e_1);\n errorMessage = getErrorMessage(e_1);\n this.fulfillRequest(list, 0, errorMessage);\n return [3, 4];\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.handleResponse = function(res, list) {\n var status = res.status;\n switch (status) {\n case Status.Success: {\n this.handleSuccessResponse(res, list);\n break;\n }\n case Status.Invalid: {\n this.handleInvalidResponse(res, list);\n break;\n }\n case Status.PayloadTooLarge: {\n this.handlePayloadTooLargeResponse(res, list);\n break;\n }\n case Status.RateLimit: {\n this.handleRateLimitResponse(res, list);\n break;\n }\n default: {\n this.config.loggerProvider.warn(`{code: 0, error: "Status \'`.concat(status, "\' provided for ").concat(list.length, \' events"}\'));\n this.handleOtherResponse(list);\n break;\n }\n }\n };\n Destination2.prototype.handleSuccessResponse = function(res, list) {\n this.fulfillRequest(list, res.statusCode, SUCCESS_MESSAGE);\n };\n Destination2.prototype.handleInvalidResponse = function(res, list) {\n var _this = this;\n if (res.body.missingField || res.body.error.startsWith(INVALID_API_KEY)) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n var dropIndex = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(Object.values(res.body.eventsWithInvalidFields)), false), __read(Object.values(res.body.eventsWithMissingFields)), false), __read(Object.values(res.body.eventsWithInvalidIdLengths)), false), __read(res.body.silencedEvents), false).flat();\n var dropIndexSet = new Set(dropIndex);\n var retry = list.filter(function(context, index) {\n if (dropIndexSet.has(index)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handlePayloadTooLargeResponse = function(res, list) {\n if (list.length === 1) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n this.config.loggerProvider.warn(getResponseBodyString(res));\n this.config.flushQueueSize /= 2;\n this.addToQueue.apply(this, __spreadArray([], __read(list), false));\n };\n Destination2.prototype.handleRateLimitResponse = function(res, list) {\n var _this = this;\n var dropUserIds = Object.keys(res.body.exceededDailyQuotaUsers);\n var dropDeviceIds = Object.keys(res.body.exceededDailyQuotaDevices);\n var throttledIndex = res.body.throttledEvents;\n var dropUserIdsSet = new Set(dropUserIds);\n var dropDeviceIdsSet = new Set(dropDeviceIds);\n var throttledIndexSet = new Set(throttledIndex);\n var retry = list.filter(function(context, index) {\n if (context.event.user_id && dropUserIdsSet.has(context.event.user_id) || context.event.device_id && dropDeviceIdsSet.has(context.event.device_id)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n if (throttledIndexSet.has(index)) {\n context.timeout = _this.throttleTimeout;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handleOtherResponse = function(list) {\n var _this = this;\n this.addToQueue.apply(this, __spreadArray([], __read(list.map(function(context) {\n context.timeout = context.attempts * _this.retryTimeout;\n return context;\n })), false));\n };\n Destination2.prototype.fulfillRequest = function(list, code, message) {\n this.saveEvents();\n list.forEach(function(context) {\n return context.callback(buildResult(context.event, code, message));\n });\n };\n Destination2.prototype.saveEvents = function() {\n if (!this.config.storageProvider) {\n return;\n }\n var events = Array.from(this.queue.map(function(context) {\n return context.event;\n }));\n void this.config.storageProvider.set(this.storageKey, events);\n };\n return Destination2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js\n var getStacktrace = function(ignoreDepth) {\n if (ignoreDepth === void 0) {\n ignoreDepth = 0;\n }\n var trace = new Error().stack || "";\n return trace.split("\\n").slice(2 + ignoreDepth).map(function(text) {\n return text.trim();\n });\n };\n var getClientLogConfig = function(client) {\n return function() {\n var _a = __assign({}, client.config), logger = _a.loggerProvider, logLevel = _a.logLevel;\n return {\n logger,\n logLevel\n };\n };\n };\n var getValueByStringPath = function(obj, path) {\n var e_1, _a;\n path = path.replace(/\\[(\\w+)\\]/g, ".$1");\n path = path.replace(/^\\./, "");\n try {\n for (var _b = __values(path.split(".")), _c = _b.next(); !_c.done; _c = _b.next()) {\n var attr = _c.value;\n if (attr in obj) {\n obj = obj[attr];\n } else {\n return;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n return obj;\n };\n var getClientStates = function(client, paths) {\n return function() {\n var e_2, _a;\n var res = {};\n try {\n for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var path = paths_1_1.value;\n res[path] = getValueByStringPath(client, path);\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n return res;\n };\n };\n var debugWrapper = function(fn, fnName, getLogConfig, getStates, fnContext) {\n if (fnContext === void 0) {\n fnContext = null;\n }\n return function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var _a = getLogConfig(), logger = _a.logger, logLevel = _a.logLevel;\n if (logLevel && logLevel < LogLevel.Debug || !logLevel || !logger) {\n return fn.apply(fnContext, args);\n }\n var debugContext = {\n type: "invoke public method",\n name: fnName,\n args,\n stacktrace: getStacktrace(1),\n time: {\n start: (/* @__PURE__ */ new Date()).toISOString()\n },\n states: {}\n };\n if (getStates && debugContext.states) {\n debugContext.states.before = getStates();\n }\n var result = fn.apply(fnContext, args);\n if (result && result.promise) {\n result.promise.then(function() {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n });\n } else {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n }\n return result;\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js\n var UUID = function(a) {\n return a ? (\n // a random number from 0 to 15\n (a ^ // unless b is 8,\n Math.random() * // in which case\n 16 >> // a random number from\n a / 4).toString(16)\n ) : (\n // or otherwise a concatenated string:\n (String(1e7) + // 10000000 +\n String(-1e3) + // -1000 +\n String(-4e3) + // -4000 +\n String(-8e3) + // -80000000 +\n String(-1e11)).replace(\n // replacing\n /[018]/g,\n // zeroes, ones, and eights with\n UUID\n )\n );\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js\n var MemoryStorage = (\n /** @class */\n (function() {\n function MemoryStorage2() {\n this.memoryStorage = /* @__PURE__ */ new Map();\n }\n MemoryStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, true];\n });\n });\n };\n MemoryStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, this.memoryStorage.get(key)];\n });\n });\n };\n MemoryStorage2.prototype.getRaw = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.get(key)];\n case 1:\n value = _a.sent();\n return [2, value ? JSON.stringify(value) : void 0];\n }\n });\n });\n };\n MemoryStorage2.prototype.set = function(key, value) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.set(key, value);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.delete(key);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.clear();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return MemoryStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/transports/base.js\n var BaseTransport = (\n /** @class */\n (function() {\n function BaseTransport2() {\n }\n BaseTransport2.prototype.send = function(_serverUrl, _payload) {\n return Promise.resolve(null);\n };\n BaseTransport2.prototype.buildResponse = function(responseJSON) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;\n if (typeof responseJSON !== "object") {\n return null;\n }\n var statusCode = responseJSON.code || 0;\n var status = this.buildStatus(statusCode);\n switch (status) {\n case Status.Success:\n return {\n status,\n statusCode,\n body: {\n eventsIngested: (_a = responseJSON.events_ingested) !== null && _a !== void 0 ? _a : 0,\n payloadSizeBytes: (_b = responseJSON.payload_size_bytes) !== null && _b !== void 0 ? _b : 0,\n serverUploadTime: (_c = responseJSON.server_upload_time) !== null && _c !== void 0 ? _c : 0\n }\n };\n case Status.Invalid:\n return {\n status,\n statusCode,\n body: {\n error: (_d = responseJSON.error) !== null && _d !== void 0 ? _d : "",\n missingField: (_e = responseJSON.missing_field) !== null && _e !== void 0 ? _e : "",\n eventsWithInvalidFields: (_f = responseJSON.events_with_invalid_fields) !== null && _f !== void 0 ? _f : {},\n eventsWithMissingFields: (_g = responseJSON.events_with_missing_fields) !== null && _g !== void 0 ? _g : {},\n eventsWithInvalidIdLengths: (_h = responseJSON.events_with_invalid_id_lengths) !== null && _h !== void 0 ? _h : {},\n epsThreshold: (_j = responseJSON.eps_threshold) !== null && _j !== void 0 ? _j : 0,\n exceededDailyQuotaDevices: (_k = responseJSON.exceeded_daily_quota_devices) !== null && _k !== void 0 ? _k : {},\n silencedDevices: (_l = responseJSON.silenced_devices) !== null && _l !== void 0 ? _l : [],\n silencedEvents: (_m = responseJSON.silenced_events) !== null && _m !== void 0 ? _m : [],\n throttledDevices: (_o = responseJSON.throttled_devices) !== null && _o !== void 0 ? _o : {},\n throttledEvents: (_p = responseJSON.throttled_events) !== null && _p !== void 0 ? _p : []\n }\n };\n case Status.PayloadTooLarge:\n return {\n status,\n statusCode,\n body: {\n error: (_q = responseJSON.error) !== null && _q !== void 0 ? _q : ""\n }\n };\n case Status.RateLimit:\n return {\n status,\n statusCode,\n body: {\n error: (_r = responseJSON.error) !== null && _r !== void 0 ? _r : "",\n epsThreshold: (_s = responseJSON.eps_threshold) !== null && _s !== void 0 ? _s : 0,\n throttledDevices: (_t = responseJSON.throttled_devices) !== null && _t !== void 0 ? _t : {},\n throttledUsers: (_u = responseJSON.throttled_users) !== null && _u !== void 0 ? _u : {},\n exceededDailyQuotaDevices: (_v = responseJSON.exceeded_daily_quota_devices) !== null && _v !== void 0 ? _v : {},\n exceededDailyQuotaUsers: (_w = responseJSON.exceeded_daily_quota_users) !== null && _w !== void 0 ? _w : {},\n throttledEvents: (_x = responseJSON.throttled_events) !== null && _x !== void 0 ? _x : []\n }\n };\n case Status.Timeout:\n default:\n return {\n status,\n statusCode\n };\n }\n };\n BaseTransport2.prototype.buildStatus = function(code) {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n if (code === 429) {\n return Status.RateLimit;\n }\n if (code === 413) {\n return Status.PayloadTooLarge;\n }\n if (code === 408) {\n return Status.Timeout;\n }\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n if (code >= 500) {\n return Status.Failed;\n }\n return Status.Unknown;\n };\n return BaseTransport2;\n })()\n );\n\n // node_modules/@amplitude/analytics-connector/dist/analytics-connector.esm.js\n var ApplicationContextProviderImpl = (\n /** @class */\n (function() {\n function ApplicationContextProviderImpl2() {\n }\n ApplicationContextProviderImpl2.prototype.getApplicationContext = function() {\n return {\n versionName: this.versionName,\n language: getLanguage(),\n platform: "Web",\n os: void 0,\n deviceModel: void 0\n };\n };\n return ApplicationContextProviderImpl2;\n })()\n );\n var getLanguage = function() {\n return typeof navigator !== "undefined" && (navigator.languages && navigator.languages[0] || navigator.language) || "";\n };\n var EventBridgeImpl = (\n /** @class */\n (function() {\n function EventBridgeImpl2() {\n this.queue = [];\n }\n EventBridgeImpl2.prototype.logEvent = function(event) {\n if (!this.receiver) {\n if (this.queue.length < 512) {\n this.queue.push(event);\n }\n } else {\n this.receiver(event);\n }\n };\n EventBridgeImpl2.prototype.setEventReceiver = function(receiver) {\n this.receiver = receiver;\n if (this.queue.length > 0) {\n this.queue.forEach(function(event) {\n receiver(event);\n });\n this.queue = [];\n }\n };\n return EventBridgeImpl2;\n })()\n );\n var __assign2 = function() {\n __assign2 = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign2.apply(this, arguments);\n };\n function __values2(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read2(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = {\n error\n };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n var isEqual = function(obj1, obj2) {\n var e_1, _a;\n var primitive = ["string", "number", "boolean", "undefined"];\n var typeA = typeof obj1;\n var typeB = typeof obj2;\n if (typeA !== typeB) {\n return false;\n }\n try {\n for (var primitive_1 = __values2(primitive), primitive_1_1 = primitive_1.next(); !primitive_1_1.done; primitive_1_1 = primitive_1.next()) {\n var p = primitive_1_1.value;\n if (p === typeA) {\n return obj1 === obj2;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (primitive_1_1 && !primitive_1_1.done && (_a = primitive_1.return)) _a.call(primitive_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n if (obj1 == null && obj2 == null) {\n return true;\n } else if (obj1 == null || obj2 == null) {\n return false;\n }\n if (obj1.length !== obj2.length) {\n return false;\n }\n var isArrayA = Array.isArray(obj1);\n var isArrayB = Array.isArray(obj2);\n if (isArrayA !== isArrayB) {\n return false;\n }\n if (isArrayA && isArrayB) {\n for (var i = 0; i < obj1.length; i++) {\n if (!isEqual(obj1[i], obj2[i])) {\n return false;\n }\n }\n } else {\n var sorted1 = Object.keys(obj1).sort();\n var sorted2 = Object.keys(obj2).sort();\n if (!isEqual(sorted1, sorted2)) {\n return false;\n }\n var result_1 = true;\n Object.keys(obj1).forEach(function(key) {\n if (!isEqual(obj1[key], obj2[key])) {\n result_1 = false;\n }\n });\n return result_1;\n }\n return true;\n };\n var ID_OP_SET = "$set";\n var ID_OP_UNSET = "$unset";\n var ID_OP_CLEAR_ALL = "$clearAll";\n if (!Object.entries) {\n Object.entries = function(obj) {\n var ownProps = Object.keys(obj);\n var i = ownProps.length;\n var resArray = new Array(i);\n while (i--) {\n resArray[i] = [ownProps[i], obj[ownProps[i]]];\n }\n return resArray;\n };\n }\n var IdentityStoreImpl = (\n /** @class */\n (function() {\n function IdentityStoreImpl2() {\n this.identity = { userProperties: {} };\n this.listeners = /* @__PURE__ */ new Set();\n }\n IdentityStoreImpl2.prototype.editIdentity = function() {\n var self2 = this;\n var actingUserProperties = __assign2({}, this.identity.userProperties);\n var actingIdentity = __assign2(__assign2({}, this.identity), { userProperties: actingUserProperties });\n return {\n setUserId: function(userId) {\n actingIdentity.userId = userId;\n return this;\n },\n setDeviceId: function(deviceId) {\n actingIdentity.deviceId = deviceId;\n return this;\n },\n setUserProperties: function(userProperties) {\n actingIdentity.userProperties = userProperties;\n return this;\n },\n setOptOut: function(optOut) {\n actingIdentity.optOut = optOut;\n return this;\n },\n updateUserProperties: function(actions) {\n var e_1, _a, e_2, _b, e_3, _c;\n var actingProperties = actingIdentity.userProperties || {};\n try {\n for (var _d = __values2(Object.entries(actions)), _e = _d.next(); !_e.done; _e = _d.next()) {\n var _f = __read2(_e.value, 2), action = _f[0], properties = _f[1];\n switch (action) {\n case ID_OP_SET:\n try {\n for (var _g = (e_2 = void 0, __values2(Object.entries(properties))), _h = _g.next(); !_h.done; _h = _g.next()) {\n var _j = __read2(_h.value, 2), key = _j[0], value = _j[1];\n actingProperties[key] = value;\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n break;\n case ID_OP_UNSET:\n try {\n for (var _k = (e_3 = void 0, __values2(Object.keys(properties))), _l = _k.next(); !_l.done; _l = _k.next()) {\n var key = _l.value;\n delete actingProperties[key];\n }\n } catch (e_3_1) {\n e_3 = { error: e_3_1 };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n break;\n case ID_OP_CLEAR_ALL:\n actingProperties = {};\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n actingIdentity.userProperties = actingProperties;\n return this;\n },\n commit: function() {\n self2.setIdentity(actingIdentity);\n return this;\n }\n };\n };\n IdentityStoreImpl2.prototype.getIdentity = function() {\n return __assign2({}, this.identity);\n };\n IdentityStoreImpl2.prototype.setIdentity = function(identity) {\n var originalIdentity = __assign2({}, this.identity);\n this.identity = __assign2({}, identity);\n if (!isEqual(originalIdentity, this.identity)) {\n this.listeners.forEach(function(listener) {\n listener(identity);\n });\n }\n };\n IdentityStoreImpl2.prototype.addIdentityListener = function(listener) {\n this.listeners.add(listener);\n };\n IdentityStoreImpl2.prototype.removeIdentityListener = function(listener) {\n this.listeners.delete(listener);\n };\n return IdentityStoreImpl2;\n })()\n );\n var safeGlobal = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self;\n var AnalyticsConnector = (\n /** @class */\n (function() {\n function AnalyticsConnector2() {\n this.identityStore = new IdentityStoreImpl();\n this.eventBridge = new EventBridgeImpl();\n this.applicationContextProvider = new ApplicationContextProviderImpl();\n }\n AnalyticsConnector2.getInstance = function(instanceName) {\n if (!safeGlobal["analyticsConnectorInstances"]) {\n safeGlobal["analyticsConnectorInstances"] = {};\n }\n if (!safeGlobal["analyticsConnectorInstances"][instanceName]) {\n safeGlobal["analyticsConnectorInstances"][instanceName] = new AnalyticsConnector2();\n }\n return safeGlobal["analyticsConnectorInstances"][instanceName];\n };\n return AnalyticsConnector2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/analytics-connector.js\n var getAnalyticsConnector = function(instanceName) {\n if (instanceName === void 0) {\n instanceName = "$default_instance";\n }\n return AnalyticsConnector.getInstance(instanceName);\n };\n var setConnectorUserId = function(userId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setUserId(userId).commit();\n };\n var setConnectorDeviceId = function(deviceId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setDeviceId(deviceId).commit();\n };\n var setConnectorOptOut = function(optOut, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setOptOut(optOut).commit();\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/global-scope.js\n var getGlobalScope = function() {\n if (typeof globalThis !== "undefined") {\n return globalThis;\n }\n if (typeof window !== "undefined") {\n return window;\n }\n if (typeof self !== "undefined") {\n return self;\n }\n if (typeof global !== "undefined") {\n return global;\n }\n return void 0;\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/query-params.js\n var getQueryParams = function() {\n var _a;\n var globalScope = getGlobalScope();\n if (!((_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.location) === null || _a === void 0 ? void 0 : _a.search)) {\n return {};\n }\n var pairs = globalScope.location.search.substring(1).split("&").filter(Boolean);\n var params = pairs.reduce(function(acc, curr) {\n var query = curr.split("=", 2);\n var key = tryDecodeURIComponent(query[0]);\n var value = tryDecodeURIComponent(query[1]);\n if (!value) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n return params;\n };\n var tryDecodeURIComponent = function(value) {\n if (value === void 0) {\n value = "";\n }\n try {\n return decodeURIComponent(value);\n } catch (_a) {\n return "";\n }\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/constants.js\n var UTM_CAMPAIGN = "utm_campaign";\n var UTM_CONTENT = "utm_content";\n var UTM_ID = "utm_id";\n var UTM_MEDIUM = "utm_medium";\n var UTM_SOURCE = "utm_source";\n var UTM_TERM = "utm_term";\n var DCLID = "dclid";\n var FBCLID = "fbclid";\n var GBRAID = "gbraid";\n var GCLID = "gclid";\n var KO_CLICK_ID = "ko_click_id";\n var LI_FAT_ID = "li_fat_id";\n var MSCLKID = "msclkid";\n var RDT_CID = "rtd_cid";\n var TTCLID = "ttclid";\n var TWCLID = "twclid";\n var WBRAID = "wbraid";\n var BASE_CAMPAIGN = {\n utm_campaign: void 0,\n utm_content: void 0,\n utm_id: void 0,\n utm_medium: void 0,\n utm_source: void 0,\n utm_term: void 0,\n referrer: void 0,\n referring_domain: void 0,\n dclid: void 0,\n gbraid: void 0,\n gclid: void 0,\n fbclid: void 0,\n ko_click_id: void 0,\n li_fat_id: void 0,\n msclkid: void 0,\n rtd_cid: void 0,\n ttclid: void 0,\n twclid: void 0,\n wbraid: void 0\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/campaign-parser.js\n var CampaignParser = (\n /** @class */\n (function() {\n function CampaignParser2() {\n }\n CampaignParser2.prototype.parse = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, __assign(__assign(__assign(__assign({}, BASE_CAMPAIGN), this.getUtmParam()), this.getReferrer()), this.getClickIds())];\n });\n });\n };\n CampaignParser2.prototype.getUtmParam = function() {\n var params = getQueryParams();\n var utmCampaign = params[UTM_CAMPAIGN];\n var utmContent = params[UTM_CONTENT];\n var utmId = params[UTM_ID];\n var utmMedium = params[UTM_MEDIUM];\n var utmSource = params[UTM_SOURCE];\n var utmTerm = params[UTM_TERM];\n return {\n utm_campaign: utmCampaign,\n utm_content: utmContent,\n utm_id: utmId,\n utm_medium: utmMedium,\n utm_source: utmSource,\n utm_term: utmTerm\n };\n };\n CampaignParser2.prototype.getReferrer = function() {\n var _a, _b;\n var data = {\n referrer: void 0,\n referring_domain: void 0\n };\n try {\n data.referrer = document.referrer || void 0;\n data.referring_domain = (_b = (_a = data.referrer) === null || _a === void 0 ? void 0 : _a.split("/")[2]) !== null && _b !== void 0 ? _b : void 0;\n } catch (_c) {\n }\n return data;\n };\n CampaignParser2.prototype.getClickIds = function() {\n var _a;\n var params = getQueryParams();\n return _a = {}, _a[DCLID] = params[DCLID], _a[FBCLID] = params[FBCLID], _a[GBRAID] = params[GBRAID], _a[GCLID] = params[GCLID], _a[KO_CLICK_ID] = params[KO_CLICK_ID], _a[LI_FAT_ID] = params[LI_FAT_ID], _a[MSCLKID] = params[MSCLKID], _a[RDT_CID] = params[RDT_CID], _a[TTCLID] = params[TTCLID], _a[TWCLID] = params[TWCLID], _a[WBRAID] = params[WBRAID], _a;\n };\n return CampaignParser2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/cookie-name.js\n var getCookieName = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var getOldCookieName = function(apiKey) {\n return "".concat(AMPLITUDE_PREFIX.toLowerCase(), "_").concat(apiKey.substring(0, 6));\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/default-tracking.js\n var isFileDownloadTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.fileDownloads) {\n return true;\n }\n return false;\n };\n var isFormInteractionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.formInteractions) {\n return true;\n }\n return false;\n };\n var isPageViewTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if ((defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) === true || (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) && typeof defaultTracking.pageViews === "object") {\n return true;\n }\n return false;\n };\n var isSessionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.sessions) {\n return true;\n }\n return false;\n };\n var getPageViewTrackingConfig = function(config) {\n var _a;\n var trackOn = ((_a = config.attribution) === null || _a === void 0 ? void 0 : _a.trackPageViews) ? "attribution" : function() {\n return false;\n };\n var trackHistoryChanges = void 0;\n var eventType = "Page View";\n var isDefaultPageViewTrackingEnabled = isPageViewTrackingEnabled(config.defaultTracking);\n if (isDefaultPageViewTrackingEnabled) {\n trackOn = void 0;\n eventType = void 0;\n if (config.defaultTracking && typeof config.defaultTracking === "object" && config.defaultTracking.pageViews && typeof config.defaultTracking.pageViews === "object") {\n if ("trackOn" in config.defaultTracking.pageViews) {\n trackOn = config.defaultTracking.pageViews.trackOn;\n }\n if ("trackHistoryChanges" in config.defaultTracking.pageViews) {\n trackHistoryChanges = config.defaultTracking.pageViews.trackHistoryChanges;\n }\n if ("eventType" in config.defaultTracking.pageViews && config.defaultTracking.pageViews.eventType) {\n eventType = config.defaultTracking.pageViews.eventType;\n }\n }\n }\n return {\n trackOn,\n trackHistoryChanges,\n eventType\n };\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/language.js\n var getLanguage2 = function() {\n var _a, _b, _c, _d;\n if (typeof navigator === "undefined")\n return "";\n var userLanguage = navigator.userLanguage;\n return (_d = (_c = (_b = (_a = navigator.languages) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : navigator.language) !== null && _c !== void 0 ? _c : userLanguage) !== null && _d !== void 0 ? _d : "";\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/plugins/identity.js\n var IdentityEventSender = (\n /** @class */\n (function() {\n function IdentityEventSender2() {\n this.name = "identity";\n this.type = PluginType.BEFORE;\n this.identityStore = getAnalyticsConnector().identityStore;\n }\n IdentityEventSender2.prototype.execute = function(context) {\n return __awaiter(this, void 0, void 0, function() {\n var userProperties;\n return __generator(this, function(_a) {\n userProperties = context.user_properties;\n if (userProperties) {\n this.identityStore.editIdentity().updateUserProperties(userProperties).commit();\n }\n return [2, context];\n });\n });\n };\n IdentityEventSender2.prototype.setup = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (config.instanceName) {\n this.identityStore = getAnalyticsConnector(config.instanceName).identityStore;\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return IdentityEventSender2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/storage/cookie.js\n var CookieStorage = (\n /** @class */\n (function() {\n function CookieStorage2(options) {\n this.options = __assign({}, options);\n }\n CookieStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var testStrorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n CookieStorage2.testValue = String(Date.now());\n testStrorage = new CookieStorage2(this.options);\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStrorage.set(testKey, CookieStorage2.testValue)];\n case 2:\n _b.sent();\n return [4, testStrorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === CookieStorage2.testValue];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStrorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.getRaw(key)];\n case 1:\n value = _a.sent();\n if (!value) {\n return [2, void 0];\n }\n try {\n try {\n value = decodeURIComponent(atob(value));\n } catch (_b) {\n }\n return [2, JSON.parse(value)];\n } catch (_c) {\n return [2, void 0];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var globalScope, cookie, match;\n return __generator(this, function(_b) {\n globalScope = getGlobalScope();\n cookie = (_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.document.cookie.split("; ")) !== null && _a !== void 0 ? _a : [];\n match = cookie.find(function(c) {\n return c.indexOf(key + "=") === 0;\n });\n if (!match) {\n return [2, void 0];\n }\n return [2, match.substring(key.length + 1)];\n });\n });\n };\n CookieStorage2.prototype.set = function(key, value) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var expirationDays, expires, expireDate, date, str, globalScope;\n return __generator(this, function(_b) {\n try {\n expirationDays = (_a = this.options.expirationDays) !== null && _a !== void 0 ? _a : 0;\n expires = value !== null ? expirationDays : -1;\n expireDate = void 0;\n if (expires) {\n date = /* @__PURE__ */ new Date();\n date.setTime(date.getTime() + expires * 24 * 60 * 60 * 1e3);\n expireDate = date;\n }\n str = "".concat(key, "=").concat(btoa(encodeURIComponent(JSON.stringify(value))));\n if (expireDate) {\n str += "; expires=".concat(expireDate.toUTCString());\n }\n str += "; path=/";\n if (this.options.domain) {\n str += "; domain=".concat(this.options.domain);\n }\n if (this.options.secure) {\n str += "; Secure";\n }\n if (this.options.sameSite) {\n str += "; SameSite=".concat(this.options.sameSite);\n }\n globalScope = getGlobalScope();\n if (globalScope) {\n globalScope.document.cookie = str;\n }\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n CookieStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.set(key, null)];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return CookieStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/transports/fetch.js\n var FetchTransport = (\n /** @class */\n (function(_super) {\n __extends(FetchTransport2, _super);\n function FetchTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FetchTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var options, response, responseText;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (typeof fetch === "undefined") {\n throw new Error("FetchTransport is not supported");\n }\n options = {\n headers: {\n "Content-Type": "application/json",\n Accept: "*/*"\n },\n body: JSON.stringify(payload),\n method: "POST"\n };\n return [4, fetch(serverUrl, options)];\n case 1:\n response = _a.sent();\n return [4, response.text()];\n case 2:\n responseText = _a.sent();\n try {\n return [2, this.buildResponse(JSON.parse(responseText))];\n } catch (_b) {\n return [2, this.buildResponse({ code: response.status })];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return FetchTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js\n var omitUndefined = function(input) {\n var obj = {};\n for (var key in input) {\n var val = input[key];\n if (val) {\n obj[key] = val;\n }\n }\n return obj;\n };\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js\n var pageViewTrackingPlugin = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var globalScope = getGlobalScope();\n var loggerProvider = void 0;\n var pushState;\n var _a = __read(args, 2), clientOrOptions = _a[0], configOrUndefined = _a[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var createPageViewEvent = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a2;\n var _b;\n var _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n _b = {\n event_type: (_c = options.eventType) !== null && _c !== void 0 ? _c : "Page View"\n };\n _a2 = [{}];\n return [4, getCampaignParams()];\n case 1:\n return [2, (_b.event_properties = __assign.apply(void 0, [__assign.apply(void 0, _a2.concat([_d.sent()])), { page_domain: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.hostname || ""\n ), page_location: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href || ""\n ), page_path: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.pathname || ""\n ), page_title: (\n /* istanbul ignore next */\n typeof document !== "undefined" && document.title || ""\n ), page_url: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href.split("?")[0] || ""\n ) }]), _b)];\n }\n });\n });\n };\n var shouldTrackOnPageLoad = function() {\n return typeof options.trackOn === "undefined" || typeof options.trackOn === "function" && options.trackOn();\n };\n var previousURL = typeof location !== "undefined" ? location.href : null;\n var trackHistoryPageView = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var newURL, shouldTrackPageView, _a2, _b, _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n newURL = location.href;\n shouldTrackPageView = shouldTrackHistoryPageView(options.trackHistoryChanges, newURL, previousURL || "") && shouldTrackOnPageLoad();\n previousURL = newURL;\n if (!shouldTrackPageView) return [3, 4];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Tracking page view event");\n if (!(amplitude === null || amplitude === void 0)) return [3, 1];\n _a2 = void 0;\n return [3, 3];\n case 1:\n _c = (_b = amplitude).track;\n return [4, createPageViewEvent()];\n case 2:\n _a2 = _c.apply(_b, [_d.sent()]);\n _d.label = 3;\n case 3:\n _a2;\n _d.label = 4;\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n var trackHistoryPageViewWrapper = function() {\n void trackHistoryPageView();\n };\n var plugin = {\n name: "page-view-tracking",\n type: PluginType.ENRICHMENT,\n setup: function(config, client) {\n return __awaiter(void 0, void 0, void 0, function() {\n var receivedType, _a2, _b;\n var _c, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n loggerProvider = config.loggerProvider;\n loggerProvider.log("Installing @amplitude/plugin-page-view-tracking-browser");\n options.trackOn = ((_c = config.attribution) === null || _c === void 0 ? void 0 : _c.trackPageViews) ? "attribution" : options.trackOn;\n if (!client && ((_d = config.attribution) === null || _d === void 0 ? void 0 : _d.trackPageViews)) {\n loggerProvider.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser.");\n config.attribution.trackPageViews = false;\n }\n if (options.trackHistoryChanges && globalScope) {\n globalScope.addEventListener("popstate", trackHistoryPageViewWrapper);\n pushState = globalScope.history.pushState;\n globalScope.history.pushState = new Proxy(globalScope.history.pushState, {\n apply: function(target, thisArg, _a3) {\n var _b2 = __read(_a3, 3), state = _b2[0], unused = _b2[1], url = _b2[2];\n target.apply(thisArg, [state, unused, url]);\n void trackHistoryPageView();\n }\n });\n }\n if (!shouldTrackOnPageLoad()) return [3, 2];\n loggerProvider.log("Tracking page view event");\n _b = (_a2 = amplitude).track;\n return [4, createPageViewEvent()];\n case 1:\n _b.apply(_a2, [_e.sent()]);\n _e.label = 2;\n case 2:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n var pageViewEvent;\n return __generator(this, function(_a2) {\n switch (_a2.label) {\n case 0:\n if (!(options.trackOn === "attribution" && isCampaignEvent(event))) return [3, 2];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Enriching campaign event to page view event with campaign parameters");\n return [4, createPageViewEvent()];\n case 1:\n pageViewEvent = _a2.sent();\n event.event_type = pageViewEvent.event_type;\n event.event_properties = __assign(__assign({}, event.event_properties), pageViewEvent.event_properties);\n _a2.label = 2;\n case 2:\n return [2, event];\n }\n });\n });\n },\n teardown: function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n if (globalScope) {\n globalScope.removeEventListener("popstate", trackHistoryPageViewWrapper);\n if (pushState) {\n globalScope.history.pushState = pushState;\n }\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n }\n };\n plugin.__trackHistoryPageView = trackHistoryPageView;\n return plugin;\n };\n var getCampaignParams = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _a = omitUndefined;\n return [4, new CampaignParser().parse()];\n case 1:\n return [2, _a.apply(void 0, [_b.sent()])];\n }\n });\n });\n };\n var isCampaignEvent = function(event) {\n if (event.event_type === "$identify" && event.user_properties) {\n var properties = event.user_properties;\n var $set = properties[IdentifyOperation.SET] || {};\n var $unset = properties[IdentifyOperation.UNSET] || {};\n var userProperties_1 = __spreadArray(__spreadArray([], __read(Object.keys($set)), false), __read(Object.keys($unset)), false);\n return Object.keys(BASE_CAMPAIGN).every(function(value) {\n return userProperties_1.includes(value);\n });\n }\n return false;\n };\n var shouldTrackHistoryPageView = function(trackingOption, newURL, oldURL) {\n switch (trackingOption) {\n case "pathOnly":\n return newURL.split("?")[0] !== oldURL.split("?")[0];\n default:\n return newURL !== oldURL;\n }\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/helpers.js\n var getStorageKey = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var domainWithoutSubdomain = function(domain) {\n var parts = domain.split(".");\n if (parts.length <= 2) {\n return domain;\n }\n return parts.slice(parts.length - 2, parts.length).join(".");\n };\n var isNewCampaign = function(current, previous, options) {\n var _a;\n var referrer = current.referrer, referring_domain = current.referring_domain, currentCampaign = __rest(current, ["referrer", "referring_domain"]);\n var _b = previous || {}, _previous_referrer = _b.referrer, prevReferringDomain = _b.referring_domain, previousCampaign = __rest(_b, ["referrer", "referring_domain"]);\n if (current.referring_domain && ((_a = options.excludeReferrers) === null || _a === void 0 ? void 0 : _a.includes(current.referring_domain))) {\n return false;\n }\n var hasNewCampaign = JSON.stringify(currentCampaign) !== JSON.stringify(previousCampaign);\n var hasNewDomain = domainWithoutSubdomain(referring_domain || "") !== domainWithoutSubdomain(prevReferringDomain || "");\n return !previous || hasNewCampaign || hasNewDomain;\n };\n var createCampaignEvent = function(campaign, options) {\n var campaignParameters = __assign(__assign({}, BASE_CAMPAIGN), campaign);\n var identifyEvent = Object.entries(campaignParameters).reduce(function(identify2, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n identify2.setOnce("initial_".concat(key), (_b = value !== null && value !== void 0 ? value : options.initialEmptyValue) !== null && _b !== void 0 ? _b : "EMPTY");\n if (value) {\n return identify2.set(key, value);\n }\n return identify2.unset(key);\n }, new Identify());\n return createIdentifyEvent(identifyEvent);\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/web-attribution.js\n var webAttributionPlugin = function() {\n var _this = this;\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var _b = __read(args, 2), clientOrOptions = _b[0], configOrUndefined = _b[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var excludeReferrers = (_a = options.excludeReferrers) !== null && _a !== void 0 ? _a : [];\n if (typeof location !== "undefined") {\n excludeReferrers.unshift(location.hostname);\n }\n options = __assign(__assign({ disabled: false, initialEmptyValue: "EMPTY", resetSessionOnNewCampaign: false }, options), { excludeReferrers });\n var plugin = {\n name: "web-attribution",\n type: PluginType.BEFORE,\n setup: function(config, client) {\n var _a2;\n return __awaiter(this, void 0, void 0, function() {\n var receivedType, storage, storageKey, _b2, currentCampaign, previousCampaign, pluginEnabledOverride, campaignEvent;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n if (options.disabled) {\n config.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n config.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser.");\n if (!client && !((_a2 = config.attribution) === null || _a2 === void 0 ? void 0 : _a2.disabled)) {\n config.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser.");\n config.attribution = {\n disabled: true\n };\n }\n storage = config.cookieStorage;\n storageKey = getStorageKey(config.apiKey, "MKTG");\n return [4, Promise.all([\n new CampaignParser().parse(),\n storage.get(storageKey)\n ])];\n case 1:\n _b2 = __read.apply(void 0, [_c.sent(), 2]), currentCampaign = _b2[0], previousCampaign = _b2[1];\n pluginEnabledOverride = this.__pluginEnabledOverride;\n if (pluginEnabledOverride !== null && pluginEnabledOverride !== void 0 ? pluginEnabledOverride : isNewCampaign(currentCampaign, previousCampaign, options)) {\n if (options.resetSessionOnNewCampaign) {\n amplitude.setSessionId(Date.now());\n config.loggerProvider.log("Created a new session for new campaign.");\n }\n config.loggerProvider.log("Tracking attribution.");\n campaignEvent = createCampaignEvent(currentCampaign, options);\n amplitude.track(campaignEvent);\n void storage.set(storageKey, currentCampaign);\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(_this, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n return [2, event];\n });\n });\n }\n };\n plugin.__pluginEnabledOverride = void 0;\n return plugin;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js\n var MAX_ARRAY_LENGTH = 1e3;\n var LocalStorage = (\n /** @class */\n (function() {\n function LocalStorage2(config) {\n this.loggerProvider = config === null || config === void 0 ? void 0 : config.loggerProvider;\n }\n LocalStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var random, testStorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n random = String(Date.now());\n testStorage = new LocalStorage2();\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStorage.set(testKey, random)];\n case 2:\n _b.sent();\n return [4, testStorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === random];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n return [4, this.getRaw(key)];\n case 1:\n value = _b.sent();\n if (!value) {\n return [2, void 0];\n }\n return [2, JSON.parse(value)];\n case 2:\n _a = _b.sent();\n return [2, void 0];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n return [2, ((_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.getItem(key)) || void 0];\n });\n });\n };\n LocalStorage2.prototype.set = function(key, value) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var isExceededArraySize, serializedValue, droppedEventsCount;\n return __generator(this, function(_c) {\n isExceededArraySize = Array.isArray(value) && value.length > MAX_ARRAY_LENGTH;\n try {\n serializedValue = isExceededArraySize ? JSON.stringify(value.slice(0, MAX_ARRAY_LENGTH)) : JSON.stringify(value);\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.setItem(key, serializedValue);\n } catch (_d) {\n }\n if (isExceededArraySize) {\n droppedEventsCount = value.length - MAX_ARRAY_LENGTH;\n (_b = this.loggerProvider) === null || _b === void 0 ? void 0 : _b.error("Failed to save ".concat(droppedEventsCount, " events because the queue length exceeded ").concat(MAX_ARRAY_LENGTH, "."));\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.remove = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.removeItem(key);\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.reset = function() {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.clear();\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return LocalStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js\n var XHRTransport = (\n /** @class */\n (function(_super) {\n __extends(XHRTransport2, _super);\n function XHRTransport2() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n done: 4\n };\n return _this;\n }\n XHRTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n if (typeof XMLHttpRequest === "undefined") {\n reject(new Error("XHRTransport is not supported."));\n }\n var xhr = new XMLHttpRequest();\n xhr.open("POST", serverUrl, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === _this.state.done) {\n try {\n var responsePayload = xhr.responseText;\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n xhr.setRequestHeader("Content-Type", "application/json");\n xhr.setRequestHeader("Accept", "*/*");\n xhr.send(JSON.stringify(payload));\n })];\n });\n });\n };\n return XHRTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js\n var SendBeaconTransport = (\n /** @class */\n (function(_super) {\n __extends(SendBeaconTransport2, _super);\n function SendBeaconTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SendBeaconTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n var globalScope = getGlobalScope();\n if (!(globalScope === null || globalScope === void 0 ? void 0 : globalScope.navigator.sendBeacon)) {\n throw new Error("SendBeaconTransport is not supported");\n }\n try {\n var data = JSON.stringify(payload);\n var success = globalScope.navigator.sendBeacon(serverUrl, JSON.stringify(payload));\n if (success) {\n return resolve(_this.buildResponse({\n code: 200,\n events_ingested: payload.events.length,\n payload_size_bytes: data.length,\n server_upload_time: Date.now()\n }));\n }\n return resolve(_this.buildResponse({ code: 500 }));\n } catch (e) {\n reject(e);\n }\n })];\n });\n });\n };\n return SendBeaconTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/config.js\n var getDefaultConfig2 = function() {\n var cookieStorage = new MemoryStorage();\n var trackingOptions = {\n deviceManufacturer: true,\n deviceModel: true,\n ipAddress: true,\n language: true,\n osName: true,\n osVersion: true,\n platform: true\n };\n return {\n cookieExpiration: 365,\n cookieSameSite: "Lax",\n cookieSecure: false,\n cookieStorage,\n cookieUpgrade: true,\n disableCookies: false,\n domain: "",\n sessionTimeout: 30 * 60 * 1e3,\n trackingOptions,\n transportProvider: new FetchTransport()\n };\n };\n var BrowserConfig = (\n /** @class */\n (function(_super) {\n __extends(BrowserConfig2, _super);\n function BrowserConfig2(apiKey, options) {\n var _this = this;\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n var defaultConfig = getDefaultConfig2();\n _this = _super.call(this, __assign(__assign({ flushIntervalMillis: 1e3, flushMaxRetries: 5, flushQueueSize: 30, transportProvider: defaultConfig.transportProvider }, options), { apiKey })) || this;\n _this._optOut = false;\n _this.cookieStorage = (_a = options === null || options === void 0 ? void 0 : options.cookieStorage) !== null && _a !== void 0 ? _a : defaultConfig.cookieStorage;\n _this.deviceId = options === null || options === void 0 ? void 0 : options.deviceId;\n _this.lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n _this.lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n _this.optOut = Boolean(options === null || options === void 0 ? void 0 : options.optOut);\n _this.sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n _this.userId = options === null || options === void 0 ? void 0 : options.userId;\n _this.appVersion = options === null || options === void 0 ? void 0 : options.appVersion;\n _this.attribution = options === null || options === void 0 ? void 0 : options.attribution;\n _this.cookieExpiration = (_b = options === null || options === void 0 ? void 0 : options.cookieExpiration) !== null && _b !== void 0 ? _b : defaultConfig.cookieExpiration;\n _this.cookieSameSite = (_c = options === null || options === void 0 ? void 0 : options.cookieSameSite) !== null && _c !== void 0 ? _c : defaultConfig.cookieSameSite;\n _this.cookieSecure = (_d = options === null || options === void 0 ? void 0 : options.cookieSecure) !== null && _d !== void 0 ? _d : defaultConfig.cookieSecure;\n _this.cookieUpgrade = (_e = options === null || options === void 0 ? void 0 : options.cookieUpgrade) !== null && _e !== void 0 ? _e : defaultConfig.cookieUpgrade;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.disableCookies = (_f = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _f !== void 0 ? _f : defaultConfig.disableCookies;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.domain = (_g = options === null || options === void 0 ? void 0 : options.domain) !== null && _g !== void 0 ? _g : defaultConfig.domain;\n _this.partnerId = options === null || options === void 0 ? void 0 : options.partnerId;\n _this.sessionTimeout = (_h = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _h !== void 0 ? _h : defaultConfig.sessionTimeout;\n _this.trackingOptions = (_j = options === null || options === void 0 ? void 0 : options.trackingOptions) !== null && _j !== void 0 ? _j : defaultConfig.trackingOptions;\n return _this;\n }\n Object.defineProperty(BrowserConfig2.prototype, "deviceId", {\n get: function() {\n return this._deviceId;\n },\n set: function(deviceId) {\n if (this._deviceId !== deviceId) {\n this._deviceId = deviceId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "userId", {\n get: function() {\n return this._userId;\n },\n set: function(userId) {\n if (this._userId !== userId) {\n this._userId = userId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "sessionId", {\n get: function() {\n return this._sessionId;\n },\n set: function(sessionId) {\n if (this._sessionId !== sessionId) {\n this._sessionId = sessionId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n if (this._optOut !== optOut) {\n this._optOut = optOut;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventTime", {\n get: function() {\n return this._lastEventTime;\n },\n set: function(lastEventTime) {\n if (this._lastEventTime !== lastEventTime) {\n this._lastEventTime = lastEventTime;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventId", {\n get: function() {\n return this._lastEventId;\n },\n set: function(lastEventId) {\n if (this._lastEventId !== lastEventId) {\n this._lastEventId = lastEventId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n BrowserConfig2.prototype.updateStorage = function() {\n var _a;\n var cache = {\n deviceId: this._deviceId,\n userId: this._userId,\n sessionId: this._sessionId,\n optOut: this._optOut,\n lastEventTime: this._lastEventTime,\n lastEventId: this._lastEventId\n };\n void ((_a = this.cookieStorage) === null || _a === void 0 ? void 0 : _a.set(getCookieName(this.apiKey), cache));\n };\n return BrowserConfig2;\n })(Config)\n );\n var useBrowserConfig = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var defaultConfig, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, cookieStorage, domain, _a, _b, _c;\n var _d;\n var _e, _f;\n return __generator(this, function(_g) {\n switch (_g.label) {\n case 0:\n defaultConfig = getDefaultConfig2();\n deviceId = (_e = options === null || options === void 0 ? void 0 : options.deviceId) !== null && _e !== void 0 ? _e : UUID();\n lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n optOut = options === null || options === void 0 ? void 0 : options.optOut;\n sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n userId = options === null || options === void 0 ? void 0 : options.userId;\n cookieStorage = options === null || options === void 0 ? void 0 : options.cookieStorage;\n domain = options === null || options === void 0 ? void 0 : options.domain;\n _a = BrowserConfig.bind;\n _b = [void 0, apiKey];\n _c = [__assign({}, options)];\n _d = { cookieStorage, deviceId, domain, lastEventId, lastEventTime, optOut, sessionId };\n return [4, createEventsStorage(options)];\n case 1:\n return [2, new (_a.apply(BrowserConfig, _b.concat([__assign.apply(void 0, _c.concat([(_d.storageProvider = _g.sent(), _d.trackingOptions = __assign(__assign({}, defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions), _d.transportProvider = (_f = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _f !== void 0 ? _f : createTransport(options === null || options === void 0 ? void 0 : options.transport), _d.userId = userId, _d)]))])))()];\n }\n });\n });\n };\n var createCookieStorage = function(overrides, baseConfig) {\n if (baseConfig === void 0) {\n baseConfig = getDefaultConfig2();\n }\n return __awaiter(void 0, void 0, void 0, function() {\n var options, cookieStorage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n options = __assign(__assign({}, baseConfig), overrides);\n cookieStorage = overrides === null || overrides === void 0 ? void 0 : overrides.cookieStorage;\n _a = !cookieStorage;\n if (_a) return [3, 2];\n return [4, cookieStorage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (_a) {\n return [2, createFlexibleStorage(options)];\n }\n return [2, cookieStorage];\n }\n });\n });\n };\n var createFlexibleStorage = function(options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n storage = new CookieStorage({\n domain: options.domain,\n expirationDays: options.cookieExpiration,\n sameSite: options.cookieSameSite,\n secure: options.cookieSecure\n });\n _a = options.disableCookies;\n if (_a) return [3, 2];\n return [4, storage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (!_a) return [3, 4];\n storage = new LocalStorage();\n return [4, storage.isEnabled()];\n case 3:\n if (!_b.sent()) {\n storage = new MemoryStorage();\n }\n _b.label = 4;\n case 4:\n return [2, storage];\n }\n });\n });\n };\n var createEventsStorage = function(overrides) {\n return __awaiter(void 0, void 0, void 0, function() {\n var hasStorageProviderProperty, loggerProvider, _a, _b, storage, _c, e_1_1;\n var e_1, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n hasStorageProviderProperty = overrides && Object.prototype.hasOwnProperty.call(overrides, "storageProvider");\n loggerProvider = overrides && overrides.loggerProvider;\n if (!(!hasStorageProviderProperty || overrides.storageProvider)) return [3, 9];\n _e.label = 1;\n case 1:\n _e.trys.push([1, 7, 8, 9]);\n _a = __values([overrides === null || overrides === void 0 ? void 0 : overrides.storageProvider, new LocalStorage({ loggerProvider })]), _b = _a.next();\n _e.label = 2;\n case 2:\n if (!!_b.done) return [3, 6];\n storage = _b.value;\n _c = storage;\n if (!_c) return [3, 4];\n return [4, storage.isEnabled()];\n case 3:\n _c = _e.sent();\n _e.label = 4;\n case 4:\n if (_c) {\n return [2, storage];\n }\n _e.label = 5;\n case 5:\n _b = _a.next();\n return [3, 2];\n case 6:\n return [3, 9];\n case 7:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 9];\n case 8:\n try {\n if (_b && !_b.done && (_d = _a.return)) _d.call(_a);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 9:\n return [2, void 0];\n }\n });\n });\n };\n var createTransport = function(transport) {\n if (transport === TransportType.XHR) {\n return new XHRTransport();\n }\n if (transport === TransportType.SendBeacon) {\n return new SendBeaconTransport();\n }\n return getDefaultConfig2().transportProvider;\n };\n var getTopLevelDomain = function(url) {\n return __awaiter(void 0, void 0, void 0, function() {\n var host, parts, levels, storageKey, i, i, domain, options, storage, value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, new CookieStorage().isEnabled()];\n case 1:\n if (!_a.sent() || !url && typeof location === "undefined") {\n return [2, ""];\n }\n host = url !== null && url !== void 0 ? url : location.hostname;\n parts = host.split(".");\n levels = [];\n storageKey = "AMP_TLDTEST";\n for (i = parts.length - 2; i >= 0; --i) {\n levels.push(parts.slice(i).join("."));\n }\n i = 0;\n _a.label = 2;\n case 2:\n if (!(i < levels.length)) return [3, 7];\n domain = levels[i];\n options = { domain: "." + domain };\n storage = new CookieStorage(options);\n return [4, storage.set(storageKey, 1)];\n case 3:\n _a.sent();\n return [4, storage.get(storageKey)];\n case 4:\n value = _a.sent();\n if (!value) return [3, 6];\n return [4, storage.remove(storageKey)];\n case 5:\n _a.sent();\n return [2, "." + domain];\n case 6:\n i++;\n return [3, 2];\n case 7:\n return [2, ""];\n }\n });\n });\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/constants.js\n var DEFAULT_EVENT_PREFIX = "[Amplitude]";\n var DEFAULT_PAGE_VIEW_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Page Viewed");\n var DEFAULT_FORM_START_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Started");\n var DEFAULT_FORM_SUBMIT_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Submitted");\n var DEFAULT_FILE_DOWNLOAD_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " File Downloaded");\n var DEFAULT_SESSION_START_EVENT = "session_start";\n var DEFAULT_SESSION_END_EVENT = "session_end";\n var FILE_EXTENSION = "".concat(DEFAULT_EVENT_PREFIX, " File Extension");\n var FILE_NAME = "".concat(DEFAULT_EVENT_PREFIX, " File Name");\n var LINK_ID = "".concat(DEFAULT_EVENT_PREFIX, " Link ID");\n var LINK_TEXT = "".concat(DEFAULT_EVENT_PREFIX, " Link Text");\n var LINK_URL = "".concat(DEFAULT_EVENT_PREFIX, " Link URL");\n var FORM_ID = "".concat(DEFAULT_EVENT_PREFIX, " Form ID");\n var FORM_NAME = "".concat(DEFAULT_EVENT_PREFIX, " Form Name");\n var FORM_DESTINATION = "".concat(DEFAULT_EVENT_PREFIX, " Form Destination");\n\n // node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js\n var parseLegacyCookies = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, oldCookieName, cookies, _a, deviceId, userId, optOut, sessionId, lastEventTime, lastEventId;\n var _b;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n return [4, createCookieStorage(options)];\n case 1:\n storage = _c.sent();\n oldCookieName = getOldCookieName(apiKey);\n return [4, storage.getRaw(oldCookieName)];\n case 2:\n cookies = _c.sent();\n if (!cookies) {\n return [2, {\n optOut: false\n }];\n }\n if (!((_b = options.cookieUpgrade) !== null && _b !== void 0 ? _b : getDefaultConfig2().cookieUpgrade)) return [3, 4];\n return [4, storage.remove(oldCookieName)];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4:\n _a = __read(cookies.split("."), 6), deviceId = _a[0], userId = _a[1], optOut = _a[2], sessionId = _a[3], lastEventTime = _a[4], lastEventId = _a[5];\n return [2, {\n deviceId,\n userId: decode(userId),\n sessionId: parseTime(sessionId),\n lastEventId: parseTime(lastEventId),\n lastEventTime: parseTime(lastEventTime),\n optOut: Boolean(optOut)\n }];\n }\n });\n });\n };\n var parseTime = function(num) {\n var integer = parseInt(num, 32);\n if (isNaN(integer)) {\n return void 0;\n }\n return integer;\n };\n var decode = function(value) {\n if (!atob || !escape || !value) {\n return void 0;\n }\n try {\n return decodeURIComponent(escape(atob(value)));\n } catch (_a) {\n return void 0;\n }\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var import_ua_parser_js = __toESM(require_ua_parser());\n\n // node_modules/@amplitude/analytics-browser/lib/esm/version.js\n var VERSION = "1.13.4";\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var BROWSER_PLATFORM = "Web";\n var IP_ADDRESS = "$remote";\n var Context = (\n /** @class */\n (function() {\n function Context2() {\n this.name = "context";\n this.type = PluginType.BEFORE;\n this.library = "amplitude-ts/".concat(VERSION);\n if (typeof navigator !== "undefined") {\n this.userAgent = navigator.userAgent;\n }\n this.uaResult = new import_ua_parser_js.default(this.userAgent).getResult();\n }\n Context2.prototype.setup = function(config) {\n this.config = config;\n return Promise.resolve(void 0);\n };\n Context2.prototype.execute = function(context) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var time, osName, osVersion, deviceModel, deviceVendor, lastEventId, nextEventId, event;\n return __generator(this, function(_c) {\n time = (/* @__PURE__ */ new Date()).getTime();\n osName = this.uaResult.browser.name;\n osVersion = this.uaResult.browser.version;\n deviceModel = this.uaResult.device.model || this.uaResult.os.name;\n deviceVendor = this.uaResult.device.vendor;\n lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n nextEventId = (_b = context.event_id) !== null && _b !== void 0 ? _b : lastEventId + 1;\n this.config.lastEventId = nextEventId;\n if (!context.time) {\n this.config.lastEventTime = time;\n }\n event = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ user_id: this.config.userId, device_id: this.config.deviceId, session_id: this.config.sessionId, time }, this.config.appVersion && { app_version: this.config.appVersion }), this.config.trackingOptions.platform && { platform: BROWSER_PLATFORM }), this.config.trackingOptions.osName && { os_name: osName }), this.config.trackingOptions.osVersion && { os_version: osVersion }), this.config.trackingOptions.deviceManufacturer && { device_manufacturer: deviceVendor }), this.config.trackingOptions.deviceModel && { device_model: deviceModel }), this.config.trackingOptions.language && { language: getLanguage2() }), this.config.trackingOptions.ipAddress && { ip: IP_ADDRESS }), { insert_id: UUID(), partner_id: this.config.partnerId, plan: this.config.plan }), this.config.ingestionMetadata && {\n ingestion_metadata: {\n source_name: this.config.ingestionMetadata.sourceName,\n source_version: this.config.ingestionMetadata.sourceVersion\n }\n }), context), { event_id: nextEventId, library: this.library, user_agent: this.userAgent });\n return [2, event];\n });\n });\n };\n return Context2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/default-page-view-event-enrichment.js\n var eventPropertyMap = {\n page_domain: "".concat(DEFAULT_EVENT_PREFIX, " Page Domain"),\n page_location: "".concat(DEFAULT_EVENT_PREFIX, " Page Location"),\n page_path: "".concat(DEFAULT_EVENT_PREFIX, " Page Path"),\n page_title: "".concat(DEFAULT_EVENT_PREFIX, " Page Title"),\n page_url: "".concat(DEFAULT_EVENT_PREFIX, " Page URL")\n };\n var defaultPageViewEventEnrichment = function() {\n var name = "@amplitude/plugin-default-page-view-event-enrichment-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, void 0];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (event.event_type === DEFAULT_PAGE_VIEW_EVENT && event.event_properties) {\n event.event_properties = Object.entries(event.event_properties).reduce(function(acc, _a2) {\n var _b = __read(_a2, 2), key = _b[0], value = _b[1];\n var transformedPropertyName = eventPropertyMap[key];\n if (transformedPropertyName) {\n acc[transformedPropertyName] = value;\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n }\n return [2, event];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js\n var fileDownloadTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-file-download-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFileDownloadListener, ext, links;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFileDownloadListener = function(a) {\n var url;\n try {\n url = new URL(a.href, window.location.href);\n } catch (_a2) {\n return;\n }\n var result = ext.exec(url.href);\n var fileExtension = result === null || result === void 0 ? void 0 : result[1];\n if (fileExtension) {\n addEventListener(a, "click", function() {\n var _a2;\n if (fileExtension) {\n amplitude.track(DEFAULT_FILE_DOWNLOAD_EVENT, (_a2 = {}, _a2[FILE_EXTENSION] = fileExtension, _a2[FILE_NAME] = url.pathname, _a2[LINK_ID] = a.id, _a2[LINK_TEXT] = a.text, _a2[LINK_URL] = a.href, _a2));\n }\n });\n }\n };\n ext = /\\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/;\n links = Array.from(document.getElementsByTagName("a"));\n links.forEach(addFileDownloadListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "A") {\n addFileDownloadListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("a")).map(addFileDownloadListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js\n var formInteractionTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-form-interaction-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFormInteractionListener, forms;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFormInteractionListener = function(form) {\n var hasFormChanged = false;\n addEventListener(form, "change", function() {\n var _a2;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n hasFormChanged = true;\n });\n addEventListener(form, "submit", function() {\n var _a2, _b;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n amplitude.track(DEFAULT_FORM_SUBMIT_EVENT, (_b = {}, _b[FORM_ID] = form.id, _b[FORM_NAME] = form.name, _b[FORM_DESTINATION] = form.action, _b));\n hasFormChanged = false;\n });\n };\n forms = Array.from(document.getElementsByTagName("form"));\n forms.forEach(addFormInteractionListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "FORM") {\n addFormInteractionListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("form")).map(addFormInteractionListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js\n var convertProxyObjectToRealObject = function(instance, queue) {\n for (var i = 0; i < queue.length; i++) {\n var _a = queue[i], name_1 = _a.name, args = _a.args, resolve = _a.resolve;\n var fn = instance && instance[name_1];\n if (typeof fn === "function") {\n var result = fn.apply(instance, args);\n if (typeof resolve === "function") {\n resolve(result === null || result === void 0 ? void 0 : result.promise);\n }\n }\n }\n return instance;\n };\n var isInstanceProxy = function(instance) {\n var instanceProxy = instance;\n return instanceProxy && instanceProxy._q !== void 0;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js\n var AmplitudeBrowser = (\n /** @class */\n (function(_super) {\n __extends(AmplitudeBrowser2, _super);\n function AmplitudeBrowser2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AmplitudeBrowser2.prototype.init = function(apiKey, userId, options) {\n if (apiKey === void 0) {\n apiKey = "";\n }\n return returnWrapper(this._init(__assign(__assign({}, options), { userId, apiKey })));\n };\n AmplitudeBrowser2.prototype._init = function(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _r, _s, _t, _u, _v, _w;\n return __awaiter(this, void 0, void 0, function() {\n var _x, _y, _z, legacyCookies, cookieStorage, previousCookies, queryParams, deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, browserOptions, isNewSession, connector, webAttribution, pageViewTrackingOptions;\n var _this = this;\n return __generator(this, function(_0) {\n switch (_0.label) {\n case 0:\n if (this.initializing) {\n return [\n 2\n /*return*/\n ];\n }\n this.initializing = true;\n _x = options;\n if (!options.disableCookies) return [3, 1];\n _y = "";\n return [3, 5];\n case 1:\n if (!((_a = options.domain) !== null && _a !== void 0)) return [3, 2];\n _z = _a;\n return [3, 4];\n case 2:\n return [4, getTopLevelDomain()];\n case 3:\n _z = _0.sent();\n _0.label = 4;\n case 4:\n _y = _z;\n _0.label = 5;\n case 5:\n _x.domain = _y;\n return [4, parseLegacyCookies(options.apiKey, options)];\n case 6:\n legacyCookies = _0.sent();\n return [4, createCookieStorage(options)];\n case 7:\n cookieStorage = _0.sent();\n return [4, cookieStorage.get(getCookieName(options.apiKey))];\n case 8:\n previousCookies = _0.sent();\n queryParams = getQueryParams();\n deviceId = (_d = (_c = (_b = options.deviceId) !== null && _b !== void 0 ? _b : queryParams.deviceId) !== null && _c !== void 0 ? _c : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _d !== void 0 ? _d : legacyCookies.deviceId;\n sessionId = (_e = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _e !== void 0 ? _e : legacyCookies.sessionId;\n optOut = (_g = (_f = options.optOut) !== null && _f !== void 0 ? _f : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _g !== void 0 ? _g : legacyCookies.optOut;\n lastEventId = (_h = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _h !== void 0 ? _h : legacyCookies.lastEventId;\n lastEventTime = (_j = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _j !== void 0 ? _j : legacyCookies.lastEventTime;\n userId = (_l = (_k = options.userId) !== null && _k !== void 0 ? _k : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _l !== void 0 ? _l : legacyCookies.userId;\n this.previousSessionDeviceId = (_m = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _m !== void 0 ? _m : legacyCookies.deviceId;\n this.previousSessionUserId = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _o !== void 0 ? _o : legacyCookies.userId;\n return [4, useBrowserConfig(options.apiKey, __assign(__assign({}, options), { deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, cookieStorage }))];\n case 9:\n browserOptions = _0.sent();\n return [4, _super.prototype._init.call(this, browserOptions)];\n case 10:\n _0.sent();\n isNewSession = false;\n if (\n // user has never sent an event\n !this.config.lastEventTime || // user has no previous session ID\n !this.config.sessionId || // has sent an event and has previous session but expired\n this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout\n ) {\n this.setSessionId((_r = (_p = options.sessionId) !== null && _p !== void 0 ? _p : this.config.sessionId) !== null && _r !== void 0 ? _r : Date.now());\n isNewSession = true;\n }\n connector = getAnalyticsConnector(options.instanceName);\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId\n });\n return [4, this.add(new Destination()).promise];\n case 11:\n _0.sent();\n return [4, this.add(new Context()).promise];\n case 12:\n _0.sent();\n return [4, this.add(new IdentityEventSender()).promise];\n case 13:\n _0.sent();\n if (!isFileDownloadTrackingEnabled(this.config.defaultTracking)) return [3, 15];\n return [4, this.add(fileDownloadTracking()).promise];\n case 14:\n _0.sent();\n _0.label = 15;\n case 15:\n if (!isFormInteractionTrackingEnabled(this.config.defaultTracking)) return [3, 17];\n return [4, this.add(formInteractionTracking()).promise];\n case 16:\n _0.sent();\n _0.label = 17;\n case 17:\n if (!!((_s = this.config.attribution) === null || _s === void 0 ? void 0 : _s.disabled)) return [3, 19];\n webAttribution = webAttributionPlugin({\n excludeReferrers: (_t = this.config.attribution) === null || _t === void 0 ? void 0 : _t.excludeReferrers,\n initialEmptyValue: (_u = this.config.attribution) === null || _u === void 0 ? void 0 : _u.initialEmptyValue,\n resetSessionOnNewCampaign: (_v = this.config.attribution) === null || _v === void 0 ? void 0 : _v.resetSessionOnNewCampaign\n });\n webAttribution.__pluginEnabledOverride = isNewSession || ((_w = this.config.attribution) === null || _w === void 0 ? void 0 : _w.trackNewCampaigns) ? void 0 : false;\n return [4, this.add(webAttribution).promise];\n case 18:\n _0.sent();\n _0.label = 19;\n case 19:\n pageViewTrackingOptions = getPageViewTrackingConfig(this.config);\n pageViewTrackingOptions.eventType = pageViewTrackingOptions.eventType || DEFAULT_PAGE_VIEW_EVENT;\n return [4, this.add(pageViewTrackingPlugin(pageViewTrackingOptions)).promise];\n case 20:\n _0.sent();\n return [4, this.add(defaultPageViewEventEnrichment()).promise];\n case 21:\n _0.sent();\n this.initializing = false;\n return [4, this.runQueuedFunctions("dispatchQ")];\n case 22:\n _0.sent();\n connector.eventBridge.setEventReceiver(function(event) {\n void _this.track(event.eventType, event.eventProperties);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeBrowser2.prototype.getUserId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.userId;\n };\n AmplitudeBrowser2.prototype.setUserId = function(userId) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n if (userId !== this.config.userId || userId === void 0) {\n this.config.userId = userId;\n setConnectorUserId(userId, this.config.instanceName);\n }\n };\n AmplitudeBrowser2.prototype.getDeviceId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.deviceId;\n };\n AmplitudeBrowser2.prototype.setDeviceId = function(deviceId) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n setConnectorDeviceId(deviceId, this.config.instanceName);\n };\n AmplitudeBrowser2.prototype.setOptOut = function(optOut) {\n setConnectorOptOut(optOut, this.config.instanceName);\n _super.prototype.setOptOut.call(this, optOut);\n };\n AmplitudeBrowser2.prototype.reset = function() {\n this.setDeviceId(UUID());\n this.setUserId(void 0);\n };\n AmplitudeBrowser2.prototype.getSessionId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionId;\n };\n AmplitudeBrowser2.prototype.setSessionId = function(sessionId) {\n var _a;\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n if (sessionId === this.config.sessionId) {\n return;\n }\n var previousSessionId = this.getSessionId();\n var lastEventTime = this.config.lastEventTime;\n var lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n this.config.sessionId = sessionId;\n this.config.lastEventTime = void 0;\n if (isSessionTrackingEnabled(this.config.defaultTracking)) {\n if (previousSessionId && lastEventTime) {\n this.track(DEFAULT_SESSION_END_EVENT, void 0, {\n device_id: this.previousSessionDeviceId,\n event_id: ++lastEventId,\n session_id: previousSessionId,\n time: lastEventTime + 1,\n user_id: this.previousSessionUserId\n });\n }\n this.config.lastEventTime = this.config.sessionId;\n this.track(DEFAULT_SESSION_START_EVENT, void 0, {\n event_id: ++lastEventId,\n session_id: this.config.sessionId,\n time: this.config.lastEventTime\n });\n }\n this.previousSessionDeviceId = this.config.deviceId;\n this.previousSessionUserId = this.config.userId;\n };\n AmplitudeBrowser2.prototype.extendSession = function() {\n if (!this.config) {\n this.q.push(this.extendSession.bind(this));\n return;\n }\n this.config.lastEventTime = Date.now();\n };\n AmplitudeBrowser2.prototype.setTransport = function(transport) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n };\n AmplitudeBrowser2.prototype.identify = function(identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return _super.prototype.identify.call(this, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return _super.prototype.groupIdentify.call(this, groupType, groupName, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.revenue = function(revenue2, eventOptions) {\n if (isInstanceProxy(revenue2)) {\n var queue = revenue2._q;\n revenue2._q = [];\n revenue2 = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return _super.prototype.revenue.call(this, revenue2, eventOptions);\n };\n AmplitudeBrowser2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var currentTime, lastEventTime, timeSinceLastEvent;\n return __generator(this, function(_a) {\n currentTime = Date.now();\n lastEventTime = this.config.lastEventTime || Date.now();\n timeSinceLastEvent = currentTime - lastEventTime;\n if (event.event_type !== DEFAULT_SESSION_START_EVENT && event.event_type !== DEFAULT_SESSION_END_EVENT && (!event.session_id || event.session_id === this.getSessionId()) && timeSinceLastEvent > this.config.sessionTimeout) {\n this.setSessionId(currentTime);\n }\n return [2, _super.prototype.process.call(this, event)];\n });\n });\n };\n return AmplitudeBrowser2;\n })(AmplitudeCore)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js\n var createInstance = function() {\n var client = new AmplitudeBrowser();\n return {\n init: debugWrapper(client.init.bind(client), "init", getClientLogConfig(client), getClientStates(client, ["config"])),\n add: debugWrapper(client.add.bind(client), "add", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n remove: debugWrapper(client.remove.bind(client), "remove", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n track: debugWrapper(client.track.bind(client), "track", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n logEvent: debugWrapper(client.logEvent.bind(client), "logEvent", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n identify: debugWrapper(client.identify.bind(client), "identify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n groupIdentify: debugWrapper(client.groupIdentify.bind(client), "groupIdentify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n setGroup: debugWrapper(client.setGroup.bind(client), "setGroup", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n revenue: debugWrapper(client.revenue.bind(client), "revenue", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n flush: debugWrapper(client.flush.bind(client), "flush", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n getUserId: debugWrapper(client.getUserId.bind(client), "getUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n setUserId: debugWrapper(client.setUserId.bind(client), "setUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n getDeviceId: debugWrapper(client.getDeviceId.bind(client), "getDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n setDeviceId: debugWrapper(client.setDeviceId.bind(client), "setDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n reset: debugWrapper(client.reset.bind(client), "reset", getClientLogConfig(client), getClientStates(client, ["config", "config.userId", "config.deviceId"])),\n getSessionId: debugWrapper(client.getSessionId.bind(client), "getSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n setSessionId: debugWrapper(client.setSessionId.bind(client), "setSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n extendSession: debugWrapper(client.extendSession.bind(client), "extendSession", getClientLogConfig(client), getClientStates(client, ["config"])),\n setOptOut: debugWrapper(client.setOptOut.bind(client), "setOptOut", getClientLogConfig(client), getClientStates(client, ["config"])),\n setTransport: debugWrapper(client.setTransport.bind(client), "setTransport", getClientLogConfig(client), getClientStates(client, ["config"]))\n };\n };\n var browser_client_factory_default = createInstance();\n\n // node_modules/@amplitude/analytics-browser/lib/esm/index.js\n var add = browser_client_factory_default.add;\n var extendSession = browser_client_factory_default.extendSession;\n var flush = browser_client_factory_default.flush;\n var getDeviceId = browser_client_factory_default.getDeviceId;\n var getSessionId = browser_client_factory_default.getSessionId;\n var getUserId = browser_client_factory_default.getUserId;\n var groupIdentify = browser_client_factory_default.groupIdentify;\n var identify = browser_client_factory_default.identify;\n var init = browser_client_factory_default.init;\n var logEvent = browser_client_factory_default.logEvent;\n var remove = browser_client_factory_default.remove;\n var reset = browser_client_factory_default.reset;\n var revenue = browser_client_factory_default.revenue;\n var setDeviceId = browser_client_factory_default.setDeviceId;\n var setGroup = browser_client_factory_default.setGroup;\n var setOptOut = browser_client_factory_default.setOptOut;\n var setSessionId = browser_client_factory_default.setSessionId;\n var setTransport = browser_client_factory_default.setTransport;\n var setUserId = browser_client_factory_default.setUserId;\n var track = browser_client_factory_default.track;\n\n // packages/dev-tools/client/setup-ui/connected.ts\n var showSection = (sectionId, delay) => {\n setTimeout(() => {\n const sections = Array.from(document.querySelectorAll("section"));\n for (const section of sections) {\n section.setAttribute("aria-hidden", String(section.id !== sectionId));\n }\n }, delay);\n };\n var showSuccess = (confetti) => {\n showSection("success", 500);\n if (confetti) {\n celebrate();\n }\n setTimeout(stepViewContent, 500);\n };\n var stepViewContent = () => {\n const stepUpdateApp = document.getElementById("step-update-app");\n stepUpdateApp.className = "highlight completed";\n const stepViewContent2 = document.getElementById("step-setup-complete");\n stepViewContent2.className = "highlight active";\n };\n var showErrors = (errors = []) => {\n showSection("error", 500);\n const msgsUl = document.getElementById("error-messages");\n msgsUl.innerHTML = "";\n for (const error of errors) {\n const li = document.createElement("li");\n li.textContent = error;\n msgsUl.appendChild(li);\n }\n document.title = `Error Connecting`;\n };\n var showRestartServer = () => {\n showSection("restart-server", 500);\n document.title = `Restart Dev Server`;\n };\n var init2 = async () => {\n const pageUrl = new URL(location.href);\n const previewUrl = pageUrl.searchParams.get(PREVIEW_URL_QS);\n const publicApiKey = pageUrl.searchParams.get(PUBLIC_API_KEY_QS);\n const privateAuthKey = pageUrl.searchParams.get(PRIVATE_AUTH_KEY_QS);\n const builderUserId = pageUrl.searchParams.get(USER_ID_QS);\n const framework = pageUrl.searchParams.get(FRAMEWORK_QS) || "unknown";\n const platform = pageUrl.searchParams.get(PLATFORM_QS);\n const nodeVersion = pageUrl.searchParams.get(NODE_VERSION_QS);\n const spaceKind = pageUrl.searchParams.get(SPACE_KIND_QS) || null;\n try {\n console.info(\n `framework: ${framework}, platform: ${platform}, node: ${nodeVersion}`\n );\n const cleanedUrl = new URL(location.pathname, location.origin);\n if (publicApiKey) {\n setGroup("organization", publicApiKey);\n setGroup("space", publicApiKey);\n }\n if (!previewUrl) {\n window.history.replaceState({}, "", cleanedUrl.href);\n showErrors(["Missing preview url"]);\n track("integration failed", {\n url: cleanedUrl.href,\n message: "missing preview url",\n framework\n });\n return;\n }\n cleanedUrl.searchParams.set(PREVIEW_URL_QS, previewUrl);\n cleanedUrl.searchParams.set(USER_ID_QS, builderUserId);\n window.history.replaceState({}, "", cleanedUrl.href);\n if (publicApiKey && privateAuthKey) {\n let connectedAttempts = 0;\n const checkConnected = async () => {\n connectedAttempts++;\n try {\n const connectedBuilder = await apiConnectBuilder(\n publicApiKey,\n privateAuthKey,\n spaceKind\n );\n if (connectedBuilder.success) {\n const appLinkUrl = updateAppLinkUrl(\n previewUrl,\n connectedBuilder.pathname,\n builderUserId\n );\n track("site integrated", {\n url: appLinkUrl,\n position: framework\n });\n if (connectedBuilder.modifiedFiles.length > 0) {\n const ul = document.getElementById("modified-files-list");\n connectedBuilder.modifiedFiles.forEach((m) => {\n const li = document.createElement("li");\n const a = document.createElement("a");\n a.textContent = m.displayFilePath || m.filePath;\n a.href = `~launch#${m.displayFilePath}`;\n a.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n apiLaunchEditor({\n filePath: m.filePath\n });\n });\n li.appendChild(a);\n ul.appendChild(li);\n });\n const modifiedFilesMessage = document.getElementById(\n "modified-files-message"\n );\n modifiedFilesMessage.removeAttribute("hidden");\n }\n if (spaceKind !== "vcp" && (connectedBuilder.platform.os === "win32" || framework === "@remix-run/react")) {\n const restartWarning = document.getElementById("restart-warning");\n restartWarning.removeAttribute("hidden");\n } else if (spaceKind !== "vcp" && (framework === "react" || framework === "@angular/core")) {\n const routeMessage = document.getElementById("router-message");\n routeMessage.removeAttribute("hidden");\n if (framework === "@angular/core") {\n track("angular framework", {});\n const angularRouterMessageSection = document.getElementById(\n "angular-message-section"\n );\n angularRouterMessageSection?.removeAttribute("hidden");\n }\n if (framework === "react") {\n track("react framework", {});\n const reactRouterMessageSection = document.getElementById(\n "react-message-section"\n );\n reactRouterMessageSection?.removeAttribute("hidden");\n }\n const routeCheckboxDiv = document.getElementById(\n "router-checkbox-div"\n );\n const routeCheckbox = document.createElement("input");\n routeCheckbox.type = "checkbox";\n routeCheckbox.id = "router-checkbox";\n const label = document.createElement("label");\n label.htmlFor = "router-checkbox";\n label.textContent = `I\'ve updated my router files`;\n routeCheckboxDiv.appendChild(routeCheckbox);\n routeCheckboxDiv.appendChild(label);\n const finishButton = document.getElementById(\n "router-finish-button"\n );\n routeCheckbox.addEventListener("change", function() {\n if (routeCheckbox.checked) {\n finishButton.removeAttribute("hidden");\n } else {\n finishButton.setAttribute("hidden", "true");\n }\n });\n } else {\n const goToApp = document.getElementById("go-to-app");\n goToApp.removeAttribute("hidden");\n if (spaceKind !== "vcp") {\n const firstParagraph = goToApp.querySelector("p");\n if (firstParagraph) {\n firstParagraph.removeAttribute("hidden");\n }\n const buttonText = goToApp.querySelector("#button-text");\n if (buttonText) {\n buttonText.textContent = "Go to your app";\n }\n }\n }\n setTimeout(() => {\n showSuccess(true);\n }, 500);\n } else {\n track("integration failed", {\n path: connectedBuilder.pathname,\n message: "error connecting to Builder.io",\n position: framework\n });\n showErrors([`Error connecting to Builder.io`]);\n }\n } catch (e) {\n const err = String(e.message || e);\n if (err.includes("Fetch Error")) {\n if (connectedAttempts > 3) {\n showRestartServer();\n }\n setTimeout(checkConnected, 1e3);\n } else {\n showErrors([err]);\n }\n }\n };\n checkConnected();\n } else {\n const validatedBuilder = await apiValidateBuilder();\n if (validatedBuilder.isValid) {\n updateAppLinkUrl(previewUrl, validatedBuilder.pathname, builderUserId);\n const goToApp = document.getElementById("go-to-app");\n goToApp.removeAttribute("hidden");\n showSuccess(false);\n } else {\n showErrors([`Error connecting to Builder.io`]);\n }\n }\n } catch (e) {\n track("integration failed", {\n message: "uncaught error",\n details: String(e),\n position: JSON.stringify({ framework, platform, nodeVersion })\n });\n console.error("integrationFailed", e);\n const err = String(e);\n if (err.includes("Fetch Error")) {\n showRestartServer();\n } else {\n showErrors([err]);\n }\n }\n };\n var updateAppLinkUrl = (previewUrl, pathname, builderUserId) => {\n const appUrl = new URL(pathname, previewUrl);\n if (builderUserId) {\n appUrl.hash = `${CONNECTED_USER_ID_QS}=${builderUserId}`;\n }\n const nextStepLinks = document.querySelectorAll(".next-step");\n for (const nextStepLink of nextStepLinks) {\n nextStepLink.setAttribute("href", appUrl.href);\n }\n console.debug("App Url", appUrl.href);\n return appUrl.href;\n };\n var loadConfetti = () => {\n return new Promise((resolve, reject) => {\n if (globalThis.confetti) {\n return resolve(globalThis.confetti);\n }\n const script = document.createElement("script");\n script.src = "https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js";\n script.onload = () => resolve(globalThis.confetti);\n script.onerror = reject;\n document.head.appendChild(script);\n script.remove();\n });\n };\n var celebrate = async () => {\n const defaults = {\n spread: 360,\n ticks: 50,\n gravity: 0,\n decay: 0.95,\n startVelocity: 30,\n colors: ["19b4f4", "a97ff2", "fd6b3c", "ffffff"]\n };\n const confettiPromise = loadConfetti();\n const shoot = async () => {\n const buttonIcon = document.getElementById("button-icon");\n const iconRect = buttonIcon.getBoundingClientRect();\n const iconX = window.scrollX + iconRect.left;\n const iconY = window.scrollY + iconRect.top;\n const origin = {\n x: iconX / window.innerWidth,\n y: iconY / window.innerHeight\n };\n const confetti = await confettiPromise;\n confetti({\n ...defaults,\n origin,\n scalar: 1.2\n });\n confetti({\n ...defaults,\n origin,\n scalar: 0.75\n });\n };\n setTimeout(shoot, 500);\n setTimeout(shoot, 650);\n setTimeout(shoot, 800);\n setTimeout(shoot, 950);\n };\n init2();\n})();\n</script>\n </body>\n</html>\n');
|
|
@@ -14362,7 +14732,7 @@ var require_core = __commonJS({
|
|
|
14362
14732
|
const o2 = {};
|
|
14363
14733
|
const vs = s2.split("|");
|
|
14364
14734
|
const key_id = vs[1];
|
|
14365
|
-
let keys =
|
|
14735
|
+
let keys = decode2(values, key_id);
|
|
14366
14736
|
const n = vs.length;
|
|
14367
14737
|
if (n - 2 === 1 && !Array.isArray(keys)) {
|
|
14368
14738
|
keys = [keys];
|
|
@@ -14370,7 +14740,7 @@ var require_core = __commonJS({
|
|
|
14370
14740
|
for (let i = 2; i < n; i++) {
|
|
14371
14741
|
const k3 = keys[i - 2];
|
|
14372
14742
|
let v = vs[i];
|
|
14373
|
-
v =
|
|
14743
|
+
v = decode2(values, v);
|
|
14374
14744
|
o2[k3] = v;
|
|
14375
14745
|
}
|
|
14376
14746
|
return o2;
|
|
@@ -14384,12 +14754,12 @@ var require_core = __commonJS({
|
|
|
14384
14754
|
const xs = new Array(n);
|
|
14385
14755
|
for (let i = 0; i < n; i++) {
|
|
14386
14756
|
let v = vs[i + 1];
|
|
14387
|
-
v =
|
|
14757
|
+
v = decode2(values, v);
|
|
14388
14758
|
xs[i] = v;
|
|
14389
14759
|
}
|
|
14390
14760
|
return xs;
|
|
14391
14761
|
}
|
|
14392
|
-
function
|
|
14762
|
+
function decode2(values, key) {
|
|
14393
14763
|
if (key === "" || key === "_") {
|
|
14394
14764
|
return null;
|
|
14395
14765
|
}
|
|
@@ -14420,10 +14790,10 @@ var require_core = __commonJS({
|
|
|
14420
14790
|
}
|
|
14421
14791
|
return (0, debug_1.throwUnknownDataType)(v);
|
|
14422
14792
|
}
|
|
14423
|
-
exports2.decode =
|
|
14793
|
+
exports2.decode = decode2;
|
|
14424
14794
|
function decompress2(c) {
|
|
14425
14795
|
const [values, root] = c;
|
|
14426
|
-
return
|
|
14796
|
+
return decode2(values, root);
|
|
14427
14797
|
}
|
|
14428
14798
|
exports2.decompress = decompress2;
|
|
14429
14799
|
}
|
|
@@ -16159,8 +16529,8 @@ var init_lib = __esm({
|
|
|
16159
16529
|
tokenize: function tokenize(value) {
|
|
16160
16530
|
return value.split("");
|
|
16161
16531
|
},
|
|
16162
|
-
join: function join2(
|
|
16163
|
-
return
|
|
16532
|
+
join: function join2(chars2) {
|
|
16533
|
+
return chars2.join("");
|
|
16164
16534
|
}
|
|
16165
16535
|
};
|
|
16166
16536
|
characterDiff = new Diff();
|
|
@@ -16522,11 +16892,11 @@ async function killProcess(sys2, procOrPid, abortSignal, timeout = 5e3) {
|
|
|
16522
16892
|
try {
|
|
16523
16893
|
await Promise.race([
|
|
16524
16894
|
await new Promise(
|
|
16525
|
-
(
|
|
16895
|
+
(resolve3, reject) => (0, import_tree_kill.default)(pid, "SIGTERM", (err) => {
|
|
16526
16896
|
if (err) {
|
|
16527
16897
|
reject(err);
|
|
16528
16898
|
} else {
|
|
16529
|
-
|
|
16899
|
+
resolve3();
|
|
16530
16900
|
}
|
|
16531
16901
|
})
|
|
16532
16902
|
),
|
|
@@ -16549,11 +16919,11 @@ async function killProcess(sys2, procOrPid, abortSignal, timeout = 5e3) {
|
|
|
16549
16919
|
try {
|
|
16550
16920
|
await Promise.race([
|
|
16551
16921
|
await new Promise(
|
|
16552
|
-
(
|
|
16922
|
+
(resolve3, reject) => (0, import_tree_kill.default)(pid, "SIGKILL", (err2) => {
|
|
16553
16923
|
if (err2) {
|
|
16554
16924
|
reject(err2);
|
|
16555
16925
|
} else {
|
|
16556
|
-
|
|
16926
|
+
resolve3();
|
|
16557
16927
|
}
|
|
16558
16928
|
})
|
|
16559
16929
|
),
|
|
@@ -17971,9 +18341,9 @@ var require_constants2 = __commonJS({
|
|
|
17971
18341
|
/**
|
|
17972
18342
|
* Create EXTGLOB_CHARS
|
|
17973
18343
|
*/
|
|
17974
|
-
extglobChars(
|
|
18344
|
+
extglobChars(chars2) {
|
|
17975
18345
|
return {
|
|
17976
|
-
"!": { type: "negate", open: "(?:(?!(?:", close: `))${
|
|
18346
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars2.STAR})` },
|
|
17977
18347
|
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
17978
18348
|
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
17979
18349
|
"*": { type: "star", open: "(?:", close: ")*" },
|
|
@@ -18571,7 +18941,7 @@ var require_parse3 = __commonJS({
|
|
|
18571
18941
|
};
|
|
18572
18942
|
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
18573
18943
|
let backslashes = false;
|
|
18574
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc,
|
|
18944
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc, chars2, first, rest, index) => {
|
|
18575
18945
|
if (first === "\\") {
|
|
18576
18946
|
backslashes = true;
|
|
18577
18947
|
return m2;
|
|
@@ -18583,10 +18953,10 @@ var require_parse3 = __commonJS({
|
|
|
18583
18953
|
if (index === 0) {
|
|
18584
18954
|
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
18585
18955
|
}
|
|
18586
|
-
return QMARK.repeat(
|
|
18956
|
+
return QMARK.repeat(chars2.length);
|
|
18587
18957
|
}
|
|
18588
18958
|
if (first === ".") {
|
|
18589
|
-
return DOT_LITERAL.repeat(
|
|
18959
|
+
return DOT_LITERAL.repeat(chars2.length);
|
|
18590
18960
|
}
|
|
18591
18961
|
if (first === "*") {
|
|
18592
18962
|
if (esc) {
|
|
@@ -20640,7 +21010,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20640
21010
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
20641
21011
|
}
|
|
20642
21012
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
20643
|
-
var currentUrlParts =
|
|
21013
|
+
var currentUrlParts = parseUrl2(this._currentUrl);
|
|
20644
21014
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
20645
21015
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
20646
21016
|
var redirectUrl = resolveUrl(location, currentUrl);
|
|
@@ -20679,7 +21049,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20679
21049
|
if (isURL(input)) {
|
|
20680
21050
|
input = spreadUrlObject(input);
|
|
20681
21051
|
} else if (isString2(input)) {
|
|
20682
|
-
input = spreadUrlObject(
|
|
21052
|
+
input = spreadUrlObject(parseUrl2(input));
|
|
20683
21053
|
} else {
|
|
20684
21054
|
callback = options;
|
|
20685
21055
|
options = validateUrl(input);
|
|
@@ -20715,7 +21085,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20715
21085
|
}
|
|
20716
21086
|
function noop() {
|
|
20717
21087
|
}
|
|
20718
|
-
function
|
|
21088
|
+
function parseUrl2(input) {
|
|
20719
21089
|
var parsed;
|
|
20720
21090
|
if (useNativeURL) {
|
|
20721
21091
|
parsed = new URL2(input);
|
|
@@ -20728,7 +21098,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20728
21098
|
return parsed;
|
|
20729
21099
|
}
|
|
20730
21100
|
function resolveUrl(relative, base) {
|
|
20731
|
-
return useNativeURL ? new URL2(relative, base) :
|
|
21101
|
+
return useNativeURL ? new URL2(relative, base) : parseUrl2(url.resolve(base, relative));
|
|
20732
21102
|
}
|
|
20733
21103
|
function validateUrl(input) {
|
|
20734
21104
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -21960,7 +22330,7 @@ var require_cookie = __commonJS({
|
|
|
21960
22330
|
var obj = {};
|
|
21961
22331
|
var len = str.length;
|
|
21962
22332
|
if (len < 2) return obj;
|
|
21963
|
-
var dec = opt && opt.decode ||
|
|
22333
|
+
var dec = opt && opt.decode || decode2;
|
|
21964
22334
|
var index = 0;
|
|
21965
22335
|
var eqIdx = 0;
|
|
21966
22336
|
var endIdx = 0;
|
|
@@ -22091,15 +22461,15 @@ var require_cookie = __commonJS({
|
|
|
22091
22461
|
}
|
|
22092
22462
|
return str;
|
|
22093
22463
|
}
|
|
22094
|
-
function
|
|
22464
|
+
function decode2(str) {
|
|
22095
22465
|
return str.indexOf("%") !== -1 ? decodeURIComponent(str) : str;
|
|
22096
22466
|
}
|
|
22097
22467
|
function isDate(val) {
|
|
22098
22468
|
return __toString.call(val) === "[object Date]";
|
|
22099
22469
|
}
|
|
22100
|
-
function tryDecode(str,
|
|
22470
|
+
function tryDecode(str, decode3) {
|
|
22101
22471
|
try {
|
|
22102
|
-
return
|
|
22472
|
+
return decode3(str);
|
|
22103
22473
|
} catch (e2) {
|
|
22104
22474
|
return str;
|
|
22105
22475
|
}
|
|
@@ -30316,7 +30686,7 @@ var require_compile2 = __commonJS({
|
|
|
30316
30686
|
const schOrFunc = root.refs[ref];
|
|
30317
30687
|
if (schOrFunc)
|
|
30318
30688
|
return schOrFunc;
|
|
30319
|
-
let _sch =
|
|
30689
|
+
let _sch = resolve3.call(this, root, ref);
|
|
30320
30690
|
if (_sch === void 0) {
|
|
30321
30691
|
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
30322
30692
|
const { schemaId } = this.opts;
|
|
@@ -30343,7 +30713,7 @@ var require_compile2 = __commonJS({
|
|
|
30343
30713
|
function sameSchemaEnv(s1, s2) {
|
|
30344
30714
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
30345
30715
|
}
|
|
30346
|
-
function
|
|
30716
|
+
function resolve3(root, ref) {
|
|
30347
30717
|
let sch;
|
|
30348
30718
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
30349
30719
|
ref = sch;
|
|
@@ -30860,7 +31230,7 @@ var require_fast_uri = __commonJS({
|
|
|
30860
31230
|
}
|
|
30861
31231
|
return uri;
|
|
30862
31232
|
}
|
|
30863
|
-
function
|
|
31233
|
+
function resolve3(baseURI, relativeURI, options) {
|
|
30864
31234
|
const schemelessOptions = Object.assign({ scheme: "null" }, options);
|
|
30865
31235
|
const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
30866
31236
|
return serialize(resolved, { ...schemelessOptions, skipEscape: true });
|
|
@@ -31091,7 +31461,7 @@ var require_fast_uri = __commonJS({
|
|
|
31091
31461
|
var fastUri = {
|
|
31092
31462
|
SCHEMES,
|
|
31093
31463
|
normalize,
|
|
31094
|
-
resolve,
|
|
31464
|
+
resolve: resolve3,
|
|
31095
31465
|
resolveComponents,
|
|
31096
31466
|
equal,
|
|
31097
31467
|
serialize,
|
|
@@ -34183,12 +34553,12 @@ var require_isexe = __commonJS({
|
|
|
34183
34553
|
if (typeof Promise !== "function") {
|
|
34184
34554
|
throw new TypeError("callback not provided");
|
|
34185
34555
|
}
|
|
34186
|
-
return new Promise(function(
|
|
34556
|
+
return new Promise(function(resolve3, reject) {
|
|
34187
34557
|
isexe(path3, options || {}, function(er, is) {
|
|
34188
34558
|
if (er) {
|
|
34189
34559
|
reject(er);
|
|
34190
34560
|
} else {
|
|
34191
|
-
|
|
34561
|
+
resolve3(is);
|
|
34192
34562
|
}
|
|
34193
34563
|
});
|
|
34194
34564
|
});
|
|
@@ -34253,28 +34623,28 @@ var require_which = __commonJS({
|
|
|
34253
34623
|
if (!opt)
|
|
34254
34624
|
opt = {};
|
|
34255
34625
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
34256
|
-
const
|
|
34257
|
-
const step = (i) => new Promise((
|
|
34626
|
+
const found2 = [];
|
|
34627
|
+
const step = (i) => new Promise((resolve3, reject) => {
|
|
34258
34628
|
if (i === pathEnv.length)
|
|
34259
|
-
return opt.all &&
|
|
34629
|
+
return opt.all && found2.length ? resolve3(found2) : reject(getNotFoundError(cmd));
|
|
34260
34630
|
const ppRaw = pathEnv[i];
|
|
34261
34631
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
34262
34632
|
const pCmd = path3.join(pathPart, cmd);
|
|
34263
34633
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
34264
|
-
|
|
34634
|
+
resolve3(subStep(p2, i, 0));
|
|
34265
34635
|
});
|
|
34266
|
-
const subStep = (p2, i, ii) => new Promise((
|
|
34636
|
+
const subStep = (p2, i, ii) => new Promise((resolve3, reject) => {
|
|
34267
34637
|
if (ii === pathExt.length)
|
|
34268
|
-
return
|
|
34638
|
+
return resolve3(step(i + 1));
|
|
34269
34639
|
const ext = pathExt[ii];
|
|
34270
34640
|
isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
34271
34641
|
if (!er && is) {
|
|
34272
34642
|
if (opt.all)
|
|
34273
|
-
|
|
34643
|
+
found2.push(p2 + ext);
|
|
34274
34644
|
else
|
|
34275
|
-
return
|
|
34645
|
+
return resolve3(p2 + ext);
|
|
34276
34646
|
}
|
|
34277
|
-
return
|
|
34647
|
+
return resolve3(subStep(p2, i, ii + 1));
|
|
34278
34648
|
});
|
|
34279
34649
|
});
|
|
34280
34650
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -34282,7 +34652,7 @@ var require_which = __commonJS({
|
|
|
34282
34652
|
var whichSync = (cmd, opt) => {
|
|
34283
34653
|
opt = opt || {};
|
|
34284
34654
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
34285
|
-
const
|
|
34655
|
+
const found2 = [];
|
|
34286
34656
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
34287
34657
|
const ppRaw = pathEnv[i];
|
|
34288
34658
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
@@ -34294,7 +34664,7 @@ var require_which = __commonJS({
|
|
|
34294
34664
|
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
34295
34665
|
if (is) {
|
|
34296
34666
|
if (opt.all)
|
|
34297
|
-
|
|
34667
|
+
found2.push(cur);
|
|
34298
34668
|
else
|
|
34299
34669
|
return cur;
|
|
34300
34670
|
}
|
|
@@ -34302,8 +34672,8 @@ var require_which = __commonJS({
|
|
|
34302
34672
|
}
|
|
34303
34673
|
}
|
|
34304
34674
|
}
|
|
34305
|
-
if (opt.all &&
|
|
34306
|
-
return
|
|
34675
|
+
if (opt.all && found2.length)
|
|
34676
|
+
return found2;
|
|
34307
34677
|
if (opt.nothrow)
|
|
34308
34678
|
return null;
|
|
34309
34679
|
throw getNotFoundError(cmd);
|
|
@@ -35401,11 +35771,11 @@ function parseCallExpression(sys2, node, sourceFile, typeChecker) {
|
|
|
35401
35771
|
import_typescript12.default.isTaggedTemplateExpression(node2) && import_typescript12.default.isIdentifier(node2.tag) && (node2.tag.escapedText === "html" || node2.tag.escapedText === "tmpl")
|
|
35402
35772
|
) {
|
|
35403
35773
|
if (import_typescript12.default.isTemplateExpression(node2.template)) {
|
|
35404
|
-
const
|
|
35774
|
+
const found2 = node2.template.templateSpans.find(
|
|
35405
35775
|
(a) => import_typescript12.default.isIdentifier(a.expression) && isCapitalized(a.expression.text) && getExportStatement2(a.expression)
|
|
35406
35776
|
);
|
|
35407
|
-
if (
|
|
35408
|
-
builderName =
|
|
35777
|
+
if (found2 && import_typescript12.default.isIdentifier(found2.expression)) {
|
|
35778
|
+
builderName = found2.expression.text;
|
|
35409
35779
|
return;
|
|
35410
35780
|
}
|
|
35411
35781
|
}
|
|
@@ -35711,7 +36081,7 @@ async function getFigmaAuth(sys2) {
|
|
|
35711
36081
|
sys: sys2,
|
|
35712
36082
|
name: "Figma",
|
|
35713
36083
|
initialPort: DEFAULT_FIGMA_PORT,
|
|
35714
|
-
requestListener: async (port, req, res,
|
|
36084
|
+
requestListener: async (port, req, res, resolve3, reject) => {
|
|
35715
36085
|
const url = new URL(req.url || "", `http://localhost:${port}`);
|
|
35716
36086
|
if (url.pathname === "/figma-connect") {
|
|
35717
36087
|
const code = url.searchParams.get("code");
|
|
@@ -35745,7 +36115,7 @@ async function getFigmaAuth(sys2) {
|
|
|
35745
36115
|
"The CLI has authenticated correctly with Figma"
|
|
35746
36116
|
),
|
|
35747
36117
|
() => {
|
|
35748
|
-
|
|
36118
|
+
resolve3({
|
|
35749
36119
|
...data,
|
|
35750
36120
|
oauth: true
|
|
35751
36121
|
});
|
|
@@ -35777,7 +36147,7 @@ async function getBuilderAuth(sys2, preferSpaceId) {
|
|
|
35777
36147
|
sys: sys2,
|
|
35778
36148
|
name: "Builder.io",
|
|
35779
36149
|
initialPort: DEFAULT_BUILDER_PORT,
|
|
35780
|
-
requestListener: async (port, req, res,
|
|
36150
|
+
requestListener: async (port, req, res, resolve3) => {
|
|
35781
36151
|
const url = new URL(req.url || "", `http://localhost:${port}`);
|
|
35782
36152
|
if (url.pathname === BUILDER_AUTH_RETURN_PATH) {
|
|
35783
36153
|
res.end(
|
|
@@ -35786,7 +36156,7 @@ async function getBuilderAuth(sys2, preferSpaceId) {
|
|
|
35786
36156
|
"The CLI has authenticated correctly with Builder.io"
|
|
35787
36157
|
),
|
|
35788
36158
|
() => {
|
|
35789
|
-
|
|
36159
|
+
resolve3({
|
|
35790
36160
|
privateKey: url.searchParams.get("p-key") || "",
|
|
35791
36161
|
spaceId: url.searchParams.get("api-key") || "",
|
|
35792
36162
|
spaceName: url.searchParams.get("org-name") || "",
|
|
@@ -35881,17 +36251,17 @@ function loadCredentials(sys2) {
|
|
|
35881
36251
|
return {};
|
|
35882
36252
|
}
|
|
35883
36253
|
async function createAuthServer(opts) {
|
|
35884
|
-
let
|
|
36254
|
+
let resolve3;
|
|
35885
36255
|
let reject;
|
|
35886
36256
|
let s2;
|
|
35887
36257
|
const promise = new Promise((re, rej) => {
|
|
35888
|
-
|
|
36258
|
+
resolve3 = re;
|
|
35889
36259
|
reject = rej;
|
|
35890
36260
|
});
|
|
35891
36261
|
let currentPort = opts.initialPort;
|
|
35892
36262
|
let attempt = 0;
|
|
35893
36263
|
const server = (0, import_http.createServer)(
|
|
35894
|
-
(req, res) => opts.requestListener(currentPort, req, res,
|
|
36264
|
+
(req, res) => opts.requestListener(currentPort, req, res, resolve3, reject)
|
|
35895
36265
|
);
|
|
35896
36266
|
const closeServer = () => {
|
|
35897
36267
|
clearHooks();
|
|
@@ -36360,7 +36730,7 @@ async function createDevToolsHttpServer(ctx) {
|
|
|
36360
36730
|
handleDevRequest(ctx, server, request2, response2);
|
|
36361
36731
|
});
|
|
36362
36732
|
const shutdownServer = () => {
|
|
36363
|
-
return new Promise((
|
|
36733
|
+
return new Promise((resolve3, reject) => {
|
|
36364
36734
|
if (server.listening) {
|
|
36365
36735
|
ctx.debug(`closing devtools server on port ${port}`);
|
|
36366
36736
|
server.close((err) => {
|
|
@@ -36372,12 +36742,12 @@ async function createDevToolsHttpServer(ctx) {
|
|
|
36372
36742
|
if (ctx) {
|
|
36373
36743
|
ctx.debug(`closed devtools server on port ${port}`);
|
|
36374
36744
|
}
|
|
36375
|
-
|
|
36745
|
+
resolve3();
|
|
36376
36746
|
}
|
|
36377
36747
|
});
|
|
36378
36748
|
} else {
|
|
36379
36749
|
ctx.debug(`devtools server on port ${port} not listening`);
|
|
36380
|
-
|
|
36750
|
+
resolve3();
|
|
36381
36751
|
}
|
|
36382
36752
|
});
|
|
36383
36753
|
};
|
|
@@ -36398,15 +36768,15 @@ async function createDevToolsHttpServer(ctx) {
|
|
|
36398
36768
|
await shutdownServer();
|
|
36399
36769
|
}
|
|
36400
36770
|
};
|
|
36401
|
-
return new Promise((
|
|
36771
|
+
return new Promise((resolve3) => {
|
|
36402
36772
|
server.listen(port, () => {
|
|
36403
36773
|
ctx.debug(`started devtools server on port ${port}`);
|
|
36404
|
-
|
|
36774
|
+
resolve3(globalThis.__builderDevToolsServer);
|
|
36405
36775
|
});
|
|
36406
36776
|
});
|
|
36407
36777
|
}
|
|
36408
36778
|
function setupDevToolsPort(ctx) {
|
|
36409
|
-
return new Promise((
|
|
36779
|
+
return new Promise((resolve3) => {
|
|
36410
36780
|
const port = ctx.port;
|
|
36411
36781
|
try {
|
|
36412
36782
|
const options = {
|
|
@@ -36418,15 +36788,15 @@ function setupDevToolsPort(ctx) {
|
|
|
36418
36788
|
(0, import_node_http2.request)(options, (res) => {
|
|
36419
36789
|
res.on("end", () => {
|
|
36420
36790
|
ctx.debug(`${DEV_TOOLS_SERVER_CLOSE_PATH} - Response ended`);
|
|
36421
|
-
|
|
36791
|
+
resolve3(port);
|
|
36422
36792
|
});
|
|
36423
36793
|
}).on("error", (error) => {
|
|
36424
36794
|
ctx.debug(`${DEV_TOOLS_SERVER_CLOSE_PATH} - No response ${error}`);
|
|
36425
|
-
|
|
36795
|
+
resolve3(port);
|
|
36426
36796
|
}).end();
|
|
36427
36797
|
} catch (e2) {
|
|
36428
36798
|
ctx.debug(`${DEV_TOOLS_SERVER_CLOSE_PATH} - Error ${e2}`);
|
|
36429
|
-
|
|
36799
|
+
resolve3(port);
|
|
36430
36800
|
}
|
|
36431
36801
|
});
|
|
36432
36802
|
}
|