@builder.io/dev-tools 1.18.40-dev.202512081828.78246177d → 1.18.40-dev.202512101047.78246177d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +1789 -1647
- 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 +1 -1
- package/server/index.cjs +854 -476
- package/server/index.mjs +870 -492
- package/types/cli/launch/server.d.ts +2 -5
- package/types/common/ast/convert-values.d.ts +1 -1
- package/types/server/source-map-resolver.d.ts +30 -0
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types.d.ts +13 -1
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.40-dev.
|
|
48
|
+
builderVersion = true ? "1.18.40-dev.202512101047.78246177d" : "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
|
}
|
|
@@ -1194,6 +1194,205 @@ var init_builder_connect = __esm({
|
|
|
1194
1194
|
}
|
|
1195
1195
|
});
|
|
1196
1196
|
|
|
1197
|
+
// packages/dev-tools/server/source-map-resolver.ts
|
|
1198
|
+
import * as fs from "fs";
|
|
1199
|
+
import * as path2 from "path";
|
|
1200
|
+
function decodeVLQ(str, index) {
|
|
1201
|
+
let result = 0;
|
|
1202
|
+
let shift = 0;
|
|
1203
|
+
let continuation = true;
|
|
1204
|
+
let digit;
|
|
1205
|
+
while (continuation) {
|
|
1206
|
+
if (index >= str.length) {
|
|
1207
|
+
return [0, index];
|
|
1208
|
+
}
|
|
1209
|
+
const char = str[index++];
|
|
1210
|
+
digit = BASE64_MAP[char];
|
|
1211
|
+
if (digit === void 0) {
|
|
1212
|
+
return [0, index];
|
|
1213
|
+
}
|
|
1214
|
+
continuation = (digit & VLQ_CONTINUATION_BIT) !== 0;
|
|
1215
|
+
digit &= VLQ_BASE_MASK;
|
|
1216
|
+
result += digit << shift;
|
|
1217
|
+
shift += VLQ_BASE_SHIFT;
|
|
1218
|
+
}
|
|
1219
|
+
const negate = result & 1;
|
|
1220
|
+
result = result >> 1;
|
|
1221
|
+
return [negate ? -result : result, index];
|
|
1222
|
+
}
|
|
1223
|
+
function decodeVLQSegment(str) {
|
|
1224
|
+
const values = [];
|
|
1225
|
+
let index = 0;
|
|
1226
|
+
while (index < str.length) {
|
|
1227
|
+
const [value, nextIndex] = decodeVLQ(str, index);
|
|
1228
|
+
values.push(value);
|
|
1229
|
+
index = nextIndex;
|
|
1230
|
+
}
|
|
1231
|
+
return values;
|
|
1232
|
+
}
|
|
1233
|
+
function resolveSourceMapPosition(sourceMap, generatedLine, generatedColumn) {
|
|
1234
|
+
try {
|
|
1235
|
+
const mappings = sourceMap.mappings.split(";");
|
|
1236
|
+
if (generatedLine < 1 || generatedLine > mappings.length) {
|
|
1237
|
+
return null;
|
|
1238
|
+
}
|
|
1239
|
+
const lineMapping = mappings[generatedLine - 1];
|
|
1240
|
+
if (!lineMapping) {
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1243
|
+
const segments = lineMapping.split(",");
|
|
1244
|
+
if (segments.length === 0) {
|
|
1245
|
+
return null;
|
|
1246
|
+
}
|
|
1247
|
+
let generatedColumnOffset = 0;
|
|
1248
|
+
let sourceFileIndex = 0;
|
|
1249
|
+
let sourceLineOffset = 0;
|
|
1250
|
+
let sourceColumnOffset = 0;
|
|
1251
|
+
let nameIndex;
|
|
1252
|
+
let bestGeneratedColumn = -1;
|
|
1253
|
+
let bestMatch = null;
|
|
1254
|
+
for (const segment of segments) {
|
|
1255
|
+
if (!segment) continue;
|
|
1256
|
+
const values = decodeVLQSegment(segment);
|
|
1257
|
+
if (values.length === 0) continue;
|
|
1258
|
+
generatedColumnOffset += values[0];
|
|
1259
|
+
if (values.length >= 4) {
|
|
1260
|
+
sourceFileIndex += values[1];
|
|
1261
|
+
sourceLineOffset += values[2];
|
|
1262
|
+
sourceColumnOffset += values[3];
|
|
1263
|
+
}
|
|
1264
|
+
if (values.length >= 5) {
|
|
1265
|
+
nameIndex = (nameIndex || 0) + values[4];
|
|
1266
|
+
}
|
|
1267
|
+
if (generatedColumnOffset <= generatedColumn && generatedColumnOffset > bestGeneratedColumn) {
|
|
1268
|
+
bestGeneratedColumn = generatedColumnOffset;
|
|
1269
|
+
bestMatch = {
|
|
1270
|
+
sourceFileIndex,
|
|
1271
|
+
sourceLineOffset,
|
|
1272
|
+
sourceColumnOffset,
|
|
1273
|
+
nameIndex
|
|
1274
|
+
};
|
|
1275
|
+
if (generatedColumnOffset === generatedColumn) {
|
|
1276
|
+
break;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
if (!bestMatch) {
|
|
1281
|
+
return null;
|
|
1282
|
+
}
|
|
1283
|
+
const source = sourceMap.sources[bestMatch.sourceFileIndex];
|
|
1284
|
+
if (!source) {
|
|
1285
|
+
return null;
|
|
1286
|
+
}
|
|
1287
|
+
let resolvedSource = source;
|
|
1288
|
+
if (sourceMap.sourceRoot) {
|
|
1289
|
+
resolvedSource = sourceMap.sourceRoot.replace(/\/$/, "") + "/" + source.replace(/^\//, "");
|
|
1290
|
+
}
|
|
1291
|
+
return {
|
|
1292
|
+
source: resolvedSource,
|
|
1293
|
+
line: bestMatch.sourceLineOffset + 1,
|
|
1294
|
+
column: bestMatch.sourceColumnOffset,
|
|
1295
|
+
name: bestMatch.nameIndex !== void 0 && sourceMap.names ? sourceMap.names[bestMatch.nameIndex] : void 0
|
|
1296
|
+
};
|
|
1297
|
+
} catch (error) {
|
|
1298
|
+
console.error("[SourceMap] Error resolving position:", error);
|
|
1299
|
+
return null;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
async function resolveSourceLocation(projectRoot, bundledPath, line, column) {
|
|
1303
|
+
try {
|
|
1304
|
+
let normalizedPath = bundledPath;
|
|
1305
|
+
if (normalizedPath.startsWith("/")) {
|
|
1306
|
+
normalizedPath = normalizedPath.substring(1);
|
|
1307
|
+
}
|
|
1308
|
+
let sourceMapPath = null;
|
|
1309
|
+
const possiblePaths = [
|
|
1310
|
+
path2.join(projectRoot, normalizedPath + ".map"),
|
|
1311
|
+
path2.join(
|
|
1312
|
+
projectRoot,
|
|
1313
|
+
".next",
|
|
1314
|
+
"static",
|
|
1315
|
+
normalizedPath.replace("_next/static/", "") + ".map"
|
|
1316
|
+
),
|
|
1317
|
+
path2.join(
|
|
1318
|
+
projectRoot,
|
|
1319
|
+
normalizedPath.replace("_next/", ".next/") + ".map"
|
|
1320
|
+
)
|
|
1321
|
+
];
|
|
1322
|
+
for (const possiblePath of possiblePaths) {
|
|
1323
|
+
if (fs.existsSync(possiblePath)) {
|
|
1324
|
+
sourceMapPath = possiblePath;
|
|
1325
|
+
break;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
if (!sourceMapPath) {
|
|
1329
|
+
console.debug(`[SourceMap] Source map not found for ${bundledPath}`);
|
|
1330
|
+
return null;
|
|
1331
|
+
}
|
|
1332
|
+
const cacheKey = sourceMapPath;
|
|
1333
|
+
let sourceMap = sourceMapCache.get(cacheKey);
|
|
1334
|
+
if (sourceMap === void 0) {
|
|
1335
|
+
try {
|
|
1336
|
+
const sourceMapContent = fs.readFileSync(sourceMapPath, "utf-8");
|
|
1337
|
+
sourceMap = JSON.parse(sourceMapContent);
|
|
1338
|
+
sourceMapCache.set(cacheKey, sourceMap);
|
|
1339
|
+
} catch (error) {
|
|
1340
|
+
console.error(
|
|
1341
|
+
`[SourceMap] Error reading source map ${sourceMapPath}:`,
|
|
1342
|
+
error
|
|
1343
|
+
);
|
|
1344
|
+
sourceMapCache.set(cacheKey, null);
|
|
1345
|
+
return null;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
if (!sourceMap) {
|
|
1349
|
+
return null;
|
|
1350
|
+
}
|
|
1351
|
+
const resolved = resolveSourceMapPosition(sourceMap, line, column);
|
|
1352
|
+
if (resolved) {
|
|
1353
|
+
if (resolved.source.startsWith("webpack://")) {
|
|
1354
|
+
resolved.source = resolved.source.replace(/^webpack:\/\/[^/]*\//, "");
|
|
1355
|
+
}
|
|
1356
|
+
if (resolved.source.startsWith("./")) {
|
|
1357
|
+
resolved.source = resolved.source.substring(2);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
return resolved;
|
|
1361
|
+
} catch (error) {
|
|
1362
|
+
console.error("[SourceMap] Error resolving source location:", error);
|
|
1363
|
+
return null;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
async function batchResolveSourceLocations(projectRoot, locations) {
|
|
1367
|
+
const results = [];
|
|
1368
|
+
for (const loc of locations) {
|
|
1369
|
+
const resolved = await resolveSourceLocation(
|
|
1370
|
+
projectRoot,
|
|
1371
|
+
loc.bundledPath,
|
|
1372
|
+
loc.line,
|
|
1373
|
+
loc.column
|
|
1374
|
+
);
|
|
1375
|
+
results.push(resolved);
|
|
1376
|
+
}
|
|
1377
|
+
return results;
|
|
1378
|
+
}
|
|
1379
|
+
var VLQ_BASE_SHIFT, VLQ_BASE, VLQ_BASE_MASK, VLQ_CONTINUATION_BIT, BASE64_CHARS, BASE64_MAP, sourceMapCache;
|
|
1380
|
+
var init_source_map_resolver = __esm({
|
|
1381
|
+
"packages/dev-tools/server/source-map-resolver.ts"() {
|
|
1382
|
+
"use strict";
|
|
1383
|
+
VLQ_BASE_SHIFT = 5;
|
|
1384
|
+
VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
1385
|
+
VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
1386
|
+
VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
1387
|
+
BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1388
|
+
BASE64_MAP = {};
|
|
1389
|
+
for (let i = 0; i < BASE64_CHARS.length; i++) {
|
|
1390
|
+
BASE64_MAP[BASE64_CHARS[i]] = i;
|
|
1391
|
+
}
|
|
1392
|
+
sourceMapCache = /* @__PURE__ */ new Map();
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
|
|
1197
1396
|
// packages/dev-tools/server/dev-tools-api.ts
|
|
1198
1397
|
async function handleDevApiRequest(ctx, apiReq) {
|
|
1199
1398
|
const result = {
|
|
@@ -1317,6 +1516,23 @@ async function handleDevApiRequest(ctx, apiReq) {
|
|
|
1317
1516
|
result.data = await readConfigFile();
|
|
1318
1517
|
break;
|
|
1319
1518
|
}
|
|
1519
|
+
case "resolveSourceMap": {
|
|
1520
|
+
const projectRoot = ctx.getAppRootDir();
|
|
1521
|
+
if (Array.isArray(apiReq.data)) {
|
|
1522
|
+
result.data = await batchResolveSourceLocations(
|
|
1523
|
+
projectRoot,
|
|
1524
|
+
apiReq.data
|
|
1525
|
+
);
|
|
1526
|
+
} else {
|
|
1527
|
+
result.data = await resolveSourceLocation(
|
|
1528
|
+
projectRoot,
|
|
1529
|
+
apiReq.data.bundledPath,
|
|
1530
|
+
apiReq.data.line,
|
|
1531
|
+
apiReq.data.column
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
break;
|
|
1535
|
+
}
|
|
1320
1536
|
default: {
|
|
1321
1537
|
result.errors = [`Unknown request type: ${JSON.stringify(apiReq)}`];
|
|
1322
1538
|
const _exhaustiveCheck = apiReq;
|
|
@@ -1325,15 +1541,15 @@ async function handleDevApiRequest(ctx, apiReq) {
|
|
|
1325
1541
|
}
|
|
1326
1542
|
return result;
|
|
1327
1543
|
}
|
|
1328
|
-
function isValidFileRequest(sys2,
|
|
1329
|
-
if (!
|
|
1544
|
+
function isValidFileRequest(sys2, path3) {
|
|
1545
|
+
if (!path3) {
|
|
1330
1546
|
return false;
|
|
1331
1547
|
}
|
|
1332
|
-
if (
|
|
1548
|
+
if (path3.includes("..")) {
|
|
1333
1549
|
return false;
|
|
1334
1550
|
}
|
|
1335
|
-
|
|
1336
|
-
const parts =
|
|
1551
|
+
path3 = path3.replace(/\\/g, "/");
|
|
1552
|
+
const parts = path3.split("/");
|
|
1337
1553
|
const last = parts[parts.length - 1];
|
|
1338
1554
|
if (last.length > 0) {
|
|
1339
1555
|
let ext = last.split(".").pop();
|
|
@@ -1345,7 +1561,7 @@ function isValidFileRequest(sys2, path2) {
|
|
|
1345
1561
|
}
|
|
1346
1562
|
}
|
|
1347
1563
|
}
|
|
1348
|
-
if (!validatePath(sys2,
|
|
1564
|
+
if (!validatePath(sys2, path3)) {
|
|
1349
1565
|
return false;
|
|
1350
1566
|
}
|
|
1351
1567
|
return false;
|
|
@@ -1383,6 +1599,7 @@ var init_dev_tools_api = __esm({
|
|
|
1383
1599
|
init_typescript();
|
|
1384
1600
|
init_node_sys();
|
|
1385
1601
|
init_builder_connect();
|
|
1602
|
+
init_source_map_resolver();
|
|
1386
1603
|
EXT_WHITELIST = [
|
|
1387
1604
|
".js",
|
|
1388
1605
|
".jsx",
|
|
@@ -1420,7 +1637,7 @@ var init_dev_tools_api = __esm({
|
|
|
1420
1637
|
|
|
1421
1638
|
// packages/dev-tools/server/client-script.ts
|
|
1422
1639
|
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.40-dev.202512081828.78246177d";\n }\n highlightOpener() {\n const menuToggle = this.shadowRoot.querySelector(".menu-toggle");\n menuToggle.classList.add("menu-toggle-highlight");\n menuToggle.classList.add("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight");\n }, 20);\n }, 20);\n }\n };\n\n // packages/dev-tools/client/setup-ui/overview.ts\n var STEP_CSS = `<style>/* packages/dev-tools/client/setup-ui/styles.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml,\nbody,\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n z-index: 2147483646;\n margin: 0;\n padding: 0;\n line-height: 1.8;\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n background-color: rgba(37, 37, 37, 1);\n color: white;\n transition: opacity 250ms ease-in-out;\n}\n:host([aria-hidden="true"]) {\n opacity: 0;\n pointer-events: none;\n}\nmain {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n}\nh1 {\n margin-top: 0;\n font-size: 24px;\n font-weight: 300;\n line-height: 1.4;\n}\np {\n margin: 20px 0;\n font-weight: 300;\n}\nbutton {\n cursor: pointer;\n}\naside {\n position: absolute;\n top: 0;\n left: 0;\n width: 350px;\n height: 100vh;\n padding: 60px 0 0 50px;\n background-color: rgba(18, 18, 18, 1);\n}\naside ul {\n margin: 30px 0 0 0px;\n padding: 0;\n list-style: none;\n}\naside li {\n position: relative;\n margin: 0;\n padding: 20px 10px;\n font-weight: 300;\n}\naside li.highlight {\n color: rgba(72, 161, 255, 1);\n}\naside li.active {\n font-weight: 700;\n}\naside li .circle {\n position: absolute;\n top: 20px;\n left: 10px;\n width: 24px;\n height: 24px;\n border: 3px solid white;\n border-radius: 50%;\n font-size: 14px;\n}\naside li.highlight .circle {\n border-color: rgba(72, 161, 255, 1);\n}\naside li.active .circle::after {\n content: "";\n position: absolute;\n top: 3px;\n left: 3px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle {\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle::after {\n content: "";\n position: absolute;\n top: 2px;\n left: 6px;\n width: 6px;\n height: 13px;\n border: 3px solid black;\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n}\naside li .line {\n position: absolute;\n top: 44px;\n left: 21px;\n width: 3px;\n height: 45px;\n background-color: white;\n}\naside li.completed .line {\n background-color: rgba(72, 161, 255, 1);\n}\naside li span {\n display: block;\n margin-left: 44px;\n}\nnav {\n margin-top: 30px;\n}\nsection {\n position: absolute;\n top: 135px;\n left: 350px;\n padding: 0 80px 0 140px;\n transition: opacity 150ms ease-in-out;\n}\nsection[aria-hidden=true] {\n pointer-events: none;\n opacity: 0;\n}\nsection h1,\nsection p {\n min-width: 300px;\n max-width: 600px;\n}\n.button {\n position: relative;\n display: inline-block;\n color: white;\n background-color: rgba(72, 161, 255, 1);\n border-radius: 4px;\n text-decoration: none;\n padding: 10px 40px 10px 20px;\n white-space: nowrap;\n}\n.button:hover {\n background-color: rgba(72, 161, 255, 0.85);\n}\n#button-icon {\n position: absolute;\n top: 1px;\n right: 5px;\n bottom: 0;\n width: 30px;\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 24px 24px;\n}\n.button[aria-disabled=true] {\n opacity: 0.9;\n background-color: rgba(255, 255, 255, 0.3);\n pointer-events: none;\n padding-right: 60px;\n}\n.button[aria-disabled=true] #button-icon {\n top: 21px;\n right: 29px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background: white;\n color: white;\n animation: dot-flashing 0.5s infinite linear alternate;\n animation-delay: 0.25s;\n}\n.button[aria-disabled=true] #button-icon::before,\n.button[aria-disabled=true] #button-icon::after {\n content: "";\n display: inline-block;\n position: absolute;\n top: 0;\n}\n.button[aria-disabled=true] #button-icon::before {\n left: -12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0s;\n}\n.button[aria-disabled=true] #button-icon::after {\n left: 12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0.5s;\n}\n@keyframes dot-flashing {\n 0% {\n background-color: white;\n }\n 50%, 100% {\n background-color: rgba(255, 255, 255, 0.3);\n }\n}\n.logo {\n margin-left: 9px;\n background: url(\'data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>\');\n background-repeat: no-repeat;\n width: 150px;\n height: 32px;\n}\n@media (max-width: 840px) {\n aside {\n width: 250px;\n padding: 60px 0 0 20px;\n }\n section {\n left: 250px;\n padding: 0 80px;\n }\n}\n@media (max-width: 590px) {\n aside {\n width: 230px;\n padding: 60px 0 0 10px;\n }\n section {\n left: 230px;\n padding: 0 40px;\n }\n}\n#modified-files-message a {\n color: #cbcbcb;\n font-weight: 300;\n text-decoration: underline;\n}\n#modified-files-message a:hover {\n color: white;\n text-decoration: none;\n}\n#restart-warning {\n border-radius: 4px;\n padding: 8px 16px;\n border: 1px solid #fd6b3c;\n background: rgba(253, 107, 60, 0.1);\n}\n#react-router-steps {\n margin: 0px;\n margin-bottom: 5px;\n padding: 0px 20px;\n}\n#need-help {\n color: #48a1ff;\n text-decoration: none;\n}\n#router-message {\n border-radius: 4px;\n padding: 16px;\n border: 1px solid #48a1ff;\n}\n#router-finish-button {\n margin-top: 12px;\n}\n#router-checkbox-div {\n display: flex;\n align-items: center;\n}\n#router-checkbox {\n margin-right: 10px;\n width: 15px;\n height: 15px;\n}\n#success-title {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n#success-title .check-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 2px solid #28a745;\n border-radius: 50%;\n position: relative;\n}\n#success-title .check-icon::before {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 6px;\n height: 12px;\n border: solid #28a745;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -60%) rotate(45deg);\n}\n</style>`;\n var BuilderOverviewStep = class extends HTMLElement {\n constructor() {\n super();\n }\n connectedCallback() {\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = STEP_CSS + `<main>\n <aside>\n <div class="logo"></div>\n\n <ul>\n <li class="highlight active">\n <div class="circle"></div>\n <div class="line"></div>\n <span>Connect Builder.io</span>\n </li>\n <li>\n <div class="circle"></div>\n <div class="line"></div>\n <span>Update App</span>\n </li>\n <li>\n <div class="circle"></div>\n <span>Setup Complete</span>\n </li>\n </ul>\n </aside>\n\n <section>\n <h1>Integrate Builder.io with your project</h1>\n\n <p>\n First, let\'s connect to your Builder.io space to continue with the\n integration\n </p>\n\n <nav>\n <a class="button next-step" href="#">\n <span id="button-text">Get Started</span>\n <span id="button-icon"></span>\n </a>\n </nav>\n </section>\n</main>\n`;\n setBuilderHead();\n const authPath = new URL(BUILDER_AUTH_CONNECT_PATH, DEV_TOOLS_URL);\n authPath.searchParams.set(PREVIEW_URL_QS, location.href);\n const nextStepLinks = shadow.querySelectorAll(".next-step");\n for (const nextStepLink of nextStepLinks) {\n nextStepLink.setAttribute("href", authPath.href);\n }\n track("overview step viewed");\n }\n };\n var setBuilderHead = () => {\n let favicon = document.head.querySelector(\n "link[rel=\'icon\'], link[rel=\'icon shortcut\']"\n );\n if (favicon) {\n favicon.href = "https://cdn.builder.io/favicon.ico";\n favicon.removeAttribute("type");\n } else {\n favicon = document.createElement("link");\n favicon.rel = "icon";\n favicon.href = "https://cdn.builder.io/favicon.ico";\n document.head.appendChild(favicon);\n }\n };\n\n // packages/dev-tools/client/setup-ui/index.ts\n var checkBuilderIntegration = async () => {\n const validatedBuilder = await apiValidateBuilder();\n if (!validatedBuilder.isValid) {\n showOverviewStep();\n }\n };\n var showOverviewStep = () => {\n if (!customElements.get("builder-dev-tools-overview")) {\n customElements.define("builder-dev-tools-overview", BuilderOverviewStep);\n }\n let overview = document.querySelector(\n "builder-dev-tools-overview"\n );\n if (!overview) {\n overview = document.createElement(\n "builder-dev-tools-overview"\n );\n overview.setAttribute("aria-hidden", "true");\n document.body.appendChild(overview);\n }\n setTimeout(() => {\n overview.removeAttribute("aria-hidden");\n }, 32);\n };\n\n // packages/dev-tools/client/index.ts\n var initDevToolsApp = () => {\n try {\n if (!customElements.get("builder-dev-tools-edit")) {\n customElements.define(\n "builder-dev-tools-edit",\n BuilderDevToolsEditButton\n );\n }\n if (!customElements.get("builder-dev-tools-menu")) {\n customElements.define("builder-dev-tools-menu", BuilderDevToolsMenu);\n }\n let menu = document.querySelector("builder-dev-tools-menu");\n if (!menu) {\n menu = document.createElement("builder-dev-tools-menu");\n menu.setAttribute("data-version", "1.18.40-dev.202512081828.78246177d");\n document.body.appendChild(menu);\n }\n let editButton = document.querySelector("builder-dev-tools-edit");\n if (!editButton) {\n editButton = document.createElement("builder-dev-tools-edit");\n document.body.appendChild(editButton);\n }\n let builderStyles = document.getElementById("builder-dev-tools-style");\n if (!builderStyles) {\n builderStyles = document.createElement("style");\n builderStyles.id = "builder-dev-tools-style";\n builderStyles.innerHTML = `.builder-no-scroll{overflow:hidden !important}`;\n document.head.appendChild(builderStyles);\n }\n checkBuilderIntegration();\n initTracking();\n } catch (e) {\n console.error("Builder Devtools:", e);\n }\n };\n if (window.location === window.parent.location) {\n console.debug(`Builder.io Devtools v${"1.18.40-dev.202512081828.78246177d"}`);\n initDevToolsApp();\n }\n})();');
|
|
1640
|
+
return updateClientRuntimeVariables(ctx, '"use strict";\n(() => {\n var __create = Object.create;\n var __defProp = Object.defineProperty;\n var __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n var __getOwnPropNames = Object.getOwnPropertyNames;\n var __getProtoOf = Object.getPrototypeOf;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n };\n var __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n };\n var __copyProps = (to, from, except, desc) => {\n if (from && typeof from === "object" || typeof from === "function") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n };\n var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. "__esModule" has not been set), then set\n // "default" to the CommonJS "module.exports" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,\n mod\n ));\n\n // node_modules/@amplitude/ua-parser-js/src/ua-parser.js\n var require_ua_parser = __commonJS({\n "node_modules/@amplitude/ua-parser-js/src/ua-parser.js"(exports, module) {\n (function(window2, undefined2) {\n "use strict";\n var LIBVERSION = "0.7.33", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION2 = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 350;\n var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook";\n var extend = function(regexes2, extensions) {\n var mergedRegexes = {};\n for (var i in regexes2) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes2[i]);\n } else {\n mergedRegexes[i] = regexes2[i];\n }\n }\n return mergedRegexes;\n }, enumerize = function(arr) {\n var enums = {};\n for (var i = 0; i < arr.length; i++) {\n enums[arr[i].toUpperCase()] = arr[i];\n }\n return enums;\n }, has = function(str1, str2) {\n return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n }, lowerize = function(str) {\n return str.toLowerCase();\n }, majorize = function(version) {\n return typeof version === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split(".")[0] : undefined2;\n }, trim = function(str, len) {\n if (typeof str === STR_TYPE) {\n str = str.replace(/^\\s\\s*/, EMPTY);\n return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n }\n };\n var rgxMapper = function(ua, arrays) {\n var i = 0, j, k, p, q, matches, match;\n while (i < arrays.length && !matches) {\n var regex = arrays[i], props = arrays[i + 1];\n j = k = 0;\n while (j < regex.length && !matches) {\n matches = regex[j++].exec(ua);\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length === 2) {\n if (typeof q[1] == FUNC_TYPE) {\n this[q[0]] = q[1].call(this, match);\n } else {\n this[q[0]] = q[1];\n }\n } else if (q.length === 3) {\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;\n } else {\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;\n }\n } else if (q.length === 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;\n }\n } else {\n this[q] = match ? match : undefined2;\n }\n }\n }\n }\n i += 2;\n }\n }, strMapper = function(str, map) {\n for (var i in map) {\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (has(map[i][j], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n } else if (has(map[i], str)) {\n return i === UNKNOWN ? undefined2 : i;\n }\n }\n return str;\n };\n var oldSafariMap = {\n "1.0": "/8",\n 1.2: "/1",\n 1.3: "/3",\n "2.0": "/412",\n "2.0.2": "/416",\n "2.0.3": "/417",\n "2.0.4": "/419",\n "?": "/"\n }, windowsVersionMap = {\n ME: "4.90",\n "NT 3.11": "NT3.51",\n "NT 4.0": "NT4.0",\n 2e3: "NT 5.0",\n XP: ["NT 5.1", "NT 5.2"],\n Vista: "NT 6.0",\n 7: "NT 6.1",\n 8: "NT 6.2",\n 8.1: "NT 6.3",\n 10: ["NT 6.4", "NT 10.0"],\n RT: "ARM"\n };\n var regexes = {\n browser: [\n [\n /\\b(?:crmo|crios)\\/([\\w\\.]+)/i\n // Chrome for Android/iOS\n ],\n [VERSION2, [NAME, "Chrome"]],\n [\n /edg(?:e|ios|a)?\\/([\\w\\.]+)/i\n // Microsoft Edge\n ],\n [VERSION2, [NAME, "Edge"]],\n [\n // Presto based\n /(opera mini)\\/([-\\w\\.]+)/i,\n // Opera Mini\n /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,\n // Opera Mobi/Tablet\n /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i\n // Opera\n ],\n [NAME, VERSION2],\n [\n /opios[\\/ ]+([\\w\\.]+)/i\n // Opera mini on iphone >= 8.0\n ],\n [VERSION2, [NAME, OPERA + " Mini"]],\n [\n /\\bopr\\/([\\w\\.]+)/i\n // Opera Webkit\n ],\n [VERSION2, [NAME, OPERA]],\n [\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,\n // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,\n // Avant/IEMobile/SlimBrowser\n /(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,\n // Baidu Browser\n /(?:ms|\\()(ie) ([\\w\\.]+)/i,\n // Internet Explorer\n // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,\n // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n /(weibo)__([\\d\\.]+)/i\n // Weibo\n ],\n [NAME, VERSION2],\n [\n /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i\n // UCBrowser\n ],\n [VERSION2, [NAME, "UC" + BROWSER]],\n [\n /microm.+\\bqbcore\\/([\\w\\.]+)/i,\n // WeChat Desktop for Windows Built-in Browser\n /\\bqbcore\\/([\\w\\.]+).+microm/i\n ],\n [VERSION2, [NAME, "WeChat(Win) Desktop"]],\n [\n /micromessenger\\/([\\w\\.]+)/i\n // WeChat\n ],\n [VERSION2, [NAME, "WeChat"]],\n [\n /konqueror\\/([\\w\\.]+)/i\n // Konqueror\n ],\n [VERSION2, [NAME, "Konqueror"]],\n [\n /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i\n // IE11\n ],\n [VERSION2, [NAME, "IE"]],\n [\n /yabrowser\\/([\\w\\.]+)/i\n // Yandex\n ],\n [VERSION2, [NAME, "Yandex"]],\n [\n /(avast|avg)\\/([\\w\\.]+)/i\n // Avast/AVG Secure Browser\n ],\n [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION2],\n [\n /\\bfocus\\/([\\w\\.]+)/i\n // Firefox Focus\n ],\n [VERSION2, [NAME, FIREFOX + " Focus"]],\n [\n /\\bopt\\/([\\w\\.]+)/i\n // Opera Touch\n ],\n [VERSION2, [NAME, OPERA + " Touch"]],\n [\n /coc_coc\\w+\\/([\\w\\.]+)/i\n // Coc Coc Browser\n ],\n [VERSION2, [NAME, "Coc Coc"]],\n [\n /dolfin\\/([\\w\\.]+)/i\n // Dolphin\n ],\n [VERSION2, [NAME, "Dolphin"]],\n [\n /coast\\/([\\w\\.]+)/i\n // Opera Coast\n ],\n [VERSION2, [NAME, OPERA + " Coast"]],\n [\n /miuibrowser\\/([\\w\\.]+)/i\n // MIUI Browser\n ],\n [VERSION2, [NAME, "MIUI " + BROWSER]],\n [\n /fxios\\/([-\\w\\.]+)/i\n // Firefox for iOS\n ],\n [VERSION2, [NAME, FIREFOX]],\n [\n /\\bqihu|(qi?ho?o?|360)browser/i\n // 360\n ],\n [[NAME, "360 " + BROWSER]],\n [/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],\n [[NAME, /(.+)/, "$1 " + BROWSER], VERSION2],\n [\n // Oculus/Samsung/Sailfish/Huawei Browser\n /(comodo_dragon)\\/([\\w\\.]+)/i\n // Comodo Dragon\n ],\n [[NAME, /_/g, " "], VERSION2],\n [\n /(electron)\\/([\\w\\.]+) safari/i,\n // Electron-based App\n /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,\n // Tesla\n /m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i\n // QQBrowser/Baidu App/2345 Browser\n ],\n [NAME, VERSION2],\n [\n /(metasr)[\\/ ]?([\\w\\.]+)/i,\n // SouGouBrowser\n /(lbbrowser)/i,\n // LieBao Browser\n /\\[(linkedin)app\\]/i\n // LinkedIn App for iOS & Android\n ],\n [NAME],\n [\n // WebView\n /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i\n // Facebook App for iOS & Android\n ],\n [[NAME, FACEBOOK], VERSION2],\n [\n /safari (line)\\/([\\w\\.]+)/i,\n // Line App for iOS\n /\\b(line)\\/([\\w\\.]+)\\/iab/i,\n // Line App for Android\n /(chromium|instagram)[\\/ ]([-\\w\\.]+)/i\n // Chromium/Instagram\n ],\n [NAME, VERSION2],\n [\n /\\bgsa\\/([\\w\\.]+) .*safari\\//i\n // Google Search Appliance on iOS\n ],\n [VERSION2, [NAME, "GSA"]],\n [\n /headlesschrome(?:\\/([\\w\\.]+)| )/i\n // Chrome Headless\n ],\n [VERSION2, [NAME, CHROME + " Headless"]],\n [\n / wv\\).+(chrome)\\/([\\w\\.]+)/i\n // Chrome WebView\n ],\n [[NAME, CHROME + " WebView"], VERSION2],\n [\n /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i\n // Android Browser\n ],\n [VERSION2, [NAME, "Android " + BROWSER]],\n [\n /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i\n // Chrome/OmniWeb/Arora/Tizen/Nokia\n ],\n [NAME, VERSION2],\n [\n /version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i\n // Mobile Safari\n ],\n [VERSION2, [NAME, "Mobile Safari"]],\n [\n /version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i\n // Safari & Safari Mobile\n ],\n [VERSION2, NAME],\n [\n /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i\n // Safari < 3.0\n ],\n [NAME, [VERSION2, strMapper, oldSafariMap]],\n [/(webkit|khtml)\\/([\\w\\.]+)/i],\n [NAME, VERSION2],\n [\n // Gecko based\n /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i\n // Netscape\n ],\n [[NAME, "Netscape"], VERSION2],\n [\n /mobile vr; rv:([\\w\\.]+)\\).+firefox/i\n // Firefox Reality\n ],\n [VERSION2, [NAME, FIREFOX + " Reality"]],\n [\n /ekiohf.+(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(swiftfox)/i,\n // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(firefox)\\/([\\w\\.]+)/i,\n // Other Firefox-based\n /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,\n // Mozilla\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n /(links) \\(([\\w\\.]+)/i\n // Links\n ],\n [NAME, VERSION2],\n [\n /(cobalt)\\/([\\w\\.]+)/i\n // Cobalt\n ],\n [NAME, [VERSION2, /master.|lts./, ""]]\n ],\n cpu: [\n [\n /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i\n // AMD64 (x64)\n ],\n [[ARCHITECTURE, "amd64"]],\n [\n /(ia32(?=;))/i\n // IA32 (quicktime)\n ],\n [[ARCHITECTURE, lowerize]],\n [\n /((?:i[346]|x)86)[;\\)]/i\n // IA32 (x86)\n ],\n [[ARCHITECTURE, "ia32"]],\n [\n /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i\n // ARM64\n ],\n [[ARCHITECTURE, "arm64"]],\n [\n /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i\n // ARMHF\n ],\n [[ARCHITECTURE, "armhf"]],\n [\n // PocketPC mistakenly identified as PowerPC\n /windows (ce|mobile); ppc;/i\n ],\n [[ARCHITECTURE, "arm"]],\n [\n /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i\n // PowerPC\n ],\n [[ARCHITECTURE, /ower/, EMPTY, lowerize]],\n [\n /(sun4\\w)[;\\)]/i\n // SPARC\n ],\n [[ARCHITECTURE, "sparc"]],\n [\n /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ],\n [[ARCHITECTURE, lowerize]]\n ],\n device: [\n [\n //////////////////////////\n // MOBILES & TABLETS\n // Ordered by popularity\n /////////////////////////\n // Samsung\n /\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]],\n [\n /\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,\n /samsung[- ]([-\\w]+)/i,\n /sec-(sgh\\w+)/i\n ],\n [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]],\n [\n // Apple\n /((ipod|iphone)\\d+,\\d+)/i\n // iPod/iPhone model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /(ipad\\d+,\\d+)/i\n // iPad model\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [\n /\\((ip(?:hone|od)[\\w ]*);/i\n // iPod/iPhone\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],\n [\n /\\((ipad);[-\\w\\),; ]+apple/i,\n // iPad\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n ],\n [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],\n [/(macintosh);/i],\n [MODEL, [VENDOR, APPLE]],\n [\n // Huawei\n /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]],\n [\n /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n /\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i\n ],\n [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]],\n [\n // Xiaomi\n /\\b(poco[\\w ]+)(?: bui|\\))/i,\n // Xiaomi POCO\n /\\b; (\\w+) build\\/hm\\1/i,\n // Xiaomi Hongmi \'numeric\' models\n /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,\n // Xiaomi Hongmi\n /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,\n // Xiaomi Redmi\n /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i\n // Xiaomi Mi\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, MOBILE]\n ],\n [\n /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i\n // Mi Pad tablets\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, XIAOMI],\n [TYPE, TABLET]\n ],\n [\n // OPPO\n /; (\\w+) bui.+ oppo/i,\n /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i\n ],\n [MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]],\n [\n // Vivo\n /vivo (\\w+)(?: bui|\\))/i,\n /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n ],\n [MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]],\n [\n // Realme\n /\\b(rmx[12]\\d{3})(?: bui|;|\\))/i\n ],\n [MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]],\n [\n // Motorola\n /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n /\\bmot(?:orola)?[- ](\\w*)/i,\n /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n ],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]],\n [/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],\n [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]],\n [\n // LG\n /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, TABLET]],\n [\n /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n /\\blg-?([\\d\\w]+) bui/i\n ],\n [MODEL, [VENDOR, LG], [TYPE, MOBILE]],\n [\n // Lenovo\n /(ideatab[-\\w ]+)/i,\n /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n ],\n [MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]],\n [\n // Nokia\n /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n /nokia[-_ ]?([-\\w\\.]*)/i\n ],\n [\n [MODEL, /_/g, " "],\n [VENDOR, "Nokia"],\n [TYPE, MOBILE]\n ],\n [\n // Google\n /(pixel c)\\b/i\n // Google Pixel C\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]],\n [\n /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i\n // Google Pixel\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]],\n [\n // Sony\n /droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ],\n [MODEL, [VENDOR, SONY], [TYPE, MOBILE]],\n [/sony tablet [ps]/i, /\\b(?:sony)?sgp\\w+(?: bui|\\))/i],\n [\n [MODEL, "Xperia Tablet"],\n [VENDOR, SONY],\n [TYPE, TABLET]\n ],\n [\n // OnePlus\n / (kb2005|in20[12]5|be20[12][59])\\b/i,\n /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n ],\n [MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]],\n [\n // Amazon\n /(alexa)webm/i,\n /(kf[a-z]{2}wi)( bui|\\))/i,\n // Kindle Fire without Silk\n /(kf[a-z]+)( bui|\\)).+silk\\//i\n // Kindle Fire HD\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]],\n [\n /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i\n // Fire Phone\n ],\n [\n [MODEL, /(.+)/g, "Fire Phone $1"],\n [VENDOR, AMAZON],\n [TYPE, MOBILE]\n ],\n [\n // BlackBerry\n /(playbook);[-\\w\\),; ]+(rim)/i\n // BlackBerry PlayBook\n ],\n [MODEL, VENDOR, [TYPE, TABLET]],\n [\n /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n /\\(bb10; (\\w+)/i\n // BlackBerry 10\n ],\n [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]],\n [\n // Asus\n /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n ],\n [MODEL, [VENDOR, ASUS], [TYPE, TABLET]],\n [/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],\n [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]],\n [\n // HTC\n /(nexus 9)/i\n // HTC Nexus 9\n ],\n [MODEL, [VENDOR, "HTC"], [TYPE, TABLET]],\n [\n /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,\n // HTC\n // ZTE\n /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n /(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i\n // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ],\n [VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]],\n [\n // Acer\n /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n ],\n [MODEL, [VENDOR, "Acer"], [TYPE, TABLET]],\n [\n // Meizu\n /droid.+; (m[1-5] note) bui/i,\n /\\bmz-([-\\w]{2,})/i\n ],\n [MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]],\n [\n // Sharp\n /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]],\n [\n // MIXED\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,\n // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp) ([\\w ]+\\w)/i,\n // HP iPAQ\n /(asus)-?(\\w+)/i,\n // Asus\n /(microsoft); (lumia[\\w ]+)/i,\n // Microsoft Lumia\n /(lenovo)[-_ ]?([-\\w]+)/i,\n // Lenovo\n /(jolla)/i,\n // Jolla\n /(oppo) ?([\\w ]+) bui/i\n // OPPO\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(archos) (gamepad2?)/i,\n // Archos\n /(hp).+(touchpad(?!.+tablet)|tablet)/i,\n // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i,\n // Kindle\n /(nook)[\\w ]+build\\/(\\w+)/i,\n // Nook\n /(dell) (strea[kpr\\d ]*[\\dko])/i,\n // Dell Streak\n /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,\n // Le Pan Tablets\n /(trinity)[- ]*(t\\d{3}) bui/i,\n // Trinity Tablets\n /(gigaset)[- ]+(q\\w{1,9}) bui/i,\n // Gigaset Tablets\n /(vodafone) ([\\w ]+)(?:\\)| bui)/i\n // Vodafone\n ],\n [VENDOR, MODEL, [TYPE, TABLET]],\n [\n /(surface duo)/i\n // Surface Duo\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]],\n [\n /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i\n // Fairphone\n ],\n [MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]],\n [\n /(u304aa)/i\n // AT&T\n ],\n [MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]],\n [\n /\\bsie-(\\w*)/i\n // Siemens\n ],\n [MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]],\n [\n /\\b(rct\\w+) b/i\n // RCA Tablets\n ],\n [MODEL, [VENDOR, "RCA"], [TYPE, TABLET]],\n [\n /\\b(venue[\\d ]{2,7}) b/i\n // Dell Venue Tablets\n ],\n [MODEL, [VENDOR, "Dell"], [TYPE, TABLET]],\n [\n /\\b(q(?:mv|ta)\\w+) b/i\n // Verizon Tablet\n ],\n [MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]],\n [\n /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i\n // Barnes & Noble Tablet\n ],\n [MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]],\n [/\\b(tm\\d{3}\\w+) b/i],\n [MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]],\n [\n /\\b(k88) b/i\n // ZTE K Series Tablet\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]],\n [\n /\\b(nx\\d{3}j) b/i\n // ZTE Nubia\n ],\n [MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]],\n [\n /\\b(gen\\d{3}) b.+49h/i\n // Swiss GEN Mobile\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]],\n [\n /\\b(zur\\d{3}) b/i\n // Swiss ZUR Tablet\n ],\n [MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]],\n [\n /\\b((zeki)?tb.*\\b) b/i\n // Zeki Tablets\n ],\n [MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]],\n [\n /\\b([yr]\\d{2}) b/i,\n /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i\n // Dragon Touch Tablet\n ],\n [[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]],\n [\n /\\b(ns-?\\w{0,9}) b/i\n // Insignia Tablets\n ],\n [MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]],\n [\n /\\b((nxa|next)-?\\w{0,9}) b/i\n // NextBook Tablets\n ],\n [MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]],\n [\n /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i\n // Voice Xtreme Phones\n ],\n [[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(lvtel\\-)?(v1[12]) b/i\n // LvTel Phones\n ],\n [[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]],\n [\n /\\b(ph-1) /i\n // Essential PH-1\n ],\n [MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]],\n [\n /\\b(v(100md|700na|7011|917g).*\\b) b/i\n // Envizen Tablets\n ],\n [MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]],\n [\n /\\b(trio[-\\w\\. ]+) b/i\n // MachSpeed Tablets\n ],\n [MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]],\n [\n /\\btu_(1491) b/i\n // Rotor Tablets\n ],\n [MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]],\n [\n /(shield[\\w ]+) b/i\n // Nvidia Shield Tablets\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]],\n [\n /(sprint) (\\w+)/i\n // Sprint Phones\n ],\n [VENDOR, MODEL, [TYPE, MOBILE]],\n [\n /(kin\\.[onetw]{3})/i\n // Microsoft Kin\n ],\n [\n [MODEL, /\\./g, " "],\n [VENDOR, MICROSOFT],\n [TYPE, MOBILE]\n ],\n [\n /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i\n // Zebra\n ],\n [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]],\n [/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]],\n [\n ///////////////////\n // CONSOLES\n ///////////////////\n /(ouya)/i,\n // Ouya\n /(nintendo) ([wids3utch]+)/i\n // Nintendo\n ],\n [VENDOR, MODEL, [TYPE, CONSOLE]],\n [\n /droid.+; (shield) bui/i\n // Nvidia\n ],\n [MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]],\n [\n /(playstation [345portablevi]+)/i\n // Playstation\n ],\n [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]],\n [\n /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i\n // Microsoft Xbox\n ],\n [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]],\n [\n ///////////////////\n // SMARTTVS\n ///////////////////\n /smart-tv.+(samsung)/i\n // Samsung\n ],\n [VENDOR, [TYPE, SMARTTV]],\n [/hbbtv.+maple;(\\d+)/i],\n [\n [MODEL, /^/, "SmartTV"],\n [VENDOR, SAMSUNG],\n [TYPE, SMARTTV]\n ],\n [\n /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i\n // LG SmartTV\n ],\n [\n [VENDOR, LG],\n [TYPE, SMARTTV]\n ],\n [\n /(apple) ?tv/i\n // Apple TV\n ],\n [VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]],\n [\n /crkey/i\n // Google Chromecast\n ],\n [\n [MODEL, CHROME + "cast"],\n [VENDOR, GOOGLE],\n [TYPE, SMARTTV]\n ],\n [\n /droid.+aft(\\w)( bui|\\))/i\n // Fire TV\n ],\n [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]],\n [\n /\\(dtv[\\);].+(aquos)/i,\n /(aquos-tv[\\w ]+)\\)/i\n // Sharp\n ],\n [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],\n [\n /(bravia[\\w ]+)( bui|\\))/i\n // Sony\n ],\n [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]],\n [\n /(mitv-\\w{5}) bui/i\n // Xiaomi\n ],\n [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]],\n [\n /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,\n // Roku\n /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i\n // HbbTV devices\n ],\n [\n [VENDOR, trim],\n [MODEL, trim],\n [TYPE, SMARTTV]\n ],\n [\n /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i\n // SmartTV from Unidentified Vendors\n ],\n [[TYPE, SMARTTV]],\n [\n ///////////////////\n // WEARABLES\n ///////////////////\n /((pebble))app/i\n // Pebble\n ],\n [VENDOR, MODEL, [TYPE, WEARABLE]],\n [\n /droid.+; (glass) \\d/i\n // Google Glass\n ],\n [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]],\n [/droid.+; (wt63?0{2,3})\\)/i],\n [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]],\n [\n /(quest( 2)?)/i\n // Oculus Quest\n ],\n [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]],\n [\n ///////////////////\n // EMBEDDED\n ///////////////////\n /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i\n // Tesla\n ],\n [VENDOR, [TYPE, EMBEDDED]],\n [\n ////////////////////\n // MIXED (GENERIC)\n ///////////////////\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i\n // Android Phones from Unidentified Vendors\n ],\n [MODEL, [TYPE, MOBILE]],\n [\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i\n // Android Tablets from Unidentified Vendors\n ],\n [MODEL, [TYPE, TABLET]],\n [\n /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i\n // Unidentifiable Tablet\n ],\n [[TYPE, TABLET]],\n [\n /(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i\n // Unidentifiable Mobile\n ],\n [[TYPE, MOBILE]],\n [\n /(android[-\\w\\. ]{0,9});.+buil/i\n // Generic Android Device\n ],\n [MODEL, [VENDOR, "Generic"]]\n ],\n engine: [\n [\n /windows.+ edge\\/([\\w\\.]+)/i\n // EdgeHTML\n ],\n [VERSION2, [NAME, EDGE + "HTML"]],\n [\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i\n // Blink\n ],\n [VERSION2, [NAME, "Blink"]],\n [\n /(presto)\\/([\\w\\.]+)/i,\n // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,\n // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /ekioh(flow)\\/([\\w\\.]+)/i,\n // Flow\n /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,\n // KHTML/Tasman/Links\n /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i\n // iCab\n ],\n [NAME, VERSION2],\n [\n /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i\n // Gecko\n ],\n [VERSION2, NAME]\n ],\n os: [\n [\n // Windows\n /microsoft (windows) (vista|xp)/i\n // Windows (iTunes)\n ],\n [NAME, VERSION2],\n [\n /(windows) nt 6\\.2; (arm)/i,\n // Windows RT\n /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,\n // Windows Phone\n /(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i\n ],\n [NAME, [VERSION2, strMapper, windowsVersionMap]],\n [/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],\n [\n [NAME, "Windows"],\n [VERSION2, strMapper, windowsVersionMap]\n ],\n [\n // iOS/macOS\n /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,\n // iOS\n /cfnetwork\\/.+darwin/i\n ],\n [\n [VERSION2, /_/g, "."],\n [NAME, "iOS"]\n ],\n [\n /(mac os x) ?([\\w\\. ]*)/i,\n /(macintosh|mac_powerpc\\b)(?!.+haiku)/i\n // Mac OS\n ],\n [\n [NAME, "Mac OS"],\n [VERSION2, /_/g, "."]\n ],\n [\n // Mobile OSes\n /droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i\n // Android-x86/HarmonyOS\n ],\n [VERSION2, NAME],\n [\n // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n /(blackberry)\\w*\\/([\\w\\.]*)/i,\n // Blackberry\n /(tizen|kaios)[\\/ ]([\\w\\.]+)/i,\n // Tizen/KaiOS\n /\\((series40);/i\n // Series 40\n ],\n [NAME, VERSION2],\n [\n /\\(bb(10);/i\n // BlackBerry 10\n ],\n [VERSION2, [NAME, BLACKBERRY]],\n [\n /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i\n // Symbian\n ],\n [VERSION2, [NAME, "Symbian"]],\n [\n /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i\n // Firefox OS\n ],\n [VERSION2, [NAME, FIREFOX + " OS"]],\n [\n /web0s;.+rt(tv)/i,\n /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i\n // WebOS\n ],\n [VERSION2, [NAME, "webOS"]],\n [\n // Google Chromecast\n /crkey\\/([\\d\\.]+)/i\n // Google Chromecast\n ],\n [VERSION2, [NAME, CHROME + "cast"]],\n [\n /(cros) [\\w]+ ([\\w\\.]+\\w)/i\n // Chromium OS\n ],\n [[NAME, "Chromium OS"], VERSION2],\n [\n // Console\n /(nintendo|playstation) ([wids345portablevuch]+)/i,\n // Nintendo/Playstation\n /(xbox); +xbox ([^\\);]+)/i,\n // Microsoft Xbox (360, One, X, S, Series X, Series S)\n // Other\n /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,\n // Joli/Palm\n /(mint)[\\/\\(\\) ]?(\\w*)/i,\n // Mint\n /(mageia|vectorlinux)[; ]/i,\n // Mageia/VectorLinux\n /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n /(hurd|linux) ?([\\w\\.]*)/i,\n // Hurd/Linux\n /(gnu) ?([\\w\\.]*)/i,\n // GNU\n /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,\n // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n /(haiku) (\\w+)/i\n // Haiku\n ],\n [NAME, VERSION2],\n [\n /(sunos) ?([\\w\\.\\d]*)/i\n // Solaris\n ],\n [[NAME, "Solaris"], VERSION2],\n [\n /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,\n // Solaris\n /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,\n // AIX\n /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,\n // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX\n /(unix) ?([\\w\\.]*)/i\n // UNIX\n ],\n [NAME, VERSION2]\n ]\n };\n var UAParser2 = function(ua, extensions) {\n if (typeof ua === OBJ_TYPE) {\n extensions = ua;\n ua = undefined2;\n }\n if (!(this instanceof UAParser2)) {\n return new UAParser2(ua, extensions).getResult();\n }\n var _ua = ua || (typeof window2 !== UNDEF_TYPE && window2.navigator && window2.navigator.userAgent ? window2.navigator.userAgent : EMPTY);\n var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n this.getBrowser = function() {\n var _browser = {};\n _browser[NAME] = undefined2;\n _browser[VERSION2] = undefined2;\n rgxMapper.call(_browser, _ua, _rgxmap.browser);\n _browser.major = majorize(_browser.version);\n return _browser;\n };\n this.getCPU = function() {\n var _cpu = {};\n _cpu[ARCHITECTURE] = undefined2;\n rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n return _cpu;\n };\n this.getDevice = function() {\n var _device = {};\n _device[VENDOR] = undefined2;\n _device[MODEL] = undefined2;\n _device[TYPE] = undefined2;\n rgxMapper.call(_device, _ua, _rgxmap.device);\n return _device;\n };\n this.getEngine = function() {\n var _engine = {};\n _engine[NAME] = undefined2;\n _engine[VERSION2] = undefined2;\n rgxMapper.call(_engine, _ua, _rgxmap.engine);\n return _engine;\n };\n this.getOS = function() {\n var _os = {};\n _os[NAME] = undefined2;\n _os[VERSION2] = undefined2;\n rgxMapper.call(_os, _ua, _rgxmap.os);\n return _os;\n };\n this.getResult = function() {\n return {\n ua: this.getUA(),\n browser: this.getBrowser(),\n engine: this.getEngine(),\n os: this.getOS(),\n device: this.getDevice(),\n cpu: this.getCPU()\n };\n };\n this.getUA = function() {\n return _ua;\n };\n this.setUA = function(ua2) {\n _ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;\n return this;\n };\n this.setUA(_ua);\n return this;\n };\n UAParser2.VERSION = LIBVERSION;\n UAParser2.BROWSER = enumerize([NAME, VERSION2, MAJOR]);\n UAParser2.CPU = enumerize([ARCHITECTURE]);\n UAParser2.DEVICE = enumerize([\n MODEL,\n VENDOR,\n TYPE,\n CONSOLE,\n MOBILE,\n SMARTTV,\n TABLET,\n WEARABLE,\n EMBEDDED\n ]);\n UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION2]);\n if (typeof exports !== UNDEF_TYPE) {\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser2;\n }\n exports.UAParser = UAParser2;\n } else {\n if (typeof define === FUNC_TYPE && define.amd) {\n define(function() {\n return UAParser2;\n });\n } else if (typeof window2 !== UNDEF_TYPE) {\n window2.UAParser = UAParser2;\n }\n }\n var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser2();\n $.ua = parser.getResult();\n $.ua.get = function() {\n return parser.getUA();\n };\n $.ua.set = function(ua) {\n parser.setUA(ua);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n })(typeof window === "object" ? window : exports);\n }\n });\n\n // packages/dev-tools/client/utils.ts\n var goToSection = (shadow, view) => {\n closeToasts(shadow);\n const aside = shadow.querySelector("aside");\n aside.dataset.view = view;\n aside.classList.remove("section-ready");\n setTimeout(() => {\n aside.classList.add("section-ready");\n }, 200);\n };\n var initBackButtons = (shadow) => {\n Array.from(shadow.querySelectorAll(".back-button")).forEach((elm) => {\n elm.addEventListener("click", (ev) => {\n closeToasts(shadow);\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n goToSection(shadow, target?.dataset.back || "nav-home");\n });\n });\n };\n var showToast = (shadow, html) => {\n closeToasts(shadow);\n const aside = shadow.querySelector("aside");\n const toast = document.createElement("div");\n toast.className = `ui-toast`;\n toast.innerHTML = html;\n aside.appendChild(toast);\n setTimeout(() => {\n toast.classList.add("ui-toast-show");\n setTimeout(() => {\n toast.classList.remove("ui-toast-show");\n setTimeout(() => {\n toast.remove();\n }, 500);\n }, 4e3);\n }, 30);\n };\n var closeToasts = (shadow) => {\n const aside = shadow.querySelector("aside");\n const existing = Array.from(aside.querySelectorAll(".ui-toast"));\n existing.forEach((el) => {\n el.classList.remove("ui-toast-show");\n });\n };\n var isEditEnabled = () => {\n const key = getDisableEditKey();\n return localStorage.getItem(key) !== "true";\n };\n var enableEdit = (enable) => {\n const key = getDisableEditKey();\n if (enable) {\n localStorage.removeItem(key);\n } else {\n localStorage.setItem(key, "true");\n }\n };\n var getDisableEditKey = () => getLocalStorageKey("disableEdit");\n var getLocalStorageKey = (name) => `builder.__LOCAL_APP_ID__.${name}`;\n var getEditorUrl = () => {\n const contentElm = document.body.querySelector("[builder-content-id]");\n const contentId = contentElm?.getAttribute("builder-content-id");\n return getBuilderContentUrl(contentId);\n };\n var getBuilderContentUrl = (contentId, blockId) => {\n let pathname = "/content";\n if (contentId) {\n pathname += "/" + contentId + "/edit";\n }\n const url = new URL(pathname, "https://builder.io");\n if (contentId && blockId) {\n url.searchParams.set("selectedBlock", blockId);\n }\n const previewUrl = new URL(location.pathname, location.href);\n url.searchParams.set("overridePreviewUrl", previewUrl.href);\n return url.href;\n };\n var DEV_TOOLS_URL = "__DEV_TOOLS_URL__";\n var APP_STATE = {\n components: [],\n registryPath: "",\n registryDisplayPath: "",\n frameworks: [],\n dependencies: [],\n publicApiKey: void 0,\n devToolsVersion: ""\n };\n var updateAppState = (registry) => {\n APP_STATE.components = registry.components;\n APP_STATE.registryPath = registry.registryPath;\n APP_STATE.registryDisplayPath = registry.registryDisplayPath;\n APP_STATE.dependencies = registry.dependencies;\n APP_STATE.publicApiKey = registry.publicApiKey;\n };\n\n // packages/dev-tools/client/edit-button/document-listeners.ts\n function initDocumentListeners(editButton) {\n let lastBlockId = null;\n const menu = document.querySelector(\n "builder-dev-tools-menu"\n );\n const hideEditButton = () => {\n editButton.hide();\n };\n const onPointerOver = (ev) => {\n const hoverElm = ev.target;\n if (!hoverElm) {\n hideEditButton();\n return;\n }\n if (hoverElm.closest("builder-dev-tools-edit")) {\n return;\n }\n const contentElm = hoverElm.closest("[builder-content-id]");\n const blockElm = hoverElm.closest("[builder-id]");\n if (!contentElm || !blockElm) {\n editButton.hide();\n return;\n }\n const blockId = editButton.show(contentElm, blockElm);\n if (!blockId || blockId === lastBlockId) {\n return;\n }\n menu.highlightOpener();\n lastBlockId = blockId;\n };\n document.addEventListener("pointerover", onPointerOver, { passive: true });\n document.addEventListener("pointerleave", hideEditButton, {\n passive: true\n });\n document.addEventListener("pointercancel", hideEditButton, {\n passive: true\n });\n document.addEventListener("visibilitychange", hideEditButton, {\n passive: true\n });\n window.addEventListener("popstate", hideEditButton, { passive: true });\n const originalPushState = history.pushState;\n history.pushState = function(...args) {\n editButton.hide();\n originalPushState.apply(this, args);\n };\n const originalReplaceState = history.replaceState;\n history.replaceState = function(...args) {\n editButton.hide();\n originalReplaceState.apply(this, args);\n };\n }\n\n // packages/dev-tools/client/edit-button/index.ts\n var BuilderDevToolsEditButton = class extends HTMLElement {\n openInBuilder = null;\n block = null;\n constructor() {\n super();\n }\n connectedCallback() {\n this.setAttribute("aria-hidden", "true");\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = \'<style>/* packages/dev-tools/client/common.css */\\n*,\\n*::before,\\n*::after {\\n box-sizing: border-box;\\n}\\n:host {\\n --background-color: rgba(40, 40, 40, 1);\\n --primary-color: rgba(72, 161, 255, 1);\\n --primary-color-subdued: rgb(72, 161, 255, 0.6);\\n --primary-color-highlight: rgb(126, 188, 255);\\n --primary-contrast-color: white;\\n --edit-color: #1d74e2;\\n --edit-color-highlight: #1c6bd1;\\n --edit-color-alpha: rgb(72, 161, 255, 0.15);\\n --error-color: #ff2b55;\\n --text-color: white;\\n --text-color-highlight: white;\\n --border-color: #454545;\\n --button-background-color-hover: rgba(255, 255, 255, 0.1);\\n --menu-width: 320px;\\n --transition-time: 150ms;\\n --font-family:\\n ui-sans-serif,\\n system-ui,\\n -apple-system,\\n BlinkMacSystemFont,\\n "Segoe UI",\\n Roboto,\\n "Helvetica Neue",\\n Arial,\\n "Noto Sans",\\n sans-serif,\\n "Apple Color Emoji",\\n "Segoe UI Emoji",\\n "Segoe UI Symbol",\\n "Noto Color Emoji";\\n font-family: var(--font-family);\\n line-height: 1.6;\\n}\\nbutton {\\n cursor: pointer;\\n color: var(--text-color);\\n -webkit-tap-highlight-color: transparent;\\n}\\ninput,\\nselect,\\nbutton {\\n font-family: var(--font-family);\\n}\\n\\n/* packages/dev-tools/client/edit-button/edit-button.css */\\n:host {\\n display: none;\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n z-index: 2147483646;\\n user-select: none;\\n pointer-events: none;\\n color: var(--text-color);\\n}\\n#content-highlight,\\n#block {\\n position: absolute;\\n}\\n#content-highlight {\\n border: 3px solid var(--primary-color);\\n background-color: var(--primary-color-alpha);\\n}\\na {\\n position: absolute;\\n top: -33px;\\n left: 0;\\n display: block;\\n padding: 5px 10px 8px 10px;\\n pointer-events: auto;\\n z-index: 100;\\n text-decoration: none;\\n}\\na:hover {\\n text-decoration: none;\\n}\\na span {\\n display: block;\\n padding: 3px 6px;\\n font-size: 10px;\\n font-weight: 300;\\n border-radius: 3px;\\n text-align: center;\\n text-decoration: none;\\n pointer-events: none;\\n background-color: var(--edit-color);\\n color: var(--text-color);\\n white-space: nowrap;\\n}\\na:hover span {\\n background-color: var(--edit-color-highlight);\\n}\\na:hover ~ .outline {\\n border-color: var(--edit-color-highlight);\\n}\\n#open-in-editor {\\n display: none;\\n}\\n.outline {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n border: 1px solid var(--edit-color);\\n background-color: var(--edit-color-alpha);\\n}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>\';\n this.openInBuilder = shadow.getElementById(\n "open-in-builder"\n );\n this.block = shadow.getElementById("block");\n initDocumentListeners(this);\n }\n show(contentElm, blockElm) {\n if (!isEditEnabled()) {\n this.hide();\n return null;\n }\n const contentId = contentElm.getAttribute("builder-content-id");\n const blockId = blockElm.getAttribute("builder-id");\n if (!contentId || !blockId) {\n this.hide();\n return null;\n }\n const block = this.block;\n const openInBuilder = this.openInBuilder;\n const builderRect = blockElm.getBoundingClientRect();\n block.style.top = builderRect.top + window.scrollY - 1 + "px";\n block.style.left = builderRect.left + window.scrollX + "px";\n block.style.width = builderRect.width + "px";\n block.style.height = builderRect.height + 1 + "px";\n const openInBuilderRect = openInBuilder.getBoundingClientRect();\n if (openInBuilderRect.width > builderRect.width) {\n const diff = openInBuilderRect.width - builderRect.width;\n openInBuilder.style.left = diff / 2 * -1 + "px";\n } else {\n openInBuilder.style.left = "";\n }\n openInBuilder.href = getBuilderContentUrl(contentId, blockId);\n this.style.display = "block";\n return blockId;\n }\n hide() {\n this.style.display = "";\n }\n };\n\n // packages/dev-tools/common/constants.ts\n var PREVIEW_URL_QS = `preview-url`;\n var CONNECTED_USER_ID_QS = "_b-uid";\n var BUILDER_AUTH_CONNECT_PATH = "/~builder-connect";\n var DEV_TOOLS_API_PATH = "/~builder-dev-tools";\n var AMPLITUDE_PROXY_URL = "https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";\n\n // packages/dev-tools/client/client-api.ts\n var apiValidateBuilder = () => apiFetch({\n type: "validateBuilder"\n });\n var apiLaunchEditor = (file) => apiFetch({\n type: "launchEditor",\n data: file\n });\n var apiRegistry = (opts) => apiFetch({\n type: "getRegistry",\n data: opts\n });\n var apiLoadComponent = (opts) => apiFetch({\n type: "loadComponent",\n data: opts\n });\n var apiRegisterComponent = (opts) => apiFetch({\n type: "registerComponent",\n data: opts\n });\n var apiSetComponentInfo = (opts) => apiFetch({\n type: "setComponentInfo",\n data: opts\n });\n var apiSetComponentInput = (opts) => apiFetch({\n type: "setComponentInput",\n data: opts\n });\n var apiUnregisterComponent = (opts) => apiFetch({\n type: "unregisterComponent",\n data: opts\n });\n var apiDevToolsEnabled = (enabled) => apiFetch({\n type: "enableDevTools",\n data: { enabled }\n });\n var apiLocalConfig = () => apiFetch({ type: "localConfig" });\n var apiFetch = async (data) => {\n const url = new URL(DEV_TOOLS_API_PATH, DEV_TOOLS_URL);\n let rsp;\n try {\n rsp = await fetch(url, {\n method: "POST",\n body: JSON.stringify(data)\n });\n } catch (e) {\n console.error(`Devtools Fetch Error, ${url.href}`, e);\n throw new Error(`Builder Devtools Fetch Error`);\n }\n const contentType = rsp.headers.get("content-type") || "";\n if (contentType.includes("application/json")) {\n const r = await rsp.json();\n if (rsp.ok) {\n return r.data;\n }\n if (Array.isArray(r.errors) && r.errors.length > 0) {\n r.errors.forEach((e) => console.error(e));\n throw new Error(`Builder Devtools Fetch Error: ${r.errors[0]}`);\n }\n }\n throw new Error(\n `Builder Devtools Fetch Error: ${rsp.status}, ${await rsp.text()}`\n );\n };\n\n // packages/dev-tools/common/ast/component-input-types.ts\n var INPUT_TYPES = [\n { value: "boolean", text: "boolean" },\n { value: "color", text: "color (provides a color in hex or rgb)" },\n { value: "date", text: "date (same format as the Date constructor)" },\n { value: "email", text: "email" },\n { value: "file", text: "file (uploads a file and provides a url)" },\n { value: "list", text: "list (collection of items)" },\n { value: "longText", text: "longText (multiline text editor)" },\n { value: "number", text: "number" },\n { value: "object", text: "object (set of specific names and values)" },\n { value: "richText", text: "richText (provides value as html)" },\n { value: "string", text: "string" }\n ];\n var STRING_TYPES = [\n "color",\n "date",\n "email",\n "file",\n "longText",\n "richText",\n "string"\n ];\n var NUMBER_TYPES = ["number"];\n var BOOLEAN_TYPES = ["boolean"];\n var ARRAY_TYPES = ["list"];\n var OBJECT_TYPES = ["object"];\n function getPrimitiveType(t) {\n if (STRING_TYPES.includes(t)) {\n return "string";\n } else if (NUMBER_TYPES.includes(t)) {\n return "number";\n } else if (BOOLEAN_TYPES.includes(t)) {\n return "boolean";\n } else if (ARRAY_TYPES.includes(t)) {\n return "array";\n } else if (OBJECT_TYPES.includes(t)) {\n return "object";\n } else {\n return "string";\n }\n }\n var PROP_BLACKLIST = new Set(\n [\n "about",\n "accessKey",\n "accessKeyLabel",\n "asChild",\n "autoCapitalize",\n "autoCorrect",\n "autoFocus",\n "autoSave",\n "blur",\n "contentEditable",\n "contextMenu",\n "dangerouslySetInnerHTML",\n "datatype",\n "defaultChecked",\n "defaultValue",\n "dir",\n "draggable",\n "enterKeyHint",\n "focus",\n "form",\n "formAction",\n "formEncType",\n "formMethod",\n "formNoValidate",\n "formTarget",\n "inlist",\n "innerText",\n "inputMode",\n "is",\n "isContentEditable",\n "itemID",\n "itemProp",\n "itemRef",\n "itemScope",\n "itemType",\n "lang",\n "nonce",\n "offsetHeight",\n "offsetLeft",\n "offsetTop",\n "offsetWidth",\n "outerText",\n "prefix",\n "property",\n "radioGroup",\n "rel",\n "resource",\n "results",\n "rev",\n "role",\n "security",\n "slot",\n "spellCheck",\n "suppressContentEditableWarning",\n "suppressHydrationWarning",\n "tabIndex",\n "translate",\n "typeof",\n "unselectable",\n "vocab"\n ].map((s) => s.toLowerCase())\n );\n\n // node_modules/tslib/tslib.es6.mjs\n var extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {\n d2.__proto__ = b2;\n } || function(d2, b2) {\n for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];\n };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function() {\n __assign = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function(resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function(resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator["throw"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() {\n if (t[0] & 1) throw t[1];\n return t[1];\n }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);\n return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {\n return this;\n }), g;\n function verb(n) {\n return function(v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n function __values(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = { error };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n }\n\n // node_modules/@amplitude/analytics-types/lib/esm/index.js\n var esm_exports = {};\n __export(esm_exports, {\n IdentifyOperation: () => IdentifyOperation,\n LogLevel: () => LogLevel,\n PluginType: () => PluginType,\n RevenueProperty: () => RevenueProperty,\n ServerZone: () => ServerZone,\n SpecialEventType: () => SpecialEventType,\n Status: () => Status,\n TransportType: () => TransportType\n });\n\n // node_modules/@amplitude/analytics-types/lib/esm/event.js\n var IdentifyOperation;\n (function(IdentifyOperation2) {\n IdentifyOperation2["SET"] = "$set";\n IdentifyOperation2["SET_ONCE"] = "$setOnce";\n IdentifyOperation2["ADD"] = "$add";\n IdentifyOperation2["APPEND"] = "$append";\n IdentifyOperation2["PREPEND"] = "$prepend";\n IdentifyOperation2["REMOVE"] = "$remove";\n IdentifyOperation2["PREINSERT"] = "$preInsert";\n IdentifyOperation2["POSTINSERT"] = "$postInsert";\n IdentifyOperation2["UNSET"] = "$unset";\n IdentifyOperation2["CLEAR_ALL"] = "$clearAll";\n })(IdentifyOperation || (IdentifyOperation = {}));\n var RevenueProperty;\n (function(RevenueProperty2) {\n RevenueProperty2["REVENUE_PRODUCT_ID"] = "$productId";\n RevenueProperty2["REVENUE_QUANTITY"] = "$quantity";\n RevenueProperty2["REVENUE_PRICE"] = "$price";\n RevenueProperty2["REVENUE_TYPE"] = "$revenueType";\n RevenueProperty2["REVENUE_CURRENCY"] = "$currency";\n RevenueProperty2["REVENUE"] = "$revenue";\n })(RevenueProperty || (RevenueProperty = {}));\n var SpecialEventType;\n (function(SpecialEventType2) {\n SpecialEventType2["IDENTIFY"] = "$identify";\n SpecialEventType2["GROUP_IDENTIFY"] = "$groupidentify";\n SpecialEventType2["REVENUE"] = "revenue_amount";\n })(SpecialEventType || (SpecialEventType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/logger.js\n var LogLevel;\n (function(LogLevel2) {\n LogLevel2[LogLevel2["None"] = 0] = "None";\n LogLevel2[LogLevel2["Error"] = 1] = "Error";\n LogLevel2[LogLevel2["Warn"] = 2] = "Warn";\n LogLevel2[LogLevel2["Verbose"] = 3] = "Verbose";\n LogLevel2[LogLevel2["Debug"] = 4] = "Debug";\n })(LogLevel || (LogLevel = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/plugin.js\n var PluginType;\n (function(PluginType2) {\n PluginType2["BEFORE"] = "before";\n PluginType2["ENRICHMENT"] = "enrichment";\n PluginType2["DESTINATION"] = "destination";\n })(PluginType || (PluginType = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/server-zone.js\n var ServerZone;\n (function(ServerZone2) {\n ServerZone2["US"] = "US";\n ServerZone2["EU"] = "EU";\n ServerZone2["STAGING"] = "STAGING";\n })(ServerZone || (ServerZone = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/status.js\n var Status;\n (function(Status2) {\n Status2["Unknown"] = "unknown";\n Status2["Skipped"] = "skipped";\n Status2["Success"] = "success";\n Status2["RateLimit"] = "rate_limit";\n Status2["PayloadTooLarge"] = "payload_too_large";\n Status2["Invalid"] = "invalid";\n Status2["Failed"] = "failed";\n Status2["Timeout"] = "Timeout";\n Status2["SystemError"] = "SystemError";\n })(Status || (Status = {}));\n\n // node_modules/@amplitude/analytics-types/lib/esm/transport.js\n var TransportType;\n (function(TransportType2) {\n TransportType2["XHR"] = "xhr";\n TransportType2["SendBeacon"] = "beacon";\n TransportType2["Fetch"] = "fetch";\n })(TransportType || (TransportType = {}));\n\n // node_modules/@amplitude/analytics-core/lib/esm/constants.js\n var UNSET_VALUE = "-";\n var AMPLITUDE_PREFIX = "AMP";\n var STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");\n var AMPLITUDE_SERVER_URL = "https://api2.amplitude.com/2/httpapi";\n var EU_AMPLITUDE_SERVER_URL = "https://api.eu.amplitude.com/2/httpapi";\n var AMPLITUDE_BATCH_SERVER_URL = "https://api2.amplitude.com/batch";\n var EU_AMPLITUDE_BATCH_SERVER_URL = "https://api.eu.amplitude.com/batch";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js\n var MAX_PROPERTY_KEYS = 1e3;\n var isValidObject = function(properties) {\n if (Object.keys(properties).length > MAX_PROPERTY_KEYS) {\n return false;\n }\n for (var key in properties) {\n var value = properties[key];\n if (!isValidProperties(key, value))\n return false;\n }\n return true;\n };\n var isValidProperties = function(property, value) {\n var e_1, _a;\n if (typeof property !== "string")\n return false;\n if (Array.isArray(value)) {\n var isValid = true;\n try {\n for (var value_1 = __values(value), value_1_1 = value_1.next(); !value_1_1.done; value_1_1 = value_1.next()) {\n var valueElement = value_1_1.value;\n if (Array.isArray(valueElement)) {\n return false;\n } else if (typeof valueElement === "object") {\n isValid = isValid && isValidObject(valueElement);\n } else if (!["number", "string"].includes(typeof valueElement)) {\n return false;\n }\n if (!isValid) {\n return false;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (value_1_1 && !value_1_1.done && (_a = value_1.return)) _a.call(value_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } else if (value === null || value === void 0) {\n return false;\n } else if (typeof value === "object") {\n return isValidObject(value);\n } else if (!["number", "string", "boolean"].includes(typeof value)) {\n return false;\n }\n return true;\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/identify.js\n var Identify = (\n /** @class */\n (function() {\n function Identify2() {\n this._propertySet = /* @__PURE__ */ new Set();\n this._properties = {};\n }\n Identify2.prototype.getUserProperties = function() {\n return __assign({}, this._properties);\n };\n Identify2.prototype.set = function(property, value) {\n this._safeSet(IdentifyOperation.SET, property, value);\n return this;\n };\n Identify2.prototype.setOnce = function(property, value) {\n this._safeSet(IdentifyOperation.SET_ONCE, property, value);\n return this;\n };\n Identify2.prototype.append = function(property, value) {\n this._safeSet(IdentifyOperation.APPEND, property, value);\n return this;\n };\n Identify2.prototype.prepend = function(property, value) {\n this._safeSet(IdentifyOperation.PREPEND, property, value);\n return this;\n };\n Identify2.prototype.postInsert = function(property, value) {\n this._safeSet(IdentifyOperation.POSTINSERT, property, value);\n return this;\n };\n Identify2.prototype.preInsert = function(property, value) {\n this._safeSet(IdentifyOperation.PREINSERT, property, value);\n return this;\n };\n Identify2.prototype.remove = function(property, value) {\n this._safeSet(IdentifyOperation.REMOVE, property, value);\n return this;\n };\n Identify2.prototype.add = function(property, value) {\n this._safeSet(IdentifyOperation.ADD, property, value);\n return this;\n };\n Identify2.prototype.unset = function(property) {\n this._safeSet(IdentifyOperation.UNSET, property, UNSET_VALUE);\n return this;\n };\n Identify2.prototype.clearAll = function() {\n this._properties = {};\n this._properties[IdentifyOperation.CLEAR_ALL] = UNSET_VALUE;\n return this;\n };\n Identify2.prototype._safeSet = function(operation, property, value) {\n if (this._validate(operation, property, value)) {\n var userPropertyMap = this._properties[operation];\n if (userPropertyMap === void 0) {\n userPropertyMap = {};\n this._properties[operation] = userPropertyMap;\n }\n userPropertyMap[property] = value;\n this._propertySet.add(property);\n return true;\n }\n return false;\n };\n Identify2.prototype._validate = function(operation, property, value) {\n if (this._properties[IdentifyOperation.CLEAR_ALL] !== void 0) {\n return false;\n }\n if (this._propertySet.has(property)) {\n return false;\n }\n if (operation === IdentifyOperation.ADD) {\n return typeof value === "number";\n }\n if (operation !== IdentifyOperation.UNSET && operation !== IdentifyOperation.REMOVE) {\n return isValidProperties(property, value);\n }\n return true;\n };\n return Identify2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js\n var createTrackEvent = function(eventInput, eventProperties, eventOptions) {\n var baseEvent = typeof eventInput === "string" ? { event_type: eventInput } : eventInput;\n return __assign(__assign(__assign({}, baseEvent), eventOptions), eventProperties && { event_properties: eventProperties });\n };\n var createIdentifyEvent = function(identify2, eventOptions) {\n var identifyEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties() });\n return identifyEvent;\n };\n var createGroupIdentifyEvent = function(groupType, groupName, identify2, eventOptions) {\n var _a;\n var groupIdentify2 = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.GROUP_IDENTIFY, group_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupIdentify2;\n };\n var createGroupEvent = function(groupType, groupName, eventOptions) {\n var _a;\n var identify2 = new Identify();\n identify2.set(groupType, groupName);\n var groupEvent = __assign(__assign({}, eventOptions), { event_type: SpecialEventType.IDENTIFY, user_properties: identify2.getUserProperties(), groups: (_a = {}, _a[groupType] = groupName, _a) });\n return groupEvent;\n };\n var createRevenueEvent = function(revenue2, eventOptions) {\n return __assign(__assign({}, eventOptions), { event_type: SpecialEventType.REVENUE, event_properties: revenue2.getEventProperties() });\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js\n var buildResult = function(event, code, message) {\n if (code === void 0) {\n code = 0;\n }\n if (message === void 0) {\n message = Status.Unknown;\n }\n return { event, code, message };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/timeline.js\n var Timeline = (\n /** @class */\n (function() {\n function Timeline2(client) {\n this.client = client;\n this.queue = [];\n this.applying = false;\n this.plugins = [];\n }\n Timeline2.prototype.register = function(plugin, config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, plugin.setup(config, this.client)];\n case 1:\n _a.sent();\n this.plugins.push(plugin);\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.deregister = function(pluginName, config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var index, plugin;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n index = this.plugins.findIndex(function(plugin2) {\n return plugin2.name === pluginName;\n });\n if (index === -1) {\n config.loggerProvider.warn("Plugin with name ".concat(pluginName, " does not exist, skipping deregistration"));\n return [\n 2\n /*return*/\n ];\n }\n plugin = this.plugins[index];\n this.plugins.splice(index, 1);\n return [4, (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin)];\n case 1:\n _b.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.reset = function(client) {\n this.applying = false;\n var plugins = this.plugins;\n plugins.map(function(plugin) {\n var _a;\n return (_a = plugin.teardown) === null || _a === void 0 ? void 0 : _a.call(plugin);\n });\n this.plugins = [];\n this.client = client;\n };\n Timeline2.prototype.push = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n _this.queue.push([event, resolve]);\n _this.scheduleApply(0);\n });\n };\n Timeline2.prototype.scheduleApply = function(timeout) {\n var _this = this;\n if (this.applying)\n return;\n this.applying = true;\n setTimeout(function() {\n void _this.apply(_this.queue.shift()).then(function() {\n _this.applying = false;\n if (_this.queue.length > 0) {\n _this.scheduleApply(0);\n }\n });\n }, timeout);\n };\n Timeline2.prototype.apply = function(item) {\n return __awaiter(this, void 0, void 0, function() {\n var _a, event, _b, resolve, before, before_1, before_1_1, plugin, e, e_1_1, enrichment, enrichment_1, enrichment_1_1, plugin, e, e_2_1, destination, executeDestinations;\n var e_1, _c, e_2, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n if (!item) {\n return [\n 2\n /*return*/\n ];\n }\n _a = __read(item, 1), event = _a[0];\n _b = __read(item, 2), resolve = _b[1];\n before = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.BEFORE;\n });\n _e.label = 1;\n case 1:\n _e.trys.push([1, 6, 7, 8]);\n before_1 = __values(before), before_1_1 = before_1.next();\n _e.label = 2;\n case 2:\n if (!!before_1_1.done) return [3, 5];\n plugin = before_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 3:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 4;\n case 4:\n before_1_1 = before_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (before_1_1 && !before_1_1.done && (_c = before_1.return)) _c.call(before_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n enrichment = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.ENRICHMENT;\n });\n _e.label = 9;\n case 9:\n _e.trys.push([9, 14, 15, 16]);\n enrichment_1 = __values(enrichment), enrichment_1_1 = enrichment_1.next();\n _e.label = 10;\n case 10:\n if (!!enrichment_1_1.done) return [3, 13];\n plugin = enrichment_1_1.value;\n return [4, plugin.execute(__assign({}, event))];\n case 11:\n e = _e.sent();\n if (e === null) {\n resolve({ event, code: 0, message: "" });\n return [\n 2\n /*return*/\n ];\n } else {\n event = e;\n }\n _e.label = 12;\n case 12:\n enrichment_1_1 = enrichment_1.next();\n return [3, 10];\n case 13:\n return [3, 16];\n case 14:\n e_2_1 = _e.sent();\n e_2 = { error: e_2_1 };\n return [3, 16];\n case 15:\n try {\n if (enrichment_1_1 && !enrichment_1_1.done && (_d = enrichment_1.return)) _d.call(enrichment_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 16:\n destination = this.plugins.filter(function(plugin2) {\n return plugin2.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin2) {\n var eventClone = __assign({}, event);\n return plugin2.execute(eventClone).catch(function(e2) {\n return buildResult(eventClone, 0, String(e2));\n });\n });\n void Promise.all(executeDestinations).then(function(_a2) {\n var _b2 = __read(_a2, 1), result = _b2[0];\n resolve(result);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Timeline2.prototype.flush = function() {\n return __awaiter(this, void 0, void 0, function() {\n var queue, destination, executeDestinations;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n queue = this.queue;\n this.queue = [];\n return [4, Promise.all(queue.map(function(item) {\n return _this.apply(item);\n }))];\n case 1:\n _a.sent();\n destination = this.plugins.filter(function(plugin) {\n return plugin.type === PluginType.DESTINATION;\n });\n executeDestinations = destination.map(function(plugin) {\n return plugin.flush && plugin.flush();\n });\n return [4, Promise.all(executeDestinations)];\n case 2:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return Timeline2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/messages.js\n var SUCCESS_MESSAGE = "Event tracked successfully";\n var UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";\n var MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";\n var OPT_OUT_MESSAGE = "Event skipped due to optOut config";\n var MISSING_API_KEY_MESSAGE = "Event rejected due to missing API key";\n var INVALID_API_KEY = "Invalid API key";\n var CLIENT_NOT_INITIALIZED = "Client not initialized";\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js\n var returnWrapper = function(awaitable) {\n return {\n promise: awaitable || Promise.resolve()\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/core-client.js\n var AmplitudeCore = (\n /** @class */\n (function() {\n function AmplitudeCore2(name) {\n if (name === void 0) {\n name = "$default";\n }\n this.initializing = false;\n this.q = [];\n this.dispatchQ = [];\n this.logEvent = this.track.bind(this);\n this.timeline = new Timeline(this);\n this.name = name;\n }\n AmplitudeCore2.prototype._init = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n this.config = config;\n this.timeline.reset(this);\n return [4, this.runQueuedFunctions("q")];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.runQueuedFunctions = function(queueName) {\n return __awaiter(this, void 0, void 0, function() {\n var queuedFunctions, queuedFunctions_1, queuedFunctions_1_1, queuedFunction, e_1_1;\n var e_1, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n queuedFunctions = this[queueName];\n this[queueName] = [];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 6, 7, 8]);\n queuedFunctions_1 = __values(queuedFunctions), queuedFunctions_1_1 = queuedFunctions_1.next();\n _b.label = 2;\n case 2:\n if (!!queuedFunctions_1_1.done) return [3, 5];\n queuedFunction = queuedFunctions_1_1.value;\n return [4, queuedFunction()];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n queuedFunctions_1_1 = queuedFunctions_1.next();\n return [3, 2];\n case 5:\n return [3, 8];\n case 6:\n e_1_1 = _b.sent();\n e_1 = { error: e_1_1 };\n return [3, 8];\n case 7:\n try {\n if (queuedFunctions_1_1 && !queuedFunctions_1_1.done && (_a = queuedFunctions_1.return)) _a.call(queuedFunctions_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 8:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.track = function(eventInput, eventProperties, eventOptions) {\n var event = createTrackEvent(eventInput, eventProperties, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.identify = function(identify2, eventOptions) {\n var event = createIdentifyEvent(identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n var event = createGroupIdentifyEvent(groupType, groupName, identify2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.setGroup = function(groupType, groupName, eventOptions) {\n var event = createGroupEvent(groupType, groupName, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.revenue = function(revenue2, eventOptions) {\n var event = createRevenueEvent(revenue2, eventOptions);\n return returnWrapper(this.dispatch(event));\n };\n AmplitudeCore2.prototype.add = function(plugin) {\n if (!this.config) {\n this.q.push(this.add.bind(this, plugin));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.register(plugin, this.config));\n };\n AmplitudeCore2.prototype.remove = function(pluginName) {\n if (!this.config) {\n this.q.push(this.remove.bind(this, pluginName));\n return returnWrapper();\n }\n return returnWrapper(this.timeline.deregister(pluginName, this.config));\n };\n AmplitudeCore2.prototype.dispatchWithCallback = function(event, callback) {\n if (!this.config) {\n return callback(buildResult(event, 0, CLIENT_NOT_INITIALIZED));\n }\n void this.process(event).then(callback);\n };\n AmplitudeCore2.prototype.dispatch = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n if (!this.config) {\n return [2, new Promise(function(resolve) {\n _this.dispatchQ.push(_this.dispatchWithCallback.bind(_this, event, resolve));\n })];\n }\n return [2, this.process(event)];\n });\n });\n };\n AmplitudeCore2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var result, e_2, message, result;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n if (this.config.optOut) {\n return [2, buildResult(event, 0, OPT_OUT_MESSAGE)];\n }\n return [4, this.timeline.push(event)];\n case 1:\n result = _a.sent();\n result.code === 200 ? this.config.loggerProvider.log(result.message) : this.config.loggerProvider.error(result.message);\n return [2, result];\n case 2:\n e_2 = _a.sent();\n this.config.loggerProvider.error(e_2);\n message = String(e_2);\n result = buildResult(event, 0, message);\n return [2, result];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeCore2.prototype.setOptOut = function(optOut) {\n if (!this.config) {\n this.q.push(this.setOptOut.bind(this, Boolean(optOut)));\n return;\n }\n this.config.optOut = Boolean(optOut);\n };\n AmplitudeCore2.prototype.flush = function() {\n return returnWrapper(this.timeline.flush());\n };\n return AmplitudeCore2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/revenue.js\n var Revenue = (\n /** @class */\n (function() {\n function Revenue2() {\n this.productId = "";\n this.quantity = 1;\n this.price = 0;\n }\n Revenue2.prototype.setProductId = function(productId) {\n this.productId = productId;\n return this;\n };\n Revenue2.prototype.setQuantity = function(quantity) {\n if (quantity > 0) {\n this.quantity = quantity;\n }\n return this;\n };\n Revenue2.prototype.setPrice = function(price) {\n this.price = price;\n return this;\n };\n Revenue2.prototype.setRevenueType = function(revenueType) {\n this.revenueType = revenueType;\n return this;\n };\n Revenue2.prototype.setCurrency = function(currency) {\n this.currency = currency;\n return this;\n };\n Revenue2.prototype.setRevenue = function(revenue2) {\n this.revenue = revenue2;\n return this;\n };\n Revenue2.prototype.setEventProperties = function(properties) {\n if (isValidObject(properties)) {\n this.properties = properties;\n }\n return this;\n };\n Revenue2.prototype.getEventProperties = function() {\n var eventProperties = this.properties ? __assign({}, this.properties) : {};\n eventProperties[RevenueProperty.REVENUE_PRODUCT_ID] = this.productId;\n eventProperties[RevenueProperty.REVENUE_QUANTITY] = this.quantity;\n eventProperties[RevenueProperty.REVENUE_PRICE] = this.price;\n eventProperties[RevenueProperty.REVENUE_TYPE] = this.revenueType;\n eventProperties[RevenueProperty.REVENUE_CURRENCY] = this.currency;\n eventProperties[RevenueProperty.REVENUE] = this.revenue;\n return eventProperties;\n };\n return Revenue2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js\n var chunk = function(arr, size) {\n var chunkSize = Math.max(size, 1);\n return arr.reduce(function(chunks, element, index) {\n var chunkIndex = Math.floor(index / chunkSize);\n if (!chunks[chunkIndex]) {\n chunks[chunkIndex] = [];\n }\n chunks[chunkIndex].push(element);\n return chunks;\n }, []);\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/logger.js\n var PREFIX = "Amplitude Logger ";\n var Logger = (\n /** @class */\n (function() {\n function Logger2() {\n this.logLevel = LogLevel.None;\n }\n Logger2.prototype.disable = function() {\n this.logLevel = LogLevel.None;\n };\n Logger2.prototype.enable = function(logLevel) {\n if (logLevel === void 0) {\n logLevel = LogLevel.Warn;\n }\n this.logLevel = logLevel;\n };\n Logger2.prototype.log = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Verbose) {\n return;\n }\n console.log("".concat(PREFIX, "[Log]: ").concat(args.join(" ")));\n };\n Logger2.prototype.warn = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Warn) {\n return;\n }\n console.warn("".concat(PREFIX, "[Warn]: ").concat(args.join(" ")));\n };\n Logger2.prototype.error = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Error) {\n return;\n }\n console.error("".concat(PREFIX, "[Error]: ").concat(args.join(" ")));\n };\n Logger2.prototype.debug = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.logLevel < LogLevel.Debug) {\n return;\n }\n console.log("".concat(PREFIX, "[Debug]: ").concat(args.join(" ")));\n };\n return Logger2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/config.js\n var getDefaultConfig = function() {\n return {\n flushMaxRetries: 12,\n flushQueueSize: 200,\n flushIntervalMillis: 1e4,\n instanceName: "$default_instance",\n logLevel: LogLevel.Warn,\n loggerProvider: new Logger(),\n optOut: false,\n serverUrl: AMPLITUDE_SERVER_URL,\n serverZone: ServerZone.US,\n useBatch: false\n };\n };\n var Config = (\n /** @class */\n (function() {\n function Config2(options) {\n var _a, _b, _c, _d;\n this._optOut = false;\n var defaultConfig = getDefaultConfig();\n this.apiKey = options.apiKey;\n this.flushIntervalMillis = (_a = options.flushIntervalMillis) !== null && _a !== void 0 ? _a : defaultConfig.flushIntervalMillis;\n this.flushMaxRetries = options.flushMaxRetries || defaultConfig.flushMaxRetries;\n this.flushQueueSize = options.flushQueueSize || defaultConfig.flushQueueSize;\n this.instanceName = options.instanceName || defaultConfig.instanceName;\n this.loggerProvider = options.loggerProvider || defaultConfig.loggerProvider;\n this.logLevel = (_b = options.logLevel) !== null && _b !== void 0 ? _b : defaultConfig.logLevel;\n this.minIdLength = options.minIdLength;\n this.plan = options.plan;\n this.ingestionMetadata = options.ingestionMetadata;\n this.optOut = (_c = options.optOut) !== null && _c !== void 0 ? _c : defaultConfig.optOut;\n this.serverUrl = options.serverUrl;\n this.serverZone = options.serverZone || defaultConfig.serverZone;\n this.storageProvider = options.storageProvider;\n this.transportProvider = options.transportProvider;\n this.useBatch = (_d = options.useBatch) !== null && _d !== void 0 ? _d : defaultConfig.useBatch;\n this.loggerProvider.enable(this.logLevel);\n var serverConfig = createServerConfig(options.serverUrl, options.serverZone, options.useBatch);\n this.serverZone = serverConfig.serverZone;\n this.serverUrl = serverConfig.serverUrl;\n }\n Object.defineProperty(Config2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n this._optOut = optOut;\n },\n enumerable: false,\n configurable: true\n });\n return Config2;\n })()\n );\n var getServerUrl = function(serverZone, useBatch) {\n if (serverZone === ServerZone.EU) {\n return useBatch ? EU_AMPLITUDE_BATCH_SERVER_URL : EU_AMPLITUDE_SERVER_URL;\n }\n return useBatch ? AMPLITUDE_BATCH_SERVER_URL : AMPLITUDE_SERVER_URL;\n };\n var createServerConfig = function(serverUrl, serverZone, useBatch) {\n if (serverUrl === void 0) {\n serverUrl = "";\n }\n if (serverZone === void 0) {\n serverZone = getDefaultConfig().serverZone;\n }\n if (useBatch === void 0) {\n useBatch = getDefaultConfig().useBatch;\n }\n if (serverUrl) {\n return { serverUrl, serverZone: void 0 };\n }\n var _serverZone = ["US", "EU"].includes(serverZone) ? serverZone : getDefaultConfig().serverZone;\n return {\n serverZone: _serverZone,\n serverUrl: getServerUrl(_serverZone, useBatch)\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js\n function getErrorMessage(error) {\n if (error instanceof Error)\n return error.message;\n return String(error);\n }\n function getResponseBodyString(res) {\n var responseBodyString = "";\n try {\n if ("body" in res) {\n responseBodyString = JSON.stringify(res.body);\n }\n } catch (_a) {\n }\n return responseBodyString;\n }\n var Destination = (\n /** @class */\n (function() {\n function Destination2() {\n this.name = "amplitude";\n this.type = PluginType.DESTINATION;\n this.retryTimeout = 1e3;\n this.throttleTimeout = 3e4;\n this.storageKey = "";\n this.scheduled = null;\n this.queue = [];\n }\n Destination2.prototype.setup = function(config) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var unsent;\n var _this = this;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n this.config = config;\n this.storageKey = "".concat(STORAGE_PREFIX, "_").concat(this.config.apiKey.substring(0, 10));\n return [4, (_a = this.config.storageProvider) === null || _a === void 0 ? void 0 : _a.get(this.storageKey)];\n case 1:\n unsent = _b.sent();\n this.saveEvents();\n if (unsent && unsent.length > 0) {\n void Promise.all(unsent.map(function(event) {\n return _this.execute(event);\n })).catch();\n }\n return [2, Promise.resolve(void 0)];\n }\n });\n });\n };\n Destination2.prototype.execute = function(event) {\n var _this = this;\n return new Promise(function(resolve) {\n var context = {\n event,\n attempts: 0,\n callback: function(result) {\n return resolve(result);\n },\n timeout: 0\n };\n void _this.addToQueue(context);\n });\n };\n Destination2.prototype.addToQueue = function() {\n var _this = this;\n var list = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n list[_i] = arguments[_i];\n }\n var tryable = list.filter(function(context) {\n if (context.attempts < _this.config.flushMaxRetries) {\n context.attempts += 1;\n return true;\n }\n void _this.fulfillRequest([context], 500, MAX_RETRIES_EXCEEDED_MESSAGE);\n return false;\n });\n tryable.forEach(function(context) {\n _this.queue = _this.queue.concat(context);\n if (context.timeout === 0) {\n _this.schedule(_this.config.flushIntervalMillis);\n return;\n }\n setTimeout(function() {\n context.timeout = 0;\n _this.schedule(0);\n }, context.timeout);\n });\n this.saveEvents();\n };\n Destination2.prototype.schedule = function(timeout) {\n var _this = this;\n if (this.scheduled)\n return;\n this.scheduled = setTimeout(function() {\n void _this.flush(true).then(function() {\n if (_this.queue.length > 0) {\n _this.schedule(timeout);\n }\n });\n }, timeout);\n };\n Destination2.prototype.flush = function(useRetry) {\n if (useRetry === void 0) {\n useRetry = false;\n }\n return __awaiter(this, void 0, void 0, function() {\n var list, later, batches;\n var _this = this;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n list = [];\n later = [];\n this.queue.forEach(function(context) {\n return context.timeout === 0 ? list.push(context) : later.push(context);\n });\n this.queue = later;\n if (this.scheduled) {\n clearTimeout(this.scheduled);\n this.scheduled = null;\n }\n batches = chunk(list, this.config.flushQueueSize);\n return [4, Promise.all(batches.map(function(batch) {\n return _this.send(batch, useRetry);\n }))];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.send = function(list, useRetry) {\n if (useRetry === void 0) {\n useRetry = true;\n }\n return __awaiter(this, void 0, void 0, function() {\n var payload, serverUrl, res, e_1, errorMessage;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (!this.config.apiKey) {\n return [2, this.fulfillRequest(list, 400, MISSING_API_KEY_MESSAGE)];\n }\n payload = {\n api_key: this.config.apiKey,\n events: list.map(function(context) {\n var _a2 = context.event, extra = _a2.extra, eventWithoutExtra = __rest(_a2, ["extra"]);\n return eventWithoutExtra;\n }),\n options: {\n min_id_length: this.config.minIdLength\n }\n };\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n serverUrl = createServerConfig(this.config.serverUrl, this.config.serverZone, this.config.useBatch).serverUrl;\n return [4, this.config.transportProvider.send(serverUrl, payload)];\n case 2:\n res = _a.sent();\n if (res === null) {\n this.fulfillRequest(list, 0, UNEXPECTED_ERROR_MESSAGE);\n return [\n 2\n /*return*/\n ];\n }\n if (!useRetry) {\n if ("body" in res) {\n this.fulfillRequest(list, res.statusCode, "".concat(res.status, ": ").concat(getResponseBodyString(res)));\n } else {\n this.fulfillRequest(list, res.statusCode, res.status);\n }\n return [\n 2\n /*return*/\n ];\n }\n this.handleResponse(res, list);\n return [3, 4];\n case 3:\n e_1 = _a.sent();\n this.config.loggerProvider.error(e_1);\n errorMessage = getErrorMessage(e_1);\n this.fulfillRequest(list, 0, errorMessage);\n return [3, 4];\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n Destination2.prototype.handleResponse = function(res, list) {\n var status = res.status;\n switch (status) {\n case Status.Success: {\n this.handleSuccessResponse(res, list);\n break;\n }\n case Status.Invalid: {\n this.handleInvalidResponse(res, list);\n break;\n }\n case Status.PayloadTooLarge: {\n this.handlePayloadTooLargeResponse(res, list);\n break;\n }\n case Status.RateLimit: {\n this.handleRateLimitResponse(res, list);\n break;\n }\n default: {\n this.config.loggerProvider.warn(`{code: 0, error: "Status \'`.concat(status, "\' provided for ").concat(list.length, \' events"}\'));\n this.handleOtherResponse(list);\n break;\n }\n }\n };\n Destination2.prototype.handleSuccessResponse = function(res, list) {\n this.fulfillRequest(list, res.statusCode, SUCCESS_MESSAGE);\n };\n Destination2.prototype.handleInvalidResponse = function(res, list) {\n var _this = this;\n if (res.body.missingField || res.body.error.startsWith(INVALID_API_KEY)) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n var dropIndex = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(Object.values(res.body.eventsWithInvalidFields)), false), __read(Object.values(res.body.eventsWithMissingFields)), false), __read(Object.values(res.body.eventsWithInvalidIdLengths)), false), __read(res.body.silencedEvents), false).flat();\n var dropIndexSet = new Set(dropIndex);\n var retry = list.filter(function(context, index) {\n if (dropIndexSet.has(index)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handlePayloadTooLargeResponse = function(res, list) {\n if (list.length === 1) {\n this.fulfillRequest(list, res.statusCode, res.body.error);\n return;\n }\n this.config.loggerProvider.warn(getResponseBodyString(res));\n this.config.flushQueueSize /= 2;\n this.addToQueue.apply(this, __spreadArray([], __read(list), false));\n };\n Destination2.prototype.handleRateLimitResponse = function(res, list) {\n var _this = this;\n var dropUserIds = Object.keys(res.body.exceededDailyQuotaUsers);\n var dropDeviceIds = Object.keys(res.body.exceededDailyQuotaDevices);\n var throttledIndex = res.body.throttledEvents;\n var dropUserIdsSet = new Set(dropUserIds);\n var dropDeviceIdsSet = new Set(dropDeviceIds);\n var throttledIndexSet = new Set(throttledIndex);\n var retry = list.filter(function(context, index) {\n if (context.event.user_id && dropUserIdsSet.has(context.event.user_id) || context.event.device_id && dropDeviceIdsSet.has(context.event.device_id)) {\n _this.fulfillRequest([context], res.statusCode, res.body.error);\n return;\n }\n if (throttledIndexSet.has(index)) {\n context.timeout = _this.throttleTimeout;\n }\n return true;\n });\n if (retry.length > 0) {\n this.config.loggerProvider.warn(getResponseBodyString(res));\n }\n this.addToQueue.apply(this, __spreadArray([], __read(retry), false));\n };\n Destination2.prototype.handleOtherResponse = function(list) {\n var _this = this;\n this.addToQueue.apply(this, __spreadArray([], __read(list.map(function(context) {\n context.timeout = context.attempts * _this.retryTimeout;\n return context;\n })), false));\n };\n Destination2.prototype.fulfillRequest = function(list, code, message) {\n this.saveEvents();\n list.forEach(function(context) {\n return context.callback(buildResult(context.event, code, message));\n });\n };\n Destination2.prototype.saveEvents = function() {\n if (!this.config.storageProvider) {\n return;\n }\n var events = Array.from(this.queue.map(function(context) {\n return context.event;\n }));\n void this.config.storageProvider.set(this.storageKey, events);\n };\n return Destination2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js\n var getStacktrace = function(ignoreDepth) {\n if (ignoreDepth === void 0) {\n ignoreDepth = 0;\n }\n var trace = new Error().stack || "";\n return trace.split("\\n").slice(2 + ignoreDepth).map(function(text) {\n return text.trim();\n });\n };\n var getClientLogConfig = function(client) {\n return function() {\n var _a = __assign({}, client.config), logger = _a.loggerProvider, logLevel = _a.logLevel;\n return {\n logger,\n logLevel\n };\n };\n };\n var getValueByStringPath = function(obj, path) {\n var e_1, _a;\n path = path.replace(/\\[(\\w+)\\]/g, ".$1");\n path = path.replace(/^\\./, "");\n try {\n for (var _b = __values(path.split(".")), _c = _b.next(); !_c.done; _c = _b.next()) {\n var attr = _c.value;\n if (attr in obj) {\n obj = obj[attr];\n } else {\n return;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n return obj;\n };\n var getClientStates = function(client, paths) {\n return function() {\n var e_2, _a;\n var res = {};\n try {\n for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var path = paths_1_1.value;\n res[path] = getValueByStringPath(client, path);\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n return res;\n };\n };\n var debugWrapper = function(fn, fnName, getLogConfig, getStates, fnContext) {\n if (fnContext === void 0) {\n fnContext = null;\n }\n return function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var _a = getLogConfig(), logger = _a.logger, logLevel = _a.logLevel;\n if (logLevel && logLevel < LogLevel.Debug || !logLevel || !logger) {\n return fn.apply(fnContext, args);\n }\n var debugContext = {\n type: "invoke public method",\n name: fnName,\n args,\n stacktrace: getStacktrace(1),\n time: {\n start: (/* @__PURE__ */ new Date()).toISOString()\n },\n states: {}\n };\n if (getStates && debugContext.states) {\n debugContext.states.before = getStates();\n }\n var result = fn.apply(fnContext, args);\n if (result && result.promise) {\n result.promise.then(function() {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n });\n } else {\n if (getStates && debugContext.states) {\n debugContext.states.after = getStates();\n }\n if (debugContext.time) {\n debugContext.time.end = (/* @__PURE__ */ new Date()).toISOString();\n }\n logger.debug(JSON.stringify(debugContext, null, 2));\n }\n return result;\n };\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js\n var UUID = function(a) {\n return a ? (\n // a random number from 0 to 15\n (a ^ // unless b is 8,\n Math.random() * // in which case\n 16 >> // a random number from\n a / 4).toString(16)\n ) : (\n // or otherwise a concatenated string:\n (String(1e7) + // 10000000 +\n String(-1e3) + // -1000 +\n String(-4e3) + // -4000 +\n String(-8e3) + // -80000000 +\n String(-1e11)).replace(\n // replacing\n /[018]/g,\n // zeroes, ones, and eights with\n UUID\n )\n );\n };\n\n // node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js\n var MemoryStorage = (\n /** @class */\n (function() {\n function MemoryStorage2() {\n this.memoryStorage = /* @__PURE__ */ new Map();\n }\n MemoryStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, true];\n });\n });\n };\n MemoryStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, this.memoryStorage.get(key)];\n });\n });\n };\n MemoryStorage2.prototype.getRaw = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.get(key)];\n case 1:\n value = _a.sent();\n return [2, value ? JSON.stringify(value) : void 0];\n }\n });\n });\n };\n MemoryStorage2.prototype.set = function(key, value) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.set(key, value);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.delete(key);\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n MemoryStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n this.memoryStorage.clear();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return MemoryStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-core/lib/esm/transports/base.js\n var BaseTransport = (\n /** @class */\n (function() {\n function BaseTransport2() {\n }\n BaseTransport2.prototype.send = function(_serverUrl, _payload) {\n return Promise.resolve(null);\n };\n BaseTransport2.prototype.buildResponse = function(responseJSON) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;\n if (typeof responseJSON !== "object") {\n return null;\n }\n var statusCode = responseJSON.code || 0;\n var status = this.buildStatus(statusCode);\n switch (status) {\n case Status.Success:\n return {\n status,\n statusCode,\n body: {\n eventsIngested: (_a = responseJSON.events_ingested) !== null && _a !== void 0 ? _a : 0,\n payloadSizeBytes: (_b = responseJSON.payload_size_bytes) !== null && _b !== void 0 ? _b : 0,\n serverUploadTime: (_c = responseJSON.server_upload_time) !== null && _c !== void 0 ? _c : 0\n }\n };\n case Status.Invalid:\n return {\n status,\n statusCode,\n body: {\n error: (_d = responseJSON.error) !== null && _d !== void 0 ? _d : "",\n missingField: (_e = responseJSON.missing_field) !== null && _e !== void 0 ? _e : "",\n eventsWithInvalidFields: (_f = responseJSON.events_with_invalid_fields) !== null && _f !== void 0 ? _f : {},\n eventsWithMissingFields: (_g = responseJSON.events_with_missing_fields) !== null && _g !== void 0 ? _g : {},\n eventsWithInvalidIdLengths: (_h = responseJSON.events_with_invalid_id_lengths) !== null && _h !== void 0 ? _h : {},\n epsThreshold: (_j = responseJSON.eps_threshold) !== null && _j !== void 0 ? _j : 0,\n exceededDailyQuotaDevices: (_k = responseJSON.exceeded_daily_quota_devices) !== null && _k !== void 0 ? _k : {},\n silencedDevices: (_l = responseJSON.silenced_devices) !== null && _l !== void 0 ? _l : [],\n silencedEvents: (_m = responseJSON.silenced_events) !== null && _m !== void 0 ? _m : [],\n throttledDevices: (_o = responseJSON.throttled_devices) !== null && _o !== void 0 ? _o : {},\n throttledEvents: (_p = responseJSON.throttled_events) !== null && _p !== void 0 ? _p : []\n }\n };\n case Status.PayloadTooLarge:\n return {\n status,\n statusCode,\n body: {\n error: (_q = responseJSON.error) !== null && _q !== void 0 ? _q : ""\n }\n };\n case Status.RateLimit:\n return {\n status,\n statusCode,\n body: {\n error: (_r = responseJSON.error) !== null && _r !== void 0 ? _r : "",\n epsThreshold: (_s = responseJSON.eps_threshold) !== null && _s !== void 0 ? _s : 0,\n throttledDevices: (_t = responseJSON.throttled_devices) !== null && _t !== void 0 ? _t : {},\n throttledUsers: (_u = responseJSON.throttled_users) !== null && _u !== void 0 ? _u : {},\n exceededDailyQuotaDevices: (_v = responseJSON.exceeded_daily_quota_devices) !== null && _v !== void 0 ? _v : {},\n exceededDailyQuotaUsers: (_w = responseJSON.exceeded_daily_quota_users) !== null && _w !== void 0 ? _w : {},\n throttledEvents: (_x = responseJSON.throttled_events) !== null && _x !== void 0 ? _x : []\n }\n };\n case Status.Timeout:\n default:\n return {\n status,\n statusCode\n };\n }\n };\n BaseTransport2.prototype.buildStatus = function(code) {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n if (code === 429) {\n return Status.RateLimit;\n }\n if (code === 413) {\n return Status.PayloadTooLarge;\n }\n if (code === 408) {\n return Status.Timeout;\n }\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n if (code >= 500) {\n return Status.Failed;\n }\n return Status.Unknown;\n };\n return BaseTransport2;\n })()\n );\n\n // node_modules/@amplitude/analytics-connector/dist/analytics-connector.esm.js\n var ApplicationContextProviderImpl = (\n /** @class */\n (function() {\n function ApplicationContextProviderImpl2() {\n }\n ApplicationContextProviderImpl2.prototype.getApplicationContext = function() {\n return {\n versionName: this.versionName,\n language: getLanguage(),\n platform: "Web",\n os: void 0,\n deviceModel: void 0\n };\n };\n return ApplicationContextProviderImpl2;\n })()\n );\n var getLanguage = function() {\n return typeof navigator !== "undefined" && (navigator.languages && navigator.languages[0] || navigator.language) || "";\n };\n var EventBridgeImpl = (\n /** @class */\n (function() {\n function EventBridgeImpl2() {\n this.queue = [];\n }\n EventBridgeImpl2.prototype.logEvent = function(event) {\n if (!this.receiver) {\n if (this.queue.length < 512) {\n this.queue.push(event);\n }\n } else {\n this.receiver(event);\n }\n };\n EventBridgeImpl2.prototype.setEventReceiver = function(receiver) {\n this.receiver = receiver;\n if (this.queue.length > 0) {\n this.queue.forEach(function(event) {\n receiver(event);\n });\n this.queue = [];\n }\n };\n return EventBridgeImpl2;\n })()\n );\n var __assign2 = function() {\n __assign2 = Object.assign || function __assign3(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign2.apply(this, arguments);\n };\n function __values2(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n }\n function __read2(o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = {\n error\n };\n } finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n var isEqual = function(obj1, obj2) {\n var e_1, _a;\n var primitive = ["string", "number", "boolean", "undefined"];\n var typeA = typeof obj1;\n var typeB = typeof obj2;\n if (typeA !== typeB) {\n return false;\n }\n try {\n for (var primitive_1 = __values2(primitive), primitive_1_1 = primitive_1.next(); !primitive_1_1.done; primitive_1_1 = primitive_1.next()) {\n var p = primitive_1_1.value;\n if (p === typeA) {\n return obj1 === obj2;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (primitive_1_1 && !primitive_1_1.done && (_a = primitive_1.return)) _a.call(primitive_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n if (obj1 == null && obj2 == null) {\n return true;\n } else if (obj1 == null || obj2 == null) {\n return false;\n }\n if (obj1.length !== obj2.length) {\n return false;\n }\n var isArrayA = Array.isArray(obj1);\n var isArrayB = Array.isArray(obj2);\n if (isArrayA !== isArrayB) {\n return false;\n }\n if (isArrayA && isArrayB) {\n for (var i = 0; i < obj1.length; i++) {\n if (!isEqual(obj1[i], obj2[i])) {\n return false;\n }\n }\n } else {\n var sorted1 = Object.keys(obj1).sort();\n var sorted2 = Object.keys(obj2).sort();\n if (!isEqual(sorted1, sorted2)) {\n return false;\n }\n var result_1 = true;\n Object.keys(obj1).forEach(function(key) {\n if (!isEqual(obj1[key], obj2[key])) {\n result_1 = false;\n }\n });\n return result_1;\n }\n return true;\n };\n var ID_OP_SET = "$set";\n var ID_OP_UNSET = "$unset";\n var ID_OP_CLEAR_ALL = "$clearAll";\n if (!Object.entries) {\n Object.entries = function(obj) {\n var ownProps = Object.keys(obj);\n var i = ownProps.length;\n var resArray = new Array(i);\n while (i--) {\n resArray[i] = [ownProps[i], obj[ownProps[i]]];\n }\n return resArray;\n };\n }\n var IdentityStoreImpl = (\n /** @class */\n (function() {\n function IdentityStoreImpl2() {\n this.identity = { userProperties: {} };\n this.listeners = /* @__PURE__ */ new Set();\n }\n IdentityStoreImpl2.prototype.editIdentity = function() {\n var self2 = this;\n var actingUserProperties = __assign2({}, this.identity.userProperties);\n var actingIdentity = __assign2(__assign2({}, this.identity), { userProperties: actingUserProperties });\n return {\n setUserId: function(userId) {\n actingIdentity.userId = userId;\n return this;\n },\n setDeviceId: function(deviceId) {\n actingIdentity.deviceId = deviceId;\n return this;\n },\n setUserProperties: function(userProperties) {\n actingIdentity.userProperties = userProperties;\n return this;\n },\n setOptOut: function(optOut) {\n actingIdentity.optOut = optOut;\n return this;\n },\n updateUserProperties: function(actions) {\n var e_1, _a, e_2, _b, e_3, _c;\n var actingProperties = actingIdentity.userProperties || {};\n try {\n for (var _d = __values2(Object.entries(actions)), _e = _d.next(); !_e.done; _e = _d.next()) {\n var _f = __read2(_e.value, 2), action = _f[0], properties = _f[1];\n switch (action) {\n case ID_OP_SET:\n try {\n for (var _g = (e_2 = void 0, __values2(Object.entries(properties))), _h = _g.next(); !_h.done; _h = _g.next()) {\n var _j = __read2(_h.value, 2), key = _j[0], value = _j[1];\n actingProperties[key] = value;\n }\n } catch (e_2_1) {\n e_2 = { error: e_2_1 };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n break;\n case ID_OP_UNSET:\n try {\n for (var _k = (e_3 = void 0, __values2(Object.keys(properties))), _l = _k.next(); !_l.done; _l = _k.next()) {\n var key = _l.value;\n delete actingProperties[key];\n }\n } catch (e_3_1) {\n e_3 = { error: e_3_1 };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n break;\n case ID_OP_CLEAR_ALL:\n actingProperties = {};\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = { error: e_1_1 };\n } finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n actingIdentity.userProperties = actingProperties;\n return this;\n },\n commit: function() {\n self2.setIdentity(actingIdentity);\n return this;\n }\n };\n };\n IdentityStoreImpl2.prototype.getIdentity = function() {\n return __assign2({}, this.identity);\n };\n IdentityStoreImpl2.prototype.setIdentity = function(identity) {\n var originalIdentity = __assign2({}, this.identity);\n this.identity = __assign2({}, identity);\n if (!isEqual(originalIdentity, this.identity)) {\n this.listeners.forEach(function(listener) {\n listener(identity);\n });\n }\n };\n IdentityStoreImpl2.prototype.addIdentityListener = function(listener) {\n this.listeners.add(listener);\n };\n IdentityStoreImpl2.prototype.removeIdentityListener = function(listener) {\n this.listeners.delete(listener);\n };\n return IdentityStoreImpl2;\n })()\n );\n var safeGlobal = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self;\n var AnalyticsConnector = (\n /** @class */\n (function() {\n function AnalyticsConnector2() {\n this.identityStore = new IdentityStoreImpl();\n this.eventBridge = new EventBridgeImpl();\n this.applicationContextProvider = new ApplicationContextProviderImpl();\n }\n AnalyticsConnector2.getInstance = function(instanceName) {\n if (!safeGlobal["analyticsConnectorInstances"]) {\n safeGlobal["analyticsConnectorInstances"] = {};\n }\n if (!safeGlobal["analyticsConnectorInstances"][instanceName]) {\n safeGlobal["analyticsConnectorInstances"][instanceName] = new AnalyticsConnector2();\n }\n return safeGlobal["analyticsConnectorInstances"][instanceName];\n };\n return AnalyticsConnector2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/analytics-connector.js\n var getAnalyticsConnector = function(instanceName) {\n if (instanceName === void 0) {\n instanceName = "$default_instance";\n }\n return AnalyticsConnector.getInstance(instanceName);\n };\n var setConnectorUserId = function(userId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setUserId(userId).commit();\n };\n var setConnectorDeviceId = function(deviceId, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setDeviceId(deviceId).commit();\n };\n var setConnectorOptOut = function(optOut, instanceName) {\n getAnalyticsConnector(instanceName).identityStore.editIdentity().setOptOut(optOut).commit();\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/global-scope.js\n var getGlobalScope = function() {\n if (typeof globalThis !== "undefined") {\n return globalThis;\n }\n if (typeof window !== "undefined") {\n return window;\n }\n if (typeof self !== "undefined") {\n return self;\n }\n if (typeof global !== "undefined") {\n return global;\n }\n return void 0;\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/query-params.js\n var getQueryParams = function() {\n var _a;\n var globalScope = getGlobalScope();\n if (!((_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.location) === null || _a === void 0 ? void 0 : _a.search)) {\n return {};\n }\n var pairs = globalScope.location.search.substring(1).split("&").filter(Boolean);\n var params = pairs.reduce(function(acc, curr) {\n var query = curr.split("=", 2);\n var key = tryDecodeURIComponent(query[0]);\n var value = tryDecodeURIComponent(query[1]);\n if (!value) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n return params;\n };\n var tryDecodeURIComponent = function(value) {\n if (value === void 0) {\n value = "";\n }\n try {\n return decodeURIComponent(value);\n } catch (_a) {\n return "";\n }\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/constants.js\n var UTM_CAMPAIGN = "utm_campaign";\n var UTM_CONTENT = "utm_content";\n var UTM_ID = "utm_id";\n var UTM_MEDIUM = "utm_medium";\n var UTM_SOURCE = "utm_source";\n var UTM_TERM = "utm_term";\n var DCLID = "dclid";\n var FBCLID = "fbclid";\n var GBRAID = "gbraid";\n var GCLID = "gclid";\n var KO_CLICK_ID = "ko_click_id";\n var LI_FAT_ID = "li_fat_id";\n var MSCLKID = "msclkid";\n var RDT_CID = "rtd_cid";\n var TTCLID = "ttclid";\n var TWCLID = "twclid";\n var WBRAID = "wbraid";\n var BASE_CAMPAIGN = {\n utm_campaign: void 0,\n utm_content: void 0,\n utm_id: void 0,\n utm_medium: void 0,\n utm_source: void 0,\n utm_term: void 0,\n referrer: void 0,\n referring_domain: void 0,\n dclid: void 0,\n gbraid: void 0,\n gclid: void 0,\n fbclid: void 0,\n ko_click_id: void 0,\n li_fat_id: void 0,\n msclkid: void 0,\n rtd_cid: void 0,\n ttclid: void 0,\n twclid: void 0,\n wbraid: void 0\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/attribution/campaign-parser.js\n var CampaignParser = (\n /** @class */\n (function() {\n function CampaignParser2() {\n }\n CampaignParser2.prototype.parse = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, __assign(__assign(__assign(__assign({}, BASE_CAMPAIGN), this.getUtmParam()), this.getReferrer()), this.getClickIds())];\n });\n });\n };\n CampaignParser2.prototype.getUtmParam = function() {\n var params = getQueryParams();\n var utmCampaign = params[UTM_CAMPAIGN];\n var utmContent = params[UTM_CONTENT];\n var utmId = params[UTM_ID];\n var utmMedium = params[UTM_MEDIUM];\n var utmSource = params[UTM_SOURCE];\n var utmTerm = params[UTM_TERM];\n return {\n utm_campaign: utmCampaign,\n utm_content: utmContent,\n utm_id: utmId,\n utm_medium: utmMedium,\n utm_source: utmSource,\n utm_term: utmTerm\n };\n };\n CampaignParser2.prototype.getReferrer = function() {\n var _a, _b;\n var data = {\n referrer: void 0,\n referring_domain: void 0\n };\n try {\n data.referrer = document.referrer || void 0;\n data.referring_domain = (_b = (_a = data.referrer) === null || _a === void 0 ? void 0 : _a.split("/")[2]) !== null && _b !== void 0 ? _b : void 0;\n } catch (_c) {\n }\n return data;\n };\n CampaignParser2.prototype.getClickIds = function() {\n var _a;\n var params = getQueryParams();\n return _a = {}, _a[DCLID] = params[DCLID], _a[FBCLID] = params[FBCLID], _a[GBRAID] = params[GBRAID], _a[GCLID] = params[GCLID], _a[KO_CLICK_ID] = params[KO_CLICK_ID], _a[LI_FAT_ID] = params[LI_FAT_ID], _a[MSCLKID] = params[MSCLKID], _a[RDT_CID] = params[RDT_CID], _a[TTCLID] = params[TTCLID], _a[TWCLID] = params[TWCLID], _a[WBRAID] = params[WBRAID], _a;\n };\n return CampaignParser2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/cookie-name.js\n var getCookieName = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var getOldCookieName = function(apiKey) {\n return "".concat(AMPLITUDE_PREFIX.toLowerCase(), "_").concat(apiKey.substring(0, 6));\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/default-tracking.js\n var isFileDownloadTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.fileDownloads) {\n return true;\n }\n return false;\n };\n var isFormInteractionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.formInteractions) {\n return true;\n }\n return false;\n };\n var isPageViewTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if ((defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) === true || (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.pageViews) && typeof defaultTracking.pageViews === "object") {\n return true;\n }\n return false;\n };\n var isSessionTrackingEnabled = function(defaultTracking) {\n if (typeof defaultTracking === "boolean") {\n return defaultTracking;\n }\n if (defaultTracking === null || defaultTracking === void 0 ? void 0 : defaultTracking.sessions) {\n return true;\n }\n return false;\n };\n var getPageViewTrackingConfig = function(config) {\n var _a;\n var trackOn = ((_a = config.attribution) === null || _a === void 0 ? void 0 : _a.trackPageViews) ? "attribution" : function() {\n return false;\n };\n var trackHistoryChanges = void 0;\n var eventType = "Page View";\n var isDefaultPageViewTrackingEnabled = isPageViewTrackingEnabled(config.defaultTracking);\n if (isDefaultPageViewTrackingEnabled) {\n trackOn = void 0;\n eventType = void 0;\n if (config.defaultTracking && typeof config.defaultTracking === "object" && config.defaultTracking.pageViews && typeof config.defaultTracking.pageViews === "object") {\n if ("trackOn" in config.defaultTracking.pageViews) {\n trackOn = config.defaultTracking.pageViews.trackOn;\n }\n if ("trackHistoryChanges" in config.defaultTracking.pageViews) {\n trackHistoryChanges = config.defaultTracking.pageViews.trackHistoryChanges;\n }\n if ("eventType" in config.defaultTracking.pageViews && config.defaultTracking.pageViews.eventType) {\n eventType = config.defaultTracking.pageViews.eventType;\n }\n }\n }\n return {\n trackOn,\n trackHistoryChanges,\n eventType\n };\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/language.js\n var getLanguage2 = function() {\n var _a, _b, _c, _d;\n if (typeof navigator === "undefined")\n return "";\n var userLanguage = navigator.userLanguage;\n return (_d = (_c = (_b = (_a = navigator.languages) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : navigator.language) !== null && _c !== void 0 ? _c : userLanguage) !== null && _d !== void 0 ? _d : "";\n };\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/plugins/identity.js\n var IdentityEventSender = (\n /** @class */\n (function() {\n function IdentityEventSender2() {\n this.name = "identity";\n this.type = PluginType.BEFORE;\n this.identityStore = getAnalyticsConnector().identityStore;\n }\n IdentityEventSender2.prototype.execute = function(context) {\n return __awaiter(this, void 0, void 0, function() {\n var userProperties;\n return __generator(this, function(_a) {\n userProperties = context.user_properties;\n if (userProperties) {\n this.identityStore.editIdentity().updateUserProperties(userProperties).commit();\n }\n return [2, context];\n });\n });\n };\n IdentityEventSender2.prototype.setup = function(config) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (config.instanceName) {\n this.identityStore = getAnalyticsConnector(config.instanceName).identityStore;\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return IdentityEventSender2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/storage/cookie.js\n var CookieStorage = (\n /** @class */\n (function() {\n function CookieStorage2(options) {\n this.options = __assign({}, options);\n }\n CookieStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var testStrorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n CookieStorage2.testValue = String(Date.now());\n testStrorage = new CookieStorage2(this.options);\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStrorage.set(testKey, CookieStorage2.testValue)];\n case 2:\n _b.sent();\n return [4, testStrorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === CookieStorage2.testValue];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStrorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.getRaw(key)];\n case 1:\n value = _a.sent();\n if (!value) {\n return [2, void 0];\n }\n try {\n try {\n value = decodeURIComponent(atob(value));\n } catch (_b) {\n }\n return [2, JSON.parse(value)];\n } catch (_c) {\n return [2, void 0];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var globalScope, cookie, match;\n return __generator(this, function(_b) {\n globalScope = getGlobalScope();\n cookie = (_a = globalScope === null || globalScope === void 0 ? void 0 : globalScope.document.cookie.split("; ")) !== null && _a !== void 0 ? _a : [];\n match = cookie.find(function(c) {\n return c.indexOf(key + "=") === 0;\n });\n if (!match) {\n return [2, void 0];\n }\n return [2, match.substring(key.length + 1)];\n });\n });\n };\n CookieStorage2.prototype.set = function(key, value) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n var expirationDays, expires, expireDate, date, str, globalScope;\n return __generator(this, function(_b) {\n try {\n expirationDays = (_a = this.options.expirationDays) !== null && _a !== void 0 ? _a : 0;\n expires = value !== null ? expirationDays : -1;\n expireDate = void 0;\n if (expires) {\n date = /* @__PURE__ */ new Date();\n date.setTime(date.getTime() + expires * 24 * 60 * 60 * 1e3);\n expireDate = date;\n }\n str = "".concat(key, "=").concat(btoa(encodeURIComponent(JSON.stringify(value))));\n if (expireDate) {\n str += "; expires=".concat(expireDate.toUTCString());\n }\n str += "; path=/";\n if (this.options.domain) {\n str += "; domain=".concat(this.options.domain);\n }\n if (this.options.secure) {\n str += "; Secure";\n }\n if (this.options.sameSite) {\n str += "; SameSite=".concat(this.options.sameSite);\n }\n globalScope = getGlobalScope();\n if (globalScope) {\n globalScope.document.cookie = str;\n }\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n CookieStorage2.prototype.remove = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, this.set(key, null)];\n case 1:\n _a.sent();\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n CookieStorage2.prototype.reset = function() {\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return CookieStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-client-common/lib/esm/transports/fetch.js\n var FetchTransport = (\n /** @class */\n (function(_super) {\n __extends(FetchTransport2, _super);\n function FetchTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FetchTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var options, response, responseText;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n if (typeof fetch === "undefined") {\n throw new Error("FetchTransport is not supported");\n }\n options = {\n headers: {\n "Content-Type": "application/json",\n Accept: "*/*"\n },\n body: JSON.stringify(payload),\n method: "POST"\n };\n return [4, fetch(serverUrl, options)];\n case 1:\n response = _a.sent();\n return [4, response.text()];\n case 2:\n responseText = _a.sent();\n try {\n return [2, this.buildResponse(JSON.parse(responseText))];\n } catch (_b) {\n return [2, this.buildResponse({ code: response.status })];\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n return FetchTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js\n var omitUndefined = function(input) {\n var obj = {};\n for (var key in input) {\n var val = input[key];\n if (val) {\n obj[key] = val;\n }\n }\n return obj;\n };\n\n // node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js\n var pageViewTrackingPlugin = function() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var globalScope = getGlobalScope();\n var loggerProvider = void 0;\n var pushState;\n var _a = __read(args, 2), clientOrOptions = _a[0], configOrUndefined = _a[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var createPageViewEvent = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a2;\n var _b;\n var _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n _b = {\n event_type: (_c = options.eventType) !== null && _c !== void 0 ? _c : "Page View"\n };\n _a2 = [{}];\n return [4, getCampaignParams()];\n case 1:\n return [2, (_b.event_properties = __assign.apply(void 0, [__assign.apply(void 0, _a2.concat([_d.sent()])), { page_domain: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.hostname || ""\n ), page_location: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href || ""\n ), page_path: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.pathname || ""\n ), page_title: (\n /* istanbul ignore next */\n typeof document !== "undefined" && document.title || ""\n ), page_url: (\n /* istanbul ignore next */\n typeof location !== "undefined" && location.href.split("?")[0] || ""\n ) }]), _b)];\n }\n });\n });\n };\n var shouldTrackOnPageLoad = function() {\n return typeof options.trackOn === "undefined" || typeof options.trackOn === "function" && options.trackOn();\n };\n var previousURL = typeof location !== "undefined" ? location.href : null;\n var trackHistoryPageView = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var newURL, shouldTrackPageView, _a2, _b, _c;\n return __generator(this, function(_d) {\n switch (_d.label) {\n case 0:\n newURL = location.href;\n shouldTrackPageView = shouldTrackHistoryPageView(options.trackHistoryChanges, newURL, previousURL || "") && shouldTrackOnPageLoad();\n previousURL = newURL;\n if (!shouldTrackPageView) return [3, 4];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Tracking page view event");\n if (!(amplitude === null || amplitude === void 0)) return [3, 1];\n _a2 = void 0;\n return [3, 3];\n case 1:\n _c = (_b = amplitude).track;\n return [4, createPageViewEvent()];\n case 2:\n _a2 = _c.apply(_b, [_d.sent()]);\n _d.label = 3;\n case 3:\n _a2;\n _d.label = 4;\n case 4:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n var trackHistoryPageViewWrapper = function() {\n void trackHistoryPageView();\n };\n var plugin = {\n name: "page-view-tracking",\n type: PluginType.ENRICHMENT,\n setup: function(config, client) {\n return __awaiter(void 0, void 0, void 0, function() {\n var receivedType, _a2, _b;\n var _c, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n loggerProvider = config.loggerProvider;\n loggerProvider.log("Installing @amplitude/plugin-page-view-tracking-browser");\n options.trackOn = ((_c = config.attribution) === null || _c === void 0 ? void 0 : _c.trackPageViews) ? "attribution" : options.trackOn;\n if (!client && ((_d = config.attribution) === null || _d === void 0 ? void 0 : _d.trackPageViews)) {\n loggerProvider.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser.");\n config.attribution.trackPageViews = false;\n }\n if (options.trackHistoryChanges && globalScope) {\n globalScope.addEventListener("popstate", trackHistoryPageViewWrapper);\n pushState = globalScope.history.pushState;\n globalScope.history.pushState = new Proxy(globalScope.history.pushState, {\n apply: function(target, thisArg, _a3) {\n var _b2 = __read(_a3, 3), state = _b2[0], unused = _b2[1], url = _b2[2];\n target.apply(thisArg, [state, unused, url]);\n void trackHistoryPageView();\n }\n });\n }\n if (!shouldTrackOnPageLoad()) return [3, 2];\n loggerProvider.log("Tracking page view event");\n _b = (_a2 = amplitude).track;\n return [4, createPageViewEvent()];\n case 1:\n _b.apply(_a2, [_e.sent()]);\n _e.label = 2;\n case 2:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n var pageViewEvent;\n return __generator(this, function(_a2) {\n switch (_a2.label) {\n case 0:\n if (!(options.trackOn === "attribution" && isCampaignEvent(event))) return [3, 2];\n loggerProvider === null || loggerProvider === void 0 ? void 0 : loggerProvider.log("Enriching campaign event to page view event with campaign parameters");\n return [4, createPageViewEvent()];\n case 1:\n pageViewEvent = _a2.sent();\n event.event_type = pageViewEvent.event_type;\n event.event_properties = __assign(__assign({}, event.event_properties), pageViewEvent.event_properties);\n _a2.label = 2;\n case 2:\n return [2, event];\n }\n });\n });\n },\n teardown: function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n if (globalScope) {\n globalScope.removeEventListener("popstate", trackHistoryPageViewWrapper);\n if (pushState) {\n globalScope.history.pushState = pushState;\n }\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n }\n };\n plugin.__trackHistoryPageView = trackHistoryPageView;\n return plugin;\n };\n var getCampaignParams = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n var _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _a = omitUndefined;\n return [4, new CampaignParser().parse()];\n case 1:\n return [2, _a.apply(void 0, [_b.sent()])];\n }\n });\n });\n };\n var isCampaignEvent = function(event) {\n if (event.event_type === "$identify" && event.user_properties) {\n var properties = event.user_properties;\n var $set = properties[IdentifyOperation.SET] || {};\n var $unset = properties[IdentifyOperation.UNSET] || {};\n var userProperties_1 = __spreadArray(__spreadArray([], __read(Object.keys($set)), false), __read(Object.keys($unset)), false);\n return Object.keys(BASE_CAMPAIGN).every(function(value) {\n return userProperties_1.includes(value);\n });\n }\n return false;\n };\n var shouldTrackHistoryPageView = function(trackingOption, newURL, oldURL) {\n switch (trackingOption) {\n case "pathOnly":\n return newURL.split("?")[0] !== oldURL.split("?")[0];\n default:\n return newURL !== oldURL;\n }\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/helpers.js\n var getStorageKey = function(apiKey, postKey, limit) {\n if (postKey === void 0) {\n postKey = "";\n }\n if (limit === void 0) {\n limit = 10;\n }\n return [AMPLITUDE_PREFIX, postKey, apiKey.substring(0, limit)].filter(Boolean).join("_");\n };\n var domainWithoutSubdomain = function(domain) {\n var parts = domain.split(".");\n if (parts.length <= 2) {\n return domain;\n }\n return parts.slice(parts.length - 2, parts.length).join(".");\n };\n var isNewCampaign = function(current, previous, options) {\n var _a;\n var referrer = current.referrer, referring_domain = current.referring_domain, currentCampaign = __rest(current, ["referrer", "referring_domain"]);\n var _b = previous || {}, _previous_referrer = _b.referrer, prevReferringDomain = _b.referring_domain, previousCampaign = __rest(_b, ["referrer", "referring_domain"]);\n if (current.referring_domain && ((_a = options.excludeReferrers) === null || _a === void 0 ? void 0 : _a.includes(current.referring_domain))) {\n return false;\n }\n var hasNewCampaign = JSON.stringify(currentCampaign) !== JSON.stringify(previousCampaign);\n var hasNewDomain = domainWithoutSubdomain(referring_domain || "") !== domainWithoutSubdomain(prevReferringDomain || "");\n return !previous || hasNewCampaign || hasNewDomain;\n };\n var createCampaignEvent = function(campaign, options) {\n var campaignParameters = __assign(__assign({}, BASE_CAMPAIGN), campaign);\n var identifyEvent = Object.entries(campaignParameters).reduce(function(identify2, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n identify2.setOnce("initial_".concat(key), (_b = value !== null && value !== void 0 ? value : options.initialEmptyValue) !== null && _b !== void 0 ? _b : "EMPTY");\n if (value) {\n return identify2.set(key, value);\n }\n return identify2.unset(key);\n }, new Identify());\n return createIdentifyEvent(identifyEvent);\n };\n\n // node_modules/@amplitude/plugin-web-attribution-browser/lib/esm/web-attribution.js\n var webAttributionPlugin = function() {\n var _this = this;\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var amplitude;\n var options = {};\n var _b = __read(args, 2), clientOrOptions = _b[0], configOrUndefined = _b[1];\n if (clientOrOptions && "init" in clientOrOptions) {\n amplitude = clientOrOptions;\n if (configOrUndefined) {\n options = configOrUndefined;\n }\n } else if (clientOrOptions) {\n options = clientOrOptions;\n }\n var excludeReferrers = (_a = options.excludeReferrers) !== null && _a !== void 0 ? _a : [];\n if (typeof location !== "undefined") {\n excludeReferrers.unshift(location.hostname);\n }\n options = __assign(__assign({ disabled: false, initialEmptyValue: "EMPTY", resetSessionOnNewCampaign: false }, options), { excludeReferrers });\n var plugin = {\n name: "web-attribution",\n type: PluginType.BEFORE,\n setup: function(config, client) {\n var _a2;\n return __awaiter(this, void 0, void 0, function() {\n var receivedType, storage, storageKey, _b2, currentCampaign, previousCampaign, pluginEnabledOverride, campaignEvent;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n amplitude = amplitude !== null && amplitude !== void 0 ? amplitude : client;\n if (!amplitude) {\n receivedType = clientOrOptions ? "Options" : "undefined";\n config.loggerProvider.error("Argument of type \'".concat(receivedType, "\' is not assignable to parameter of type \'BrowserClient\'."));\n return [\n 2\n /*return*/\n ];\n }\n if (options.disabled) {\n config.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n config.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser.");\n if (!client && !((_a2 = config.attribution) === null || _a2 === void 0 ? void 0 : _a2.disabled)) {\n config.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser.");\n config.attribution = {\n disabled: true\n };\n }\n storage = config.cookieStorage;\n storageKey = getStorageKey(config.apiKey, "MKTG");\n return [4, Promise.all([\n new CampaignParser().parse(),\n storage.get(storageKey)\n ])];\n case 1:\n _b2 = __read.apply(void 0, [_c.sent(), 2]), currentCampaign = _b2[0], previousCampaign = _b2[1];\n pluginEnabledOverride = this.__pluginEnabledOverride;\n if (pluginEnabledOverride !== null && pluginEnabledOverride !== void 0 ? pluginEnabledOverride : isNewCampaign(currentCampaign, previousCampaign, options)) {\n if (options.resetSessionOnNewCampaign) {\n amplitude.setSessionId(Date.now());\n config.loggerProvider.log("Created a new session for new campaign.");\n }\n config.loggerProvider.log("Tracking attribution.");\n campaignEvent = createCampaignEvent(currentCampaign, options);\n amplitude.track(campaignEvent);\n void storage.set(storageKey, currentCampaign);\n }\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n },\n execute: function(event) {\n return __awaiter(_this, void 0, void 0, function() {\n return __generator(this, function(_a2) {\n return [2, event];\n });\n });\n }\n };\n plugin.__pluginEnabledOverride = void 0;\n return plugin;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js\n var MAX_ARRAY_LENGTH = 1e3;\n var LocalStorage = (\n /** @class */\n (function() {\n function LocalStorage2(config) {\n this.loggerProvider = config === null || config === void 0 ? void 0 : config.loggerProvider;\n }\n LocalStorage2.prototype.isEnabled = function() {\n return __awaiter(this, void 0, void 0, function() {\n var random, testStorage, testKey, value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n if (!getGlobalScope()) {\n return [2, false];\n }\n random = String(Date.now());\n testStorage = new LocalStorage2();\n testKey = "AMP_TEST";\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, 5, 7]);\n return [4, testStorage.set(testKey, random)];\n case 2:\n _b.sent();\n return [4, testStorage.get(testKey)];\n case 3:\n value = _b.sent();\n return [2, value === random];\n case 4:\n _a = _b.sent();\n return [2, false];\n case 5:\n return [4, testStorage.remove(testKey)];\n case 6:\n _b.sent();\n return [\n 7\n /*endfinally*/\n ];\n case 7:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.get = function(key) {\n return __awaiter(this, void 0, void 0, function() {\n var value, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n return [4, this.getRaw(key)];\n case 1:\n value = _b.sent();\n if (!value) {\n return [2, void 0];\n }\n return [2, JSON.parse(value)];\n case 2:\n _a = _b.sent();\n return [2, void 0];\n case 3:\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n LocalStorage2.prototype.getRaw = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n return [2, ((_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.getItem(key)) || void 0];\n });\n });\n };\n LocalStorage2.prototype.set = function(key, value) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var isExceededArraySize, serializedValue, droppedEventsCount;\n return __generator(this, function(_c) {\n isExceededArraySize = Array.isArray(value) && value.length > MAX_ARRAY_LENGTH;\n try {\n serializedValue = isExceededArraySize ? JSON.stringify(value.slice(0, MAX_ARRAY_LENGTH)) : JSON.stringify(value);\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.setItem(key, serializedValue);\n } catch (_d) {\n }\n if (isExceededArraySize) {\n droppedEventsCount = value.length - MAX_ARRAY_LENGTH;\n (_b = this.loggerProvider) === null || _b === void 0 ? void 0 : _b.error("Failed to save ".concat(droppedEventsCount, " events because the queue length exceeded ").concat(MAX_ARRAY_LENGTH, "."));\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.remove = function(key) {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.removeItem(key);\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n LocalStorage2.prototype.reset = function() {\n var _a;\n return __awaiter(this, void 0, void 0, function() {\n return __generator(this, function(_b) {\n try {\n (_a = getGlobalScope()) === null || _a === void 0 ? void 0 : _a.localStorage.clear();\n } catch (_c) {\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return LocalStorage2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js\n var XHRTransport = (\n /** @class */\n (function(_super) {\n __extends(XHRTransport2, _super);\n function XHRTransport2() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n done: 4\n };\n return _this;\n }\n XHRTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n if (typeof XMLHttpRequest === "undefined") {\n reject(new Error("XHRTransport is not supported."));\n }\n var xhr = new XMLHttpRequest();\n xhr.open("POST", serverUrl, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === _this.state.done) {\n try {\n var responsePayload = xhr.responseText;\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n xhr.setRequestHeader("Content-Type", "application/json");\n xhr.setRequestHeader("Accept", "*/*");\n xhr.send(JSON.stringify(payload));\n })];\n });\n });\n };\n return XHRTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js\n var SendBeaconTransport = (\n /** @class */\n (function(_super) {\n __extends(SendBeaconTransport2, _super);\n function SendBeaconTransport2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SendBeaconTransport2.prototype.send = function(serverUrl, payload) {\n return __awaiter(this, void 0, void 0, function() {\n var _this = this;\n return __generator(this, function(_a) {\n return [2, new Promise(function(resolve, reject) {\n var globalScope = getGlobalScope();\n if (!(globalScope === null || globalScope === void 0 ? void 0 : globalScope.navigator.sendBeacon)) {\n throw new Error("SendBeaconTransport is not supported");\n }\n try {\n var data = JSON.stringify(payload);\n var success = globalScope.navigator.sendBeacon(serverUrl, JSON.stringify(payload));\n if (success) {\n return resolve(_this.buildResponse({\n code: 200,\n events_ingested: payload.events.length,\n payload_size_bytes: data.length,\n server_upload_time: Date.now()\n }));\n }\n return resolve(_this.buildResponse({ code: 500 }));\n } catch (e) {\n reject(e);\n }\n })];\n });\n });\n };\n return SendBeaconTransport2;\n })(BaseTransport)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/config.js\n var getDefaultConfig2 = function() {\n var cookieStorage = new MemoryStorage();\n var trackingOptions = {\n deviceManufacturer: true,\n deviceModel: true,\n ipAddress: true,\n language: true,\n osName: true,\n osVersion: true,\n platform: true\n };\n return {\n cookieExpiration: 365,\n cookieSameSite: "Lax",\n cookieSecure: false,\n cookieStorage,\n cookieUpgrade: true,\n disableCookies: false,\n domain: "",\n sessionTimeout: 30 * 60 * 1e3,\n trackingOptions,\n transportProvider: new FetchTransport()\n };\n };\n var BrowserConfig = (\n /** @class */\n (function(_super) {\n __extends(BrowserConfig2, _super);\n function BrowserConfig2(apiKey, options) {\n var _this = this;\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n var defaultConfig = getDefaultConfig2();\n _this = _super.call(this, __assign(__assign({ flushIntervalMillis: 1e3, flushMaxRetries: 5, flushQueueSize: 30, transportProvider: defaultConfig.transportProvider }, options), { apiKey })) || this;\n _this._optOut = false;\n _this.cookieStorage = (_a = options === null || options === void 0 ? void 0 : options.cookieStorage) !== null && _a !== void 0 ? _a : defaultConfig.cookieStorage;\n _this.deviceId = options === null || options === void 0 ? void 0 : options.deviceId;\n _this.lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n _this.lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n _this.optOut = Boolean(options === null || options === void 0 ? void 0 : options.optOut);\n _this.sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n _this.userId = options === null || options === void 0 ? void 0 : options.userId;\n _this.appVersion = options === null || options === void 0 ? void 0 : options.appVersion;\n _this.attribution = options === null || options === void 0 ? void 0 : options.attribution;\n _this.cookieExpiration = (_b = options === null || options === void 0 ? void 0 : options.cookieExpiration) !== null && _b !== void 0 ? _b : defaultConfig.cookieExpiration;\n _this.cookieSameSite = (_c = options === null || options === void 0 ? void 0 : options.cookieSameSite) !== null && _c !== void 0 ? _c : defaultConfig.cookieSameSite;\n _this.cookieSecure = (_d = options === null || options === void 0 ? void 0 : options.cookieSecure) !== null && _d !== void 0 ? _d : defaultConfig.cookieSecure;\n _this.cookieUpgrade = (_e = options === null || options === void 0 ? void 0 : options.cookieUpgrade) !== null && _e !== void 0 ? _e : defaultConfig.cookieUpgrade;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.disableCookies = (_f = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _f !== void 0 ? _f : defaultConfig.disableCookies;\n _this.defaultTracking = options === null || options === void 0 ? void 0 : options.defaultTracking;\n _this.domain = (_g = options === null || options === void 0 ? void 0 : options.domain) !== null && _g !== void 0 ? _g : defaultConfig.domain;\n _this.partnerId = options === null || options === void 0 ? void 0 : options.partnerId;\n _this.sessionTimeout = (_h = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _h !== void 0 ? _h : defaultConfig.sessionTimeout;\n _this.trackingOptions = (_j = options === null || options === void 0 ? void 0 : options.trackingOptions) !== null && _j !== void 0 ? _j : defaultConfig.trackingOptions;\n return _this;\n }\n Object.defineProperty(BrowserConfig2.prototype, "deviceId", {\n get: function() {\n return this._deviceId;\n },\n set: function(deviceId) {\n if (this._deviceId !== deviceId) {\n this._deviceId = deviceId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "userId", {\n get: function() {\n return this._userId;\n },\n set: function(userId) {\n if (this._userId !== userId) {\n this._userId = userId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "sessionId", {\n get: function() {\n return this._sessionId;\n },\n set: function(sessionId) {\n if (this._sessionId !== sessionId) {\n this._sessionId = sessionId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "optOut", {\n get: function() {\n return this._optOut;\n },\n set: function(optOut) {\n if (this._optOut !== optOut) {\n this._optOut = optOut;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventTime", {\n get: function() {\n return this._lastEventTime;\n },\n set: function(lastEventTime) {\n if (this._lastEventTime !== lastEventTime) {\n this._lastEventTime = lastEventTime;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrowserConfig2.prototype, "lastEventId", {\n get: function() {\n return this._lastEventId;\n },\n set: function(lastEventId) {\n if (this._lastEventId !== lastEventId) {\n this._lastEventId = lastEventId;\n this.updateStorage();\n }\n },\n enumerable: false,\n configurable: true\n });\n BrowserConfig2.prototype.updateStorage = function() {\n var _a;\n var cache = {\n deviceId: this._deviceId,\n userId: this._userId,\n sessionId: this._sessionId,\n optOut: this._optOut,\n lastEventTime: this._lastEventTime,\n lastEventId: this._lastEventId\n };\n void ((_a = this.cookieStorage) === null || _a === void 0 ? void 0 : _a.set(getCookieName(this.apiKey), cache));\n };\n return BrowserConfig2;\n })(Config)\n );\n var useBrowserConfig = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var defaultConfig, deviceId, lastEventId, lastEventTime, optOut, sessionId, userId, cookieStorage, domain, _a, _b, _c;\n var _d;\n var _e, _f;\n return __generator(this, function(_g) {\n switch (_g.label) {\n case 0:\n defaultConfig = getDefaultConfig2();\n deviceId = (_e = options === null || options === void 0 ? void 0 : options.deviceId) !== null && _e !== void 0 ? _e : UUID();\n lastEventId = options === null || options === void 0 ? void 0 : options.lastEventId;\n lastEventTime = options === null || options === void 0 ? void 0 : options.lastEventTime;\n optOut = options === null || options === void 0 ? void 0 : options.optOut;\n sessionId = options === null || options === void 0 ? void 0 : options.sessionId;\n userId = options === null || options === void 0 ? void 0 : options.userId;\n cookieStorage = options === null || options === void 0 ? void 0 : options.cookieStorage;\n domain = options === null || options === void 0 ? void 0 : options.domain;\n _a = BrowserConfig.bind;\n _b = [void 0, apiKey];\n _c = [__assign({}, options)];\n _d = { cookieStorage, deviceId, domain, lastEventId, lastEventTime, optOut, sessionId };\n return [4, createEventsStorage(options)];\n case 1:\n return [2, new (_a.apply(BrowserConfig, _b.concat([__assign.apply(void 0, _c.concat([(_d.storageProvider = _g.sent(), _d.trackingOptions = __assign(__assign({}, defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions), _d.transportProvider = (_f = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _f !== void 0 ? _f : createTransport(options === null || options === void 0 ? void 0 : options.transport), _d.userId = userId, _d)]))])))()];\n }\n });\n });\n };\n var createCookieStorage = function(overrides, baseConfig) {\n if (baseConfig === void 0) {\n baseConfig = getDefaultConfig2();\n }\n return __awaiter(void 0, void 0, void 0, function() {\n var options, cookieStorage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n options = __assign(__assign({}, baseConfig), overrides);\n cookieStorage = overrides === null || overrides === void 0 ? void 0 : overrides.cookieStorage;\n _a = !cookieStorage;\n if (_a) return [3, 2];\n return [4, cookieStorage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (_a) {\n return [2, createFlexibleStorage(options)];\n }\n return [2, cookieStorage];\n }\n });\n });\n };\n var createFlexibleStorage = function(options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, _a;\n return __generator(this, function(_b) {\n switch (_b.label) {\n case 0:\n storage = new CookieStorage({\n domain: options.domain,\n expirationDays: options.cookieExpiration,\n sameSite: options.cookieSameSite,\n secure: options.cookieSecure\n });\n _a = options.disableCookies;\n if (_a) return [3, 2];\n return [4, storage.isEnabled()];\n case 1:\n _a = !_b.sent();\n _b.label = 2;\n case 2:\n if (!_a) return [3, 4];\n storage = new LocalStorage();\n return [4, storage.isEnabled()];\n case 3:\n if (!_b.sent()) {\n storage = new MemoryStorage();\n }\n _b.label = 4;\n case 4:\n return [2, storage];\n }\n });\n });\n };\n var createEventsStorage = function(overrides) {\n return __awaiter(void 0, void 0, void 0, function() {\n var hasStorageProviderProperty, loggerProvider, _a, _b, storage, _c, e_1_1;\n var e_1, _d;\n return __generator(this, function(_e) {\n switch (_e.label) {\n case 0:\n hasStorageProviderProperty = overrides && Object.prototype.hasOwnProperty.call(overrides, "storageProvider");\n loggerProvider = overrides && overrides.loggerProvider;\n if (!(!hasStorageProviderProperty || overrides.storageProvider)) return [3, 9];\n _e.label = 1;\n case 1:\n _e.trys.push([1, 7, 8, 9]);\n _a = __values([overrides === null || overrides === void 0 ? void 0 : overrides.storageProvider, new LocalStorage({ loggerProvider })]), _b = _a.next();\n _e.label = 2;\n case 2:\n if (!!_b.done) return [3, 6];\n storage = _b.value;\n _c = storage;\n if (!_c) return [3, 4];\n return [4, storage.isEnabled()];\n case 3:\n _c = _e.sent();\n _e.label = 4;\n case 4:\n if (_c) {\n return [2, storage];\n }\n _e.label = 5;\n case 5:\n _b = _a.next();\n return [3, 2];\n case 6:\n return [3, 9];\n case 7:\n e_1_1 = _e.sent();\n e_1 = { error: e_1_1 };\n return [3, 9];\n case 8:\n try {\n if (_b && !_b.done && (_d = _a.return)) _d.call(_a);\n } finally {\n if (e_1) throw e_1.error;\n }\n return [\n 7\n /*endfinally*/\n ];\n case 9:\n return [2, void 0];\n }\n });\n });\n };\n var createTransport = function(transport) {\n if (transport === TransportType.XHR) {\n return new XHRTransport();\n }\n if (transport === TransportType.SendBeacon) {\n return new SendBeaconTransport();\n }\n return getDefaultConfig2().transportProvider;\n };\n var getTopLevelDomain = function(url) {\n return __awaiter(void 0, void 0, void 0, function() {\n var host, parts, levels, storageKey, i, i, domain, options, storage, value;\n return __generator(this, function(_a) {\n switch (_a.label) {\n case 0:\n return [4, new CookieStorage().isEnabled()];\n case 1:\n if (!_a.sent() || !url && typeof location === "undefined") {\n return [2, ""];\n }\n host = url !== null && url !== void 0 ? url : location.hostname;\n parts = host.split(".");\n levels = [];\n storageKey = "AMP_TLDTEST";\n for (i = parts.length - 2; i >= 0; --i) {\n levels.push(parts.slice(i).join("."));\n }\n i = 0;\n _a.label = 2;\n case 2:\n if (!(i < levels.length)) return [3, 7];\n domain = levels[i];\n options = { domain: "." + domain };\n storage = new CookieStorage(options);\n return [4, storage.set(storageKey, 1)];\n case 3:\n _a.sent();\n return [4, storage.get(storageKey)];\n case 4:\n value = _a.sent();\n if (!value) return [3, 6];\n return [4, storage.remove(storageKey)];\n case 5:\n _a.sent();\n return [2, "." + domain];\n case 6:\n i++;\n return [3, 2];\n case 7:\n return [2, ""];\n }\n });\n });\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/constants.js\n var DEFAULT_EVENT_PREFIX = "[Amplitude]";\n var DEFAULT_PAGE_VIEW_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Page Viewed");\n var DEFAULT_FORM_START_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Started");\n var DEFAULT_FORM_SUBMIT_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " Form Submitted");\n var DEFAULT_FILE_DOWNLOAD_EVENT = "".concat(DEFAULT_EVENT_PREFIX, " File Downloaded");\n var DEFAULT_SESSION_START_EVENT = "session_start";\n var DEFAULT_SESSION_END_EVENT = "session_end";\n var FILE_EXTENSION = "".concat(DEFAULT_EVENT_PREFIX, " File Extension");\n var FILE_NAME = "".concat(DEFAULT_EVENT_PREFIX, " File Name");\n var LINK_ID = "".concat(DEFAULT_EVENT_PREFIX, " Link ID");\n var LINK_TEXT = "".concat(DEFAULT_EVENT_PREFIX, " Link Text");\n var LINK_URL = "".concat(DEFAULT_EVENT_PREFIX, " Link URL");\n var FORM_ID = "".concat(DEFAULT_EVENT_PREFIX, " Form ID");\n var FORM_NAME = "".concat(DEFAULT_EVENT_PREFIX, " Form Name");\n var FORM_DESTINATION = "".concat(DEFAULT_EVENT_PREFIX, " Form Destination");\n\n // node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js\n var parseLegacyCookies = function(apiKey, options) {\n return __awaiter(void 0, void 0, void 0, function() {\n var storage, oldCookieName, cookies, _a, deviceId, userId, optOut, sessionId, lastEventTime, lastEventId;\n var _b;\n return __generator(this, function(_c) {\n switch (_c.label) {\n case 0:\n return [4, createCookieStorage(options)];\n case 1:\n storage = _c.sent();\n oldCookieName = getOldCookieName(apiKey);\n return [4, storage.getRaw(oldCookieName)];\n case 2:\n cookies = _c.sent();\n if (!cookies) {\n return [2, {\n optOut: false\n }];\n }\n if (!((_b = options.cookieUpgrade) !== null && _b !== void 0 ? _b : getDefaultConfig2().cookieUpgrade)) return [3, 4];\n return [4, storage.remove(oldCookieName)];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4:\n _a = __read(cookies.split("."), 6), deviceId = _a[0], userId = _a[1], optOut = _a[2], sessionId = _a[3], lastEventTime = _a[4], lastEventId = _a[5];\n return [2, {\n deviceId,\n userId: decode(userId),\n sessionId: parseTime(sessionId),\n lastEventId: parseTime(lastEventId),\n lastEventTime: parseTime(lastEventTime),\n optOut: Boolean(optOut)\n }];\n }\n });\n });\n };\n var parseTime = function(num) {\n var integer = parseInt(num, 32);\n if (isNaN(integer)) {\n return void 0;\n }\n return integer;\n };\n var decode = function(value) {\n if (!atob || !escape || !value) {\n return void 0;\n }\n try {\n return decodeURIComponent(escape(atob(value)));\n } catch (_a) {\n return void 0;\n }\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var import_ua_parser_js = __toESM(require_ua_parser());\n\n // node_modules/@amplitude/analytics-browser/lib/esm/version.js\n var VERSION = "1.13.4";\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js\n var BROWSER_PLATFORM = "Web";\n var IP_ADDRESS = "$remote";\n var Context = (\n /** @class */\n (function() {\n function Context2() {\n this.name = "context";\n this.type = PluginType.BEFORE;\n this.library = "amplitude-ts/".concat(VERSION);\n if (typeof navigator !== "undefined") {\n this.userAgent = navigator.userAgent;\n }\n this.uaResult = new import_ua_parser_js.default(this.userAgent).getResult();\n }\n Context2.prototype.setup = function(config) {\n this.config = config;\n return Promise.resolve(void 0);\n };\n Context2.prototype.execute = function(context) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function() {\n var time, osName, osVersion, deviceModel, deviceVendor, lastEventId, nextEventId, event;\n return __generator(this, function(_c) {\n time = (/* @__PURE__ */ new Date()).getTime();\n osName = this.uaResult.browser.name;\n osVersion = this.uaResult.browser.version;\n deviceModel = this.uaResult.device.model || this.uaResult.os.name;\n deviceVendor = this.uaResult.device.vendor;\n lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n nextEventId = (_b = context.event_id) !== null && _b !== void 0 ? _b : lastEventId + 1;\n this.config.lastEventId = nextEventId;\n if (!context.time) {\n this.config.lastEventTime = time;\n }\n event = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ user_id: this.config.userId, device_id: this.config.deviceId, session_id: this.config.sessionId, time }, this.config.appVersion && { app_version: this.config.appVersion }), this.config.trackingOptions.platform && { platform: BROWSER_PLATFORM }), this.config.trackingOptions.osName && { os_name: osName }), this.config.trackingOptions.osVersion && { os_version: osVersion }), this.config.trackingOptions.deviceManufacturer && { device_manufacturer: deviceVendor }), this.config.trackingOptions.deviceModel && { device_model: deviceModel }), this.config.trackingOptions.language && { language: getLanguage2() }), this.config.trackingOptions.ipAddress && { ip: IP_ADDRESS }), { insert_id: UUID(), partner_id: this.config.partnerId, plan: this.config.plan }), this.config.ingestionMetadata && {\n ingestion_metadata: {\n source_name: this.config.ingestionMetadata.sourceName,\n source_version: this.config.ingestionMetadata.sourceVersion\n }\n }), context), { event_id: nextEventId, library: this.library, user_agent: this.userAgent });\n return [2, event];\n });\n });\n };\n return Context2;\n })()\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/default-page-view-event-enrichment.js\n var eventPropertyMap = {\n page_domain: "".concat(DEFAULT_EVENT_PREFIX, " Page Domain"),\n page_location: "".concat(DEFAULT_EVENT_PREFIX, " Page Location"),\n page_path: "".concat(DEFAULT_EVENT_PREFIX, " Page Path"),\n page_title: "".concat(DEFAULT_EVENT_PREFIX, " Page Title"),\n page_url: "".concat(DEFAULT_EVENT_PREFIX, " Page URL")\n };\n var defaultPageViewEventEnrichment = function() {\n var name = "@amplitude/plugin-default-page-view-event-enrichment-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, void 0];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n if (event.event_type === DEFAULT_PAGE_VIEW_EVENT && event.event_properties) {\n event.event_properties = Object.entries(event.event_properties).reduce(function(acc, _a2) {\n var _b = __read(_a2, 2), key = _b[0], value = _b[1];\n var transformedPropertyName = eventPropertyMap[key];\n if (transformedPropertyName) {\n acc[transformedPropertyName] = value;\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n }\n return [2, event];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js\n var fileDownloadTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-file-download-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFileDownloadListener, ext, links;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFileDownloadListener = function(a) {\n var url;\n try {\n url = new URL(a.href, window.location.href);\n } catch (_a2) {\n return;\n }\n var result = ext.exec(url.href);\n var fileExtension = result === null || result === void 0 ? void 0 : result[1];\n if (fileExtension) {\n addEventListener(a, "click", function() {\n var _a2;\n if (fileExtension) {\n amplitude.track(DEFAULT_FILE_DOWNLOAD_EVENT, (_a2 = {}, _a2[FILE_EXTENSION] = fileExtension, _a2[FILE_NAME] = url.pathname, _a2[LINK_ID] = a.id, _a2[LINK_TEXT] = a.text, _a2[LINK_URL] = a.href, _a2));\n }\n });\n }\n };\n ext = /\\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/;\n links = Array.from(document.getElementsByTagName("a"));\n links.forEach(addFileDownloadListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "A") {\n addFileDownloadListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("a")).map(addFileDownloadListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js\n var formInteractionTracking = function() {\n var observer;\n var eventListeners = [];\n var addEventListener = function(element, type2, handler) {\n element.addEventListener(type2, handler);\n eventListeners.push({\n element,\n type: type2,\n handler\n });\n };\n var removeClickListeners = function() {\n eventListeners.forEach(function(_a) {\n var element = _a.element, type2 = _a.type, handler = _a.handler;\n element === null || element === void 0 ? void 0 : element.removeEventListener(type2, handler);\n });\n eventListeners = [];\n };\n var name = "@amplitude/plugin-form-interaction-tracking-browser";\n var type = PluginType.ENRICHMENT;\n var setup = function(config, amplitude) {\n return __awaiter(void 0, void 0, void 0, function() {\n var addFormInteractionListener, forms;\n return __generator(this, function(_a) {\n if (!amplitude) {\n config.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");\n return [\n 2\n /*return*/\n ];\n }\n if (typeof document === "undefined") {\n return [\n 2\n /*return*/\n ];\n }\n addFormInteractionListener = function(form) {\n var hasFormChanged = false;\n addEventListener(form, "change", function() {\n var _a2;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n hasFormChanged = true;\n });\n addEventListener(form, "submit", function() {\n var _a2, _b;\n if (!hasFormChanged) {\n amplitude.track(DEFAULT_FORM_START_EVENT, (_a2 = {}, _a2[FORM_ID] = form.id, _a2[FORM_NAME] = form.name, _a2[FORM_DESTINATION] = form.action, _a2));\n }\n amplitude.track(DEFAULT_FORM_SUBMIT_EVENT, (_b = {}, _b[FORM_ID] = form.id, _b[FORM_NAME] = form.name, _b[FORM_DESTINATION] = form.action, _b));\n hasFormChanged = false;\n });\n };\n forms = Array.from(document.getElementsByTagName("form"));\n forms.forEach(addFormInteractionListener);\n if (typeof MutationObserver !== "undefined") {\n observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function(node) {\n if (node.nodeName === "FORM") {\n addFormInteractionListener(node);\n }\n if ("querySelectorAll" in node && typeof node.querySelectorAll === "function") {\n Array.from(node.querySelectorAll("form")).map(addFormInteractionListener);\n }\n });\n });\n });\n observer.observe(document.body, {\n subtree: true,\n childList: true\n });\n }\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n var execute = function(event) {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n return [2, event];\n });\n });\n };\n var teardown = function() {\n return __awaiter(void 0, void 0, void 0, function() {\n return __generator(this, function(_a) {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n removeClickListeners();\n return [\n 2\n /*return*/\n ];\n });\n });\n };\n return {\n name,\n type,\n setup,\n execute,\n teardown\n };\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js\n var convertProxyObjectToRealObject = function(instance, queue) {\n for (var i = 0; i < queue.length; i++) {\n var _a = queue[i], name_1 = _a.name, args = _a.args, resolve = _a.resolve;\n var fn = instance && instance[name_1];\n if (typeof fn === "function") {\n var result = fn.apply(instance, args);\n if (typeof resolve === "function") {\n resolve(result === null || result === void 0 ? void 0 : result.promise);\n }\n }\n }\n return instance;\n };\n var isInstanceProxy = function(instance) {\n var instanceProxy = instance;\n return instanceProxy && instanceProxy._q !== void 0;\n };\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js\n var AmplitudeBrowser = (\n /** @class */\n (function(_super) {\n __extends(AmplitudeBrowser2, _super);\n function AmplitudeBrowser2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AmplitudeBrowser2.prototype.init = function(apiKey, userId, options) {\n if (apiKey === void 0) {\n apiKey = "";\n }\n return returnWrapper(this._init(__assign(__assign({}, options), { userId, apiKey })));\n };\n AmplitudeBrowser2.prototype._init = function(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _r, _s, _t, _u, _v, _w;\n return __awaiter(this, void 0, void 0, function() {\n var _x, _y, _z, legacyCookies, cookieStorage, previousCookies, queryParams, deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, browserOptions, isNewSession, connector, webAttribution, pageViewTrackingOptions;\n var _this = this;\n return __generator(this, function(_0) {\n switch (_0.label) {\n case 0:\n if (this.initializing) {\n return [\n 2\n /*return*/\n ];\n }\n this.initializing = true;\n _x = options;\n if (!options.disableCookies) return [3, 1];\n _y = "";\n return [3, 5];\n case 1:\n if (!((_a = options.domain) !== null && _a !== void 0)) return [3, 2];\n _z = _a;\n return [3, 4];\n case 2:\n return [4, getTopLevelDomain()];\n case 3:\n _z = _0.sent();\n _0.label = 4;\n case 4:\n _y = _z;\n _0.label = 5;\n case 5:\n _x.domain = _y;\n return [4, parseLegacyCookies(options.apiKey, options)];\n case 6:\n legacyCookies = _0.sent();\n return [4, createCookieStorage(options)];\n case 7:\n cookieStorage = _0.sent();\n return [4, cookieStorage.get(getCookieName(options.apiKey))];\n case 8:\n previousCookies = _0.sent();\n queryParams = getQueryParams();\n deviceId = (_d = (_c = (_b = options.deviceId) !== null && _b !== void 0 ? _b : queryParams.deviceId) !== null && _c !== void 0 ? _c : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _d !== void 0 ? _d : legacyCookies.deviceId;\n sessionId = (_e = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.sessionId) !== null && _e !== void 0 ? _e : legacyCookies.sessionId;\n optOut = (_g = (_f = options.optOut) !== null && _f !== void 0 ? _f : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.optOut) !== null && _g !== void 0 ? _g : legacyCookies.optOut;\n lastEventId = (_h = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventId) !== null && _h !== void 0 ? _h : legacyCookies.lastEventId;\n lastEventTime = (_j = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.lastEventTime) !== null && _j !== void 0 ? _j : legacyCookies.lastEventTime;\n userId = (_l = (_k = options.userId) !== null && _k !== void 0 ? _k : previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _l !== void 0 ? _l : legacyCookies.userId;\n this.previousSessionDeviceId = (_m = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.deviceId) !== null && _m !== void 0 ? _m : legacyCookies.deviceId;\n this.previousSessionUserId = (_o = previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies.userId) !== null && _o !== void 0 ? _o : legacyCookies.userId;\n return [4, useBrowserConfig(options.apiKey, __assign(__assign({}, options), { deviceId, sessionId, optOut, lastEventId, lastEventTime, userId, cookieStorage }))];\n case 9:\n browserOptions = _0.sent();\n return [4, _super.prototype._init.call(this, browserOptions)];\n case 10:\n _0.sent();\n isNewSession = false;\n if (\n // user has never sent an event\n !this.config.lastEventTime || // user has no previous session ID\n !this.config.sessionId || // has sent an event and has previous session but expired\n this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout\n ) {\n this.setSessionId((_r = (_p = options.sessionId) !== null && _p !== void 0 ? _p : this.config.sessionId) !== null && _r !== void 0 ? _r : Date.now());\n isNewSession = true;\n }\n connector = getAnalyticsConnector(options.instanceName);\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId\n });\n return [4, this.add(new Destination()).promise];\n case 11:\n _0.sent();\n return [4, this.add(new Context()).promise];\n case 12:\n _0.sent();\n return [4, this.add(new IdentityEventSender()).promise];\n case 13:\n _0.sent();\n if (!isFileDownloadTrackingEnabled(this.config.defaultTracking)) return [3, 15];\n return [4, this.add(fileDownloadTracking()).promise];\n case 14:\n _0.sent();\n _0.label = 15;\n case 15:\n if (!isFormInteractionTrackingEnabled(this.config.defaultTracking)) return [3, 17];\n return [4, this.add(formInteractionTracking()).promise];\n case 16:\n _0.sent();\n _0.label = 17;\n case 17:\n if (!!((_s = this.config.attribution) === null || _s === void 0 ? void 0 : _s.disabled)) return [3, 19];\n webAttribution = webAttributionPlugin({\n excludeReferrers: (_t = this.config.attribution) === null || _t === void 0 ? void 0 : _t.excludeReferrers,\n initialEmptyValue: (_u = this.config.attribution) === null || _u === void 0 ? void 0 : _u.initialEmptyValue,\n resetSessionOnNewCampaign: (_v = this.config.attribution) === null || _v === void 0 ? void 0 : _v.resetSessionOnNewCampaign\n });\n webAttribution.__pluginEnabledOverride = isNewSession || ((_w = this.config.attribution) === null || _w === void 0 ? void 0 : _w.trackNewCampaigns) ? void 0 : false;\n return [4, this.add(webAttribution).promise];\n case 18:\n _0.sent();\n _0.label = 19;\n case 19:\n pageViewTrackingOptions = getPageViewTrackingConfig(this.config);\n pageViewTrackingOptions.eventType = pageViewTrackingOptions.eventType || DEFAULT_PAGE_VIEW_EVENT;\n return [4, this.add(pageViewTrackingPlugin(pageViewTrackingOptions)).promise];\n case 20:\n _0.sent();\n return [4, this.add(defaultPageViewEventEnrichment()).promise];\n case 21:\n _0.sent();\n this.initializing = false;\n return [4, this.runQueuedFunctions("dispatchQ")];\n case 22:\n _0.sent();\n connector.eventBridge.setEventReceiver(function(event) {\n void _this.track(event.eventType, event.eventProperties);\n });\n return [\n 2\n /*return*/\n ];\n }\n });\n });\n };\n AmplitudeBrowser2.prototype.getUserId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.userId;\n };\n AmplitudeBrowser2.prototype.setUserId = function(userId) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n if (userId !== this.config.userId || userId === void 0) {\n this.config.userId = userId;\n setConnectorUserId(userId, this.config.instanceName);\n }\n };\n AmplitudeBrowser2.prototype.getDeviceId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.deviceId;\n };\n AmplitudeBrowser2.prototype.setDeviceId = function(deviceId) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n setConnectorDeviceId(deviceId, this.config.instanceName);\n };\n AmplitudeBrowser2.prototype.setOptOut = function(optOut) {\n setConnectorOptOut(optOut, this.config.instanceName);\n _super.prototype.setOptOut.call(this, optOut);\n };\n AmplitudeBrowser2.prototype.reset = function() {\n this.setDeviceId(UUID());\n this.setUserId(void 0);\n };\n AmplitudeBrowser2.prototype.getSessionId = function() {\n var _a;\n return (_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionId;\n };\n AmplitudeBrowser2.prototype.setSessionId = function(sessionId) {\n var _a;\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n if (sessionId === this.config.sessionId) {\n return;\n }\n var previousSessionId = this.getSessionId();\n var lastEventTime = this.config.lastEventTime;\n var lastEventId = (_a = this.config.lastEventId) !== null && _a !== void 0 ? _a : -1;\n this.config.sessionId = sessionId;\n this.config.lastEventTime = void 0;\n if (isSessionTrackingEnabled(this.config.defaultTracking)) {\n if (previousSessionId && lastEventTime) {\n this.track(DEFAULT_SESSION_END_EVENT, void 0, {\n device_id: this.previousSessionDeviceId,\n event_id: ++lastEventId,\n session_id: previousSessionId,\n time: lastEventTime + 1,\n user_id: this.previousSessionUserId\n });\n }\n this.config.lastEventTime = this.config.sessionId;\n this.track(DEFAULT_SESSION_START_EVENT, void 0, {\n event_id: ++lastEventId,\n session_id: this.config.sessionId,\n time: this.config.lastEventTime\n });\n }\n this.previousSessionDeviceId = this.config.deviceId;\n this.previousSessionUserId = this.config.userId;\n };\n AmplitudeBrowser2.prototype.extendSession = function() {\n if (!this.config) {\n this.q.push(this.extendSession.bind(this));\n return;\n }\n this.config.lastEventTime = Date.now();\n };\n AmplitudeBrowser2.prototype.setTransport = function(transport) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n };\n AmplitudeBrowser2.prototype.identify = function(identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions === null || eventOptions === void 0 ? void 0 : eventOptions.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return _super.prototype.identify.call(this, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.groupIdentify = function(groupType, groupName, identify2, eventOptions) {\n if (isInstanceProxy(identify2)) {\n var queue = identify2._q;\n identify2._q = [];\n identify2 = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return _super.prototype.groupIdentify.call(this, groupType, groupName, identify2, eventOptions);\n };\n AmplitudeBrowser2.prototype.revenue = function(revenue2, eventOptions) {\n if (isInstanceProxy(revenue2)) {\n var queue = revenue2._q;\n revenue2._q = [];\n revenue2 = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return _super.prototype.revenue.call(this, revenue2, eventOptions);\n };\n AmplitudeBrowser2.prototype.process = function(event) {\n return __awaiter(this, void 0, void 0, function() {\n var currentTime, lastEventTime, timeSinceLastEvent;\n return __generator(this, function(_a) {\n currentTime = Date.now();\n lastEventTime = this.config.lastEventTime || Date.now();\n timeSinceLastEvent = currentTime - lastEventTime;\n if (event.event_type !== DEFAULT_SESSION_START_EVENT && event.event_type !== DEFAULT_SESSION_END_EVENT && (!event.session_id || event.session_id === this.getSessionId()) && timeSinceLastEvent > this.config.sessionTimeout) {\n this.setSessionId(currentTime);\n }\n return [2, _super.prototype.process.call(this, event)];\n });\n });\n };\n return AmplitudeBrowser2;\n })(AmplitudeCore)\n );\n\n // node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js\n var createInstance = function() {\n var client = new AmplitudeBrowser();\n return {\n init: debugWrapper(client.init.bind(client), "init", getClientLogConfig(client), getClientStates(client, ["config"])),\n add: debugWrapper(client.add.bind(client), "add", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n remove: debugWrapper(client.remove.bind(client), "remove", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.plugins"])),\n track: debugWrapper(client.track.bind(client), "track", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n logEvent: debugWrapper(client.logEvent.bind(client), "logEvent", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n identify: debugWrapper(client.identify.bind(client), "identify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n groupIdentify: debugWrapper(client.groupIdentify.bind(client), "groupIdentify", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n setGroup: debugWrapper(client.setGroup.bind(client), "setGroup", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n revenue: debugWrapper(client.revenue.bind(client), "revenue", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n flush: debugWrapper(client.flush.bind(client), "flush", getClientLogConfig(client), getClientStates(client, ["config.apiKey", "timeline.queue.length"])),\n getUserId: debugWrapper(client.getUserId.bind(client), "getUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n setUserId: debugWrapper(client.setUserId.bind(client), "setUserId", getClientLogConfig(client), getClientStates(client, ["config", "config.userId"])),\n getDeviceId: debugWrapper(client.getDeviceId.bind(client), "getDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n setDeviceId: debugWrapper(client.setDeviceId.bind(client), "setDeviceId", getClientLogConfig(client), getClientStates(client, ["config", "config.deviceId"])),\n reset: debugWrapper(client.reset.bind(client), "reset", getClientLogConfig(client), getClientStates(client, ["config", "config.userId", "config.deviceId"])),\n getSessionId: debugWrapper(client.getSessionId.bind(client), "getSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n setSessionId: debugWrapper(client.setSessionId.bind(client), "setSessionId", getClientLogConfig(client), getClientStates(client, ["config"])),\n extendSession: debugWrapper(client.extendSession.bind(client), "extendSession", getClientLogConfig(client), getClientStates(client, ["config"])),\n setOptOut: debugWrapper(client.setOptOut.bind(client), "setOptOut", getClientLogConfig(client), getClientStates(client, ["config"])),\n setTransport: debugWrapper(client.setTransport.bind(client), "setTransport", getClientLogConfig(client), getClientStates(client, ["config"]))\n };\n };\n var browser_client_factory_default = createInstance();\n\n // node_modules/@amplitude/analytics-browser/lib/esm/index.js\n var add = browser_client_factory_default.add;\n var extendSession = browser_client_factory_default.extendSession;\n var flush = browser_client_factory_default.flush;\n var getDeviceId = browser_client_factory_default.getDeviceId;\n var getSessionId = browser_client_factory_default.getSessionId;\n var getUserId = browser_client_factory_default.getUserId;\n var groupIdentify = browser_client_factory_default.groupIdentify;\n var identify = browser_client_factory_default.identify;\n var init = browser_client_factory_default.init;\n var logEvent = browser_client_factory_default.logEvent;\n var remove = browser_client_factory_default.remove;\n var reset = browser_client_factory_default.reset;\n var revenue = browser_client_factory_default.revenue;\n var setDeviceId = browser_client_factory_default.setDeviceId;\n var setGroup = browser_client_factory_default.setGroup;\n var setOptOut = browser_client_factory_default.setOptOut;\n var setSessionId = browser_client_factory_default.setSessionId;\n var setTransport = browser_client_factory_default.setTransport;\n var setUserId = browser_client_factory_default.setUserId;\n var track = browser_client_factory_default.track;\n\n // packages/dev-tools/client/tracking.ts\n var dispatch = (eventName) => {\n window.dispatchEvent(\n new CustomEvent(`builderdevtools`, { detail: { eventName } })\n );\n };\n async function loadUserDataFromLocal() {\n return apiLocalConfig();\n }\n var initTracking = async () => {\n const url = new URL(window.location.href);\n const hash = url.hash;\n const userIdHash = `#${CONNECTED_USER_ID_QS}=`;\n const uniqueId = Math.random().toString(36).substring(2, 15);\n const localConfig = await loadUserDataFromLocal();\n init("f1d2eb79aecd01b28c8a371ea5d1751c", localConfig?.userId || uniqueId, {\n logLevel: esm_exports.LogLevel.None,\n serverUrl: AMPLITUDE_PROXY_URL,\n flushIntervalMillis: 500\n });\n const identifyObj = new Identify();\n identify(identifyObj, {\n device_id: localConfig?.deviceId,\n user_id: localConfig?.userId || uniqueId\n });\n let builderUserId = `anonymous`;\n if (hash.startsWith(userIdHash)) {\n builderUserId = hash.slice(userIdHash.length);\n if (builderUserId) {\n setBuilderUserId(builderUserId);\n url.hash = "";\n window.history.replaceState({}, "", url.href);\n }\n }\n dispatch("init");\n };\n var setBuilderUserId = (builderUserId) => {\n if (typeof builderUserId === "string" && builderUserId.length > 0) {\n const t = getTracking();\n setTracking({\n ...t,\n builderUserId\n });\n }\n };\n var getTracking = () => {\n const ls = localStorage.getItem(TRACKING_KEY);\n if (ls) {\n try {\n let t = JSON.parse(ls);\n if (!t.ctas || typeof t.ctas !== "object") {\n t = setTracking({\n ...t,\n ctas: {}\n });\n }\n if (t.menuOpenedTs) {\n t = setTracking({\n ...t,\n ctas: {\n ...t.ctas,\n menuOpened: t.menuOpenedTs\n }\n });\n delete t.menuOpenedTs;\n }\n return t;\n } catch (e) {\n console.error(e);\n }\n }\n return setTracking({\n firstVisitTs: Date.now(),\n ctas: {},\n builderUserId: ""\n });\n };\n var setTracking = (t) => {\n try {\n localStorage.setItem(TRACKING_KEY, JSON.stringify(t));\n } catch (e) {\n console.error(e);\n }\n return t;\n };\n var hasCTA = (ctaName) => {\n const t = getTracking();\n return !!t.ctas[ctaName];\n };\n var setCTA = (ctaName) => {\n const t = getTracking();\n return setTracking({\n ...t,\n ctas: {\n ...t.ctas,\n [ctaName]: Date.now()\n }\n });\n };\n var TRACKING_KEY = "builderDevtools";\n\n // packages/dev-tools/client/menu/pages/component-input.ts\n function initComponentInputSection(shadow) {\n initRegisterInput(shadow);\n initComponentOpenSource(shadow);\n initComponentInputName(shadow);\n initComponentInputType(shadow);\n }\n function initRegisterInput(shadow) {\n const inputReg = shadow.getElementById("input-register");\n inputReg.addEventListener("change", async (ev) => {\n ev.stopPropagation();\n const inputName = shadow.getElementById("input-name");\n const nav = shadow.querySelector(".nav-cmp-input");\n nav.classList.add("input-loading");\n nav.classList.remove("input-enabled");\n const cmpId = inputName.dataset.id;\n const propName = inputName.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name: propName,\n registerInput: inputReg.checked\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentInput(shadow, cmpId, propName);\n renderComponentDetail(shadow, cmpId);\n nav.classList.remove("input-loading");\n });\n }\n function initComponentOpenSource(shadow) {\n const openSourceBtn = shadow.getElementById(\n "input-open-source"\n );\n openSourceBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmp = APP_STATE.components.find((c) => c.id === target?.dataset.id);\n if (cmp) {\n apiLaunchEditor({ filePath: cmp.filePath });\n }\n });\n }\n function initComponentInputName(shadow) {\n const inputName = shadow.getElementById("input-name");\n const inputWrapper = inputName.closest(".ui-text-input");\n let initInputName = "";\n let savedTmr;\n inputName.addEventListener("focus", (ev) => {\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n ev.stopPropagation();\n initInputName = inputName.value;\n });\n inputName.addEventListener("blur", async (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (inputName.value !== initInputName) {\n if (inputName.value.trim().length < 3) {\n inputName.value = initInputName;\n return;\n }\n inputWrapper.classList.add("saved");\n savedTmr = setTimeout(() => {\n inputWrapper.classList.remove("saved");\n }, 3e3);\n const cmpId = inputName.dataset.id;\n const name = inputName.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name,\n friendlyName: inputName.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n renderComponentInput(shadow, cmpId, name);\n }\n });\n inputName.addEventListener("keyup", (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (ev.key === "Escape") {\n inputName.value = initInputName;\n inputName.blur();\n } else if (ev.key === "Enter") {\n inputName.blur();\n }\n });\n }\n function initComponentInputType(shadow) {\n const inputType = shadow.getElementById("input-type");\n inputType.addEventListener("change", async (ev) => {\n ev.stopPropagation();\n const cmpId = inputType.dataset.id;\n const name = inputType.dataset.prop;\n const registry = await apiSetComponentInput({\n cmpId,\n name,\n type: inputType.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n renderComponentInput(shadow, cmpId, name);\n });\n }\n function renderComponentInput(shadow, cmpId, propName) {\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (!cmp) {\n return null;\n }\n const regInput = cmp.inputs.find((i) => i.name === propName);\n if (!regInput) {\n return null;\n }\n const nav = shadow.querySelector(".nav-cmp-input");\n if (regInput.isRegistered) {\n nav.classList.add("input-enabled");\n } else {\n nav.classList.remove("input-enabled");\n }\n const inputReg = shadow.getElementById("input-register");\n inputReg.checked = !!regInput.isRegistered;\n const title = shadow.getElementById("cmp-input-title");\n title.innerText = cmp.name + ": " + (regInput.friendlyName || regInput.name);\n const openSource = shadow.getElementById("input-open-source");\n openSource.innerText = `Open ${cmp.displayFilePath}`;\n openSource.dataset.id = cmp.id;\n const propNameText = shadow.getElementById("cmp-prop-name");\n propNameText.innerText = regInput.name;\n const propType = shadow.getElementById("cmp-prop-type");\n propType.innerText = getPrimitiveType(regInput.type);\n const inputName = shadow.getElementById("input-name");\n inputName.dataset.id = cmp.id;\n inputName.dataset.prop = regInput.name;\n inputName.value = regInput.friendlyName || regInput.name;\n renderInputTypeSelect(shadow, cmp, regInput);\n return regInput;\n }\n function renderInputTypeSelect(shadow, cmp, cmpInput) {\n const typeSelect = shadow.getElementById("input-type");\n typeSelect.dataset.id = cmp.id;\n typeSelect.dataset.prop = cmpInput.name;\n typeSelect.innerHTML = "";\n const inputType = cmpInput.type;\n const isString = STRING_TYPES.includes(inputType);\n const isNumber = NUMBER_TYPES.includes(inputType);\n const isBoolean = BOOLEAN_TYPES.includes(inputType);\n const isArray = ARRAY_TYPES.includes(inputType);\n const isObject = OBJECT_TYPES.includes(inputType);\n INPUT_TYPES.forEach((t) => {\n const option = document.createElement("option");\n option.value = t.value;\n option.innerText = t.text;\n option.disabled = STRING_TYPES.includes(t.value) && !isString || NUMBER_TYPES.includes(t.value) && !isNumber || BOOLEAN_TYPES.includes(t.value) && !isBoolean || ARRAY_TYPES.includes(t.value) && !isArray || OBJECT_TYPES.includes(t.value) && !isObject;\n typeSelect.appendChild(option);\n });\n typeSelect.value = inputType;\n }\n\n // packages/dev-tools/client/menu/pages/component-detail.ts\n function initComponentDetailSection(shadow) {\n initRegisterComponent(shadow);\n initComponentName(shadow);\n initComponentOpenSource2(shadow);\n initComponentInputList(shadow);\n initInputReload(shadow);\n }\n function initRegisterComponent(shadow) {\n const cmpReg = shadow.getElementById("cmp-register");\n cmpReg.addEventListener("change", (ev) => {\n ev.stopPropagation();\n loadComponentDetail(shadow, "update");\n });\n }\n async function loadComponentDetail(shadow, opt) {\n const cmpDetail = shadow.querySelector(".nav-cmp-detail");\n const cmpError = shadow.getElementById("cmp-error");\n const cmpReg = shadow.getElementById("cmp-register");\n const regSwitchLabel = cmpReg.closest(".ui-switch");\n cmpDetail.classList.remove("cmp-enabled");\n if (cmpReg.checked) {\n cmpDetail.classList.add("cmp-loading");\n }\n try {\n const cmpId = cmpReg.dataset.id;\n let registry;\n if (opt === "load") {\n registry = await apiLoadComponent({ cmpId });\n } else if (cmpReg.checked) {\n registry = await apiRegisterComponent({ cmpId });\n dispatch("registryUpdate");\n track("interaction", {\n type: "click",\n name: "register component",\n detail: cmpId\n });\n } else {\n registry = await apiUnregisterComponent({ cmpId });\n dispatch("registryUpdate");\n track("interaction", {\n type: "click",\n name: "unregister component",\n detail: cmpId\n });\n }\n updateAppState(registry);\n renderComponentList(shadow);\n const cmp = renderComponentDetail(shadow, cmpId);\n if (opt === "update" && cmp) {\n if (cmpReg.checked) {\n cmpDetail.classList.add("cmp-enabled");\n showToast(\n shadow,\n `<strong>${cmp.name}</strong> is now registered in <strong>${APP_STATE.registryDisplayPath}</strong> and available for use in the Builder Visual Editor`\n );\n } else {\n showToast(\n shadow,\n `<strong>${cmp.name}</strong> has been unregistered from <strong>${APP_STATE.registryDisplayPath}</strong> and removed from the Builder Visual Editor`\n );\n }\n }\n } catch (e) {\n console.error(e);\n cmpError.innerHTML = `<p class="error">Error loading components</p><p class="error">${e.message || e}</p>`;\n regSwitchLabel.style.display = "none";\n }\n cmpDetail.classList.remove("cmp-loading");\n }\n function initComponentName(shadow) {\n const cmpName = shadow.getElementById("cmp-name");\n const inputWrapper = cmpName.closest(".ui-text-input");\n let initComponentName2 = "";\n let savedTmr;\n cmpName.addEventListener("focus", (ev) => {\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n ev.stopPropagation();\n initComponentName2 = cmpName.value;\n });\n cmpName.addEventListener("blur", async (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (cmpName.value !== initComponentName2) {\n if (cmpName.value.trim().length < 3) {\n cmpName.value = initComponentName2;\n return;\n }\n inputWrapper.classList.add("saved");\n savedTmr = setTimeout(() => {\n inputWrapper.classList.remove("saved");\n }, 3e3);\n const cmpId = cmpName.dataset.id;\n const registry = await apiSetComponentInfo({\n cmpId,\n name: cmpName.value\n });\n dispatch("registryUpdate");\n updateAppState(registry);\n renderComponentList(shadow);\n renderComponentDetail(shadow, cmpId);\n }\n });\n cmpName.addEventListener("keyup", (ev) => {\n ev.stopPropagation();\n clearTimeout(savedTmr);\n inputWrapper.classList.remove("saved");\n if (ev.key === "Escape") {\n cmpName.value = initComponentName2;\n cmpName.blur();\n } else if (ev.key === "Enter") {\n cmpName.blur();\n }\n });\n }\n function renderComponentDetail(shadow, cmpId) {\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (!cmp) {\n return null;\n }\n const cmpReg = shadow.getElementById("cmp-register");\n const cmpError = shadow.getElementById("cmp-error");\n const regSwitchLabel = cmpReg.closest(".ui-switch");\n regSwitchLabel.style.display = "";\n cmpError.innerHTML = "";\n cmpReg.dataset.id = cmp.id;\n cmpReg.checked = !!cmp.isRegistered;\n const cmpDetail = shadow.querySelector(".nav-cmp-detail");\n if (cmp.isRegistered) {\n cmpDetail.classList.add("cmp-enabled");\n } else {\n cmpDetail.classList.remove("cmp-enabled");\n }\n const cmpName = shadow.getElementById("cmp-name");\n cmpName.dataset.id = cmp.id;\n cmpName.value = cmp.name;\n const openSource = shadow.getElementById("cmp-open-source");\n openSource.innerText = `Open ${cmp.displayFilePath}`;\n openSource.dataset.id = cmp.id;\n const title = shadow.getElementById("cmp-detail-title");\n title.innerText = `${cmp.name} Component`;\n renderComponentDetailInputs(shadow, cmp);\n return cmp;\n }\n function initComponentOpenSource2(shadow) {\n const openSourceBtn = shadow.getElementById(\n "cmp-open-source"\n );\n openSourceBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmp = APP_STATE.components.find((c) => c.id === target?.dataset.id);\n if (cmp) {\n apiLaunchEditor({ filePath: cmp.filePath });\n track("interaction", {\n type: "click",\n name: "open component source file",\n detail: cmp.filePath\n });\n }\n });\n }\n function initInputReload(shadow) {\n const reloadBtn = shadow.getElementById(\n "btn-inputs-reload"\n );\n reloadBtn.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n loadComponentDetail(shadow, "load");\n });\n }\n function initComponentInputList(shadow) {\n const cmpInputList = shadow.getElementById(\n "cmp-detail-inputs"\n );\n cmpInputList.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const button = target?.closest("button");\n const cmpId = button?.dataset.id;\n const propName = button?.dataset.propName;\n const cmpInput = renderComponentInput(shadow, cmpId, propName);\n if (cmpInput) {\n goToSection(shadow, "nav-cmp-input");\n }\n });\n }\n function renderComponentDetailInputs(shadow, cmp) {\n const cmpInputList = shadow.getElementById(\n "cmp-detail-inputs"\n );\n const filteredInputList = cmp.inputs.filter((input) => !input.hideFromUI);\n if (filteredInputList.length > 0) {\n cmpInputList.innerHTML = "";\n filteredInputList.forEach((input) => {\n cmpInputList.appendChild(renderComponentDetailInputItem(cmp, input));\n });\n } else {\n cmpInputList.innerHTML = `<p class="cmp-inputs-empty">${cmp.name} component does not have any props</p>`;\n }\n }\n function renderComponentDetailInputItem(cmp, cmpInput) {\n const item = document.createElement("button");\n item.dataset.id = cmp.id;\n item.dataset.propName = cmpInput.name;\n item.className = "cmp-input-item nav-list-item";\n if (!cmpInput.isRegistered) {\n item.classList.add("cmp-input-item-unregistered");\n }\n const itemIcon = document.createElement("span");\n const type = getPrimitiveType(cmpInput.type);\n itemIcon.className = `nav-list-item-icon input-icon input-icon-${type}`;\n item.appendChild(itemIcon);\n const itemName = document.createElement("span");\n itemName.innerText = cmpInput.friendlyName || cmpInput.name;\n item.appendChild(itemName);\n const itemNote = document.createElement("span");\n itemNote.className = "nav-list-item-note";\n itemNote.innerText = cmpInput.type;\n item.appendChild(itemNote);\n return item;\n }\n\n // packages/dev-tools/client/menu/pages/component-list.ts\n function initComponentListSection(shadow) {\n const openRegistryFile = shadow.getElementById("open-builder-registry");\n openRegistryFile.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n apiLaunchEditor({ filePath: APP_STATE.registryPath, line: 1, column: 1 });\n });\n const cmpList = shadow.getElementById("cmp-list");\n cmpList.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const target = ev.target;\n const cmpId = target?.dataset.id;\n const cmp = APP_STATE.components.find((c) => c.id === cmpId);\n if (cmp) {\n const cmpDetail = shadow.querySelector(\n ".nav-cmp-detail .section-content"\n );\n cmpDetail.scrollTop = 0;\n renderComponentDetail(shadow, cmp.id);\n goToSection(shadow, "nav-cmp-detail");\n if (cmp.isRegistered) {\n loadComponentDetail(shadow, "load");\n }\n }\n });\n const searchInput = shadow.getElementById(\n "component-search"\n );\n const clearSearchButton = shadow.getElementById(\n "clear-search"\n );\n searchInput?.addEventListener("input", (event) => {\n const searchTerm = event.target.value.toLowerCase();\n const filteredComponents = searchTerm ? APP_STATE.components.filter(\n (component) => component.name.toLowerCase().includes(searchTerm) || component.displayFilePath?.toLowerCase().includes(searchTerm)\n ) : APP_STATE.components;\n renderComponentList(shadow, filteredComponents);\n clearSearchButton.style.display = searchTerm ? "flex" : "none";\n });\n clearSearchButton?.addEventListener("click", () => {\n searchInput.value = "";\n renderComponentList(shadow);\n clearSearchButton.style.display = "none";\n });\n searchInput?.addEventListener("keydown", (event) => {\n if (event.key === "Escape") {\n searchInput.value = "";\n renderComponentList(shadow);\n clearSearchButton.style.display = "none";\n }\n });\n }\n function loadComponentsSection(shadow) {\n const loadRegistry = apiRegistry();\n renderComponents(shadow, loadRegistry);\n }\n async function renderComponents(shadow, loadRegistry) {\n const cmpList = shadow.getElementById("cmp-list");\n const cmpListSection = shadow.querySelector(".nav-cmp-list");\n cmpListSection.classList.add("nav-loading");\n const openRegistryFile = shadow.getElementById("open-builder-registry");\n try {\n const registry = await loadRegistry;\n updateAppState(registry);\n renderComponentList(shadow);\n if (APP_STATE.registryDisplayPath) {\n openRegistryFile.innerText = "Open " + registry.registryDisplayPath;\n } else {\n openRegistryFile.innerText = "";\n }\n } catch (e) {\n cmpList.innerHTML = `<p class="error">Error loading components</p><p class="error">${e.message || e}</p>`;\n console.error(e);\n }\n cmpListSection.classList.remove("nav-loading");\n }\n function renderComponentList(shadow, filteredComponents) {\n const cmpList = shadow.getElementById("cmp-list");\n cmpList.innerHTML = "";\n const componentsToRender = filteredComponents || APP_STATE.components;\n const registered = componentsToRender.filter((c) => c.isRegistered);\n const unregistered = componentsToRender.filter((c) => !c.isRegistered);\n if (filteredComponents && filteredComponents.length === 0) {\n const noResults = document.createElement("p");\n noResults.className = "no-results";\n noResults.innerText = "No matching components found";\n cmpList.appendChild(noResults);\n return;\n }\n renderComponentListSection(cmpList, "Registered Components", registered);\n renderComponentListSection(cmpList, "Unregistered Components", unregistered);\n }\n function renderComponentListSection(cmpList, listTitle, cmps) {\n if (cmps.length > 0) {\n const cmpsTitle = document.createElement("h4");\n cmpsTitle.innerText = listTitle;\n cmpList.appendChild(cmpsTitle);\n cmps.forEach((c) => {\n cmpList.appendChild(renderComponentListItem(c));\n });\n }\n }\n function renderComponentListItem(cmp) {\n const searchTerm = document.getElementById("component-search")?.value.toLowerCase();\n const item = document.createElement("button");\n item.dataset.id = cmp.id;\n item.className = "cmp-item nav-list-item";\n if (cmp.isRegistered) {\n item.classList.add("registered");\n }\n const itemIcon = document.createElement("span");\n itemIcon.className = "nav-list-item-icon";\n if (cmp.image) {\n itemIcon.style.backgroundImage = `url(${cmp.image})`;\n }\n item.appendChild(itemIcon);\n const itemName = document.createElement("span");\n itemName.className = "nav-list-item-name";\n itemName.innerHTML = highlightMatches(cmp.name, searchTerm);\n item.appendChild(itemName);\n const itemNote = document.createElement("span");\n itemNote.className = "nav-list-item-note";\n itemNote.innerHTML = highlightMatches(cmp.displayFilePath || "", searchTerm);\n item.appendChild(itemNote);\n return item;\n }\n function highlightMatches(text, searchTerm) {\n if (!searchTerm) return text;\n const regex = new RegExp(`(${searchTerm})`, "gi");\n return text.replace(regex, \'<span class="search-highlight">$1</span>\');\n }\n\n // packages/dev-tools/client/menu/toggle/menu-toggle.ts\n var initMenuToggle = (shadow) => {\n shadow.querySelector(".menu-toggle").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, true);\n });\n shadow.getElementById("close").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n });\n shadow.getElementById("hit").addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n });\n initBackButtons(shadow);\n shadow.addEventListener("click", (ev) => ev.stopPropagation());\n checkCTAs(shadow);\n };\n var openMenu = (shadow, openDevToolsMenu) => {\n if (openDevToolsMenu) {\n document.body.classList.add("builder-no-scroll");\n shadow.host.classList.add("show-builder-menu");\n dispatch("menuOpen");\n setCTA("menuOpened");\n track("interaction", {\n type: "click",\n name: "open dev-tools menu"\n });\n } else {\n document.body.classList.remove("builder-no-scroll");\n shadow.host.classList.remove("show-builder-menu");\n dispatch("menuClose");\n setTimeout(() => {\n goToSection(shadow, "nav-home");\n }, 300);\n }\n apiDevToolsEnabled(openDevToolsMenu);\n };\n var checkCTAs = (shadow) => {\n if (!hasCTA("menuOpened")) {\n menuToggleToolTipCta(shadow);\n return;\n }\n const t = getTracking();\n const minutesSinceFirstVisit = (Date.now() - t.firstVisitTs) / 1e3 / 60;\n if (minutesSinceFirstVisit < 10) {\n return;\n }\n if (!hasCTA("feedback")) {\n setCTA("feedback");\n feedbackToolTipCta(shadow);\n return;\n }\n };\n var menuToggleToolTipCta = (shadow) => {\n const tooltip = document.createElement("a");\n tooltip.classList.add("menu-toggle-tooltip");\n tooltip.href = `#open-dev-tools`;\n tooltip.innerHTML = `\n <div class="menu-toggle-tooltip-content">\n <h3>Open Builder Devtools</h3>\n <p>Start registering your components</p>\n </div>\n `;\n shadow.appendChild(tooltip);\n setTimeout(() => {\n tooltip.classList.add("menu-toggle-tooltip-show");\n tooltip.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n tooltip.classList.remove("menu-toggle-tooltip-show");\n openMenu(shadow, true);\n });\n }, 1e3);\n };\n var feedbackToolTipCta = (shadow) => {\n const tooltip = document.createElement("a");\n tooltip.classList.add("menu-toggle-tooltip");\n tooltip.href = `https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform`;\n tooltip.target = "_blank";\n tooltip.innerHTML = `\n <div class="menu-toggle-tooltip-content">\n <h3>How\'s Devtools working for you?</h3>\n <p>We\'d love your feedback!</p>\n </div>\n `;\n shadow.appendChild(tooltip);\n setTimeout(() => {\n tooltip.classList.add("menu-toggle-tooltip-show");\n tooltip.addEventListener("click", () => {\n tooltip.classList.remove("menu-toggle-tooltip-show");\n });\n }, 1e3);\n };\n\n // packages/dev-tools/client/menu/pages/home.ts\n function initHomeSection(shadow) {\n const goToBuilder = shadow.getElementById("go-to-builder");\n goToBuilder.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(getEditorUrl(), "builder");\n });\n const componentsLink = shadow.getElementById("components-link");\n componentsLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n const cmpList = shadow.querySelector(\n ".nav-cmp-list .section-content"\n );\n cmpList.scrollTop = 0;\n goToSection(shadow, "nav-cmp-list");\n loadComponentsSection(shadow);\n });\n const settingsLink = shadow.getElementById("settings-link");\n settingsLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n goToSection(shadow, "nav-settings");\n });\n const addPageLink = shadow.getElementById("add-page-link");\n addPageLink.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(getBuilderContentUrl(), "builder");\n });\n const importFromFigma = shadow.getElementById("import-from-figma");\n importFromFigma.addEventListener("click", (ev) => {\n ev.preventDefault();\n ev.stopPropagation();\n openMenu(shadow, false);\n window.open(\n "https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more"\n );\n });\n }\n\n // packages/dev-tools/client/menu/pages/settings.ts\n function initSettingsSection(shadow) {\n const s = shadow.getElementById("enable-edit");\n s.addEventListener("change", (ev) => {\n ev.stopPropagation();\n enableEdit(s.checked);\n });\n s.checked = isEditEnabled();\n enableEdit(s.checked);\n }\n\n // packages/dev-tools/client/menu/index.ts\n var BuilderDevToolsMenu = class extends HTMLElement {\n constructor() {\n super();\n }\n connectedCallback() {\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = `<style>/* packages/dev-tools/client/common.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n:host {\n --background-color: rgba(40, 40, 40, 1);\n --primary-color: rgba(72, 161, 255, 1);\n --primary-color-subdued: rgb(72, 161, 255, 0.6);\n --primary-color-highlight: rgb(126, 188, 255);\n --primary-contrast-color: white;\n --edit-color: #1d74e2;\n --edit-color-highlight: #1c6bd1;\n --edit-color-alpha: rgb(72, 161, 255, 0.15);\n --error-color: #ff2b55;\n --text-color: white;\n --text-color-highlight: white;\n --border-color: #454545;\n --button-background-color-hover: rgba(255, 255, 255, 0.1);\n --menu-width: 320px;\n --transition-time: 150ms;\n --font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n font-family: var(--font-family);\n line-height: 1.6;\n}\nbutton {\n cursor: pointer;\n color: var(--text-color);\n -webkit-tap-highlight-color: transparent;\n}\ninput,\nselect,\nbutton {\n font-family: var(--font-family);\n}\n\n/* packages/dev-tools/client/menu/toggle/menu-toggle.css */\n.menu-toggle {\n position: absolute;\n right: 0;\n bottom: 0;\n pointer-events: auto;\n padding: 8px;\n background: transparent;\n border: none;\n appearance: none;\n}\n.menu-toggle div {\n position: relative;\n width: 64px;\n height: 64px;\n pointer-events: none;\n border-radius: 50%;\n background: black;\n border: 1px solid white;\n box-shadow: rgba(0, 0, 0, 33%) 0px 0 8px;\n}\n.menu-toggle:hover div {\n background-color: var(--background-color);\n border: 1px solid rgb(220, 220, 220);\n}\n.menu-toggle svg {\n position: absolute;\n top: 15px;\n left: 15px;\n width: 33px;\n height: 32px;\n}\ndiv.highlight-bg {\n position: absolute;\n top: -1px;\n left: -1px;\n background-color: rgb(26, 26, 26);\n pointer-events: none;\n transition: all 400ms ease-out;\n opacity: 0;\n}\n.menu-toggle-highlight-no-transition div.highlight-bg {\n transition: none;\n}\n.menu-toggle-highlight div.highlight-bg {\n opacity: 1;\n}\n.menu-toggle-tooltip {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 382px;\n height: 72px;\n padding: 0;\n text-align: left;\n appearance: none;\n background-color: transparent;\n border: none;\n pointer-events: none;\n transform: translate3d(320px, 0, 0);\n opacity: 0;\n transition: all 150ms ease-in-out;\n color: white;\n}\n.menu-toggle-tooltip.menu-toggle-tooltip-show {\n pointer-events: auto;\n opacity: 1;\n transform: translate3d(0, 0, 0);\n}\n.menu-toggle-tooltip-content {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 10px;\n right: 95px;\n padding: 8px 12px;\n background-color: var(--primary-color);\n box-shadow: rgba(0, 0, 0, 33%) 0px 0 20px;\n border-radius: 2px;\n}\n.menu-toggle-tooltip-content::before {\n content: "";\n position: absolute;\n bottom: 15px;\n right: -6px;\n width: 30px;\n height: 30px;\n background-color: var(--primary-color);\n transform: rotate(45deg);\n}\n.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,\n.menu-toggle-tooltip:hover .menu-toggle-tooltip-content::before {\n background-color: var(--primary-color-highlight);\n}\n.menu-toggle-tooltip-content h3 {\n margin: 0;\n font-size: 16px;\n}\n.menu-toggle-tooltip-content p {\n margin: 0;\n font-size: 12px;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-page.css */\nsection {\n position: absolute;\n display: grid;\n grid-template-rows: 64px auto 64px;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n pointer-events: none;\n}\n.section-content {\n margin: 0;\n padding: 0 0 10px 0;\n font-weight: 300;\n transform: translate3d(105%, 0, 0);\n transition: transform var(--transition-time) ease-in-out;\n overflow-y: auto;\n}\n.section-content .error {\n color: var(--error-color);\n font-weight: bold;\n}\nsection a {\n text-decoration: none;\n color: var(--text-color);\n}\nsection h3,\nsection p {\n margin-left: 16px;\n margin-right: 16px;\n}\n.info {\n font-size: 12px;\n}\nul.list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\nul.list li {\n display: block;\n padding: 0;\n margin: 0;\n}\nul.list a,\nul.list button {\n display: grid;\n grid-template-columns: 24px auto;\n grid-gap: 16px;\n padding: 12px;\n margin: 8px 0;\n border: none;\n background: transparent;\n appearance: none;\n width: 100%;\n font-weight: 300;\n text-align: left;\n text-decoration: none;\n color: var(--text-color);\n}\nul.list a:hover,\nul.list button:hover {\n text-decoration: none;\n color: var(--text-color);\n background-color: var(--button-background-color-hover);\n}\nul.list a span,\nul.list button span {\n display: block;\n font-size: 16px;\n font-weight: 500;\n line-height: 1.5;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-header.css */\nheader {\n position: relative;\n display: grid;\n grid-template-columns: 44px 1fr;\n gap: 8px;\n padding-left: 8px;\n border-bottom: 1px solid var(--border-color);\n transition: opacity var(--transition-time) ease-in-out;\n opacity: 0;\n pointer-events: none;\n}\nheader > div {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.nav-home header > div {\n margin-right: 56px;\n}\nheader h2 {\n margin: 7px 0 0 0;\n font-size: 18px;\n font-weight: 500;\n line-height: 1.5;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p {\n margin: 2px 0 0 0;\n font-size: 12px;\n font-weight: 300;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p button {\n display: block;\n margin: 0;\n padding: 0;\n width: 100%;\n text-align: left;\n font-size: 12px;\n font-weight: 300;\n text-decoration: none;\n appearance: none;\n text-align: left;\n background-color: transparent;\n border: none;\n color: var(--primary-color);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\nheader p button:hover {\n text-decoration: underline;\n color: var(--primary-color);\n}\n.builder-logo {\n margin: 12px 0 0 8px;\n}\n#close {\n display: block;\n position: absolute;\n appearance: none;\n background: transparent;\n border: none;\n border-radius: 50%;\n margin: 0;\n padding: 0;\n right: 4px;\n top: 8px;\n width: 48px;\n height: 48px;\n z-index: 1;\n opacity: 0.7;\n}\n#close:hover {\n opacity: 1;\n background-color: var(--button-background-color-hover);\n}\n#close svg {\n position: absolute;\n top: 12px;\n left: 12px;\n width: 24px;\n height: 24px;\n fill: currentColor;\n pointer-events: none;\n}\n.back-button {\n position: relative;\n display: block;\n margin: 7px 0 0 -2px;\n width: 48px;\n height: 48px;\n background: transparent;\n border: none;\n appearance: none;\n border-radius: 50%;\n}\n.back-button:hover {\n background-color: var(--button-background-color-hover);\n}\n.back-button svg {\n position: absolute;\n top: 12px;\n left: 12px;\n width: 24px;\n height: 24px;\n fill: currentColor;\n pointer-events: none;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-footer.css */\nfooter {\n border-top: 1px solid var(--border-color);\n transition: opacity var(--transition-time) ease-in-out;\n opacity: 0;\n pointer-events: none;\n}\nsection.nav-cmp-list {\n grid-template-rows: 64px auto 120px;\n}\nfooter a {\n text-decoration: underline;\n color: var(--primary-color);\n}\nfooter a:hover {\n color: var(--primary-color);\n text-decoration: none;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-nav-list.css */\n.nav-list {\n padding: 2px 0;\n}\n.nav-loading {\n pointer-events: none;\n}\n.nav-loading-icon {\n position: absolute;\n display: inline-block;\n top: 170px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.nav-loading .nav-loading-icon {\n opacity: 0.5;\n}\n.nav-list h4 {\n margin: 8px 8px 8px 10px;\n font-size: 14px;\n font-weight: 600;\n}\n.nav-list .nav-list-item + h4 {\n margin-top: 30px;\n}\n.nav-list-item {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n position: relative;\n margin: 2px 0;\n padding: 8px 28px 8px 46px;\n width: 100%;\n font-size: 14px;\n font-weight: 300;\n text-align: left;\n border: none;\n background: transparent;\n appearance: none;\n}\n.nav-list-item:hover {\n background-color: var(--button-background-color-hover);\n}\n.nav-list-item-icon {\n position: absolute;\n top: 4px;\n left: 10px;\n width: 24px;\n height: 24px;\n object-fit: contain;\n filter: invert(100%);\n background-size: 24px 24px;\n background-repeat: no-repeat;\n background-position: center center;\n}\n.nav-list-item span {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n}\n.nav-list-item::after {\n display: block;\n position: absolute;\n content: "";\n background-image: url(\'data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>\');\n background-repeat: no-repeat;\n background-position: 12px 9px;\n top: 0;\n right: 0;\n width: 32px;\n height: 32px;\n pointer-events: none;\n}\n.nav-list-item-note {\n opacity: 0;\n font-size: 12px;\n padding-top: 1px;\n text-align: right;\n}\n.nav-list-item:hover .nav-list-item-note {\n opacity: 0.5;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-select.css */\n.ui-select {\n display: block;\n margin: 8px 0 16px 0;\n padding: 8px 16px 8px 16px;\n cursor: pointer;\n}\n.ui-select h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-select p {\n margin: 8px 0 8px 0;\n font-size: 12px;\n font-weight: 300;\n}\n.ui-select .select {\n position: relative;\n margin: 8px 0 8px 0;\n border-radius: 4px;\n padding: 0;\n line-height: 1.1;\n overflow: hidden;\n border: 1px solid var(--border-color);\n}\n.ui-select select {\n appearance: none;\n background-color: transparent;\n border: none;\n outline: none;\n padding: 8px 32px 8px 8px;\n margin: 0;\n width: 100%;\n font-size: 14px;\n cursor: pointer;\n text-overflow: ellipsis;\n opacity: 0.6;\n color: var(--text-color);\n}\n.ui-select .select::after {\n content: "";\n top: 6px;\n right: 5px;\n width: 24px;\n height: 24px;\n position: absolute;\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n opacity: 0.6;\n}\n.ui-select .select:hover {\n border-color: var(--primary-color-subdued);\n}\n.ui-text-input .select:focus-within {\n border-color: var(--primary-color);\n}\n.ui-text-input .select:focus-within select {\n opacity: 1;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-spinner.css */\n.spinner:after {\n content: " ";\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 auto;\n pointer-events: auto;\n border-radius: 50%;\n border: 3px solid var(--text-color);\n border-color: var(--text-color) transparent var(--text-color) transparent;\n animation: spinner 750ms linear infinite;\n}\n@keyframes spinner {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* packages/dev-tools/client/menu/ui/ui-switch.css */\n.ui-switch {\n display: grid;\n grid-template-columns: auto 48px;\n grid-gap: 20px;\n margin: 8px 0 16px 0;\n padding: 8px 0 8px 16px;\n cursor: pointer;\n}\n.ui-switch > * {\n pointer-events: none;\n}\n.ui-switch input {\n display: none;\n visibility: hidden;\n}\n.ui-switch .switcher {\n display: inline-block;\n border-radius: 100px;\n width: 35px;\n height: 14px;\n background-color: #ccc;\n position: relative;\n top: 6px;\n vertical-align: middle;\n cursor: pointer;\n}\n.ui-switch input[type=checkbox]:checked + .switcher {\n background-color: var(--primary-color-subdued);\n}\n.ui-switch .switcher:before {\n content: "";\n display: block;\n width: 20px;\n height: 20px;\n background-color: var(--text-color);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);\n border-radius: 50%;\n position: absolute;\n top: -3px;\n left: 0;\n margin-right: 0;\n transition: all 150ms;\n}\n.ui-switch input[type=checkbox]:checked + .switcher:before {\n left: 100%;\n margin-left: -20px;\n background-color: var(--primary-color);\n}\n.ui-switch h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-switch p {\n margin: 4px 0 0 0;\n font-size: 12px;\n font-weight: 300;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-text-input.css */\n.ui-text-input {\n display: block;\n margin: 8px 0 16px 0;\n padding: 8px 16px 8px 16px;\n cursor: pointer;\n}\n.ui-text-input h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.ui-text-input p {\n margin: 8px 0 8px 0;\n font-size: 12px;\n font-weight: 300;\n}\n.ui-text-input .input {\n position: relative;\n margin: 8px 0 8px 0;\n border: 1px solid var(--border-color);\n border-radius: 4px;\n background: transparent;\n padding: 2px;\n overflow: hidden;\n}\n.ui-text-input input {\n display: block;\n width: 235px;\n font-size: 14px;\n border: none;\n background: transparent;\n padding: 6px;\n appearance: none;\n color: var(--text-color);\n opacity: 0.6;\n outline: none;\n}\n.ui-text-input .input:hover {\n border-color: var(--primary-color-subdued);\n}\n.ui-text-input .input:focus-within {\n border-color: var(--primary-color);\n}\n.ui-text-input .input:focus-within input {\n opacity: 1;\n}\n.ui-text-input .input::after {\n content: "";\n position: absolute;\n top: 5px;\n right: 14px;\n width: 8px;\n height: 17px;\n border: 2px solid rgba(51, 181, 51, 1);\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n opacity: 0;\n transition: opacity 80ms ease-in-out;\n pointer-events: none;\n}\n.ui-text-input.saved .input::after {\n opacity: 1;\n}\n\n/* packages/dev-tools/client/menu/ui/ui-toast.css */\n.ui-toast {\n position: fixed;\n bottom: 8px;\n left: 8px;\n right: 8px;\n padding: 6px 12px;\n font-size: 14px;\n border-radius: 4px;\n transform: translate3d(0, 150%, 0);\n opacity: 0;\n transition: all var(--transition-time) ease-in-out;\n background-color: var(--primary-color-subdued);\n color: var(--text-color);\n pointer-events: none;\n}\n.ui-toast.ui-toast-show {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n pointer-events: auto;\n}\n\n/* packages/dev-tools/client/menu/nav.css */\n[data-view=nav-home] .nav-home .section-content,\n[data-view=nav-cmp-list] .nav-cmp-list .section-content,\n[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,\n[data-view=nav-cmp-input] .nav-cmp-input .section-content,\n[data-view=nav-settings] .nav-settings .section-content {\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n}\n[data-view=nav-home] .nav-home header,\n[data-view=nav-home] .nav-home footer,\n[data-view=nav-cmp-list] .nav-cmp-list header,\n[data-view=nav-cmp-list] .nav-cmp-list footer,\n[data-view=nav-cmp-detail] .nav-cmp-detail header,\n[data-view=nav-cmp-detail] .nav-cmp-detail footer,\n[data-view=nav-cmp-input] .nav-cmp-input header,\n[data-view=nav-cmp-input] .nav-cmp-input footer,\n[data-view=nav-settings] .nav-settings header,\n[data-view=nav-settings] .nav-settings footer {\n opacity: 1;\n pointer-events: auto;\n}\n[data-view=nav-cmp-list] .nav-home .section-content,\n[data-view=nav-cmp-detail] .nav-home .section-content,\n[data-view=nav-cmp-detail] .nav-cmp-list .section-content,\n[data-view=nav-cmp-input] .nav-home .section-content,\n[data-view=nav-cmp-input] .nav-cmp-list .section-content,\n[data-view=nav-cmp-input] .nav-cmp-detail .section-content,\n[data-view=nav-settings] .nav-home .section-content {\n transform: translate3d(-105%, 0, 0);\n}\n\n/* packages/dev-tools/client/menu/pages/component-list.css */\n.cmp-item .nav-list-item-icon {\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>\');\n opacity: 0.3;\n}\n.cmp-item.registered .nav-list-item-icon {\n background-image: url(\'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>\');\n opacity: 0.8;\n}\n.search-highlight {\n background-color: var(--primary-color-alpha);\n padding: 0 2px;\n border-radius: 2px;\n font-weight: 500;\n}\n.search-container {\n position: sticky;\n top: 0;\n z-index: 10;\n padding: 12px 16px;\n background: var(--background-color);\n border-bottom: 1px solid var(--border-color);\n}\n.search-input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n}\n.search-icon {\n position: absolute;\n left: 12px;\n color: var(--text-color-secondary);\n pointer-events: none;\n}\n.component-search-input {\n width: 100%;\n height: 36px;\n padding: 8px 36px;\n border: 1px solid var(--border-color);\n border-radius: 6px;\n background: var(--input-background);\n color: var(--text-color);\n font-size: 14px;\n transition: border-color 0.2s, box-shadow 0.2s;\n}\n.component-search-input:focus {\n outline: none;\n border-color: var(--primary-color);\n box-shadow: 0 0 0 2px var(--primary-color-alpha);\n}\n.component-search-input::placeholder {\n color: var(--text-color-tertiary);\n}\n.clear-search-button {\n position: absolute;\n right: 8px;\n padding: 4px;\n color: var(--text-color-secondary);\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.2s, background-color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.clear-search-button:hover {\n background-color: var(--hover-color);\n}\n.component-search-input:not(:placeholder-shown) + .clear-search-button {\n opacity: 1;\n}\n.no-results {\n padding: 32px 16px;\n text-align: center;\n color: var(--text-color-secondary);\n font-size: 14px;\n}\n\n/* packages/dev-tools/client/menu/pages/component-detail.css */\n#cmp-detail {\n position: relative;\n}\n.cmp-loading {\n pointer-events: none !important;\n}\n.cmp-loading-icon {\n position: absolute;\n display: inline-block;\n top: 170px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.cmp-loading .cmp-loading-icon {\n opacity: 0.5;\n}\n.cmp-cover {\n position: absolute;\n top: 160px;\n left: 0;\n width: 100%;\n height: 100vh;\n background: var(--background-color);\n transform: translate3d(0, 0, 0);\n pointer-events: none;\n display: none;\n}\n[data-view=nav-cmp-detail] .cmp-cover {\n display: block;\n pointer-events: auto;\n}\n.cmp-enabled .cmp-cover {\n transform: translate3d(0, 105%, 0);\n pointer-events: none;\n}\n.section-ready .cmp-cover {\n transition: all var(--transition-time) ease-in-out;\n}\n.cmp-detail-inputs-container {\n margin: 8px 0 16px 0;\n padding: 0;\n}\n.cmp-detail-inputs-container h3 {\n margin: 0 0 6px 0;\n padding-left: 16px;\n padding-right: 8px;\n font-size: 14px;\n font-weight: 500;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.cmp-detail-inputs-reload {\n font-weight: 300;\n font-size: 0.9em;\n text-decoration: none;\n appearance: none;\n text-align: left;\n background-color: transparent;\n border: none;\n color: var(--primary-color);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.cmp-detail-inputs-reload:hover {\n text-decoration: underline;\n color: var(--primary-color);\n}\n.cmp-detail-inputs-container .cmp-inputs-empty {\n padding: 0;\n margin-top: 12px;\n font-size: 12px;\n font-weight: 300;\n opacity: 0.5;\n font-style: italic;\n}\n.cmp-detail-inputs-container .nav-list-item-icon {\n opacity: 0.8;\n background-size: 20px 20px;\n background-position: 4px center;\n}\n.input-icon {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>\');\n}\n.input-icon-array {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>\');\n}\n.input-icon-boolean {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>\');\n}\n.input-icon-number {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>\');\n}\n.input-icon-object {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>\');\n}\n.input-icon-string {\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>\');\n}\n.cmp-input-item-unregistered {\n opacity: 0.4;\n}\n.cmp-input-item-unregistered .input-icon::after {\n content: "";\n position: absolute;\n top: 11px;\n left: 4px;\n width: 20px;\n height: 2px;\n background-color: black;\n transform: rotate(-45deg);\n}\n\n/* packages/dev-tools/client/menu/pages/component-input.css */\n.cmp-prop-info {\n border-bottom: 1px solid var(--border-color);\n}\n.cmp-input-readonly {\n margin: 16px 0;\n padding: 0 16px;\n display: grid;\n grid-template-columns: 50% 50%;\n gap: 12px;\n}\n.cmp-input-readonly h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n}\n.cmp-input-readonly span {\n margin-top: 2px;\n font-size: 12px;\n font-weight: 300;\n opacity: 0.8;\n}\n.cmp-input-detail {\n margin: 16px 0;\n}\n.cmp-input-detail a {\n color: var(--primary-color);\n text-decoration: none;\n}\n.cmp-input-detail a:hover {\n text-decoration: underline;\n}\n.input-cover {\n position: absolute;\n top: 175px;\n left: 0;\n width: 100%;\n height: 100%;\n background: var(--background-color);\n transform: translate3d(0, 0, 0);\n transition: all var(--transition-time) ease-in-out;\n pointer-events: auto;\n}\n.input-enabled .input-cover {\n transform: translate3d(0, 105%, 0);\n pointer-events: none;\n}\n.input-loading-icon {\n position: absolute;\n display: inline-block;\n top: 190px;\n left: 0;\n width: 100%;\n transform: translate3d(0, 0, 0);\n pointer-events: auto;\n opacity: 0;\n transition: all 50ms ease-in-out;\n transition-delay: 50ms;\n pointer-events: none;\n}\n.input-loading .input-loading-icon {\n opacity: 0.5;\n}\n\n/* packages/dev-tools/client/menu/menu.css */\n:host {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 2147483646;\n user-select: none;\n pointer-events: none;\n color: var(--text-color);\n}\naside {\n position: absolute;\n top: 0;\n right: 0;\n width: var(--menu-width);\n height: 100%;\n transform: translate3d(105%, 0, 0);\n transition: transform var(--transition-time) ease-in-out;\n background: var(--background-color);\n box-shadow: #000000c9 5px 0 20px;\n overflow: hidden;\n z-index: 1;\n}\n:host(.show-builder-menu) aside {\n pointer-events: auto;\n transform: translate3d(0, 0, 0);\n}\n#hit {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: none;\n}\n:host(.show-builder-menu) #hit {\n display: block;\n pointer-events: auto;\n}\n#version {\n position: absolute;\n bottom: 6px;\n right: 6px;\n font-size: 8px;\n color: #9b9b9b;\n}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder\'s selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder\'s Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder\'s Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>`;\n initMenuToggle(shadow);\n initHomeSection(shadow);\n initComponentListSection(shadow);\n initComponentDetailSection(shadow);\n initComponentInputSection(shadow);\n initSettingsSection(shadow);\n this.setAttribute("aria-hidden", "true");\n shadow.getElementById("version").textContent = "v1.18.40-dev.202512101047.78246177d";\n }\n highlightOpener() {\n const menuToggle = this.shadowRoot.querySelector(".menu-toggle");\n menuToggle.classList.add("menu-toggle-highlight");\n menuToggle.classList.add("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight-no-transition");\n setTimeout(() => {\n menuToggle.classList.remove("menu-toggle-highlight");\n }, 20);\n }, 20);\n }\n };\n\n // packages/dev-tools/client/setup-ui/overview.ts\n var STEP_CSS = `<style>/* packages/dev-tools/client/setup-ui/styles.css */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml,\nbody,\n:host {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n z-index: 2147483646;\n margin: 0;\n padding: 0;\n line-height: 1.8;\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n "Noto Sans",\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n background-color: rgba(37, 37, 37, 1);\n color: white;\n transition: opacity 250ms ease-in-out;\n}\n:host([aria-hidden="true"]) {\n opacity: 0;\n pointer-events: none;\n}\nmain {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n}\nh1 {\n margin-top: 0;\n font-size: 24px;\n font-weight: 300;\n line-height: 1.4;\n}\np {\n margin: 20px 0;\n font-weight: 300;\n}\nbutton {\n cursor: pointer;\n}\naside {\n position: absolute;\n top: 0;\n left: 0;\n width: 350px;\n height: 100vh;\n padding: 60px 0 0 50px;\n background-color: rgba(18, 18, 18, 1);\n}\naside ul {\n margin: 30px 0 0 0px;\n padding: 0;\n list-style: none;\n}\naside li {\n position: relative;\n margin: 0;\n padding: 20px 10px;\n font-weight: 300;\n}\naside li.highlight {\n color: rgba(72, 161, 255, 1);\n}\naside li.active {\n font-weight: 700;\n}\naside li .circle {\n position: absolute;\n top: 20px;\n left: 10px;\n width: 24px;\n height: 24px;\n border: 3px solid white;\n border-radius: 50%;\n font-size: 14px;\n}\naside li.highlight .circle {\n border-color: rgba(72, 161, 255, 1);\n}\naside li.active .circle::after {\n content: "";\n position: absolute;\n top: 3px;\n left: 3px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle {\n background-color: rgba(72, 161, 255, 1);\n}\naside li.completed .circle::after {\n content: "";\n position: absolute;\n top: 2px;\n left: 6px;\n width: 6px;\n height: 13px;\n border: 3px solid black;\n border-top: none;\n border-left: none;\n transform: rotate(45deg);\n}\naside li .line {\n position: absolute;\n top: 44px;\n left: 21px;\n width: 3px;\n height: 45px;\n background-color: white;\n}\naside li.completed .line {\n background-color: rgba(72, 161, 255, 1);\n}\naside li span {\n display: block;\n margin-left: 44px;\n}\nnav {\n margin-top: 30px;\n}\nsection {\n position: absolute;\n top: 135px;\n left: 350px;\n padding: 0 80px 0 140px;\n transition: opacity 150ms ease-in-out;\n}\nsection[aria-hidden=true] {\n pointer-events: none;\n opacity: 0;\n}\nsection h1,\nsection p {\n min-width: 300px;\n max-width: 600px;\n}\n.button {\n position: relative;\n display: inline-block;\n color: white;\n background-color: rgba(72, 161, 255, 1);\n border-radius: 4px;\n text-decoration: none;\n padding: 10px 40px 10px 20px;\n white-space: nowrap;\n}\n.button:hover {\n background-color: rgba(72, 161, 255, 0.85);\n}\n#button-icon {\n position: absolute;\n top: 1px;\n right: 5px;\n bottom: 0;\n width: 30px;\n background-image: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>\');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 24px 24px;\n}\n.button[aria-disabled=true] {\n opacity: 0.9;\n background-color: rgba(255, 255, 255, 0.3);\n pointer-events: none;\n padding-right: 60px;\n}\n.button[aria-disabled=true] #button-icon {\n top: 21px;\n right: 29px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background: white;\n color: white;\n animation: dot-flashing 0.5s infinite linear alternate;\n animation-delay: 0.25s;\n}\n.button[aria-disabled=true] #button-icon::before,\n.button[aria-disabled=true] #button-icon::after {\n content: "";\n display: inline-block;\n position: absolute;\n top: 0;\n}\n.button[aria-disabled=true] #button-icon::before {\n left: -12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0s;\n}\n.button[aria-disabled=true] #button-icon::after {\n left: 12px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: white;\n color: white;\n animation: dot-flashing 0.5s infinite alternate;\n animation-delay: 0.5s;\n}\n@keyframes dot-flashing {\n 0% {\n background-color: white;\n }\n 50%, 100% {\n background-color: rgba(255, 255, 255, 0.3);\n }\n}\n.logo {\n margin-left: 9px;\n background: url(\'data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>\');\n background-repeat: no-repeat;\n width: 150px;\n height: 32px;\n}\n@media (max-width: 840px) {\n aside {\n width: 250px;\n padding: 60px 0 0 20px;\n }\n section {\n left: 250px;\n padding: 0 80px;\n }\n}\n@media (max-width: 590px) {\n aside {\n width: 230px;\n padding: 60px 0 0 10px;\n }\n section {\n left: 230px;\n padding: 0 40px;\n }\n}\n#modified-files-message a {\n color: #cbcbcb;\n font-weight: 300;\n text-decoration: underline;\n}\n#modified-files-message a:hover {\n color: white;\n text-decoration: none;\n}\n#restart-warning {\n border-radius: 4px;\n padding: 8px 16px;\n border: 1px solid #fd6b3c;\n background: rgba(253, 107, 60, 0.1);\n}\n#react-router-steps {\n margin: 0px;\n margin-bottom: 5px;\n padding: 0px 20px;\n}\n#need-help {\n color: #48a1ff;\n text-decoration: none;\n}\n#router-message {\n border-radius: 4px;\n padding: 16px;\n border: 1px solid #48a1ff;\n}\n#router-finish-button {\n margin-top: 12px;\n}\n#router-checkbox-div {\n display: flex;\n align-items: center;\n}\n#router-checkbox {\n margin-right: 10px;\n width: 15px;\n height: 15px;\n}\n#success-title {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n#success-title .check-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 2px solid #28a745;\n border-radius: 50%;\n position: relative;\n}\n#success-title .check-icon::before {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 6px;\n height: 12px;\n border: solid #28a745;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -60%) rotate(45deg);\n}\n</style>`;\n var BuilderOverviewStep = class extends HTMLElement {\n constructor() {\n super();\n }\n connectedCallback() {\n const shadow = this.attachShadow({ mode: "open" });\n shadow.innerHTML = STEP_CSS + `<main>\n <aside>\n <div class="logo"></div>\n\n <ul>\n <li class="highlight active">\n <div class="circle"></div>\n <div class="line"></div>\n <span>Connect Builder.io</span>\n </li>\n <li>\n <div class="circle"></div>\n <div class="line"></div>\n <span>Update App</span>\n </li>\n <li>\n <div class="circle"></div>\n <span>Setup Complete</span>\n </li>\n </ul>\n </aside>\n\n <section>\n <h1>Integrate Builder.io with your project</h1>\n\n <p>\n First, let\'s connect to your Builder.io space to continue with the\n integration\n </p>\n\n <nav>\n <a class="button next-step" href="#">\n <span id="button-text">Get Started</span>\n <span id="button-icon"></span>\n </a>\n </nav>\n </section>\n</main>\n`;\n setBuilderHead();\n const authPath = new URL(BUILDER_AUTH_CONNECT_PATH, DEV_TOOLS_URL);\n authPath.searchParams.set(PREVIEW_URL_QS, location.href);\n const nextStepLinks = shadow.querySelectorAll(".next-step");\n for (const nextStepLink of nextStepLinks) {\n nextStepLink.setAttribute("href", authPath.href);\n }\n track("overview step viewed");\n }\n };\n var setBuilderHead = () => {\n let favicon = document.head.querySelector(\n "link[rel=\'icon\'], link[rel=\'icon shortcut\']"\n );\n if (favicon) {\n favicon.href = "https://cdn.builder.io/favicon.ico";\n favicon.removeAttribute("type");\n } else {\n favicon = document.createElement("link");\n favicon.rel = "icon";\n favicon.href = "https://cdn.builder.io/favicon.ico";\n document.head.appendChild(favicon);\n }\n };\n\n // packages/dev-tools/client/setup-ui/index.ts\n var checkBuilderIntegration = async () => {\n const validatedBuilder = await apiValidateBuilder();\n if (!validatedBuilder.isValid) {\n showOverviewStep();\n }\n };\n var showOverviewStep = () => {\n if (!customElements.get("builder-dev-tools-overview")) {\n customElements.define("builder-dev-tools-overview", BuilderOverviewStep);\n }\n let overview = document.querySelector(\n "builder-dev-tools-overview"\n );\n if (!overview) {\n overview = document.createElement(\n "builder-dev-tools-overview"\n );\n overview.setAttribute("aria-hidden", "true");\n document.body.appendChild(overview);\n }\n setTimeout(() => {\n overview.removeAttribute("aria-hidden");\n }, 32);\n };\n\n // packages/dev-tools/client/index.ts\n var initDevToolsApp = () => {\n try {\n if (!customElements.get("builder-dev-tools-edit")) {\n customElements.define(\n "builder-dev-tools-edit",\n BuilderDevToolsEditButton\n );\n }\n if (!customElements.get("builder-dev-tools-menu")) {\n customElements.define("builder-dev-tools-menu", BuilderDevToolsMenu);\n }\n let menu = document.querySelector("builder-dev-tools-menu");\n if (!menu) {\n menu = document.createElement("builder-dev-tools-menu");\n menu.setAttribute("data-version", "1.18.40-dev.202512101047.78246177d");\n document.body.appendChild(menu);\n }\n let editButton = document.querySelector("builder-dev-tools-edit");\n if (!editButton) {\n editButton = document.createElement("builder-dev-tools-edit");\n document.body.appendChild(editButton);\n }\n let builderStyles = document.getElementById("builder-dev-tools-style");\n if (!builderStyles) {\n builderStyles = document.createElement("style");\n builderStyles.id = "builder-dev-tools-style";\n builderStyles.innerHTML = `.builder-no-scroll{overflow:hidden !important}`;\n document.head.appendChild(builderStyles);\n }\n checkBuilderIntegration();\n initTracking();\n } catch (e) {\n console.error("Builder Devtools:", e);\n }\n };\n if (window.location === window.parent.location) {\n console.debug(`Builder.io Devtools v${"1.18.40-dev.202512101047.78246177d"}`);\n initDevToolsApp();\n }\n})();');
|
|
1424
1641
|
}
|
|
1425
1642
|
async function getConnectedStepHtml(ctx) {
|
|
1426
1643
|
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 +7071,11 @@ async function createNextDevToolsSys(sys2) {
|
|
|
6854
7071
|
addExternalPackage: (pkgName) => {
|
|
6855
7072
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
6856
7073
|
},
|
|
6857
|
-
readFileSync: (
|
|
6858
|
-
existsSync: (
|
|
6859
|
-
readdirSync: (
|
|
6860
|
-
const realFiles = sys2.readdirSync(
|
|
6861
|
-
if (
|
|
7074
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
7075
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
7076
|
+
readdirSync: (path3) => {
|
|
7077
|
+
const realFiles = sys2.readdirSync(path3);
|
|
7078
|
+
if (path3 === rootDir) {
|
|
6862
7079
|
return [
|
|
6863
7080
|
...realFiles,
|
|
6864
7081
|
...Object.keys(externalPackages).map(
|
|
@@ -6868,9 +7085,9 @@ async function createNextDevToolsSys(sys2) {
|
|
|
6868
7085
|
}
|
|
6869
7086
|
return realFiles;
|
|
6870
7087
|
},
|
|
6871
|
-
readdir: async (
|
|
6872
|
-
const realFiles = await sys2.readdir(
|
|
6873
|
-
if (
|
|
7088
|
+
readdir: async (path3) => {
|
|
7089
|
+
const realFiles = await sys2.readdir(path3);
|
|
7090
|
+
if (path3 === rootDir) {
|
|
6874
7091
|
return [
|
|
6875
7092
|
...realFiles,
|
|
6876
7093
|
...Object.keys(externalPackages).map(
|
|
@@ -8702,11 +8919,11 @@ async function createRemixDevToolsSys(sys2) {
|
|
|
8702
8919
|
addExternalPackage: (pkgName) => {
|
|
8703
8920
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
8704
8921
|
},
|
|
8705
|
-
readFileSync: (
|
|
8706
|
-
existsSync: (
|
|
8707
|
-
readdirSync: (
|
|
8708
|
-
const realFiles = sys2.readdirSync(
|
|
8709
|
-
if (
|
|
8922
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
8923
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
8924
|
+
readdirSync: (path3) => {
|
|
8925
|
+
const realFiles = sys2.readdirSync(path3);
|
|
8926
|
+
if (path3 === rootDir) {
|
|
8710
8927
|
return [
|
|
8711
8928
|
...realFiles,
|
|
8712
8929
|
...Object.keys(externalPackages).map(
|
|
@@ -8716,9 +8933,9 @@ async function createRemixDevToolsSys(sys2) {
|
|
|
8716
8933
|
}
|
|
8717
8934
|
return realFiles;
|
|
8718
8935
|
},
|
|
8719
|
-
readdir: async (
|
|
8720
|
-
const realFiles = await sys2.readdir(
|
|
8721
|
-
if (
|
|
8936
|
+
readdir: async (path3) => {
|
|
8937
|
+
const realFiles = await sys2.readdir(path3);
|
|
8938
|
+
if (path3 === rootDir) {
|
|
8722
8939
|
return [
|
|
8723
8940
|
...realFiles,
|
|
8724
8941
|
...Object.keys(externalPackages).map(
|
|
@@ -9902,11 +10119,11 @@ async function createReactDevToolsSys(sys2) {
|
|
|
9902
10119
|
addExternalPackage: (pkgName) => {
|
|
9903
10120
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
9904
10121
|
},
|
|
9905
|
-
readFileSync: (
|
|
9906
|
-
existsSync: (
|
|
9907
|
-
readdirSync: (
|
|
9908
|
-
const realFiles = sys2.readdirSync(
|
|
9909
|
-
if (
|
|
10122
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
10123
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
10124
|
+
readdirSync: (path3) => {
|
|
10125
|
+
const realFiles = sys2.readdirSync(path3);
|
|
10126
|
+
if (path3 === rootDir) {
|
|
9910
10127
|
return [
|
|
9911
10128
|
...realFiles,
|
|
9912
10129
|
...Object.keys(externalPackages).map(
|
|
@@ -9916,9 +10133,9 @@ async function createReactDevToolsSys(sys2) {
|
|
|
9916
10133
|
}
|
|
9917
10134
|
return realFiles;
|
|
9918
10135
|
},
|
|
9919
|
-
readdir: async (
|
|
9920
|
-
const realFiles = await sys2.readdir(
|
|
9921
|
-
if (
|
|
10136
|
+
readdir: async (path3) => {
|
|
10137
|
+
const realFiles = await sys2.readdir(path3);
|
|
10138
|
+
if (path3 === rootDir) {
|
|
9922
10139
|
return [
|
|
9923
10140
|
...realFiles,
|
|
9924
10141
|
...Object.keys(externalPackages).map(
|
|
@@ -10843,7 +11060,7 @@ var init_angular_app_module_imports = __esm({
|
|
|
10843
11060
|
});
|
|
10844
11061
|
|
|
10845
11062
|
// packages/dev-tools/core/adapters/angular/angular-app-routes-update.ts
|
|
10846
|
-
async function angularAddRoute(sys2,
|
|
11063
|
+
async function angularAddRoute(sys2, path3, componentName, componentPath) {
|
|
10847
11064
|
const fileExtension = sys2.typescriptEnabled ? ".ts" : ".js";
|
|
10848
11065
|
const fileName = `app.routes${fileExtension}`;
|
|
10849
11066
|
const appRoutesPath = sys2.join(sys2.appDir, fileName);
|
|
@@ -10856,11 +11073,11 @@ async function angularAddRoute(sys2, path2, componentName, componentPath) {
|
|
|
10856
11073
|
}
|
|
10857
11074
|
const exportKey = Object.keys(mod.exports)[0];
|
|
10858
11075
|
const routes = mod.exports[exportKey];
|
|
10859
|
-
if (routes.find((r) => r.path ===
|
|
11076
|
+
if (routes.find((r) => r.path === path3)) {
|
|
10860
11077
|
return;
|
|
10861
11078
|
}
|
|
10862
11079
|
const newEntry = sys2.magicast.builders.raw("{}");
|
|
10863
|
-
newEntry.path =
|
|
11080
|
+
newEntry.path = path3;
|
|
10864
11081
|
newEntry.component = sys2.magicast.builders.raw(componentName);
|
|
10865
11082
|
routes.push(newEntry);
|
|
10866
11083
|
if (mod.imports.$items.find((i) => i.imported === componentName)) {
|
|
@@ -12868,11 +13085,11 @@ async function createAngularDevToolsSys(sys2) {
|
|
|
12868
13085
|
addExternalPackage: (pkgName) => {
|
|
12869
13086
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
12870
13087
|
},
|
|
12871
|
-
readFileSync: (
|
|
12872
|
-
existsSync: (
|
|
12873
|
-
readdirSync: (
|
|
12874
|
-
const realFiles = sys2.readdirSync(
|
|
12875
|
-
if (
|
|
13088
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
13089
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
13090
|
+
readdirSync: (path3) => {
|
|
13091
|
+
const realFiles = sys2.readdirSync(path3);
|
|
13092
|
+
if (path3 === rootDir) {
|
|
12876
13093
|
return [
|
|
12877
13094
|
...realFiles,
|
|
12878
13095
|
...Object.keys(externalPackages).map(
|
|
@@ -12882,9 +13099,9 @@ async function createAngularDevToolsSys(sys2) {
|
|
|
12882
13099
|
}
|
|
12883
13100
|
return realFiles;
|
|
12884
13101
|
},
|
|
12885
|
-
readdir: async (
|
|
12886
|
-
const realFiles = await sys2.readdir(
|
|
12887
|
-
if (
|
|
13102
|
+
readdir: async (path3) => {
|
|
13103
|
+
const realFiles = await sys2.readdir(path3);
|
|
13104
|
+
if (path3 === rootDir) {
|
|
12888
13105
|
return [
|
|
12889
13106
|
...realFiles,
|
|
12890
13107
|
...Object.keys(externalPackages).map(
|
|
@@ -13489,11 +13706,11 @@ async function createVueDevToolsSys(sys2) {
|
|
|
13489
13706
|
addExternalPackage: (pkgName) => {
|
|
13490
13707
|
externalPackages[sys2.join(rootDir, pkgName, "index.ts")] = `export * from "${pkgName}";`;
|
|
13491
13708
|
},
|
|
13492
|
-
readFileSync: (
|
|
13493
|
-
existsSync: (
|
|
13494
|
-
readdirSync: (
|
|
13495
|
-
const realFiles = sys2.readdirSync(
|
|
13496
|
-
if (
|
|
13709
|
+
readFileSync: (path3) => externalPackages[path3] ?? sys2.readFileSync(path3),
|
|
13710
|
+
existsSync: (path3) => !!externalPackages[path3] || sys2.existsSync(path3),
|
|
13711
|
+
readdirSync: (path3) => {
|
|
13712
|
+
const realFiles = sys2.readdirSync(path3);
|
|
13713
|
+
if (path3 === rootDir) {
|
|
13497
13714
|
return [
|
|
13498
13715
|
...realFiles,
|
|
13499
13716
|
...Object.keys(externalPackages).map(
|
|
@@ -13503,9 +13720,9 @@ async function createVueDevToolsSys(sys2) {
|
|
|
13503
13720
|
}
|
|
13504
13721
|
return realFiles;
|
|
13505
13722
|
},
|
|
13506
|
-
readdir: async (
|
|
13507
|
-
const realFiles = await sys2.readdir(
|
|
13508
|
-
if (
|
|
13723
|
+
readdir: async (path3) => {
|
|
13724
|
+
const realFiles = await sys2.readdir(path3);
|
|
13725
|
+
if (path3 === rootDir) {
|
|
13509
13726
|
return [
|
|
13510
13727
|
...realFiles,
|
|
13511
13728
|
...Object.keys(externalPackages).map(
|
|
@@ -15783,11 +16000,11 @@ var init_lib = __esm({
|
|
|
15783
16000
|
}
|
|
15784
16001
|
}
|
|
15785
16002
|
},
|
|
15786
|
-
addToPath: function addToPath(
|
|
15787
|
-
var last =
|
|
16003
|
+
addToPath: function addToPath(path3, added, removed, oldPosInc) {
|
|
16004
|
+
var last = path3.lastComponent;
|
|
15788
16005
|
if (last && last.added === added && last.removed === removed) {
|
|
15789
16006
|
return {
|
|
15790
|
-
oldPos:
|
|
16007
|
+
oldPos: path3.oldPos + oldPosInc,
|
|
15791
16008
|
lastComponent: {
|
|
15792
16009
|
count: last.count + 1,
|
|
15793
16010
|
added,
|
|
@@ -15797,7 +16014,7 @@ var init_lib = __esm({
|
|
|
15797
16014
|
};
|
|
15798
16015
|
} else {
|
|
15799
16016
|
return {
|
|
15800
|
-
oldPos:
|
|
16017
|
+
oldPos: path3.oldPos + oldPosInc,
|
|
15801
16018
|
lastComponent: {
|
|
15802
16019
|
count: 1,
|
|
15803
16020
|
added,
|
|
@@ -15845,7 +16062,7 @@ var init_lib = __esm({
|
|
|
15845
16062
|
tokenize: function tokenize(value) {
|
|
15846
16063
|
return value.split("");
|
|
15847
16064
|
},
|
|
15848
|
-
join: function
|
|
16065
|
+
join: function join2(chars) {
|
|
15849
16066
|
return chars.join("");
|
|
15850
16067
|
}
|
|
15851
16068
|
};
|
|
@@ -17483,7 +17700,7 @@ var require_braces = __commonJS({
|
|
|
17483
17700
|
var require_constants2 = __commonJS({
|
|
17484
17701
|
"node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
17485
17702
|
"use strict";
|
|
17486
|
-
var
|
|
17703
|
+
var path3 = __require("path");
|
|
17487
17704
|
var WIN_SLASH = "\\\\/";
|
|
17488
17705
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
17489
17706
|
var DOT_LITERAL = "\\.";
|
|
@@ -17653,7 +17870,7 @@ var require_constants2 = __commonJS({
|
|
|
17653
17870
|
/* | */
|
|
17654
17871
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
17655
17872
|
/* \uFEFF */
|
|
17656
|
-
SEP:
|
|
17873
|
+
SEP: path3.sep,
|
|
17657
17874
|
/**
|
|
17658
17875
|
* Create EXTGLOB_CHARS
|
|
17659
17876
|
*/
|
|
@@ -17680,7 +17897,7 @@ var require_constants2 = __commonJS({
|
|
|
17680
17897
|
var require_utils2 = __commonJS({
|
|
17681
17898
|
"node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports) {
|
|
17682
17899
|
"use strict";
|
|
17683
|
-
var
|
|
17900
|
+
var path3 = __require("path");
|
|
17684
17901
|
var win32 = process.platform === "win32";
|
|
17685
17902
|
var {
|
|
17686
17903
|
REGEX_BACKSLASH,
|
|
@@ -17709,7 +17926,7 @@ var require_utils2 = __commonJS({
|
|
|
17709
17926
|
if (options && typeof options.windows === "boolean") {
|
|
17710
17927
|
return options.windows;
|
|
17711
17928
|
}
|
|
17712
|
-
return win32 === true ||
|
|
17929
|
+
return win32 === true || path3.sep === "\\";
|
|
17713
17930
|
};
|
|
17714
17931
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
17715
17932
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -18844,7 +19061,7 @@ var require_parse3 = __commonJS({
|
|
|
18844
19061
|
var require_picomatch = __commonJS({
|
|
18845
19062
|
"node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
18846
19063
|
"use strict";
|
|
18847
|
-
var
|
|
19064
|
+
var path3 = __require("path");
|
|
18848
19065
|
var scan = require_scan();
|
|
18849
19066
|
var parse = require_parse3();
|
|
18850
19067
|
var utils = require_utils2();
|
|
@@ -18929,7 +19146,7 @@ var require_picomatch = __commonJS({
|
|
|
18929
19146
|
};
|
|
18930
19147
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
18931
19148
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
18932
|
-
return regex.test(
|
|
19149
|
+
return regex.test(path3.basename(input));
|
|
18933
19150
|
};
|
|
18934
19151
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
18935
19152
|
picomatch.parse = (pattern, options) => {
|
|
@@ -19221,342 +19438,6 @@ var init_port_detection = __esm({
|
|
|
19221
19438
|
}
|
|
19222
19439
|
});
|
|
19223
19440
|
|
|
19224
|
-
// node_modules/http-proxy-3/dist/lib/http-proxy/common.js
|
|
19225
|
-
var require_common = __commonJS({
|
|
19226
|
-
"node_modules/http-proxy-3/dist/lib/http-proxy/common.js"(exports) {
|
|
19227
|
-
"use strict";
|
|
19228
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19229
|
-
exports.isSSL = void 0;
|
|
19230
|
-
exports.setupOutgoing = setupOutgoing;
|
|
19231
|
-
exports.setupSocket = setupSocket;
|
|
19232
|
-
exports.getPort = getPort;
|
|
19233
|
-
exports.hasEncryptedConnection = hasEncryptedConnection;
|
|
19234
|
-
exports.urlJoin = urlJoin;
|
|
19235
|
-
exports.rewriteCookieProperty = rewriteCookieProperty;
|
|
19236
|
-
exports.toURL = toURL;
|
|
19237
|
-
var node_tls_1 = __require("node:tls");
|
|
19238
|
-
var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;
|
|
19239
|
-
exports.isSSL = /^https|wss/;
|
|
19240
|
-
var HEADER_BLACKLIST = "trailer";
|
|
19241
|
-
var HTTP2_HEADER_BLACKLIST = [
|
|
19242
|
-
":method",
|
|
19243
|
-
":path",
|
|
19244
|
-
":scheme",
|
|
19245
|
-
":authority"
|
|
19246
|
-
];
|
|
19247
|
-
function setupOutgoing(outgoing, options, req, forward) {
|
|
19248
|
-
const target = options[forward || "target"];
|
|
19249
|
-
outgoing.port = +(target.port ?? (target.protocol !== void 0 && exports.isSSL.test(target.protocol) ? 443 : 80));
|
|
19250
|
-
for (const e2 of [
|
|
19251
|
-
"host",
|
|
19252
|
-
"hostname",
|
|
19253
|
-
"socketPath",
|
|
19254
|
-
"pfx",
|
|
19255
|
-
"key",
|
|
19256
|
-
"passphrase",
|
|
19257
|
-
"cert",
|
|
19258
|
-
"ca",
|
|
19259
|
-
"ciphers",
|
|
19260
|
-
"secureProtocol"
|
|
19261
|
-
]) {
|
|
19262
|
-
outgoing[e2] = target[e2];
|
|
19263
|
-
}
|
|
19264
|
-
outgoing.method = options.method || req.method;
|
|
19265
|
-
outgoing.headers = { ...req.headers };
|
|
19266
|
-
if (options.headers) {
|
|
19267
|
-
outgoing.headers = { ...outgoing.headers, ...options.headers };
|
|
19268
|
-
}
|
|
19269
|
-
for (const header in outgoing.headers) {
|
|
19270
|
-
if (HEADER_BLACKLIST == header.toLowerCase()) {
|
|
19271
|
-
delete outgoing.headers[header];
|
|
19272
|
-
break;
|
|
19273
|
-
}
|
|
19274
|
-
}
|
|
19275
|
-
if (req.httpVersionMajor > 1) {
|
|
19276
|
-
for (const header of HTTP2_HEADER_BLACKLIST) {
|
|
19277
|
-
delete outgoing.headers[header];
|
|
19278
|
-
}
|
|
19279
|
-
}
|
|
19280
|
-
if (options.auth) {
|
|
19281
|
-
delete outgoing.headers.authorization;
|
|
19282
|
-
outgoing.auth = options.auth;
|
|
19283
|
-
}
|
|
19284
|
-
if (options.ca) {
|
|
19285
|
-
outgoing.ca = options.ca;
|
|
19286
|
-
}
|
|
19287
|
-
if (target.protocol !== void 0 && exports.isSSL.test(target.protocol)) {
|
|
19288
|
-
outgoing.rejectUnauthorized = typeof options.secure === "undefined" ? true : options.secure;
|
|
19289
|
-
}
|
|
19290
|
-
outgoing.agent = options.agent || false;
|
|
19291
|
-
outgoing.localAddress = options.localAddress;
|
|
19292
|
-
if (!outgoing.agent) {
|
|
19293
|
-
outgoing.headers = outgoing.headers || {};
|
|
19294
|
-
if (typeof outgoing.headers.connection !== "string" || !upgradeHeader.test(outgoing.headers.connection)) {
|
|
19295
|
-
outgoing.headers.connection = "close";
|
|
19296
|
-
}
|
|
19297
|
-
}
|
|
19298
|
-
const targetPath = target && options.prependPath !== false && "pathname" in target ? getPath(`${target.pathname}${target.search ?? ""}`) : "/";
|
|
19299
|
-
let outgoingPath = options.toProxy ? req.url : getPath(req.url);
|
|
19300
|
-
outgoingPath = !options.ignorePath ? outgoingPath : "";
|
|
19301
|
-
outgoing.path = urlJoin(targetPath, outgoingPath ?? "");
|
|
19302
|
-
if (options.changeOrigin) {
|
|
19303
|
-
outgoing.headers.host = target.protocol !== void 0 && required(outgoing.port, target.protocol) && !hasPort(outgoing.host) ? outgoing.host + ":" + outgoing.port : outgoing.host;
|
|
19304
|
-
}
|
|
19305
|
-
return outgoing;
|
|
19306
|
-
}
|
|
19307
|
-
function setupSocket(socket) {
|
|
19308
|
-
socket.setTimeout(0);
|
|
19309
|
-
socket.setNoDelay(true);
|
|
19310
|
-
socket.setKeepAlive(true, 0);
|
|
19311
|
-
return socket;
|
|
19312
|
-
}
|
|
19313
|
-
function getPort(req) {
|
|
19314
|
-
const res = req.headers.host ? req.headers.host.match(/:(\d+)/) : "";
|
|
19315
|
-
return res ? res[1] : hasEncryptedConnection(req) ? "443" : "80";
|
|
19316
|
-
}
|
|
19317
|
-
function hasEncryptedConnection(req) {
|
|
19318
|
-
const conn = req.connection;
|
|
19319
|
-
return conn instanceof node_tls_1.TLSSocket && conn.encrypted || Boolean(conn.pair);
|
|
19320
|
-
}
|
|
19321
|
-
function urlJoin(...args) {
|
|
19322
|
-
const queryParams = [];
|
|
19323
|
-
let queryParamRaw = "";
|
|
19324
|
-
args.forEach((url, index) => {
|
|
19325
|
-
const qpStart = url.indexOf("?");
|
|
19326
|
-
if (qpStart !== -1) {
|
|
19327
|
-
queryParams.push(url.substring(qpStart + 1));
|
|
19328
|
-
args[index] = url.substring(0, qpStart);
|
|
19329
|
-
}
|
|
19330
|
-
});
|
|
19331
|
-
queryParamRaw = queryParams.filter(Boolean).join("&");
|
|
19332
|
-
let retSegs = "";
|
|
19333
|
-
for (const seg of args) {
|
|
19334
|
-
if (!seg) {
|
|
19335
|
-
continue;
|
|
19336
|
-
}
|
|
19337
|
-
if (retSegs.endsWith("/")) {
|
|
19338
|
-
if (seg.startsWith("/")) {
|
|
19339
|
-
retSegs += seg.slice(1);
|
|
19340
|
-
} else {
|
|
19341
|
-
retSegs += seg;
|
|
19342
|
-
}
|
|
19343
|
-
} else {
|
|
19344
|
-
if (seg.startsWith("/")) {
|
|
19345
|
-
retSegs += seg;
|
|
19346
|
-
} else {
|
|
19347
|
-
retSegs += "/" + seg;
|
|
19348
|
-
}
|
|
19349
|
-
}
|
|
19350
|
-
}
|
|
19351
|
-
return queryParamRaw ? retSegs + "?" + queryParamRaw : retSegs;
|
|
19352
|
-
}
|
|
19353
|
-
function rewriteCookieProperty(header, config, property) {
|
|
19354
|
-
if (Array.isArray(header)) {
|
|
19355
|
-
return header.map((headerElement) => {
|
|
19356
|
-
return rewriteCookieProperty(headerElement, config, property);
|
|
19357
|
-
});
|
|
19358
|
-
}
|
|
19359
|
-
return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), (match, prefix, previousValue) => {
|
|
19360
|
-
let newValue;
|
|
19361
|
-
if (previousValue in config) {
|
|
19362
|
-
newValue = config[previousValue];
|
|
19363
|
-
} else if ("*" in config) {
|
|
19364
|
-
newValue = config["*"];
|
|
19365
|
-
} else {
|
|
19366
|
-
return match;
|
|
19367
|
-
}
|
|
19368
|
-
if (newValue) {
|
|
19369
|
-
return prefix + newValue;
|
|
19370
|
-
} else {
|
|
19371
|
-
return "";
|
|
19372
|
-
}
|
|
19373
|
-
});
|
|
19374
|
-
}
|
|
19375
|
-
function hasPort(host) {
|
|
19376
|
-
return !!~host.indexOf(":");
|
|
19377
|
-
}
|
|
19378
|
-
function getPath(url) {
|
|
19379
|
-
if (url === "" || url?.startsWith("?")) {
|
|
19380
|
-
return url;
|
|
19381
|
-
}
|
|
19382
|
-
const u2 = toURL(url);
|
|
19383
|
-
return `${u2.pathname ?? ""}${u2.search ?? ""}`;
|
|
19384
|
-
}
|
|
19385
|
-
function toURL(url) {
|
|
19386
|
-
if (url instanceof URL) {
|
|
19387
|
-
return url;
|
|
19388
|
-
} else if (typeof url === "object" && "href" in url && typeof url.href === "string") {
|
|
19389
|
-
url = url.href;
|
|
19390
|
-
}
|
|
19391
|
-
if (!url) {
|
|
19392
|
-
url = "";
|
|
19393
|
-
}
|
|
19394
|
-
if (typeof url != "string") {
|
|
19395
|
-
url = `${url}`;
|
|
19396
|
-
}
|
|
19397
|
-
if (url.startsWith("//")) {
|
|
19398
|
-
url = `http://base.invalid${url}`;
|
|
19399
|
-
}
|
|
19400
|
-
return new URL(url, "http://base.invalid");
|
|
19401
|
-
}
|
|
19402
|
-
function required(port, protocol) {
|
|
19403
|
-
protocol = protocol.split(":")[0];
|
|
19404
|
-
port = +port;
|
|
19405
|
-
if (!port)
|
|
19406
|
-
return false;
|
|
19407
|
-
switch (protocol) {
|
|
19408
|
-
case "http":
|
|
19409
|
-
case "ws":
|
|
19410
|
-
return port !== 80;
|
|
19411
|
-
case "https":
|
|
19412
|
-
case "wss":
|
|
19413
|
-
return port !== 443;
|
|
19414
|
-
}
|
|
19415
|
-
return port !== 0;
|
|
19416
|
-
}
|
|
19417
|
-
}
|
|
19418
|
-
});
|
|
19419
|
-
|
|
19420
|
-
// node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-outgoing.js
|
|
19421
|
-
var require_web_outgoing = __commonJS({
|
|
19422
|
-
"node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-outgoing.js"(exports) {
|
|
19423
|
-
"use strict";
|
|
19424
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
|
|
19425
|
-
if (k22 === void 0) k22 = k3;
|
|
19426
|
-
var desc = Object.getOwnPropertyDescriptor(m2, k3);
|
|
19427
|
-
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
19428
|
-
desc = { enumerable: true, get: function() {
|
|
19429
|
-
return m2[k3];
|
|
19430
|
-
} };
|
|
19431
|
-
}
|
|
19432
|
-
Object.defineProperty(o2, k22, desc);
|
|
19433
|
-
}) : (function(o2, m2, k3, k22) {
|
|
19434
|
-
if (k22 === void 0) k22 = k3;
|
|
19435
|
-
o2[k22] = m2[k3];
|
|
19436
|
-
}));
|
|
19437
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o2, v) {
|
|
19438
|
-
Object.defineProperty(o2, "default", { enumerable: true, value: v });
|
|
19439
|
-
}) : function(o2, v) {
|
|
19440
|
-
o2["default"] = v;
|
|
19441
|
-
});
|
|
19442
|
-
var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() {
|
|
19443
|
-
var ownKeys = function(o2) {
|
|
19444
|
-
ownKeys = Object.getOwnPropertyNames || function(o3) {
|
|
19445
|
-
var ar = [];
|
|
19446
|
-
for (var k3 in o3) if (Object.prototype.hasOwnProperty.call(o3, k3)) ar[ar.length] = k3;
|
|
19447
|
-
return ar;
|
|
19448
|
-
};
|
|
19449
|
-
return ownKeys(o2);
|
|
19450
|
-
};
|
|
19451
|
-
return function(mod) {
|
|
19452
|
-
if (mod && mod.__esModule) return mod;
|
|
19453
|
-
var result = {};
|
|
19454
|
-
if (mod != null) {
|
|
19455
|
-
for (var k3 = ownKeys(mod), i = 0; i < k3.length; i++) if (k3[i] !== "default") __createBinding(result, mod, k3[i]);
|
|
19456
|
-
}
|
|
19457
|
-
__setModuleDefault(result, mod);
|
|
19458
|
-
return result;
|
|
19459
|
-
};
|
|
19460
|
-
})();
|
|
19461
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19462
|
-
exports.OUTGOING_PASSES = void 0;
|
|
19463
|
-
exports.removeChunked = removeChunked;
|
|
19464
|
-
exports.setConnection = setConnection;
|
|
19465
|
-
exports.setRedirectHostRewrite = setRedirectHostRewrite;
|
|
19466
|
-
exports.writeHeaders = writeHeaders;
|
|
19467
|
-
exports.writeStatusCode = writeStatusCode;
|
|
19468
|
-
var common = __importStar(require_common());
|
|
19469
|
-
var redirectRegex = /^201|30(1|2|7|8)$/;
|
|
19470
|
-
function removeChunked(_req, _res, proxyRes) {
|
|
19471
|
-
delete proxyRes.headers["transfer-encoding"];
|
|
19472
|
-
}
|
|
19473
|
-
function setConnection(req, _res, proxyRes) {
|
|
19474
|
-
if (req.httpVersion === "1.0") {
|
|
19475
|
-
proxyRes.headers["connection"] = req.headers["connection"] || "close";
|
|
19476
|
-
} else if (req.httpVersion !== "2.0" && !proxyRes.headers["connection"]) {
|
|
19477
|
-
proxyRes.headers["connection"] = req.headers["connection"] || "keep-alive";
|
|
19478
|
-
}
|
|
19479
|
-
}
|
|
19480
|
-
function setRedirectHostRewrite(req, _res, proxyRes, options) {
|
|
19481
|
-
if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) && proxyRes.headers["location"] && redirectRegex.test(`${proxyRes.statusCode}`)) {
|
|
19482
|
-
const target = common.toURL(options.target);
|
|
19483
|
-
const location = proxyRes.headers["location"];
|
|
19484
|
-
if (typeof location != "string") {
|
|
19485
|
-
return;
|
|
19486
|
-
}
|
|
19487
|
-
const u2 = common.toURL(location);
|
|
19488
|
-
if (target.host != u2.host) {
|
|
19489
|
-
return;
|
|
19490
|
-
}
|
|
19491
|
-
if (options.hostRewrite) {
|
|
19492
|
-
u2.host = options.hostRewrite;
|
|
19493
|
-
} else if (options.autoRewrite) {
|
|
19494
|
-
u2.host = req.headers["host"] ?? "";
|
|
19495
|
-
}
|
|
19496
|
-
if (options.protocolRewrite) {
|
|
19497
|
-
u2.protocol = options.protocolRewrite;
|
|
19498
|
-
}
|
|
19499
|
-
proxyRes.headers["location"] = u2.toString();
|
|
19500
|
-
}
|
|
19501
|
-
}
|
|
19502
|
-
function writeHeaders(_req, res, proxyRes, options) {
|
|
19503
|
-
const rewriteCookieDomainConfig = typeof options.cookieDomainRewrite === "string" ? (
|
|
19504
|
-
// also test for ''
|
|
19505
|
-
{ "*": options.cookieDomainRewrite }
|
|
19506
|
-
) : options.cookieDomainRewrite;
|
|
19507
|
-
const rewriteCookiePathConfig = typeof options.cookiePathRewrite === "string" ? (
|
|
19508
|
-
// also test for ''
|
|
19509
|
-
{ "*": options.cookiePathRewrite }
|
|
19510
|
-
) : options.cookiePathRewrite;
|
|
19511
|
-
const preserveHeaderKeyCase = options.preserveHeaderKeyCase;
|
|
19512
|
-
const setHeader = (key, header) => {
|
|
19513
|
-
if (header == void 0) {
|
|
19514
|
-
return;
|
|
19515
|
-
}
|
|
19516
|
-
if (rewriteCookieDomainConfig && key.toLowerCase() === "set-cookie") {
|
|
19517
|
-
header = common.rewriteCookieProperty(header, rewriteCookieDomainConfig, "domain");
|
|
19518
|
-
}
|
|
19519
|
-
if (rewriteCookiePathConfig && key.toLowerCase() === "set-cookie") {
|
|
19520
|
-
header = common.rewriteCookieProperty(header, rewriteCookiePathConfig, "path");
|
|
19521
|
-
}
|
|
19522
|
-
res.setHeader(String(key).trim(), header);
|
|
19523
|
-
};
|
|
19524
|
-
let rawHeaderKeyMap;
|
|
19525
|
-
if (preserveHeaderKeyCase && proxyRes.rawHeaders != void 0) {
|
|
19526
|
-
rawHeaderKeyMap = {};
|
|
19527
|
-
for (let i = 0; i < proxyRes.rawHeaders.length; i += 2) {
|
|
19528
|
-
const key = proxyRes.rawHeaders[i];
|
|
19529
|
-
rawHeaderKeyMap[key.toLowerCase()] = key;
|
|
19530
|
-
}
|
|
19531
|
-
}
|
|
19532
|
-
for (const key0 in proxyRes.headers) {
|
|
19533
|
-
let key = key0;
|
|
19534
|
-
if (_req.httpVersionMajor > 1 && key === "connection") {
|
|
19535
|
-
continue;
|
|
19536
|
-
}
|
|
19537
|
-
const header = proxyRes.headers[key];
|
|
19538
|
-
if (preserveHeaderKeyCase && rawHeaderKeyMap) {
|
|
19539
|
-
key = rawHeaderKeyMap[key] ?? key;
|
|
19540
|
-
}
|
|
19541
|
-
setHeader(key, header);
|
|
19542
|
-
}
|
|
19543
|
-
}
|
|
19544
|
-
function writeStatusCode(_req, res, proxyRes) {
|
|
19545
|
-
res.statusCode = proxyRes.statusCode;
|
|
19546
|
-
if (proxyRes.statusMessage && _req.httpVersionMajor === 1) {
|
|
19547
|
-
res.statusMessage = proxyRes.statusMessage;
|
|
19548
|
-
}
|
|
19549
|
-
}
|
|
19550
|
-
exports.OUTGOING_PASSES = {
|
|
19551
|
-
removeChunked,
|
|
19552
|
-
setConnection,
|
|
19553
|
-
setRedirectHostRewrite,
|
|
19554
|
-
writeHeaders,
|
|
19555
|
-
writeStatusCode
|
|
19556
|
-
};
|
|
19557
|
-
}
|
|
19558
|
-
});
|
|
19559
|
-
|
|
19560
19441
|
// node_modules/ms/index.js
|
|
19561
19442
|
var require_ms = __commonJS({
|
|
19562
19443
|
"node_modules/ms/index.js"(exports, module) {
|
|
@@ -19674,7 +19555,7 @@ var require_ms = __commonJS({
|
|
|
19674
19555
|
});
|
|
19675
19556
|
|
|
19676
19557
|
// node_modules/debug/src/common.js
|
|
19677
|
-
var
|
|
19558
|
+
var require_common = __commonJS({
|
|
19678
19559
|
"node_modules/debug/src/common.js"(exports, module) {
|
|
19679
19560
|
function setup(env) {
|
|
19680
19561
|
createDebug.debug = createDebug;
|
|
@@ -20008,7 +19889,7 @@ var require_browser = __commonJS({
|
|
|
20008
19889
|
} catch (error) {
|
|
20009
19890
|
}
|
|
20010
19891
|
}
|
|
20011
|
-
module.exports =
|
|
19892
|
+
module.exports = require_common()(exports);
|
|
20012
19893
|
var { formatters } = module.exports;
|
|
20013
19894
|
formatters.j = function(v) {
|
|
20014
19895
|
try {
|
|
@@ -20296,7 +20177,7 @@ var require_node = __commonJS({
|
|
|
20296
20177
|
debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
20297
20178
|
}
|
|
20298
20179
|
}
|
|
20299
|
-
module.exports =
|
|
20180
|
+
module.exports = require_common()(exports);
|
|
20300
20181
|
var { formatters } = module.exports;
|
|
20301
20182
|
formatters.o = function(v) {
|
|
20302
20183
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -20836,6 +20717,354 @@ var require_follow_redirects = __commonJS({
|
|
|
20836
20717
|
}
|
|
20837
20718
|
});
|
|
20838
20719
|
|
|
20720
|
+
// node_modules/http-proxy-3/dist/lib/http-proxy/common.js
|
|
20721
|
+
var require_common2 = __commonJS({
|
|
20722
|
+
"node_modules/http-proxy-3/dist/lib/http-proxy/common.js"(exports) {
|
|
20723
|
+
"use strict";
|
|
20724
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20725
|
+
exports.isSSL = void 0;
|
|
20726
|
+
exports.setupOutgoing = setupOutgoing;
|
|
20727
|
+
exports.setupSocket = setupSocket;
|
|
20728
|
+
exports.getPort = getPort;
|
|
20729
|
+
exports.hasEncryptedConnection = hasEncryptedConnection;
|
|
20730
|
+
exports.urlJoin = urlJoin;
|
|
20731
|
+
exports.rewriteCookieProperty = rewriteCookieProperty;
|
|
20732
|
+
exports.toURL = toURL;
|
|
20733
|
+
var node_tls_1 = __require("node:tls");
|
|
20734
|
+
var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;
|
|
20735
|
+
exports.isSSL = /^https|wss/;
|
|
20736
|
+
var HEADER_BLACKLIST = "trailer";
|
|
20737
|
+
var HTTP2_HEADER_BLACKLIST = [
|
|
20738
|
+
":method",
|
|
20739
|
+
":path",
|
|
20740
|
+
":scheme",
|
|
20741
|
+
":authority",
|
|
20742
|
+
"connection",
|
|
20743
|
+
"keep-alive"
|
|
20744
|
+
];
|
|
20745
|
+
function setupOutgoing(outgoing, options, req, forward) {
|
|
20746
|
+
const target = options[forward || "target"];
|
|
20747
|
+
outgoing.port = +(target.port ?? (target.protocol !== void 0 && exports.isSSL.test(target.protocol) ? 443 : 80));
|
|
20748
|
+
for (const e2 of [
|
|
20749
|
+
"host",
|
|
20750
|
+
"hostname",
|
|
20751
|
+
"socketPath",
|
|
20752
|
+
"pfx",
|
|
20753
|
+
"key",
|
|
20754
|
+
"passphrase",
|
|
20755
|
+
"cert",
|
|
20756
|
+
"ca",
|
|
20757
|
+
"ciphers",
|
|
20758
|
+
"secureProtocol"
|
|
20759
|
+
]) {
|
|
20760
|
+
outgoing[e2] = target[e2];
|
|
20761
|
+
}
|
|
20762
|
+
outgoing.method = options.method || req.method;
|
|
20763
|
+
outgoing.headers = { ...req.headers };
|
|
20764
|
+
if (req.headers?.[":authority"]) {
|
|
20765
|
+
outgoing.headers.host = req.headers[":authority"];
|
|
20766
|
+
}
|
|
20767
|
+
if (options.headers) {
|
|
20768
|
+
outgoing.headers = { ...outgoing.headers, ...options.headers };
|
|
20769
|
+
}
|
|
20770
|
+
for (const header in outgoing.headers) {
|
|
20771
|
+
if (HEADER_BLACKLIST == header.toLowerCase()) {
|
|
20772
|
+
delete outgoing.headers[header];
|
|
20773
|
+
break;
|
|
20774
|
+
}
|
|
20775
|
+
}
|
|
20776
|
+
if (req.httpVersionMajor > 1) {
|
|
20777
|
+
for (const header of HTTP2_HEADER_BLACKLIST) {
|
|
20778
|
+
delete outgoing.headers[header];
|
|
20779
|
+
}
|
|
20780
|
+
}
|
|
20781
|
+
if (options.auth) {
|
|
20782
|
+
delete outgoing.headers.authorization;
|
|
20783
|
+
outgoing.auth = options.auth;
|
|
20784
|
+
}
|
|
20785
|
+
if (options.ca) {
|
|
20786
|
+
outgoing.ca = options.ca;
|
|
20787
|
+
}
|
|
20788
|
+
if (target.protocol !== void 0 && exports.isSSL.test(target.protocol)) {
|
|
20789
|
+
outgoing.rejectUnauthorized = typeof options.secure === "undefined" ? true : options.secure;
|
|
20790
|
+
}
|
|
20791
|
+
outgoing.agent = options.agent || false;
|
|
20792
|
+
outgoing.localAddress = options.localAddress;
|
|
20793
|
+
if (!outgoing.agent) {
|
|
20794
|
+
outgoing.headers = outgoing.headers || {};
|
|
20795
|
+
if (typeof outgoing.headers.connection !== "string" || !upgradeHeader.test(outgoing.headers.connection)) {
|
|
20796
|
+
outgoing.headers.connection = "close";
|
|
20797
|
+
}
|
|
20798
|
+
}
|
|
20799
|
+
const targetPath = target && options.prependPath !== false && "pathname" in target ? getPath(`${target.pathname}${target.search ?? ""}`) : "/";
|
|
20800
|
+
let outgoingPath = options.toProxy ? req.url : getPath(req.url);
|
|
20801
|
+
outgoingPath = !options.ignorePath ? outgoingPath : "";
|
|
20802
|
+
outgoing.path = urlJoin(targetPath, outgoingPath ?? "");
|
|
20803
|
+
if (options.changeOrigin) {
|
|
20804
|
+
outgoing.headers.host = target.protocol !== void 0 && required(outgoing.port, target.protocol) && !hasPort(outgoing.host) ? outgoing.host + ":" + outgoing.port : outgoing.host;
|
|
20805
|
+
}
|
|
20806
|
+
outgoing.url = "href" in target && target.href || (target.protocol === "https" ? "https" : "http") + "://" + outgoing.host + (outgoing.port ? ":" + outgoing.port : "");
|
|
20807
|
+
if (req.httpVersionMajor > 1) {
|
|
20808
|
+
for (const header of HTTP2_HEADER_BLACKLIST) {
|
|
20809
|
+
delete outgoing.headers[header];
|
|
20810
|
+
}
|
|
20811
|
+
}
|
|
20812
|
+
return outgoing;
|
|
20813
|
+
}
|
|
20814
|
+
function setupSocket(socket) {
|
|
20815
|
+
socket.setTimeout(0);
|
|
20816
|
+
socket.setNoDelay(true);
|
|
20817
|
+
socket.setKeepAlive(true, 0);
|
|
20818
|
+
return socket;
|
|
20819
|
+
}
|
|
20820
|
+
function getPort(req) {
|
|
20821
|
+
const hostHeader = req.headers[":authority"] || req.headers.host;
|
|
20822
|
+
const res = hostHeader ? hostHeader.match(/:(\d+)/) : "";
|
|
20823
|
+
return res ? res[1] : hasEncryptedConnection(req) ? "443" : "80";
|
|
20824
|
+
}
|
|
20825
|
+
function hasEncryptedConnection(req) {
|
|
20826
|
+
const conn = req.connection;
|
|
20827
|
+
return conn instanceof node_tls_1.TLSSocket && conn.encrypted || Boolean(conn.pair);
|
|
20828
|
+
}
|
|
20829
|
+
function urlJoin(...args) {
|
|
20830
|
+
const queryParams = [];
|
|
20831
|
+
let queryParamRaw = "";
|
|
20832
|
+
args.forEach((url, index) => {
|
|
20833
|
+
const qpStart = url.indexOf("?");
|
|
20834
|
+
if (qpStart !== -1) {
|
|
20835
|
+
queryParams.push(url.substring(qpStart + 1));
|
|
20836
|
+
args[index] = url.substring(0, qpStart);
|
|
20837
|
+
}
|
|
20838
|
+
});
|
|
20839
|
+
queryParamRaw = queryParams.filter(Boolean).join("&");
|
|
20840
|
+
let retSegs = "";
|
|
20841
|
+
for (const seg of args) {
|
|
20842
|
+
if (!seg) {
|
|
20843
|
+
continue;
|
|
20844
|
+
}
|
|
20845
|
+
if (retSegs.endsWith("/")) {
|
|
20846
|
+
if (seg.startsWith("/")) {
|
|
20847
|
+
retSegs += seg.slice(1);
|
|
20848
|
+
} else {
|
|
20849
|
+
retSegs += seg;
|
|
20850
|
+
}
|
|
20851
|
+
} else {
|
|
20852
|
+
if (seg.startsWith("/")) {
|
|
20853
|
+
retSegs += seg;
|
|
20854
|
+
} else {
|
|
20855
|
+
retSegs += "/" + seg;
|
|
20856
|
+
}
|
|
20857
|
+
}
|
|
20858
|
+
}
|
|
20859
|
+
return queryParamRaw ? retSegs + "?" + queryParamRaw : retSegs;
|
|
20860
|
+
}
|
|
20861
|
+
function rewriteCookieProperty(header, config, property) {
|
|
20862
|
+
if (Array.isArray(header)) {
|
|
20863
|
+
return header.map((headerElement) => {
|
|
20864
|
+
return rewriteCookieProperty(headerElement, config, property);
|
|
20865
|
+
});
|
|
20866
|
+
}
|
|
20867
|
+
return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), (match, prefix, previousValue) => {
|
|
20868
|
+
let newValue;
|
|
20869
|
+
if (previousValue in config) {
|
|
20870
|
+
newValue = config[previousValue];
|
|
20871
|
+
} else if ("*" in config) {
|
|
20872
|
+
newValue = config["*"];
|
|
20873
|
+
} else {
|
|
20874
|
+
return match;
|
|
20875
|
+
}
|
|
20876
|
+
if (newValue) {
|
|
20877
|
+
return prefix + newValue;
|
|
20878
|
+
} else {
|
|
20879
|
+
return "";
|
|
20880
|
+
}
|
|
20881
|
+
});
|
|
20882
|
+
}
|
|
20883
|
+
function hasPort(host) {
|
|
20884
|
+
return !!~host.indexOf(":");
|
|
20885
|
+
}
|
|
20886
|
+
function getPath(url) {
|
|
20887
|
+
if (url === "" || url?.startsWith("?")) {
|
|
20888
|
+
return url;
|
|
20889
|
+
}
|
|
20890
|
+
const u2 = toURL(url);
|
|
20891
|
+
return `${u2.pathname ?? ""}${u2.search ?? ""}`;
|
|
20892
|
+
}
|
|
20893
|
+
function toURL(url) {
|
|
20894
|
+
if (url instanceof URL) {
|
|
20895
|
+
return url;
|
|
20896
|
+
} else if (typeof url === "object" && "href" in url && typeof url.href === "string") {
|
|
20897
|
+
url = url.href;
|
|
20898
|
+
}
|
|
20899
|
+
if (!url) {
|
|
20900
|
+
url = "";
|
|
20901
|
+
}
|
|
20902
|
+
if (typeof url != "string") {
|
|
20903
|
+
url = `${url}`;
|
|
20904
|
+
}
|
|
20905
|
+
if (url.startsWith("//")) {
|
|
20906
|
+
url = `http://base.invalid${url}`;
|
|
20907
|
+
}
|
|
20908
|
+
return new URL(url, "http://base.invalid");
|
|
20909
|
+
}
|
|
20910
|
+
function required(port, protocol) {
|
|
20911
|
+
protocol = protocol.split(":")[0];
|
|
20912
|
+
port = +port;
|
|
20913
|
+
if (!port)
|
|
20914
|
+
return false;
|
|
20915
|
+
switch (protocol) {
|
|
20916
|
+
case "http":
|
|
20917
|
+
case "ws":
|
|
20918
|
+
return port !== 80;
|
|
20919
|
+
case "https":
|
|
20920
|
+
case "wss":
|
|
20921
|
+
return port !== 443;
|
|
20922
|
+
}
|
|
20923
|
+
return port !== 0;
|
|
20924
|
+
}
|
|
20925
|
+
}
|
|
20926
|
+
});
|
|
20927
|
+
|
|
20928
|
+
// node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-outgoing.js
|
|
20929
|
+
var require_web_outgoing = __commonJS({
|
|
20930
|
+
"node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-outgoing.js"(exports) {
|
|
20931
|
+
"use strict";
|
|
20932
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m2, k3, k22) {
|
|
20933
|
+
if (k22 === void 0) k22 = k3;
|
|
20934
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k3);
|
|
20935
|
+
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
20936
|
+
desc = { enumerable: true, get: function() {
|
|
20937
|
+
return m2[k3];
|
|
20938
|
+
} };
|
|
20939
|
+
}
|
|
20940
|
+
Object.defineProperty(o2, k22, desc);
|
|
20941
|
+
}) : (function(o2, m2, k3, k22) {
|
|
20942
|
+
if (k22 === void 0) k22 = k3;
|
|
20943
|
+
o2[k22] = m2[k3];
|
|
20944
|
+
}));
|
|
20945
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o2, v) {
|
|
20946
|
+
Object.defineProperty(o2, "default", { enumerable: true, value: v });
|
|
20947
|
+
}) : function(o2, v) {
|
|
20948
|
+
o2["default"] = v;
|
|
20949
|
+
});
|
|
20950
|
+
var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() {
|
|
20951
|
+
var ownKeys = function(o2) {
|
|
20952
|
+
ownKeys = Object.getOwnPropertyNames || function(o3) {
|
|
20953
|
+
var ar = [];
|
|
20954
|
+
for (var k3 in o3) if (Object.prototype.hasOwnProperty.call(o3, k3)) ar[ar.length] = k3;
|
|
20955
|
+
return ar;
|
|
20956
|
+
};
|
|
20957
|
+
return ownKeys(o2);
|
|
20958
|
+
};
|
|
20959
|
+
return function(mod) {
|
|
20960
|
+
if (mod && mod.__esModule) return mod;
|
|
20961
|
+
var result = {};
|
|
20962
|
+
if (mod != null) {
|
|
20963
|
+
for (var k3 = ownKeys(mod), i = 0; i < k3.length; i++) if (k3[i] !== "default") __createBinding(result, mod, k3[i]);
|
|
20964
|
+
}
|
|
20965
|
+
__setModuleDefault(result, mod);
|
|
20966
|
+
return result;
|
|
20967
|
+
};
|
|
20968
|
+
})();
|
|
20969
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20970
|
+
exports.OUTGOING_PASSES = void 0;
|
|
20971
|
+
exports.removeChunked = removeChunked;
|
|
20972
|
+
exports.setConnection = setConnection;
|
|
20973
|
+
exports.setRedirectHostRewrite = setRedirectHostRewrite;
|
|
20974
|
+
exports.writeHeaders = writeHeaders;
|
|
20975
|
+
exports.writeStatusCode = writeStatusCode;
|
|
20976
|
+
var common = __importStar(require_common2());
|
|
20977
|
+
var redirectRegex = /^201|30(1|2|7|8)$/;
|
|
20978
|
+
function removeChunked(_req, _res, proxyRes) {
|
|
20979
|
+
delete proxyRes.headers["transfer-encoding"];
|
|
20980
|
+
}
|
|
20981
|
+
function setConnection(req, _res, proxyRes) {
|
|
20982
|
+
if (req.httpVersion === "1.0") {
|
|
20983
|
+
proxyRes.headers["connection"] = req.headers["connection"] || "close";
|
|
20984
|
+
} else if (req.httpVersion !== "2.0" && !proxyRes.headers["connection"]) {
|
|
20985
|
+
proxyRes.headers["connection"] = req.headers["connection"] || "keep-alive";
|
|
20986
|
+
}
|
|
20987
|
+
}
|
|
20988
|
+
function setRedirectHostRewrite(req, _res, proxyRes, options) {
|
|
20989
|
+
if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) && proxyRes.headers["location"] && redirectRegex.test(`${proxyRes.statusCode}`)) {
|
|
20990
|
+
const target = common.toURL(options.target);
|
|
20991
|
+
const location = proxyRes.headers["location"];
|
|
20992
|
+
if (typeof location != "string") {
|
|
20993
|
+
return;
|
|
20994
|
+
}
|
|
20995
|
+
const u2 = common.toURL(location);
|
|
20996
|
+
if (target.host != u2.host) {
|
|
20997
|
+
return;
|
|
20998
|
+
}
|
|
20999
|
+
if (options.hostRewrite) {
|
|
21000
|
+
u2.host = options.hostRewrite;
|
|
21001
|
+
} else if (options.autoRewrite) {
|
|
21002
|
+
u2.host = req.headers[":authority"] ?? req.headers["host"] ?? "";
|
|
21003
|
+
}
|
|
21004
|
+
if (options.protocolRewrite) {
|
|
21005
|
+
u2.protocol = options.protocolRewrite;
|
|
21006
|
+
}
|
|
21007
|
+
proxyRes.headers["location"] = u2.toString();
|
|
21008
|
+
}
|
|
21009
|
+
}
|
|
21010
|
+
function writeHeaders(_req, res, proxyRes, options) {
|
|
21011
|
+
const rewriteCookieDomainConfig = typeof options.cookieDomainRewrite === "string" ? (
|
|
21012
|
+
// also test for ''
|
|
21013
|
+
{ "*": options.cookieDomainRewrite }
|
|
21014
|
+
) : options.cookieDomainRewrite;
|
|
21015
|
+
const rewriteCookiePathConfig = typeof options.cookiePathRewrite === "string" ? (
|
|
21016
|
+
// also test for ''
|
|
21017
|
+
{ "*": options.cookiePathRewrite }
|
|
21018
|
+
) : options.cookiePathRewrite;
|
|
21019
|
+
const preserveHeaderKeyCase = options.preserveHeaderKeyCase;
|
|
21020
|
+
const setHeader = (key, header) => {
|
|
21021
|
+
if (header == void 0) {
|
|
21022
|
+
return;
|
|
21023
|
+
}
|
|
21024
|
+
if (rewriteCookieDomainConfig && key.toLowerCase() === "set-cookie") {
|
|
21025
|
+
header = common.rewriteCookieProperty(header, rewriteCookieDomainConfig, "domain");
|
|
21026
|
+
}
|
|
21027
|
+
if (rewriteCookiePathConfig && key.toLowerCase() === "set-cookie") {
|
|
21028
|
+
header = common.rewriteCookieProperty(header, rewriteCookiePathConfig, "path");
|
|
21029
|
+
}
|
|
21030
|
+
res.setHeader(String(key).trim(), header);
|
|
21031
|
+
};
|
|
21032
|
+
let rawHeaderKeyMap;
|
|
21033
|
+
if (preserveHeaderKeyCase && proxyRes.rawHeaders != void 0) {
|
|
21034
|
+
rawHeaderKeyMap = {};
|
|
21035
|
+
for (let i = 0; i < proxyRes.rawHeaders.length; i += 2) {
|
|
21036
|
+
const key = proxyRes.rawHeaders[i];
|
|
21037
|
+
rawHeaderKeyMap[key.toLowerCase()] = key;
|
|
21038
|
+
}
|
|
21039
|
+
}
|
|
21040
|
+
for (const key0 in proxyRes.headers) {
|
|
21041
|
+
let key = key0;
|
|
21042
|
+
if (_req.httpVersionMajor > 1 && (key === "connection" || key === "keep-alive")) {
|
|
21043
|
+
continue;
|
|
21044
|
+
}
|
|
21045
|
+
const header = proxyRes.headers[key];
|
|
21046
|
+
if (preserveHeaderKeyCase && rawHeaderKeyMap) {
|
|
21047
|
+
key = rawHeaderKeyMap[key] ?? key;
|
|
21048
|
+
}
|
|
21049
|
+
setHeader(key, header);
|
|
21050
|
+
}
|
|
21051
|
+
}
|
|
21052
|
+
function writeStatusCode(_req, res, proxyRes) {
|
|
21053
|
+
res.statusCode = proxyRes.statusCode;
|
|
21054
|
+
if (proxyRes.statusMessage && _req.httpVersionMajor === 1) {
|
|
21055
|
+
res.statusMessage = proxyRes.statusMessage;
|
|
21056
|
+
}
|
|
21057
|
+
}
|
|
21058
|
+
exports.OUTGOING_PASSES = {
|
|
21059
|
+
removeChunked,
|
|
21060
|
+
setConnection,
|
|
21061
|
+
setRedirectHostRewrite,
|
|
21062
|
+
writeHeaders,
|
|
21063
|
+
writeStatusCode
|
|
21064
|
+
};
|
|
21065
|
+
}
|
|
21066
|
+
});
|
|
21067
|
+
|
|
20839
21068
|
// node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-incoming.js
|
|
20840
21069
|
var require_web_incoming = __commonJS({
|
|
20841
21070
|
"node_modules/http-proxy-3/dist/lib/http-proxy/passes/web-incoming.js"(exports) {
|
|
@@ -20885,9 +21114,10 @@ var require_web_incoming = __commonJS({
|
|
|
20885
21114
|
exports.stream = stream;
|
|
20886
21115
|
var http = __importStar(__require("node:http"));
|
|
20887
21116
|
var https = __importStar(__require("node:https"));
|
|
20888
|
-
var web_outgoing_1 = require_web_outgoing();
|
|
20889
|
-
var common = __importStar(require_common());
|
|
20890
21117
|
var followRedirects = __importStar(require_follow_redirects());
|
|
21118
|
+
var common = __importStar(require_common2());
|
|
21119
|
+
var web_outgoing_1 = require_web_outgoing();
|
|
21120
|
+
var node_stream_1 = __require("node:stream");
|
|
20891
21121
|
var web_o = Object.values(web_outgoing_1.OUTGOING_PASSES);
|
|
20892
21122
|
var nativeAgents = { http, https };
|
|
20893
21123
|
function deleteLength(req) {
|
|
@@ -20914,10 +21144,13 @@ var require_web_incoming = __commonJS({
|
|
|
20914
21144
|
for (const header of ["for", "port", "proto"]) {
|
|
20915
21145
|
req.headers["x-forwarded-" + header] = (req.headers["x-forwarded-" + header] || "") + (req.headers["x-forwarded-" + header] ? "," : "") + values[header];
|
|
20916
21146
|
}
|
|
20917
|
-
req.headers["x-forwarded-host"] = req.headers["x-forwarded-host"] || req.headers["host"] || "";
|
|
21147
|
+
req.headers["x-forwarded-host"] = req.headers["x-forwarded-host"] || req.headers[":authority"] || req.headers["host"] || "";
|
|
20918
21148
|
}
|
|
20919
21149
|
function stream(req, res, options, _3, server, cb) {
|
|
20920
21150
|
server.emit("start", req, res, options.target || options.forward);
|
|
21151
|
+
if (options.fetch || options.fetchOptions || process.env.FORCE_FETCH_PATH === "true") {
|
|
21152
|
+
return stream2(req, res, options, _3, server, cb);
|
|
21153
|
+
}
|
|
20921
21154
|
const agents = options.followRedirects ? followRedirects : nativeAgents;
|
|
20922
21155
|
const http2 = agents.http;
|
|
20923
21156
|
const https2 = agents.https;
|
|
@@ -20989,6 +21222,161 @@ var require_web_incoming = __commonJS({
|
|
|
20989
21222
|
}
|
|
20990
21223
|
});
|
|
20991
21224
|
}
|
|
21225
|
+
async function stream2(req, res, options, _3, server, cb) {
|
|
21226
|
+
const handleError = (err, target) => {
|
|
21227
|
+
const e2 = err;
|
|
21228
|
+
if (e2.code === void 0 && e2.cause?.code) {
|
|
21229
|
+
e2.code = e2.cause.code;
|
|
21230
|
+
}
|
|
21231
|
+
if (cb) {
|
|
21232
|
+
cb(err, req, res, target);
|
|
21233
|
+
} else {
|
|
21234
|
+
server.emit("error", err, req, res, target);
|
|
21235
|
+
}
|
|
21236
|
+
};
|
|
21237
|
+
req.on("error", (err) => {
|
|
21238
|
+
if (req.socket.destroyed && err.code === "ECONNRESET") {
|
|
21239
|
+
const target = options.target || options.forward;
|
|
21240
|
+
if (target) {
|
|
21241
|
+
server.emit("econnreset", err, req, res, target);
|
|
21242
|
+
}
|
|
21243
|
+
return;
|
|
21244
|
+
}
|
|
21245
|
+
handleError(err);
|
|
21246
|
+
});
|
|
21247
|
+
const customFetch = options.fetch || fetch;
|
|
21248
|
+
const fetchOptions = options.fetchOptions ?? {};
|
|
21249
|
+
const prepareRequest = (outgoing) => {
|
|
21250
|
+
const requestOptions2 = {
|
|
21251
|
+
method: outgoing.method,
|
|
21252
|
+
...fetchOptions.requestOptions
|
|
21253
|
+
};
|
|
21254
|
+
const headers = new Headers(fetchOptions.requestOptions?.headers);
|
|
21255
|
+
if (!fetchOptions.requestOptions?.headers && outgoing.headers) {
|
|
21256
|
+
for (const [key, value] of Object.entries(outgoing.headers)) {
|
|
21257
|
+
if (typeof key === "string") {
|
|
21258
|
+
if (Array.isArray(value)) {
|
|
21259
|
+
for (const v of value) {
|
|
21260
|
+
headers.append(key, v);
|
|
21261
|
+
}
|
|
21262
|
+
} else if (value != null) {
|
|
21263
|
+
headers.append(key, value);
|
|
21264
|
+
}
|
|
21265
|
+
}
|
|
21266
|
+
}
|
|
21267
|
+
}
|
|
21268
|
+
if (options.auth) {
|
|
21269
|
+
headers.set("authorization", `Basic ${Buffer.from(options.auth).toString("base64")}`);
|
|
21270
|
+
}
|
|
21271
|
+
if (options.proxyTimeout) {
|
|
21272
|
+
requestOptions2.signal = AbortSignal.timeout(options.proxyTimeout);
|
|
21273
|
+
}
|
|
21274
|
+
requestOptions2.headers = headers;
|
|
21275
|
+
if (options.buffer) {
|
|
21276
|
+
requestOptions2.body = options.buffer;
|
|
21277
|
+
} else if (req.method !== "GET" && req.method !== "HEAD") {
|
|
21278
|
+
requestOptions2.body = req;
|
|
21279
|
+
requestOptions2.duplex = "half";
|
|
21280
|
+
}
|
|
21281
|
+
return requestOptions2;
|
|
21282
|
+
};
|
|
21283
|
+
if (options.forward) {
|
|
21284
|
+
const outgoingOptions2 = common.setupOutgoing(options.ssl || {}, options, req, "forward");
|
|
21285
|
+
const requestOptions2 = prepareRequest(outgoingOptions2);
|
|
21286
|
+
let targetUrl2 = new URL(outgoingOptions2.url).origin + outgoingOptions2.path;
|
|
21287
|
+
if (targetUrl2.startsWith("ws")) {
|
|
21288
|
+
targetUrl2 = targetUrl2.replace("ws", "http");
|
|
21289
|
+
}
|
|
21290
|
+
if (fetchOptions.onBeforeRequest) {
|
|
21291
|
+
try {
|
|
21292
|
+
await fetchOptions.onBeforeRequest(requestOptions2, req, res, options);
|
|
21293
|
+
} catch (err) {
|
|
21294
|
+
handleError(err, options.forward);
|
|
21295
|
+
return;
|
|
21296
|
+
}
|
|
21297
|
+
}
|
|
21298
|
+
try {
|
|
21299
|
+
const result = await customFetch(targetUrl2, requestOptions2);
|
|
21300
|
+
if (fetchOptions.onAfterResponse) {
|
|
21301
|
+
try {
|
|
21302
|
+
await fetchOptions.onAfterResponse(result, req, res, options);
|
|
21303
|
+
} catch (err) {
|
|
21304
|
+
handleError(err, options.forward);
|
|
21305
|
+
return;
|
|
21306
|
+
}
|
|
21307
|
+
}
|
|
21308
|
+
} catch (err) {
|
|
21309
|
+
handleError(err, options.forward);
|
|
21310
|
+
}
|
|
21311
|
+
if (!options.target) {
|
|
21312
|
+
return res.end();
|
|
21313
|
+
}
|
|
21314
|
+
}
|
|
21315
|
+
const outgoingOptions = common.setupOutgoing(options.ssl || {}, options, req);
|
|
21316
|
+
const requestOptions = prepareRequest(outgoingOptions);
|
|
21317
|
+
let targetUrl = new URL(outgoingOptions.url).origin + outgoingOptions.path;
|
|
21318
|
+
if (targetUrl.startsWith("ws")) {
|
|
21319
|
+
targetUrl = targetUrl.replace("ws", "http");
|
|
21320
|
+
}
|
|
21321
|
+
if (fetchOptions.onBeforeRequest) {
|
|
21322
|
+
try {
|
|
21323
|
+
await fetchOptions.onBeforeRequest(requestOptions, req, res, options);
|
|
21324
|
+
} catch (err) {
|
|
21325
|
+
handleError(err, options.target);
|
|
21326
|
+
return;
|
|
21327
|
+
}
|
|
21328
|
+
}
|
|
21329
|
+
try {
|
|
21330
|
+
const response2 = await customFetch(targetUrl, requestOptions);
|
|
21331
|
+
if (fetchOptions.onAfterResponse) {
|
|
21332
|
+
try {
|
|
21333
|
+
await fetchOptions.onAfterResponse(response2, req, res, options);
|
|
21334
|
+
} catch (err) {
|
|
21335
|
+
handleError(err, options.target);
|
|
21336
|
+
return;
|
|
21337
|
+
}
|
|
21338
|
+
}
|
|
21339
|
+
const fakeProxyRes = {
|
|
21340
|
+
statusCode: response2.status,
|
|
21341
|
+
statusMessage: response2.statusText,
|
|
21342
|
+
headers: Object.fromEntries(response2.headers.entries()),
|
|
21343
|
+
rawHeaders: Object.entries(response2.headers).flatMap(([key, value]) => {
|
|
21344
|
+
if (Array.isArray(value)) {
|
|
21345
|
+
return value.flatMap((v) => v != null ? [key, v] : []);
|
|
21346
|
+
}
|
|
21347
|
+
return value != null ? [key, value] : [];
|
|
21348
|
+
})
|
|
21349
|
+
};
|
|
21350
|
+
server?.emit("proxyRes", fakeProxyRes, req, res);
|
|
21351
|
+
if (!res.headersSent && !options.selfHandleResponse) {
|
|
21352
|
+
for (const pass of web_o) {
|
|
21353
|
+
pass(req, res, fakeProxyRes, options);
|
|
21354
|
+
}
|
|
21355
|
+
}
|
|
21356
|
+
if (!res.writableEnded) {
|
|
21357
|
+
const nodeStream = response2.body ? node_stream_1.Readable.from(response2.body) : null;
|
|
21358
|
+
if (nodeStream) {
|
|
21359
|
+
nodeStream.on("error", (err) => {
|
|
21360
|
+
handleError(err, options.target);
|
|
21361
|
+
});
|
|
21362
|
+
nodeStream.on("end", () => {
|
|
21363
|
+
server?.emit("end", req, res, fakeProxyRes);
|
|
21364
|
+
});
|
|
21365
|
+
if (!options.selfHandleResponse) {
|
|
21366
|
+
nodeStream.pipe(res, { end: true });
|
|
21367
|
+
} else {
|
|
21368
|
+
nodeStream.resume();
|
|
21369
|
+
}
|
|
21370
|
+
} else {
|
|
21371
|
+
server?.emit("end", req, res, fakeProxyRes);
|
|
21372
|
+
}
|
|
21373
|
+
} else {
|
|
21374
|
+
server?.emit("end", req, res, fakeProxyRes);
|
|
21375
|
+
}
|
|
21376
|
+
} catch (err) {
|
|
21377
|
+
handleError(err, options.target);
|
|
21378
|
+
}
|
|
21379
|
+
}
|
|
20992
21380
|
exports.WEB_PASSES = { deleteLength, timeout, XHeaders, stream };
|
|
20993
21381
|
}
|
|
20994
21382
|
});
|
|
@@ -21045,7 +21433,7 @@ var require_ws_incoming = __commonJS({
|
|
|
21045
21433
|
exports.stream = stream;
|
|
21046
21434
|
var http = __importStar(__require("node:http"));
|
|
21047
21435
|
var https = __importStar(__require("node:https"));
|
|
21048
|
-
var common = __importStar(
|
|
21436
|
+
var common = __importStar(require_common2());
|
|
21049
21437
|
var web_outgoing_1 = require_web_outgoing();
|
|
21050
21438
|
var debug_1 = __importDefault(require_src2());
|
|
21051
21439
|
var log = (0, debug_1.default)("http-proxy-3:ws-incoming");
|
|
@@ -21274,7 +21662,7 @@ var require_http_proxy = __commonJS({
|
|
|
21274
21662
|
var ws_incoming_1 = require_ws_incoming();
|
|
21275
21663
|
var node_events_1 = __require("node:events");
|
|
21276
21664
|
var debug_1 = __importDefault(require_src2());
|
|
21277
|
-
var common_1 =
|
|
21665
|
+
var common_1 = require_common2();
|
|
21278
21666
|
var log = (0, debug_1.default)("http-proxy-3");
|
|
21279
21667
|
var ProxyServer = class _ProxyServer extends node_events_1.EventEmitter {
|
|
21280
21668
|
/**
|
|
@@ -21395,7 +21783,7 @@ var require_http_proxy = __commonJS({
|
|
|
21395
21783
|
passes.splice(i++, 0, cb);
|
|
21396
21784
|
};
|
|
21397
21785
|
log("creating a ProxyServer", options);
|
|
21398
|
-
options.prependPath = options.prependPath
|
|
21786
|
+
options.prependPath = options.prependPath !== false;
|
|
21399
21787
|
this.options = options;
|
|
21400
21788
|
this.web = this.createRightProxy("web")(options);
|
|
21401
21789
|
this.ws = this.createRightProxy("ws")(options);
|
|
@@ -21735,22 +22123,12 @@ var require_cookie_parser = __commonJS({
|
|
|
21735
22123
|
}
|
|
21736
22124
|
});
|
|
21737
22125
|
|
|
21738
|
-
// packages/dev-tools/core/component-map-builder.ts
|
|
21739
|
-
var init_component_map_builder = __esm({
|
|
21740
|
-
"packages/dev-tools/core/component-map-builder.ts"() {
|
|
21741
|
-
"use strict";
|
|
21742
|
-
init_react_components();
|
|
21743
|
-
init_utils();
|
|
21744
|
-
}
|
|
21745
|
-
});
|
|
21746
|
-
|
|
21747
22126
|
// packages/dev-tools/cli/launch/server.ts
|
|
21748
22127
|
var import_cookie_parser, BUILDER_ENDPOINT_PREFIX, BUILDER_API_ENDPOINT_PREFIX;
|
|
21749
22128
|
var init_server = __esm({
|
|
21750
22129
|
"packages/dev-tools/cli/launch/server.ts"() {
|
|
21751
22130
|
"use strict";
|
|
21752
22131
|
import_cookie_parser = __toESM(require_cookie_parser(), 1);
|
|
21753
|
-
init_component_map_builder();
|
|
21754
22132
|
BUILDER_ENDPOINT_PREFIX = "/_builder.io";
|
|
21755
22133
|
BUILDER_API_ENDPOINT_PREFIX = BUILDER_ENDPOINT_PREFIX + "/api";
|
|
21756
22134
|
}
|
|
@@ -22250,8 +22628,8 @@ var init_parseUtil = __esm({
|
|
|
22250
22628
|
init_errors2();
|
|
22251
22629
|
init_en();
|
|
22252
22630
|
makeIssue = (params) => {
|
|
22253
|
-
const { data, path:
|
|
22254
|
-
const fullPath = [...
|
|
22631
|
+
const { data, path: path3, errorMaps, issueData } = params;
|
|
22632
|
+
const fullPath = [...path3, ...issueData.path || []];
|
|
22255
22633
|
const fullIssue = {
|
|
22256
22634
|
...issueData,
|
|
22257
22635
|
path: fullPath
|
|
@@ -22559,11 +22937,11 @@ var init_types2 = __esm({
|
|
|
22559
22937
|
init_parseUtil();
|
|
22560
22938
|
init_util();
|
|
22561
22939
|
ParseInputLazyPath = class {
|
|
22562
|
-
constructor(parent, value,
|
|
22940
|
+
constructor(parent, value, path3, key) {
|
|
22563
22941
|
this._cachedPath = [];
|
|
22564
22942
|
this.parent = parent;
|
|
22565
22943
|
this.data = value;
|
|
22566
|
-
this._path =
|
|
22944
|
+
this._path = path3;
|
|
22567
22945
|
this._key = key;
|
|
22568
22946
|
}
|
|
22569
22947
|
get path() {
|
|
@@ -30265,8 +30643,8 @@ var require_schemes = __commonJS({
|
|
|
30265
30643
|
wsComponents.secure = void 0;
|
|
30266
30644
|
}
|
|
30267
30645
|
if (wsComponents.resourceName) {
|
|
30268
|
-
const [
|
|
30269
|
-
wsComponents.path =
|
|
30646
|
+
const [path3, query] = wsComponents.resourceName.split("?");
|
|
30647
|
+
wsComponents.path = path3 && path3 !== "/" ? path3 : void 0;
|
|
30270
30648
|
wsComponents.query = query;
|
|
30271
30649
|
wsComponents.resourceName = void 0;
|
|
30272
30650
|
}
|
|
@@ -33582,12 +33960,12 @@ var require_dist2 = __commonJS({
|
|
|
33582
33960
|
throw new Error(`Unknown format "${name}"`);
|
|
33583
33961
|
return f;
|
|
33584
33962
|
};
|
|
33585
|
-
function addFormats(ajv, list,
|
|
33963
|
+
function addFormats(ajv, list, fs2, exportName) {
|
|
33586
33964
|
var _a;
|
|
33587
33965
|
var _b;
|
|
33588
33966
|
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
33589
33967
|
for (const f of list)
|
|
33590
|
-
ajv.addFormat(f,
|
|
33968
|
+
ajv.addFormat(f, fs2[f]);
|
|
33591
33969
|
}
|
|
33592
33970
|
module.exports = exports = formatsPlugin;
|
|
33593
33971
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -33618,8 +33996,8 @@ var require_windows = __commonJS({
|
|
|
33618
33996
|
"node_modules/isexe/windows.js"(exports, module) {
|
|
33619
33997
|
module.exports = isexe;
|
|
33620
33998
|
isexe.sync = sync;
|
|
33621
|
-
var
|
|
33622
|
-
function checkPathExt(
|
|
33999
|
+
var fs2 = __require("fs");
|
|
34000
|
+
function checkPathExt(path3, options) {
|
|
33623
34001
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
33624
34002
|
if (!pathext) {
|
|
33625
34003
|
return true;
|
|
@@ -33630,25 +34008,25 @@ var require_windows = __commonJS({
|
|
|
33630
34008
|
}
|
|
33631
34009
|
for (var i = 0; i < pathext.length; i++) {
|
|
33632
34010
|
var p2 = pathext[i].toLowerCase();
|
|
33633
|
-
if (p2 &&
|
|
34011
|
+
if (p2 && path3.substr(-p2.length).toLowerCase() === p2) {
|
|
33634
34012
|
return true;
|
|
33635
34013
|
}
|
|
33636
34014
|
}
|
|
33637
34015
|
return false;
|
|
33638
34016
|
}
|
|
33639
|
-
function checkStat(stat2,
|
|
34017
|
+
function checkStat(stat2, path3, options) {
|
|
33640
34018
|
if (!stat2.isSymbolicLink() && !stat2.isFile()) {
|
|
33641
34019
|
return false;
|
|
33642
34020
|
}
|
|
33643
|
-
return checkPathExt(
|
|
34021
|
+
return checkPathExt(path3, options);
|
|
33644
34022
|
}
|
|
33645
|
-
function isexe(
|
|
33646
|
-
|
|
33647
|
-
cb(er, er ? false : checkStat(stat2,
|
|
34023
|
+
function isexe(path3, options, cb) {
|
|
34024
|
+
fs2.stat(path3, function(er, stat2) {
|
|
34025
|
+
cb(er, er ? false : checkStat(stat2, path3, options));
|
|
33648
34026
|
});
|
|
33649
34027
|
}
|
|
33650
|
-
function sync(
|
|
33651
|
-
return checkStat(
|
|
34028
|
+
function sync(path3, options) {
|
|
34029
|
+
return checkStat(fs2.statSync(path3), path3, options);
|
|
33652
34030
|
}
|
|
33653
34031
|
}
|
|
33654
34032
|
});
|
|
@@ -33658,14 +34036,14 @@ var require_mode = __commonJS({
|
|
|
33658
34036
|
"node_modules/isexe/mode.js"(exports, module) {
|
|
33659
34037
|
module.exports = isexe;
|
|
33660
34038
|
isexe.sync = sync;
|
|
33661
|
-
var
|
|
33662
|
-
function isexe(
|
|
33663
|
-
|
|
34039
|
+
var fs2 = __require("fs");
|
|
34040
|
+
function isexe(path3, options, cb) {
|
|
34041
|
+
fs2.stat(path3, function(er, stat2) {
|
|
33664
34042
|
cb(er, er ? false : checkStat(stat2, options));
|
|
33665
34043
|
});
|
|
33666
34044
|
}
|
|
33667
|
-
function sync(
|
|
33668
|
-
return checkStat(
|
|
34045
|
+
function sync(path3, options) {
|
|
34046
|
+
return checkStat(fs2.statSync(path3), options);
|
|
33669
34047
|
}
|
|
33670
34048
|
function checkStat(stat2, options) {
|
|
33671
34049
|
return stat2.isFile() && checkMode(stat2, options);
|
|
@@ -33689,7 +34067,7 @@ var require_mode = __commonJS({
|
|
|
33689
34067
|
// node_modules/isexe/index.js
|
|
33690
34068
|
var require_isexe = __commonJS({
|
|
33691
34069
|
"node_modules/isexe/index.js"(exports, module) {
|
|
33692
|
-
var
|
|
34070
|
+
var fs2 = __require("fs");
|
|
33693
34071
|
var core;
|
|
33694
34072
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
33695
34073
|
core = require_windows();
|
|
@@ -33698,7 +34076,7 @@ var require_isexe = __commonJS({
|
|
|
33698
34076
|
}
|
|
33699
34077
|
module.exports = isexe;
|
|
33700
34078
|
isexe.sync = sync;
|
|
33701
|
-
function isexe(
|
|
34079
|
+
function isexe(path3, options, cb) {
|
|
33702
34080
|
if (typeof options === "function") {
|
|
33703
34081
|
cb = options;
|
|
33704
34082
|
options = {};
|
|
@@ -33708,7 +34086,7 @@ var require_isexe = __commonJS({
|
|
|
33708
34086
|
throw new TypeError("callback not provided");
|
|
33709
34087
|
}
|
|
33710
34088
|
return new Promise(function(resolve, reject) {
|
|
33711
|
-
isexe(
|
|
34089
|
+
isexe(path3, options || {}, function(er, is) {
|
|
33712
34090
|
if (er) {
|
|
33713
34091
|
reject(er);
|
|
33714
34092
|
} else {
|
|
@@ -33717,7 +34095,7 @@ var require_isexe = __commonJS({
|
|
|
33717
34095
|
});
|
|
33718
34096
|
});
|
|
33719
34097
|
}
|
|
33720
|
-
core(
|
|
34098
|
+
core(path3, options || {}, function(er, is) {
|
|
33721
34099
|
if (er) {
|
|
33722
34100
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
33723
34101
|
er = null;
|
|
@@ -33727,9 +34105,9 @@ var require_isexe = __commonJS({
|
|
|
33727
34105
|
cb(er, is);
|
|
33728
34106
|
});
|
|
33729
34107
|
}
|
|
33730
|
-
function sync(
|
|
34108
|
+
function sync(path3, options) {
|
|
33731
34109
|
try {
|
|
33732
|
-
return core.sync(
|
|
34110
|
+
return core.sync(path3, options || {});
|
|
33733
34111
|
} catch (er) {
|
|
33734
34112
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
33735
34113
|
return false;
|
|
@@ -33745,7 +34123,7 @@ var require_isexe = __commonJS({
|
|
|
33745
34123
|
var require_which = __commonJS({
|
|
33746
34124
|
"node_modules/which/which.js"(exports, module) {
|
|
33747
34125
|
var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
33748
|
-
var
|
|
34126
|
+
var path3 = __require("path");
|
|
33749
34127
|
var COLON = isWindows2 ? ";" : ":";
|
|
33750
34128
|
var isexe = require_isexe();
|
|
33751
34129
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -33783,7 +34161,7 @@ var require_which = __commonJS({
|
|
|
33783
34161
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
33784
34162
|
const ppRaw = pathEnv[i];
|
|
33785
34163
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
33786
|
-
const pCmd =
|
|
34164
|
+
const pCmd = path3.join(pathPart, cmd);
|
|
33787
34165
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
33788
34166
|
resolve(subStep(p2, i, 0));
|
|
33789
34167
|
});
|
|
@@ -33810,7 +34188,7 @@ var require_which = __commonJS({
|
|
|
33810
34188
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
33811
34189
|
const ppRaw = pathEnv[i];
|
|
33812
34190
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
33813
|
-
const pCmd =
|
|
34191
|
+
const pCmd = path3.join(pathPart, cmd);
|
|
33814
34192
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
33815
34193
|
for (let j2 = 0; j2 < pathExt.length; j2++) {
|
|
33816
34194
|
const cur = p2 + pathExt[j2];
|
|
@@ -33858,7 +34236,7 @@ var require_path_key = __commonJS({
|
|
|
33858
34236
|
var require_resolveCommand = __commonJS({
|
|
33859
34237
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
33860
34238
|
"use strict";
|
|
33861
|
-
var
|
|
34239
|
+
var path3 = __require("path");
|
|
33862
34240
|
var which = require_which();
|
|
33863
34241
|
var getPathKey = require_path_key();
|
|
33864
34242
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -33876,7 +34254,7 @@ var require_resolveCommand = __commonJS({
|
|
|
33876
34254
|
try {
|
|
33877
34255
|
resolved = which.sync(parsed.command, {
|
|
33878
34256
|
path: env[getPathKey({ env })],
|
|
33879
|
-
pathExt: withoutPathExt ?
|
|
34257
|
+
pathExt: withoutPathExt ? path3.delimiter : void 0
|
|
33880
34258
|
});
|
|
33881
34259
|
} catch (e2) {
|
|
33882
34260
|
} finally {
|
|
@@ -33885,7 +34263,7 @@ var require_resolveCommand = __commonJS({
|
|
|
33885
34263
|
}
|
|
33886
34264
|
}
|
|
33887
34265
|
if (resolved) {
|
|
33888
|
-
resolved =
|
|
34266
|
+
resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
33889
34267
|
}
|
|
33890
34268
|
return resolved;
|
|
33891
34269
|
}
|
|
@@ -33939,8 +34317,8 @@ var require_shebang_command = __commonJS({
|
|
|
33939
34317
|
if (!match) {
|
|
33940
34318
|
return null;
|
|
33941
34319
|
}
|
|
33942
|
-
const [
|
|
33943
|
-
const binary =
|
|
34320
|
+
const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
34321
|
+
const binary = path3.split("/").pop();
|
|
33944
34322
|
if (binary === "env") {
|
|
33945
34323
|
return argument;
|
|
33946
34324
|
}
|
|
@@ -33953,16 +34331,16 @@ var require_shebang_command = __commonJS({
|
|
|
33953
34331
|
var require_readShebang = __commonJS({
|
|
33954
34332
|
"node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
33955
34333
|
"use strict";
|
|
33956
|
-
var
|
|
34334
|
+
var fs2 = __require("fs");
|
|
33957
34335
|
var shebangCommand = require_shebang_command();
|
|
33958
34336
|
function readShebang(command) {
|
|
33959
34337
|
const size = 150;
|
|
33960
34338
|
const buffer = Buffer.alloc(size);
|
|
33961
34339
|
let fd;
|
|
33962
34340
|
try {
|
|
33963
|
-
fd =
|
|
33964
|
-
|
|
33965
|
-
|
|
34341
|
+
fd = fs2.openSync(command, "r");
|
|
34342
|
+
fs2.readSync(fd, buffer, 0, size, 0);
|
|
34343
|
+
fs2.closeSync(fd);
|
|
33966
34344
|
} catch (e2) {
|
|
33967
34345
|
}
|
|
33968
34346
|
return shebangCommand(buffer.toString());
|
|
@@ -33975,7 +34353,7 @@ var require_readShebang = __commonJS({
|
|
|
33975
34353
|
var require_parse4 = __commonJS({
|
|
33976
34354
|
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
33977
34355
|
"use strict";
|
|
33978
|
-
var
|
|
34356
|
+
var path3 = __require("path");
|
|
33979
34357
|
var resolveCommand = require_resolveCommand();
|
|
33980
34358
|
var escape2 = require_escape();
|
|
33981
34359
|
var readShebang = require_readShebang();
|
|
@@ -34000,7 +34378,7 @@ var require_parse4 = __commonJS({
|
|
|
34000
34378
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
34001
34379
|
if (parsed.options.forceShell || needsShell) {
|
|
34002
34380
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
34003
|
-
parsed.command =
|
|
34381
|
+
parsed.command = path3.normalize(parsed.command);
|
|
34004
34382
|
parsed.command = escape2.command(parsed.command);
|
|
34005
34383
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
34006
34384
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -34217,8 +34595,8 @@ var require_package = __commonJS({
|
|
|
34217
34595
|
// node_modules/dotenv/lib/main.js
|
|
34218
34596
|
var require_main = __commonJS({
|
|
34219
34597
|
"node_modules/dotenv/lib/main.js"(exports, module) {
|
|
34220
|
-
var
|
|
34221
|
-
var
|
|
34598
|
+
var fs2 = __require("fs");
|
|
34599
|
+
var path3 = __require("path");
|
|
34222
34600
|
var os = __require("os");
|
|
34223
34601
|
var crypto4 = __require("crypto");
|
|
34224
34602
|
var packageJson = require_package();
|
|
@@ -34310,14 +34688,14 @@ var require_main = __commonJS({
|
|
|
34310
34688
|
return { ciphertext, key };
|
|
34311
34689
|
}
|
|
34312
34690
|
function _vaultPath(options) {
|
|
34313
|
-
let dotenvPath =
|
|
34691
|
+
let dotenvPath = path3.resolve(process.cwd(), ".env");
|
|
34314
34692
|
if (options && options.path && options.path.length > 0) {
|
|
34315
34693
|
dotenvPath = options.path;
|
|
34316
34694
|
}
|
|
34317
34695
|
return dotenvPath.endsWith(".vault") ? dotenvPath : `${dotenvPath}.vault`;
|
|
34318
34696
|
}
|
|
34319
34697
|
function _resolveHome(envPath) {
|
|
34320
|
-
return envPath[0] === "~" ?
|
|
34698
|
+
return envPath[0] === "~" ? path3.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
34321
34699
|
}
|
|
34322
34700
|
function _configVault(options) {
|
|
34323
34701
|
_log("Loading env from encrypted .env.vault");
|
|
@@ -34330,7 +34708,7 @@ var require_main = __commonJS({
|
|
|
34330
34708
|
return { parsed };
|
|
34331
34709
|
}
|
|
34332
34710
|
function configDotenv(options) {
|
|
34333
|
-
let dotenvPath =
|
|
34711
|
+
let dotenvPath = path3.resolve(process.cwd(), ".env");
|
|
34334
34712
|
let encoding = "utf8";
|
|
34335
34713
|
const debug2 = Boolean(options && options.debug);
|
|
34336
34714
|
if (options) {
|
|
@@ -34346,7 +34724,7 @@ var require_main = __commonJS({
|
|
|
34346
34724
|
}
|
|
34347
34725
|
}
|
|
34348
34726
|
try {
|
|
34349
|
-
const parsed = DotenvModule.parse(
|
|
34727
|
+
const parsed = DotenvModule.parse(fs2.readFileSync(dotenvPath, { encoding }));
|
|
34350
34728
|
let processEnv = process.env;
|
|
34351
34729
|
if (options && options.processEnv != null) {
|
|
34352
34730
|
processEnv = options.processEnv;
|
|
@@ -34365,7 +34743,7 @@ var require_main = __commonJS({
|
|
|
34365
34743
|
if (_dotenvKey(options).length === 0) {
|
|
34366
34744
|
return DotenvModule.configDotenv(options);
|
|
34367
34745
|
}
|
|
34368
|
-
if (!
|
|
34746
|
+
if (!fs2.existsSync(vaultPath)) {
|
|
34369
34747
|
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
34370
34748
|
return DotenvModule.configDotenv(options);
|
|
34371
34749
|
}
|
|
@@ -35227,8 +35605,8 @@ var init_figma_publish = __esm({
|
|
|
35227
35605
|
// packages/dev-tools/cli/credentials.ts
|
|
35228
35606
|
import { createServer } from "http";
|
|
35229
35607
|
import { platform as platform2 } from "node:os";
|
|
35230
|
-
import { dirname, join as
|
|
35231
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
35608
|
+
import { dirname, join as join3 } from "node:path";
|
|
35609
|
+
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
35232
35610
|
import { randomUUID } from "crypto";
|
|
35233
35611
|
async function getFigmaAuth(sys2) {
|
|
35234
35612
|
const randomState = randomUUID();
|
|
@@ -35347,27 +35725,27 @@ async function getBuilderAuth(sys2, preferSpaceId) {
|
|
|
35347
35725
|
});
|
|
35348
35726
|
}
|
|
35349
35727
|
function storeCredentials(sys2, credentials) {
|
|
35350
|
-
const doesNodeModulesExist =
|
|
35351
|
-
|
|
35728
|
+
const doesNodeModulesExist = existsSync2(
|
|
35729
|
+
join3(sys2.getAppRootDir(), "node_modules")
|
|
35352
35730
|
);
|
|
35353
35731
|
if (doesNodeModulesExist) {
|
|
35354
|
-
const configDir =
|
|
35355
|
-
const filePath =
|
|
35732
|
+
const configDir = join3(sys2.getAppRootDir(), "node_modules", ".builder");
|
|
35733
|
+
const filePath = join3(configDir, "data.json");
|
|
35356
35734
|
const existingCredentials = loadCredentials(sys2);
|
|
35357
35735
|
credentials = Object.assign(existingCredentials, credentials);
|
|
35358
35736
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
35359
35737
|
writeFileSync(filePath, JSON.stringify({ credentials }, null, 2));
|
|
35360
35738
|
} else {
|
|
35361
|
-
const configDir =
|
|
35362
|
-
const filePath =
|
|
35363
|
-
const gitignorePath =
|
|
35739
|
+
const configDir = join3(sys2.getAppRootDir(), ".config", "builderio");
|
|
35740
|
+
const filePath = join3(configDir, "data.json");
|
|
35741
|
+
const gitignorePath = join3(sys2.getAppRootDir(), ".gitignore");
|
|
35364
35742
|
const existingCredentials = loadCredentials(sys2);
|
|
35365
35743
|
credentials = Object.assign(existingCredentials, credentials);
|
|
35366
35744
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
35367
35745
|
writeFileSync(filePath, JSON.stringify({ credentials }, null, 2));
|
|
35368
35746
|
const gitignoreEntry = ".config/";
|
|
35369
|
-
if (
|
|
35370
|
-
const gitignoreContent =
|
|
35747
|
+
if (existsSync2(gitignorePath)) {
|
|
35748
|
+
const gitignoreContent = readFileSync2(gitignorePath, "utf8");
|
|
35371
35749
|
if (!gitignoreContent.includes(gitignoreEntry)) {
|
|
35372
35750
|
writeFileSync(
|
|
35373
35751
|
gitignorePath,
|
|
@@ -35380,21 +35758,21 @@ function storeCredentials(sys2, credentials) {
|
|
|
35380
35758
|
}
|
|
35381
35759
|
}
|
|
35382
35760
|
function loadCredentials(sys2) {
|
|
35383
|
-
const newPath =
|
|
35761
|
+
const newPath = join3(
|
|
35384
35762
|
sys2.getAppRootDir(),
|
|
35385
35763
|
".config",
|
|
35386
35764
|
"builderio",
|
|
35387
35765
|
"data.json"
|
|
35388
35766
|
);
|
|
35389
35767
|
const locations = [
|
|
35390
|
-
|
|
35768
|
+
join3(sys2.getAppRootDir(), "node_modules", ".builder", "data.json"),
|
|
35391
35769
|
newPath,
|
|
35392
|
-
|
|
35770
|
+
join3(sys2.getRepoRootDir(), ".git", ".builder.json")
|
|
35393
35771
|
];
|
|
35394
35772
|
for (const filepath of locations) {
|
|
35395
|
-
if (
|
|
35773
|
+
if (existsSync2(filepath)) {
|
|
35396
35774
|
try {
|
|
35397
|
-
const data =
|
|
35775
|
+
const data = readFileSync2(filepath, "utf8");
|
|
35398
35776
|
return JSON.parse(data).credentials;
|
|
35399
35777
|
} catch (e2) {
|
|
35400
35778
|
sys2.Sentry?.captureException(e2, {
|
|
@@ -35852,8 +36230,8 @@ async function getRequestBody(request2) {
|
|
|
35852
36230
|
return body;
|
|
35853
36231
|
}
|
|
35854
36232
|
function getNodeHttpUrl(req) {
|
|
35855
|
-
const
|
|
35856
|
-
return new URL(
|
|
36233
|
+
const path3 = req.url || "/";
|
|
36234
|
+
return new URL(path3, `http://${req.headers.host}`);
|
|
35857
36235
|
}
|
|
35858
36236
|
var init_request_handler = __esm({
|
|
35859
36237
|
"packages/dev-tools/server/request-handler.ts"() {
|