@builder.io/dev-tools 1.18.44-dev.202512111132.bf5b095a5 → 1.18.44-dev.202512111428.dadde891f
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 +2262 -1289
- 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 +1133 -191
- package/server/index.mjs +1151 -209
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/core/component-map-builder.d.ts +42 -0
- package/types/server/source-map-resolver.d.ts +31 -0
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types.d.ts +13 -1
- package/types/cli/repo-indexing.d.ts +0 -17
- package/types/cli/repo-indexing.mock.d.ts +0 -5
- package/types/cli/utils/repo-indexing-group-prompts.d.ts +0 -1
- package/types/scripts/analyze-projects.d.ts +0 -18
- package/types/scripts/call-ensure-container.d.ts +0 -4
- package/types/scripts/check-backup.d.ts +0 -1
- package/types/scripts/cli.d.ts +0 -1
- package/types/scripts/download-projects.d.ts +0 -12
- package/types/scripts/utils/db.d.ts +0 -3
- package/types/scripts/utils/ensure-container.d.ts +0 -7
- package/types/scripts/utils/remove-machine-and-volume.d.ts +0 -5
package/server/index.mjs
CHANGED
|
@@ -45,7 +45,7 @@ var builderVersion, pkgVersion;
|
|
|
45
45
|
var init_version = __esm({
|
|
46
46
|
"packages/dev-tools/cli/version.ts"() {
|
|
47
47
|
"use strict";
|
|
48
|
-
builderVersion = true ? "1.18.44-dev.
|
|
48
|
+
builderVersion = true ? "1.18.44-dev.202512111428.dadde891f" : "0.0.0";
|
|
49
49
|
pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
@@ -157,12 +157,12 @@ function getImportPath(sys2, containingModulePath, moduleToImportPath) {
|
|
|
157
157
|
}
|
|
158
158
|
return p2;
|
|
159
159
|
}
|
|
160
|
-
function normalizePathSlash(
|
|
161
|
-
const isExtendedLengthPath =
|
|
160
|
+
function normalizePathSlash(path3) {
|
|
161
|
+
const isExtendedLengthPath = path3.startsWith("\\\\?\\");
|
|
162
162
|
if (isExtendedLengthPath) {
|
|
163
|
-
return
|
|
163
|
+
return path3;
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return path3.replace(/\\/g, "/");
|
|
166
166
|
}
|
|
167
167
|
function getComponentImportNameFilePath(sys2, filePath) {
|
|
168
168
|
const ext = sys2.extname(filePath);
|
|
@@ -204,15 +204,15 @@ function getComponentImportPath(sys2, absFilePath) {
|
|
|
204
204
|
return "~/" + relFilePath;
|
|
205
205
|
}
|
|
206
206
|
function getDisplayFilePath(sys2, filePath) {
|
|
207
|
-
let
|
|
207
|
+
let path3 = filePath;
|
|
208
208
|
let parts = [];
|
|
209
209
|
for (let i = 0; i < 2; i++) {
|
|
210
|
-
const part = sys2.basename(
|
|
210
|
+
const part = sys2.basename(path3);
|
|
211
211
|
if (!part || part === "components") {
|
|
212
212
|
break;
|
|
213
213
|
}
|
|
214
214
|
parts.unshift(part);
|
|
215
|
-
|
|
215
|
+
path3 = sys2.dirname(path3);
|
|
216
216
|
}
|
|
217
217
|
return parts.join("/");
|
|
218
218
|
}
|
|
@@ -834,7 +834,7 @@ import { request as httpRequest } from "node:http";
|
|
|
834
834
|
import { request as httpsRequest } from "node:https";
|
|
835
835
|
function requestJSON(opts) {
|
|
836
836
|
const startTime = Date.now();
|
|
837
|
-
return new Promise((
|
|
837
|
+
return new Promise((resolve4, reject) => {
|
|
838
838
|
const request2 = getRequestModule(opts.url);
|
|
839
839
|
const req = request2(
|
|
840
840
|
{
|
|
@@ -861,7 +861,7 @@ function requestJSON(opts) {
|
|
|
861
861
|
);
|
|
862
862
|
} else {
|
|
863
863
|
try {
|
|
864
|
-
|
|
864
|
+
resolve4(JSON.parse(data));
|
|
865
865
|
} catch (err) {
|
|
866
866
|
reject(
|
|
867
867
|
`Response from ${opts.url.href} is not valid JSON: ${data}
|
|
@@ -1106,7 +1106,7 @@ async function connectBuilder(ctx, publicApiKey, privateAuthKey, kind) {
|
|
|
1106
1106
|
let MAX_RETRIES = 5;
|
|
1107
1107
|
let retries = 0;
|
|
1108
1108
|
while (!hasContent && retries < MAX_RETRIES) {
|
|
1109
|
-
await new Promise((
|
|
1109
|
+
await new Promise((resolve4) => setTimeout(resolve4, 1e3));
|
|
1110
1110
|
let content = await hasBuilderContentViaQueryAPI({
|
|
1111
1111
|
model: DEFAULT_MODEL_NAME,
|
|
1112
1112
|
pageUrl: frameworkPageOpts.pathname,
|
|
@@ -1142,7 +1142,7 @@ async function connectBuilder(ctx, publicApiKey, privateAuthKey, kind) {
|
|
|
1142
1142
|
`modified files: ${modifiedFiles.map((m2) => m2.displayFilePath).join(", ")}`
|
|
1143
1143
|
);
|
|
1144
1144
|
await ctx.restartAppServer();
|
|
1145
|
-
await new Promise((
|
|
1145
|
+
await new Promise((resolve4) => setTimeout(resolve4, 500));
|
|
1146
1146
|
} else {
|
|
1147
1147
|
ctx.debug(`no modified files`);
|
|
1148
1148
|
}
|
|
@@ -1194,6 +1194,927 @@ var init_builder_connect = __esm({
|
|
|
1194
1194
|
}
|
|
1195
1195
|
});
|
|
1196
1196
|
|
|
1197
|
+
// node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
1198
|
+
function decodeInteger(reader, relative) {
|
|
1199
|
+
let value = 0;
|
|
1200
|
+
let shift = 0;
|
|
1201
|
+
let integer = 0;
|
|
1202
|
+
do {
|
|
1203
|
+
const c = reader.next();
|
|
1204
|
+
integer = charToInt[c];
|
|
1205
|
+
value |= (integer & 31) << shift;
|
|
1206
|
+
shift += 5;
|
|
1207
|
+
} while (integer & 32);
|
|
1208
|
+
const shouldNegate = value & 1;
|
|
1209
|
+
value >>>= 1;
|
|
1210
|
+
if (shouldNegate) {
|
|
1211
|
+
value = -2147483648 | -value;
|
|
1212
|
+
}
|
|
1213
|
+
return relative + value;
|
|
1214
|
+
}
|
|
1215
|
+
function hasMoreVlq(reader, max) {
|
|
1216
|
+
if (reader.pos >= max)
|
|
1217
|
+
return false;
|
|
1218
|
+
return reader.peek() !== comma;
|
|
1219
|
+
}
|
|
1220
|
+
function decode(mappings) {
|
|
1221
|
+
const { length } = mappings;
|
|
1222
|
+
const reader = new StringReader(mappings);
|
|
1223
|
+
const decoded = [];
|
|
1224
|
+
let genColumn = 0;
|
|
1225
|
+
let sourcesIndex = 0;
|
|
1226
|
+
let sourceLine = 0;
|
|
1227
|
+
let sourceColumn = 0;
|
|
1228
|
+
let namesIndex = 0;
|
|
1229
|
+
do {
|
|
1230
|
+
const semi = reader.indexOf(";");
|
|
1231
|
+
const line = [];
|
|
1232
|
+
let sorted = true;
|
|
1233
|
+
let lastCol = 0;
|
|
1234
|
+
genColumn = 0;
|
|
1235
|
+
while (reader.pos < semi) {
|
|
1236
|
+
let seg;
|
|
1237
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
1238
|
+
if (genColumn < lastCol)
|
|
1239
|
+
sorted = false;
|
|
1240
|
+
lastCol = genColumn;
|
|
1241
|
+
if (hasMoreVlq(reader, semi)) {
|
|
1242
|
+
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
1243
|
+
sourceLine = decodeInteger(reader, sourceLine);
|
|
1244
|
+
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
1245
|
+
if (hasMoreVlq(reader, semi)) {
|
|
1246
|
+
namesIndex = decodeInteger(reader, namesIndex);
|
|
1247
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
|
|
1248
|
+
} else {
|
|
1249
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
|
|
1250
|
+
}
|
|
1251
|
+
} else {
|
|
1252
|
+
seg = [genColumn];
|
|
1253
|
+
}
|
|
1254
|
+
line.push(seg);
|
|
1255
|
+
reader.pos++;
|
|
1256
|
+
}
|
|
1257
|
+
if (!sorted)
|
|
1258
|
+
sort(line);
|
|
1259
|
+
decoded.push(line);
|
|
1260
|
+
reader.pos = semi + 1;
|
|
1261
|
+
} while (reader.pos <= length);
|
|
1262
|
+
return decoded;
|
|
1263
|
+
}
|
|
1264
|
+
function sort(line) {
|
|
1265
|
+
line.sort(sortComparator);
|
|
1266
|
+
}
|
|
1267
|
+
function sortComparator(a, b3) {
|
|
1268
|
+
return a[0] - b3[0];
|
|
1269
|
+
}
|
|
1270
|
+
var comma, semicolon, chars, intToChar, charToInt, bufLength, StringReader;
|
|
1271
|
+
var init_sourcemap_codec = __esm({
|
|
1272
|
+
"node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs"() {
|
|
1273
|
+
comma = ",".charCodeAt(0);
|
|
1274
|
+
semicolon = ";".charCodeAt(0);
|
|
1275
|
+
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1276
|
+
intToChar = new Uint8Array(64);
|
|
1277
|
+
charToInt = new Uint8Array(128);
|
|
1278
|
+
for (let i = 0; i < chars.length; i++) {
|
|
1279
|
+
const c = chars.charCodeAt(i);
|
|
1280
|
+
intToChar[i] = c;
|
|
1281
|
+
charToInt[c] = i;
|
|
1282
|
+
}
|
|
1283
|
+
bufLength = 1024 * 16;
|
|
1284
|
+
StringReader = class {
|
|
1285
|
+
constructor(buffer) {
|
|
1286
|
+
this.pos = 0;
|
|
1287
|
+
this.buffer = buffer;
|
|
1288
|
+
}
|
|
1289
|
+
next() {
|
|
1290
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
1291
|
+
}
|
|
1292
|
+
peek() {
|
|
1293
|
+
return this.buffer.charCodeAt(this.pos);
|
|
1294
|
+
}
|
|
1295
|
+
indexOf(char) {
|
|
1296
|
+
const { buffer, pos } = this;
|
|
1297
|
+
const idx = buffer.indexOf(char, pos);
|
|
1298
|
+
return idx === -1 ? buffer.length : idx;
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
});
|
|
1303
|
+
|
|
1304
|
+
// node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
1305
|
+
function isAbsoluteUrl(input) {
|
|
1306
|
+
return schemeRegex.test(input);
|
|
1307
|
+
}
|
|
1308
|
+
function isSchemeRelativeUrl(input) {
|
|
1309
|
+
return input.startsWith("//");
|
|
1310
|
+
}
|
|
1311
|
+
function isAbsolutePath(input) {
|
|
1312
|
+
return input.startsWith("/");
|
|
1313
|
+
}
|
|
1314
|
+
function isFileUrl(input) {
|
|
1315
|
+
return input.startsWith("file:");
|
|
1316
|
+
}
|
|
1317
|
+
function isRelative(input) {
|
|
1318
|
+
return /^[.?#]/.test(input);
|
|
1319
|
+
}
|
|
1320
|
+
function parseAbsoluteUrl(input) {
|
|
1321
|
+
const match = urlRegex.exec(input);
|
|
1322
|
+
return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
|
|
1323
|
+
}
|
|
1324
|
+
function parseFileUrl(input) {
|
|
1325
|
+
const match = fileRegex.exec(input);
|
|
1326
|
+
const path3 = match[2];
|
|
1327
|
+
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path3) ? path3 : "/" + path3, match[3] || "", match[4] || "");
|
|
1328
|
+
}
|
|
1329
|
+
function makeUrl(scheme, user, host, port, path3, query, hash) {
|
|
1330
|
+
return {
|
|
1331
|
+
scheme,
|
|
1332
|
+
user,
|
|
1333
|
+
host,
|
|
1334
|
+
port,
|
|
1335
|
+
path: path3,
|
|
1336
|
+
query,
|
|
1337
|
+
hash,
|
|
1338
|
+
type: 7
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
function parseUrl(input) {
|
|
1342
|
+
if (isSchemeRelativeUrl(input)) {
|
|
1343
|
+
const url2 = parseAbsoluteUrl("http:" + input);
|
|
1344
|
+
url2.scheme = "";
|
|
1345
|
+
url2.type = 6;
|
|
1346
|
+
return url2;
|
|
1347
|
+
}
|
|
1348
|
+
if (isAbsolutePath(input)) {
|
|
1349
|
+
const url2 = parseAbsoluteUrl("http://foo.com" + input);
|
|
1350
|
+
url2.scheme = "";
|
|
1351
|
+
url2.host = "";
|
|
1352
|
+
url2.type = 5;
|
|
1353
|
+
return url2;
|
|
1354
|
+
}
|
|
1355
|
+
if (isFileUrl(input))
|
|
1356
|
+
return parseFileUrl(input);
|
|
1357
|
+
if (isAbsoluteUrl(input))
|
|
1358
|
+
return parseAbsoluteUrl(input);
|
|
1359
|
+
const url = parseAbsoluteUrl("http://foo.com/" + input);
|
|
1360
|
+
url.scheme = "";
|
|
1361
|
+
url.host = "";
|
|
1362
|
+
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
1363
|
+
return url;
|
|
1364
|
+
}
|
|
1365
|
+
function stripPathFilename(path3) {
|
|
1366
|
+
if (path3.endsWith("/.."))
|
|
1367
|
+
return path3;
|
|
1368
|
+
const index = path3.lastIndexOf("/");
|
|
1369
|
+
return path3.slice(0, index + 1);
|
|
1370
|
+
}
|
|
1371
|
+
function mergePaths(url, base) {
|
|
1372
|
+
normalizePath(base, base.type);
|
|
1373
|
+
if (url.path === "/") {
|
|
1374
|
+
url.path = base.path;
|
|
1375
|
+
} else {
|
|
1376
|
+
url.path = stripPathFilename(base.path) + url.path;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
function normalizePath(url, type) {
|
|
1380
|
+
const rel = type <= 4;
|
|
1381
|
+
const pieces = url.path.split("/");
|
|
1382
|
+
let pointer = 1;
|
|
1383
|
+
let positive = 0;
|
|
1384
|
+
let addTrailingSlash = false;
|
|
1385
|
+
for (let i = 1; i < pieces.length; i++) {
|
|
1386
|
+
const piece = pieces[i];
|
|
1387
|
+
if (!piece) {
|
|
1388
|
+
addTrailingSlash = true;
|
|
1389
|
+
continue;
|
|
1390
|
+
}
|
|
1391
|
+
addTrailingSlash = false;
|
|
1392
|
+
if (piece === ".")
|
|
1393
|
+
continue;
|
|
1394
|
+
if (piece === "..") {
|
|
1395
|
+
if (positive) {
|
|
1396
|
+
addTrailingSlash = true;
|
|
1397
|
+
positive--;
|
|
1398
|
+
pointer--;
|
|
1399
|
+
} else if (rel) {
|
|
1400
|
+
pieces[pointer++] = piece;
|
|
1401
|
+
}
|
|
1402
|
+
continue;
|
|
1403
|
+
}
|
|
1404
|
+
pieces[pointer++] = piece;
|
|
1405
|
+
positive++;
|
|
1406
|
+
}
|
|
1407
|
+
let path3 = "";
|
|
1408
|
+
for (let i = 1; i < pointer; i++) {
|
|
1409
|
+
path3 += "/" + pieces[i];
|
|
1410
|
+
}
|
|
1411
|
+
if (!path3 || addTrailingSlash && !path3.endsWith("/..")) {
|
|
1412
|
+
path3 += "/";
|
|
1413
|
+
}
|
|
1414
|
+
url.path = path3;
|
|
1415
|
+
}
|
|
1416
|
+
function resolve(input, base) {
|
|
1417
|
+
if (!input && !base)
|
|
1418
|
+
return "";
|
|
1419
|
+
const url = parseUrl(input);
|
|
1420
|
+
let inputType = url.type;
|
|
1421
|
+
if (base && inputType !== 7) {
|
|
1422
|
+
const baseUrl = parseUrl(base);
|
|
1423
|
+
const baseType = baseUrl.type;
|
|
1424
|
+
switch (inputType) {
|
|
1425
|
+
case 1:
|
|
1426
|
+
url.hash = baseUrl.hash;
|
|
1427
|
+
// fall through
|
|
1428
|
+
case 2:
|
|
1429
|
+
url.query = baseUrl.query;
|
|
1430
|
+
// fall through
|
|
1431
|
+
case 3:
|
|
1432
|
+
case 4:
|
|
1433
|
+
mergePaths(url, baseUrl);
|
|
1434
|
+
// fall through
|
|
1435
|
+
case 5:
|
|
1436
|
+
url.user = baseUrl.user;
|
|
1437
|
+
url.host = baseUrl.host;
|
|
1438
|
+
url.port = baseUrl.port;
|
|
1439
|
+
// fall through
|
|
1440
|
+
case 6:
|
|
1441
|
+
url.scheme = baseUrl.scheme;
|
|
1442
|
+
}
|
|
1443
|
+
if (baseType > inputType)
|
|
1444
|
+
inputType = baseType;
|
|
1445
|
+
}
|
|
1446
|
+
normalizePath(url, inputType);
|
|
1447
|
+
const queryHash = url.query + url.hash;
|
|
1448
|
+
switch (inputType) {
|
|
1449
|
+
// This is impossible, because of the empty checks at the start of the function.
|
|
1450
|
+
// case UrlType.Empty:
|
|
1451
|
+
case 2:
|
|
1452
|
+
case 3:
|
|
1453
|
+
return queryHash;
|
|
1454
|
+
case 4: {
|
|
1455
|
+
const path3 = url.path.slice(1);
|
|
1456
|
+
if (!path3)
|
|
1457
|
+
return queryHash || ".";
|
|
1458
|
+
if (isRelative(base || input) && !isRelative(path3)) {
|
|
1459
|
+
return "./" + path3 + queryHash;
|
|
1460
|
+
}
|
|
1461
|
+
return path3 + queryHash;
|
|
1462
|
+
}
|
|
1463
|
+
case 5:
|
|
1464
|
+
return url.path + queryHash;
|
|
1465
|
+
default:
|
|
1466
|
+
return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
var schemeRegex, urlRegex, fileRegex;
|
|
1470
|
+
var init_resolve_uri = __esm({
|
|
1471
|
+
"node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs"() {
|
|
1472
|
+
schemeRegex = /^[\w+.-]+:\/\//;
|
|
1473
|
+
urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
1474
|
+
fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
1475
|
+
}
|
|
1476
|
+
});
|
|
1477
|
+
|
|
1478
|
+
// node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
1479
|
+
function resolve2(input, base) {
|
|
1480
|
+
if (base && !base.endsWith("/"))
|
|
1481
|
+
base += "/";
|
|
1482
|
+
return resolve(input, base);
|
|
1483
|
+
}
|
|
1484
|
+
function stripFilename(path3) {
|
|
1485
|
+
if (!path3)
|
|
1486
|
+
return "";
|
|
1487
|
+
const index = path3.lastIndexOf("/");
|
|
1488
|
+
return path3.slice(0, index + 1);
|
|
1489
|
+
}
|
|
1490
|
+
function maybeSort(mappings, owned) {
|
|
1491
|
+
const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
|
|
1492
|
+
if (unsortedIndex === mappings.length)
|
|
1493
|
+
return mappings;
|
|
1494
|
+
if (!owned)
|
|
1495
|
+
mappings = mappings.slice();
|
|
1496
|
+
for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
|
|
1497
|
+
mappings[i] = sortSegments(mappings[i], owned);
|
|
1498
|
+
}
|
|
1499
|
+
return mappings;
|
|
1500
|
+
}
|
|
1501
|
+
function nextUnsortedSegmentLine(mappings, start) {
|
|
1502
|
+
for (let i = start; i < mappings.length; i++) {
|
|
1503
|
+
if (!isSorted(mappings[i]))
|
|
1504
|
+
return i;
|
|
1505
|
+
}
|
|
1506
|
+
return mappings.length;
|
|
1507
|
+
}
|
|
1508
|
+
function isSorted(line) {
|
|
1509
|
+
for (let j2 = 1; j2 < line.length; j2++) {
|
|
1510
|
+
if (line[j2][COLUMN] < line[j2 - 1][COLUMN]) {
|
|
1511
|
+
return false;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
return true;
|
|
1515
|
+
}
|
|
1516
|
+
function sortSegments(line, owned) {
|
|
1517
|
+
if (!owned)
|
|
1518
|
+
line = line.slice();
|
|
1519
|
+
return line.sort(sortComparator2);
|
|
1520
|
+
}
|
|
1521
|
+
function sortComparator2(a, b3) {
|
|
1522
|
+
return a[COLUMN] - b3[COLUMN];
|
|
1523
|
+
}
|
|
1524
|
+
function binarySearch(haystack, needle, low, high) {
|
|
1525
|
+
while (low <= high) {
|
|
1526
|
+
const mid = low + (high - low >> 1);
|
|
1527
|
+
const cmp = haystack[mid][COLUMN] - needle;
|
|
1528
|
+
if (cmp === 0) {
|
|
1529
|
+
found = true;
|
|
1530
|
+
return mid;
|
|
1531
|
+
}
|
|
1532
|
+
if (cmp < 0) {
|
|
1533
|
+
low = mid + 1;
|
|
1534
|
+
} else {
|
|
1535
|
+
high = mid - 1;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
found = false;
|
|
1539
|
+
return low - 1;
|
|
1540
|
+
}
|
|
1541
|
+
function upperBound(haystack, needle, index) {
|
|
1542
|
+
for (let i = index + 1; i < haystack.length; index = i++) {
|
|
1543
|
+
if (haystack[i][COLUMN] !== needle)
|
|
1544
|
+
break;
|
|
1545
|
+
}
|
|
1546
|
+
return index;
|
|
1547
|
+
}
|
|
1548
|
+
function lowerBound(haystack, needle, index) {
|
|
1549
|
+
for (let i = index - 1; i >= 0; index = i--) {
|
|
1550
|
+
if (haystack[i][COLUMN] !== needle)
|
|
1551
|
+
break;
|
|
1552
|
+
}
|
|
1553
|
+
return index;
|
|
1554
|
+
}
|
|
1555
|
+
function memoizedState() {
|
|
1556
|
+
return {
|
|
1557
|
+
lastKey: -1,
|
|
1558
|
+
lastNeedle: -1,
|
|
1559
|
+
lastIndex: -1
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
1563
|
+
const { lastKey, lastNeedle, lastIndex } = state;
|
|
1564
|
+
let low = 0;
|
|
1565
|
+
let high = haystack.length - 1;
|
|
1566
|
+
if (key === lastKey) {
|
|
1567
|
+
if (needle === lastNeedle) {
|
|
1568
|
+
found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
|
|
1569
|
+
return lastIndex;
|
|
1570
|
+
}
|
|
1571
|
+
if (needle >= lastNeedle) {
|
|
1572
|
+
low = lastIndex === -1 ? 0 : lastIndex;
|
|
1573
|
+
} else {
|
|
1574
|
+
high = lastIndex;
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
state.lastKey = key;
|
|
1578
|
+
state.lastNeedle = needle;
|
|
1579
|
+
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
1580
|
+
}
|
|
1581
|
+
function cast(map) {
|
|
1582
|
+
return map;
|
|
1583
|
+
}
|
|
1584
|
+
function decodedMappings(map) {
|
|
1585
|
+
var _a;
|
|
1586
|
+
return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
|
|
1587
|
+
}
|
|
1588
|
+
function originalPositionFor(map, needle) {
|
|
1589
|
+
let { line, column, bias } = needle;
|
|
1590
|
+
line--;
|
|
1591
|
+
if (line < 0)
|
|
1592
|
+
throw new Error(LINE_GTR_ZERO);
|
|
1593
|
+
if (column < 0)
|
|
1594
|
+
throw new Error(COL_GTR_EQ_ZERO);
|
|
1595
|
+
const decoded = decodedMappings(map);
|
|
1596
|
+
if (line >= decoded.length)
|
|
1597
|
+
return OMapping(null, null, null, null);
|
|
1598
|
+
const segments = decoded[line];
|
|
1599
|
+
const index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
|
|
1600
|
+
if (index === -1)
|
|
1601
|
+
return OMapping(null, null, null, null);
|
|
1602
|
+
const segment = segments[index];
|
|
1603
|
+
if (segment.length === 1)
|
|
1604
|
+
return OMapping(null, null, null, null);
|
|
1605
|
+
const { names, resolvedSources } = map;
|
|
1606
|
+
return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
|
|
1607
|
+
}
|
|
1608
|
+
function OMapping(source, line, column, name) {
|
|
1609
|
+
return { source, line, column, name };
|
|
1610
|
+
}
|
|
1611
|
+
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
1612
|
+
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
1613
|
+
if (found) {
|
|
1614
|
+
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
|
|
1615
|
+
} else if (bias === LEAST_UPPER_BOUND)
|
|
1616
|
+
index++;
|
|
1617
|
+
if (index === -1 || index === segments.length)
|
|
1618
|
+
return -1;
|
|
1619
|
+
return index;
|
|
1620
|
+
}
|
|
1621
|
+
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;
|
|
1622
|
+
var init_trace_mapping = __esm({
|
|
1623
|
+
"node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs"() {
|
|
1624
|
+
init_sourcemap_codec();
|
|
1625
|
+
init_resolve_uri();
|
|
1626
|
+
COLUMN = 0;
|
|
1627
|
+
SOURCES_INDEX = 1;
|
|
1628
|
+
SOURCE_LINE = 2;
|
|
1629
|
+
SOURCE_COLUMN = 3;
|
|
1630
|
+
NAMES_INDEX = 4;
|
|
1631
|
+
found = false;
|
|
1632
|
+
LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
|
|
1633
|
+
COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
1634
|
+
LEAST_UPPER_BOUND = -1;
|
|
1635
|
+
GREATEST_LOWER_BOUND = 1;
|
|
1636
|
+
TraceMap = class {
|
|
1637
|
+
constructor(map, mapUrl) {
|
|
1638
|
+
const isString2 = typeof map === "string";
|
|
1639
|
+
if (!isString2 && map._decodedMemo)
|
|
1640
|
+
return map;
|
|
1641
|
+
const parsed = isString2 ? JSON.parse(map) : map;
|
|
1642
|
+
const { version: version4, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
1643
|
+
this.version = version4;
|
|
1644
|
+
this.file = file;
|
|
1645
|
+
this.names = names || [];
|
|
1646
|
+
this.sourceRoot = sourceRoot;
|
|
1647
|
+
this.sources = sources;
|
|
1648
|
+
this.sourcesContent = sourcesContent;
|
|
1649
|
+
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
|
1650
|
+
const from = resolve2(sourceRoot || "", stripFilename(mapUrl));
|
|
1651
|
+
this.resolvedSources = sources.map((s2) => resolve2(s2 || "", from));
|
|
1652
|
+
const { mappings } = parsed;
|
|
1653
|
+
if (typeof mappings === "string") {
|
|
1654
|
+
this._encoded = mappings;
|
|
1655
|
+
this._decoded = void 0;
|
|
1656
|
+
} else {
|
|
1657
|
+
this._encoded = void 0;
|
|
1658
|
+
this._decoded = maybeSort(mappings, isString2);
|
|
1659
|
+
}
|
|
1660
|
+
this._decodedMemo = memoizedState();
|
|
1661
|
+
this._bySources = void 0;
|
|
1662
|
+
this._bySourceMemos = void 0;
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
});
|
|
1667
|
+
|
|
1668
|
+
// packages/dev-tools/server/source-map-resolver.ts
|
|
1669
|
+
import * as fs from "fs";
|
|
1670
|
+
import * as path2 from "path";
|
|
1671
|
+
function cacheSet(key, value) {
|
|
1672
|
+
if (traceMapCache.size >= MAX_CACHE_SIZE) {
|
|
1673
|
+
const firstKey = traceMapCache.keys().next().value;
|
|
1674
|
+
if (firstKey) {
|
|
1675
|
+
traceMapCache.delete(firstKey);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
traceMapCache.set(key, value);
|
|
1679
|
+
}
|
|
1680
|
+
function cacheGet(key) {
|
|
1681
|
+
if (!traceMapCache.has(key)) {
|
|
1682
|
+
CACHE_STATS.misses++;
|
|
1683
|
+
return void 0;
|
|
1684
|
+
}
|
|
1685
|
+
CACHE_STATS.hits++;
|
|
1686
|
+
const value = traceMapCache.get(key);
|
|
1687
|
+
traceMapCache.delete(key);
|
|
1688
|
+
traceMapCache.set(key, value);
|
|
1689
|
+
return value;
|
|
1690
|
+
}
|
|
1691
|
+
function extractSourceMappingURL(content) {
|
|
1692
|
+
const lines = content.split("\n").slice(-10);
|
|
1693
|
+
for (const line of lines.reverse()) {
|
|
1694
|
+
const match = line.match(/\/\/[#@]\s*sourceMappingURL=(.+)/);
|
|
1695
|
+
if (match) {
|
|
1696
|
+
let url = match[1].trim();
|
|
1697
|
+
try {
|
|
1698
|
+
url = decodeURIComponent(url);
|
|
1699
|
+
} catch (e2) {
|
|
1700
|
+
}
|
|
1701
|
+
return url;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
return null;
|
|
1705
|
+
}
|
|
1706
|
+
async function loadSourceMap(projectRoot, devServerUrl, bundledPath, sourceMappingURL) {
|
|
1707
|
+
try {
|
|
1708
|
+
if (sourceMappingURL.startsWith("data:")) {
|
|
1709
|
+
const base64Match = sourceMappingURL.match(
|
|
1710
|
+
/^data:application\/json;(?:charset=utf-8;)?base64,(.+)$/
|
|
1711
|
+
);
|
|
1712
|
+
if (base64Match) {
|
|
1713
|
+
return Buffer.from(base64Match[1], "base64").toString("utf-8");
|
|
1714
|
+
}
|
|
1715
|
+
console.error(
|
|
1716
|
+
`[SourceMap] Unsupported inline source map format: ${sourceMappingURL.substring(0, 50)}...`
|
|
1717
|
+
);
|
|
1718
|
+
return null;
|
|
1719
|
+
}
|
|
1720
|
+
const bundledDir = path2.dirname(bundledPath);
|
|
1721
|
+
const isServerChunk = bundledPath.includes(".next/server/") || bundledPath.includes("_next/server/");
|
|
1722
|
+
if (isServerChunk) {
|
|
1723
|
+
const normalizedPath2 = sourceMappingURL.startsWith("/") ? sourceMappingURL.substring(1) : sourceMappingURL;
|
|
1724
|
+
const possiblePaths2 = [
|
|
1725
|
+
path2.join(projectRoot, bundledDir.replace(/^\//, ""), normalizedPath2),
|
|
1726
|
+
path2.join(projectRoot, normalizedPath2)
|
|
1727
|
+
];
|
|
1728
|
+
for (const possiblePath of possiblePaths2) {
|
|
1729
|
+
const resolvedPath = path2.resolve(possiblePath);
|
|
1730
|
+
const resolvedRoot = path2.resolve(projectRoot);
|
|
1731
|
+
if (!resolvedPath.startsWith(resolvedRoot)) {
|
|
1732
|
+
continue;
|
|
1733
|
+
}
|
|
1734
|
+
if (fs.existsSync(possiblePath)) {
|
|
1735
|
+
return fs.readFileSync(possiblePath, "utf-8");
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
console.error(
|
|
1739
|
+
`[SourceMap] Server chunk source map not found: ${sourceMappingURL}`
|
|
1740
|
+
);
|
|
1741
|
+
return null;
|
|
1742
|
+
}
|
|
1743
|
+
const sourceMapPath = path2.join(bundledDir, sourceMappingURL);
|
|
1744
|
+
const sourceMapUrl = `${devServerUrl}${sourceMapPath.startsWith("/") ? sourceMapPath : "/" + sourceMapPath}`;
|
|
1745
|
+
try {
|
|
1746
|
+
const response2 = await fetch(sourceMapUrl);
|
|
1747
|
+
if (response2.ok) {
|
|
1748
|
+
return await response2.text();
|
|
1749
|
+
}
|
|
1750
|
+
} catch (fetchError) {
|
|
1751
|
+
}
|
|
1752
|
+
const normalizedPath = sourceMappingURL.startsWith("/") ? sourceMappingURL.substring(1) : sourceMappingURL;
|
|
1753
|
+
const possiblePaths = [
|
|
1754
|
+
path2.join(projectRoot, bundledDir, normalizedPath),
|
|
1755
|
+
path2.join(projectRoot, normalizedPath),
|
|
1756
|
+
path2.join(
|
|
1757
|
+
projectRoot,
|
|
1758
|
+
bundledDir.replace("_next/", ".next/"),
|
|
1759
|
+
normalizedPath
|
|
1760
|
+
)
|
|
1761
|
+
];
|
|
1762
|
+
for (const possiblePath of possiblePaths) {
|
|
1763
|
+
const resolvedPath = path2.resolve(possiblePath);
|
|
1764
|
+
const resolvedRoot = path2.resolve(projectRoot);
|
|
1765
|
+
if (!resolvedPath.startsWith(resolvedRoot)) {
|
|
1766
|
+
continue;
|
|
1767
|
+
}
|
|
1768
|
+
if (fs.existsSync(possiblePath)) {
|
|
1769
|
+
return fs.readFileSync(possiblePath, "utf-8");
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
console.error(
|
|
1773
|
+
`[SourceMap] Source map not found: ${sourceMappingURL} (tried ${possiblePaths.length} paths)`
|
|
1774
|
+
);
|
|
1775
|
+
return null;
|
|
1776
|
+
} catch (error) {
|
|
1777
|
+
console.error(`[SourceMap] Error loading source map:`, error);
|
|
1778
|
+
return null;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
async function resolveSourceLocation(projectRoot, devServerUrl, bundledPath, line, column) {
|
|
1782
|
+
try {
|
|
1783
|
+
try {
|
|
1784
|
+
bundledPath = decodeURIComponent(bundledPath);
|
|
1785
|
+
} catch (e2) {
|
|
1786
|
+
}
|
|
1787
|
+
if (bundledPath.includes("file://") || bundledPath.includes("/Server/") || bundledPath.includes("..") || // Prevent directory traversal
|
|
1788
|
+
bundledPath.includes("~")) {
|
|
1789
|
+
return null;
|
|
1790
|
+
}
|
|
1791
|
+
const normalizedBundledPath = path2.normalize(bundledPath);
|
|
1792
|
+
if (normalizedBundledPath.includes("..")) {
|
|
1793
|
+
return null;
|
|
1794
|
+
}
|
|
1795
|
+
const filename = bundledPath.split("/").pop() || "";
|
|
1796
|
+
const isServerChunk = bundledPath.includes(".next/server/") || bundledPath.includes("_next/server/");
|
|
1797
|
+
const definitelyInternalPatterns = [
|
|
1798
|
+
"webpack_",
|
|
1799
|
+
// Webpack runtime
|
|
1800
|
+
"[turbopack]",
|
|
1801
|
+
// Turbopack runtime
|
|
1802
|
+
"next-devtools",
|
|
1803
|
+
// Next.js devtools
|
|
1804
|
+
"polyfill"
|
|
1805
|
+
// Polyfills
|
|
1806
|
+
];
|
|
1807
|
+
if (definitelyInternalPatterns.some((pattern) => filename.includes(pattern))) {
|
|
1808
|
+
return null;
|
|
1809
|
+
}
|
|
1810
|
+
let jsContent;
|
|
1811
|
+
if (isServerChunk) {
|
|
1812
|
+
const fsPath = path2.join(projectRoot, bundledPath.replace(/^\//, ""));
|
|
1813
|
+
const resolvedPath = path2.resolve(fsPath);
|
|
1814
|
+
const resolvedRoot = path2.resolve(projectRoot);
|
|
1815
|
+
if (!resolvedPath.startsWith(resolvedRoot)) {
|
|
1816
|
+
console.error(
|
|
1817
|
+
`[SourceMap] Path traversal attempt detected: ${bundledPath}`
|
|
1818
|
+
);
|
|
1819
|
+
return null;
|
|
1820
|
+
}
|
|
1821
|
+
if (!fs.existsSync(fsPath)) {
|
|
1822
|
+
console.error(`[SourceMap] Server chunk file not found: ${fsPath}`);
|
|
1823
|
+
return null;
|
|
1824
|
+
}
|
|
1825
|
+
jsContent = fs.readFileSync(fsPath, "utf-8");
|
|
1826
|
+
} else {
|
|
1827
|
+
const fileUrl = `${devServerUrl}${bundledPath.startsWith("/") ? bundledPath : "/" + bundledPath}`;
|
|
1828
|
+
try {
|
|
1829
|
+
const response2 = await fetch(fileUrl);
|
|
1830
|
+
if (!response2.ok) {
|
|
1831
|
+
console.error(
|
|
1832
|
+
`[SourceMap] Failed to fetch JS file: ${response2.status} ${response2.statusText}`
|
|
1833
|
+
);
|
|
1834
|
+
return null;
|
|
1835
|
+
}
|
|
1836
|
+
jsContent = await response2.text();
|
|
1837
|
+
} catch (fetchError) {
|
|
1838
|
+
console.error(
|
|
1839
|
+
`[SourceMap] Network error fetching JS file:`,
|
|
1840
|
+
fetchError
|
|
1841
|
+
);
|
|
1842
|
+
return null;
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
const sourceMappingURL = extractSourceMappingURL(jsContent);
|
|
1846
|
+
if (!sourceMappingURL) {
|
|
1847
|
+
console.error(`[SourceMap] No sourceMappingURL found in ${bundledPath}`);
|
|
1848
|
+
return null;
|
|
1849
|
+
}
|
|
1850
|
+
const baseCacheKey = `${bundledPath}:${sourceMappingURL}`;
|
|
1851
|
+
const rawMapCacheKey = `${baseCacheKey}:raw`;
|
|
1852
|
+
let sourceMapJson = cacheGet(rawMapCacheKey);
|
|
1853
|
+
let tracer = null;
|
|
1854
|
+
if (sourceMapJson === null) {
|
|
1855
|
+
return null;
|
|
1856
|
+
}
|
|
1857
|
+
if (sourceMapJson === void 0) {
|
|
1858
|
+
const sourceMapContent = await loadSourceMap(
|
|
1859
|
+
projectRoot,
|
|
1860
|
+
devServerUrl,
|
|
1861
|
+
bundledPath,
|
|
1862
|
+
sourceMappingURL
|
|
1863
|
+
);
|
|
1864
|
+
if (!sourceMapContent) {
|
|
1865
|
+
cacheSet(rawMapCacheKey, null);
|
|
1866
|
+
return null;
|
|
1867
|
+
}
|
|
1868
|
+
try {
|
|
1869
|
+
sourceMapJson = JSON.parse(sourceMapContent);
|
|
1870
|
+
if (!sourceMapJson || typeof sourceMapJson !== "object") {
|
|
1871
|
+
console.error(
|
|
1872
|
+
`[SourceMap] Invalid source map structure (not an object)`
|
|
1873
|
+
);
|
|
1874
|
+
cacheSet(rawMapCacheKey, null);
|
|
1875
|
+
return null;
|
|
1876
|
+
}
|
|
1877
|
+
if (!sourceMapJson.mappings && !sourceMapJson.sections && sourceMapJson.version !== 3) {
|
|
1878
|
+
console.error(
|
|
1879
|
+
`[SourceMap] Invalid source map: missing mappings/sections or wrong version`
|
|
1880
|
+
);
|
|
1881
|
+
console.error(
|
|
1882
|
+
`[SourceMap] Available fields:`,
|
|
1883
|
+
Object.keys(sourceMapJson)
|
|
1884
|
+
);
|
|
1885
|
+
cacheSet(rawMapCacheKey, null);
|
|
1886
|
+
return null;
|
|
1887
|
+
}
|
|
1888
|
+
if (sourceMapJson.sections) {
|
|
1889
|
+
if (!Array.isArray(sourceMapJson.sections)) {
|
|
1890
|
+
console.error(
|
|
1891
|
+
`[SourceMap] Invalid indexed source map: sections is not an array`
|
|
1892
|
+
);
|
|
1893
|
+
cacheSet(rawMapCacheKey, null);
|
|
1894
|
+
return null;
|
|
1895
|
+
}
|
|
1896
|
+
for (let i = 0; i < sourceMapJson.sections.length; i++) {
|
|
1897
|
+
const section = sourceMapJson.sections[i];
|
|
1898
|
+
if (!section.offset) {
|
|
1899
|
+
console.error(
|
|
1900
|
+
`[SourceMap] Section ${i} missing offset:`,
|
|
1901
|
+
JSON.stringify(section).substring(0, 200)
|
|
1902
|
+
);
|
|
1903
|
+
cacheSet(rawMapCacheKey, null);
|
|
1904
|
+
return null;
|
|
1905
|
+
}
|
|
1906
|
+
if (!section.map && !section.url) {
|
|
1907
|
+
console.error(
|
|
1908
|
+
`[SourceMap] Section ${i} missing both map and url:`,
|
|
1909
|
+
JSON.stringify(section).substring(0, 200)
|
|
1910
|
+
);
|
|
1911
|
+
cacheSet(rawMapCacheKey, null);
|
|
1912
|
+
return null;
|
|
1913
|
+
}
|
|
1914
|
+
if (section.url) {
|
|
1915
|
+
console.error(
|
|
1916
|
+
`[SourceMap] Section ${i} uses 'url' reference (not supported yet): ${section.url}`
|
|
1917
|
+
);
|
|
1918
|
+
cacheSet(rawMapCacheKey, null);
|
|
1919
|
+
return null;
|
|
1920
|
+
}
|
|
1921
|
+
if (section.map) {
|
|
1922
|
+
if (!section.map.version) {
|
|
1923
|
+
console.error(`[SourceMap] Section ${i}.map missing version`);
|
|
1924
|
+
cacheSet(rawMapCacheKey, null);
|
|
1925
|
+
return null;
|
|
1926
|
+
}
|
|
1927
|
+
if (typeof section.map.mappings !== "string") {
|
|
1928
|
+
console.error(
|
|
1929
|
+
`[SourceMap] Section ${i}.map has invalid mappings type: ${typeof section.map.mappings}`
|
|
1930
|
+
);
|
|
1931
|
+
cacheSet(rawMapCacheKey, null);
|
|
1932
|
+
return null;
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
if (Array.isArray(sourceMapJson.sources) && sourceMapJson.sources.length === 0) {
|
|
1937
|
+
delete sourceMapJson.sources;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
try {
|
|
1941
|
+
if (sourceMapJson.sections) {
|
|
1942
|
+
let matchingSection = null;
|
|
1943
|
+
let sectionIndex = -1;
|
|
1944
|
+
for (let i = 0; i < sourceMapJson.sections.length; i++) {
|
|
1945
|
+
const section = sourceMapJson.sections[i];
|
|
1946
|
+
const sectionLine = section.offset.line;
|
|
1947
|
+
const sectionColumn = section.offset.column;
|
|
1948
|
+
if (line > sectionLine || line === sectionLine && column >= sectionColumn) {
|
|
1949
|
+
matchingSection = section;
|
|
1950
|
+
sectionIndex = i;
|
|
1951
|
+
} else {
|
|
1952
|
+
break;
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
if (!matchingSection || !matchingSection.map) {
|
|
1956
|
+
return null;
|
|
1957
|
+
}
|
|
1958
|
+
const relativeLine = line - matchingSection.offset.line;
|
|
1959
|
+
const relativeColumn = line === matchingSection.offset.line ? column - matchingSection.offset.column : column;
|
|
1960
|
+
tracer = new TraceMap(matchingSection.map);
|
|
1961
|
+
const sectionCacheKey = `${baseCacheKey}:section${sectionIndex}`;
|
|
1962
|
+
cacheSet(sectionCacheKey, tracer);
|
|
1963
|
+
line = relativeLine;
|
|
1964
|
+
column = relativeColumn;
|
|
1965
|
+
} else {
|
|
1966
|
+
tracer = new TraceMap(sourceMapJson);
|
|
1967
|
+
cacheSet(baseCacheKey, tracer);
|
|
1968
|
+
}
|
|
1969
|
+
if (!cacheGet(rawMapCacheKey)) {
|
|
1970
|
+
cacheSet(rawMapCacheKey, sourceMapJson);
|
|
1971
|
+
}
|
|
1972
|
+
} catch (traceMapError) {
|
|
1973
|
+
console.error(
|
|
1974
|
+
`[SourceMap] TraceMap construction failed:`,
|
|
1975
|
+
traceMapError.message
|
|
1976
|
+
);
|
|
1977
|
+
console.error(
|
|
1978
|
+
`[SourceMap] Source map structure:`,
|
|
1979
|
+
JSON.stringify(
|
|
1980
|
+
{
|
|
1981
|
+
version: sourceMapJson.version,
|
|
1982
|
+
hasMapping: !!sourceMapJson.mappings,
|
|
1983
|
+
hasSections: !!sourceMapJson.sections,
|
|
1984
|
+
sectionsCount: sourceMapJson.sections?.length,
|
|
1985
|
+
sourcesCount: sourceMapJson.sources?.length
|
|
1986
|
+
},
|
|
1987
|
+
null,
|
|
1988
|
+
2
|
|
1989
|
+
)
|
|
1990
|
+
);
|
|
1991
|
+
cacheSet(rawMapCacheKey, null);
|
|
1992
|
+
return null;
|
|
1993
|
+
}
|
|
1994
|
+
} catch (parseError) {
|
|
1995
|
+
console.error(`[SourceMap] Error parsing source map:`, parseError);
|
|
1996
|
+
console.error(
|
|
1997
|
+
`[SourceMap] Source map content preview:`,
|
|
1998
|
+
sourceMapContent.substring(0, 500)
|
|
1999
|
+
);
|
|
2000
|
+
cacheSet(rawMapCacheKey, null);
|
|
2001
|
+
return null;
|
|
2002
|
+
}
|
|
2003
|
+
} else {
|
|
2004
|
+
if (sourceMapJson.sections) {
|
|
2005
|
+
let matchingSection = null;
|
|
2006
|
+
let sectionIndex = -1;
|
|
2007
|
+
for (let i = 0; i < sourceMapJson.sections.length; i++) {
|
|
2008
|
+
const section = sourceMapJson.sections[i];
|
|
2009
|
+
if (line > section.offset.line || line === section.offset.line && column >= section.offset.column) {
|
|
2010
|
+
matchingSection = section;
|
|
2011
|
+
sectionIndex = i;
|
|
2012
|
+
} else {
|
|
2013
|
+
break;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
if (matchingSection) {
|
|
2017
|
+
const sectionCacheKey = `${baseCacheKey}:section${sectionIndex}`;
|
|
2018
|
+
tracer = cacheGet(sectionCacheKey);
|
|
2019
|
+
const relativeLine = line - matchingSection.offset.line;
|
|
2020
|
+
const relativeColumn = line === matchingSection.offset.line ? column - matchingSection.offset.column : column;
|
|
2021
|
+
if (!tracer) {
|
|
2022
|
+
tracer = new TraceMap(matchingSection.map);
|
|
2023
|
+
cacheSet(sectionCacheKey, tracer);
|
|
2024
|
+
}
|
|
2025
|
+
line = relativeLine;
|
|
2026
|
+
column = relativeColumn;
|
|
2027
|
+
}
|
|
2028
|
+
} else {
|
|
2029
|
+
tracer = cacheGet(baseCacheKey);
|
|
2030
|
+
if (!tracer) {
|
|
2031
|
+
tracer = new TraceMap(sourceMapJson);
|
|
2032
|
+
cacheSet(baseCacheKey, tracer);
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
if (!tracer) {
|
|
2037
|
+
return null;
|
|
2038
|
+
}
|
|
2039
|
+
const original = originalPositionFor(tracer, {
|
|
2040
|
+
line,
|
|
2041
|
+
column
|
|
2042
|
+
});
|
|
2043
|
+
if (!original || !original.source || original.line === null || original.column === null) {
|
|
2044
|
+
return null;
|
|
2045
|
+
}
|
|
2046
|
+
let cleanSource = original.source;
|
|
2047
|
+
if (cleanSource.startsWith("webpack://")) {
|
|
2048
|
+
cleanSource = cleanSource.replace(/^webpack:\/\/[^/]*\//, "");
|
|
2049
|
+
}
|
|
2050
|
+
if (cleanSource.startsWith("./")) {
|
|
2051
|
+
cleanSource = cleanSource.substring(2);
|
|
2052
|
+
}
|
|
2053
|
+
if (cleanSource.startsWith("file://")) {
|
|
2054
|
+
cleanSource = decodeURIComponent(cleanSource.replace(/^file:\/\//, ""));
|
|
2055
|
+
if (cleanSource.startsWith(projectRoot)) {
|
|
2056
|
+
cleanSource = cleanSource.substring(projectRoot.length);
|
|
2057
|
+
if (cleanSource.startsWith("/")) {
|
|
2058
|
+
cleanSource = cleanSource.substring(1);
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
const isFrameworkCode = cleanSource.includes("/node_modules/") || cleanSource.includes("react-dom") || cleanSource.includes("react-server") || cleanSource.includes("next/dist/") || cleanSource.includes("@swc/helpers") || cleanSource.includes("scheduler");
|
|
2063
|
+
if (isFrameworkCode) {
|
|
2064
|
+
return null;
|
|
2065
|
+
}
|
|
2066
|
+
const result = {
|
|
2067
|
+
source: cleanSource,
|
|
2068
|
+
line: original.line,
|
|
2069
|
+
column: original.column,
|
|
2070
|
+
name: original.name || void 0
|
|
2071
|
+
};
|
|
2072
|
+
return result;
|
|
2073
|
+
} catch (error) {
|
|
2074
|
+
console.error(`[SourceMap] Error resolving source location:`, error);
|
|
2075
|
+
return null;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
async function batchResolveSourceLocations(projectRoot, devServerUrl, locations) {
|
|
2079
|
+
const requestMap = /* @__PURE__ */ new Map();
|
|
2080
|
+
locations.forEach((loc, index) => {
|
|
2081
|
+
const key = `${loc.bundledPath}:${loc.line}:${loc.column}`;
|
|
2082
|
+
if (requestMap.has(key)) {
|
|
2083
|
+
requestMap.get(key).indices.push(index);
|
|
2084
|
+
} else {
|
|
2085
|
+
requestMap.set(key, { indices: [index], request: loc });
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
const uniqueResults = /* @__PURE__ */ new Map();
|
|
2089
|
+
for (const [key, { request: request2 }] of requestMap) {
|
|
2090
|
+
const resolved = await resolveSourceLocation(
|
|
2091
|
+
projectRoot,
|
|
2092
|
+
devServerUrl,
|
|
2093
|
+
request2.bundledPath,
|
|
2094
|
+
request2.line,
|
|
2095
|
+
request2.column
|
|
2096
|
+
);
|
|
2097
|
+
uniqueResults.set(key, resolved);
|
|
2098
|
+
}
|
|
2099
|
+
const results = [];
|
|
2100
|
+
for (let i = 0; i < locations.length; i++) {
|
|
2101
|
+
const loc = locations[i];
|
|
2102
|
+
const key = `${loc.bundledPath}:${loc.line}:${loc.column}`;
|
|
2103
|
+
results.push(uniqueResults.get(key) || null);
|
|
2104
|
+
}
|
|
2105
|
+
return results;
|
|
2106
|
+
}
|
|
2107
|
+
var MAX_CACHE_SIZE, CACHE_STATS, traceMapCache;
|
|
2108
|
+
var init_source_map_resolver = __esm({
|
|
2109
|
+
"packages/dev-tools/server/source-map-resolver.ts"() {
|
|
2110
|
+
"use strict";
|
|
2111
|
+
init_trace_mapping();
|
|
2112
|
+
MAX_CACHE_SIZE = 500;
|
|
2113
|
+
CACHE_STATS = { hits: 0, misses: 0 };
|
|
2114
|
+
traceMapCache = /* @__PURE__ */ new Map();
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
|
|
1197
2118
|
// packages/dev-tools/server/dev-tools-api.ts
|
|
1198
2119
|
async function handleDevApiRequest(ctx, apiReq) {
|
|
1199
2120
|
const result = {
|
|
@@ -1317,6 +2238,26 @@ async function handleDevApiRequest(ctx, apiReq) {
|
|
|
1317
2238
|
result.data = await readConfigFile();
|
|
1318
2239
|
break;
|
|
1319
2240
|
}
|
|
2241
|
+
case "resolveSourceMap": {
|
|
2242
|
+
const projectRoot = ctx.getAppRootDir();
|
|
2243
|
+
const devServerUrl = "http://localhost:3000";
|
|
2244
|
+
if (Array.isArray(apiReq.data)) {
|
|
2245
|
+
result.data = await batchResolveSourceLocations(
|
|
2246
|
+
projectRoot,
|
|
2247
|
+
devServerUrl,
|
|
2248
|
+
apiReq.data
|
|
2249
|
+
);
|
|
2250
|
+
} else {
|
|
2251
|
+
result.data = await resolveSourceLocation(
|
|
2252
|
+
projectRoot,
|
|
2253
|
+
devServerUrl,
|
|
2254
|
+
apiReq.data.bundledPath,
|
|
2255
|
+
apiReq.data.line,
|
|
2256
|
+
apiReq.data.column
|
|
2257
|
+
);
|
|
2258
|
+
}
|
|
2259
|
+
break;
|
|
2260
|
+
}
|
|
1320
2261
|
default: {
|
|
1321
2262
|
result.errors = [`Unknown request type: ${JSON.stringify(apiReq)}`];
|
|
1322
2263
|
const _exhaustiveCheck = apiReq;
|
|
@@ -1325,15 +2266,15 @@ async function handleDevApiRequest(ctx, apiReq) {
|
|
|
1325
2266
|
}
|
|
1326
2267
|
return result;
|
|
1327
2268
|
}
|
|
1328
|
-
function isValidFileRequest(sys2,
|
|
1329
|
-
if (!
|
|
2269
|
+
function isValidFileRequest(sys2, path3) {
|
|
2270
|
+
if (!path3) {
|
|
1330
2271
|
return false;
|
|
1331
2272
|
}
|
|
1332
|
-
if (
|
|
2273
|
+
if (path3.includes("..")) {
|
|
1333
2274
|
return false;
|
|
1334
2275
|
}
|
|
1335
|
-
|
|
1336
|
-
const parts =
|
|
2276
|
+
path3 = path3.replace(/\\/g, "/");
|
|
2277
|
+
const parts = path3.split("/");
|
|
1337
2278
|
const last = parts[parts.length - 1];
|
|
1338
2279
|
if (last.length > 0) {
|
|
1339
2280
|
let ext = last.split(".").pop();
|
|
@@ -1345,7 +2286,7 @@ function isValidFileRequest(sys2, path2) {
|
|
|
1345
2286
|
}
|
|
1346
2287
|
}
|
|
1347
2288
|
}
|
|
1348
|
-
if (!validatePath(sys2,
|
|
2289
|
+
if (!validatePath(sys2, path3)) {
|
|
1349
2290
|
return false;
|
|
1350
2291
|
}
|
|
1351
2292
|
return false;
|
|
@@ -1383,6 +2324,7 @@ var init_dev_tools_api = __esm({
|
|
|
1383
2324
|
init_typescript();
|
|
1384
2325
|
init_node_sys();
|
|
1385
2326
|
init_builder_connect();
|
|
2327
|
+
init_source_map_resolver();
|
|
1386
2328
|
EXT_WHITELIST = [
|
|
1387
2329
|
".js",
|
|
1388
2330
|
".jsx",
|
|
@@ -1420,7 +2362,7 @@ var init_dev_tools_api = __esm({
|
|
|
1420
2362
|
|
|
1421
2363
|
// packages/dev-tools/server/client-script.ts
|
|
1422
2364
|
async function getClientScript(ctx) {
|
|
1423
|
-
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.44-dev.202512111132.bf5b095a5";\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.44-dev.202512111132.bf5b095a5");\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.44-dev.202512111132.bf5b095a5"}`);\n initDevToolsApp();\n }\n})();');
|
|
2365
|
+
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.44-dev.202512111428.dadde891f";\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.44-dev.202512111428.dadde891f");\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.44-dev.202512111428.dadde891f"}`);\n initDevToolsApp();\n }\n})();');
|
|
1424
2366
|
}
|
|
1425
2367
|
async function getConnectedStepHtml(ctx) {
|
|
1426
2368
|
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');
|
|
@@ -6854,11 +7796,11 @@ async function createNextDevToolsSys(sys2) {
|
|
|
6854
7796
|
addExternalPackage: (pkgName) => {
|
|
6855
7797
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
6856
7798
|
},
|
|
6857
|
-
readFileSync: (
|
|
6858
|
-
existsSync: (
|
|
6859
|
-
readdirSync: (
|
|
6860
|
-
const realFiles = sys2.readdirSync(
|
|
6861
|
-
if (
|
|
7799
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
7800
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
7801
|
+
readdirSync: (path3) => {
|
|
7802
|
+
const realFiles = sys2.readdirSync(path3);
|
|
7803
|
+
if (path3 === rootDir) {
|
|
6862
7804
|
return [
|
|
6863
7805
|
...realFiles,
|
|
6864
7806
|
...Object.keys(externalPackages).map(
|
|
@@ -6868,9 +7810,9 @@ async function createNextDevToolsSys(sys2) {
|
|
|
6868
7810
|
}
|
|
6869
7811
|
return realFiles;
|
|
6870
7812
|
},
|
|
6871
|
-
readdir: async (
|
|
6872
|
-
const realFiles = await sys2.readdir(
|
|
6873
|
-
if (
|
|
7813
|
+
readdir: async (path3) => {
|
|
7814
|
+
const realFiles = await sys2.readdir(path3);
|
|
7815
|
+
if (path3 === rootDir) {
|
|
6874
7816
|
return [
|
|
6875
7817
|
...realFiles,
|
|
6876
7818
|
...Object.keys(externalPackages).map(
|
|
@@ -8702,11 +9644,11 @@ async function createRemixDevToolsSys(sys2) {
|
|
|
8702
9644
|
addExternalPackage: (pkgName) => {
|
|
8703
9645
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
8704
9646
|
},
|
|
8705
|
-
readFileSync: (
|
|
8706
|
-
existsSync: (
|
|
8707
|
-
readdirSync: (
|
|
8708
|
-
const realFiles = sys2.readdirSync(
|
|
8709
|
-
if (
|
|
9647
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
9648
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
9649
|
+
readdirSync: (path3) => {
|
|
9650
|
+
const realFiles = sys2.readdirSync(path3);
|
|
9651
|
+
if (path3 === rootDir) {
|
|
8710
9652
|
return [
|
|
8711
9653
|
...realFiles,
|
|
8712
9654
|
...Object.keys(externalPackages).map(
|
|
@@ -8716,9 +9658,9 @@ async function createRemixDevToolsSys(sys2) {
|
|
|
8716
9658
|
}
|
|
8717
9659
|
return realFiles;
|
|
8718
9660
|
},
|
|
8719
|
-
readdir: async (
|
|
8720
|
-
const realFiles = await sys2.readdir(
|
|
8721
|
-
if (
|
|
9661
|
+
readdir: async (path3) => {
|
|
9662
|
+
const realFiles = await sys2.readdir(path3);
|
|
9663
|
+
if (path3 === rootDir) {
|
|
8722
9664
|
return [
|
|
8723
9665
|
...realFiles,
|
|
8724
9666
|
...Object.keys(externalPackages).map(
|
|
@@ -9902,11 +10844,11 @@ async function createReactDevToolsSys(sys2) {
|
|
|
9902
10844
|
addExternalPackage: (pkgName) => {
|
|
9903
10845
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
9904
10846
|
},
|
|
9905
|
-
readFileSync: (
|
|
9906
|
-
existsSync: (
|
|
9907
|
-
readdirSync: (
|
|
9908
|
-
const realFiles = sys2.readdirSync(
|
|
9909
|
-
if (
|
|
10847
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
10848
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
10849
|
+
readdirSync: (path3) => {
|
|
10850
|
+
const realFiles = sys2.readdirSync(path3);
|
|
10851
|
+
if (path3 === rootDir) {
|
|
9910
10852
|
return [
|
|
9911
10853
|
...realFiles,
|
|
9912
10854
|
...Object.keys(externalPackages).map(
|
|
@@ -9916,9 +10858,9 @@ async function createReactDevToolsSys(sys2) {
|
|
|
9916
10858
|
}
|
|
9917
10859
|
return realFiles;
|
|
9918
10860
|
},
|
|
9919
|
-
readdir: async (
|
|
9920
|
-
const realFiles = await sys2.readdir(
|
|
9921
|
-
if (
|
|
10861
|
+
readdir: async (path3) => {
|
|
10862
|
+
const realFiles = await sys2.readdir(path3);
|
|
10863
|
+
if (path3 === rootDir) {
|
|
9922
10864
|
return [
|
|
9923
10865
|
...realFiles,
|
|
9924
10866
|
...Object.keys(externalPackages).map(
|
|
@@ -10843,7 +11785,7 @@ var init_angular_app_module_imports = __esm({
|
|
|
10843
11785
|
});
|
|
10844
11786
|
|
|
10845
11787
|
// packages/dev-tools/core/adapters/angular/angular-app-routes-update.ts
|
|
10846
|
-
async function angularAddRoute(sys2,
|
|
11788
|
+
async function angularAddRoute(sys2, path3, componentName, componentPath) {
|
|
10847
11789
|
const fileExtension = sys2.typescriptEnabled ? ".ts" : ".js";
|
|
10848
11790
|
const fileName = `app.routes${fileExtension}`;
|
|
10849
11791
|
const appRoutesPath = sys2.join(sys2.appDir, fileName);
|
|
@@ -10856,11 +11798,11 @@ async function angularAddRoute(sys2, path2, componentName, componentPath) {
|
|
|
10856
11798
|
}
|
|
10857
11799
|
const exportKey = Object.keys(mod.exports)[0];
|
|
10858
11800
|
const routes = mod.exports[exportKey];
|
|
10859
|
-
if (routes.find((r) => r.path ===
|
|
11801
|
+
if (routes.find((r) => r.path === path3)) {
|
|
10860
11802
|
return;
|
|
10861
11803
|
}
|
|
10862
11804
|
const newEntry = sys2.magicast.builders.raw("{}");
|
|
10863
|
-
newEntry.path =
|
|
11805
|
+
newEntry.path = path3;
|
|
10864
11806
|
newEntry.component = sys2.magicast.builders.raw(componentName);
|
|
10865
11807
|
routes.push(newEntry);
|
|
10866
11808
|
if (mod.imports.$items.find((i) => i.imported === componentName)) {
|
|
@@ -12868,11 +13810,11 @@ async function createAngularDevToolsSys(sys2) {
|
|
|
12868
13810
|
addExternalPackage: (pkgName) => {
|
|
12869
13811
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
12870
13812
|
},
|
|
12871
|
-
readFileSync: (
|
|
12872
|
-
existsSync: (
|
|
12873
|
-
readdirSync: (
|
|
12874
|
-
const realFiles = sys2.readdirSync(
|
|
12875
|
-
if (
|
|
13813
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
13814
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
13815
|
+
readdirSync: (path3) => {
|
|
13816
|
+
const realFiles = sys2.readdirSync(path3);
|
|
13817
|
+
if (path3 === rootDir) {
|
|
12876
13818
|
return [
|
|
12877
13819
|
...realFiles,
|
|
12878
13820
|
...Object.keys(externalPackages).map(
|
|
@@ -12882,9 +13824,9 @@ async function createAngularDevToolsSys(sys2) {
|
|
|
12882
13824
|
}
|
|
12883
13825
|
return realFiles;
|
|
12884
13826
|
},
|
|
12885
|
-
readdir: async (
|
|
12886
|
-
const realFiles = await sys2.readdir(
|
|
12887
|
-
if (
|
|
13827
|
+
readdir: async (path3) => {
|
|
13828
|
+
const realFiles = await sys2.readdir(path3);
|
|
13829
|
+
if (path3 === rootDir) {
|
|
12888
13830
|
return [
|
|
12889
13831
|
...realFiles,
|
|
12890
13832
|
...Object.keys(externalPackages).map(
|
|
@@ -13489,11 +14431,11 @@ async function createVueDevToolsSys(sys2) {
|
|
|
13489
14431
|
addExternalPackage: (pkgName) => {
|
|
13490
14432
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
13491
14433
|
},
|
|
13492
|
-
readFileSync: (
|
|
13493
|
-
existsSync: (
|
|
13494
|
-
readdirSync: (
|
|
13495
|
-
const realFiles = sys2.readdirSync(
|
|
13496
|
-
if (
|
|
14434
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
14435
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
14436
|
+
readdirSync: (path3) => {
|
|
14437
|
+
const realFiles = sys2.readdirSync(path3);
|
|
14438
|
+
if (path3 === rootDir) {
|
|
13497
14439
|
return [
|
|
13498
14440
|
...realFiles,
|
|
13499
14441
|
...Object.keys(externalPackages).map(
|
|
@@ -13503,9 +14445,9 @@ async function createVueDevToolsSys(sys2) {
|
|
|
13503
14445
|
}
|
|
13504
14446
|
return realFiles;
|
|
13505
14447
|
},
|
|
13506
|
-
readdir: async (
|
|
13507
|
-
const realFiles = await sys2.readdir(
|
|
13508
|
-
if (
|
|
14448
|
+
readdir: async (path3) => {
|
|
14449
|
+
const realFiles = await sys2.readdir(path3);
|
|
14450
|
+
if (path3 === rootDir) {
|
|
13509
14451
|
return [
|
|
13510
14452
|
...realFiles,
|
|
13511
14453
|
...Object.keys(externalPackages).map(
|
|
@@ -14049,7 +14991,7 @@ var require_core = __commonJS({
|
|
|
14049
14991
|
const o2 = {};
|
|
14050
14992
|
const vs = s2.split("|");
|
|
14051
14993
|
const key_id = vs[1];
|
|
14052
|
-
let keys =
|
|
14994
|
+
let keys = decode2(values, key_id);
|
|
14053
14995
|
const n = vs.length;
|
|
14054
14996
|
if (n - 2 === 1 && !Array.isArray(keys)) {
|
|
14055
14997
|
keys = [keys];
|
|
@@ -14057,7 +14999,7 @@ var require_core = __commonJS({
|
|
|
14057
14999
|
for (let i = 2; i < n; i++) {
|
|
14058
15000
|
const k3 = keys[i - 2];
|
|
14059
15001
|
let v = vs[i];
|
|
14060
|
-
v =
|
|
15002
|
+
v = decode2(values, v);
|
|
14061
15003
|
o2[k3] = v;
|
|
14062
15004
|
}
|
|
14063
15005
|
return o2;
|
|
@@ -14071,12 +15013,12 @@ var require_core = __commonJS({
|
|
|
14071
15013
|
const xs = new Array(n);
|
|
14072
15014
|
for (let i = 0; i < n; i++) {
|
|
14073
15015
|
let v = vs[i + 1];
|
|
14074
|
-
v =
|
|
15016
|
+
v = decode2(values, v);
|
|
14075
15017
|
xs[i] = v;
|
|
14076
15018
|
}
|
|
14077
15019
|
return xs;
|
|
14078
15020
|
}
|
|
14079
|
-
function
|
|
15021
|
+
function decode2(values, key) {
|
|
14080
15022
|
if (key === "" || key === "_") {
|
|
14081
15023
|
return null;
|
|
14082
15024
|
}
|
|
@@ -14107,10 +15049,10 @@ var require_core = __commonJS({
|
|
|
14107
15049
|
}
|
|
14108
15050
|
return (0, debug_1.throwUnknownDataType)(v);
|
|
14109
15051
|
}
|
|
14110
|
-
exports.decode =
|
|
15052
|
+
exports.decode = decode2;
|
|
14111
15053
|
function decompress2(c) {
|
|
14112
15054
|
const [values, root] = c;
|
|
14113
|
-
return
|
|
15055
|
+
return decode2(values, root);
|
|
14114
15056
|
}
|
|
14115
15057
|
exports.decompress = decompress2;
|
|
14116
15058
|
}
|
|
@@ -15783,11 +16725,11 @@ var init_lib = __esm({
|
|
|
15783
16725
|
}
|
|
15784
16726
|
}
|
|
15785
16727
|
},
|
|
15786
|
-
addToPath: function addToPath(
|
|
15787
|
-
var last =
|
|
16728
|
+
addToPath: function addToPath(path3, added, removed, oldPosInc) {
|
|
16729
|
+
var last = path3.lastComponent;
|
|
15788
16730
|
if (last && last.added === added && last.removed === removed) {
|
|
15789
16731
|
return {
|
|
15790
|
-
oldPos:
|
|
16732
|
+
oldPos: path3.oldPos + oldPosInc,
|
|
15791
16733
|
lastComponent: {
|
|
15792
16734
|
count: last.count + 1,
|
|
15793
16735
|
added,
|
|
@@ -15797,7 +16739,7 @@ var init_lib = __esm({
|
|
|
15797
16739
|
};
|
|
15798
16740
|
} else {
|
|
15799
16741
|
return {
|
|
15800
|
-
oldPos:
|
|
16742
|
+
oldPos: path3.oldPos + oldPosInc,
|
|
15801
16743
|
lastComponent: {
|
|
15802
16744
|
count: 1,
|
|
15803
16745
|
added,
|
|
@@ -15845,8 +16787,8 @@ var init_lib = __esm({
|
|
|
15845
16787
|
tokenize: function tokenize(value) {
|
|
15846
16788
|
return value.split("");
|
|
15847
16789
|
},
|
|
15848
|
-
join: function
|
|
15849
|
-
return
|
|
16790
|
+
join: function join2(chars2) {
|
|
16791
|
+
return chars2.join("");
|
|
15850
16792
|
}
|
|
15851
16793
|
};
|
|
15852
16794
|
characterDiff = new Diff();
|
|
@@ -16209,11 +17151,11 @@ async function killProcess(sys2, procOrPid, abortSignal, timeout = 5e3) {
|
|
|
16209
17151
|
try {
|
|
16210
17152
|
await Promise.race([
|
|
16211
17153
|
await new Promise(
|
|
16212
|
-
(
|
|
17154
|
+
(resolve4, reject) => (0, import_tree_kill.default)(pid, "SIGTERM", (err) => {
|
|
16213
17155
|
if (err) {
|
|
16214
17156
|
reject(err);
|
|
16215
17157
|
} else {
|
|
16216
|
-
|
|
17158
|
+
resolve4();
|
|
16217
17159
|
}
|
|
16218
17160
|
})
|
|
16219
17161
|
),
|
|
@@ -16236,11 +17178,11 @@ async function killProcess(sys2, procOrPid, abortSignal, timeout = 5e3) {
|
|
|
16236
17178
|
try {
|
|
16237
17179
|
await Promise.race([
|
|
16238
17180
|
await new Promise(
|
|
16239
|
-
(
|
|
17181
|
+
(resolve4, reject) => (0, import_tree_kill.default)(pid, "SIGKILL", (err2) => {
|
|
16240
17182
|
if (err2) {
|
|
16241
17183
|
reject(err2);
|
|
16242
17184
|
} else {
|
|
16243
|
-
|
|
17185
|
+
resolve4();
|
|
16244
17186
|
}
|
|
16245
17187
|
})
|
|
16246
17188
|
),
|
|
@@ -17483,7 +18425,7 @@ var require_braces = __commonJS({
|
|
|
17483
18425
|
var require_constants2 = __commonJS({
|
|
17484
18426
|
"node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
17485
18427
|
"use strict";
|
|
17486
|
-
var
|
|
18428
|
+
var path3 = __require("path");
|
|
17487
18429
|
var WIN_SLASH = "\\\\/";
|
|
17488
18430
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
17489
18431
|
var DOT_LITERAL = "\\.";
|
|
@@ -17653,13 +18595,13 @@ var require_constants2 = __commonJS({
|
|
|
17653
18595
|
/* | */
|
|
17654
18596
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
17655
18597
|
/* \uFEFF */
|
|
17656
|
-
SEP:
|
|
18598
|
+
SEP: path3.sep,
|
|
17657
18599
|
/**
|
|
17658
18600
|
* Create EXTGLOB_CHARS
|
|
17659
18601
|
*/
|
|
17660
|
-
extglobChars(
|
|
18602
|
+
extglobChars(chars2) {
|
|
17661
18603
|
return {
|
|
17662
|
-
"!": { type: "negate", open: "(?:(?!(?:", close: `))${
|
|
18604
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars2.STAR})` },
|
|
17663
18605
|
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
17664
18606
|
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
17665
18607
|
"*": { type: "star", open: "(?:", close: ")*" },
|
|
@@ -17680,7 +18622,7 @@ var require_constants2 = __commonJS({
|
|
|
17680
18622
|
var require_utils2 = __commonJS({
|
|
17681
18623
|
"node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports) {
|
|
17682
18624
|
"use strict";
|
|
17683
|
-
var
|
|
18625
|
+
var path3 = __require("path");
|
|
17684
18626
|
var win32 = process.platform === "win32";
|
|
17685
18627
|
var {
|
|
17686
18628
|
REGEX_BACKSLASH,
|
|
@@ -17709,7 +18651,7 @@ var require_utils2 = __commonJS({
|
|
|
17709
18651
|
if (options && typeof options.windows === "boolean") {
|
|
17710
18652
|
return options.windows;
|
|
17711
18653
|
}
|
|
17712
|
-
return win32 === true ||
|
|
18654
|
+
return win32 === true || path3.sep === "\\";
|
|
17713
18655
|
};
|
|
17714
18656
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
17715
18657
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -18257,7 +19199,7 @@ var require_parse3 = __commonJS({
|
|
|
18257
19199
|
};
|
|
18258
19200
|
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
18259
19201
|
let backslashes = false;
|
|
18260
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc,
|
|
19202
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc, chars2, first, rest, index) => {
|
|
18261
19203
|
if (first === "\\") {
|
|
18262
19204
|
backslashes = true;
|
|
18263
19205
|
return m2;
|
|
@@ -18269,10 +19211,10 @@ var require_parse3 = __commonJS({
|
|
|
18269
19211
|
if (index === 0) {
|
|
18270
19212
|
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
18271
19213
|
}
|
|
18272
|
-
return QMARK.repeat(
|
|
19214
|
+
return QMARK.repeat(chars2.length);
|
|
18273
19215
|
}
|
|
18274
19216
|
if (first === ".") {
|
|
18275
|
-
return DOT_LITERAL.repeat(
|
|
19217
|
+
return DOT_LITERAL.repeat(chars2.length);
|
|
18276
19218
|
}
|
|
18277
19219
|
if (first === "*") {
|
|
18278
19220
|
if (esc) {
|
|
@@ -18844,7 +19786,7 @@ var require_parse3 = __commonJS({
|
|
|
18844
19786
|
var require_picomatch = __commonJS({
|
|
18845
19787
|
"node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
18846
19788
|
"use strict";
|
|
18847
|
-
var
|
|
19789
|
+
var path3 = __require("path");
|
|
18848
19790
|
var scan = require_scan();
|
|
18849
19791
|
var parse = require_parse3();
|
|
18850
19792
|
var utils = require_utils2();
|
|
@@ -18929,7 +19871,7 @@ var require_picomatch = __commonJS({
|
|
|
18929
19871
|
};
|
|
18930
19872
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
18931
19873
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
18932
|
-
return regex.test(
|
|
19874
|
+
return regex.test(path3.basename(input));
|
|
18933
19875
|
};
|
|
18934
19876
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
18935
19877
|
picomatch.parse = (pattern, options) => {
|
|
@@ -20326,7 +21268,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20326
21268
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
20327
21269
|
}
|
|
20328
21270
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
20329
|
-
var currentUrlParts =
|
|
21271
|
+
var currentUrlParts = parseUrl2(this._currentUrl);
|
|
20330
21272
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
20331
21273
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
20332
21274
|
var redirectUrl = resolveUrl(location, currentUrl);
|
|
@@ -20365,7 +21307,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20365
21307
|
if (isURL(input)) {
|
|
20366
21308
|
input = spreadUrlObject(input);
|
|
20367
21309
|
} else if (isString2(input)) {
|
|
20368
|
-
input = spreadUrlObject(
|
|
21310
|
+
input = spreadUrlObject(parseUrl2(input));
|
|
20369
21311
|
} else {
|
|
20370
21312
|
callback = options;
|
|
20371
21313
|
options = validateUrl(input);
|
|
@@ -20401,7 +21343,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20401
21343
|
}
|
|
20402
21344
|
function noop() {
|
|
20403
21345
|
}
|
|
20404
|
-
function
|
|
21346
|
+
function parseUrl2(input) {
|
|
20405
21347
|
var parsed;
|
|
20406
21348
|
if (useNativeURL) {
|
|
20407
21349
|
parsed = new URL2(input);
|
|
@@ -20414,7 +21356,7 @@ var require_follow_redirects = __commonJS({
|
|
|
20414
21356
|
return parsed;
|
|
20415
21357
|
}
|
|
20416
21358
|
function resolveUrl(relative, base) {
|
|
20417
|
-
return useNativeURL ? new URL2(relative, base) :
|
|
21359
|
+
return useNativeURL ? new URL2(relative, base) : parseUrl2(url.resolve(base, relative));
|
|
20418
21360
|
}
|
|
20419
21361
|
function validateUrl(input) {
|
|
20420
21362
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -21646,7 +22588,7 @@ var require_cookie = __commonJS({
|
|
|
21646
22588
|
var obj = {};
|
|
21647
22589
|
var len = str.length;
|
|
21648
22590
|
if (len < 2) return obj;
|
|
21649
|
-
var dec = opt && opt.decode ||
|
|
22591
|
+
var dec = opt && opt.decode || decode2;
|
|
21650
22592
|
var index = 0;
|
|
21651
22593
|
var eqIdx = 0;
|
|
21652
22594
|
var endIdx = 0;
|
|
@@ -21777,15 +22719,15 @@ var require_cookie = __commonJS({
|
|
|
21777
22719
|
}
|
|
21778
22720
|
return str;
|
|
21779
22721
|
}
|
|
21780
|
-
function
|
|
22722
|
+
function decode2(str) {
|
|
21781
22723
|
return str.indexOf("%") !== -1 ? decodeURIComponent(str) : str;
|
|
21782
22724
|
}
|
|
21783
22725
|
function isDate(val) {
|
|
21784
22726
|
return __toString.call(val) === "[object Date]";
|
|
21785
22727
|
}
|
|
21786
|
-
function tryDecode(str,
|
|
22728
|
+
function tryDecode(str, decode3) {
|
|
21787
22729
|
try {
|
|
21788
|
-
return
|
|
22730
|
+
return decode3(str);
|
|
21789
22731
|
} catch (e2) {
|
|
21790
22732
|
return str;
|
|
21791
22733
|
}
|
|
@@ -22411,8 +23353,8 @@ var init_parseUtil = __esm({
|
|
|
22411
23353
|
init_errors2();
|
|
22412
23354
|
init_en();
|
|
22413
23355
|
makeIssue = (params) => {
|
|
22414
|
-
const { data, path:
|
|
22415
|
-
const fullPath = [...
|
|
23356
|
+
const { data, path: path3, errorMaps, issueData } = params;
|
|
23357
|
+
const fullPath = [...path3, ...issueData.path || []];
|
|
22416
23358
|
const fullIssue = {
|
|
22417
23359
|
...issueData,
|
|
22418
23360
|
path: fullPath
|
|
@@ -22720,11 +23662,11 @@ var init_types2 = __esm({
|
|
|
22720
23662
|
init_parseUtil();
|
|
22721
23663
|
init_util();
|
|
22722
23664
|
ParseInputLazyPath = class {
|
|
22723
|
-
constructor(parent, value,
|
|
23665
|
+
constructor(parent, value, path3, key) {
|
|
22724
23666
|
this._cachedPath = [];
|
|
22725
23667
|
this.parent = parent;
|
|
22726
23668
|
this.data = value;
|
|
22727
|
-
this._path =
|
|
23669
|
+
this._path = path3;
|
|
22728
23670
|
this._key = key;
|
|
22729
23671
|
}
|
|
22730
23672
|
get path() {
|
|
@@ -29252,8 +30194,8 @@ var require_resolve = __commonJS({
|
|
|
29252
30194
|
}
|
|
29253
30195
|
return count;
|
|
29254
30196
|
}
|
|
29255
|
-
function getFullPath(resolver, id = "",
|
|
29256
|
-
if (
|
|
30197
|
+
function getFullPath(resolver, id = "", normalize2) {
|
|
30198
|
+
if (normalize2 !== false)
|
|
29257
30199
|
id = normalizeId(id);
|
|
29258
30200
|
const p2 = resolver.parse(id);
|
|
29259
30201
|
return _getFullPath(resolver, p2);
|
|
@@ -30001,7 +30943,7 @@ var require_compile2 = __commonJS({
|
|
|
30001
30943
|
const schOrFunc = root.refs[ref];
|
|
30002
30944
|
if (schOrFunc)
|
|
30003
30945
|
return schOrFunc;
|
|
30004
|
-
let _sch =
|
|
30946
|
+
let _sch = resolve4.call(this, root, ref);
|
|
30005
30947
|
if (_sch === void 0) {
|
|
30006
30948
|
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
30007
30949
|
const { schemaId } = this.opts;
|
|
@@ -30028,7 +30970,7 @@ var require_compile2 = __commonJS({
|
|
|
30028
30970
|
function sameSchemaEnv(s1, s2) {
|
|
30029
30971
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
30030
30972
|
}
|
|
30031
|
-
function
|
|
30973
|
+
function resolve4(root, ref) {
|
|
30032
30974
|
let sch;
|
|
30033
30975
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
30034
30976
|
ref = sch;
|
|
@@ -30426,8 +31368,8 @@ var require_schemes = __commonJS({
|
|
|
30426
31368
|
wsComponents.secure = void 0;
|
|
30427
31369
|
}
|
|
30428
31370
|
if (wsComponents.resourceName) {
|
|
30429
|
-
const [
|
|
30430
|
-
wsComponents.path =
|
|
31371
|
+
const [path3, query] = wsComponents.resourceName.split("?");
|
|
31372
|
+
wsComponents.path = path3 && path3 !== "/" ? path3 : void 0;
|
|
30431
31373
|
wsComponents.query = query;
|
|
30432
31374
|
wsComponents.resourceName = void 0;
|
|
30433
31375
|
}
|
|
@@ -30537,7 +31479,7 @@ var require_fast_uri = __commonJS({
|
|
|
30537
31479
|
"use strict";
|
|
30538
31480
|
var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils3();
|
|
30539
31481
|
var SCHEMES = require_schemes();
|
|
30540
|
-
function
|
|
31482
|
+
function normalize2(uri, options) {
|
|
30541
31483
|
if (typeof uri === "string") {
|
|
30542
31484
|
uri = serialize(parse(uri, options), options);
|
|
30543
31485
|
} else if (typeof uri === "object") {
|
|
@@ -30545,7 +31487,7 @@ var require_fast_uri = __commonJS({
|
|
|
30545
31487
|
}
|
|
30546
31488
|
return uri;
|
|
30547
31489
|
}
|
|
30548
|
-
function
|
|
31490
|
+
function resolve4(baseURI, relativeURI, options) {
|
|
30549
31491
|
const schemelessOptions = Object.assign({ scheme: "null" }, options);
|
|
30550
31492
|
const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
30551
31493
|
return serialize(resolved, { ...schemelessOptions, skipEscape: true });
|
|
@@ -30775,8 +31717,8 @@ var require_fast_uri = __commonJS({
|
|
|
30775
31717
|
}
|
|
30776
31718
|
var fastUri = {
|
|
30777
31719
|
SCHEMES,
|
|
30778
|
-
normalize,
|
|
30779
|
-
resolve,
|
|
31720
|
+
normalize: normalize2,
|
|
31721
|
+
resolve: resolve4,
|
|
30780
31722
|
resolveComponents,
|
|
30781
31723
|
equal,
|
|
30782
31724
|
serialize,
|
|
@@ -33743,12 +34685,12 @@ var require_dist2 = __commonJS({
|
|
|
33743
34685
|
throw new Error(`Unknown format "${name}"`);
|
|
33744
34686
|
return f;
|
|
33745
34687
|
};
|
|
33746
|
-
function addFormats(ajv, list,
|
|
34688
|
+
function addFormats(ajv, list, fs2, exportName) {
|
|
33747
34689
|
var _a;
|
|
33748
34690
|
var _b;
|
|
33749
34691
|
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
33750
34692
|
for (const f of list)
|
|
33751
|
-
ajv.addFormat(f,
|
|
34693
|
+
ajv.addFormat(f, fs2[f]);
|
|
33752
34694
|
}
|
|
33753
34695
|
module.exports = exports = formatsPlugin;
|
|
33754
34696
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -33779,8 +34721,8 @@ var require_windows = __commonJS({
|
|
|
33779
34721
|
"node_modules/isexe/windows.js"(exports, module) {
|
|
33780
34722
|
module.exports = isexe;
|
|
33781
34723
|
isexe.sync = sync;
|
|
33782
|
-
var
|
|
33783
|
-
function checkPathExt(
|
|
34724
|
+
var fs2 = __require("fs");
|
|
34725
|
+
function checkPathExt(path3, options) {
|
|
33784
34726
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
33785
34727
|
if (!pathext) {
|
|
33786
34728
|
return true;
|
|
@@ -33791,25 +34733,25 @@ var require_windows = __commonJS({
|
|
|
33791
34733
|
}
|
|
33792
34734
|
for (var i = 0; i < pathext.length; i++) {
|
|
33793
34735
|
var p2 = pathext[i].toLowerCase();
|
|
33794
|
-
if (p2 &&
|
|
34736
|
+
if (p2 && path3.substr(-p2.length).toLowerCase() === p2) {
|
|
33795
34737
|
return true;
|
|
33796
34738
|
}
|
|
33797
34739
|
}
|
|
33798
34740
|
return false;
|
|
33799
34741
|
}
|
|
33800
|
-
function checkStat(stat2,
|
|
34742
|
+
function checkStat(stat2, path3, options) {
|
|
33801
34743
|
if (!stat2.isSymbolicLink() && !stat2.isFile()) {
|
|
33802
34744
|
return false;
|
|
33803
34745
|
}
|
|
33804
|
-
return checkPathExt(
|
|
34746
|
+
return checkPathExt(path3, options);
|
|
33805
34747
|
}
|
|
33806
|
-
function isexe(
|
|
33807
|
-
|
|
33808
|
-
cb(er, er ? false : checkStat(stat2,
|
|
34748
|
+
function isexe(path3, options, cb) {
|
|
34749
|
+
fs2.stat(path3, function(er, stat2) {
|
|
34750
|
+
cb(er, er ? false : checkStat(stat2, path3, options));
|
|
33809
34751
|
});
|
|
33810
34752
|
}
|
|
33811
|
-
function sync(
|
|
33812
|
-
return checkStat(
|
|
34753
|
+
function sync(path3, options) {
|
|
34754
|
+
return checkStat(fs2.statSync(path3), path3, options);
|
|
33813
34755
|
}
|
|
33814
34756
|
}
|
|
33815
34757
|
});
|
|
@@ -33819,14 +34761,14 @@ var require_mode = __commonJS({
|
|
|
33819
34761
|
"node_modules/isexe/mode.js"(exports, module) {
|
|
33820
34762
|
module.exports = isexe;
|
|
33821
34763
|
isexe.sync = sync;
|
|
33822
|
-
var
|
|
33823
|
-
function isexe(
|
|
33824
|
-
|
|
34764
|
+
var fs2 = __require("fs");
|
|
34765
|
+
function isexe(path3, options, cb) {
|
|
34766
|
+
fs2.stat(path3, function(er, stat2) {
|
|
33825
34767
|
cb(er, er ? false : checkStat(stat2, options));
|
|
33826
34768
|
});
|
|
33827
34769
|
}
|
|
33828
|
-
function sync(
|
|
33829
|
-
return checkStat(
|
|
34770
|
+
function sync(path3, options) {
|
|
34771
|
+
return checkStat(fs2.statSync(path3), options);
|
|
33830
34772
|
}
|
|
33831
34773
|
function checkStat(stat2, options) {
|
|
33832
34774
|
return stat2.isFile() && checkMode(stat2, options);
|
|
@@ -33850,7 +34792,7 @@ var require_mode = __commonJS({
|
|
|
33850
34792
|
// node_modules/isexe/index.js
|
|
33851
34793
|
var require_isexe = __commonJS({
|
|
33852
34794
|
"node_modules/isexe/index.js"(exports, module) {
|
|
33853
|
-
var
|
|
34795
|
+
var fs2 = __require("fs");
|
|
33854
34796
|
var core;
|
|
33855
34797
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
33856
34798
|
core = require_windows();
|
|
@@ -33859,7 +34801,7 @@ var require_isexe = __commonJS({
|
|
|
33859
34801
|
}
|
|
33860
34802
|
module.exports = isexe;
|
|
33861
34803
|
isexe.sync = sync;
|
|
33862
|
-
function isexe(
|
|
34804
|
+
function isexe(path3, options, cb) {
|
|
33863
34805
|
if (typeof options === "function") {
|
|
33864
34806
|
cb = options;
|
|
33865
34807
|
options = {};
|
|
@@ -33868,17 +34810,17 @@ var require_isexe = __commonJS({
|
|
|
33868
34810
|
if (typeof Promise !== "function") {
|
|
33869
34811
|
throw new TypeError("callback not provided");
|
|
33870
34812
|
}
|
|
33871
|
-
return new Promise(function(
|
|
33872
|
-
isexe(
|
|
34813
|
+
return new Promise(function(resolve4, reject) {
|
|
34814
|
+
isexe(path3, options || {}, function(er, is) {
|
|
33873
34815
|
if (er) {
|
|
33874
34816
|
reject(er);
|
|
33875
34817
|
} else {
|
|
33876
|
-
|
|
34818
|
+
resolve4(is);
|
|
33877
34819
|
}
|
|
33878
34820
|
});
|
|
33879
34821
|
});
|
|
33880
34822
|
}
|
|
33881
|
-
core(
|
|
34823
|
+
core(path3, options || {}, function(er, is) {
|
|
33882
34824
|
if (er) {
|
|
33883
34825
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
33884
34826
|
er = null;
|
|
@@ -33888,9 +34830,9 @@ var require_isexe = __commonJS({
|
|
|
33888
34830
|
cb(er, is);
|
|
33889
34831
|
});
|
|
33890
34832
|
}
|
|
33891
|
-
function sync(
|
|
34833
|
+
function sync(path3, options) {
|
|
33892
34834
|
try {
|
|
33893
|
-
return core.sync(
|
|
34835
|
+
return core.sync(path3, options || {});
|
|
33894
34836
|
} catch (er) {
|
|
33895
34837
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
33896
34838
|
return false;
|
|
@@ -33906,7 +34848,7 @@ var require_isexe = __commonJS({
|
|
|
33906
34848
|
var require_which = __commonJS({
|
|
33907
34849
|
"node_modules/which/which.js"(exports, module) {
|
|
33908
34850
|
var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
33909
|
-
var
|
|
34851
|
+
var path3 = __require("path");
|
|
33910
34852
|
var COLON = isWindows2 ? ";" : ":";
|
|
33911
34853
|
var isexe = require_isexe();
|
|
33912
34854
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -33938,28 +34880,28 @@ var require_which = __commonJS({
|
|
|
33938
34880
|
if (!opt)
|
|
33939
34881
|
opt = {};
|
|
33940
34882
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
33941
|
-
const
|
|
33942
|
-
const step = (i) => new Promise((
|
|
34883
|
+
const found2 = [];
|
|
34884
|
+
const step = (i) => new Promise((resolve4, reject) => {
|
|
33943
34885
|
if (i === pathEnv.length)
|
|
33944
|
-
return opt.all &&
|
|
34886
|
+
return opt.all && found2.length ? resolve4(found2) : reject(getNotFoundError(cmd));
|
|
33945
34887
|
const ppRaw = pathEnv[i];
|
|
33946
34888
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
33947
|
-
const pCmd =
|
|
34889
|
+
const pCmd = path3.join(pathPart, cmd);
|
|
33948
34890
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
33949
|
-
|
|
34891
|
+
resolve4(subStep(p2, i, 0));
|
|
33950
34892
|
});
|
|
33951
|
-
const subStep = (p2, i, ii) => new Promise((
|
|
34893
|
+
const subStep = (p2, i, ii) => new Promise((resolve4, reject) => {
|
|
33952
34894
|
if (ii === pathExt.length)
|
|
33953
|
-
return
|
|
34895
|
+
return resolve4(step(i + 1));
|
|
33954
34896
|
const ext = pathExt[ii];
|
|
33955
34897
|
isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
33956
34898
|
if (!er && is) {
|
|
33957
34899
|
if (opt.all)
|
|
33958
|
-
|
|
34900
|
+
found2.push(p2 + ext);
|
|
33959
34901
|
else
|
|
33960
|
-
return
|
|
34902
|
+
return resolve4(p2 + ext);
|
|
33961
34903
|
}
|
|
33962
|
-
return
|
|
34904
|
+
return resolve4(subStep(p2, i, ii + 1));
|
|
33963
34905
|
});
|
|
33964
34906
|
});
|
|
33965
34907
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -33967,11 +34909,11 @@ var require_which = __commonJS({
|
|
|
33967
34909
|
var whichSync = (cmd, opt) => {
|
|
33968
34910
|
opt = opt || {};
|
|
33969
34911
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
33970
|
-
const
|
|
34912
|
+
const found2 = [];
|
|
33971
34913
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
33972
34914
|
const ppRaw = pathEnv[i];
|
|
33973
34915
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
33974
|
-
const pCmd =
|
|
34916
|
+
const pCmd = path3.join(pathPart, cmd);
|
|
33975
34917
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
33976
34918
|
for (let j2 = 0; j2 < pathExt.length; j2++) {
|
|
33977
34919
|
const cur = p2 + pathExt[j2];
|
|
@@ -33979,7 +34921,7 @@ var require_which = __commonJS({
|
|
|
33979
34921
|
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
33980
34922
|
if (is) {
|
|
33981
34923
|
if (opt.all)
|
|
33982
|
-
|
|
34924
|
+
found2.push(cur);
|
|
33983
34925
|
else
|
|
33984
34926
|
return cur;
|
|
33985
34927
|
}
|
|
@@ -33987,8 +34929,8 @@ var require_which = __commonJS({
|
|
|
33987
34929
|
}
|
|
33988
34930
|
}
|
|
33989
34931
|
}
|
|
33990
|
-
if (opt.all &&
|
|
33991
|
-
return
|
|
34932
|
+
if (opt.all && found2.length)
|
|
34933
|
+
return found2;
|
|
33992
34934
|
if (opt.nothrow)
|
|
33993
34935
|
return null;
|
|
33994
34936
|
throw getNotFoundError(cmd);
|
|
@@ -34019,7 +34961,7 @@ var require_path_key = __commonJS({
|
|
|
34019
34961
|
var require_resolveCommand = __commonJS({
|
|
34020
34962
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
34021
34963
|
"use strict";
|
|
34022
|
-
var
|
|
34964
|
+
var path3 = __require("path");
|
|
34023
34965
|
var which = require_which();
|
|
34024
34966
|
var getPathKey = require_path_key();
|
|
34025
34967
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -34037,7 +34979,7 @@ var require_resolveCommand = __commonJS({
|
|
|
34037
34979
|
try {
|
|
34038
34980
|
resolved = which.sync(parsed.command, {
|
|
34039
34981
|
path: env[getPathKey({ env })],
|
|
34040
|
-
pathExt: withoutPathExt ?
|
|
34982
|
+
pathExt: withoutPathExt ? path3.delimiter : void 0
|
|
34041
34983
|
});
|
|
34042
34984
|
} catch (e2) {
|
|
34043
34985
|
} finally {
|
|
@@ -34046,7 +34988,7 @@ var require_resolveCommand = __commonJS({
|
|
|
34046
34988
|
}
|
|
34047
34989
|
}
|
|
34048
34990
|
if (resolved) {
|
|
34049
|
-
resolved =
|
|
34991
|
+
resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
34050
34992
|
}
|
|
34051
34993
|
return resolved;
|
|
34052
34994
|
}
|
|
@@ -34100,8 +35042,8 @@ var require_shebang_command = __commonJS({
|
|
|
34100
35042
|
if (!match) {
|
|
34101
35043
|
return null;
|
|
34102
35044
|
}
|
|
34103
|
-
const [
|
|
34104
|
-
const binary =
|
|
35045
|
+
const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
35046
|
+
const binary = path3.split("/").pop();
|
|
34105
35047
|
if (binary === "env") {
|
|
34106
35048
|
return argument;
|
|
34107
35049
|
}
|
|
@@ -34114,16 +35056,16 @@ var require_shebang_command = __commonJS({
|
|
|
34114
35056
|
var require_readShebang = __commonJS({
|
|
34115
35057
|
"node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
34116
35058
|
"use strict";
|
|
34117
|
-
var
|
|
35059
|
+
var fs2 = __require("fs");
|
|
34118
35060
|
var shebangCommand = require_shebang_command();
|
|
34119
35061
|
function readShebang(command) {
|
|
34120
35062
|
const size = 150;
|
|
34121
35063
|
const buffer = Buffer.alloc(size);
|
|
34122
35064
|
let fd;
|
|
34123
35065
|
try {
|
|
34124
|
-
fd =
|
|
34125
|
-
|
|
34126
|
-
|
|
35066
|
+
fd = fs2.openSync(command, "r");
|
|
35067
|
+
fs2.readSync(fd, buffer, 0, size, 0);
|
|
35068
|
+
fs2.closeSync(fd);
|
|
34127
35069
|
} catch (e2) {
|
|
34128
35070
|
}
|
|
34129
35071
|
return shebangCommand(buffer.toString());
|
|
@@ -34136,7 +35078,7 @@ var require_readShebang = __commonJS({
|
|
|
34136
35078
|
var require_parse4 = __commonJS({
|
|
34137
35079
|
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
34138
35080
|
"use strict";
|
|
34139
|
-
var
|
|
35081
|
+
var path3 = __require("path");
|
|
34140
35082
|
var resolveCommand = require_resolveCommand();
|
|
34141
35083
|
var escape2 = require_escape();
|
|
34142
35084
|
var readShebang = require_readShebang();
|
|
@@ -34161,7 +35103,7 @@ var require_parse4 = __commonJS({
|
|
|
34161
35103
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
34162
35104
|
if (parsed.options.forceShell || needsShell) {
|
|
34163
35105
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
34164
|
-
parsed.command =
|
|
35106
|
+
parsed.command = path3.normalize(parsed.command);
|
|
34165
35107
|
parsed.command = escape2.command(parsed.command);
|
|
34166
35108
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
34167
35109
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -34378,8 +35320,8 @@ var require_package = __commonJS({
|
|
|
34378
35320
|
// node_modules/dotenv/lib/main.js
|
|
34379
35321
|
var require_main = __commonJS({
|
|
34380
35322
|
"node_modules/dotenv/lib/main.js"(exports, module) {
|
|
34381
|
-
var
|
|
34382
|
-
var
|
|
35323
|
+
var fs2 = __require("fs");
|
|
35324
|
+
var path3 = __require("path");
|
|
34383
35325
|
var os = __require("os");
|
|
34384
35326
|
var crypto4 = __require("crypto");
|
|
34385
35327
|
var packageJson = require_package();
|
|
@@ -34471,14 +35413,14 @@ var require_main = __commonJS({
|
|
|
34471
35413
|
return { ciphertext, key };
|
|
34472
35414
|
}
|
|
34473
35415
|
function _vaultPath(options) {
|
|
34474
|
-
let dotenvPath =
|
|
35416
|
+
let dotenvPath = path3.resolve(process.cwd(), ".env");
|
|
34475
35417
|
if (options && options.path && options.path.length > 0) {
|
|
34476
35418
|
dotenvPath = options.path;
|
|
34477
35419
|
}
|
|
34478
35420
|
return dotenvPath.endsWith(".vault") ? dotenvPath : `${dotenvPath}.vault`;
|
|
34479
35421
|
}
|
|
34480
35422
|
function _resolveHome(envPath) {
|
|
34481
|
-
return envPath[0] === "~" ?
|
|
35423
|
+
return envPath[0] === "~" ? path3.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
34482
35424
|
}
|
|
34483
35425
|
function _configVault(options) {
|
|
34484
35426
|
_log("Loading env from encrypted .env.vault");
|
|
@@ -34491,7 +35433,7 @@ var require_main = __commonJS({
|
|
|
34491
35433
|
return { parsed };
|
|
34492
35434
|
}
|
|
34493
35435
|
function configDotenv(options) {
|
|
34494
|
-
let dotenvPath =
|
|
35436
|
+
let dotenvPath = path3.resolve(process.cwd(), ".env");
|
|
34495
35437
|
let encoding = "utf8";
|
|
34496
35438
|
const debug2 = Boolean(options && options.debug);
|
|
34497
35439
|
if (options) {
|
|
@@ -34507,7 +35449,7 @@ var require_main = __commonJS({
|
|
|
34507
35449
|
}
|
|
34508
35450
|
}
|
|
34509
35451
|
try {
|
|
34510
|
-
const parsed = DotenvModule.parse(
|
|
35452
|
+
const parsed = DotenvModule.parse(fs2.readFileSync(dotenvPath, { encoding }));
|
|
34511
35453
|
let processEnv = process.env;
|
|
34512
35454
|
if (options && options.processEnv != null) {
|
|
34513
35455
|
processEnv = options.processEnv;
|
|
@@ -34526,7 +35468,7 @@ var require_main = __commonJS({
|
|
|
34526
35468
|
if (_dotenvKey(options).length === 0) {
|
|
34527
35469
|
return DotenvModule.configDotenv(options);
|
|
34528
35470
|
}
|
|
34529
|
-
if (!
|
|
35471
|
+
if (!fs2.existsSync(vaultPath)) {
|
|
34530
35472
|
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
34531
35473
|
return DotenvModule.configDotenv(options);
|
|
34532
35474
|
}
|
|
@@ -35083,11 +36025,11 @@ function parseCallExpression(sys2, node, sourceFile, typeChecker) {
|
|
|
35083
36025
|
ts3.isTaggedTemplateExpression(node2) && ts3.isIdentifier(node2.tag) && (node2.tag.escapedText === "html" || node2.tag.escapedText === "tmpl")
|
|
35084
36026
|
) {
|
|
35085
36027
|
if (ts3.isTemplateExpression(node2.template)) {
|
|
35086
|
-
const
|
|
36028
|
+
const found2 = node2.template.templateSpans.find(
|
|
35087
36029
|
(a) => ts3.isIdentifier(a.expression) && isCapitalized(a.expression.text) && getExportStatement2(a.expression)
|
|
35088
36030
|
);
|
|
35089
|
-
if (
|
|
35090
|
-
builderName =
|
|
36031
|
+
if (found2 && ts3.isIdentifier(found2.expression)) {
|
|
36032
|
+
builderName = found2.expression.text;
|
|
35091
36033
|
return;
|
|
35092
36034
|
}
|
|
35093
36035
|
}
|
|
@@ -35388,8 +36330,8 @@ var init_figma_publish = __esm({
|
|
|
35388
36330
|
// packages/dev-tools/cli/credentials.ts
|
|
35389
36331
|
import { createServer } from "http";
|
|
35390
36332
|
import { platform as platform2 } from "node:os";
|
|
35391
|
-
import { dirname, join as
|
|
35392
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
36333
|
+
import { dirname as dirname2, join as join3 } from "node:path";
|
|
36334
|
+
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
35393
36335
|
import { randomUUID } from "crypto";
|
|
35394
36336
|
async function getFigmaAuth(sys2) {
|
|
35395
36337
|
const randomState = randomUUID();
|
|
@@ -35397,7 +36339,7 @@ async function getFigmaAuth(sys2) {
|
|
|
35397
36339
|
sys: sys2,
|
|
35398
36340
|
name: "Figma",
|
|
35399
36341
|
initialPort: DEFAULT_FIGMA_PORT,
|
|
35400
|
-
requestListener: async (port, req, res,
|
|
36342
|
+
requestListener: async (port, req, res, resolve4, reject) => {
|
|
35401
36343
|
const url = new URL(req.url || "", `http://localhost:${port}`);
|
|
35402
36344
|
if (url.pathname === "/figma-connect") {
|
|
35403
36345
|
const code = url.searchParams.get("code");
|
|
@@ -35431,7 +36373,7 @@ async function getFigmaAuth(sys2) {
|
|
|
35431
36373
|
"The CLI has authenticated correctly with Figma"
|
|
35432
36374
|
),
|
|
35433
36375
|
() => {
|
|
35434
|
-
|
|
36376
|
+
resolve4({
|
|
35435
36377
|
...data,
|
|
35436
36378
|
oauth: true
|
|
35437
36379
|
});
|
|
@@ -35463,7 +36405,7 @@ async function getBuilderAuth(sys2, preferSpaceId) {
|
|
|
35463
36405
|
sys: sys2,
|
|
35464
36406
|
name: "Builder.io",
|
|
35465
36407
|
initialPort: DEFAULT_BUILDER_PORT,
|
|
35466
|
-
requestListener: async (port, req, res,
|
|
36408
|
+
requestListener: async (port, req, res, resolve4) => {
|
|
35467
36409
|
const url = new URL(req.url || "", `http://localhost:${port}`);
|
|
35468
36410
|
if (url.pathname === BUILDER_AUTH_RETURN_PATH) {
|
|
35469
36411
|
res.end(
|
|
@@ -35472,7 +36414,7 @@ async function getBuilderAuth(sys2, preferSpaceId) {
|
|
|
35472
36414
|
"The CLI has authenticated correctly with Builder.io"
|
|
35473
36415
|
),
|
|
35474
36416
|
() => {
|
|
35475
|
-
|
|
36417
|
+
resolve4({
|
|
35476
36418
|
privateKey: url.searchParams.get("p-key") || "",
|
|
35477
36419
|
spaceId: url.searchParams.get("api-key") || "",
|
|
35478
36420
|
spaceName: url.searchParams.get("org-name") || "",
|
|
@@ -35508,27 +36450,27 @@ async function getBuilderAuth(sys2, preferSpaceId) {
|
|
|
35508
36450
|
});
|
|
35509
36451
|
}
|
|
35510
36452
|
function storeCredentials(sys2, credentials) {
|
|
35511
|
-
const doesNodeModulesExist =
|
|
35512
|
-
|
|
36453
|
+
const doesNodeModulesExist = existsSync2(
|
|
36454
|
+
join3(sys2.getAppRootDir(), "node_modules")
|
|
35513
36455
|
);
|
|
35514
36456
|
if (doesNodeModulesExist) {
|
|
35515
|
-
const configDir =
|
|
35516
|
-
const filePath =
|
|
36457
|
+
const configDir = join3(sys2.getAppRootDir(), "node_modules", ".builder");
|
|
36458
|
+
const filePath = join3(configDir, "data.json");
|
|
35517
36459
|
const existingCredentials = loadCredentials(sys2);
|
|
35518
36460
|
credentials = Object.assign(existingCredentials, credentials);
|
|
35519
|
-
mkdirSync(
|
|
36461
|
+
mkdirSync(dirname2(filePath), { recursive: true });
|
|
35520
36462
|
writeFileSync(filePath, JSON.stringify({ credentials }, null, 2));
|
|
35521
36463
|
} else {
|
|
35522
|
-
const configDir =
|
|
35523
|
-
const filePath =
|
|
35524
|
-
const gitignorePath =
|
|
36464
|
+
const configDir = join3(sys2.getAppRootDir(), ".config", "builderio");
|
|
36465
|
+
const filePath = join3(configDir, "data.json");
|
|
36466
|
+
const gitignorePath = join3(sys2.getAppRootDir(), ".gitignore");
|
|
35525
36467
|
const existingCredentials = loadCredentials(sys2);
|
|
35526
36468
|
credentials = Object.assign(existingCredentials, credentials);
|
|
35527
|
-
mkdirSync(
|
|
36469
|
+
mkdirSync(dirname2(filePath), { recursive: true });
|
|
35528
36470
|
writeFileSync(filePath, JSON.stringify({ credentials }, null, 2));
|
|
35529
36471
|
const gitignoreEntry = ".config/";
|
|
35530
|
-
if (
|
|
35531
|
-
const gitignoreContent =
|
|
36472
|
+
if (existsSync2(gitignorePath)) {
|
|
36473
|
+
const gitignoreContent = readFileSync2(gitignorePath, "utf8");
|
|
35532
36474
|
if (!gitignoreContent.includes(gitignoreEntry)) {
|
|
35533
36475
|
writeFileSync(
|
|
35534
36476
|
gitignorePath,
|
|
@@ -35541,21 +36483,21 @@ function storeCredentials(sys2, credentials) {
|
|
|
35541
36483
|
}
|
|
35542
36484
|
}
|
|
35543
36485
|
function loadCredentials(sys2) {
|
|
35544
|
-
const newPath =
|
|
36486
|
+
const newPath = join3(
|
|
35545
36487
|
sys2.getAppRootDir(),
|
|
35546
36488
|
".config",
|
|
35547
36489
|
"builderio",
|
|
35548
36490
|
"data.json"
|
|
35549
36491
|
);
|
|
35550
36492
|
const locations = [
|
|
35551
|
-
|
|
36493
|
+
join3(sys2.getAppRootDir(), "node_modules", ".builder", "data.json"),
|
|
35552
36494
|
newPath,
|
|
35553
|
-
|
|
36495
|
+
join3(sys2.getRepoRootDir(), ".git", ".builder.json")
|
|
35554
36496
|
];
|
|
35555
36497
|
for (const filepath of locations) {
|
|
35556
|
-
if (
|
|
36498
|
+
if (existsSync2(filepath)) {
|
|
35557
36499
|
try {
|
|
35558
|
-
const data =
|
|
36500
|
+
const data = readFileSync2(filepath, "utf8");
|
|
35559
36501
|
return JSON.parse(data).credentials;
|
|
35560
36502
|
} catch (e2) {
|
|
35561
36503
|
sys2.Sentry?.captureException(e2, {
|
|
@@ -35567,17 +36509,17 @@ function loadCredentials(sys2) {
|
|
|
35567
36509
|
return {};
|
|
35568
36510
|
}
|
|
35569
36511
|
async function createAuthServer(opts) {
|
|
35570
|
-
let
|
|
36512
|
+
let resolve4;
|
|
35571
36513
|
let reject;
|
|
35572
36514
|
let s2;
|
|
35573
36515
|
const promise = new Promise((re, rej) => {
|
|
35574
|
-
|
|
36516
|
+
resolve4 = re;
|
|
35575
36517
|
reject = rej;
|
|
35576
36518
|
});
|
|
35577
36519
|
let currentPort = opts.initialPort;
|
|
35578
36520
|
let attempt = 0;
|
|
35579
36521
|
const server = createServer(
|
|
35580
|
-
(req, res) => opts.requestListener(currentPort, req, res,
|
|
36522
|
+
(req, res) => opts.requestListener(currentPort, req, res, resolve4, reject)
|
|
35581
36523
|
);
|
|
35582
36524
|
const closeServer = () => {
|
|
35583
36525
|
clearHooks();
|
|
@@ -36013,8 +36955,8 @@ async function getRequestBody(request2) {
|
|
|
36013
36955
|
return body;
|
|
36014
36956
|
}
|
|
36015
36957
|
function getNodeHttpUrl(req) {
|
|
36016
|
-
const
|
|
36017
|
-
return new URL(
|
|
36958
|
+
const path3 = req.url || "/";
|
|
36959
|
+
return new URL(path3, `http://${req.headers.host}`);
|
|
36018
36960
|
}
|
|
36019
36961
|
var init_request_handler = __esm({
|
|
36020
36962
|
"packages/dev-tools/server/request-handler.ts"() {
|
|
@@ -36042,7 +36984,7 @@ async function createDevToolsHttpServer(ctx) {
|
|
|
36042
36984
|
handleDevRequest(ctx, server, request2, response2);
|
|
36043
36985
|
});
|
|
36044
36986
|
const shutdownServer = () => {
|
|
36045
|
-
return new Promise((
|
|
36987
|
+
return new Promise((resolve4, reject) => {
|
|
36046
36988
|
if (server.listening) {
|
|
36047
36989
|
ctx.debug(`closing devtools server on port ${port}`);
|
|
36048
36990
|
server.close((err) => {
|
|
@@ -36054,12 +36996,12 @@ async function createDevToolsHttpServer(ctx) {
|
|
|
36054
36996
|
if (ctx) {
|
|
36055
36997
|
ctx.debug(`closed devtools server on port ${port}`);
|
|
36056
36998
|
}
|
|
36057
|
-
|
|
36999
|
+
resolve4();
|
|
36058
37000
|
}
|
|
36059
37001
|
});
|
|
36060
37002
|
} else {
|
|
36061
37003
|
ctx.debug(`devtools server on port ${port} not listening`);
|
|
36062
|
-
|
|
37004
|
+
resolve4();
|
|
36063
37005
|
}
|
|
36064
37006
|
});
|
|
36065
37007
|
};
|
|
@@ -36080,15 +37022,15 @@ async function createDevToolsHttpServer(ctx) {
|
|
|
36080
37022
|
await shutdownServer();
|
|
36081
37023
|
}
|
|
36082
37024
|
};
|
|
36083
|
-
return new Promise((
|
|
37025
|
+
return new Promise((resolve4) => {
|
|
36084
37026
|
server.listen(port, () => {
|
|
36085
37027
|
ctx.debug(`started devtools server on port ${port}`);
|
|
36086
|
-
|
|
37028
|
+
resolve4(globalThis.__builderDevToolsServer);
|
|
36087
37029
|
});
|
|
36088
37030
|
});
|
|
36089
37031
|
}
|
|
36090
37032
|
function setupDevToolsPort(ctx) {
|
|
36091
|
-
return new Promise((
|
|
37033
|
+
return new Promise((resolve4) => {
|
|
36092
37034
|
const port = ctx.port;
|
|
36093
37035
|
try {
|
|
36094
37036
|
const options = {
|
|
@@ -36100,15 +37042,15 @@ function setupDevToolsPort(ctx) {
|
|
|
36100
37042
|
request(options, (res) => {
|
|
36101
37043
|
res.on("end", () => {
|
|
36102
37044
|
ctx.debug(`${DEV_TOOLS_SERVER_CLOSE_PATH} - Response ended`);
|
|
36103
|
-
|
|
37045
|
+
resolve4(port);
|
|
36104
37046
|
});
|
|
36105
37047
|
}).on("error", (error) => {
|
|
36106
37048
|
ctx.debug(`${DEV_TOOLS_SERVER_CLOSE_PATH} - No response ${error}`);
|
|
36107
|
-
|
|
37049
|
+
resolve4(port);
|
|
36108
37050
|
}).end();
|
|
36109
37051
|
} catch (e2) {
|
|
36110
37052
|
ctx.debug(`${DEV_TOOLS_SERVER_CLOSE_PATH} - Error ${e2}`);
|
|
36111
|
-
|
|
37053
|
+
resolve4(port);
|
|
36112
37054
|
}
|
|
36113
37055
|
});
|
|
36114
37056
|
}
|