@nice-code/action 0.13.0 → 0.15.0

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.
@@ -5,7 +5,9 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  import { createPortal } from "react-dom";
6
6
  import { useVirtualizer } from "@tanstack/react-virtual";
7
7
  import { Circle, CircleAlert, CircleCheck, CircleX, Component, ExternalLink, Loader2, PackageCheck, Sparkle, Variable } from "lucide-react";
8
- import { SourceMapConsumer } from "source-map-js";
8
+ //#region \0rolldown/runtime.js
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
+ //#endregion
9
11
  //#region ../nice-devtools-shared/src/colors.ts
10
12
  const DEVTOOL_COLOR_SEMANTIC_ERROR = "#FF5C5C";
11
13
  const DEVTOOL_COLOR_SEMANTIC_SUCCESS = "#A3E635";
@@ -1273,7 +1275,2104 @@ const devtools_storage = createTypedWebLocalStorage({
1273
1275
  });
1274
1276
  devtools_storage.updateJsonWithDef("runtimeToProjectFilePath", {}, (prev) => prev);
1275
1277
  //#endregion
1278
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js
1279
+ var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
1280
+ var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
1281
+ /**
1282
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
1283
+ */
1284
+ exports.encode = function(number) {
1285
+ if (0 <= number && number < intToCharMap.length) return intToCharMap[number];
1286
+ throw new TypeError("Must be between 0 and 63: " + number);
1287
+ };
1288
+ /**
1289
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
1290
+ * failure.
1291
+ */
1292
+ exports.decode = function(charCode) {
1293
+ var bigA = 65;
1294
+ var bigZ = 90;
1295
+ var littleA = 97;
1296
+ var littleZ = 122;
1297
+ var zero = 48;
1298
+ var nine = 57;
1299
+ var plus = 43;
1300
+ var slash = 47;
1301
+ var littleOffset = 26;
1302
+ var numberOffset = 52;
1303
+ if (bigA <= charCode && charCode <= bigZ) return charCode - bigA;
1304
+ if (littleA <= charCode && charCode <= littleZ) return charCode - littleA + littleOffset;
1305
+ if (zero <= charCode && charCode <= nine) return charCode - zero + numberOffset;
1306
+ if (charCode == plus) return 62;
1307
+ if (charCode == slash) return 63;
1308
+ return -1;
1309
+ };
1310
+ }));
1311
+ //#endregion
1312
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js
1313
+ var require_base64_vlq = /* @__PURE__ */ __commonJSMin(((exports) => {
1314
+ var base64 = require_base64();
1315
+ var VLQ_BASE_SHIFT = 5;
1316
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
1317
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
1318
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
1319
+ /**
1320
+ * Converts from a two-complement value to a value where the sign bit is
1321
+ * placed in the least significant bit. For example, as decimals:
1322
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
1323
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
1324
+ */
1325
+ function toVLQSigned(aValue) {
1326
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
1327
+ }
1328
+ /**
1329
+ * Converts to a two-complement value from a value where the sign bit is
1330
+ * placed in the least significant bit. For example, as decimals:
1331
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
1332
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
1333
+ */
1334
+ function fromVLQSigned(aValue) {
1335
+ var isNegative = (aValue & 1) === 1;
1336
+ var shifted = aValue >> 1;
1337
+ return isNegative ? -shifted : shifted;
1338
+ }
1339
+ /**
1340
+ * Returns the base 64 VLQ encoded value.
1341
+ */
1342
+ exports.encode = function base64VLQ_encode(aValue) {
1343
+ var encoded = "";
1344
+ var digit;
1345
+ var vlq = toVLQSigned(aValue);
1346
+ do {
1347
+ digit = vlq & VLQ_BASE_MASK;
1348
+ vlq >>>= VLQ_BASE_SHIFT;
1349
+ if (vlq > 0) digit |= VLQ_CONTINUATION_BIT;
1350
+ encoded += base64.encode(digit);
1351
+ } while (vlq > 0);
1352
+ return encoded;
1353
+ };
1354
+ /**
1355
+ * Decodes the next base 64 VLQ value from the given string and returns the
1356
+ * value and the rest of the string via the out parameter.
1357
+ */
1358
+ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
1359
+ var strLen = aStr.length;
1360
+ var result = 0;
1361
+ var shift = 0;
1362
+ var continuation, digit;
1363
+ do {
1364
+ if (aIndex >= strLen) throw new Error("Expected more digits in base 64 VLQ value.");
1365
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
1366
+ if (digit === -1) throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
1367
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
1368
+ digit &= VLQ_BASE_MASK;
1369
+ result = result + (digit << shift);
1370
+ shift += VLQ_BASE_SHIFT;
1371
+ } while (continuation);
1372
+ aOutParam.value = fromVLQSigned(result);
1373
+ aOutParam.rest = aIndex;
1374
+ };
1375
+ }));
1376
+ //#endregion
1377
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js
1378
+ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
1379
+ /**
1380
+ * This is a helper function for getting values from parameter/options
1381
+ * objects.
1382
+ *
1383
+ * @param args The object we are extracting values from
1384
+ * @param name The name of the property we are getting.
1385
+ * @param defaultValue An optional value to return if the property is missing
1386
+ * from the object. If this is not specified and the property is missing, an
1387
+ * error will be thrown.
1388
+ */
1389
+ function getArg(aArgs, aName, aDefaultValue) {
1390
+ if (aName in aArgs) return aArgs[aName];
1391
+ else if (arguments.length === 3) return aDefaultValue;
1392
+ else throw new Error("\"" + aName + "\" is a required argument.");
1393
+ }
1394
+ exports.getArg = getArg;
1395
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
1396
+ var dataUrlRegexp = /^data:.+\,.+$/;
1397
+ function urlParse(aUrl) {
1398
+ var match = aUrl.match(urlRegexp);
1399
+ if (!match) return null;
1400
+ return {
1401
+ scheme: match[1],
1402
+ auth: match[2],
1403
+ host: match[3],
1404
+ port: match[4],
1405
+ path: match[5]
1406
+ };
1407
+ }
1408
+ exports.urlParse = urlParse;
1409
+ function urlGenerate(aParsedUrl) {
1410
+ var url = "";
1411
+ if (aParsedUrl.scheme) url += aParsedUrl.scheme + ":";
1412
+ url += "//";
1413
+ if (aParsedUrl.auth) url += aParsedUrl.auth + "@";
1414
+ if (aParsedUrl.host) url += aParsedUrl.host;
1415
+ if (aParsedUrl.port) url += ":" + aParsedUrl.port;
1416
+ if (aParsedUrl.path) url += aParsedUrl.path;
1417
+ return url;
1418
+ }
1419
+ exports.urlGenerate = urlGenerate;
1420
+ var MAX_CACHED_INPUTS = 32;
1421
+ /**
1422
+ * Takes some function `f(input) -> result` and returns a memoized version of
1423
+ * `f`.
1424
+ *
1425
+ * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
1426
+ * memoization is a dumb-simple, linear least-recently-used cache.
1427
+ */
1428
+ function lruMemoize(f) {
1429
+ var cache = [];
1430
+ return function(input) {
1431
+ for (var i = 0; i < cache.length; i++) if (cache[i].input === input) {
1432
+ var temp = cache[0];
1433
+ cache[0] = cache[i];
1434
+ cache[i] = temp;
1435
+ return cache[0].result;
1436
+ }
1437
+ var result = f(input);
1438
+ cache.unshift({
1439
+ input,
1440
+ result
1441
+ });
1442
+ if (cache.length > MAX_CACHED_INPUTS) cache.pop();
1443
+ return result;
1444
+ };
1445
+ }
1446
+ /**
1447
+ * Normalizes a path, or the path portion of a URL:
1448
+ *
1449
+ * - Replaces consecutive slashes with one slash.
1450
+ * - Removes unnecessary '.' parts.
1451
+ * - Removes unnecessary '<dir>/..' parts.
1452
+ *
1453
+ * Based on code in the Node.js 'path' core module.
1454
+ *
1455
+ * @param aPath The path or url to normalize.
1456
+ */
1457
+ var normalize = lruMemoize(function normalize(aPath) {
1458
+ var path = aPath;
1459
+ var url = urlParse(aPath);
1460
+ if (url) {
1461
+ if (!url.path) return aPath;
1462
+ path = url.path;
1463
+ }
1464
+ var isAbsolute = exports.isAbsolute(path);
1465
+ var parts = [];
1466
+ var start = 0;
1467
+ var i = 0;
1468
+ while (true) {
1469
+ start = i;
1470
+ i = path.indexOf("/", start);
1471
+ if (i === -1) {
1472
+ parts.push(path.slice(start));
1473
+ break;
1474
+ } else {
1475
+ parts.push(path.slice(start, i));
1476
+ while (i < path.length && path[i] === "/") i++;
1477
+ }
1478
+ }
1479
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
1480
+ part = parts[i];
1481
+ if (part === ".") parts.splice(i, 1);
1482
+ else if (part === "..") up++;
1483
+ else if (up > 0) if (part === "") {
1484
+ parts.splice(i + 1, up);
1485
+ up = 0;
1486
+ } else {
1487
+ parts.splice(i, 2);
1488
+ up--;
1489
+ }
1490
+ }
1491
+ path = parts.join("/");
1492
+ if (path === "") path = isAbsolute ? "/" : ".";
1493
+ if (url) {
1494
+ url.path = path;
1495
+ return urlGenerate(url);
1496
+ }
1497
+ return path;
1498
+ });
1499
+ exports.normalize = normalize;
1500
+ /**
1501
+ * Joins two paths/URLs.
1502
+ *
1503
+ * @param aRoot The root path or URL.
1504
+ * @param aPath The path or URL to be joined with the root.
1505
+ *
1506
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
1507
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
1508
+ * first.
1509
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
1510
+ * is updated with the result and aRoot is returned. Otherwise the result
1511
+ * is returned.
1512
+ * - If aPath is absolute, the result is aPath.
1513
+ * - Otherwise the two paths are joined with a slash.
1514
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
1515
+ */
1516
+ function join(aRoot, aPath) {
1517
+ if (aRoot === "") aRoot = ".";
1518
+ if (aPath === "") aPath = ".";
1519
+ var aPathUrl = urlParse(aPath);
1520
+ var aRootUrl = urlParse(aRoot);
1521
+ if (aRootUrl) aRoot = aRootUrl.path || "/";
1522
+ if (aPathUrl && !aPathUrl.scheme) {
1523
+ if (aRootUrl) aPathUrl.scheme = aRootUrl.scheme;
1524
+ return urlGenerate(aPathUrl);
1525
+ }
1526
+ if (aPathUrl || aPath.match(dataUrlRegexp)) return aPath;
1527
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
1528
+ aRootUrl.host = aPath;
1529
+ return urlGenerate(aRootUrl);
1530
+ }
1531
+ var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
1532
+ if (aRootUrl) {
1533
+ aRootUrl.path = joined;
1534
+ return urlGenerate(aRootUrl);
1535
+ }
1536
+ return joined;
1537
+ }
1538
+ exports.join = join;
1539
+ exports.isAbsolute = function(aPath) {
1540
+ return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
1541
+ };
1542
+ /**
1543
+ * Make a path relative to a URL or another path.
1544
+ *
1545
+ * @param aRoot The root path or URL.
1546
+ * @param aPath The path or URL to be made relative to aRoot.
1547
+ */
1548
+ function relative(aRoot, aPath) {
1549
+ if (aRoot === "") aRoot = ".";
1550
+ aRoot = aRoot.replace(/\/$/, "");
1551
+ var level = 0;
1552
+ while (aPath.indexOf(aRoot + "/") !== 0) {
1553
+ var index = aRoot.lastIndexOf("/");
1554
+ if (index < 0) return aPath;
1555
+ aRoot = aRoot.slice(0, index);
1556
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) return aPath;
1557
+ ++level;
1558
+ }
1559
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
1560
+ }
1561
+ exports.relative = relative;
1562
+ var supportsNullProto = function() {
1563
+ return !("__proto__" in Object.create(null));
1564
+ }();
1565
+ function identity(s) {
1566
+ return s;
1567
+ }
1568
+ /**
1569
+ * Because behavior goes wacky when you set `__proto__` on objects, we
1570
+ * have to prefix all the strings in our set with an arbitrary character.
1571
+ *
1572
+ * See https://github.com/mozilla/source-map/pull/31 and
1573
+ * https://github.com/mozilla/source-map/issues/30
1574
+ *
1575
+ * @param String aStr
1576
+ */
1577
+ function toSetString(aStr) {
1578
+ if (isProtoString(aStr)) return "$" + aStr;
1579
+ return aStr;
1580
+ }
1581
+ exports.toSetString = supportsNullProto ? identity : toSetString;
1582
+ function fromSetString(aStr) {
1583
+ if (isProtoString(aStr)) return aStr.slice(1);
1584
+ return aStr;
1585
+ }
1586
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
1587
+ function isProtoString(s) {
1588
+ if (!s) return false;
1589
+ var length = s.length;
1590
+ if (length < 9) return false;
1591
+ if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) return false;
1592
+ for (var i = length - 10; i >= 0; i--) if (s.charCodeAt(i) !== 36) return false;
1593
+ return true;
1594
+ }
1595
+ /**
1596
+ * Comparator between two mappings where the original positions are compared.
1597
+ *
1598
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
1599
+ * mappings with the same original source/line/column, but different generated
1600
+ * line and column the same. Useful when searching for a mapping with a
1601
+ * stubbed out mapping.
1602
+ */
1603
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
1604
+ var cmp = strcmp(mappingA.source, mappingB.source);
1605
+ if (cmp !== 0) return cmp;
1606
+ cmp = mappingA.originalLine - mappingB.originalLine;
1607
+ if (cmp !== 0) return cmp;
1608
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1609
+ if (cmp !== 0 || onlyCompareOriginal) return cmp;
1610
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1611
+ if (cmp !== 0) return cmp;
1612
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
1613
+ if (cmp !== 0) return cmp;
1614
+ return strcmp(mappingA.name, mappingB.name);
1615
+ }
1616
+ exports.compareByOriginalPositions = compareByOriginalPositions;
1617
+ function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
1618
+ var cmp = mappingA.originalLine - mappingB.originalLine;
1619
+ if (cmp !== 0) return cmp;
1620
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1621
+ if (cmp !== 0 || onlyCompareOriginal) return cmp;
1622
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1623
+ if (cmp !== 0) return cmp;
1624
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
1625
+ if (cmp !== 0) return cmp;
1626
+ return strcmp(mappingA.name, mappingB.name);
1627
+ }
1628
+ exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
1629
+ /**
1630
+ * Comparator between two mappings with deflated source and name indices where
1631
+ * the generated positions are compared.
1632
+ *
1633
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
1634
+ * mappings with the same generated line and column, but different
1635
+ * source/name/original line and column the same. Useful when searching for a
1636
+ * mapping with a stubbed out mapping.
1637
+ */
1638
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
1639
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
1640
+ if (cmp !== 0) return cmp;
1641
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1642
+ if (cmp !== 0 || onlyCompareGenerated) return cmp;
1643
+ cmp = strcmp(mappingA.source, mappingB.source);
1644
+ if (cmp !== 0) return cmp;
1645
+ cmp = mappingA.originalLine - mappingB.originalLine;
1646
+ if (cmp !== 0) return cmp;
1647
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1648
+ if (cmp !== 0) return cmp;
1649
+ return strcmp(mappingA.name, mappingB.name);
1650
+ }
1651
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
1652
+ function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
1653
+ var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1654
+ if (cmp !== 0 || onlyCompareGenerated) return cmp;
1655
+ cmp = strcmp(mappingA.source, mappingB.source);
1656
+ if (cmp !== 0) return cmp;
1657
+ cmp = mappingA.originalLine - mappingB.originalLine;
1658
+ if (cmp !== 0) return cmp;
1659
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1660
+ if (cmp !== 0) return cmp;
1661
+ return strcmp(mappingA.name, mappingB.name);
1662
+ }
1663
+ exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
1664
+ function strcmp(aStr1, aStr2) {
1665
+ if (aStr1 === aStr2) return 0;
1666
+ if (aStr1 === null) return 1;
1667
+ if (aStr2 === null) return -1;
1668
+ if (aStr1 > aStr2) return 1;
1669
+ return -1;
1670
+ }
1671
+ /**
1672
+ * Comparator between two mappings with inflated source and name strings where
1673
+ * the generated positions are compared.
1674
+ */
1675
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
1676
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
1677
+ if (cmp !== 0) return cmp;
1678
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1679
+ if (cmp !== 0) return cmp;
1680
+ cmp = strcmp(mappingA.source, mappingB.source);
1681
+ if (cmp !== 0) return cmp;
1682
+ cmp = mappingA.originalLine - mappingB.originalLine;
1683
+ if (cmp !== 0) return cmp;
1684
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1685
+ if (cmp !== 0) return cmp;
1686
+ return strcmp(mappingA.name, mappingB.name);
1687
+ }
1688
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
1689
+ /**
1690
+ * Strip any JSON XSSI avoidance prefix from the string (as documented
1691
+ * in the source maps specification), and then parse the string as
1692
+ * JSON.
1693
+ */
1694
+ function parseSourceMapInput(str) {
1695
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
1696
+ }
1697
+ exports.parseSourceMapInput = parseSourceMapInput;
1698
+ /**
1699
+ * Compute the URL of a source given the the source root, the source's
1700
+ * URL, and the source map's URL.
1701
+ */
1702
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
1703
+ sourceURL = sourceURL || "";
1704
+ if (sourceRoot) {
1705
+ if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") sourceRoot += "/";
1706
+ sourceURL = sourceRoot + sourceURL;
1707
+ }
1708
+ if (sourceMapURL) {
1709
+ var parsed = urlParse(sourceMapURL);
1710
+ if (!parsed) throw new Error("sourceMapURL could not be parsed");
1711
+ if (parsed.path) {
1712
+ var index = parsed.path.lastIndexOf("/");
1713
+ if (index >= 0) parsed.path = parsed.path.substring(0, index + 1);
1714
+ }
1715
+ sourceURL = join(urlGenerate(parsed), sourceURL);
1716
+ }
1717
+ return normalize(sourceURL);
1718
+ }
1719
+ exports.computeSourceURL = computeSourceURL;
1720
+ }));
1721
+ //#endregion
1722
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js
1723
+ var require_array_set = /* @__PURE__ */ __commonJSMin(((exports) => {
1724
+ var util = require_util();
1725
+ var has = Object.prototype.hasOwnProperty;
1726
+ var hasNativeMap = typeof Map !== "undefined";
1727
+ /**
1728
+ * A data structure which is a combination of an array and a set. Adding a new
1729
+ * member is O(1), testing for membership is O(1), and finding the index of an
1730
+ * element is O(1). Removing elements from the set is not supported. Only
1731
+ * strings are supported for membership.
1732
+ */
1733
+ function ArraySet() {
1734
+ this._array = [];
1735
+ this._set = hasNativeMap ? /* @__PURE__ */ new Map() : Object.create(null);
1736
+ }
1737
+ /**
1738
+ * Static method for creating ArraySet instances from an existing array.
1739
+ */
1740
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
1741
+ var set = new ArraySet();
1742
+ for (var i = 0, len = aArray.length; i < len; i++) set.add(aArray[i], aAllowDuplicates);
1743
+ return set;
1744
+ };
1745
+ /**
1746
+ * Return how many unique items are in this ArraySet. If duplicates have been
1747
+ * added, than those do not count towards the size.
1748
+ *
1749
+ * @returns Number
1750
+ */
1751
+ ArraySet.prototype.size = function ArraySet_size() {
1752
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
1753
+ };
1754
+ /**
1755
+ * Add the given string to this set.
1756
+ *
1757
+ * @param String aStr
1758
+ */
1759
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
1760
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
1761
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
1762
+ var idx = this._array.length;
1763
+ if (!isDuplicate || aAllowDuplicates) this._array.push(aStr);
1764
+ if (!isDuplicate) if (hasNativeMap) this._set.set(aStr, idx);
1765
+ else this._set[sStr] = idx;
1766
+ };
1767
+ /**
1768
+ * Is the given string a member of this set?
1769
+ *
1770
+ * @param String aStr
1771
+ */
1772
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
1773
+ if (hasNativeMap) return this._set.has(aStr);
1774
+ else {
1775
+ var sStr = util.toSetString(aStr);
1776
+ return has.call(this._set, sStr);
1777
+ }
1778
+ };
1779
+ /**
1780
+ * What is the index of the given string in the array?
1781
+ *
1782
+ * @param String aStr
1783
+ */
1784
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
1785
+ if (hasNativeMap) {
1786
+ var idx = this._set.get(aStr);
1787
+ if (idx >= 0) return idx;
1788
+ } else {
1789
+ var sStr = util.toSetString(aStr);
1790
+ if (has.call(this._set, sStr)) return this._set[sStr];
1791
+ }
1792
+ throw new Error("\"" + aStr + "\" is not in the set.");
1793
+ };
1794
+ /**
1795
+ * What is the element at the given index?
1796
+ *
1797
+ * @param Number aIdx
1798
+ */
1799
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
1800
+ if (aIdx >= 0 && aIdx < this._array.length) return this._array[aIdx];
1801
+ throw new Error("No element indexed by " + aIdx);
1802
+ };
1803
+ /**
1804
+ * Returns the array representation of this set (which has the proper indices
1805
+ * indicated by indexOf). Note that this is a copy of the internal array used
1806
+ * for storing the members so that no one can mess with internal state.
1807
+ */
1808
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
1809
+ return this._array.slice();
1810
+ };
1811
+ exports.ArraySet = ArraySet;
1812
+ }));
1813
+ //#endregion
1814
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js
1815
+ var require_mapping_list = /* @__PURE__ */ __commonJSMin(((exports) => {
1816
+ var util = require_util();
1817
+ /**
1818
+ * Determine whether mappingB is after mappingA with respect to generated
1819
+ * position.
1820
+ */
1821
+ function generatedPositionAfter(mappingA, mappingB) {
1822
+ var lineA = mappingA.generatedLine;
1823
+ var lineB = mappingB.generatedLine;
1824
+ var columnA = mappingA.generatedColumn;
1825
+ var columnB = mappingB.generatedColumn;
1826
+ return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
1827
+ }
1828
+ /**
1829
+ * A data structure to provide a sorted view of accumulated mappings in a
1830
+ * performance conscious manner. It trades a neglibable overhead in general
1831
+ * case for a large speedup in case of mappings being added in order.
1832
+ */
1833
+ function MappingList() {
1834
+ this._array = [];
1835
+ this._sorted = true;
1836
+ this._last = {
1837
+ generatedLine: -1,
1838
+ generatedColumn: 0
1839
+ };
1840
+ }
1841
+ /**
1842
+ * Iterate through internal items. This method takes the same arguments that
1843
+ * `Array.prototype.forEach` takes.
1844
+ *
1845
+ * NOTE: The order of the mappings is NOT guaranteed.
1846
+ */
1847
+ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
1848
+ this._array.forEach(aCallback, aThisArg);
1849
+ };
1850
+ /**
1851
+ * Add the given source mapping.
1852
+ *
1853
+ * @param Object aMapping
1854
+ */
1855
+ MappingList.prototype.add = function MappingList_add(aMapping) {
1856
+ if (generatedPositionAfter(this._last, aMapping)) {
1857
+ this._last = aMapping;
1858
+ this._array.push(aMapping);
1859
+ } else {
1860
+ this._sorted = false;
1861
+ this._array.push(aMapping);
1862
+ }
1863
+ };
1864
+ /**
1865
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
1866
+ * generated position.
1867
+ *
1868
+ * WARNING: This method returns internal data without copying, for
1869
+ * performance. The return value must NOT be mutated, and should be treated as
1870
+ * an immutable borrow. If you want to take ownership, you must make your own
1871
+ * copy.
1872
+ */
1873
+ MappingList.prototype.toArray = function MappingList_toArray() {
1874
+ if (!this._sorted) {
1875
+ this._array.sort(util.compareByGeneratedPositionsInflated);
1876
+ this._sorted = true;
1877
+ }
1878
+ return this._array;
1879
+ };
1880
+ exports.MappingList = MappingList;
1881
+ }));
1882
+ //#endregion
1883
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js
1884
+ var require_source_map_generator = /* @__PURE__ */ __commonJSMin(((exports) => {
1885
+ var base64VLQ = require_base64_vlq();
1886
+ var util = require_util();
1887
+ var ArraySet = require_array_set().ArraySet;
1888
+ var MappingList = require_mapping_list().MappingList;
1889
+ /**
1890
+ * An instance of the SourceMapGenerator represents a source map which is
1891
+ * being built incrementally. You may pass an object with the following
1892
+ * properties:
1893
+ *
1894
+ * - file: The filename of the generated source.
1895
+ * - sourceRoot: A root for all relative URLs in this source map.
1896
+ */
1897
+ function SourceMapGenerator(aArgs) {
1898
+ if (!aArgs) aArgs = {};
1899
+ this._file = util.getArg(aArgs, "file", null);
1900
+ this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
1901
+ this._skipValidation = util.getArg(aArgs, "skipValidation", false);
1902
+ this._ignoreInvalidMapping = util.getArg(aArgs, "ignoreInvalidMapping", false);
1903
+ this._sources = new ArraySet();
1904
+ this._names = new ArraySet();
1905
+ this._mappings = new MappingList();
1906
+ this._sourcesContents = null;
1907
+ }
1908
+ SourceMapGenerator.prototype._version = 3;
1909
+ /**
1910
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
1911
+ *
1912
+ * @param aSourceMapConsumer The SourceMap.
1913
+ */
1914
+ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
1915
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
1916
+ var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
1917
+ file: aSourceMapConsumer.file,
1918
+ sourceRoot
1919
+ }));
1920
+ aSourceMapConsumer.eachMapping(function(mapping) {
1921
+ var newMapping = { generated: {
1922
+ line: mapping.generatedLine,
1923
+ column: mapping.generatedColumn
1924
+ } };
1925
+ if (mapping.source != null) {
1926
+ newMapping.source = mapping.source;
1927
+ if (sourceRoot != null) newMapping.source = util.relative(sourceRoot, newMapping.source);
1928
+ newMapping.original = {
1929
+ line: mapping.originalLine,
1930
+ column: mapping.originalColumn
1931
+ };
1932
+ if (mapping.name != null) newMapping.name = mapping.name;
1933
+ }
1934
+ generator.addMapping(newMapping);
1935
+ });
1936
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
1937
+ var sourceRelative = sourceFile;
1938
+ if (sourceRoot !== null) sourceRelative = util.relative(sourceRoot, sourceFile);
1939
+ if (!generator._sources.has(sourceRelative)) generator._sources.add(sourceRelative);
1940
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1941
+ if (content != null) generator.setSourceContent(sourceFile, content);
1942
+ });
1943
+ return generator;
1944
+ };
1945
+ /**
1946
+ * Add a single mapping from original source line and column to the generated
1947
+ * source's line and column for this source map being created. The mapping
1948
+ * object should have the following properties:
1949
+ *
1950
+ * - generated: An object with the generated line and column positions.
1951
+ * - original: An object with the original line and column positions.
1952
+ * - source: The original source file (relative to the sourceRoot).
1953
+ * - name: An optional original token name for this mapping.
1954
+ */
1955
+ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
1956
+ var generated = util.getArg(aArgs, "generated");
1957
+ var original = util.getArg(aArgs, "original", null);
1958
+ var source = util.getArg(aArgs, "source", null);
1959
+ var name = util.getArg(aArgs, "name", null);
1960
+ if (!this._skipValidation) {
1961
+ if (this._validateMapping(generated, original, source, name) === false) return;
1962
+ }
1963
+ if (source != null) {
1964
+ source = String(source);
1965
+ if (!this._sources.has(source)) this._sources.add(source);
1966
+ }
1967
+ if (name != null) {
1968
+ name = String(name);
1969
+ if (!this._names.has(name)) this._names.add(name);
1970
+ }
1971
+ this._mappings.add({
1972
+ generatedLine: generated.line,
1973
+ generatedColumn: generated.column,
1974
+ originalLine: original != null && original.line,
1975
+ originalColumn: original != null && original.column,
1976
+ source,
1977
+ name
1978
+ });
1979
+ };
1980
+ /**
1981
+ * Set the source content for a source file.
1982
+ */
1983
+ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
1984
+ var source = aSourceFile;
1985
+ if (this._sourceRoot != null) source = util.relative(this._sourceRoot, source);
1986
+ if (aSourceContent != null) {
1987
+ if (!this._sourcesContents) this._sourcesContents = Object.create(null);
1988
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
1989
+ } else if (this._sourcesContents) {
1990
+ delete this._sourcesContents[util.toSetString(source)];
1991
+ if (Object.keys(this._sourcesContents).length === 0) this._sourcesContents = null;
1992
+ }
1993
+ };
1994
+ /**
1995
+ * Applies the mappings of a sub-source-map for a specific source file to the
1996
+ * source map being generated. Each mapping to the supplied source file is
1997
+ * rewritten using the supplied source map. Note: The resolution for the
1998
+ * resulting mappings is the minimium of this map and the supplied map.
1999
+ *
2000
+ * @param aSourceMapConsumer The source map to be applied.
2001
+ * @param aSourceFile Optional. The filename of the source file.
2002
+ * If omitted, SourceMapConsumer's file property will be used.
2003
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
2004
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
2005
+ * This parameter is needed when the two source maps aren't in the same
2006
+ * directory, and the source map to be applied contains relative source
2007
+ * paths. If so, those relative source paths need to be rewritten
2008
+ * relative to the SourceMapGenerator.
2009
+ */
2010
+ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
2011
+ var sourceFile = aSourceFile;
2012
+ if (aSourceFile == null) {
2013
+ if (aSourceMapConsumer.file == null) throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's \"file\" property. Both were omitted.");
2014
+ sourceFile = aSourceMapConsumer.file;
2015
+ }
2016
+ var sourceRoot = this._sourceRoot;
2017
+ if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile);
2018
+ var newSources = new ArraySet();
2019
+ var newNames = new ArraySet();
2020
+ this._mappings.unsortedForEach(function(mapping) {
2021
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
2022
+ var original = aSourceMapConsumer.originalPositionFor({
2023
+ line: mapping.originalLine,
2024
+ column: mapping.originalColumn
2025
+ });
2026
+ if (original.source != null) {
2027
+ mapping.source = original.source;
2028
+ if (aSourceMapPath != null) mapping.source = util.join(aSourceMapPath, mapping.source);
2029
+ if (sourceRoot != null) mapping.source = util.relative(sourceRoot, mapping.source);
2030
+ mapping.originalLine = original.line;
2031
+ mapping.originalColumn = original.column;
2032
+ if (original.name != null) mapping.name = original.name;
2033
+ }
2034
+ }
2035
+ var source = mapping.source;
2036
+ if (source != null && !newSources.has(source)) newSources.add(source);
2037
+ var name = mapping.name;
2038
+ if (name != null && !newNames.has(name)) newNames.add(name);
2039
+ }, this);
2040
+ this._sources = newSources;
2041
+ this._names = newNames;
2042
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
2043
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
2044
+ if (content != null) {
2045
+ if (aSourceMapPath != null) sourceFile = util.join(aSourceMapPath, sourceFile);
2046
+ if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile);
2047
+ this.setSourceContent(sourceFile, content);
2048
+ }
2049
+ }, this);
2050
+ };
2051
+ /**
2052
+ * A mapping can have one of the three levels of data:
2053
+ *
2054
+ * 1. Just the generated position.
2055
+ * 2. The Generated position, original position, and original source.
2056
+ * 3. Generated and original position, original source, as well as a name
2057
+ * token.
2058
+ *
2059
+ * To maintain consistency, we validate that any new mapping being added falls
2060
+ * in to one of these categories.
2061
+ */
2062
+ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
2063
+ if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
2064
+ var message = "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";
2065
+ if (this._ignoreInvalidMapping) {
2066
+ if (typeof console !== "undefined" && console.warn) console.warn(message);
2067
+ return false;
2068
+ } else throw new Error(message);
2069
+ }
2070
+ if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) return;
2071
+ else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) return;
2072
+ else {
2073
+ var message = "Invalid mapping: " + JSON.stringify({
2074
+ generated: aGenerated,
2075
+ source: aSource,
2076
+ original: aOriginal,
2077
+ name: aName
2078
+ });
2079
+ if (this._ignoreInvalidMapping) {
2080
+ if (typeof console !== "undefined" && console.warn) console.warn(message);
2081
+ return false;
2082
+ } else throw new Error(message);
2083
+ }
2084
+ };
2085
+ /**
2086
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
2087
+ * specified by the source map format.
2088
+ */
2089
+ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
2090
+ var previousGeneratedColumn = 0;
2091
+ var previousGeneratedLine = 1;
2092
+ var previousOriginalColumn = 0;
2093
+ var previousOriginalLine = 0;
2094
+ var previousName = 0;
2095
+ var previousSource = 0;
2096
+ var result = "";
2097
+ var next;
2098
+ var mapping;
2099
+ var nameIdx;
2100
+ var sourceIdx;
2101
+ var mappings = this._mappings.toArray();
2102
+ for (var i = 0, len = mappings.length; i < len; i++) {
2103
+ mapping = mappings[i];
2104
+ next = "";
2105
+ if (mapping.generatedLine !== previousGeneratedLine) {
2106
+ previousGeneratedColumn = 0;
2107
+ while (mapping.generatedLine !== previousGeneratedLine) {
2108
+ next += ";";
2109
+ previousGeneratedLine++;
2110
+ }
2111
+ } else if (i > 0) {
2112
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
2113
+ next += ",";
2114
+ }
2115
+ next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
2116
+ previousGeneratedColumn = mapping.generatedColumn;
2117
+ if (mapping.source != null) {
2118
+ sourceIdx = this._sources.indexOf(mapping.source);
2119
+ next += base64VLQ.encode(sourceIdx - previousSource);
2120
+ previousSource = sourceIdx;
2121
+ next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
2122
+ previousOriginalLine = mapping.originalLine - 1;
2123
+ next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
2124
+ previousOriginalColumn = mapping.originalColumn;
2125
+ if (mapping.name != null) {
2126
+ nameIdx = this._names.indexOf(mapping.name);
2127
+ next += base64VLQ.encode(nameIdx - previousName);
2128
+ previousName = nameIdx;
2129
+ }
2130
+ }
2131
+ result += next;
2132
+ }
2133
+ return result;
2134
+ };
2135
+ SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
2136
+ return aSources.map(function(source) {
2137
+ if (!this._sourcesContents) return null;
2138
+ if (aSourceRoot != null) source = util.relative(aSourceRoot, source);
2139
+ var key = util.toSetString(source);
2140
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
2141
+ }, this);
2142
+ };
2143
+ /**
2144
+ * Externalize the source map.
2145
+ */
2146
+ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
2147
+ var map = {
2148
+ version: this._version,
2149
+ sources: this._sources.toArray(),
2150
+ names: this._names.toArray(),
2151
+ mappings: this._serializeMappings()
2152
+ };
2153
+ if (this._file != null) map.file = this._file;
2154
+ if (this._sourceRoot != null) map.sourceRoot = this._sourceRoot;
2155
+ if (this._sourcesContents) map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
2156
+ return map;
2157
+ };
2158
+ /**
2159
+ * Render the source map being generated to a string.
2160
+ */
2161
+ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
2162
+ return JSON.stringify(this.toJSON());
2163
+ };
2164
+ exports.SourceMapGenerator = SourceMapGenerator;
2165
+ }));
2166
+ //#endregion
2167
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js
2168
+ var require_binary_search = /* @__PURE__ */ __commonJSMin(((exports) => {
2169
+ exports.GREATEST_LOWER_BOUND = 1;
2170
+ exports.LEAST_UPPER_BOUND = 2;
2171
+ /**
2172
+ * Recursive implementation of binary search.
2173
+ *
2174
+ * @param aLow Indices here and lower do not contain the needle.
2175
+ * @param aHigh Indices here and higher do not contain the needle.
2176
+ * @param aNeedle The element being searched for.
2177
+ * @param aHaystack The non-empty array being searched.
2178
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
2179
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
2180
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
2181
+ * closest element that is smaller than or greater than the one we are
2182
+ * searching for, respectively, if the exact element cannot be found.
2183
+ */
2184
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
2185
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
2186
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
2187
+ if (cmp === 0) return mid;
2188
+ else if (cmp > 0) {
2189
+ if (aHigh - mid > 1) return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
2190
+ if (aBias == exports.LEAST_UPPER_BOUND) return aHigh < aHaystack.length ? aHigh : -1;
2191
+ else return mid;
2192
+ } else {
2193
+ if (mid - aLow > 1) return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
2194
+ if (aBias == exports.LEAST_UPPER_BOUND) return mid;
2195
+ else return aLow < 0 ? -1 : aLow;
2196
+ }
2197
+ }
2198
+ /**
2199
+ * This is an implementation of binary search which will always try and return
2200
+ * the index of the closest element if there is no exact hit. This is because
2201
+ * mappings between original and generated line/col pairs are single points,
2202
+ * and there is an implicit region between each of them, so a miss just means
2203
+ * that you aren't on the very start of a region.
2204
+ *
2205
+ * @param aNeedle The element you are looking for.
2206
+ * @param aHaystack The array that is being searched.
2207
+ * @param aCompare A function which takes the needle and an element in the
2208
+ * array and returns -1, 0, or 1 depending on whether the needle is less
2209
+ * than, equal to, or greater than the element, respectively.
2210
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
2211
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
2212
+ * closest element that is smaller than or greater than the one we are
2213
+ * searching for, respectively, if the exact element cannot be found.
2214
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
2215
+ */
2216
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
2217
+ if (aHaystack.length === 0) return -1;
2218
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
2219
+ if (index < 0) return -1;
2220
+ while (index - 1 >= 0) {
2221
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) break;
2222
+ --index;
2223
+ }
2224
+ return index;
2225
+ };
2226
+ }));
2227
+ //#endregion
2228
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js
2229
+ var require_quick_sort = /* @__PURE__ */ __commonJSMin(((exports) => {
2230
+ function SortTemplate(comparator) {
2231
+ /**
2232
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
2233
+ *
2234
+ * @param {Array} ary
2235
+ * The array.
2236
+ * @param {Number} x
2237
+ * The index of the first item.
2238
+ * @param {Number} y
2239
+ * The index of the second item.
2240
+ */
2241
+ function swap(ary, x, y) {
2242
+ var temp = ary[x];
2243
+ ary[x] = ary[y];
2244
+ ary[y] = temp;
2245
+ }
2246
+ /**
2247
+ * Returns a random integer within the range `low .. high` inclusive.
2248
+ *
2249
+ * @param {Number} low
2250
+ * The lower bound on the range.
2251
+ * @param {Number} high
2252
+ * The upper bound on the range.
2253
+ */
2254
+ function randomIntInRange(low, high) {
2255
+ return Math.round(low + Math.random() * (high - low));
2256
+ }
2257
+ /**
2258
+ * The Quick Sort algorithm.
2259
+ *
2260
+ * @param {Array} ary
2261
+ * An array to sort.
2262
+ * @param {function} comparator
2263
+ * Function to use to compare two items.
2264
+ * @param {Number} p
2265
+ * Start index of the array
2266
+ * @param {Number} r
2267
+ * End index of the array
2268
+ */
2269
+ function doQuickSort(ary, comparator, p, r) {
2270
+ if (p < r) {
2271
+ var pivotIndex = randomIntInRange(p, r);
2272
+ var i = p - 1;
2273
+ swap(ary, pivotIndex, r);
2274
+ var pivot = ary[r];
2275
+ for (var j = p; j < r; j++) if (comparator(ary[j], pivot, false) <= 0) {
2276
+ i += 1;
2277
+ swap(ary, i, j);
2278
+ }
2279
+ swap(ary, i + 1, j);
2280
+ var q = i + 1;
2281
+ doQuickSort(ary, comparator, p, q - 1);
2282
+ doQuickSort(ary, comparator, q + 1, r);
2283
+ }
2284
+ }
2285
+ return doQuickSort;
2286
+ }
2287
+ function cloneSort(comparator) {
2288
+ let template = SortTemplate.toString();
2289
+ return new Function(`return ${template}`)()(comparator);
2290
+ }
2291
+ /**
2292
+ * Sort the given array in-place with the given comparator function.
2293
+ *
2294
+ * @param {Array} ary
2295
+ * An array to sort.
2296
+ * @param {function} comparator
2297
+ * Function to use to compare two items.
2298
+ */
2299
+ let sortCache = /* @__PURE__ */ new WeakMap();
2300
+ exports.quickSort = function(ary, comparator, start = 0) {
2301
+ let doQuickSort = sortCache.get(comparator);
2302
+ if (doQuickSort === void 0) {
2303
+ doQuickSort = cloneSort(comparator);
2304
+ sortCache.set(comparator, doQuickSort);
2305
+ }
2306
+ doQuickSort(ary, comparator, start, ary.length - 1);
2307
+ };
2308
+ }));
2309
+ //#endregion
2310
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js
2311
+ var require_source_map_consumer = /* @__PURE__ */ __commonJSMin(((exports) => {
2312
+ var util = require_util();
2313
+ var binarySearch = require_binary_search();
2314
+ var ArraySet = require_array_set().ArraySet;
2315
+ var base64VLQ = require_base64_vlq();
2316
+ var quickSort = require_quick_sort().quickSort;
2317
+ function SourceMapConsumer(aSourceMap, aSourceMapURL) {
2318
+ var sourceMap = aSourceMap;
2319
+ if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
2320
+ return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
2321
+ }
2322
+ SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
2323
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
2324
+ };
2325
+ /**
2326
+ * The version of the source mapping spec that we are consuming.
2327
+ */
2328
+ SourceMapConsumer.prototype._version = 3;
2329
+ SourceMapConsumer.prototype.__generatedMappings = null;
2330
+ Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
2331
+ configurable: true,
2332
+ enumerable: true,
2333
+ get: function() {
2334
+ if (!this.__generatedMappings) this._parseMappings(this._mappings, this.sourceRoot);
2335
+ return this.__generatedMappings;
2336
+ }
2337
+ });
2338
+ SourceMapConsumer.prototype.__originalMappings = null;
2339
+ Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
2340
+ configurable: true,
2341
+ enumerable: true,
2342
+ get: function() {
2343
+ if (!this.__originalMappings) this._parseMappings(this._mappings, this.sourceRoot);
2344
+ return this.__originalMappings;
2345
+ }
2346
+ });
2347
+ SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
2348
+ var c = aStr.charAt(index);
2349
+ return c === ";" || c === ",";
2350
+ };
2351
+ /**
2352
+ * Parse the mappings in a string in to a data structure which we can easily
2353
+ * query (the ordered arrays in the `this.__generatedMappings` and
2354
+ * `this.__originalMappings` properties).
2355
+ */
2356
+ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
2357
+ throw new Error("Subclasses must implement _parseMappings");
2358
+ };
2359
+ SourceMapConsumer.GENERATED_ORDER = 1;
2360
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
2361
+ SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
2362
+ SourceMapConsumer.LEAST_UPPER_BOUND = 2;
2363
+ /**
2364
+ * Iterate over each mapping between an original source/line/column and a
2365
+ * generated line/column in this source map.
2366
+ *
2367
+ * @param Function aCallback
2368
+ * The function that is called with each mapping.
2369
+ * @param Object aContext
2370
+ * Optional. If specified, this object will be the value of `this` every
2371
+ * time that `aCallback` is called.
2372
+ * @param aOrder
2373
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
2374
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
2375
+ * iterate over the mappings sorted by the generated file's line/column
2376
+ * order or the original's source/line/column order, respectively. Defaults to
2377
+ * `SourceMapConsumer.GENERATED_ORDER`.
2378
+ */
2379
+ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
2380
+ var context = aContext || null;
2381
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
2382
+ var mappings;
2383
+ switch (order) {
2384
+ case SourceMapConsumer.GENERATED_ORDER:
2385
+ mappings = this._generatedMappings;
2386
+ break;
2387
+ case SourceMapConsumer.ORIGINAL_ORDER:
2388
+ mappings = this._originalMappings;
2389
+ break;
2390
+ default: throw new Error("Unknown order of iteration.");
2391
+ }
2392
+ var sourceRoot = this.sourceRoot;
2393
+ var boundCallback = aCallback.bind(context);
2394
+ var names = this._names;
2395
+ var sources = this._sources;
2396
+ var sourceMapURL = this._sourceMapURL;
2397
+ for (var i = 0, n = mappings.length; i < n; i++) {
2398
+ var mapping = mappings[i];
2399
+ var source = mapping.source === null ? null : sources.at(mapping.source);
2400
+ if (source !== null) source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
2401
+ boundCallback({
2402
+ source,
2403
+ generatedLine: mapping.generatedLine,
2404
+ generatedColumn: mapping.generatedColumn,
2405
+ originalLine: mapping.originalLine,
2406
+ originalColumn: mapping.originalColumn,
2407
+ name: mapping.name === null ? null : names.at(mapping.name)
2408
+ });
2409
+ }
2410
+ };
2411
+ /**
2412
+ * Returns all generated line and column information for the original source,
2413
+ * line, and column provided. If no column is provided, returns all mappings
2414
+ * corresponding to a either the line we are searching for or the next
2415
+ * closest line that has any mappings. Otherwise, returns all mappings
2416
+ * corresponding to the given line and either the column we are searching for
2417
+ * or the next closest column that has any offsets.
2418
+ *
2419
+ * The only argument is an object with the following properties:
2420
+ *
2421
+ * - source: The filename of the original source.
2422
+ * - line: The line number in the original source. The line number is 1-based.
2423
+ * - column: Optional. the column number in the original source.
2424
+ * The column number is 0-based.
2425
+ *
2426
+ * and an array of objects is returned, each with the following properties:
2427
+ *
2428
+ * - line: The line number in the generated source, or null. The
2429
+ * line number is 1-based.
2430
+ * - column: The column number in the generated source, or null.
2431
+ * The column number is 0-based.
2432
+ */
2433
+ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
2434
+ var line = util.getArg(aArgs, "line");
2435
+ var needle = {
2436
+ source: util.getArg(aArgs, "source"),
2437
+ originalLine: line,
2438
+ originalColumn: util.getArg(aArgs, "column", 0)
2439
+ };
2440
+ needle.source = this._findSourceIndex(needle.source);
2441
+ if (needle.source < 0) return [];
2442
+ var mappings = [];
2443
+ var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
2444
+ if (index >= 0) {
2445
+ var mapping = this._originalMappings[index];
2446
+ if (aArgs.column === void 0) {
2447
+ var originalLine = mapping.originalLine;
2448
+ while (mapping && mapping.originalLine === originalLine) {
2449
+ mappings.push({
2450
+ line: util.getArg(mapping, "generatedLine", null),
2451
+ column: util.getArg(mapping, "generatedColumn", null),
2452
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2453
+ });
2454
+ mapping = this._originalMappings[++index];
2455
+ }
2456
+ } else {
2457
+ var originalColumn = mapping.originalColumn;
2458
+ while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
2459
+ mappings.push({
2460
+ line: util.getArg(mapping, "generatedLine", null),
2461
+ column: util.getArg(mapping, "generatedColumn", null),
2462
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2463
+ });
2464
+ mapping = this._originalMappings[++index];
2465
+ }
2466
+ }
2467
+ }
2468
+ return mappings;
2469
+ };
2470
+ exports.SourceMapConsumer = SourceMapConsumer;
2471
+ /**
2472
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
2473
+ * query for information about the original file positions by giving it a file
2474
+ * position in the generated source.
2475
+ *
2476
+ * The first parameter is the raw source map (either as a JSON string, or
2477
+ * already parsed to an object). According to the spec, source maps have the
2478
+ * following attributes:
2479
+ *
2480
+ * - version: Which version of the source map spec this map is following.
2481
+ * - sources: An array of URLs to the original source files.
2482
+ * - names: An array of identifiers which can be referrenced by individual mappings.
2483
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
2484
+ * - sourcesContent: Optional. An array of contents of the original source files.
2485
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
2486
+ * - file: Optional. The generated file this source map is associated with.
2487
+ *
2488
+ * Here is an example source map, taken from the source map spec[0]:
2489
+ *
2490
+ * {
2491
+ * version : 3,
2492
+ * file: "out.js",
2493
+ * sourceRoot : "",
2494
+ * sources: ["foo.js", "bar.js"],
2495
+ * names: ["src", "maps", "are", "fun"],
2496
+ * mappings: "AA,AB;;ABCDE;"
2497
+ * }
2498
+ *
2499
+ * The second parameter, if given, is a string whose value is the URL
2500
+ * at which the source map was found. This URL is used to compute the
2501
+ * sources array.
2502
+ *
2503
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
2504
+ */
2505
+ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
2506
+ var sourceMap = aSourceMap;
2507
+ if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
2508
+ var version = util.getArg(sourceMap, "version");
2509
+ var sources = util.getArg(sourceMap, "sources");
2510
+ var names = util.getArg(sourceMap, "names", []);
2511
+ var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
2512
+ var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
2513
+ var mappings = util.getArg(sourceMap, "mappings");
2514
+ var file = util.getArg(sourceMap, "file", null);
2515
+ if (version != this._version) throw new Error("Unsupported version: " + version);
2516
+ if (sourceRoot) sourceRoot = util.normalize(sourceRoot);
2517
+ sources = sources.map(String).map(util.normalize).map(function(source) {
2518
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
2519
+ });
2520
+ this._names = ArraySet.fromArray(names.map(String), true);
2521
+ this._sources = ArraySet.fromArray(sources, true);
2522
+ this._absoluteSources = this._sources.toArray().map(function(s) {
2523
+ return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
2524
+ });
2525
+ this.sourceRoot = sourceRoot;
2526
+ this.sourcesContent = sourcesContent;
2527
+ this._mappings = mappings;
2528
+ this._sourceMapURL = aSourceMapURL;
2529
+ this.file = file;
2530
+ }
2531
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
2532
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
2533
+ /**
2534
+ * Utility function to find the index of a source. Returns -1 if not
2535
+ * found.
2536
+ */
2537
+ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
2538
+ var relativeSource = aSource;
2539
+ if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource);
2540
+ if (this._sources.has(relativeSource)) return this._sources.indexOf(relativeSource);
2541
+ var i;
2542
+ for (i = 0; i < this._absoluteSources.length; ++i) if (this._absoluteSources[i] == aSource) return i;
2543
+ return -1;
2544
+ };
2545
+ /**
2546
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
2547
+ *
2548
+ * @param SourceMapGenerator aSourceMap
2549
+ * The source map that will be consumed.
2550
+ * @param String aSourceMapURL
2551
+ * The URL at which the source map can be found (optional)
2552
+ * @returns BasicSourceMapConsumer
2553
+ */
2554
+ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
2555
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
2556
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
2557
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
2558
+ smc.sourceRoot = aSourceMap._sourceRoot;
2559
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
2560
+ smc.file = aSourceMap._file;
2561
+ smc._sourceMapURL = aSourceMapURL;
2562
+ smc._absoluteSources = smc._sources.toArray().map(function(s) {
2563
+ return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
2564
+ });
2565
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
2566
+ var destGeneratedMappings = smc.__generatedMappings = [];
2567
+ var destOriginalMappings = smc.__originalMappings = [];
2568
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
2569
+ var srcMapping = generatedMappings[i];
2570
+ var destMapping = new Mapping();
2571
+ destMapping.generatedLine = srcMapping.generatedLine;
2572
+ destMapping.generatedColumn = srcMapping.generatedColumn;
2573
+ if (srcMapping.source) {
2574
+ destMapping.source = sources.indexOf(srcMapping.source);
2575
+ destMapping.originalLine = srcMapping.originalLine;
2576
+ destMapping.originalColumn = srcMapping.originalColumn;
2577
+ if (srcMapping.name) destMapping.name = names.indexOf(srcMapping.name);
2578
+ destOriginalMappings.push(destMapping);
2579
+ }
2580
+ destGeneratedMappings.push(destMapping);
2581
+ }
2582
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
2583
+ return smc;
2584
+ };
2585
+ /**
2586
+ * The version of the source mapping spec that we are consuming.
2587
+ */
2588
+ BasicSourceMapConsumer.prototype._version = 3;
2589
+ /**
2590
+ * The list of original sources.
2591
+ */
2592
+ Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() {
2593
+ return this._absoluteSources.slice();
2594
+ } });
2595
+ /**
2596
+ * Provide the JIT with a nice shape / hidden class.
2597
+ */
2598
+ function Mapping() {
2599
+ this.generatedLine = 0;
2600
+ this.generatedColumn = 0;
2601
+ this.source = null;
2602
+ this.originalLine = null;
2603
+ this.originalColumn = null;
2604
+ this.name = null;
2605
+ }
2606
+ /**
2607
+ * Parse the mappings in a string in to a data structure which we can easily
2608
+ * query (the ordered arrays in the `this.__generatedMappings` and
2609
+ * `this.__originalMappings` properties).
2610
+ */
2611
+ const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;
2612
+ function sortGenerated(array, start) {
2613
+ let l = array.length;
2614
+ let n = array.length - start;
2615
+ if (n <= 1) return;
2616
+ else if (n == 2) {
2617
+ let a = array[start];
2618
+ let b = array[start + 1];
2619
+ if (compareGenerated(a, b) > 0) {
2620
+ array[start] = b;
2621
+ array[start + 1] = a;
2622
+ }
2623
+ } else if (n < 20) for (let i = start; i < l; i++) for (let j = i; j > start; j--) {
2624
+ let a = array[j - 1];
2625
+ let b = array[j];
2626
+ if (compareGenerated(a, b) <= 0) break;
2627
+ array[j - 1] = b;
2628
+ array[j] = a;
2629
+ }
2630
+ else quickSort(array, compareGenerated, start);
2631
+ }
2632
+ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
2633
+ var generatedLine = 1;
2634
+ var previousGeneratedColumn = 0;
2635
+ var previousOriginalLine = 0;
2636
+ var previousOriginalColumn = 0;
2637
+ var previousSource = 0;
2638
+ var previousName = 0;
2639
+ var length = aStr.length;
2640
+ var index = 0;
2641
+ var temp = {};
2642
+ var originalMappings = [];
2643
+ var generatedMappings = [], mapping, segment, end, value;
2644
+ let subarrayStart = 0;
2645
+ while (index < length) if (aStr.charAt(index) === ";") {
2646
+ generatedLine++;
2647
+ index++;
2648
+ previousGeneratedColumn = 0;
2649
+ sortGenerated(generatedMappings, subarrayStart);
2650
+ subarrayStart = generatedMappings.length;
2651
+ } else if (aStr.charAt(index) === ",") index++;
2652
+ else {
2653
+ mapping = new Mapping();
2654
+ mapping.generatedLine = generatedLine;
2655
+ for (end = index; end < length; end++) if (this._charIsMappingSeparator(aStr, end)) break;
2656
+ aStr.slice(index, end);
2657
+ segment = [];
2658
+ while (index < end) {
2659
+ base64VLQ.decode(aStr, index, temp);
2660
+ value = temp.value;
2661
+ index = temp.rest;
2662
+ segment.push(value);
2663
+ }
2664
+ if (segment.length === 2) throw new Error("Found a source, but no line and column");
2665
+ if (segment.length === 3) throw new Error("Found a source and line, but no column");
2666
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
2667
+ previousGeneratedColumn = mapping.generatedColumn;
2668
+ if (segment.length > 1) {
2669
+ mapping.source = previousSource + segment[1];
2670
+ previousSource += segment[1];
2671
+ mapping.originalLine = previousOriginalLine + segment[2];
2672
+ previousOriginalLine = mapping.originalLine;
2673
+ mapping.originalLine += 1;
2674
+ mapping.originalColumn = previousOriginalColumn + segment[3];
2675
+ previousOriginalColumn = mapping.originalColumn;
2676
+ if (segment.length > 4) {
2677
+ mapping.name = previousName + segment[4];
2678
+ previousName += segment[4];
2679
+ }
2680
+ }
2681
+ generatedMappings.push(mapping);
2682
+ if (typeof mapping.originalLine === "number") {
2683
+ let currentSource = mapping.source;
2684
+ while (originalMappings.length <= currentSource) originalMappings.push(null);
2685
+ if (originalMappings[currentSource] === null) originalMappings[currentSource] = [];
2686
+ originalMappings[currentSource].push(mapping);
2687
+ }
2688
+ }
2689
+ sortGenerated(generatedMappings, subarrayStart);
2690
+ this.__generatedMappings = generatedMappings;
2691
+ for (var i = 0; i < originalMappings.length; i++) if (originalMappings[i] != null) quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);
2692
+ this.__originalMappings = [].concat(...originalMappings);
2693
+ };
2694
+ /**
2695
+ * Find the mapping that best matches the hypothetical "needle" mapping that
2696
+ * we are searching for in the given "haystack" of mappings.
2697
+ */
2698
+ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
2699
+ if (aNeedle[aLineName] <= 0) throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
2700
+ if (aNeedle[aColumnName] < 0) throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
2701
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
2702
+ };
2703
+ /**
2704
+ * Compute the last column for each generated mapping. The last column is
2705
+ * inclusive.
2706
+ */
2707
+ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
2708
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
2709
+ var mapping = this._generatedMappings[index];
2710
+ if (index + 1 < this._generatedMappings.length) {
2711
+ var nextMapping = this._generatedMappings[index + 1];
2712
+ if (mapping.generatedLine === nextMapping.generatedLine) {
2713
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
2714
+ continue;
2715
+ }
2716
+ }
2717
+ mapping.lastGeneratedColumn = Infinity;
2718
+ }
2719
+ };
2720
+ /**
2721
+ * Returns the original source, line, and column information for the generated
2722
+ * source's line and column positions provided. The only argument is an object
2723
+ * with the following properties:
2724
+ *
2725
+ * - line: The line number in the generated source. The line number
2726
+ * is 1-based.
2727
+ * - column: The column number in the generated source. The column
2728
+ * number is 0-based.
2729
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
2730
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
2731
+ * closest element that is smaller than or greater than the one we are
2732
+ * searching for, respectively, if the exact element cannot be found.
2733
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
2734
+ *
2735
+ * and an object is returned with the following properties:
2736
+ *
2737
+ * - source: The original source file, or null.
2738
+ * - line: The line number in the original source, or null. The
2739
+ * line number is 1-based.
2740
+ * - column: The column number in the original source, or null. The
2741
+ * column number is 0-based.
2742
+ * - name: The original identifier, or null.
2743
+ */
2744
+ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
2745
+ var needle = {
2746
+ generatedLine: util.getArg(aArgs, "line"),
2747
+ generatedColumn: util.getArg(aArgs, "column")
2748
+ };
2749
+ var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
2750
+ if (index >= 0) {
2751
+ var mapping = this._generatedMappings[index];
2752
+ if (mapping.generatedLine === needle.generatedLine) {
2753
+ var source = util.getArg(mapping, "source", null);
2754
+ if (source !== null) {
2755
+ source = this._sources.at(source);
2756
+ source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
2757
+ }
2758
+ var name = util.getArg(mapping, "name", null);
2759
+ if (name !== null) name = this._names.at(name);
2760
+ return {
2761
+ source,
2762
+ line: util.getArg(mapping, "originalLine", null),
2763
+ column: util.getArg(mapping, "originalColumn", null),
2764
+ name
2765
+ };
2766
+ }
2767
+ }
2768
+ return {
2769
+ source: null,
2770
+ line: null,
2771
+ column: null,
2772
+ name: null
2773
+ };
2774
+ };
2775
+ /**
2776
+ * Return true if we have the source content for every source in the source
2777
+ * map, false otherwise.
2778
+ */
2779
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
2780
+ if (!this.sourcesContent) return false;
2781
+ return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
2782
+ return sc == null;
2783
+ });
2784
+ };
2785
+ /**
2786
+ * Returns the original source content. The only argument is the url of the
2787
+ * original source file. Returns null if no original source content is
2788
+ * available.
2789
+ */
2790
+ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
2791
+ if (!this.sourcesContent) return null;
2792
+ var index = this._findSourceIndex(aSource);
2793
+ if (index >= 0) return this.sourcesContent[index];
2794
+ var relativeSource = aSource;
2795
+ if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource);
2796
+ var url;
2797
+ if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
2798
+ var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
2799
+ if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
2800
+ if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
2801
+ }
2802
+ if (nullOnMissing) return null;
2803
+ else throw new Error("\"" + relativeSource + "\" is not in the SourceMap.");
2804
+ };
2805
+ /**
2806
+ * Returns the generated line and column information for the original source,
2807
+ * line, and column positions provided. The only argument is an object with
2808
+ * the following properties:
2809
+ *
2810
+ * - source: The filename of the original source.
2811
+ * - line: The line number in the original source. The line number
2812
+ * is 1-based.
2813
+ * - column: The column number in the original source. The column
2814
+ * number is 0-based.
2815
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
2816
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
2817
+ * closest element that is smaller than or greater than the one we are
2818
+ * searching for, respectively, if the exact element cannot be found.
2819
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
2820
+ *
2821
+ * and an object is returned with the following properties:
2822
+ *
2823
+ * - line: The line number in the generated source, or null. The
2824
+ * line number is 1-based.
2825
+ * - column: The column number in the generated source, or null.
2826
+ * The column number is 0-based.
2827
+ */
2828
+ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
2829
+ var source = util.getArg(aArgs, "source");
2830
+ source = this._findSourceIndex(source);
2831
+ if (source < 0) return {
2832
+ line: null,
2833
+ column: null,
2834
+ lastColumn: null
2835
+ };
2836
+ var needle = {
2837
+ source,
2838
+ originalLine: util.getArg(aArgs, "line"),
2839
+ originalColumn: util.getArg(aArgs, "column")
2840
+ };
2841
+ var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
2842
+ if (index >= 0) {
2843
+ var mapping = this._originalMappings[index];
2844
+ if (mapping.source === needle.source) return {
2845
+ line: util.getArg(mapping, "generatedLine", null),
2846
+ column: util.getArg(mapping, "generatedColumn", null),
2847
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2848
+ };
2849
+ }
2850
+ return {
2851
+ line: null,
2852
+ column: null,
2853
+ lastColumn: null
2854
+ };
2855
+ };
2856
+ exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
2857
+ /**
2858
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
2859
+ * we can query for information. It differs from BasicSourceMapConsumer in
2860
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
2861
+ * input.
2862
+ *
2863
+ * The first parameter is a raw source map (either as a JSON string, or already
2864
+ * parsed to an object). According to the spec for indexed source maps, they
2865
+ * have the following attributes:
2866
+ *
2867
+ * - version: Which version of the source map spec this map is following.
2868
+ * - file: Optional. The generated file this source map is associated with.
2869
+ * - sections: A list of section definitions.
2870
+ *
2871
+ * Each value under the "sections" field has two fields:
2872
+ * - offset: The offset into the original specified at which this section
2873
+ * begins to apply, defined as an object with a "line" and "column"
2874
+ * field.
2875
+ * - map: A source map definition. This source map could also be indexed,
2876
+ * but doesn't have to be.
2877
+ *
2878
+ * Instead of the "map" field, it's also possible to have a "url" field
2879
+ * specifying a URL to retrieve a source map from, but that's currently
2880
+ * unsupported.
2881
+ *
2882
+ * Here's an example source map, taken from the source map spec[0], but
2883
+ * modified to omit a section which uses the "url" field.
2884
+ *
2885
+ * {
2886
+ * version : 3,
2887
+ * file: "app.js",
2888
+ * sections: [{
2889
+ * offset: {line:100, column:10},
2890
+ * map: {
2891
+ * version : 3,
2892
+ * file: "section.js",
2893
+ * sources: ["foo.js", "bar.js"],
2894
+ * names: ["src", "maps", "are", "fun"],
2895
+ * mappings: "AAAA,E;;ABCDE;"
2896
+ * }
2897
+ * }],
2898
+ * }
2899
+ *
2900
+ * The second parameter, if given, is a string whose value is the URL
2901
+ * at which the source map was found. This URL is used to compute the
2902
+ * sources array.
2903
+ *
2904
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
2905
+ */
2906
+ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
2907
+ var sourceMap = aSourceMap;
2908
+ if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
2909
+ var version = util.getArg(sourceMap, "version");
2910
+ var sections = util.getArg(sourceMap, "sections");
2911
+ if (version != this._version) throw new Error("Unsupported version: " + version);
2912
+ this._sources = new ArraySet();
2913
+ this._names = new ArraySet();
2914
+ var lastOffset = {
2915
+ line: -1,
2916
+ column: 0
2917
+ };
2918
+ this._sections = sections.map(function(s) {
2919
+ if (s.url) throw new Error("Support for url field in sections not implemented.");
2920
+ var offset = util.getArg(s, "offset");
2921
+ var offsetLine = util.getArg(offset, "line");
2922
+ var offsetColumn = util.getArg(offset, "column");
2923
+ if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error("Section offsets must be ordered and non-overlapping.");
2924
+ lastOffset = offset;
2925
+ return {
2926
+ generatedOffset: {
2927
+ generatedLine: offsetLine + 1,
2928
+ generatedColumn: offsetColumn + 1
2929
+ },
2930
+ consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
2931
+ };
2932
+ });
2933
+ }
2934
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
2935
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
2936
+ /**
2937
+ * The version of the source mapping spec that we are consuming.
2938
+ */
2939
+ IndexedSourceMapConsumer.prototype._version = 3;
2940
+ /**
2941
+ * The list of original sources.
2942
+ */
2943
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() {
2944
+ var sources = [];
2945
+ for (var i = 0; i < this._sections.length; i++) for (var j = 0; j < this._sections[i].consumer.sources.length; j++) sources.push(this._sections[i].consumer.sources[j]);
2946
+ return sources;
2947
+ } });
2948
+ /**
2949
+ * Returns the original source, line, and column information for the generated
2950
+ * source's line and column positions provided. The only argument is an object
2951
+ * with the following properties:
2952
+ *
2953
+ * - line: The line number in the generated source. The line number
2954
+ * is 1-based.
2955
+ * - column: The column number in the generated source. The column
2956
+ * number is 0-based.
2957
+ *
2958
+ * and an object is returned with the following properties:
2959
+ *
2960
+ * - source: The original source file, or null.
2961
+ * - line: The line number in the original source, or null. The
2962
+ * line number is 1-based.
2963
+ * - column: The column number in the original source, or null. The
2964
+ * column number is 0-based.
2965
+ * - name: The original identifier, or null.
2966
+ */
2967
+ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
2968
+ var needle = {
2969
+ generatedLine: util.getArg(aArgs, "line"),
2970
+ generatedColumn: util.getArg(aArgs, "column")
2971
+ };
2972
+ var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) {
2973
+ var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
2974
+ if (cmp) return cmp;
2975
+ return needle.generatedColumn - section.generatedOffset.generatedColumn;
2976
+ });
2977
+ var section = this._sections[sectionIndex];
2978
+ if (!section) return {
2979
+ source: null,
2980
+ line: null,
2981
+ column: null,
2982
+ name: null
2983
+ };
2984
+ return section.consumer.originalPositionFor({
2985
+ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
2986
+ column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
2987
+ bias: aArgs.bias
2988
+ });
2989
+ };
2990
+ /**
2991
+ * Return true if we have the source content for every source in the source
2992
+ * map, false otherwise.
2993
+ */
2994
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
2995
+ return this._sections.every(function(s) {
2996
+ return s.consumer.hasContentsOfAllSources();
2997
+ });
2998
+ };
2999
+ /**
3000
+ * Returns the original source content. The only argument is the url of the
3001
+ * original source file. Returns null if no original source content is
3002
+ * available.
3003
+ */
3004
+ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
3005
+ for (var i = 0; i < this._sections.length; i++) {
3006
+ var content = this._sections[i].consumer.sourceContentFor(aSource, true);
3007
+ if (content || content === "") return content;
3008
+ }
3009
+ if (nullOnMissing) return null;
3010
+ else throw new Error("\"" + aSource + "\" is not in the SourceMap.");
3011
+ };
3012
+ /**
3013
+ * Returns the generated line and column information for the original source,
3014
+ * line, and column positions provided. The only argument is an object with
3015
+ * the following properties:
3016
+ *
3017
+ * - source: The filename of the original source.
3018
+ * - line: The line number in the original source. The line number
3019
+ * is 1-based.
3020
+ * - column: The column number in the original source. The column
3021
+ * number is 0-based.
3022
+ *
3023
+ * and an object is returned with the following properties:
3024
+ *
3025
+ * - line: The line number in the generated source, or null. The
3026
+ * line number is 1-based.
3027
+ * - column: The column number in the generated source, or null.
3028
+ * The column number is 0-based.
3029
+ */
3030
+ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
3031
+ for (var i = 0; i < this._sections.length; i++) {
3032
+ var section = this._sections[i];
3033
+ if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) continue;
3034
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
3035
+ if (generatedPosition) return {
3036
+ line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
3037
+ column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
3038
+ };
3039
+ }
3040
+ return {
3041
+ line: null,
3042
+ column: null
3043
+ };
3044
+ };
3045
+ /**
3046
+ * Parse the mappings in a string in to a data structure which we can easily
3047
+ * query (the ordered arrays in the `this.__generatedMappings` and
3048
+ * `this.__originalMappings` properties).
3049
+ */
3050
+ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
3051
+ this.__generatedMappings = [];
3052
+ this.__originalMappings = [];
3053
+ for (var i = 0; i < this._sections.length; i++) {
3054
+ var section = this._sections[i];
3055
+ var sectionMappings = section.consumer._generatedMappings;
3056
+ for (var j = 0; j < sectionMappings.length; j++) {
3057
+ var mapping = sectionMappings[j];
3058
+ var source = section.consumer._sources.at(mapping.source);
3059
+ if (source !== null) source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
3060
+ this._sources.add(source);
3061
+ source = this._sources.indexOf(source);
3062
+ var name = null;
3063
+ if (mapping.name) {
3064
+ name = section.consumer._names.at(mapping.name);
3065
+ this._names.add(name);
3066
+ name = this._names.indexOf(name);
3067
+ }
3068
+ var adjustedMapping = {
3069
+ source,
3070
+ generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
3071
+ generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
3072
+ originalLine: mapping.originalLine,
3073
+ originalColumn: mapping.originalColumn,
3074
+ name
3075
+ };
3076
+ this.__generatedMappings.push(adjustedMapping);
3077
+ if (typeof adjustedMapping.originalLine === "number") this.__originalMappings.push(adjustedMapping);
3078
+ }
3079
+ }
3080
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
3081
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
3082
+ };
3083
+ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
3084
+ }));
3085
+ //#endregion
3086
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js
3087
+ var require_source_node = /* @__PURE__ */ __commonJSMin(((exports) => {
3088
+ var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
3089
+ var util = require_util();
3090
+ var REGEX_NEWLINE = /(\r?\n)/;
3091
+ var NEWLINE_CODE = 10;
3092
+ var isSourceNode = "$$$isSourceNode$$$";
3093
+ /**
3094
+ * SourceNodes provide a way to abstract over interpolating/concatenating
3095
+ * snippets of generated JavaScript source code while maintaining the line and
3096
+ * column information associated with the original source code.
3097
+ *
3098
+ * @param aLine The original line number.
3099
+ * @param aColumn The original column number.
3100
+ * @param aSource The original source's filename.
3101
+ * @param aChunks Optional. An array of strings which are snippets of
3102
+ * generated JS, or other SourceNodes.
3103
+ * @param aName The original identifier.
3104
+ */
3105
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
3106
+ this.children = [];
3107
+ this.sourceContents = {};
3108
+ this.line = aLine == null ? null : aLine;
3109
+ this.column = aColumn == null ? null : aColumn;
3110
+ this.source = aSource == null ? null : aSource;
3111
+ this.name = aName == null ? null : aName;
3112
+ this[isSourceNode] = true;
3113
+ if (aChunks != null) this.add(aChunks);
3114
+ }
3115
+ /**
3116
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
3117
+ *
3118
+ * @param aGeneratedCode The generated code
3119
+ * @param aSourceMapConsumer The SourceMap for the generated code
3120
+ * @param aRelativePath Optional. The path that relative sources in the
3121
+ * SourceMapConsumer should be relative to.
3122
+ */
3123
+ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
3124
+ var node = new SourceNode();
3125
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
3126
+ var remainingLinesIndex = 0;
3127
+ var shiftNextLine = function() {
3128
+ return getNextLine() + (getNextLine() || "");
3129
+ function getNextLine() {
3130
+ return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
3131
+ }
3132
+ };
3133
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
3134
+ var lastMapping = null;
3135
+ aSourceMapConsumer.eachMapping(function(mapping) {
3136
+ if (lastMapping !== null) if (lastGeneratedLine < mapping.generatedLine) {
3137
+ addMappingWithCode(lastMapping, shiftNextLine());
3138
+ lastGeneratedLine++;
3139
+ lastGeneratedColumn = 0;
3140
+ } else {
3141
+ var nextLine = remainingLines[remainingLinesIndex] || "";
3142
+ var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
3143
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
3144
+ lastGeneratedColumn = mapping.generatedColumn;
3145
+ addMappingWithCode(lastMapping, code);
3146
+ lastMapping = mapping;
3147
+ return;
3148
+ }
3149
+ while (lastGeneratedLine < mapping.generatedLine) {
3150
+ node.add(shiftNextLine());
3151
+ lastGeneratedLine++;
3152
+ }
3153
+ if (lastGeneratedColumn < mapping.generatedColumn) {
3154
+ var nextLine = remainingLines[remainingLinesIndex] || "";
3155
+ node.add(nextLine.substr(0, mapping.generatedColumn));
3156
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
3157
+ lastGeneratedColumn = mapping.generatedColumn;
3158
+ }
3159
+ lastMapping = mapping;
3160
+ }, this);
3161
+ if (remainingLinesIndex < remainingLines.length) {
3162
+ if (lastMapping) addMappingWithCode(lastMapping, shiftNextLine());
3163
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
3164
+ }
3165
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
3166
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
3167
+ if (content != null) {
3168
+ if (aRelativePath != null) sourceFile = util.join(aRelativePath, sourceFile);
3169
+ node.setSourceContent(sourceFile, content);
3170
+ }
3171
+ });
3172
+ return node;
3173
+ function addMappingWithCode(mapping, code) {
3174
+ if (mapping === null || mapping.source === void 0) node.add(code);
3175
+ else {
3176
+ var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
3177
+ node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
3178
+ }
3179
+ }
3180
+ };
3181
+ /**
3182
+ * Add a chunk of generated JS to this source node.
3183
+ *
3184
+ * @param aChunk A string snippet of generated JS code, another instance of
3185
+ * SourceNode, or an array where each member is one of those things.
3186
+ */
3187
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
3188
+ if (Array.isArray(aChunk)) aChunk.forEach(function(chunk) {
3189
+ this.add(chunk);
3190
+ }, this);
3191
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
3192
+ if (aChunk) this.children.push(aChunk);
3193
+ } else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
3194
+ return this;
3195
+ };
3196
+ /**
3197
+ * Add a chunk of generated JS to the beginning of this source node.
3198
+ *
3199
+ * @param aChunk A string snippet of generated JS code, another instance of
3200
+ * SourceNode, or an array where each member is one of those things.
3201
+ */
3202
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
3203
+ if (Array.isArray(aChunk)) for (var i = aChunk.length - 1; i >= 0; i--) this.prepend(aChunk[i]);
3204
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") this.children.unshift(aChunk);
3205
+ else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
3206
+ return this;
3207
+ };
3208
+ /**
3209
+ * Walk over the tree of JS snippets in this node and its children. The
3210
+ * walking function is called once for each snippet of JS and is passed that
3211
+ * snippet and the its original associated source's line/column location.
3212
+ *
3213
+ * @param aFn The traversal function.
3214
+ */
3215
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
3216
+ var chunk;
3217
+ for (var i = 0, len = this.children.length; i < len; i++) {
3218
+ chunk = this.children[i];
3219
+ if (chunk[isSourceNode]) chunk.walk(aFn);
3220
+ else if (chunk !== "") aFn(chunk, {
3221
+ source: this.source,
3222
+ line: this.line,
3223
+ column: this.column,
3224
+ name: this.name
3225
+ });
3226
+ }
3227
+ };
3228
+ /**
3229
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
3230
+ * each of `this.children`.
3231
+ *
3232
+ * @param aSep The separator.
3233
+ */
3234
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
3235
+ var newChildren;
3236
+ var i;
3237
+ var len = this.children.length;
3238
+ if (len > 0) {
3239
+ newChildren = [];
3240
+ for (i = 0; i < len - 1; i++) {
3241
+ newChildren.push(this.children[i]);
3242
+ newChildren.push(aSep);
3243
+ }
3244
+ newChildren.push(this.children[i]);
3245
+ this.children = newChildren;
3246
+ }
3247
+ return this;
3248
+ };
3249
+ /**
3250
+ * Call String.prototype.replace on the very right-most source snippet. Useful
3251
+ * for trimming whitespace from the end of a source node, etc.
3252
+ *
3253
+ * @param aPattern The pattern to replace.
3254
+ * @param aReplacement The thing to replace the pattern with.
3255
+ */
3256
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
3257
+ var lastChild = this.children[this.children.length - 1];
3258
+ if (lastChild[isSourceNode]) lastChild.replaceRight(aPattern, aReplacement);
3259
+ else if (typeof lastChild === "string") this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
3260
+ else this.children.push("".replace(aPattern, aReplacement));
3261
+ return this;
3262
+ };
3263
+ /**
3264
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
3265
+ * in the sourcesContent field.
3266
+ *
3267
+ * @param aSourceFile The filename of the source file
3268
+ * @param aSourceContent The content of the source file
3269
+ */
3270
+ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
3271
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
3272
+ };
3273
+ /**
3274
+ * Walk over the tree of SourceNodes. The walking function is called for each
3275
+ * source file content and is passed the filename and source content.
3276
+ *
3277
+ * @param aFn The traversal function.
3278
+ */
3279
+ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
3280
+ for (var i = 0, len = this.children.length; i < len; i++) if (this.children[i][isSourceNode]) this.children[i].walkSourceContents(aFn);
3281
+ var sources = Object.keys(this.sourceContents);
3282
+ for (var i = 0, len = sources.length; i < len; i++) aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
3283
+ };
3284
+ /**
3285
+ * Return the string representation of this source node. Walks over the tree
3286
+ * and concatenates all the various snippets together to one string.
3287
+ */
3288
+ SourceNode.prototype.toString = function SourceNode_toString() {
3289
+ var str = "";
3290
+ this.walk(function(chunk) {
3291
+ str += chunk;
3292
+ });
3293
+ return str;
3294
+ };
3295
+ /**
3296
+ * Returns the string representation of this source node along with a source
3297
+ * map.
3298
+ */
3299
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
3300
+ var generated = {
3301
+ code: "",
3302
+ line: 1,
3303
+ column: 0
3304
+ };
3305
+ var map = new SourceMapGenerator(aArgs);
3306
+ var sourceMappingActive = false;
3307
+ var lastOriginalSource = null;
3308
+ var lastOriginalLine = null;
3309
+ var lastOriginalColumn = null;
3310
+ var lastOriginalName = null;
3311
+ this.walk(function(chunk, original) {
3312
+ generated.code += chunk;
3313
+ if (original.source !== null && original.line !== null && original.column !== null) {
3314
+ if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) map.addMapping({
3315
+ source: original.source,
3316
+ original: {
3317
+ line: original.line,
3318
+ column: original.column
3319
+ },
3320
+ generated: {
3321
+ line: generated.line,
3322
+ column: generated.column
3323
+ },
3324
+ name: original.name
3325
+ });
3326
+ lastOriginalSource = original.source;
3327
+ lastOriginalLine = original.line;
3328
+ lastOriginalColumn = original.column;
3329
+ lastOriginalName = original.name;
3330
+ sourceMappingActive = true;
3331
+ } else if (sourceMappingActive) {
3332
+ map.addMapping({ generated: {
3333
+ line: generated.line,
3334
+ column: generated.column
3335
+ } });
3336
+ lastOriginalSource = null;
3337
+ sourceMappingActive = false;
3338
+ }
3339
+ for (var idx = 0, length = chunk.length; idx < length; idx++) if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
3340
+ generated.line++;
3341
+ generated.column = 0;
3342
+ if (idx + 1 === length) {
3343
+ lastOriginalSource = null;
3344
+ sourceMappingActive = false;
3345
+ } else if (sourceMappingActive) map.addMapping({
3346
+ source: original.source,
3347
+ original: {
3348
+ line: original.line,
3349
+ column: original.column
3350
+ },
3351
+ generated: {
3352
+ line: generated.line,
3353
+ column: generated.column
3354
+ },
3355
+ name: original.name
3356
+ });
3357
+ } else generated.column++;
3358
+ });
3359
+ this.walkSourceContents(function(sourceFile, sourceContent) {
3360
+ map.setSourceContent(sourceFile, sourceContent);
3361
+ });
3362
+ return {
3363
+ code: generated.code,
3364
+ map
3365
+ };
3366
+ };
3367
+ exports.SourceNode = SourceNode;
3368
+ }));
3369
+ //#endregion
1276
3370
  //#region src/devtools/browser/components/sourceMapResolver.ts
3371
+ var import_source_map = (/* @__PURE__ */ __commonJSMin(((exports) => {
3372
+ exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
3373
+ exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
3374
+ exports.SourceNode = require_source_node().SourceNode;
3375
+ })))();
1277
3376
  const consumerCache = /* @__PURE__ */ new Map();
1278
3377
  async function loadConsumer(fileUrl) {
1279
3378
  try {
@@ -1296,7 +3395,7 @@ async function loadConsumer(fileUrl) {
1296
3395
  if (!mapResp.ok) return null;
1297
3396
  mapJson = await mapResp.text();
1298
3397
  }
1299
- return new SourceMapConsumer(JSON.parse(mapJson));
3398
+ return new import_source_map.SourceMapConsumer(JSON.parse(mapJson));
1300
3399
  } catch {
1301
3400
  return null;
1302
3401
  }