vscode-behavior3 2.1.2 → 2.2.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.
package/dist/extension.js CHANGED
@@ -5,7 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
8
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
9
9
  var __typeError = (msg) => {
10
10
  throw TypeError(msg);
11
11
  };
@@ -1186,2272 +1186,6 @@ var require_lib = __commonJS({
1186
1186
  }
1187
1187
  });
1188
1188
 
1189
- // node_modules/source-map/lib/base64.js
1190
- var require_base64 = __commonJS({
1191
- "node_modules/source-map/lib/base64.js"(exports2) {
1192
- var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
1193
- exports2.encode = function(number) {
1194
- if (0 <= number && number < intToCharMap.length) {
1195
- return intToCharMap[number];
1196
- }
1197
- throw new TypeError("Must be between 0 and 63: " + number);
1198
- };
1199
- exports2.decode = function(charCode) {
1200
- var bigA = 65;
1201
- var bigZ = 90;
1202
- var littleA = 97;
1203
- var littleZ = 122;
1204
- var zero = 48;
1205
- var nine = 57;
1206
- var plus = 43;
1207
- var slash = 47;
1208
- var littleOffset = 26;
1209
- var numberOffset = 52;
1210
- if (bigA <= charCode && charCode <= bigZ) {
1211
- return charCode - bigA;
1212
- }
1213
- if (littleA <= charCode && charCode <= littleZ) {
1214
- return charCode - littleA + littleOffset;
1215
- }
1216
- if (zero <= charCode && charCode <= nine) {
1217
- return charCode - zero + numberOffset;
1218
- }
1219
- if (charCode == plus) {
1220
- return 62;
1221
- }
1222
- if (charCode == slash) {
1223
- return 63;
1224
- }
1225
- return -1;
1226
- };
1227
- }
1228
- });
1229
-
1230
- // node_modules/source-map/lib/base64-vlq.js
1231
- var require_base64_vlq = __commonJS({
1232
- "node_modules/source-map/lib/base64-vlq.js"(exports2) {
1233
- var base64 = require_base64();
1234
- var VLQ_BASE_SHIFT = 5;
1235
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
1236
- var VLQ_BASE_MASK = VLQ_BASE - 1;
1237
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
1238
- function toVLQSigned(aValue) {
1239
- return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
1240
- }
1241
- function fromVLQSigned(aValue) {
1242
- var isNegative = (aValue & 1) === 1;
1243
- var shifted = aValue >> 1;
1244
- return isNegative ? -shifted : shifted;
1245
- }
1246
- exports2.encode = function base64VLQ_encode(aValue) {
1247
- var encoded = "";
1248
- var digit;
1249
- var vlq = toVLQSigned(aValue);
1250
- do {
1251
- digit = vlq & VLQ_BASE_MASK;
1252
- vlq >>>= VLQ_BASE_SHIFT;
1253
- if (vlq > 0) {
1254
- digit |= VLQ_CONTINUATION_BIT;
1255
- }
1256
- encoded += base64.encode(digit);
1257
- } while (vlq > 0);
1258
- return encoded;
1259
- };
1260
- exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
1261
- var strLen = aStr.length;
1262
- var result = 0;
1263
- var shift = 0;
1264
- var continuation, digit;
1265
- do {
1266
- if (aIndex >= strLen) {
1267
- throw new Error("Expected more digits in base 64 VLQ value.");
1268
- }
1269
- digit = base64.decode(aStr.charCodeAt(aIndex++));
1270
- if (digit === -1) {
1271
- throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
1272
- }
1273
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
1274
- digit &= VLQ_BASE_MASK;
1275
- result = result + (digit << shift);
1276
- shift += VLQ_BASE_SHIFT;
1277
- } while (continuation);
1278
- aOutParam.value = fromVLQSigned(result);
1279
- aOutParam.rest = aIndex;
1280
- };
1281
- }
1282
- });
1283
-
1284
- // node_modules/source-map/lib/util.js
1285
- var require_util2 = __commonJS({
1286
- "node_modules/source-map/lib/util.js"(exports2) {
1287
- function getArg(aArgs, aName, aDefaultValue) {
1288
- if (aName in aArgs) {
1289
- return aArgs[aName];
1290
- } else if (arguments.length === 3) {
1291
- return aDefaultValue;
1292
- } else {
1293
- throw new Error('"' + aName + '" is a required argument.');
1294
- }
1295
- }
1296
- exports2.getArg = getArg;
1297
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
1298
- var dataUrlRegexp = /^data:.+\,.+$/;
1299
- function urlParse(aUrl) {
1300
- var match = aUrl.match(urlRegexp);
1301
- if (!match) {
1302
- return null;
1303
- }
1304
- return {
1305
- scheme: match[1],
1306
- auth: match[2],
1307
- host: match[3],
1308
- port: match[4],
1309
- path: match[5]
1310
- };
1311
- }
1312
- exports2.urlParse = urlParse;
1313
- function urlGenerate(aParsedUrl) {
1314
- var url = "";
1315
- if (aParsedUrl.scheme) {
1316
- url += aParsedUrl.scheme + ":";
1317
- }
1318
- url += "//";
1319
- if (aParsedUrl.auth) {
1320
- url += aParsedUrl.auth + "@";
1321
- }
1322
- if (aParsedUrl.host) {
1323
- url += aParsedUrl.host;
1324
- }
1325
- if (aParsedUrl.port) {
1326
- url += ":" + aParsedUrl.port;
1327
- }
1328
- if (aParsedUrl.path) {
1329
- url += aParsedUrl.path;
1330
- }
1331
- return url;
1332
- }
1333
- exports2.urlGenerate = urlGenerate;
1334
- function normalize3(aPath) {
1335
- var path14 = aPath;
1336
- var url = urlParse(aPath);
1337
- if (url) {
1338
- if (!url.path) {
1339
- return aPath;
1340
- }
1341
- path14 = url.path;
1342
- }
1343
- var isAbsolute7 = exports2.isAbsolute(path14);
1344
- var parts = path14.split(/\/+/);
1345
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
1346
- part = parts[i];
1347
- if (part === ".") {
1348
- parts.splice(i, 1);
1349
- } else if (part === "..") {
1350
- up++;
1351
- } else if (up > 0) {
1352
- if (part === "") {
1353
- parts.splice(i + 1, up);
1354
- up = 0;
1355
- } else {
1356
- parts.splice(i, 2);
1357
- up--;
1358
- }
1359
- }
1360
- }
1361
- path14 = parts.join("/");
1362
- if (path14 === "") {
1363
- path14 = isAbsolute7 ? "/" : ".";
1364
- }
1365
- if (url) {
1366
- url.path = path14;
1367
- return urlGenerate(url);
1368
- }
1369
- return path14;
1370
- }
1371
- exports2.normalize = normalize3;
1372
- function join10(aRoot, aPath) {
1373
- if (aRoot === "") {
1374
- aRoot = ".";
1375
- }
1376
- if (aPath === "") {
1377
- aPath = ".";
1378
- }
1379
- var aPathUrl = urlParse(aPath);
1380
- var aRootUrl = urlParse(aRoot);
1381
- if (aRootUrl) {
1382
- aRoot = aRootUrl.path || "/";
1383
- }
1384
- if (aPathUrl && !aPathUrl.scheme) {
1385
- if (aRootUrl) {
1386
- aPathUrl.scheme = aRootUrl.scheme;
1387
- }
1388
- return urlGenerate(aPathUrl);
1389
- }
1390
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
1391
- return aPath;
1392
- }
1393
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
1394
- aRootUrl.host = aPath;
1395
- return urlGenerate(aRootUrl);
1396
- }
1397
- var joined = aPath.charAt(0) === "/" ? aPath : normalize3(aRoot.replace(/\/+$/, "") + "/" + aPath);
1398
- if (aRootUrl) {
1399
- aRootUrl.path = joined;
1400
- return urlGenerate(aRootUrl);
1401
- }
1402
- return joined;
1403
- }
1404
- exports2.join = join10;
1405
- exports2.isAbsolute = function(aPath) {
1406
- return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
1407
- };
1408
- function relative7(aRoot, aPath) {
1409
- if (aRoot === "") {
1410
- aRoot = ".";
1411
- }
1412
- aRoot = aRoot.replace(/\/$/, "");
1413
- var level = 0;
1414
- while (aPath.indexOf(aRoot + "/") !== 0) {
1415
- var index = aRoot.lastIndexOf("/");
1416
- if (index < 0) {
1417
- return aPath;
1418
- }
1419
- aRoot = aRoot.slice(0, index);
1420
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
1421
- return aPath;
1422
- }
1423
- ++level;
1424
- }
1425
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
1426
- }
1427
- exports2.relative = relative7;
1428
- var supportsNullProto = function() {
1429
- var obj = /* @__PURE__ */ Object.create(null);
1430
- return !("__proto__" in obj);
1431
- }();
1432
- function identity(s) {
1433
- return s;
1434
- }
1435
- function toSetString(aStr) {
1436
- if (isProtoString(aStr)) {
1437
- return "$" + aStr;
1438
- }
1439
- return aStr;
1440
- }
1441
- exports2.toSetString = supportsNullProto ? identity : toSetString;
1442
- function fromSetString(aStr) {
1443
- if (isProtoString(aStr)) {
1444
- return aStr.slice(1);
1445
- }
1446
- return aStr;
1447
- }
1448
- exports2.fromSetString = supportsNullProto ? identity : fromSetString;
1449
- function isProtoString(s) {
1450
- if (!s) {
1451
- return false;
1452
- }
1453
- var length = s.length;
1454
- if (length < 9) {
1455
- return false;
1456
- }
1457
- 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) {
1458
- return false;
1459
- }
1460
- for (var i = length - 10; i >= 0; i--) {
1461
- if (s.charCodeAt(i) !== 36) {
1462
- return false;
1463
- }
1464
- }
1465
- return true;
1466
- }
1467
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
1468
- var cmp = strcmp(mappingA.source, mappingB.source);
1469
- if (cmp !== 0) {
1470
- return cmp;
1471
- }
1472
- cmp = mappingA.originalLine - mappingB.originalLine;
1473
- if (cmp !== 0) {
1474
- return cmp;
1475
- }
1476
- cmp = mappingA.originalColumn - mappingB.originalColumn;
1477
- if (cmp !== 0 || onlyCompareOriginal) {
1478
- return cmp;
1479
- }
1480
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1481
- if (cmp !== 0) {
1482
- return cmp;
1483
- }
1484
- cmp = mappingA.generatedLine - mappingB.generatedLine;
1485
- if (cmp !== 0) {
1486
- return cmp;
1487
- }
1488
- return strcmp(mappingA.name, mappingB.name);
1489
- }
1490
- exports2.compareByOriginalPositions = compareByOriginalPositions;
1491
- function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
1492
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
1493
- if (cmp !== 0) {
1494
- return cmp;
1495
- }
1496
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1497
- if (cmp !== 0 || onlyCompareGenerated) {
1498
- return cmp;
1499
- }
1500
- cmp = strcmp(mappingA.source, mappingB.source);
1501
- if (cmp !== 0) {
1502
- return cmp;
1503
- }
1504
- cmp = mappingA.originalLine - mappingB.originalLine;
1505
- if (cmp !== 0) {
1506
- return cmp;
1507
- }
1508
- cmp = mappingA.originalColumn - mappingB.originalColumn;
1509
- if (cmp !== 0) {
1510
- return cmp;
1511
- }
1512
- return strcmp(mappingA.name, mappingB.name);
1513
- }
1514
- exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
1515
- function strcmp(aStr1, aStr2) {
1516
- if (aStr1 === aStr2) {
1517
- return 0;
1518
- }
1519
- if (aStr1 === null) {
1520
- return 1;
1521
- }
1522
- if (aStr2 === null) {
1523
- return -1;
1524
- }
1525
- if (aStr1 > aStr2) {
1526
- return 1;
1527
- }
1528
- return -1;
1529
- }
1530
- function compareByGeneratedPositionsInflated(mappingA, mappingB) {
1531
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
1532
- if (cmp !== 0) {
1533
- return cmp;
1534
- }
1535
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1536
- if (cmp !== 0) {
1537
- return cmp;
1538
- }
1539
- cmp = strcmp(mappingA.source, mappingB.source);
1540
- if (cmp !== 0) {
1541
- return cmp;
1542
- }
1543
- cmp = mappingA.originalLine - mappingB.originalLine;
1544
- if (cmp !== 0) {
1545
- return cmp;
1546
- }
1547
- cmp = mappingA.originalColumn - mappingB.originalColumn;
1548
- if (cmp !== 0) {
1549
- return cmp;
1550
- }
1551
- return strcmp(mappingA.name, mappingB.name);
1552
- }
1553
- exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
1554
- function parseSourceMapInput(str) {
1555
- return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
1556
- }
1557
- exports2.parseSourceMapInput = parseSourceMapInput;
1558
- function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
1559
- sourceURL = sourceURL || "";
1560
- if (sourceRoot) {
1561
- if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
1562
- sourceRoot += "/";
1563
- }
1564
- sourceURL = sourceRoot + sourceURL;
1565
- }
1566
- if (sourceMapURL) {
1567
- var parsed = urlParse(sourceMapURL);
1568
- if (!parsed) {
1569
- throw new Error("sourceMapURL could not be parsed");
1570
- }
1571
- if (parsed.path) {
1572
- var index = parsed.path.lastIndexOf("/");
1573
- if (index >= 0) {
1574
- parsed.path = parsed.path.substring(0, index + 1);
1575
- }
1576
- }
1577
- sourceURL = join10(urlGenerate(parsed), sourceURL);
1578
- }
1579
- return normalize3(sourceURL);
1580
- }
1581
- exports2.computeSourceURL = computeSourceURL;
1582
- }
1583
- });
1584
-
1585
- // node_modules/source-map/lib/array-set.js
1586
- var require_array_set = __commonJS({
1587
- "node_modules/source-map/lib/array-set.js"(exports2) {
1588
- var util = require_util2();
1589
- var has = Object.prototype.hasOwnProperty;
1590
- var hasNativeMap = typeof Map !== "undefined";
1591
- function ArraySet() {
1592
- this._array = [];
1593
- this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
1594
- }
1595
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
1596
- var set = new ArraySet();
1597
- for (var i = 0, len = aArray.length; i < len; i++) {
1598
- set.add(aArray[i], aAllowDuplicates);
1599
- }
1600
- return set;
1601
- };
1602
- ArraySet.prototype.size = function ArraySet_size() {
1603
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
1604
- };
1605
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
1606
- var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
1607
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
1608
- var idx = this._array.length;
1609
- if (!isDuplicate || aAllowDuplicates) {
1610
- this._array.push(aStr);
1611
- }
1612
- if (!isDuplicate) {
1613
- if (hasNativeMap) {
1614
- this._set.set(aStr, idx);
1615
- } else {
1616
- this._set[sStr] = idx;
1617
- }
1618
- }
1619
- };
1620
- ArraySet.prototype.has = function ArraySet_has(aStr) {
1621
- if (hasNativeMap) {
1622
- return this._set.has(aStr);
1623
- } else {
1624
- var sStr = util.toSetString(aStr);
1625
- return has.call(this._set, sStr);
1626
- }
1627
- };
1628
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
1629
- if (hasNativeMap) {
1630
- var idx = this._set.get(aStr);
1631
- if (idx >= 0) {
1632
- return idx;
1633
- }
1634
- } else {
1635
- var sStr = util.toSetString(aStr);
1636
- if (has.call(this._set, sStr)) {
1637
- return this._set[sStr];
1638
- }
1639
- }
1640
- throw new Error('"' + aStr + '" is not in the set.');
1641
- };
1642
- ArraySet.prototype.at = function ArraySet_at(aIdx) {
1643
- if (aIdx >= 0 && aIdx < this._array.length) {
1644
- return this._array[aIdx];
1645
- }
1646
- throw new Error("No element indexed by " + aIdx);
1647
- };
1648
- ArraySet.prototype.toArray = function ArraySet_toArray() {
1649
- return this._array.slice();
1650
- };
1651
- exports2.ArraySet = ArraySet;
1652
- }
1653
- });
1654
-
1655
- // node_modules/source-map/lib/mapping-list.js
1656
- var require_mapping_list = __commonJS({
1657
- "node_modules/source-map/lib/mapping-list.js"(exports2) {
1658
- var util = require_util2();
1659
- function generatedPositionAfter(mappingA, mappingB) {
1660
- var lineA = mappingA.generatedLine;
1661
- var lineB = mappingB.generatedLine;
1662
- var columnA = mappingA.generatedColumn;
1663
- var columnB = mappingB.generatedColumn;
1664
- return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
1665
- }
1666
- function MappingList() {
1667
- this._array = [];
1668
- this._sorted = true;
1669
- this._last = { generatedLine: -1, generatedColumn: 0 };
1670
- }
1671
- MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
1672
- this._array.forEach(aCallback, aThisArg);
1673
- };
1674
- MappingList.prototype.add = function MappingList_add(aMapping) {
1675
- if (generatedPositionAfter(this._last, aMapping)) {
1676
- this._last = aMapping;
1677
- this._array.push(aMapping);
1678
- } else {
1679
- this._sorted = false;
1680
- this._array.push(aMapping);
1681
- }
1682
- };
1683
- MappingList.prototype.toArray = function MappingList_toArray() {
1684
- if (!this._sorted) {
1685
- this._array.sort(util.compareByGeneratedPositionsInflated);
1686
- this._sorted = true;
1687
- }
1688
- return this._array;
1689
- };
1690
- exports2.MappingList = MappingList;
1691
- }
1692
- });
1693
-
1694
- // node_modules/source-map/lib/source-map-generator.js
1695
- var require_source_map_generator = __commonJS({
1696
- "node_modules/source-map/lib/source-map-generator.js"(exports2) {
1697
- var base64VLQ = require_base64_vlq();
1698
- var util = require_util2();
1699
- var ArraySet = require_array_set().ArraySet;
1700
- var MappingList = require_mapping_list().MappingList;
1701
- function SourceMapGenerator(aArgs) {
1702
- if (!aArgs) {
1703
- aArgs = {};
1704
- }
1705
- this._file = util.getArg(aArgs, "file", null);
1706
- this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
1707
- this._skipValidation = util.getArg(aArgs, "skipValidation", false);
1708
- this._sources = new ArraySet();
1709
- this._names = new ArraySet();
1710
- this._mappings = new MappingList();
1711
- this._sourcesContents = null;
1712
- }
1713
- SourceMapGenerator.prototype._version = 3;
1714
- SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
1715
- var sourceRoot = aSourceMapConsumer.sourceRoot;
1716
- var generator = new SourceMapGenerator({
1717
- file: aSourceMapConsumer.file,
1718
- sourceRoot
1719
- });
1720
- aSourceMapConsumer.eachMapping(function(mapping) {
1721
- var newMapping = {
1722
- generated: {
1723
- line: mapping.generatedLine,
1724
- column: mapping.generatedColumn
1725
- }
1726
- };
1727
- if (mapping.source != null) {
1728
- newMapping.source = mapping.source;
1729
- if (sourceRoot != null) {
1730
- newMapping.source = util.relative(sourceRoot, newMapping.source);
1731
- }
1732
- newMapping.original = {
1733
- line: mapping.originalLine,
1734
- column: mapping.originalColumn
1735
- };
1736
- if (mapping.name != null) {
1737
- newMapping.name = mapping.name;
1738
- }
1739
- }
1740
- generator.addMapping(newMapping);
1741
- });
1742
- aSourceMapConsumer.sources.forEach(function(sourceFile) {
1743
- var sourceRelative = sourceFile;
1744
- if (sourceRoot !== null) {
1745
- sourceRelative = util.relative(sourceRoot, sourceFile);
1746
- }
1747
- if (!generator._sources.has(sourceRelative)) {
1748
- generator._sources.add(sourceRelative);
1749
- }
1750
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1751
- if (content != null) {
1752
- generator.setSourceContent(sourceFile, content);
1753
- }
1754
- });
1755
- return generator;
1756
- };
1757
- SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
1758
- var generated = util.getArg(aArgs, "generated");
1759
- var original = util.getArg(aArgs, "original", null);
1760
- var source = util.getArg(aArgs, "source", null);
1761
- var name = util.getArg(aArgs, "name", null);
1762
- if (!this._skipValidation) {
1763
- this._validateMapping(generated, original, source, name);
1764
- }
1765
- if (source != null) {
1766
- source = String(source);
1767
- if (!this._sources.has(source)) {
1768
- this._sources.add(source);
1769
- }
1770
- }
1771
- if (name != null) {
1772
- name = String(name);
1773
- if (!this._names.has(name)) {
1774
- this._names.add(name);
1775
- }
1776
- }
1777
- this._mappings.add({
1778
- generatedLine: generated.line,
1779
- generatedColumn: generated.column,
1780
- originalLine: original != null && original.line,
1781
- originalColumn: original != null && original.column,
1782
- source,
1783
- name
1784
- });
1785
- };
1786
- SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
1787
- var source = aSourceFile;
1788
- if (this._sourceRoot != null) {
1789
- source = util.relative(this._sourceRoot, source);
1790
- }
1791
- if (aSourceContent != null) {
1792
- if (!this._sourcesContents) {
1793
- this._sourcesContents = /* @__PURE__ */ Object.create(null);
1794
- }
1795
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
1796
- } else if (this._sourcesContents) {
1797
- delete this._sourcesContents[util.toSetString(source)];
1798
- if (Object.keys(this._sourcesContents).length === 0) {
1799
- this._sourcesContents = null;
1800
- }
1801
- }
1802
- };
1803
- SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
1804
- var sourceFile = aSourceFile;
1805
- if (aSourceFile == null) {
1806
- if (aSourceMapConsumer.file == null) {
1807
- throw new Error(
1808
- `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
1809
- );
1810
- }
1811
- sourceFile = aSourceMapConsumer.file;
1812
- }
1813
- var sourceRoot = this._sourceRoot;
1814
- if (sourceRoot != null) {
1815
- sourceFile = util.relative(sourceRoot, sourceFile);
1816
- }
1817
- var newSources = new ArraySet();
1818
- var newNames = new ArraySet();
1819
- this._mappings.unsortedForEach(function(mapping) {
1820
- if (mapping.source === sourceFile && mapping.originalLine != null) {
1821
- var original = aSourceMapConsumer.originalPositionFor({
1822
- line: mapping.originalLine,
1823
- column: mapping.originalColumn
1824
- });
1825
- if (original.source != null) {
1826
- mapping.source = original.source;
1827
- if (aSourceMapPath != null) {
1828
- mapping.source = util.join(aSourceMapPath, mapping.source);
1829
- }
1830
- if (sourceRoot != null) {
1831
- mapping.source = util.relative(sourceRoot, mapping.source);
1832
- }
1833
- mapping.originalLine = original.line;
1834
- mapping.originalColumn = original.column;
1835
- if (original.name != null) {
1836
- mapping.name = original.name;
1837
- }
1838
- }
1839
- }
1840
- var source = mapping.source;
1841
- if (source != null && !newSources.has(source)) {
1842
- newSources.add(source);
1843
- }
1844
- var name = mapping.name;
1845
- if (name != null && !newNames.has(name)) {
1846
- newNames.add(name);
1847
- }
1848
- }, this);
1849
- this._sources = newSources;
1850
- this._names = newNames;
1851
- aSourceMapConsumer.sources.forEach(function(sourceFile2) {
1852
- var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
1853
- if (content != null) {
1854
- if (aSourceMapPath != null) {
1855
- sourceFile2 = util.join(aSourceMapPath, sourceFile2);
1856
- }
1857
- if (sourceRoot != null) {
1858
- sourceFile2 = util.relative(sourceRoot, sourceFile2);
1859
- }
1860
- this.setSourceContent(sourceFile2, content);
1861
- }
1862
- }, this);
1863
- };
1864
- SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
1865
- if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
1866
- throw new Error(
1867
- "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."
1868
- );
1869
- }
1870
- if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
1871
- return;
1872
- } 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) {
1873
- return;
1874
- } else {
1875
- throw new Error("Invalid mapping: " + JSON.stringify({
1876
- generated: aGenerated,
1877
- source: aSource,
1878
- original: aOriginal,
1879
- name: aName
1880
- }));
1881
- }
1882
- };
1883
- SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
1884
- var previousGeneratedColumn = 0;
1885
- var previousGeneratedLine = 1;
1886
- var previousOriginalColumn = 0;
1887
- var previousOriginalLine = 0;
1888
- var previousName = 0;
1889
- var previousSource = 0;
1890
- var result = "";
1891
- var next;
1892
- var mapping;
1893
- var nameIdx;
1894
- var sourceIdx;
1895
- var mappings = this._mappings.toArray();
1896
- for (var i = 0, len = mappings.length; i < len; i++) {
1897
- mapping = mappings[i];
1898
- next = "";
1899
- if (mapping.generatedLine !== previousGeneratedLine) {
1900
- previousGeneratedColumn = 0;
1901
- while (mapping.generatedLine !== previousGeneratedLine) {
1902
- next += ";";
1903
- previousGeneratedLine++;
1904
- }
1905
- } else {
1906
- if (i > 0) {
1907
- if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
1908
- continue;
1909
- }
1910
- next += ",";
1911
- }
1912
- }
1913
- next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
1914
- previousGeneratedColumn = mapping.generatedColumn;
1915
- if (mapping.source != null) {
1916
- sourceIdx = this._sources.indexOf(mapping.source);
1917
- next += base64VLQ.encode(sourceIdx - previousSource);
1918
- previousSource = sourceIdx;
1919
- next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
1920
- previousOriginalLine = mapping.originalLine - 1;
1921
- next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
1922
- previousOriginalColumn = mapping.originalColumn;
1923
- if (mapping.name != null) {
1924
- nameIdx = this._names.indexOf(mapping.name);
1925
- next += base64VLQ.encode(nameIdx - previousName);
1926
- previousName = nameIdx;
1927
- }
1928
- }
1929
- result += next;
1930
- }
1931
- return result;
1932
- };
1933
- SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
1934
- return aSources.map(function(source) {
1935
- if (!this._sourcesContents) {
1936
- return null;
1937
- }
1938
- if (aSourceRoot != null) {
1939
- source = util.relative(aSourceRoot, source);
1940
- }
1941
- var key = util.toSetString(source);
1942
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
1943
- }, this);
1944
- };
1945
- SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
1946
- var map = {
1947
- version: this._version,
1948
- sources: this._sources.toArray(),
1949
- names: this._names.toArray(),
1950
- mappings: this._serializeMappings()
1951
- };
1952
- if (this._file != null) {
1953
- map.file = this._file;
1954
- }
1955
- if (this._sourceRoot != null) {
1956
- map.sourceRoot = this._sourceRoot;
1957
- }
1958
- if (this._sourcesContents) {
1959
- map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
1960
- }
1961
- return map;
1962
- };
1963
- SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
1964
- return JSON.stringify(this.toJSON());
1965
- };
1966
- exports2.SourceMapGenerator = SourceMapGenerator;
1967
- }
1968
- });
1969
-
1970
- // node_modules/source-map/lib/binary-search.js
1971
- var require_binary_search = __commonJS({
1972
- "node_modules/source-map/lib/binary-search.js"(exports2) {
1973
- exports2.GREATEST_LOWER_BOUND = 1;
1974
- exports2.LEAST_UPPER_BOUND = 2;
1975
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
1976
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
1977
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
1978
- if (cmp === 0) {
1979
- return mid;
1980
- } else if (cmp > 0) {
1981
- if (aHigh - mid > 1) {
1982
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
1983
- }
1984
- if (aBias == exports2.LEAST_UPPER_BOUND) {
1985
- return aHigh < aHaystack.length ? aHigh : -1;
1986
- } else {
1987
- return mid;
1988
- }
1989
- } else {
1990
- if (mid - aLow > 1) {
1991
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
1992
- }
1993
- if (aBias == exports2.LEAST_UPPER_BOUND) {
1994
- return mid;
1995
- } else {
1996
- return aLow < 0 ? -1 : aLow;
1997
- }
1998
- }
1999
- }
2000
- exports2.search = function search(aNeedle, aHaystack, aCompare, aBias) {
2001
- if (aHaystack.length === 0) {
2002
- return -1;
2003
- }
2004
- var index = recursiveSearch(
2005
- -1,
2006
- aHaystack.length,
2007
- aNeedle,
2008
- aHaystack,
2009
- aCompare,
2010
- aBias || exports2.GREATEST_LOWER_BOUND
2011
- );
2012
- if (index < 0) {
2013
- return -1;
2014
- }
2015
- while (index - 1 >= 0) {
2016
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
2017
- break;
2018
- }
2019
- --index;
2020
- }
2021
- return index;
2022
- };
2023
- }
2024
- });
2025
-
2026
- // node_modules/source-map/lib/quick-sort.js
2027
- var require_quick_sort = __commonJS({
2028
- "node_modules/source-map/lib/quick-sort.js"(exports2) {
2029
- function swap(ary, x, y) {
2030
- var temp = ary[x];
2031
- ary[x] = ary[y];
2032
- ary[y] = temp;
2033
- }
2034
- function randomIntInRange(low, high) {
2035
- return Math.round(low + Math.random() * (high - low));
2036
- }
2037
- function doQuickSort(ary, comparator, p, r) {
2038
- if (p < r) {
2039
- var pivotIndex = randomIntInRange(p, r);
2040
- var i = p - 1;
2041
- swap(ary, pivotIndex, r);
2042
- var pivot = ary[r];
2043
- for (var j = p; j < r; j++) {
2044
- if (comparator(ary[j], pivot) <= 0) {
2045
- i += 1;
2046
- swap(ary, i, j);
2047
- }
2048
- }
2049
- swap(ary, i + 1, j);
2050
- var q = i + 1;
2051
- doQuickSort(ary, comparator, p, q - 1);
2052
- doQuickSort(ary, comparator, q + 1, r);
2053
- }
2054
- }
2055
- exports2.quickSort = function(ary, comparator) {
2056
- doQuickSort(ary, comparator, 0, ary.length - 1);
2057
- };
2058
- }
2059
- });
2060
-
2061
- // node_modules/source-map/lib/source-map-consumer.js
2062
- var require_source_map_consumer = __commonJS({
2063
- "node_modules/source-map/lib/source-map-consumer.js"(exports2) {
2064
- var util = require_util2();
2065
- var binarySearch = require_binary_search();
2066
- var ArraySet = require_array_set().ArraySet;
2067
- var base64VLQ = require_base64_vlq();
2068
- var quickSort = require_quick_sort().quickSort;
2069
- function SourceMapConsumer(aSourceMap, aSourceMapURL) {
2070
- var sourceMap = aSourceMap;
2071
- if (typeof aSourceMap === "string") {
2072
- sourceMap = util.parseSourceMapInput(aSourceMap);
2073
- }
2074
- return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
2075
- }
2076
- SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
2077
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
2078
- };
2079
- SourceMapConsumer.prototype._version = 3;
2080
- SourceMapConsumer.prototype.__generatedMappings = null;
2081
- Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
2082
- configurable: true,
2083
- enumerable: true,
2084
- get: function() {
2085
- if (!this.__generatedMappings) {
2086
- this._parseMappings(this._mappings, this.sourceRoot);
2087
- }
2088
- return this.__generatedMappings;
2089
- }
2090
- });
2091
- SourceMapConsumer.prototype.__originalMappings = null;
2092
- Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
2093
- configurable: true,
2094
- enumerable: true,
2095
- get: function() {
2096
- if (!this.__originalMappings) {
2097
- this._parseMappings(this._mappings, this.sourceRoot);
2098
- }
2099
- return this.__originalMappings;
2100
- }
2101
- });
2102
- SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
2103
- var c = aStr.charAt(index);
2104
- return c === ";" || c === ",";
2105
- };
2106
- SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
2107
- throw new Error("Subclasses must implement _parseMappings");
2108
- };
2109
- SourceMapConsumer.GENERATED_ORDER = 1;
2110
- SourceMapConsumer.ORIGINAL_ORDER = 2;
2111
- SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
2112
- SourceMapConsumer.LEAST_UPPER_BOUND = 2;
2113
- SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
2114
- var context = aContext || null;
2115
- var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
2116
- var mappings;
2117
- switch (order) {
2118
- case SourceMapConsumer.GENERATED_ORDER:
2119
- mappings = this._generatedMappings;
2120
- break;
2121
- case SourceMapConsumer.ORIGINAL_ORDER:
2122
- mappings = this._originalMappings;
2123
- break;
2124
- default:
2125
- throw new Error("Unknown order of iteration.");
2126
- }
2127
- var sourceRoot = this.sourceRoot;
2128
- mappings.map(function(mapping) {
2129
- var source = mapping.source === null ? null : this._sources.at(mapping.source);
2130
- source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
2131
- return {
2132
- source,
2133
- generatedLine: mapping.generatedLine,
2134
- generatedColumn: mapping.generatedColumn,
2135
- originalLine: mapping.originalLine,
2136
- originalColumn: mapping.originalColumn,
2137
- name: mapping.name === null ? null : this._names.at(mapping.name)
2138
- };
2139
- }, this).forEach(aCallback, context);
2140
- };
2141
- SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
2142
- var line = util.getArg(aArgs, "line");
2143
- var needle = {
2144
- source: util.getArg(aArgs, "source"),
2145
- originalLine: line,
2146
- originalColumn: util.getArg(aArgs, "column", 0)
2147
- };
2148
- needle.source = this._findSourceIndex(needle.source);
2149
- if (needle.source < 0) {
2150
- return [];
2151
- }
2152
- var mappings = [];
2153
- var index = this._findMapping(
2154
- needle,
2155
- this._originalMappings,
2156
- "originalLine",
2157
- "originalColumn",
2158
- util.compareByOriginalPositions,
2159
- binarySearch.LEAST_UPPER_BOUND
2160
- );
2161
- if (index >= 0) {
2162
- var mapping = this._originalMappings[index];
2163
- if (aArgs.column === void 0) {
2164
- var originalLine = mapping.originalLine;
2165
- while (mapping && mapping.originalLine === originalLine) {
2166
- mappings.push({
2167
- line: util.getArg(mapping, "generatedLine", null),
2168
- column: util.getArg(mapping, "generatedColumn", null),
2169
- lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2170
- });
2171
- mapping = this._originalMappings[++index];
2172
- }
2173
- } else {
2174
- var originalColumn = mapping.originalColumn;
2175
- while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
2176
- mappings.push({
2177
- line: util.getArg(mapping, "generatedLine", null),
2178
- column: util.getArg(mapping, "generatedColumn", null),
2179
- lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2180
- });
2181
- mapping = this._originalMappings[++index];
2182
- }
2183
- }
2184
- }
2185
- return mappings;
2186
- };
2187
- exports2.SourceMapConsumer = SourceMapConsumer;
2188
- function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
2189
- var sourceMap = aSourceMap;
2190
- if (typeof aSourceMap === "string") {
2191
- sourceMap = util.parseSourceMapInput(aSourceMap);
2192
- }
2193
- var version = util.getArg(sourceMap, "version");
2194
- var sources = util.getArg(sourceMap, "sources");
2195
- var names = util.getArg(sourceMap, "names", []);
2196
- var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
2197
- var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
2198
- var mappings = util.getArg(sourceMap, "mappings");
2199
- var file = util.getArg(sourceMap, "file", null);
2200
- if (version != this._version) {
2201
- throw new Error("Unsupported version: " + version);
2202
- }
2203
- if (sourceRoot) {
2204
- sourceRoot = util.normalize(sourceRoot);
2205
- }
2206
- sources = sources.map(String).map(util.normalize).map(function(source) {
2207
- return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
2208
- });
2209
- this._names = ArraySet.fromArray(names.map(String), true);
2210
- this._sources = ArraySet.fromArray(sources, true);
2211
- this._absoluteSources = this._sources.toArray().map(function(s) {
2212
- return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
2213
- });
2214
- this.sourceRoot = sourceRoot;
2215
- this.sourcesContent = sourcesContent;
2216
- this._mappings = mappings;
2217
- this._sourceMapURL = aSourceMapURL;
2218
- this.file = file;
2219
- }
2220
- BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
2221
- BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
2222
- BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
2223
- var relativeSource = aSource;
2224
- if (this.sourceRoot != null) {
2225
- relativeSource = util.relative(this.sourceRoot, relativeSource);
2226
- }
2227
- if (this._sources.has(relativeSource)) {
2228
- return this._sources.indexOf(relativeSource);
2229
- }
2230
- var i;
2231
- for (i = 0; i < this._absoluteSources.length; ++i) {
2232
- if (this._absoluteSources[i] == aSource) {
2233
- return i;
2234
- }
2235
- }
2236
- return -1;
2237
- };
2238
- BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
2239
- var smc = Object.create(BasicSourceMapConsumer.prototype);
2240
- var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
2241
- var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
2242
- smc.sourceRoot = aSourceMap._sourceRoot;
2243
- smc.sourcesContent = aSourceMap._generateSourcesContent(
2244
- smc._sources.toArray(),
2245
- smc.sourceRoot
2246
- );
2247
- smc.file = aSourceMap._file;
2248
- smc._sourceMapURL = aSourceMapURL;
2249
- smc._absoluteSources = smc._sources.toArray().map(function(s) {
2250
- return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
2251
- });
2252
- var generatedMappings = aSourceMap._mappings.toArray().slice();
2253
- var destGeneratedMappings = smc.__generatedMappings = [];
2254
- var destOriginalMappings = smc.__originalMappings = [];
2255
- for (var i = 0, length = generatedMappings.length; i < length; i++) {
2256
- var srcMapping = generatedMappings[i];
2257
- var destMapping = new Mapping();
2258
- destMapping.generatedLine = srcMapping.generatedLine;
2259
- destMapping.generatedColumn = srcMapping.generatedColumn;
2260
- if (srcMapping.source) {
2261
- destMapping.source = sources.indexOf(srcMapping.source);
2262
- destMapping.originalLine = srcMapping.originalLine;
2263
- destMapping.originalColumn = srcMapping.originalColumn;
2264
- if (srcMapping.name) {
2265
- destMapping.name = names.indexOf(srcMapping.name);
2266
- }
2267
- destOriginalMappings.push(destMapping);
2268
- }
2269
- destGeneratedMappings.push(destMapping);
2270
- }
2271
- quickSort(smc.__originalMappings, util.compareByOriginalPositions);
2272
- return smc;
2273
- };
2274
- BasicSourceMapConsumer.prototype._version = 3;
2275
- Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
2276
- get: function() {
2277
- return this._absoluteSources.slice();
2278
- }
2279
- });
2280
- function Mapping() {
2281
- this.generatedLine = 0;
2282
- this.generatedColumn = 0;
2283
- this.source = null;
2284
- this.originalLine = null;
2285
- this.originalColumn = null;
2286
- this.name = null;
2287
- }
2288
- BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
2289
- var generatedLine = 1;
2290
- var previousGeneratedColumn = 0;
2291
- var previousOriginalLine = 0;
2292
- var previousOriginalColumn = 0;
2293
- var previousSource = 0;
2294
- var previousName = 0;
2295
- var length = aStr.length;
2296
- var index = 0;
2297
- var cachedSegments = {};
2298
- var temp = {};
2299
- var originalMappings = [];
2300
- var generatedMappings = [];
2301
- var mapping, str, segment, end, value;
2302
- while (index < length) {
2303
- if (aStr.charAt(index) === ";") {
2304
- generatedLine++;
2305
- index++;
2306
- previousGeneratedColumn = 0;
2307
- } else if (aStr.charAt(index) === ",") {
2308
- index++;
2309
- } else {
2310
- mapping = new Mapping();
2311
- mapping.generatedLine = generatedLine;
2312
- for (end = index; end < length; end++) {
2313
- if (this._charIsMappingSeparator(aStr, end)) {
2314
- break;
2315
- }
2316
- }
2317
- str = aStr.slice(index, end);
2318
- segment = cachedSegments[str];
2319
- if (segment) {
2320
- index += str.length;
2321
- } else {
2322
- segment = [];
2323
- while (index < end) {
2324
- base64VLQ.decode(aStr, index, temp);
2325
- value = temp.value;
2326
- index = temp.rest;
2327
- segment.push(value);
2328
- }
2329
- if (segment.length === 2) {
2330
- throw new Error("Found a source, but no line and column");
2331
- }
2332
- if (segment.length === 3) {
2333
- throw new Error("Found a source and line, but no column");
2334
- }
2335
- cachedSegments[str] = segment;
2336
- }
2337
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
2338
- previousGeneratedColumn = mapping.generatedColumn;
2339
- if (segment.length > 1) {
2340
- mapping.source = previousSource + segment[1];
2341
- previousSource += segment[1];
2342
- mapping.originalLine = previousOriginalLine + segment[2];
2343
- previousOriginalLine = mapping.originalLine;
2344
- mapping.originalLine += 1;
2345
- mapping.originalColumn = previousOriginalColumn + segment[3];
2346
- previousOriginalColumn = mapping.originalColumn;
2347
- if (segment.length > 4) {
2348
- mapping.name = previousName + segment[4];
2349
- previousName += segment[4];
2350
- }
2351
- }
2352
- generatedMappings.push(mapping);
2353
- if (typeof mapping.originalLine === "number") {
2354
- originalMappings.push(mapping);
2355
- }
2356
- }
2357
- }
2358
- quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
2359
- this.__generatedMappings = generatedMappings;
2360
- quickSort(originalMappings, util.compareByOriginalPositions);
2361
- this.__originalMappings = originalMappings;
2362
- };
2363
- BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
2364
- if (aNeedle[aLineName] <= 0) {
2365
- throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
2366
- }
2367
- if (aNeedle[aColumnName] < 0) {
2368
- throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
2369
- }
2370
- return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
2371
- };
2372
- BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
2373
- for (var index = 0; index < this._generatedMappings.length; ++index) {
2374
- var mapping = this._generatedMappings[index];
2375
- if (index + 1 < this._generatedMappings.length) {
2376
- var nextMapping = this._generatedMappings[index + 1];
2377
- if (mapping.generatedLine === nextMapping.generatedLine) {
2378
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
2379
- continue;
2380
- }
2381
- }
2382
- mapping.lastGeneratedColumn = Infinity;
2383
- }
2384
- };
2385
- BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
2386
- var needle = {
2387
- generatedLine: util.getArg(aArgs, "line"),
2388
- generatedColumn: util.getArg(aArgs, "column")
2389
- };
2390
- var index = this._findMapping(
2391
- needle,
2392
- this._generatedMappings,
2393
- "generatedLine",
2394
- "generatedColumn",
2395
- util.compareByGeneratedPositionsDeflated,
2396
- util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
2397
- );
2398
- if (index >= 0) {
2399
- var mapping = this._generatedMappings[index];
2400
- if (mapping.generatedLine === needle.generatedLine) {
2401
- var source = util.getArg(mapping, "source", null);
2402
- if (source !== null) {
2403
- source = this._sources.at(source);
2404
- source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
2405
- }
2406
- var name = util.getArg(mapping, "name", null);
2407
- if (name !== null) {
2408
- name = this._names.at(name);
2409
- }
2410
- return {
2411
- source,
2412
- line: util.getArg(mapping, "originalLine", null),
2413
- column: util.getArg(mapping, "originalColumn", null),
2414
- name
2415
- };
2416
- }
2417
- }
2418
- return {
2419
- source: null,
2420
- line: null,
2421
- column: null,
2422
- name: null
2423
- };
2424
- };
2425
- BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
2426
- if (!this.sourcesContent) {
2427
- return false;
2428
- }
2429
- return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
2430
- return sc == null;
2431
- });
2432
- };
2433
- BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
2434
- if (!this.sourcesContent) {
2435
- return null;
2436
- }
2437
- var index = this._findSourceIndex(aSource);
2438
- if (index >= 0) {
2439
- return this.sourcesContent[index];
2440
- }
2441
- var relativeSource = aSource;
2442
- if (this.sourceRoot != null) {
2443
- relativeSource = util.relative(this.sourceRoot, relativeSource);
2444
- }
2445
- var url;
2446
- if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
2447
- var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
2448
- if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
2449
- return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
2450
- }
2451
- if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
2452
- return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
2453
- }
2454
- }
2455
- if (nullOnMissing) {
2456
- return null;
2457
- } else {
2458
- throw new Error('"' + relativeSource + '" is not in the SourceMap.');
2459
- }
2460
- };
2461
- BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
2462
- var source = util.getArg(aArgs, "source");
2463
- source = this._findSourceIndex(source);
2464
- if (source < 0) {
2465
- return {
2466
- line: null,
2467
- column: null,
2468
- lastColumn: null
2469
- };
2470
- }
2471
- var needle = {
2472
- source,
2473
- originalLine: util.getArg(aArgs, "line"),
2474
- originalColumn: util.getArg(aArgs, "column")
2475
- };
2476
- var index = this._findMapping(
2477
- needle,
2478
- this._originalMappings,
2479
- "originalLine",
2480
- "originalColumn",
2481
- util.compareByOriginalPositions,
2482
- util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
2483
- );
2484
- if (index >= 0) {
2485
- var mapping = this._originalMappings[index];
2486
- if (mapping.source === needle.source) {
2487
- return {
2488
- line: util.getArg(mapping, "generatedLine", null),
2489
- column: util.getArg(mapping, "generatedColumn", null),
2490
- lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2491
- };
2492
- }
2493
- }
2494
- return {
2495
- line: null,
2496
- column: null,
2497
- lastColumn: null
2498
- };
2499
- };
2500
- exports2.BasicSourceMapConsumer = BasicSourceMapConsumer;
2501
- function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
2502
- var sourceMap = aSourceMap;
2503
- if (typeof aSourceMap === "string") {
2504
- sourceMap = util.parseSourceMapInput(aSourceMap);
2505
- }
2506
- var version = util.getArg(sourceMap, "version");
2507
- var sections = util.getArg(sourceMap, "sections");
2508
- if (version != this._version) {
2509
- throw new Error("Unsupported version: " + version);
2510
- }
2511
- this._sources = new ArraySet();
2512
- this._names = new ArraySet();
2513
- var lastOffset = {
2514
- line: -1,
2515
- column: 0
2516
- };
2517
- this._sections = sections.map(function(s) {
2518
- if (s.url) {
2519
- throw new Error("Support for url field in sections not implemented.");
2520
- }
2521
- var offset = util.getArg(s, "offset");
2522
- var offsetLine = util.getArg(offset, "line");
2523
- var offsetColumn = util.getArg(offset, "column");
2524
- if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
2525
- throw new Error("Section offsets must be ordered and non-overlapping.");
2526
- }
2527
- lastOffset = offset;
2528
- return {
2529
- generatedOffset: {
2530
- // The offset fields are 0-based, but we use 1-based indices when
2531
- // encoding/decoding from VLQ.
2532
- generatedLine: offsetLine + 1,
2533
- generatedColumn: offsetColumn + 1
2534
- },
2535
- consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
2536
- };
2537
- });
2538
- }
2539
- IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
2540
- IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
2541
- IndexedSourceMapConsumer.prototype._version = 3;
2542
- Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
2543
- get: function() {
2544
- var sources = [];
2545
- for (var i = 0; i < this._sections.length; i++) {
2546
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
2547
- sources.push(this._sections[i].consumer.sources[j]);
2548
- }
2549
- }
2550
- return sources;
2551
- }
2552
- });
2553
- IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
2554
- var needle = {
2555
- generatedLine: util.getArg(aArgs, "line"),
2556
- generatedColumn: util.getArg(aArgs, "column")
2557
- };
2558
- var sectionIndex = binarySearch.search(
2559
- needle,
2560
- this._sections,
2561
- function(needle2, section2) {
2562
- var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
2563
- if (cmp) {
2564
- return cmp;
2565
- }
2566
- return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
2567
- }
2568
- );
2569
- var section = this._sections[sectionIndex];
2570
- if (!section) {
2571
- return {
2572
- source: null,
2573
- line: null,
2574
- column: null,
2575
- name: null
2576
- };
2577
- }
2578
- return section.consumer.originalPositionFor({
2579
- line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
2580
- column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
2581
- bias: aArgs.bias
2582
- });
2583
- };
2584
- IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
2585
- return this._sections.every(function(s) {
2586
- return s.consumer.hasContentsOfAllSources();
2587
- });
2588
- };
2589
- IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
2590
- for (var i = 0; i < this._sections.length; i++) {
2591
- var section = this._sections[i];
2592
- var content = section.consumer.sourceContentFor(aSource, true);
2593
- if (content) {
2594
- return content;
2595
- }
2596
- }
2597
- if (nullOnMissing) {
2598
- return null;
2599
- } else {
2600
- throw new Error('"' + aSource + '" is not in the SourceMap.');
2601
- }
2602
- };
2603
- IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
2604
- for (var i = 0; i < this._sections.length; i++) {
2605
- var section = this._sections[i];
2606
- if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
2607
- continue;
2608
- }
2609
- var generatedPosition = section.consumer.generatedPositionFor(aArgs);
2610
- if (generatedPosition) {
2611
- var ret = {
2612
- line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
2613
- column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
2614
- };
2615
- return ret;
2616
- }
2617
- }
2618
- return {
2619
- line: null,
2620
- column: null
2621
- };
2622
- };
2623
- IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
2624
- this.__generatedMappings = [];
2625
- this.__originalMappings = [];
2626
- for (var i = 0; i < this._sections.length; i++) {
2627
- var section = this._sections[i];
2628
- var sectionMappings = section.consumer._generatedMappings;
2629
- for (var j = 0; j < sectionMappings.length; j++) {
2630
- var mapping = sectionMappings[j];
2631
- var source = section.consumer._sources.at(mapping.source);
2632
- source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
2633
- this._sources.add(source);
2634
- source = this._sources.indexOf(source);
2635
- var name = null;
2636
- if (mapping.name) {
2637
- name = section.consumer._names.at(mapping.name);
2638
- this._names.add(name);
2639
- name = this._names.indexOf(name);
2640
- }
2641
- var adjustedMapping = {
2642
- source,
2643
- generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
2644
- generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
2645
- originalLine: mapping.originalLine,
2646
- originalColumn: mapping.originalColumn,
2647
- name
2648
- };
2649
- this.__generatedMappings.push(adjustedMapping);
2650
- if (typeof adjustedMapping.originalLine === "number") {
2651
- this.__originalMappings.push(adjustedMapping);
2652
- }
2653
- }
2654
- }
2655
- quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
2656
- quickSort(this.__originalMappings, util.compareByOriginalPositions);
2657
- };
2658
- exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
2659
- }
2660
- });
2661
-
2662
- // node_modules/source-map/lib/source-node.js
2663
- var require_source_node = __commonJS({
2664
- "node_modules/source-map/lib/source-node.js"(exports2) {
2665
- var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
2666
- var util = require_util2();
2667
- var REGEX_NEWLINE = /(\r?\n)/;
2668
- var NEWLINE_CODE = 10;
2669
- var isSourceNode = "$$$isSourceNode$$$";
2670
- function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
2671
- this.children = [];
2672
- this.sourceContents = {};
2673
- this.line = aLine == null ? null : aLine;
2674
- this.column = aColumn == null ? null : aColumn;
2675
- this.source = aSource == null ? null : aSource;
2676
- this.name = aName == null ? null : aName;
2677
- this[isSourceNode] = true;
2678
- if (aChunks != null) this.add(aChunks);
2679
- }
2680
- SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
2681
- var node = new SourceNode();
2682
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
2683
- var remainingLinesIndex = 0;
2684
- var shiftNextLine = function() {
2685
- var lineContents = getNextLine();
2686
- var newLine = getNextLine() || "";
2687
- return lineContents + newLine;
2688
- function getNextLine() {
2689
- return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
2690
- }
2691
- };
2692
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
2693
- var lastMapping = null;
2694
- aSourceMapConsumer.eachMapping(function(mapping) {
2695
- if (lastMapping !== null) {
2696
- if (lastGeneratedLine < mapping.generatedLine) {
2697
- addMappingWithCode(lastMapping, shiftNextLine());
2698
- lastGeneratedLine++;
2699
- lastGeneratedColumn = 0;
2700
- } else {
2701
- var nextLine = remainingLines[remainingLinesIndex] || "";
2702
- var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
2703
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
2704
- lastGeneratedColumn = mapping.generatedColumn;
2705
- addMappingWithCode(lastMapping, code);
2706
- lastMapping = mapping;
2707
- return;
2708
- }
2709
- }
2710
- while (lastGeneratedLine < mapping.generatedLine) {
2711
- node.add(shiftNextLine());
2712
- lastGeneratedLine++;
2713
- }
2714
- if (lastGeneratedColumn < mapping.generatedColumn) {
2715
- var nextLine = remainingLines[remainingLinesIndex] || "";
2716
- node.add(nextLine.substr(0, mapping.generatedColumn));
2717
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
2718
- lastGeneratedColumn = mapping.generatedColumn;
2719
- }
2720
- lastMapping = mapping;
2721
- }, this);
2722
- if (remainingLinesIndex < remainingLines.length) {
2723
- if (lastMapping) {
2724
- addMappingWithCode(lastMapping, shiftNextLine());
2725
- }
2726
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
2727
- }
2728
- aSourceMapConsumer.sources.forEach(function(sourceFile) {
2729
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
2730
- if (content != null) {
2731
- if (aRelativePath != null) {
2732
- sourceFile = util.join(aRelativePath, sourceFile);
2733
- }
2734
- node.setSourceContent(sourceFile, content);
2735
- }
2736
- });
2737
- return node;
2738
- function addMappingWithCode(mapping, code) {
2739
- if (mapping === null || mapping.source === void 0) {
2740
- node.add(code);
2741
- } else {
2742
- var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
2743
- node.add(new SourceNode(
2744
- mapping.originalLine,
2745
- mapping.originalColumn,
2746
- source,
2747
- code,
2748
- mapping.name
2749
- ));
2750
- }
2751
- }
2752
- };
2753
- SourceNode.prototype.add = function SourceNode_add(aChunk) {
2754
- if (Array.isArray(aChunk)) {
2755
- aChunk.forEach(function(chunk) {
2756
- this.add(chunk);
2757
- }, this);
2758
- } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
2759
- if (aChunk) {
2760
- this.children.push(aChunk);
2761
- }
2762
- } else {
2763
- throw new TypeError(
2764
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
2765
- );
2766
- }
2767
- return this;
2768
- };
2769
- SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
2770
- if (Array.isArray(aChunk)) {
2771
- for (var i = aChunk.length - 1; i >= 0; i--) {
2772
- this.prepend(aChunk[i]);
2773
- }
2774
- } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
2775
- this.children.unshift(aChunk);
2776
- } else {
2777
- throw new TypeError(
2778
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
2779
- );
2780
- }
2781
- return this;
2782
- };
2783
- SourceNode.prototype.walk = function SourceNode_walk(aFn) {
2784
- var chunk;
2785
- for (var i = 0, len = this.children.length; i < len; i++) {
2786
- chunk = this.children[i];
2787
- if (chunk[isSourceNode]) {
2788
- chunk.walk(aFn);
2789
- } else {
2790
- if (chunk !== "") {
2791
- aFn(chunk, {
2792
- source: this.source,
2793
- line: this.line,
2794
- column: this.column,
2795
- name: this.name
2796
- });
2797
- }
2798
- }
2799
- }
2800
- };
2801
- SourceNode.prototype.join = function SourceNode_join(aSep) {
2802
- var newChildren;
2803
- var i;
2804
- var len = this.children.length;
2805
- if (len > 0) {
2806
- newChildren = [];
2807
- for (i = 0; i < len - 1; i++) {
2808
- newChildren.push(this.children[i]);
2809
- newChildren.push(aSep);
2810
- }
2811
- newChildren.push(this.children[i]);
2812
- this.children = newChildren;
2813
- }
2814
- return this;
2815
- };
2816
- SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
2817
- var lastChild = this.children[this.children.length - 1];
2818
- if (lastChild[isSourceNode]) {
2819
- lastChild.replaceRight(aPattern, aReplacement);
2820
- } else if (typeof lastChild === "string") {
2821
- this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
2822
- } else {
2823
- this.children.push("".replace(aPattern, aReplacement));
2824
- }
2825
- return this;
2826
- };
2827
- SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
2828
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
2829
- };
2830
- SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
2831
- for (var i = 0, len = this.children.length; i < len; i++) {
2832
- if (this.children[i][isSourceNode]) {
2833
- this.children[i].walkSourceContents(aFn);
2834
- }
2835
- }
2836
- var sources = Object.keys(this.sourceContents);
2837
- for (var i = 0, len = sources.length; i < len; i++) {
2838
- aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
2839
- }
2840
- };
2841
- SourceNode.prototype.toString = function SourceNode_toString() {
2842
- var str = "";
2843
- this.walk(function(chunk) {
2844
- str += chunk;
2845
- });
2846
- return str;
2847
- };
2848
- SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
2849
- var generated = {
2850
- code: "",
2851
- line: 1,
2852
- column: 0
2853
- };
2854
- var map = new SourceMapGenerator(aArgs);
2855
- var sourceMappingActive = false;
2856
- var lastOriginalSource = null;
2857
- var lastOriginalLine = null;
2858
- var lastOriginalColumn = null;
2859
- var lastOriginalName = null;
2860
- this.walk(function(chunk, original) {
2861
- generated.code += chunk;
2862
- if (original.source !== null && original.line !== null && original.column !== null) {
2863
- if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
2864
- map.addMapping({
2865
- source: original.source,
2866
- original: {
2867
- line: original.line,
2868
- column: original.column
2869
- },
2870
- generated: {
2871
- line: generated.line,
2872
- column: generated.column
2873
- },
2874
- name: original.name
2875
- });
2876
- }
2877
- lastOriginalSource = original.source;
2878
- lastOriginalLine = original.line;
2879
- lastOriginalColumn = original.column;
2880
- lastOriginalName = original.name;
2881
- sourceMappingActive = true;
2882
- } else if (sourceMappingActive) {
2883
- map.addMapping({
2884
- generated: {
2885
- line: generated.line,
2886
- column: generated.column
2887
- }
2888
- });
2889
- lastOriginalSource = null;
2890
- sourceMappingActive = false;
2891
- }
2892
- for (var idx = 0, length = chunk.length; idx < length; idx++) {
2893
- if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
2894
- generated.line++;
2895
- generated.column = 0;
2896
- if (idx + 1 === length) {
2897
- lastOriginalSource = null;
2898
- sourceMappingActive = false;
2899
- } else if (sourceMappingActive) {
2900
- map.addMapping({
2901
- source: original.source,
2902
- original: {
2903
- line: original.line,
2904
- column: original.column
2905
- },
2906
- generated: {
2907
- line: generated.line,
2908
- column: generated.column
2909
- },
2910
- name: original.name
2911
- });
2912
- }
2913
- } else {
2914
- generated.column++;
2915
- }
2916
- }
2917
- });
2918
- this.walkSourceContents(function(sourceFile, sourceContent) {
2919
- map.setSourceContent(sourceFile, sourceContent);
2920
- });
2921
- return { code: generated.code, map };
2922
- };
2923
- exports2.SourceNode = SourceNode;
2924
- }
2925
- });
2926
-
2927
- // node_modules/source-map/source-map.js
2928
- var require_source_map = __commonJS({
2929
- "node_modules/source-map/source-map.js"(exports2) {
2930
- exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
2931
- exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
2932
- exports2.SourceNode = require_source_node().SourceNode;
2933
- }
2934
- });
2935
-
2936
- // node_modules/buffer-from/index.js
2937
- var require_buffer_from = __commonJS({
2938
- "node_modules/buffer-from/index.js"(exports2, module2) {
2939
- var toString = Object.prototype.toString;
2940
- var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
2941
- function isArrayBuffer(input) {
2942
- return toString.call(input).slice(8, -1) === "ArrayBuffer";
2943
- }
2944
- function fromArrayBuffer(obj, byteOffset, length) {
2945
- byteOffset >>>= 0;
2946
- var maxLength = obj.byteLength - byteOffset;
2947
- if (maxLength < 0) {
2948
- throw new RangeError("'offset' is out of bounds");
2949
- }
2950
- if (length === void 0) {
2951
- length = maxLength;
2952
- } else {
2953
- length >>>= 0;
2954
- if (length > maxLength) {
2955
- throw new RangeError("'length' is out of bounds");
2956
- }
2957
- }
2958
- return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
2959
- }
2960
- function fromString(string, encoding) {
2961
- if (typeof encoding !== "string" || encoding === "") {
2962
- encoding = "utf8";
2963
- }
2964
- if (!Buffer.isEncoding(encoding)) {
2965
- throw new TypeError('"encoding" must be a valid string encoding');
2966
- }
2967
- return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
2968
- }
2969
- function bufferFrom(value, encodingOrOffset, length) {
2970
- if (typeof value === "number") {
2971
- throw new TypeError('"value" argument must not be a number');
2972
- }
2973
- if (isArrayBuffer(value)) {
2974
- return fromArrayBuffer(value, encodingOrOffset, length);
2975
- }
2976
- if (typeof value === "string") {
2977
- return fromString(value, encodingOrOffset);
2978
- }
2979
- return isModern ? Buffer.from(value) : new Buffer(value);
2980
- }
2981
- module2.exports = bufferFrom;
2982
- }
2983
- });
2984
-
2985
- // node_modules/source-map-support/source-map-support.js
2986
- var require_source_map_support = __commonJS({
2987
- "node_modules/source-map-support/source-map-support.js"(exports2, module2) {
2988
- var SourceMapConsumer = require_source_map().SourceMapConsumer;
2989
- var path14 = require("path");
2990
- var fs9;
2991
- try {
2992
- fs9 = require("fs");
2993
- if (!fs9.existsSync || !fs9.readFileSync) {
2994
- fs9 = null;
2995
- }
2996
- } catch (err) {
2997
- }
2998
- var bufferFrom = require_buffer_from();
2999
- function dynamicRequire(mod, request) {
3000
- return mod.require(request);
3001
- }
3002
- var errorFormatterInstalled = false;
3003
- var uncaughtShimInstalled = false;
3004
- var emptyCacheBetweenOperations = false;
3005
- var environment = "auto";
3006
- var fileContentsCache = {};
3007
- var sourceMapCache = {};
3008
- var reSourceMap = /^data:application\/json[^,]+base64,/;
3009
- var retrieveFileHandlers = [];
3010
- var retrieveMapHandlers = [];
3011
- function isInBrowser() {
3012
- if (environment === "browser")
3013
- return true;
3014
- if (environment === "node")
3015
- return false;
3016
- return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
3017
- }
3018
- function hasGlobalProcessEventEmitter() {
3019
- return typeof process === "object" && process !== null && typeof process.on === "function";
3020
- }
3021
- function globalProcessVersion() {
3022
- if (typeof process === "object" && process !== null) {
3023
- return process.version;
3024
- } else {
3025
- return "";
3026
- }
3027
- }
3028
- function globalProcessStderr() {
3029
- if (typeof process === "object" && process !== null) {
3030
- return process.stderr;
3031
- }
3032
- }
3033
- function globalProcessExit(code) {
3034
- if (typeof process === "object" && process !== null && typeof process.exit === "function") {
3035
- return process.exit(code);
3036
- }
3037
- }
3038
- function handlerExec(list) {
3039
- return function(arg) {
3040
- for (var i = 0; i < list.length; i++) {
3041
- var ret = list[i](arg);
3042
- if (ret) {
3043
- return ret;
3044
- }
3045
- }
3046
- return null;
3047
- };
3048
- }
3049
- var retrieveFile = handlerExec(retrieveFileHandlers);
3050
- retrieveFileHandlers.push(function(path15) {
3051
- path15 = path15.trim();
3052
- if (/^file:/.test(path15)) {
3053
- path15 = path15.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
3054
- return drive ? "" : (
3055
- // file:///C:/dir/file -> C:/dir/file
3056
- "/"
3057
- );
3058
- });
3059
- }
3060
- if (path15 in fileContentsCache) {
3061
- return fileContentsCache[path15];
3062
- }
3063
- var contents = "";
3064
- try {
3065
- if (!fs9) {
3066
- var xhr = new XMLHttpRequest();
3067
- xhr.open(
3068
- "GET",
3069
- path15,
3070
- /** async */
3071
- false
3072
- );
3073
- xhr.send(null);
3074
- if (xhr.readyState === 4 && xhr.status === 200) {
3075
- contents = xhr.responseText;
3076
- }
3077
- } else if (fs9.existsSync(path15)) {
3078
- contents = fs9.readFileSync(path15, "utf8");
3079
- }
3080
- } catch (er) {
3081
- }
3082
- return fileContentsCache[path15] = contents;
3083
- });
3084
- function supportRelativeURL(file, url) {
3085
- if (!file) return url;
3086
- var dir = path14.dirname(file);
3087
- var match = /^\w+:\/\/[^\/]*/.exec(dir);
3088
- var protocol = match ? match[0] : "";
3089
- var startPath = dir.slice(protocol.length);
3090
- if (protocol && /^\/\w\:/.test(startPath)) {
3091
- protocol += "/";
3092
- return protocol + path14.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
3093
- }
3094
- return protocol + path14.resolve(dir.slice(protocol.length), url);
3095
- }
3096
- function retrieveSourceMapURL(source) {
3097
- var fileData;
3098
- if (isInBrowser()) {
3099
- try {
3100
- var xhr = new XMLHttpRequest();
3101
- xhr.open("GET", source, false);
3102
- xhr.send(null);
3103
- fileData = xhr.readyState === 4 ? xhr.responseText : null;
3104
- var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
3105
- if (sourceMapHeader) {
3106
- return sourceMapHeader;
3107
- }
3108
- } catch (e) {
3109
- }
3110
- }
3111
- fileData = retrieveFile(source);
3112
- var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
3113
- var lastMatch, match;
3114
- while (match = re.exec(fileData)) lastMatch = match;
3115
- if (!lastMatch) return null;
3116
- return lastMatch[1];
3117
- }
3118
- var retrieveSourceMap = handlerExec(retrieveMapHandlers);
3119
- retrieveMapHandlers.push(function(source) {
3120
- var sourceMappingURL = retrieveSourceMapURL(source);
3121
- if (!sourceMappingURL) return null;
3122
- var sourceMapData;
3123
- if (reSourceMap.test(sourceMappingURL)) {
3124
- var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
3125
- sourceMapData = bufferFrom(rawData, "base64").toString();
3126
- sourceMappingURL = source;
3127
- } else {
3128
- sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
3129
- sourceMapData = retrieveFile(sourceMappingURL);
3130
- }
3131
- if (!sourceMapData) {
3132
- return null;
3133
- }
3134
- return {
3135
- url: sourceMappingURL,
3136
- map: sourceMapData
3137
- };
3138
- });
3139
- function mapSourcePosition(position) {
3140
- var sourceMap = sourceMapCache[position.source];
3141
- if (!sourceMap) {
3142
- var urlAndMap = retrieveSourceMap(position.source);
3143
- if (urlAndMap) {
3144
- sourceMap = sourceMapCache[position.source] = {
3145
- url: urlAndMap.url,
3146
- map: new SourceMapConsumer(urlAndMap.map)
3147
- };
3148
- if (sourceMap.map.sourcesContent) {
3149
- sourceMap.map.sources.forEach(function(source, i) {
3150
- var contents = sourceMap.map.sourcesContent[i];
3151
- if (contents) {
3152
- var url = supportRelativeURL(sourceMap.url, source);
3153
- fileContentsCache[url] = contents;
3154
- }
3155
- });
3156
- }
3157
- } else {
3158
- sourceMap = sourceMapCache[position.source] = {
3159
- url: null,
3160
- map: null
3161
- };
3162
- }
3163
- }
3164
- if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
3165
- var originalPosition = sourceMap.map.originalPositionFor(position);
3166
- if (originalPosition.source !== null) {
3167
- originalPosition.source = supportRelativeURL(
3168
- sourceMap.url,
3169
- originalPosition.source
3170
- );
3171
- return originalPosition;
3172
- }
3173
- }
3174
- return position;
3175
- }
3176
- function mapEvalOrigin(origin) {
3177
- var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
3178
- if (match) {
3179
- var position = mapSourcePosition({
3180
- source: match[2],
3181
- line: +match[3],
3182
- column: match[4] - 1
3183
- });
3184
- return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
3185
- }
3186
- match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
3187
- if (match) {
3188
- return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
3189
- }
3190
- return origin;
3191
- }
3192
- function CallSiteToString() {
3193
- var fileName;
3194
- var fileLocation = "";
3195
- if (this.isNative()) {
3196
- fileLocation = "native";
3197
- } else {
3198
- fileName = this.getScriptNameOrSourceURL();
3199
- if (!fileName && this.isEval()) {
3200
- fileLocation = this.getEvalOrigin();
3201
- fileLocation += ", ";
3202
- }
3203
- if (fileName) {
3204
- fileLocation += fileName;
3205
- } else {
3206
- fileLocation += "<anonymous>";
3207
- }
3208
- var lineNumber = this.getLineNumber();
3209
- if (lineNumber != null) {
3210
- fileLocation += ":" + lineNumber;
3211
- var columnNumber = this.getColumnNumber();
3212
- if (columnNumber) {
3213
- fileLocation += ":" + columnNumber;
3214
- }
3215
- }
3216
- }
3217
- var line = "";
3218
- var functionName = this.getFunctionName();
3219
- var addSuffix = true;
3220
- var isConstructor = this.isConstructor();
3221
- var isMethodCall = !(this.isToplevel() || isConstructor);
3222
- if (isMethodCall) {
3223
- var typeName = this.getTypeName();
3224
- if (typeName === "[object Object]") {
3225
- typeName = "null";
3226
- }
3227
- var methodName = this.getMethodName();
3228
- if (functionName) {
3229
- if (typeName && functionName.indexOf(typeName) != 0) {
3230
- line += typeName + ".";
3231
- }
3232
- line += functionName;
3233
- if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
3234
- line += " [as " + methodName + "]";
3235
- }
3236
- } else {
3237
- line += typeName + "." + (methodName || "<anonymous>");
3238
- }
3239
- } else if (isConstructor) {
3240
- line += "new " + (functionName || "<anonymous>");
3241
- } else if (functionName) {
3242
- line += functionName;
3243
- } else {
3244
- line += fileLocation;
3245
- addSuffix = false;
3246
- }
3247
- if (addSuffix) {
3248
- line += " (" + fileLocation + ")";
3249
- }
3250
- return line;
3251
- }
3252
- function cloneCallSite(frame) {
3253
- var object = {};
3254
- Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
3255
- object[name] = /^(?:is|get)/.test(name) ? function() {
3256
- return frame[name].call(frame);
3257
- } : frame[name];
3258
- });
3259
- object.toString = CallSiteToString;
3260
- return object;
3261
- }
3262
- function wrapCallSite(frame, state) {
3263
- if (state === void 0) {
3264
- state = { nextPosition: null, curPosition: null };
3265
- }
3266
- if (frame.isNative()) {
3267
- state.curPosition = null;
3268
- return frame;
3269
- }
3270
- var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
3271
- if (source) {
3272
- var line = frame.getLineNumber();
3273
- var column = frame.getColumnNumber() - 1;
3274
- var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
3275
- var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
3276
- if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
3277
- column -= headerLength;
3278
- }
3279
- var position = mapSourcePosition({
3280
- source,
3281
- line,
3282
- column
3283
- });
3284
- state.curPosition = position;
3285
- frame = cloneCallSite(frame);
3286
- var originalFunctionName = frame.getFunctionName;
3287
- frame.getFunctionName = function() {
3288
- if (state.nextPosition == null) {
3289
- return originalFunctionName();
3290
- }
3291
- return state.nextPosition.name || originalFunctionName();
3292
- };
3293
- frame.getFileName = function() {
3294
- return position.source;
3295
- };
3296
- frame.getLineNumber = function() {
3297
- return position.line;
3298
- };
3299
- frame.getColumnNumber = function() {
3300
- return position.column + 1;
3301
- };
3302
- frame.getScriptNameOrSourceURL = function() {
3303
- return position.source;
3304
- };
3305
- return frame;
3306
- }
3307
- var origin = frame.isEval() && frame.getEvalOrigin();
3308
- if (origin) {
3309
- origin = mapEvalOrigin(origin);
3310
- frame = cloneCallSite(frame);
3311
- frame.getEvalOrigin = function() {
3312
- return origin;
3313
- };
3314
- return frame;
3315
- }
3316
- return frame;
3317
- }
3318
- function prepareStackTrace(error, stack) {
3319
- if (emptyCacheBetweenOperations) {
3320
- fileContentsCache = {};
3321
- sourceMapCache = {};
3322
- }
3323
- var name = error.name || "Error";
3324
- var message = error.message || "";
3325
- var errorString = name + ": " + message;
3326
- var state = { nextPosition: null, curPosition: null };
3327
- var processedStack = [];
3328
- for (var i = stack.length - 1; i >= 0; i--) {
3329
- processedStack.push("\n at " + wrapCallSite(stack[i], state));
3330
- state.nextPosition = state.curPosition;
3331
- }
3332
- state.curPosition = state.nextPosition = null;
3333
- return errorString + processedStack.reverse().join("");
3334
- }
3335
- function getErrorSource(error) {
3336
- var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
3337
- if (match) {
3338
- var source = match[1];
3339
- var line = +match[2];
3340
- var column = +match[3];
3341
- var contents = fileContentsCache[source];
3342
- if (!contents && fs9 && fs9.existsSync(source)) {
3343
- try {
3344
- contents = fs9.readFileSync(source, "utf8");
3345
- } catch (er) {
3346
- contents = "";
3347
- }
3348
- }
3349
- if (contents) {
3350
- var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
3351
- if (code) {
3352
- return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
3353
- }
3354
- }
3355
- }
3356
- return null;
3357
- }
3358
- function printErrorAndExit(error) {
3359
- var source = getErrorSource(error);
3360
- var stderr = globalProcessStderr();
3361
- if (stderr && stderr._handle && stderr._handle.setBlocking) {
3362
- stderr._handle.setBlocking(true);
3363
- }
3364
- if (source) {
3365
- console.error();
3366
- console.error(source);
3367
- }
3368
- console.error(error.stack);
3369
- globalProcessExit(1);
3370
- }
3371
- function shimEmitUncaughtException() {
3372
- var origEmit = process.emit;
3373
- process.emit = function(type) {
3374
- if (type === "uncaughtException") {
3375
- var hasStack = arguments[1] && arguments[1].stack;
3376
- var hasListeners = this.listeners(type).length > 0;
3377
- if (hasStack && !hasListeners) {
3378
- return printErrorAndExit(arguments[1]);
3379
- }
3380
- }
3381
- return origEmit.apply(this, arguments);
3382
- };
3383
- }
3384
- var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
3385
- var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
3386
- exports2.wrapCallSite = wrapCallSite;
3387
- exports2.getErrorSource = getErrorSource;
3388
- exports2.mapSourcePosition = mapSourcePosition;
3389
- exports2.retrieveSourceMap = retrieveSourceMap;
3390
- exports2.install = function(options) {
3391
- options = options || {};
3392
- if (options.environment) {
3393
- environment = options.environment;
3394
- if (["node", "browser", "auto"].indexOf(environment) === -1) {
3395
- throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
3396
- }
3397
- }
3398
- if (options.retrieveFile) {
3399
- if (options.overrideRetrieveFile) {
3400
- retrieveFileHandlers.length = 0;
3401
- }
3402
- retrieveFileHandlers.unshift(options.retrieveFile);
3403
- }
3404
- if (options.retrieveSourceMap) {
3405
- if (options.overrideRetrieveSourceMap) {
3406
- retrieveMapHandlers.length = 0;
3407
- }
3408
- retrieveMapHandlers.unshift(options.retrieveSourceMap);
3409
- }
3410
- if (options.hookRequire && !isInBrowser()) {
3411
- var Module = dynamicRequire(module2, "module");
3412
- var $compile = Module.prototype._compile;
3413
- if (!$compile.__sourceMapSupport) {
3414
- Module.prototype._compile = function(content, filename) {
3415
- fileContentsCache[filename] = content;
3416
- sourceMapCache[filename] = void 0;
3417
- return $compile.call(this, content, filename);
3418
- };
3419
- Module.prototype._compile.__sourceMapSupport = true;
3420
- }
3421
- }
3422
- if (!emptyCacheBetweenOperations) {
3423
- emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
3424
- }
3425
- if (!errorFormatterInstalled) {
3426
- errorFormatterInstalled = true;
3427
- Error.prepareStackTrace = prepareStackTrace;
3428
- }
3429
- if (!uncaughtShimInstalled) {
3430
- var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
3431
- try {
3432
- var worker_threads = dynamicRequire(module2, "worker_threads");
3433
- if (worker_threads.isMainThread === false) {
3434
- installHandler = false;
3435
- }
3436
- } catch (e) {
3437
- }
3438
- if (installHandler && hasGlobalProcessEventEmitter()) {
3439
- uncaughtShimInstalled = true;
3440
- shimEmitUncaughtException();
3441
- }
3442
- }
3443
- };
3444
- exports2.resetRetrieveHandlers = function() {
3445
- retrieveFileHandlers.length = 0;
3446
- retrieveMapHandlers.length = 0;
3447
- retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
3448
- retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
3449
- retrieveSourceMap = handlerExec(retrieveMapHandlers);
3450
- retrieveFile = handlerExec(retrieveFileHandlers);
3451
- };
3452
- }
3453
- });
3454
-
3455
1189
  // node_modules/typescript/lib/typescript.js
3456
1190
  var require_typescript = __commonJS({
3457
1191
  "node_modules/typescript/lib/typescript.js"(exports2, module2) {
@@ -12107,7 +9841,7 @@ ${lanes.join("\n")}
12107
9841
  debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(arg)) || !!process.recordreplay,
12108
9842
  tryEnableSourceMapsForHost() {
12109
9843
  try {
12110
- require_source_map_support().install();
9844
+ require("source-map-support").install();
12111
9845
  } catch {
12112
9846
  }
12113
9847
  },
@@ -77183,9 +74917,9 @@ ${lanes.join("\n")}
77183
74917
  const elem = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic);
77184
74918
  if (elem) {
77185
74919
  result = elaborateElementwise(
77186
- function* () {
74920
+ (function* () {
77187
74921
  yield elem;
77188
- }(),
74922
+ })(),
77189
74923
  source,
77190
74924
  target,
77191
74925
  relation,
@@ -183117,7 +180851,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
183117
180851
  return !!(symbol2.flags & 1920) && !((_a42 = symbol2.declarations) == null ? void 0 : _a42.every((d) => d.parent === node.parent));
183118
180852
  } : isRhsOfImportDeclaration ? (
183119
180853
  // Any kind is allowed when dotting off namespace in internal import equals declaration
183120
- (symbol2) => isValidTypeAccess(symbol2) || isValidValueAccess(symbol2)
180854
+ ((symbol2) => isValidTypeAccess(symbol2) || isValidValueAccess(symbol2))
183121
180855
  ) : isTypeLocation || insideJsDocTagTypeExpression ? isValidTypeAccess : isValidValueAccess;
183122
180856
  for (const exportedSymbol of exportedSymbols) {
183123
180857
  if (isValidAccess(exportedSymbol)) {
@@ -217344,8 +215078,7 @@ var stringifyJson = (data, option) => {
217344
215078
  };
217345
215079
 
217346
215080
  // webview/shared/b3type.ts
217347
- var DOCUMENT_VERSION = "2.1.0";
217348
- var VERSION = DOCUMENT_VERSION;
215081
+ var DOCUMENT_VERSION = "2.2.0";
217349
215082
  var keyWords = ["true", "false", "null", "undefined", "NaN", "Infinity"];
217350
215083
  var isIntType = (type) => type.startsWith("int");
217351
215084
  var isFloatType = (type) => type.startsWith("float");
@@ -218071,7 +215804,7 @@ var clonePersistedTree = (tree) => cloneJsonValue(tree);
218071
215804
  var clonePersistedNode = (node) => cloneJsonValue(node);
218072
215805
  var treeDataForPersistence = (data, name) => {
218073
215806
  return {
218074
- version: VERSION,
215807
+ version: DOCUMENT_VERSION,
218075
215808
  name,
218076
215809
  desc: data.desc?.trim() || void 0,
218077
215810
  prefix: data.prefix ?? "",
@@ -218736,7 +216469,7 @@ var hasBatchHookMethod = (obj) => {
218736
216469
  return false;
218737
216470
  }
218738
216471
  const candidate = obj;
218739
- return typeof candidate.onProcessTree === "function" || typeof candidate.onProcessNode === "function" || typeof candidate.onWriteFile === "function" || typeof candidate.onComplete === "function";
216472
+ return typeof candidate.shouldUpgradeTree === "function" || typeof candidate.onProcessTree === "function" || typeof candidate.onProcessNode === "function" || typeof candidate.onWriteFile === "function" || typeof candidate.onComplete === "function";
218740
216473
  };
218741
216474
  var BUILD_HOOK_MARKER = "__behavior3BuildHook";
218742
216475
  var CHECK_HOOK_MARKER = "__behavior3CheckHook";
@@ -219618,11 +217351,8 @@ var batchProcessProjectWithContext = async (project, scriptPath, context) => {
219618
217351
  let skippedFiles = 0;
219619
217352
  let failedFiles = 0;
219620
217353
  let writtenFiles = 0;
219621
- const settings = readWorkspaceSettings(project);
219622
- const checkScriptSetting = settings.checkScripts ?? [];
219623
217354
  const allErrors = [];
219624
217355
  const stagedWrites = [];
219625
- context.setCheckExpr(context.checkExprOverride ?? settings.checkExpr ?? true);
219626
217356
  let buildScriptModule;
219627
217357
  try {
219628
217358
  buildScriptModule = await loadRuntimeModule(scriptPath, {
@@ -219631,23 +217361,6 @@ var batchProcessProjectWithContext = async (project, scriptPath, context) => {
219631
217361
  } catch {
219632
217362
  logger.error(`'${scriptPath}' is not a valid batch script`);
219633
217363
  }
219634
- const checkScriptModules = [];
219635
- const checkScriptPaths = resolveCheckScriptPaths(context.workdir, checkScriptSetting);
219636
- for (const pattern of checkScriptPaths.missingPatterns) {
219637
- logger.error(`checkScripts pattern matched no files: ${pattern}`);
219638
- hasError = true;
219639
- }
219640
- for (const checkScriptPath of checkScriptPaths.paths) {
219641
- const moduleExports = await loadRuntimeModule(checkScriptPath, {
219642
- debug: context.buildScriptDebug
219643
- });
219644
- if (!moduleExports) {
219645
- logger.error(`'${checkScriptPath}' is not a valid check script`);
219646
- hasError = true;
219647
- continue;
219648
- }
219649
- checkScriptModules.push({ path: checkScriptPath, moduleExports });
219650
- }
219651
217364
  const scriptEnv = {
219652
217365
  fs: getFs(),
219653
217366
  path: b3path_default,
@@ -219655,28 +217368,25 @@ var batchProcessProjectWithContext = async (project, scriptPath, context) => {
219655
217368
  nodeDefs: context.nodeDefs,
219656
217369
  logger
219657
217370
  };
219658
- const buildRuntime = createBuildScriptRuntimeWithCheckModules(
219659
- buildScriptModule,
219660
- checkScriptModules,
219661
- scriptEnv
219662
- );
219663
- if (!buildScriptModule || buildRuntime.hasError || !buildRuntime.buildScript) {
217371
+ const buildScript = createBatchHooks(buildScriptModule, scriptEnv);
217372
+ if (!buildScriptModule || !buildScript) {
219664
217373
  hasError = true;
219665
217374
  }
219666
217375
  try {
219667
- if (!hasError || buildRuntime.buildScript) {
217376
+ if (!hasError || buildScript) {
219668
217377
  for (const candidatePath of b3path_default.lsdir(b3path_default.dirname(project), true)) {
219669
217378
  if (!isBehaviorTreeJsonPath(candidatePath)) {
219670
217379
  continue;
219671
217380
  }
219672
217381
  totalFiles += 1;
219673
217382
  const treeName = b3path_default.basenameWithoutExt(candidatePath);
217383
+ const originalDiskContent = getFs().readFileSync(candidatePath, "utf-8");
219674
217384
  const originalTree = readTreeFromFile(candidatePath);
219675
217385
  const originalContent = writeTree(originalTree, treeName);
219676
217386
  const errors = [];
219677
217387
  let tree = originalTree;
219678
217388
  try {
219679
- tree = processBatchTree(tree, candidatePath, buildRuntime.buildScript, errors);
217389
+ tree = processBatchTree(tree, candidatePath, buildScript, errors);
219680
217390
  } catch (error) {
219681
217391
  errors.push(`batch script failed: ${formatRuntimeError(error)}`);
219682
217392
  }
@@ -219685,34 +217395,6 @@ var batchProcessProjectWithContext = async (project, scriptPath, context) => {
219685
217395
  skippedFiles += 1;
219686
217396
  continue;
219687
217397
  }
219688
- const declare = {
219689
- import: tree.variables.imports.map((importPath) => ({
219690
- path: importPath,
219691
- vars: [],
219692
- depends: []
219693
- })),
219694
- vars: tree.variables.locals.map((variable) => ({
219695
- name: variable.name,
219696
- desc: variable.desc
219697
- })),
219698
- subtree: []
219699
- };
219700
- context.refreshVarDecl(tree.root, tree.group, declare);
219701
- if (!context.checkNodeData(tree.root, (message) => errors.push(message))) {
219702
- hasError = true;
219703
- }
219704
- const checkDiagnostics = collectNodeArgCheckDiagnostics({
219705
- tree,
219706
- treePath: candidatePath,
219707
- env: scriptEnv,
219708
- checkers: buildRuntime.nodeArgCheckers
219709
- });
219710
- if (checkDiagnostics.length) {
219711
- hasError = true;
219712
- checkDiagnostics.forEach(
219713
- (diagnostic) => errors.push(formatNodeArgCheckBuildDiagnostic(diagnostic))
219714
- );
219715
- }
219716
217398
  if (errors.length) {
219717
217399
  hasError = true;
219718
217400
  failedFiles += 1;
@@ -219721,7 +217403,9 @@ var batchProcessProjectWithContext = async (project, scriptPath, context) => {
219721
217403
  continue;
219722
217404
  }
219723
217405
  const nextContent = writeTree(tree, treeName);
219724
- if (nextContent === originalContent) {
217406
+ const changedByScript = nextContent !== originalContent;
217407
+ const changedByInputUpgrade = buildScript?.shouldUpgradeTree?.(candidatePath, tree) === true && nextContent !== originalDiskContent;
217408
+ if (!changedByScript && !changedByInputUpgrade) {
219725
217409
  unchangedFiles += 1;
219726
217410
  continue;
219727
217411
  }
@@ -219735,7 +217419,7 @@ var batchProcessProjectWithContext = async (project, scriptPath, context) => {
219735
217419
  if (!hasError) {
219736
217420
  for (const staged of stagedWrites) {
219737
217421
  try {
219738
- buildRuntime.buildScript?.onWriteFile?.(staged.path, staged.tree);
217422
+ buildScript?.onWriteFile?.(staged.path, staged.tree);
219739
217423
  } catch (error) {
219740
217424
  hasError = true;
219741
217425
  failedFiles += 1;
@@ -219755,7 +217439,7 @@ var batchProcessProjectWithContext = async (project, scriptPath, context) => {
219755
217439
  } finally {
219756
217440
  allErrors.forEach((message) => logger.error(message));
219757
217441
  try {
219758
- buildRuntime.buildScript?.onComplete?.(hasError ? "failure" : "success");
217442
+ buildScript?.onComplete?.(hasError ? "failure" : "success");
219759
217443
  } catch (error) {
219760
217444
  logger.error("batch script onComplete failed", error);
219761
217445
  }
@@ -221172,6 +218856,7 @@ var flattenMaterializedTree = (root, prefix) => {
221172
218856
  args: node.data.args,
221173
218857
  input: node.data.input,
221174
218858
  output: node.data.output,
218859
+ children: node.data.children,
221175
218860
  debug: node.data.debug,
221176
218861
  disabled: node.data.disabled,
221177
218862
  path: node.data.path,
@@ -222292,6 +219977,7 @@ var en_default = {
222292
219977
  reload: "Reload",
222293
219978
  reset: "Reset",
222294
219979
  "reset.confirm": "Reset to original value?",
219980
+ "reset.defaultConfirm": "Reset to default value?",
222295
219981
  rename: "Rename...",
222296
219982
  replace: "Replace",
222297
219983
  reportIssue: "Report Issue",
@@ -222494,6 +220180,7 @@ var zh_default = {
222494
220180
  reload: "\u91CD\u65B0\u52A0\u8F7D",
222495
220181
  reset: "\u91CD\u7F6E",
222496
220182
  "reset.confirm": "\u91CD\u7F6E\u4E3A\u539F\u59CB\u503C\uFF1F",
220183
+ "reset.defaultConfirm": "\u91CD\u7F6E\u4E3A\u9ED8\u8BA4\u503C\uFF1F",
222497
220184
  rename: "\u91CD\u547D\u540D...",
222498
220185
  replace: "\u66FF\u6362",
222499
220186
  reportIssue: "\u95EE\u9898\u53CD\u9988",
@@ -223190,10 +220877,7 @@ var pruneReachableSubtreeOverrides = (deps, tree) => normalizeReachableSubtreeOv
223190
220877
  readWorkspaceFileContent
223191
220878
  });
223192
220879
  function applyContentFromWebview(deps, content) {
223193
- const normalizedContent = normalizeTreeContentForWrite(
223194
- content,
223195
- deps.document.uri.fsPath
223196
- );
220880
+ const normalizedContent = normalizeTreeContentForWrite(content, deps.document.uri.fsPath);
223197
220881
  if (deps.document.content === normalizedContent) {
223198
220882
  return false;
223199
220883
  }
@@ -223213,10 +220897,7 @@ async function handleSaveSelectedAsSubtreeMutation(deps, msg) {
223213
220897
  if (msg.mutation.type !== "saveSelectedAsSubtree") {
223214
220898
  return { kind: "skip" };
223215
220899
  }
223216
- const currentTree = parsePersistedTreeContent(
223217
- deps.document.content,
223218
- deps.document.uri.fsPath
223219
- );
220900
+ const currentTree = parsePersistedTreeContent(deps.document.content, deps.document.uri.fsPath);
223220
220901
  if (currentTree.root.uuid === msg.mutation.payload.target.structuralStableId) {
223221
220902
  return {
223222
220903
  kind: "handled",
@@ -223250,7 +220931,7 @@ async function handleSaveSelectedAsSubtreeMutation(deps, msg) {
223250
220931
  };
223251
220932
  }
223252
220933
  const subtreeModel = {
223253
- version: VERSION,
220934
+ version: DOCUMENT_VERSION,
223254
220935
  name: "subtree",
223255
220936
  prefix: "",
223256
220937
  desc: msg.mutation.payload.subtreeRoot.desc,
@@ -224929,6 +222610,9 @@ var buildReloadDocumentSnapshot = (content, documentSession, selection) => ({
224929
222610
  });
224930
222611
  var stripSnapshotTransportFields = (initMessage) => {
224931
222612
  const { content, documentSession, selection, ...rest } = initMessage;
222613
+ void content;
222614
+ void documentSession;
222615
+ void selection;
224932
222616
  return rest;
224933
222617
  };
224934
222618
  var buildEmbeddedModeSettingsMessage = (snapshot) => ({
@@ -224967,6 +222651,16 @@ var InspectorSidebarCoordinator = class {
224967
222651
  this.view = null;
224968
222652
  this.viewReady = false;
224969
222653
  }
222654
+ toggleNodeJsonView() {
222655
+ if (this.inspectorMode !== "sidebar") {
222656
+ return;
222657
+ }
222658
+ const snapshot = (this.activeDocumentUri && this.sessionSnapshots.get(this.activeDocumentUri)) ?? null;
222659
+ if (!snapshot || snapshot.documentSnapshot.selection.kind !== "node") {
222660
+ return;
222661
+ }
222662
+ void this.postMessage({ type: "toggleInspectorNodeJson" });
222663
+ }
224970
222664
  setInspectorMode(mode) {
224971
222665
  this.inspectorMode = mode;
224972
222666
  if (!this.viewReady) {
@@ -225267,6 +222961,7 @@ var getVSCodeTheme2 = () => {
225267
222961
  };
225268
222962
  function activate(context) {
225269
222963
  const config = vscode23.workspace.getConfiguration("behavior3");
222964
+ const inspectorMode = config.get("inspectorMode", "sidebar");
225270
222965
  const out = getBehavior3OutputChannel();
225271
222966
  context.subscriptions.push(out);
225272
222967
  setLogger(composeLoggers(createConsoleLogger(), createLogOutputChannelLogger(out)));
@@ -225276,8 +222971,11 @@ function activate(context) {
225276
222971
  context.extensionUri,
225277
222972
  inspectorCoordinator
225278
222973
  );
225279
- inspectorCoordinator.setInspectorMode(
225280
- config.get("inspectorMode", "sidebar")
222974
+ inspectorCoordinator.setInspectorMode(inspectorMode);
222975
+ void vscode23.commands.executeCommand(
222976
+ "setContext",
222977
+ "behavior3.inspectorSidebarMode",
222978
+ inspectorMode === "sidebar"
225281
222979
  );
225282
222980
  inspectorCoordinator.setMessageDispatcher(
225283
222981
  (documentUri, message, reply) => TreeEditorProvider.dispatchMessageToDocument(documentUri, message, reply)
@@ -225321,8 +223019,12 @@ function activate(context) {
225321
223019
  if (!event.affectsConfiguration("behavior3.inspectorMode")) {
225322
223020
  return;
225323
223021
  }
225324
- inspectorCoordinator.setInspectorMode(
225325
- vscode23.workspace.getConfiguration("behavior3").get("inspectorMode", "sidebar")
223022
+ const nextInspectorMode = vscode23.workspace.getConfiguration("behavior3").get("inspectorMode", "sidebar");
223023
+ inspectorCoordinator.setInspectorMode(nextInspectorMode);
223024
+ void vscode23.commands.executeCommand(
223025
+ "setContext",
223026
+ "behavior3.inspectorSidebarMode",
223027
+ nextInspectorMode === "sidebar"
225326
223028
  );
225327
223029
  }));
225328
223030
  const autoCheckedJsonWhileOpen = /* @__PURE__ */ new Set();
@@ -225366,6 +223068,11 @@ function activate(context) {
225366
223068
  await runBuild(context, { buildScriptDebug: true });
225367
223069
  })
225368
223070
  );
223071
+ context.subscriptions.push(
223072
+ vscode23.commands.registerCommand("behavior3.toggleInspectorNodeJson", async () => {
223073
+ inspectorCoordinator.toggleNodeJsonView();
223074
+ })
223075
+ );
225369
223076
  context.subscriptions.push(
225370
223077
  vscode23.commands.registerCommand("behavior3.batchProcess", async (uri) => {
225371
223078
  await runBatchProcess(context, uri);