@hot-updater/firebase 0.33.0 → 0.33.1

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.
@@ -178,7 +178,7 @@ function calculatePagination(total, options) {
178
178
  };
179
179
  }
180
180
  //#endregion
181
- //#region ../../node_modules/.pnpm/mime@4.0.4/node_modules/mime/dist/types/other.js
181
+ //#region ../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/types/other.js
182
182
  const types$1 = {
183
183
  "application/prs.cww": ["cww"],
184
184
  "application/prs.xsf+xml": ["xsf"],
@@ -217,6 +217,7 @@ const types$1 = {
217
217
  "application/vnd.aristanetworks.swi": ["swi"],
218
218
  "application/vnd.astraea-software.iota": ["iota"],
219
219
  "application/vnd.audiograph": ["aep"],
220
+ "application/vnd.autodesk.fbx": ["fbx"],
220
221
  "application/vnd.balsamiq.bmml+xml": ["bmml"],
221
222
  "application/vnd.blueice.multipass": ["mpm"],
222
223
  "application/vnd.bmi": ["bmi"],
@@ -252,6 +253,7 @@ const types$1 = {
252
253
  "application/vnd.dart": ["dart"],
253
254
  "application/vnd.data-vision.rdz": ["rdz"],
254
255
  "application/vnd.dbf": ["dbf"],
256
+ "application/vnd.dcmp+xml": ["dcmp"],
255
257
  "application/vnd.dece.data": [
256
258
  "uvf",
257
259
  "uvvf",
@@ -305,6 +307,7 @@ const types$1 = {
305
307
  "application/vnd.fuzzysheet": ["fzs"],
306
308
  "application/vnd.genomatix.tuxedo": ["txd"],
307
309
  "application/vnd.geogebra.file": ["ggb"],
310
+ "application/vnd.geogebra.slides": ["ggs"],
308
311
  "application/vnd.geogebra.tool": ["ggt"],
309
312
  "application/vnd.geometry-explorer": ["gex", "gre"],
310
313
  "application/vnd.geonext": ["gxt"],
@@ -312,10 +315,17 @@ const types$1 = {
312
315
  "application/vnd.geospace": ["g3w"],
313
316
  "application/vnd.gmx": ["gmx"],
314
317
  "application/vnd.google-apps.document": ["gdoc"],
318
+ "application/vnd.google-apps.drawing": ["gdraw"],
319
+ "application/vnd.google-apps.form": ["gform"],
320
+ "application/vnd.google-apps.jam": ["gjam"],
321
+ "application/vnd.google-apps.map": ["gmap"],
315
322
  "application/vnd.google-apps.presentation": ["gslides"],
323
+ "application/vnd.google-apps.script": ["gscript"],
324
+ "application/vnd.google-apps.site": ["gsite"],
316
325
  "application/vnd.google-apps.spreadsheet": ["gsheet"],
317
326
  "application/vnd.google-earth.kml+xml": ["kml"],
318
327
  "application/vnd.google-earth.kmz": ["kmz"],
328
+ "application/vnd.gov.sk.xmldatacontainer+xml": ["xdcf"],
319
329
  "application/vnd.grafeq": ["gqf", "gqs"],
320
330
  "application/vnd.groove-account": ["gac"],
321
331
  "application/vnd.groove-help": ["ghf"],
@@ -442,6 +452,7 @@ const types$1 = {
442
452
  "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"],
443
453
  "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"],
444
454
  "application/vnd.ms-project": ["*mpp", "mpt"],
455
+ "application/vnd.ms-visio.viewer": ["vdx"],
445
456
  "application/vnd.ms-word.document.macroenabled.12": ["docm"],
446
457
  "application/vnd.ms-word.template.macroenabled.12": ["dotm"],
447
458
  "application/vnd.ms-works": [
@@ -456,6 +467,7 @@ const types$1 = {
456
467
  "application/vnd.musician": ["mus"],
457
468
  "application/vnd.muvee.style": ["msty"],
458
469
  "application/vnd.mynfc": ["taglet"],
470
+ "application/vnd.nato.bindingdataobject+xml": ["bdo"],
459
471
  "application/vnd.neurolanguage.nlu": ["nlu"],
460
472
  "application/vnd.nitf": ["ntf", "nitf"],
461
473
  "application/vnd.noblenet-directory": ["nnd"],
@@ -515,6 +527,9 @@ const types$1 = {
515
527
  "application/vnd.pocketlearn": ["plf"],
516
528
  "application/vnd.powerbuilder6": ["pbd"],
517
529
  "application/vnd.previewsystems.box": ["box"],
530
+ "application/vnd.procrate.brushset": ["brushset"],
531
+ "application/vnd.procreate.brush": ["brush"],
532
+ "application/vnd.procreate.dream": ["drm"],
518
533
  "application/vnd.proteus.magazine": ["mgz"],
519
534
  "application/vnd.publishare-delta-tree": ["qps"],
520
535
  "application/vnd.pvi.ptid1": ["ptid"],
@@ -598,7 +613,9 @@ const types$1 = {
598
613
  "vsd",
599
614
  "vst",
600
615
  "vss",
601
- "vsw"
616
+ "vsw",
617
+ "vsdx",
618
+ "vtx"
602
619
  ],
603
620
  "application/vnd.visionary": ["vis"],
604
621
  "application/vnd.vsf": ["vsf"],
@@ -638,6 +655,7 @@ const types$1 = {
638
655
  "application/x-bcpio": ["bcpio"],
639
656
  "application/x-bdoc": ["*bdoc"],
640
657
  "application/x-bittorrent": ["torrent"],
658
+ "application/x-blender": ["blend"],
641
659
  "application/x-blorb": ["blb", "blorb"],
642
660
  "application/x-bzip": ["bz"],
643
661
  "application/x-bzip2": ["bz2", "boz"],
@@ -654,6 +672,7 @@ const types$1 = {
654
672
  "application/x-chess-pgn": ["pgn"],
655
673
  "application/x-chrome-extension": ["crx"],
656
674
  "application/x-cocoa": ["cco"],
675
+ "application/x-compressed": ["*rar"],
657
676
  "application/x-conference": ["nsc"],
658
677
  "application/x-cpio": ["cpio"],
659
678
  "application/x-csh": ["csh"],
@@ -698,6 +717,7 @@ const types$1 = {
698
717
  "application/x-hdf": ["hdf"],
699
718
  "application/x-httpd-php": ["php"],
700
719
  "application/x-install-instructions": ["install"],
720
+ "application/x-ipynb+json": ["ipynb"],
701
721
  "application/x-iso9660-image": ["*iso"],
702
722
  "application/x-iwork-keynote-sffkey": ["*key"],
703
723
  "application/x-iwork-numbers-sffnumbers": ["*numbers"],
@@ -794,6 +814,7 @@ const types$1 = {
794
814
  "application/x-xliff+xml": ["*xlf"],
795
815
  "application/x-xpinstall": ["xpi"],
796
816
  "application/x-xz": ["xz"],
817
+ "application/x-zip-compressed": ["*zip"],
797
818
  "application/x-zmachine": [
798
819
  "z1",
799
820
  "z2",
@@ -842,6 +863,7 @@ const types$1 = {
842
863
  "image/prs.pti": ["pti"],
843
864
  "image/vnd.adobe.photoshop": ["psd"],
844
865
  "image/vnd.airzip.accelerator.azv": ["azv"],
866
+ "image/vnd.blockfact.facti": ["facti"],
845
867
  "image/vnd.dece.graphic": [
846
868
  "uvi",
847
869
  "uvvi",
@@ -869,6 +891,7 @@ const types$1 = {
869
891
  "image/vnd.xiff": ["xif"],
870
892
  "image/vnd.zbrush.pcx": ["pcx"],
871
893
  "image/x-3ds": ["3ds"],
894
+ "image/x-adobe-dng": ["dng"],
872
895
  "image/x-cmu-raster": ["ras"],
873
896
  "image/x-cmx": ["cmx"],
874
897
  "image/x-freehand": [
@@ -894,12 +917,13 @@ const types$1 = {
894
917
  "image/x-xpixmap": ["xpm"],
895
918
  "image/x-xwindowdump": ["xwd"],
896
919
  "message/vnd.wfa.wsc": ["wsc"],
920
+ "model/vnd.bary": ["bary"],
897
921
  "model/vnd.cld": ["cld"],
898
922
  "model/vnd.collada+xml": ["dae"],
899
923
  "model/vnd.dwf": ["dwf"],
900
924
  "model/vnd.gdl": ["gdl"],
901
925
  "model/vnd.gtw": ["gtw"],
902
- "model/vnd.mts": ["mts"],
926
+ "model/vnd.mts": ["*mts"],
903
927
  "model/vnd.opengex": ["ogex"],
904
928
  "model/vnd.parasolid.transmit.binary": ["x_b"],
905
929
  "model/vnd.parasolid.transmit.text": ["x_t"],
@@ -992,7 +1016,7 @@ const types$1 = {
992
1016
  };
993
1017
  Object.freeze(types$1);
994
1018
  //#endregion
995
- //#region ../../node_modules/.pnpm/mime@4.0.4/node_modules/mime/dist/types/standard.js
1019
+ //#region ../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/types/standard.js
996
1020
  const types = {
997
1021
  "application/andrew-inset": ["ez"],
998
1022
  "application/appinstaller": ["appinstaller"],
@@ -1023,6 +1047,7 @@ const types = {
1023
1047
  "application/dash+xml": ["mpd"],
1024
1048
  "application/dash-patch+xml": ["mpp"],
1025
1049
  "application/davmount+xml": ["davmount"],
1050
+ "application/dicom": ["dcm"],
1026
1051
  "application/docbook+xml": ["dbk"],
1027
1052
  "application/dssc+der": ["dssc"],
1028
1053
  "application/dssc+xml": ["xdssc"],
@@ -1126,7 +1151,9 @@ const types = {
1126
1151
  "onetoc",
1127
1152
  "onetoc2",
1128
1153
  "onetmp",
1129
- "onepkg"
1154
+ "onepkg",
1155
+ "one",
1156
+ "onea"
1130
1157
  ],
1131
1158
  "application/oxps": ["oxps"],
1132
1159
  "application/p2p-overlay+xml": ["relo"],
@@ -1237,6 +1264,7 @@ const types = {
1237
1264
  "application/yang": ["yang"],
1238
1265
  "application/yin+xml": ["yin"],
1239
1266
  "application/zip": ["zip"],
1267
+ "application/zip+dotlottie": ["lottie"],
1240
1268
  "audio/3gpp": ["*3gpp"],
1241
1269
  "audio/aac": ["adts", "aac"],
1242
1270
  "audio/adpcm": ["adp"],
@@ -1250,7 +1278,11 @@ const types = {
1250
1278
  ],
1251
1279
  "audio/mobile-xmf": ["mxmf"],
1252
1280
  "audio/mp3": ["*mp3"],
1253
- "audio/mp4": ["m4a", "mp4a"],
1281
+ "audio/mp4": [
1282
+ "m4a",
1283
+ "mp4a",
1284
+ "m4b"
1285
+ ],
1254
1286
  "audio/mpeg": [
1255
1287
  "mpga",
1256
1288
  "mp2",
@@ -1294,19 +1326,21 @@ const types = {
1294
1326
  "image/heif": ["heif"],
1295
1327
  "image/heif-sequence": ["heifs"],
1296
1328
  "image/hej2k": ["hej2"],
1297
- "image/hsj2": ["hsj2"],
1298
1329
  "image/ief": ["ief"],
1330
+ "image/jaii": ["jaii"],
1331
+ "image/jais": ["jais"],
1299
1332
  "image/jls": ["jls"],
1300
1333
  "image/jp2": ["jp2", "jpg2"],
1301
1334
  "image/jpeg": [
1302
- "jpeg",
1303
1335
  "jpg",
1336
+ "jpeg",
1304
1337
  "jpe"
1305
1338
  ],
1306
1339
  "image/jph": ["jph"],
1307
1340
  "image/jphc": ["jhc"],
1308
1341
  "image/jpm": ["jpm", "jpgm"],
1309
1342
  "image/jpx": ["jpx", "jpf"],
1343
+ "image/jxl": ["jxl"],
1310
1344
  "image/jxr": ["jxr"],
1311
1345
  "image/jxra": ["jxra"],
1312
1346
  "image/jxrs": ["jxrs"],
@@ -1316,6 +1350,7 @@ const types = {
1316
1350
  "image/jxss": ["jxss"],
1317
1351
  "image/ktx": ["ktx"],
1318
1352
  "image/ktx2": ["ktx2"],
1353
+ "image/pjpeg": ["jfif"],
1319
1354
  "image/png": ["png"],
1320
1355
  "image/sgi": ["sgi"],
1321
1356
  "image/svg+xml": ["svg", "svgz"],
@@ -1329,7 +1364,12 @@ const types = {
1329
1364
  "message/global-delivery-status": ["u8dsn"],
1330
1365
  "message/global-disposition-notification": ["u8mdn"],
1331
1366
  "message/global-headers": ["u8hdr"],
1332
- "message/rfc822": ["eml", "mime"],
1367
+ "message/rfc822": [
1368
+ "eml",
1369
+ "mime",
1370
+ "mht",
1371
+ "mhtml"
1372
+ ],
1333
1373
  "model/3mf": ["3mf"],
1334
1374
  "model/gltf+json": ["gltf"],
1335
1375
  "model/gltf-binary": ["glb"],
@@ -1343,6 +1383,13 @@ const types = {
1343
1383
  "model/mtl": ["mtl"],
1344
1384
  "model/obj": ["obj"],
1345
1385
  "model/prc": ["prc"],
1386
+ "model/step": [
1387
+ "step",
1388
+ "stp",
1389
+ "stpnc",
1390
+ "p21",
1391
+ "210"
1392
+ ],
1346
1393
  "model/step+xml": ["stpx"],
1347
1394
  "model/step+zip": ["stpz"],
1348
1395
  "model/step-xml+zip": ["stpxz"],
@@ -1418,7 +1465,12 @@ const types = {
1418
1465
  "video/jpeg": ["jpgv"],
1419
1466
  "video/jpm": ["*jpm", "*jpgm"],
1420
1467
  "video/mj2": ["mj2", "mjp2"],
1421
- "video/mp2t": ["ts"],
1468
+ "video/mp2t": [
1469
+ "ts",
1470
+ "m2t",
1471
+ "m2ts",
1472
+ "mts"
1473
+ ],
1422
1474
  "video/mp4": [
1423
1475
  "mp4",
1424
1476
  "mp4v",
@@ -1437,7 +1489,7 @@ const types = {
1437
1489
  };
1438
1490
  Object.freeze(types);
1439
1491
  //#endregion
1440
- //#region ../../node_modules/.pnpm/mime@4.0.4/node_modules/mime/dist/src/Mime.js
1492
+ //#region ../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/src/Mime.js
1441
1493
  var __classPrivateFieldGet = function(receiver, state, kind, f) {
1442
1494
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1443
1495
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
@@ -1474,8 +1526,8 @@ var Mime = class {
1474
1526
  }
1475
1527
  getType(path) {
1476
1528
  if (typeof path !== "string") return null;
1477
- const last = path.replace(/^.*[/\\]/, "").toLowerCase();
1478
- const ext = last.replace(/^.*\./, "").toLowerCase();
1529
+ const last = path.replace(/^.*[/\\]/s, "").toLowerCase();
1530
+ const ext = last.replace(/^.*\./s, "").toLowerCase();
1479
1531
  const hasPath = last.length < path.length;
1480
1532
  if (!(ext.length < last.length - 1) && hasPath) return null;
1481
1533
  return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
@@ -1506,7 +1558,7 @@ var Mime = class {
1506
1558
  };
1507
1559
  _Mime_extensionToType = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtension = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtensions = /* @__PURE__ */ new WeakMap();
1508
1560
  //#endregion
1509
- //#region ../../node_modules/.pnpm/mime@4.0.4/node_modules/mime/dist/src/index.js
1561
+ //#region ../../node_modules/.pnpm/mime@4.1.0/node_modules/mime/dist/src/index.js
1510
1562
  var src_default = new Mime(types, types$1)._freeze();
1511
1563
  //#endregion
1512
1564
  //#region ../plugin-core/dist/compressionFormat.mjs
@@ -1558,22 +1610,339 @@ function getContentType(bundlePath) {
1558
1610
  return src_default.getType(bundlePath) ?? getCompressionMimeType(filename) ?? "application/octet-stream";
1559
1611
  }
1560
1612
  //#endregion
1561
- //#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs
1562
- function isObjectLike(value) {
1563
- return typeof value === "object" && value !== null;
1613
+ //#region ../plugin-core/dist/queryBundles.mjs
1614
+ const compareValue = (value, expected, comparator) => {
1615
+ if (expected === void 0) return true;
1616
+ switch (comparator) {
1617
+ case "eq": return value === expected;
1618
+ case "gt": return value.localeCompare(expected) > 0;
1619
+ case "gte": return value.localeCompare(expected) >= 0;
1620
+ case "lt": return value.localeCompare(expected) < 0;
1621
+ case "lte": return value.localeCompare(expected) <= 0;
1622
+ }
1623
+ };
1624
+ function bundleIdMatchesFilter(id, filter) {
1625
+ if (!filter) return true;
1626
+ if (filter.in && !filter.in.includes(id)) return false;
1627
+ return compareValue(id, filter.eq, "eq") && compareValue(id, filter.gt, "gt") && compareValue(id, filter.gte, "gte") && compareValue(id, filter.lt, "lt") && compareValue(id, filter.lte, "lte");
1628
+ }
1629
+ function bundleMatchesQueryWhere$1(bundle, where) {
1630
+ if (!where) return true;
1631
+ if (where.channel !== void 0 && bundle.channel !== where.channel) return false;
1632
+ if (where.platform !== void 0 && bundle.platform !== where.platform) return false;
1633
+ if (where.enabled !== void 0 && bundle.enabled !== where.enabled) return false;
1634
+ if (!bundleIdMatchesFilter(bundle.id, where.id)) return false;
1635
+ if (where.targetAppVersionNotNull === true && bundle.targetAppVersion === null) return false;
1636
+ if (where.targetAppVersion !== void 0 && bundle.targetAppVersion !== where.targetAppVersion) return false;
1637
+ if (where.targetAppVersionIn && !where.targetAppVersionIn.includes(bundle.targetAppVersion ?? "")) return false;
1638
+ if (where.fingerprintHash !== void 0 && bundle.fingerprintHash !== where.fingerprintHash) return false;
1639
+ return true;
1640
+ }
1641
+ function sortBundles$1(bundles, orderBy) {
1642
+ const direction = orderBy?.direction ?? "desc";
1643
+ if (orderBy && orderBy.field !== "id") return bundles;
1644
+ return bundles.slice().sort((a, b) => {
1645
+ const result = a.id.localeCompare(b.id);
1646
+ return direction === "asc" ? result : -result;
1647
+ });
1564
1648
  }
1565
1649
  //#endregion
1566
- //#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/object/mergeWith.mjs
1650
+ //#region ../plugin-core/dist/bundleUnitOfWork.mjs
1651
+ const resolveEntryValue = (entry) => entry.kind === "present" ? entry.bundle : null;
1652
+ var BundleUnitOfWork = class {
1653
+ entries = /* @__PURE__ */ new Map();
1654
+ pendingLoads = /* @__PURE__ */ new Map();
1655
+ changes = /* @__PURE__ */ new Map();
1656
+ seededIds = /* @__PURE__ */ new Set();
1657
+ seed(seeds) {
1658
+ for (const seed of seeds) {
1659
+ if (!seed) continue;
1660
+ this.seededIds.add(seed.id);
1661
+ if (!this.changes.has(seed.id)) this.entries.set(seed.id, {
1662
+ kind: "present",
1663
+ bundle: seed
1664
+ });
1665
+ }
1666
+ }
1667
+ hasSeeds() {
1668
+ return this.seededIds.size > 0;
1669
+ }
1670
+ seededBundles() {
1671
+ const bundles = [];
1672
+ for (const bundleId of this.seededIds) {
1673
+ const entry = this.entries.get(bundleId);
1674
+ if (entry?.kind === "present") bundles.push(entry.bundle);
1675
+ }
1676
+ return bundles;
1677
+ }
1678
+ peek(bundleId) {
1679
+ const entry = this.entries.get(bundleId);
1680
+ if (entry?.kind === "present") return entry.bundle;
1681
+ return null;
1682
+ }
1683
+ peekChanged(bundleId) {
1684
+ if (!this.changes.has(bundleId)) return { found: false };
1685
+ const entry = this.entries.get(bundleId);
1686
+ return {
1687
+ found: true,
1688
+ value: entry ? resolveEntryValue(entry) : null
1689
+ };
1690
+ }
1691
+ async getById(bundleId, loadBundleById) {
1692
+ const entry = this.entries.get(bundleId);
1693
+ if (entry) return resolveEntryValue(entry);
1694
+ const pendingLoad = this.pendingLoads.get(bundleId);
1695
+ if (pendingLoad) return pendingLoad;
1696
+ const load = loadBundleById().then((bundle) => {
1697
+ this.pendingLoads.delete(bundleId);
1698
+ const currentEntry = this.entries.get(bundleId);
1699
+ if (currentEntry) return resolveEntryValue(currentEntry);
1700
+ this.entries.set(bundleId, bundle ? {
1701
+ kind: "present",
1702
+ bundle
1703
+ } : { kind: "missing" });
1704
+ return bundle;
1705
+ }, (error) => {
1706
+ this.pendingLoads.delete(bundleId);
1707
+ throw error;
1708
+ });
1709
+ this.pendingLoads.set(bundleId, load);
1710
+ return load;
1711
+ }
1712
+ overlayList(bundles, options) {
1713
+ const dataById = /* @__PURE__ */ new Map();
1714
+ for (const bundle of bundles) {
1715
+ const entry = this.entries.get(bundle.id);
1716
+ if (entry?.kind === "deleted") continue;
1717
+ if (entry?.kind === "present") {
1718
+ if (bundleMatchesQueryWhere$1(entry.bundle, options.where)) dataById.set(entry.bundle.id, entry.bundle);
1719
+ continue;
1720
+ }
1721
+ this.entries.set(bundle.id, {
1722
+ kind: "present",
1723
+ bundle
1724
+ });
1725
+ dataById.set(bundle.id, bundle);
1726
+ }
1727
+ for (const change of this.changes.values()) {
1728
+ if (change.operation === "delete" || change.operation === "insert") {
1729
+ dataById.delete(change.data.id);
1730
+ continue;
1731
+ }
1732
+ if (bundleMatchesQueryWhere$1(change.data, options.where)) dataById.set(change.data.id, change.data);
1733
+ else dataById.delete(change.data.id);
1734
+ }
1735
+ return sortBundles$1(Array.from(dataById.values()), options.orderBy).slice(0, options.limit);
1736
+ }
1737
+ markInsert(bundle) {
1738
+ this.entries.set(bundle.id, {
1739
+ kind: "present",
1740
+ bundle
1741
+ });
1742
+ this.changes.set(bundle.id, {
1743
+ operation: "insert",
1744
+ data: bundle,
1745
+ before: null
1746
+ });
1747
+ }
1748
+ markUpdate(bundle) {
1749
+ const previousChange = this.changes.get(bundle.id);
1750
+ const previousEntry = this.entries.get(bundle.id);
1751
+ const operation = previousChange?.operation ?? "update";
1752
+ this.entries.set(bundle.id, {
1753
+ kind: "present",
1754
+ bundle
1755
+ });
1756
+ this.changes.set(bundle.id, {
1757
+ operation,
1758
+ data: bundle,
1759
+ before: previousChange?.before ?? (previousEntry ? resolveEntryValue(previousEntry) : null)
1760
+ });
1761
+ }
1762
+ markDelete(bundle) {
1763
+ const previousChange = this.changes.get(bundle.id);
1764
+ const previousEntry = this.entries.get(bundle.id);
1765
+ this.entries.set(bundle.id, {
1766
+ kind: "deleted",
1767
+ bundle
1768
+ });
1769
+ this.changes.set(bundle.id, {
1770
+ operation: "delete",
1771
+ data: bundle,
1772
+ before: previousChange?.before ?? (previousEntry ? resolveEntryValue(previousEntry) : bundle)
1773
+ });
1774
+ }
1775
+ changedSets() {
1776
+ return Array.from(this.changes.values(), ({ data, operation }) => ({
1777
+ operation,
1778
+ data
1779
+ }));
1780
+ }
1781
+ hasChanges() {
1782
+ return this.changes.size > 0;
1783
+ }
1784
+ listFetchExtraCount() {
1785
+ return Array.from(this.changes.values()).filter((change) => change.operation === "update" || change.operation === "delete").length;
1786
+ }
1787
+ totalDelta(where) {
1788
+ let total = 0;
1789
+ for (const change of this.changes.values()) {
1790
+ if (change.operation === "insert") continue;
1791
+ const matchedBefore = change.before !== null && bundleMatchesQueryWhere$1(change.before, where);
1792
+ const matchesAfter = change.operation === "update" && bundleMatchesQueryWhere$1(change.data, where);
1793
+ if (matchedBefore && !matchesAfter) total -= 1;
1794
+ else if (!matchedBefore && matchesAfter) total += 1;
1795
+ }
1796
+ return total;
1797
+ }
1798
+ clear() {
1799
+ this.entries.clear();
1800
+ this.pendingLoads.clear();
1801
+ this.changes.clear();
1802
+ this.seededIds.clear();
1803
+ }
1804
+ };
1805
+ //#endregion
1806
+ //#region ../plugin-core/dist/bundleUnitOfWorkStore.mjs
1807
+ const requestUnitOfWorks = /* @__PURE__ */ new WeakMap();
1808
+ const isUnitOfWorkContext = (value) => typeof value === "object" && value !== null || typeof value === "function";
1809
+ const getRequestBundleUnitOfWork = (context) => {
1810
+ if (!isUnitOfWorkContext(context)) return null;
1811
+ let unitOfWork = requestUnitOfWorks.get(context);
1812
+ if (!unitOfWork) {
1813
+ unitOfWork = new BundleUnitOfWork();
1814
+ requestUnitOfWorks.set(context, unitOfWork);
1815
+ }
1816
+ return unitOfWork;
1817
+ };
1818
+ //#endregion
1819
+ //#region ../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
1820
+ /**
1821
+ * Checks if a given value is a plain object.
1822
+ *
1823
+ * @param {object} value - The value to check.
1824
+ * @returns {value is Record<PropertyKey, any>} - True if the value is a plain object, otherwise false.
1825
+ *
1826
+ * @example
1827
+ * ```typescript
1828
+ * // ✅👇 True
1829
+ *
1830
+ * isPlainObject({ }); // ✅
1831
+ * isPlainObject({ key: 'value' }); // ✅
1832
+ * isPlainObject({ key: new Date() }); // ✅
1833
+ * isPlainObject(new Object()); // ✅
1834
+ * isPlainObject(Object.create(null)); // ✅
1835
+ * isPlainObject({ nested: { key: true} }); // ✅
1836
+ * isPlainObject(new Proxy({}, {})); // ✅
1837
+ * isPlainObject({ [Symbol('tag')]: 'A' }); // ✅
1838
+ *
1839
+ * // ✅👇 (cross-realms, node context, workers, ...)
1840
+ * const runInNewContext = await import('node:vm').then(
1841
+ * (mod) => mod.runInNewContext
1842
+ * );
1843
+ * isPlainObject(runInNewContext('({})')); // ✅
1844
+ *
1845
+ * // ❌👇 False
1846
+ *
1847
+ * class Test { };
1848
+ * isPlainObject(new Test()) // ❌
1849
+ * isPlainObject(10); // ❌
1850
+ * isPlainObject(null); // ❌
1851
+ * isPlainObject('hello'); // ❌
1852
+ * isPlainObject([]); // ❌
1853
+ * isPlainObject(new Date()); // ❌
1854
+ * isPlainObject(new Uint8Array([1])); // ❌
1855
+ * isPlainObject(Buffer.from('ABC')); // ❌
1856
+ * isPlainObject(Promise.resolve({})); // ❌
1857
+ * isPlainObject(Object.create({})); // ❌
1858
+ * isPlainObject(new (class Cls {})); // ❌
1859
+ * isPlainObject(globalThis); // ❌,
1860
+ * ```
1861
+ */
1862
+ function isPlainObject(value) {
1863
+ if (!value || typeof value !== "object") return false;
1864
+ const proto = Object.getPrototypeOf(value);
1865
+ if (!(proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null)) return false;
1866
+ return Object.prototype.toString.call(value) === "[object Object]";
1867
+ }
1868
+ //#endregion
1869
+ //#region ../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
1870
+ /**
1871
+ * Checks if a property key is unsafe to modify directly.
1872
+ *
1873
+ * This function is used in functions like `merge` to prevent prototype pollution attacks
1874
+ * by identifying property keys that could modify the object's prototype chain or constructor.
1875
+ *
1876
+ * @param key - The property key to check
1877
+ * @returns `true` if the property is unsafe to modify directly, `false` otherwise
1878
+ * @internal
1879
+ */
1880
+ function isUnsafeProperty(key) {
1881
+ return key === "__proto__";
1882
+ }
1883
+ //#endregion
1884
+ //#region ../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/object/mergeWith.mjs
1885
+ /**
1886
+ * Merges the properties of the source object into the target object.
1887
+ *
1888
+ * You can provide a custom `merge` function to control how properties are merged. It should return the value to be set in the target object.
1889
+ *
1890
+ * If it returns `undefined`, a default deep merge will be applied for arrays and objects:
1891
+ *
1892
+ * - If a property in the source object is an array or an object and the corresponding property in the target object is also an array or object, they will be merged.
1893
+ * - If a property in the source object is undefined, it will not overwrite a defined property in the target object.
1894
+ *
1895
+ * Note that this function mutates the target object.
1896
+ *
1897
+ * @param {T} target - The target object into which the source object properties will be merged. This object is modified in place.
1898
+ * @param {S} source - The source object whose properties will be merged into the target object.
1899
+ * @param {(targetValue: any, sourceValue: any, key: string, target: T, source: S) => any} merge - A custom merge function that defines how properties should be combined. It receives the following arguments:
1900
+ * - `targetValue`: The current value of the property in the target object.
1901
+ * - `sourceValue`: The value of the property in the source object.
1902
+ * - `key`: The key of the property being merged.
1903
+ * - `target`: The target object.
1904
+ * - `source`: The source object.
1905
+ *
1906
+ * @returns {T & S} The updated target object with properties from the source object merged in.
1907
+ *
1908
+ * @template T - Type of the target object.
1909
+ * @template S - Type of the source object.
1910
+ *
1911
+ * @example
1912
+ * const target = { a: 1, b: 2 };
1913
+ * const source = { b: 3, c: 4 };
1914
+ *
1915
+ * mergeWith(target, source, (targetValue, sourceValue) => {
1916
+ * if (typeof targetValue === 'number' && typeof sourceValue === 'number') {
1917
+ * return targetValue + sourceValue;
1918
+ * }
1919
+ * });
1920
+ * // Returns { a: 1, b: 5, c: 4 }
1921
+ * @example
1922
+ * const target = { a: [1], b: [2] };
1923
+ * const source = { a: [3], b: [4] };
1924
+ *
1925
+ * const result = mergeWith(target, source, (objValue, srcValue) => {
1926
+ * if (Array.isArray(objValue)) {
1927
+ * return objValue.concat(srcValue);
1928
+ * }
1929
+ * });
1930
+ *
1931
+ * expect(result).toEqual({ a: [1, 3], b: [2, 4] });
1932
+ */
1567
1933
  function mergeWith(target, source, merge) {
1568
1934
  const sourceKeys = Object.keys(source);
1569
1935
  for (let i = 0; i < sourceKeys.length; i++) {
1570
1936
  const key = sourceKeys[i];
1937
+ if (isUnsafeProperty(key)) continue;
1571
1938
  const sourceValue = source[key];
1572
1939
  const targetValue = target[key];
1573
1940
  const merged = merge(targetValue, sourceValue, key, target, source);
1574
- if (merged != null) target[key] = merged;
1575
- else if (Array.isArray(sourceValue)) target[key] = mergeWith(targetValue ?? [], sourceValue, merge);
1576
- else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);
1941
+ if (merged !== void 0) target[key] = merged;
1942
+ else if (Array.isArray(sourceValue)) if (Array.isArray(targetValue)) target[key] = mergeWith(targetValue, sourceValue, merge);
1943
+ else target[key] = mergeWith([], sourceValue, merge);
1944
+ else if (isPlainObject(sourceValue)) if (isPlainObject(targetValue)) target[key] = mergeWith(targetValue, sourceValue, merge);
1945
+ else target[key] = mergeWith({}, sourceValue, merge);
1577
1946
  else if (targetValue === void 0 || sourceValue !== void 0) target[key] = sourceValue;
1578
1947
  }
1579
1948
  return target;
@@ -1590,7 +1959,7 @@ function normalizePage(value) {
1590
1959
  return value;
1591
1960
  }
1592
1961
  function mergeBundleUpdate(baseBundle, patch) {
1593
- return mergeWith(baseBundle, patch, (_targetValue, sourceValue, key) => {
1962
+ return mergeWith({ ...baseBundle }, patch, (_targetValue, sourceValue, key) => {
1594
1963
  if (REPLACE_ON_UPDATE_KEYS.includes(key)) return sourceValue;
1595
1964
  });
1596
1965
  }
@@ -1646,6 +2015,27 @@ function createPaginatedResult(total, limit, startIndex, data) {
1646
2015
  }
1647
2016
  };
1648
2017
  }
2018
+ function expandLimitForUnitOfWork(options, unitOfWork) {
2019
+ const extraLimit = unitOfWork.listFetchExtraCount();
2020
+ if (extraLimit === 0) return options;
2021
+ return {
2022
+ ...options,
2023
+ limit: options.limit + extraLimit
2024
+ };
2025
+ }
2026
+ function adjustPaginationTotal(pagination, options) {
2027
+ if (options.totalDelta === 0) return pagination;
2028
+ const total = Math.max(0, pagination.total + options.totalDelta);
2029
+ const hasPreviousPage = pagination.currentPage > 1;
2030
+ const hasNextPage = pagination.currentPage * options.limit < total;
2031
+ return {
2032
+ ...pagination,
2033
+ total,
2034
+ hasNextPage,
2035
+ hasPreviousPage,
2036
+ totalPages: total === 0 ? 0 : Math.ceil(total / options.limit)
2037
+ };
2038
+ }
1649
2039
  /**
1650
2040
  * Creates a database plugin with lazy initialization and automatic hook execution.
1651
2041
  *
@@ -1680,12 +2070,12 @@ function createDatabasePlugin(options) {
1680
2070
  return cachedMethods;
1681
2071
  };
1682
2072
  return () => {
1683
- const changedMap = /* @__PURE__ */ new Map();
1684
- const markChanged = (operation, data) => {
1685
- changedMap.set(data.id, {
1686
- operation,
1687
- data
1688
- });
2073
+ const instanceMutationUnitOfWork = new BundleUnitOfWork();
2074
+ const getRequestUnitOfWork = (context) => {
2075
+ return getRequestBundleUnitOfWork(context);
2076
+ };
2077
+ const getMutationUnitOfWork = (context) => {
2078
+ return getRequestUnitOfWork(context) ?? instanceMutationUnitOfWork;
1689
2079
  };
1690
2080
  const runGetBundles = async (options, context) => {
1691
2081
  if (context === void 0) return getMethods().getBundles(options);
@@ -1743,22 +2133,41 @@ function createDatabasePlugin(options) {
1743
2133
  const plugin = {
1744
2134
  name: options.name,
1745
2135
  async getBundleById(bundleId, context) {
1746
- if (context === void 0) return getMethods().getBundleById(bundleId);
1747
- return getMethods().getBundleById(bundleId, context);
2136
+ const requestUnitOfWork = getRequestUnitOfWork(context);
2137
+ if (requestUnitOfWork) return requestUnitOfWork.getById(bundleId, () => getMethods().getBundleById(bundleId, context));
2138
+ const pendingMutation = instanceMutationUnitOfWork.peekChanged(bundleId);
2139
+ if (pendingMutation.found) return pendingMutation.value;
2140
+ return getMethods().getBundleById(bundleId);
1748
2141
  },
1749
2142
  async getBundles(options, context) {
1750
2143
  if (typeof options === "object" && options !== null && "offset" in options && options.offset !== void 0) throw new Error("Bundle offset pagination has been removed. Use cursor.after or cursor.before instead.");
1751
2144
  const methods = getMethods();
2145
+ const requestUnitOfWork = getRequestUnitOfWork(context);
2146
+ const unitOfWork = requestUnitOfWork ?? instanceMutationUnitOfWork;
2147
+ const shouldOverlay = requestUnitOfWork !== null || instanceMutationUnitOfWork.hasChanges();
1752
2148
  const normalizedOptions = {
1753
2149
  ...options,
1754
2150
  page: normalizePage(options.page),
1755
2151
  orderBy: options.orderBy ?? DEFAULT_DESC_ORDER
1756
2152
  };
2153
+ const overlayResult = (result) => ({
2154
+ ...result,
2155
+ data: unitOfWork.overlayList(result.data, {
2156
+ limit: normalizedOptions.limit,
2157
+ orderBy: normalizedOptions.orderBy,
2158
+ where: normalizedOptions.where
2159
+ }),
2160
+ pagination: adjustPaginationTotal(result.pagination, {
2161
+ limit: normalizedOptions.limit,
2162
+ totalDelta: unitOfWork.totalDelta(normalizedOptions.where)
2163
+ })
2164
+ });
1757
2165
  if (normalizedOptions.page !== void 0) {
1758
2166
  const { page, ...pageOptions } = normalizedOptions;
1759
2167
  const requestedOffset = (page - 1) * normalizedOptions.limit;
2168
+ const fetchPageOptions = expandLimitForUnitOfWork(pageOptions, unitOfWork);
1760
2169
  let pageResult = await runGetBundles({
1761
- ...pageOptions,
2170
+ ...fetchPageOptions,
1762
2171
  offset: requestedOffset
1763
2172
  }, context);
1764
2173
  const total = pageResult.pagination.total;
@@ -1766,16 +2175,19 @@ function createDatabasePlugin(options) {
1766
2175
  const maxOffset = totalPages === 0 ? 0 : (Math.max(1, totalPages) - 1) * normalizedOptions.limit;
1767
2176
  const resolvedOffset = Math.min(requestedOffset, maxOffset);
1768
2177
  if (resolvedOffset !== requestedOffset) pageResult = await runGetBundles({
1769
- ...pageOptions,
2178
+ ...fetchPageOptions,
1770
2179
  offset: resolvedOffset
1771
2180
  }, context);
1772
- return createPaginatedResult(total, normalizedOptions.limit, resolvedOffset, pageResult.data);
2181
+ const result = { ...createPaginatedResult(total, normalizedOptions.limit, resolvedOffset, pageResult.data) };
2182
+ return shouldOverlay ? overlayResult(result) : result;
1773
2183
  }
1774
2184
  if (methods.supportsCursorPagination) {
1775
- if (context === void 0) return methods.getBundles(normalizedOptions);
1776
- return methods.getBundles(normalizedOptions, context);
2185
+ const fetchOptions = expandLimitForUnitOfWork(normalizedOptions, unitOfWork);
2186
+ const result = context === void 0 ? await methods.getBundles(fetchOptions) : await methods.getBundles(fetchOptions, context);
2187
+ return shouldOverlay ? overlayResult(result) : result;
1777
2188
  }
1778
- return getBundlesWithLegacyCursorFallback(normalizedOptions, context);
2189
+ const result = await getBundlesWithLegacyCursorFallback(shouldOverlay ? expandLimitForUnitOfWork(normalizedOptions, unitOfWork) : normalizedOptions, context);
2190
+ return shouldOverlay ? overlayResult(result) : result;
1779
2191
  },
1780
2192
  async getChannels(context) {
1781
2193
  if (context === void 0) return getMethods().getChannels();
@@ -1787,31 +2199,25 @@ function createDatabasePlugin(options) {
1787
2199
  },
1788
2200
  async commitBundle(context) {
1789
2201
  const methods = getMethods();
1790
- const params = { changedSets: Array.from(changedMap.values()) };
2202
+ const unitOfWork = getMutationUnitOfWork(context);
2203
+ const params = { changedSets: unitOfWork.changedSets() };
1791
2204
  if (context === void 0) await methods.commitBundle(params);
1792
2205
  else await methods.commitBundle(params, context);
1793
- changedMap.clear();
2206
+ unitOfWork.clear();
1794
2207
  await hooks?.onDatabaseUpdated?.();
1795
2208
  },
1796
2209
  async updateBundle(targetBundleId, newBundle, context) {
1797
- const pendingChange = changedMap.get(targetBundleId);
1798
- if (pendingChange) {
1799
- const updatedData = mergeBundleUpdate(pendingChange.data, newBundle);
1800
- changedMap.set(targetBundleId, {
1801
- operation: pendingChange.operation,
1802
- data: updatedData
1803
- });
1804
- return;
1805
- }
1806
- const currentBundle = context === void 0 ? await getMethods().getBundleById(targetBundleId) : await getMethods().getBundleById(targetBundleId, context);
2210
+ const unitOfWork = getMutationUnitOfWork(context);
2211
+ const currentBundle = await unitOfWork.getById(targetBundleId, () => context === void 0 ? getMethods().getBundleById(targetBundleId) : getMethods().getBundleById(targetBundleId, context));
1807
2212
  if (!currentBundle) throw new Error("targetBundleId not found");
1808
- markChanged("update", mergeBundleUpdate(currentBundle, newBundle));
2213
+ const updatedBundle = mergeBundleUpdate(currentBundle, newBundle);
2214
+ unitOfWork.markUpdate(updatedBundle);
1809
2215
  },
1810
- async appendBundle(inputBundle) {
1811
- markChanged("insert", inputBundle);
2216
+ async appendBundle(inputBundle, context) {
2217
+ getMutationUnitOfWork(context).markInsert(inputBundle);
1812
2218
  },
1813
- async deleteBundle(deleteBundle) {
1814
- markChanged("delete", deleteBundle);
2219
+ async deleteBundle(deleteBundle, context) {
2220
+ getMutationUnitOfWork(context).markDelete(deleteBundle);
1815
2221
  }
1816
2222
  };
1817
2223
  Object.defineProperty(plugin, "getUpdateInfo", {
@@ -1844,7 +2250,7 @@ function createDatabasePlugin(options) {
1844
2250
  };
1845
2251
  }
1846
2252
  //#endregion
1847
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
2253
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js
1848
2254
  var require_constants$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
1849
2255
  const SEMVER_SPEC_VERSION = "2.0.0";
1850
2256
  const MAX_LENGTH = 256;
@@ -1869,12 +2275,12 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =>
1869
2275
  };
1870
2276
  }));
1871
2277
  //#endregion
1872
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js
2278
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js
1873
2279
  var require_debug$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
1874
2280
  module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
1875
2281
  }));
1876
2282
  //#endregion
1877
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js
2283
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
1878
2284
  var require_re$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
1879
2285
  const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants$1();
1880
2286
  const debug = require_debug$1();
@@ -1953,7 +2359,7 @@ var require_re$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
1953
2359
  createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
1954
2360
  }));
1955
2361
  //#endregion
1956
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js
2362
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
1957
2363
  var require_parse_options$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
1958
2364
  const looseOption = Object.freeze({ loose: true });
1959
2365
  const emptyOpts = Object.freeze({});
@@ -1965,10 +2371,11 @@ var require_parse_options$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module)
1965
2371
  module.exports = parseOptions;
1966
2372
  }));
1967
2373
  //#endregion
1968
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js
2374
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
1969
2375
  var require_identifiers$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
1970
2376
  const numeric = /^[0-9]+$/;
1971
2377
  const compareIdentifiers = (a, b) => {
2378
+ if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
1972
2379
  const anum = numeric.test(a);
1973
2380
  const bnum = numeric.test(b);
1974
2381
  if (anum && bnum) {
@@ -1984,13 +2391,19 @@ var require_identifiers$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =
1984
2391
  };
1985
2392
  }));
1986
2393
  //#endregion
1987
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
2394
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
1988
2395
  var require_semver$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
1989
2396
  const debug = require_debug$1();
1990
2397
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants$1();
1991
2398
  const { safeRe: re, t } = require_re$1();
1992
2399
  const parseOptions = require_parse_options$1();
1993
2400
  const { compareIdentifiers } = require_identifiers$1();
2401
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
2402
+ const identifiers = identifier.split(".");
2403
+ if (identifiers.length > prerelease.length) return false;
2404
+ for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
2405
+ return true;
2406
+ };
1994
2407
  module.exports = class SemVer {
1995
2408
  constructor(version, options) {
1996
2409
  options = parseOptions(options);
@@ -2041,7 +2454,13 @@ var require_semver$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2041
2454
  }
2042
2455
  compareMain(other) {
2043
2456
  if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
2044
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
2457
+ if (this.major < other.major) return -1;
2458
+ if (this.major > other.major) return 1;
2459
+ if (this.minor < other.minor) return -1;
2460
+ if (this.minor > other.minor) return 1;
2461
+ if (this.patch < other.patch) return -1;
2462
+ if (this.patch > other.patch) return 1;
2463
+ return 0;
2045
2464
  }
2046
2465
  comparePre(other) {
2047
2466
  if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
@@ -2141,8 +2560,9 @@ var require_semver$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2141
2560
  if (identifier) {
2142
2561
  let prerelease = [identifier, base];
2143
2562
  if (identifierBase === false) prerelease = [identifier];
2144
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
2145
- if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
2563
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
2564
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
2565
+ if (isNaN(prereleaseBase)) this.prerelease = prerelease;
2146
2566
  } else this.prerelease = prerelease;
2147
2567
  }
2148
2568
  break;
@@ -2156,7 +2576,7 @@ var require_semver$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2156
2576
  };
2157
2577
  }));
2158
2578
  //#endregion
2159
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js
2579
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
2160
2580
  var require_parse$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2161
2581
  const SemVer = require_semver$2();
2162
2582
  const parse = (version, options, throwErrors = false) => {
@@ -2171,7 +2591,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2171
2591
  module.exports = parse;
2172
2592
  }));
2173
2593
  //#endregion
2174
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js
2594
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
2175
2595
  var require_valid$3 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2176
2596
  const parse = require_parse$1();
2177
2597
  const valid = (version, options) => {
@@ -2181,7 +2601,7 @@ var require_valid$3 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2181
2601
  module.exports = valid;
2182
2602
  }));
2183
2603
  //#endregion
2184
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js
2604
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
2185
2605
  var require_clean$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2186
2606
  const parse = require_parse$1();
2187
2607
  const clean = (version, options) => {
@@ -2191,7 +2611,7 @@ var require_clean$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2191
2611
  module.exports = clean;
2192
2612
  }));
2193
2613
  //#endregion
2194
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js
2614
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
2195
2615
  var require_inc$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2196
2616
  const SemVer = require_semver$2();
2197
2617
  const inc = (version, release, options, identifier, identifierBase) => {
@@ -2209,7 +2629,7 @@ var require_inc$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2209
2629
  module.exports = inc;
2210
2630
  }));
2211
2631
  //#endregion
2212
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js
2632
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
2213
2633
  var require_diff$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2214
2634
  const parse = require_parse$1();
2215
2635
  const diff = (version1, version2) => {
@@ -2237,28 +2657,28 @@ var require_diff$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2237
2657
  module.exports = diff;
2238
2658
  }));
2239
2659
  //#endregion
2240
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js
2660
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
2241
2661
  var require_major$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2242
2662
  const SemVer = require_semver$2();
2243
2663
  const major = (a, loose) => new SemVer(a, loose).major;
2244
2664
  module.exports = major;
2245
2665
  }));
2246
2666
  //#endregion
2247
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js
2667
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
2248
2668
  var require_minor$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2249
2669
  const SemVer = require_semver$2();
2250
2670
  const minor = (a, loose) => new SemVer(a, loose).minor;
2251
2671
  module.exports = minor;
2252
2672
  }));
2253
2673
  //#endregion
2254
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js
2674
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
2255
2675
  var require_patch$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2256
2676
  const SemVer = require_semver$2();
2257
2677
  const patch = (a, loose) => new SemVer(a, loose).patch;
2258
2678
  module.exports = patch;
2259
2679
  }));
2260
2680
  //#endregion
2261
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js
2681
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
2262
2682
  var require_prerelease$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2263
2683
  const parse = require_parse$1();
2264
2684
  const prerelease = (version, options) => {
@@ -2268,28 +2688,28 @@ var require_prerelease$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =>
2268
2688
  module.exports = prerelease;
2269
2689
  }));
2270
2690
  //#endregion
2271
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
2691
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
2272
2692
  var require_compare$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2273
2693
  const SemVer = require_semver$2();
2274
2694
  const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
2275
2695
  module.exports = compare;
2276
2696
  }));
2277
2697
  //#endregion
2278
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js
2698
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
2279
2699
  var require_rcompare$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2280
2700
  const compare = require_compare$1();
2281
2701
  const rcompare = (a, b, loose) => compare(b, a, loose);
2282
2702
  module.exports = rcompare;
2283
2703
  }));
2284
2704
  //#endregion
2285
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js
2705
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
2286
2706
  var require_compare_loose$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2287
2707
  const compare = require_compare$1();
2288
2708
  const compareLoose = (a, b) => compare(a, b, true);
2289
2709
  module.exports = compareLoose;
2290
2710
  }));
2291
2711
  //#endregion
2292
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js
2712
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
2293
2713
  var require_compare_build$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2294
2714
  const SemVer = require_semver$2();
2295
2715
  const compareBuild = (a, b, loose) => {
@@ -2300,63 +2720,63 @@ var require_compare_build$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module)
2300
2720
  module.exports = compareBuild;
2301
2721
  }));
2302
2722
  //#endregion
2303
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js
2723
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
2304
2724
  var require_sort$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2305
2725
  const compareBuild = require_compare_build$1();
2306
2726
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
2307
2727
  module.exports = sort;
2308
2728
  }));
2309
2729
  //#endregion
2310
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js
2730
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
2311
2731
  var require_rsort$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2312
2732
  const compareBuild = require_compare_build$1();
2313
2733
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
2314
2734
  module.exports = rsort;
2315
2735
  }));
2316
2736
  //#endregion
2317
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
2737
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
2318
2738
  var require_gt$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2319
2739
  const compare = require_compare$1();
2320
2740
  const gt = (a, b, loose) => compare(a, b, loose) > 0;
2321
2741
  module.exports = gt;
2322
2742
  }));
2323
2743
  //#endregion
2324
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
2744
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
2325
2745
  var require_lt$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2326
2746
  const compare = require_compare$1();
2327
2747
  const lt = (a, b, loose) => compare(a, b, loose) < 0;
2328
2748
  module.exports = lt;
2329
2749
  }));
2330
2750
  //#endregion
2331
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
2751
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
2332
2752
  var require_eq$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2333
2753
  const compare = require_compare$1();
2334
2754
  const eq = (a, b, loose) => compare(a, b, loose) === 0;
2335
2755
  module.exports = eq;
2336
2756
  }));
2337
2757
  //#endregion
2338
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
2758
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
2339
2759
  var require_neq$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2340
2760
  const compare = require_compare$1();
2341
2761
  const neq = (a, b, loose) => compare(a, b, loose) !== 0;
2342
2762
  module.exports = neq;
2343
2763
  }));
2344
2764
  //#endregion
2345
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
2765
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
2346
2766
  var require_gte$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2347
2767
  const compare = require_compare$1();
2348
2768
  const gte = (a, b, loose) => compare(a, b, loose) >= 0;
2349
2769
  module.exports = gte;
2350
2770
  }));
2351
2771
  //#endregion
2352
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js
2772
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
2353
2773
  var require_lte$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2354
2774
  const compare = require_compare$1();
2355
2775
  const lte = (a, b, loose) => compare(a, b, loose) <= 0;
2356
2776
  module.exports = lte;
2357
2777
  }));
2358
2778
  //#endregion
2359
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js
2779
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
2360
2780
  var require_cmp$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2361
2781
  const eq = require_eq$1();
2362
2782
  const neq = require_neq$1();
@@ -2388,7 +2808,7 @@ var require_cmp$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2388
2808
  module.exports = cmp;
2389
2809
  }));
2390
2810
  //#endregion
2391
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js
2811
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
2392
2812
  var require_coerce$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2393
2813
  const SemVer = require_semver$2();
2394
2814
  const parse = require_parse$1();
@@ -2416,7 +2836,40 @@ var require_coerce$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2416
2836
  module.exports = coerce;
2417
2837
  }));
2418
2838
  //#endregion
2419
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js
2839
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
2840
+ var require_truncate$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2841
+ const parse = require_parse$1();
2842
+ const constants = require_constants$1();
2843
+ const SemVer = require_semver$2();
2844
+ const truncate = (version, truncation, options) => {
2845
+ if (!constants.RELEASE_TYPES.includes(truncation)) return null;
2846
+ const clonedVersion = cloneInputVersion(version, options);
2847
+ return clonedVersion && doTruncation(clonedVersion, truncation);
2848
+ };
2849
+ const cloneInputVersion = (version, options) => {
2850
+ return parse(version instanceof SemVer ? version.version : version, options);
2851
+ };
2852
+ const doTruncation = (version, truncation) => {
2853
+ if (isPrerelease(truncation)) return version.version;
2854
+ version.prerelease = [];
2855
+ switch (truncation) {
2856
+ case "major":
2857
+ version.minor = 0;
2858
+ version.patch = 0;
2859
+ break;
2860
+ case "minor":
2861
+ version.patch = 0;
2862
+ break;
2863
+ }
2864
+ return version.format();
2865
+ };
2866
+ const isPrerelease = (type) => {
2867
+ return type.startsWith("pre");
2868
+ };
2869
+ module.exports = truncate;
2870
+ }));
2871
+ //#endregion
2872
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/lrucache.js
2420
2873
  var require_lrucache$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2421
2874
  var LRUCache = class {
2422
2875
  constructor() {
@@ -2449,7 +2902,7 @@ var require_lrucache$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2449
2902
  module.exports = LRUCache;
2450
2903
  }));
2451
2904
  //#endregion
2452
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
2905
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js
2453
2906
  var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2454
2907
  const SPACE_CHARACTERS = /\s+/g;
2455
2908
  module.exports = class Range {
@@ -2503,6 +2956,7 @@ var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2503
2956
  return this.range;
2504
2957
  }
2505
2958
  parseRange(range) {
2959
+ range = range.replace(BUILDSTRIPRE, "");
2506
2960
  const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
2507
2961
  const cached = cache.get(memoKey);
2508
2962
  if (cached) return cached;
@@ -2561,8 +3015,9 @@ var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2561
3015
  const Comparator = require_comparator$1();
2562
3016
  const debug = require_debug$1();
2563
3017
  const SemVer = require_semver$2();
2564
- const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re$1();
3018
+ const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re$1();
2565
3019
  const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants$1();
3020
+ const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
2566
3021
  const isNullSet = (c) => c.value === "<0.0.0-0";
2567
3022
  const isAny = (c) => c.value === "";
2568
3023
  const isSatisfiable = (comparators, options) => {
@@ -2578,6 +3033,7 @@ var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2578
3033
  return result;
2579
3034
  };
2580
3035
  const parseComparator = (comp, options) => {
3036
+ comp = comp.replace(re[t.BUILD], "");
2581
3037
  debug("comp", comp, options);
2582
3038
  comp = replaceCarets(comp, options);
2583
3039
  debug("caret", comp);
@@ -2590,6 +3046,7 @@ var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2590
3046
  return comp;
2591
3047
  };
2592
3048
  const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
3049
+ const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
2593
3050
  const replaceTildes = (comp, options) => {
2594
3051
  return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
2595
3052
  };
@@ -2630,8 +3087,8 @@ var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2630
3087
  else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
2631
3088
  } else {
2632
3089
  debug("no pr");
2633
- if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
2634
- else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
3090
+ if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
3091
+ else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
2635
3092
  else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
2636
3093
  }
2637
3094
  debug("caret return", ret);
@@ -2647,6 +3104,7 @@ var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2647
3104
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
2648
3105
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
2649
3106
  debug("xRange", comp, ret, gtlt, M, m, p, pr);
3107
+ if (invalidXRangeOrder(M, m, p)) return comp;
2650
3108
  const xM = isX(M);
2651
3109
  const xm = xM || isX(m);
2652
3110
  const xp = xm || isX(p);
@@ -2720,7 +3178,7 @@ var require_range$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2720
3178
  };
2721
3179
  }));
2722
3180
  //#endregion
2723
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
3181
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js
2724
3182
  var require_comparator$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2725
3183
  const ANY = Symbol("SemVer ANY");
2726
3184
  module.exports = class Comparator {
@@ -2790,7 +3248,7 @@ var require_comparator$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =>
2790
3248
  const Range = require_range$1();
2791
3249
  }));
2792
3250
  //#endregion
2793
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
3251
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
2794
3252
  var require_satisfies$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2795
3253
  const Range = require_range$1();
2796
3254
  const satisfies = (version, range, options) => {
@@ -2804,14 +3262,14 @@ var require_satisfies$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =>
2804
3262
  module.exports = satisfies;
2805
3263
  }));
2806
3264
  //#endregion
2807
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js
3265
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
2808
3266
  var require_to_comparators$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2809
3267
  const Range = require_range$1();
2810
3268
  const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
2811
3269
  module.exports = toComparators;
2812
3270
  }));
2813
3271
  //#endregion
2814
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js
3272
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
2815
3273
  var require_max_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2816
3274
  const SemVer = require_semver$2();
2817
3275
  const Range = require_range$1();
@@ -2837,7 +3295,7 @@ var require_max_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module
2837
3295
  module.exports = maxSatisfying;
2838
3296
  }));
2839
3297
  //#endregion
2840
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js
3298
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
2841
3299
  var require_min_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2842
3300
  const SemVer = require_semver$2();
2843
3301
  const Range = require_range$1();
@@ -2863,7 +3321,7 @@ var require_min_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module
2863
3321
  module.exports = minSatisfying;
2864
3322
  }));
2865
3323
  //#endregion
2866
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
3324
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-version.js
2867
3325
  var require_min_version$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2868
3326
  const SemVer = require_semver$2();
2869
3327
  const Range = require_range$1();
@@ -2902,7 +3360,7 @@ var require_min_version$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =
2902
3360
  module.exports = minVersion;
2903
3361
  }));
2904
3362
  //#endregion
2905
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js
3363
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/valid.js
2906
3364
  var require_valid$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2907
3365
  const Range = require_range$1();
2908
3366
  const validRange = (range, options) => {
@@ -2915,7 +3373,7 @@ var require_valid$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2915
3373
  module.exports = validRange;
2916
3374
  }));
2917
3375
  //#endregion
2918
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
3376
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/outside.js
2919
3377
  var require_outside$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2920
3378
  const SemVer = require_semver$2();
2921
3379
  const Comparator = require_comparator$1();
@@ -2968,21 +3426,21 @@ var require_outside$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2968
3426
  module.exports = outside;
2969
3427
  }));
2970
3428
  //#endregion
2971
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
3429
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
2972
3430
  var require_gtr$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2973
3431
  const outside = require_outside$1();
2974
3432
  const gtr = (version, range, options) => outside(version, range, ">", options);
2975
3433
  module.exports = gtr;
2976
3434
  }));
2977
3435
  //#endregion
2978
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
3436
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
2979
3437
  var require_ltr$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2980
3438
  const outside = require_outside$1();
2981
3439
  const ltr = (version, range, options) => outside(version, range, "<", options);
2982
3440
  module.exports = ltr;
2983
3441
  }));
2984
3442
  //#endregion
2985
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js
3443
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
2986
3444
  var require_intersects$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2987
3445
  const Range = require_range$1();
2988
3446
  const intersects = (r1, r2, options) => {
@@ -2993,7 +3451,7 @@ var require_intersects$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) =>
2993
3451
  module.exports = intersects;
2994
3452
  }));
2995
3453
  //#endregion
2996
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js
3454
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
2997
3455
  var require_simplify$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
2998
3456
  const satisfies = require_satisfies$1();
2999
3457
  const compare = require_compare$1();
@@ -3023,7 +3481,7 @@ var require_simplify$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3023
3481
  };
3024
3482
  }));
3025
3483
  //#endregion
3026
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js
3484
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
3027
3485
  var require_subset$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3028
3486
  const Range = require_range$1();
3029
3487
  const Comparator = require_comparator$1();
@@ -3087,7 +3545,7 @@ var require_subset$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3087
3545
  if (c.operator === ">" || c.operator === ">=") {
3088
3546
  higher = higherGT(gt, c, options);
3089
3547
  if (higher === c && higher !== gt) return false;
3090
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
3548
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
3091
3549
  }
3092
3550
  if (lt) {
3093
3551
  if (needDomLTPre) {
@@ -3096,7 +3554,7 @@ var require_subset$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3096
3554
  if (c.operator === "<" || c.operator === "<=") {
3097
3555
  lower = lowerLT(lt, c, options);
3098
3556
  if (lower === c && lower !== lt) return false;
3099
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
3557
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
3100
3558
  }
3101
3559
  if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
3102
3560
  }
@@ -3148,6 +3606,7 @@ var import_semver$1 = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJSMin$1
3148
3606
  lte: require_lte$1(),
3149
3607
  cmp: require_cmp$1(),
3150
3608
  coerce: require_coerce$1(),
3609
+ truncate: require_truncate$1(),
3151
3610
  Comparator: require_comparator$1(),
3152
3611
  Range: require_range$1(),
3153
3612
  satisfies: require_satisfies$1(),
@@ -3192,17 +3651,13 @@ const filterCompatibleAppVersions = (targetAppVersionList, currentVersion) => {
3192
3651
  };
3193
3652
  //#endregion
3194
3653
  //#region ../plugin-core/dist/requestUpdateBundleState.mjs
3195
- const requestUpdateBundleSeeds = /* @__PURE__ */ new WeakMap();
3196
- const isWeakMapKey = (value) => typeof value === "object" && value !== null || typeof value === "function";
3197
3654
  const toBundleSeeds = (seeds) => seeds.filter((seed) => !!seed);
3198
3655
  const seedRequestUpdateBundles = (context, seeds) => {
3199
- if (!isWeakMapKey(context)) return;
3656
+ const unitOfWork = getRequestBundleUnitOfWork(context);
3657
+ if (!unitOfWork) return;
3200
3658
  const nextSeeds = toBundleSeeds(seeds);
3201
3659
  if (nextSeeds.length === 0) return;
3202
- const bundlesById = /* @__PURE__ */ new Map();
3203
- for (const seed of requestUpdateBundleSeeds.get(context) ?? []) bundlesById.set(seed.id, seed);
3204
- for (const seed of nextSeeds) bundlesById.set(seed.id, seed);
3205
- requestUpdateBundleSeeds.set(context, [...bundlesById.values()]);
3660
+ unitOfWork.seed(nextSeeds);
3206
3661
  };
3207
3662
  //#endregion
3208
3663
  //#region ../js/dist/index.mjs
@@ -3343,6 +3798,7 @@ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) =>
3343
3798
  var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3344
3799
  const numeric = /^[0-9]+$/;
3345
3800
  const compareIdentifiers = (a, b) => {
3801
+ if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
3346
3802
  const anum = numeric.test(a);
3347
3803
  const bnum = numeric.test(b);
3348
3804
  if (anum && bnum) {
@@ -3363,6 +3819,12 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3363
3819
  const { safeRe: re, t } = require_re();
3364
3820
  const parseOptions = require_parse_options();
3365
3821
  const { compareIdentifiers } = require_identifiers();
3822
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
3823
+ const identifiers = identifier.split(".");
3824
+ if (identifiers.length > prerelease.length) return false;
3825
+ for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
3826
+ return true;
3827
+ };
3366
3828
  module.exports = class SemVer {
3367
3829
  constructor(version, options) {
3368
3830
  options = parseOptions(options);
@@ -3413,7 +3875,13 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3413
3875
  }
3414
3876
  compareMain(other) {
3415
3877
  if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
3416
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
3878
+ if (this.major < other.major) return -1;
3879
+ if (this.major > other.major) return 1;
3880
+ if (this.minor < other.minor) return -1;
3881
+ if (this.minor > other.minor) return 1;
3882
+ if (this.patch < other.patch) return -1;
3883
+ if (this.patch > other.patch) return 1;
3884
+ return 0;
3417
3885
  }
3418
3886
  comparePre(other) {
3419
3887
  if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
@@ -3513,8 +3981,9 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3513
3981
  if (identifier) {
3514
3982
  let prerelease = [identifier, base];
3515
3983
  if (identifierBase === false) prerelease = [identifier];
3516
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
3517
- if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
3984
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
3985
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
3986
+ if (isNaN(prereleaseBase)) this.prerelease = prerelease;
3518
3987
  } else this.prerelease = prerelease;
3519
3988
  }
3520
3989
  break;
@@ -3741,6 +4210,37 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3741
4210
  };
3742
4211
  module.exports = coerce;
3743
4212
  }));
4213
+ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4214
+ const parse = require_parse();
4215
+ const constants = require_constants();
4216
+ const SemVer = require_semver$1();
4217
+ const truncate = (version, truncation, options) => {
4218
+ if (!constants.RELEASE_TYPES.includes(truncation)) return null;
4219
+ const clonedVersion = cloneInputVersion(version, options);
4220
+ return clonedVersion && doTruncation(clonedVersion, truncation);
4221
+ };
4222
+ const cloneInputVersion = (version, options) => {
4223
+ return parse(version instanceof SemVer ? version.version : version, options);
4224
+ };
4225
+ const doTruncation = (version, truncation) => {
4226
+ if (isPrerelease(truncation)) return version.version;
4227
+ version.prerelease = [];
4228
+ switch (truncation) {
4229
+ case "major":
4230
+ version.minor = 0;
4231
+ version.patch = 0;
4232
+ break;
4233
+ case "minor":
4234
+ version.patch = 0;
4235
+ break;
4236
+ }
4237
+ return version.format();
4238
+ };
4239
+ const isPrerelease = (type) => {
4240
+ return type.startsWith("pre");
4241
+ };
4242
+ module.exports = truncate;
4243
+ }));
3744
4244
  var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3745
4245
  var LRUCache = class {
3746
4246
  constructor() {
@@ -3825,6 +4325,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3825
4325
  return this.range;
3826
4326
  }
3827
4327
  parseRange(range) {
4328
+ range = range.replace(BUILDSTRIPRE, "");
3828
4329
  const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
3829
4330
  const cached = cache.get(memoKey);
3830
4331
  if (cached) return cached;
@@ -3883,8 +4384,9 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3883
4384
  const Comparator = require_comparator();
3884
4385
  const debug = require_debug();
3885
4386
  const SemVer = require_semver$1();
3886
- const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
4387
+ const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
3887
4388
  const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
4389
+ const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
3888
4390
  const isNullSet = (c) => c.value === "<0.0.0-0";
3889
4391
  const isAny = (c) => c.value === "";
3890
4392
  const isSatisfiable = (comparators, options) => {
@@ -3900,6 +4402,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3900
4402
  return result;
3901
4403
  };
3902
4404
  const parseComparator = (comp, options) => {
4405
+ comp = comp.replace(re[t.BUILD], "");
3903
4406
  debug("comp", comp, options);
3904
4407
  comp = replaceCarets(comp, options);
3905
4408
  debug("caret", comp);
@@ -3912,6 +4415,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3912
4415
  return comp;
3913
4416
  };
3914
4417
  const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
4418
+ const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
3915
4419
  const replaceTildes = (comp, options) => {
3916
4420
  return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
3917
4421
  };
@@ -3952,8 +4456,8 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3952
4456
  else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
3953
4457
  } else {
3954
4458
  debug("no pr");
3955
- if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
3956
- else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
4459
+ if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
4460
+ else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
3957
4461
  else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
3958
4462
  }
3959
4463
  debug("caret return", ret);
@@ -3969,6 +4473,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3969
4473
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
3970
4474
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
3971
4475
  debug("xRange", comp, ret, gtlt, M, m, p, pr);
4476
+ if (invalidXRangeOrder(M, m, p)) return comp;
3972
4477
  const xM = isX(M);
3973
4478
  const xm = xM || isX(m);
3974
4479
  const xp = xm || isX(p);
@@ -4383,7 +4888,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4383
4888
  if (c.operator === ">" || c.operator === ">=") {
4384
4889
  higher = higherGT(gt, c, options);
4385
4890
  if (higher === c && higher !== gt) return false;
4386
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
4891
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
4387
4892
  }
4388
4893
  if (lt) {
4389
4894
  if (needDomLTPre) {
@@ -4392,7 +4897,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4392
4897
  if (c.operator === "<" || c.operator === "<=") {
4393
4898
  lower = lowerLT(lt, c, options);
4394
4899
  if (lower === c && lower !== lt) return false;
4395
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
4900
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
4396
4901
  }
4397
4902
  if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
4398
4903
  }
@@ -4442,6 +4947,7 @@ var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exp
4442
4947
  lte: require_lte(),
4443
4948
  cmp: require_cmp(),
4444
4949
  coerce: require_coerce(),
4950
+ truncate: require_truncate(),
4445
4951
  Comparator: require_comparator(),
4446
4952
  Range: require_range(),
4447
4953
  satisfies: require_satisfies(),