@settlemint/sdk-cli 2.2.3-pr09bf4cc8 → 2.2.3-pr0f5033c1

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.
Files changed (3) hide show
  1. package/dist/cli.js +645 -3331
  2. package/dist/cli.js.map +7 -23
  3. package/package.json +8 -8
package/dist/cli.js CHANGED
@@ -29768,7 +29768,7 @@ var require_lib3 = __commonJS((exports, module) => {
29768
29768
  };
29769
29769
  });
29770
29770
 
29771
- // ../../node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/index.js
29771
+ // ../../node_modules/lru-cache/dist/commonjs/index.js
29772
29772
  var require_commonjs = __commonJS((exports) => {
29773
29773
  Object.defineProperty(exports, "__esModule", { value: true });
29774
29774
  exports.LRUCache = undefined;
@@ -32623,1123 +32623,8 @@ globstar while`, file, fr, pattern, pr, swallowee);
32623
32623
  exports.minimatch.unescape = unescape_js_1.unescape;
32624
32624
  });
32625
32625
 
32626
- // ../../node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js
32627
- var require_commonjs3 = __commonJS((exports) => {
32628
- Object.defineProperty(exports, "__esModule", { value: true });
32629
- exports.LRUCache = undefined;
32630
- var perf2 = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
32631
- var warned2 = new Set;
32632
- var PROCESS2 = typeof process === "object" && !!process ? process : {};
32633
- var emitWarning2 = (msg, type2, code, fn) => {
32634
- typeof PROCESS2.emitWarning === "function" ? PROCESS2.emitWarning(msg, type2, code, fn) : console.error(`[${code}] ${type2}: ${msg}`);
32635
- };
32636
- var AC2 = globalThis.AbortController;
32637
- var AS2 = globalThis.AbortSignal;
32638
- if (typeof AC2 === "undefined") {
32639
- AS2 = class AbortSignal2 {
32640
- onabort;
32641
- _onabort = [];
32642
- reason;
32643
- aborted = false;
32644
- addEventListener(_, fn) {
32645
- this._onabort.push(fn);
32646
- }
32647
- };
32648
- AC2 = class AbortController2 {
32649
- constructor() {
32650
- warnACPolyfill();
32651
- }
32652
- signal = new AS2;
32653
- abort(reason) {
32654
- if (this.signal.aborted)
32655
- return;
32656
- this.signal.reason = reason;
32657
- this.signal.aborted = true;
32658
- for (const fn of this.signal._onabort) {
32659
- fn(reason);
32660
- }
32661
- this.signal.onabort?.(reason);
32662
- }
32663
- };
32664
- let printACPolyfillWarning = PROCESS2.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
32665
- const warnACPolyfill = () => {
32666
- if (!printACPolyfillWarning)
32667
- return;
32668
- printACPolyfillWarning = false;
32669
- emitWarning2("AbortController is not defined. If using lru-cache in " + "node 14, load an AbortController polyfill from the " + "`node-abort-controller` package. A minimal polyfill is " + "provided for use by LRUCache.fetch(), but it should not be " + "relied upon in other contexts (eg, passing it to other APIs that " + "use AbortController/AbortSignal might have undesirable effects). " + "You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
32670
- };
32671
- }
32672
- var shouldWarn2 = (code) => !warned2.has(code);
32673
- var TYPE2 = Symbol("type");
32674
- var isPosInt2 = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
32675
- var getUintArray2 = (max) => !isPosInt2(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray2 : null;
32676
-
32677
- class ZeroArray2 extends Array {
32678
- constructor(size) {
32679
- super(size);
32680
- this.fill(0);
32681
- }
32682
- }
32683
-
32684
- class Stack2 {
32685
- heap;
32686
- length;
32687
- static #constructing = false;
32688
- static create(max) {
32689
- const HeapCls = getUintArray2(max);
32690
- if (!HeapCls)
32691
- return [];
32692
- Stack2.#constructing = true;
32693
- const s = new Stack2(max, HeapCls);
32694
- Stack2.#constructing = false;
32695
- return s;
32696
- }
32697
- constructor(max, HeapCls) {
32698
- if (!Stack2.#constructing) {
32699
- throw new TypeError("instantiate Stack using Stack.create(n)");
32700
- }
32701
- this.heap = new HeapCls(max);
32702
- this.length = 0;
32703
- }
32704
- push(n2) {
32705
- this.heap[this.length++] = n2;
32706
- }
32707
- pop() {
32708
- return this.heap[--this.length];
32709
- }
32710
- }
32711
-
32712
- class LRUCache2 {
32713
- #max;
32714
- #maxSize;
32715
- #dispose;
32716
- #disposeAfter;
32717
- #fetchMethod;
32718
- #memoMethod;
32719
- ttl;
32720
- ttlResolution;
32721
- ttlAutopurge;
32722
- updateAgeOnGet;
32723
- updateAgeOnHas;
32724
- allowStale;
32725
- noDisposeOnSet;
32726
- noUpdateTTL;
32727
- maxEntrySize;
32728
- sizeCalculation;
32729
- noDeleteOnFetchRejection;
32730
- noDeleteOnStaleGet;
32731
- allowStaleOnFetchAbort;
32732
- allowStaleOnFetchRejection;
32733
- ignoreFetchAbort;
32734
- #size;
32735
- #calculatedSize;
32736
- #keyMap;
32737
- #keyList;
32738
- #valList;
32739
- #next;
32740
- #prev;
32741
- #head;
32742
- #tail;
32743
- #free;
32744
- #disposed;
32745
- #sizes;
32746
- #starts;
32747
- #ttls;
32748
- #hasDispose;
32749
- #hasFetchMethod;
32750
- #hasDisposeAfter;
32751
- static unsafeExposeInternals(c) {
32752
- return {
32753
- starts: c.#starts,
32754
- ttls: c.#ttls,
32755
- sizes: c.#sizes,
32756
- keyMap: c.#keyMap,
32757
- keyList: c.#keyList,
32758
- valList: c.#valList,
32759
- next: c.#next,
32760
- prev: c.#prev,
32761
- get head() {
32762
- return c.#head;
32763
- },
32764
- get tail() {
32765
- return c.#tail;
32766
- },
32767
- free: c.#free,
32768
- isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
32769
- backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
32770
- moveToTail: (index) => c.#moveToTail(index),
32771
- indexes: (options) => c.#indexes(options),
32772
- rindexes: (options) => c.#rindexes(options),
32773
- isStale: (index) => c.#isStale(index)
32774
- };
32775
- }
32776
- get max() {
32777
- return this.#max;
32778
- }
32779
- get maxSize() {
32780
- return this.#maxSize;
32781
- }
32782
- get calculatedSize() {
32783
- return this.#calculatedSize;
32784
- }
32785
- get size() {
32786
- return this.#size;
32787
- }
32788
- get fetchMethod() {
32789
- return this.#fetchMethod;
32790
- }
32791
- get memoMethod() {
32792
- return this.#memoMethod;
32793
- }
32794
- get dispose() {
32795
- return this.#dispose;
32796
- }
32797
- get disposeAfter() {
32798
- return this.#disposeAfter;
32799
- }
32800
- constructor(options) {
32801
- const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
32802
- if (max !== 0 && !isPosInt2(max)) {
32803
- throw new TypeError("max option must be a nonnegative integer");
32804
- }
32805
- const UintArray = max ? getUintArray2(max) : Array;
32806
- if (!UintArray) {
32807
- throw new Error("invalid max value: " + max);
32808
- }
32809
- this.#max = max;
32810
- this.#maxSize = maxSize;
32811
- this.maxEntrySize = maxEntrySize || this.#maxSize;
32812
- this.sizeCalculation = sizeCalculation;
32813
- if (this.sizeCalculation) {
32814
- if (!this.#maxSize && !this.maxEntrySize) {
32815
- throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
32816
- }
32817
- if (typeof this.sizeCalculation !== "function") {
32818
- throw new TypeError("sizeCalculation set to non-function");
32819
- }
32820
- }
32821
- if (memoMethod !== undefined && typeof memoMethod !== "function") {
32822
- throw new TypeError("memoMethod must be a function if defined");
32823
- }
32824
- this.#memoMethod = memoMethod;
32825
- if (fetchMethod !== undefined && typeof fetchMethod !== "function") {
32826
- throw new TypeError("fetchMethod must be a function if specified");
32827
- }
32828
- this.#fetchMethod = fetchMethod;
32829
- this.#hasFetchMethod = !!fetchMethod;
32830
- this.#keyMap = new Map;
32831
- this.#keyList = new Array(max).fill(undefined);
32832
- this.#valList = new Array(max).fill(undefined);
32833
- this.#next = new UintArray(max);
32834
- this.#prev = new UintArray(max);
32835
- this.#head = 0;
32836
- this.#tail = 0;
32837
- this.#free = Stack2.create(max);
32838
- this.#size = 0;
32839
- this.#calculatedSize = 0;
32840
- if (typeof dispose === "function") {
32841
- this.#dispose = dispose;
32842
- }
32843
- if (typeof disposeAfter === "function") {
32844
- this.#disposeAfter = disposeAfter;
32845
- this.#disposed = [];
32846
- } else {
32847
- this.#disposeAfter = undefined;
32848
- this.#disposed = undefined;
32849
- }
32850
- this.#hasDispose = !!this.#dispose;
32851
- this.#hasDisposeAfter = !!this.#disposeAfter;
32852
- this.noDisposeOnSet = !!noDisposeOnSet;
32853
- this.noUpdateTTL = !!noUpdateTTL;
32854
- this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
32855
- this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
32856
- this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
32857
- this.ignoreFetchAbort = !!ignoreFetchAbort;
32858
- if (this.maxEntrySize !== 0) {
32859
- if (this.#maxSize !== 0) {
32860
- if (!isPosInt2(this.#maxSize)) {
32861
- throw new TypeError("maxSize must be a positive integer if specified");
32862
- }
32863
- }
32864
- if (!isPosInt2(this.maxEntrySize)) {
32865
- throw new TypeError("maxEntrySize must be a positive integer if specified");
32866
- }
32867
- this.#initializeSizeTracking();
32868
- }
32869
- this.allowStale = !!allowStale;
32870
- this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
32871
- this.updateAgeOnGet = !!updateAgeOnGet;
32872
- this.updateAgeOnHas = !!updateAgeOnHas;
32873
- this.ttlResolution = isPosInt2(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
32874
- this.ttlAutopurge = !!ttlAutopurge;
32875
- this.ttl = ttl || 0;
32876
- if (this.ttl) {
32877
- if (!isPosInt2(this.ttl)) {
32878
- throw new TypeError("ttl must be a positive integer if specified");
32879
- }
32880
- this.#initializeTTLTracking();
32881
- }
32882
- if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
32883
- throw new TypeError("At least one of max, maxSize, or ttl is required");
32884
- }
32885
- if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
32886
- const code = "LRU_CACHE_UNBOUNDED";
32887
- if (shouldWarn2(code)) {
32888
- warned2.add(code);
32889
- const msg = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
32890
- emitWarning2(msg, "UnboundedCacheWarning", code, LRUCache2);
32891
- }
32892
- }
32893
- }
32894
- getRemainingTTL(key2) {
32895
- return this.#keyMap.has(key2) ? Infinity : 0;
32896
- }
32897
- #initializeTTLTracking() {
32898
- const ttls = new ZeroArray2(this.#max);
32899
- const starts = new ZeroArray2(this.#max);
32900
- this.#ttls = ttls;
32901
- this.#starts = starts;
32902
- this.#setItemTTL = (index, ttl, start = perf2.now()) => {
32903
- starts[index] = ttl !== 0 ? start : 0;
32904
- ttls[index] = ttl;
32905
- if (ttl !== 0 && this.ttlAutopurge) {
32906
- const t3 = setTimeout(() => {
32907
- if (this.#isStale(index)) {
32908
- this.#delete(this.#keyList[index], "expire");
32909
- }
32910
- }, ttl + 1);
32911
- if (t3.unref) {
32912
- t3.unref();
32913
- }
32914
- }
32915
- };
32916
- this.#updateItemAge = (index) => {
32917
- starts[index] = ttls[index] !== 0 ? perf2.now() : 0;
32918
- };
32919
- this.#statusTTL = (status, index) => {
32920
- if (ttls[index]) {
32921
- const ttl = ttls[index];
32922
- const start = starts[index];
32923
- if (!ttl || !start)
32924
- return;
32925
- status.ttl = ttl;
32926
- status.start = start;
32927
- status.now = cachedNow || getNow();
32928
- const age = status.now - start;
32929
- status.remainingTTL = ttl - age;
32930
- }
32931
- };
32932
- let cachedNow = 0;
32933
- const getNow = () => {
32934
- const n2 = perf2.now();
32935
- if (this.ttlResolution > 0) {
32936
- cachedNow = n2;
32937
- const t3 = setTimeout(() => cachedNow = 0, this.ttlResolution);
32938
- if (t3.unref) {
32939
- t3.unref();
32940
- }
32941
- }
32942
- return n2;
32943
- };
32944
- this.getRemainingTTL = (key2) => {
32945
- const index = this.#keyMap.get(key2);
32946
- if (index === undefined) {
32947
- return 0;
32948
- }
32949
- const ttl = ttls[index];
32950
- const start = starts[index];
32951
- if (!ttl || !start) {
32952
- return Infinity;
32953
- }
32954
- const age = (cachedNow || getNow()) - start;
32955
- return ttl - age;
32956
- };
32957
- this.#isStale = (index) => {
32958
- const s = starts[index];
32959
- const t3 = ttls[index];
32960
- return !!t3 && !!s && (cachedNow || getNow()) - s > t3;
32961
- };
32962
- }
32963
- #updateItemAge = () => {};
32964
- #statusTTL = () => {};
32965
- #setItemTTL = () => {};
32966
- #isStale = () => false;
32967
- #initializeSizeTracking() {
32968
- const sizes = new ZeroArray2(this.#max);
32969
- this.#calculatedSize = 0;
32970
- this.#sizes = sizes;
32971
- this.#removeItemSize = (index) => {
32972
- this.#calculatedSize -= sizes[index];
32973
- sizes[index] = 0;
32974
- };
32975
- this.#requireSize = (k, v, size, sizeCalculation) => {
32976
- if (this.#isBackgroundFetch(v)) {
32977
- return 0;
32978
- }
32979
- if (!isPosInt2(size)) {
32980
- if (sizeCalculation) {
32981
- if (typeof sizeCalculation !== "function") {
32982
- throw new TypeError("sizeCalculation must be a function");
32983
- }
32984
- size = sizeCalculation(v, k);
32985
- if (!isPosInt2(size)) {
32986
- throw new TypeError("sizeCalculation return invalid (expect positive integer)");
32987
- }
32988
- } else {
32989
- throw new TypeError("invalid size value (must be positive integer). " + "When maxSize or maxEntrySize is used, sizeCalculation " + "or size must be set.");
32990
- }
32991
- }
32992
- return size;
32993
- };
32994
- this.#addItemSize = (index, size, status) => {
32995
- sizes[index] = size;
32996
- if (this.#maxSize) {
32997
- const maxSize = this.#maxSize - sizes[index];
32998
- while (this.#calculatedSize > maxSize) {
32999
- this.#evict(true);
33000
- }
33001
- }
33002
- this.#calculatedSize += sizes[index];
33003
- if (status) {
33004
- status.entrySize = size;
33005
- status.totalCalculatedSize = this.#calculatedSize;
33006
- }
33007
- };
33008
- }
33009
- #removeItemSize = (_i) => {};
33010
- #addItemSize = (_i, _s, _st) => {};
33011
- #requireSize = (_k, _v, size, sizeCalculation) => {
33012
- if (size || sizeCalculation) {
33013
- throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
33014
- }
33015
- return 0;
33016
- };
33017
- *#indexes({ allowStale = this.allowStale } = {}) {
33018
- if (this.#size) {
33019
- for (let i2 = this.#tail;; ) {
33020
- if (!this.#isValidIndex(i2)) {
33021
- break;
33022
- }
33023
- if (allowStale || !this.#isStale(i2)) {
33024
- yield i2;
33025
- }
33026
- if (i2 === this.#head) {
33027
- break;
33028
- } else {
33029
- i2 = this.#prev[i2];
33030
- }
33031
- }
33032
- }
33033
- }
33034
- *#rindexes({ allowStale = this.allowStale } = {}) {
33035
- if (this.#size) {
33036
- for (let i2 = this.#head;; ) {
33037
- if (!this.#isValidIndex(i2)) {
33038
- break;
33039
- }
33040
- if (allowStale || !this.#isStale(i2)) {
33041
- yield i2;
33042
- }
33043
- if (i2 === this.#tail) {
33044
- break;
33045
- } else {
33046
- i2 = this.#next[i2];
33047
- }
33048
- }
33049
- }
33050
- }
33051
- #isValidIndex(index) {
33052
- return index !== undefined && this.#keyMap.get(this.#keyList[index]) === index;
33053
- }
33054
- *entries() {
33055
- for (const i2 of this.#indexes()) {
33056
- if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
33057
- yield [this.#keyList[i2], this.#valList[i2]];
33058
- }
33059
- }
33060
- }
33061
- *rentries() {
33062
- for (const i2 of this.#rindexes()) {
33063
- if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
33064
- yield [this.#keyList[i2], this.#valList[i2]];
33065
- }
33066
- }
33067
- }
33068
- *keys() {
33069
- for (const i2 of this.#indexes()) {
33070
- const k = this.#keyList[i2];
33071
- if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
33072
- yield k;
33073
- }
33074
- }
33075
- }
33076
- *rkeys() {
33077
- for (const i2 of this.#rindexes()) {
33078
- const k = this.#keyList[i2];
33079
- if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
33080
- yield k;
33081
- }
33082
- }
33083
- }
33084
- *values() {
33085
- for (const i2 of this.#indexes()) {
33086
- const v = this.#valList[i2];
33087
- if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
33088
- yield this.#valList[i2];
33089
- }
33090
- }
33091
- }
33092
- *rvalues() {
33093
- for (const i2 of this.#rindexes()) {
33094
- const v = this.#valList[i2];
33095
- if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
33096
- yield this.#valList[i2];
33097
- }
33098
- }
33099
- }
33100
- [Symbol.iterator]() {
33101
- return this.entries();
33102
- }
33103
- [Symbol.toStringTag] = "LRUCache";
33104
- find(fn, getOptions = {}) {
33105
- for (const i2 of this.#indexes()) {
33106
- const v = this.#valList[i2];
33107
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
33108
- if (value2 === undefined)
33109
- continue;
33110
- if (fn(value2, this.#keyList[i2], this)) {
33111
- return this.get(this.#keyList[i2], getOptions);
33112
- }
33113
- }
33114
- }
33115
- forEach(fn, thisp = this) {
33116
- for (const i2 of this.#indexes()) {
33117
- const v = this.#valList[i2];
33118
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
33119
- if (value2 === undefined)
33120
- continue;
33121
- fn.call(thisp, value2, this.#keyList[i2], this);
33122
- }
33123
- }
33124
- rforEach(fn, thisp = this) {
33125
- for (const i2 of this.#rindexes()) {
33126
- const v = this.#valList[i2];
33127
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
33128
- if (value2 === undefined)
33129
- continue;
33130
- fn.call(thisp, value2, this.#keyList[i2], this);
33131
- }
33132
- }
33133
- purgeStale() {
33134
- let deleted = false;
33135
- for (const i2 of this.#rindexes({ allowStale: true })) {
33136
- if (this.#isStale(i2)) {
33137
- this.#delete(this.#keyList[i2], "expire");
33138
- deleted = true;
33139
- }
33140
- }
33141
- return deleted;
33142
- }
33143
- info(key2) {
33144
- const i2 = this.#keyMap.get(key2);
33145
- if (i2 === undefined)
33146
- return;
33147
- const v = this.#valList[i2];
33148
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
33149
- if (value2 === undefined)
33150
- return;
33151
- const entry = { value: value2 };
33152
- if (this.#ttls && this.#starts) {
33153
- const ttl = this.#ttls[i2];
33154
- const start = this.#starts[i2];
33155
- if (ttl && start) {
33156
- const remain = ttl - (perf2.now() - start);
33157
- entry.ttl = remain;
33158
- entry.start = Date.now();
33159
- }
33160
- }
33161
- if (this.#sizes) {
33162
- entry.size = this.#sizes[i2];
33163
- }
33164
- return entry;
33165
- }
33166
- dump() {
33167
- const arr = [];
33168
- for (const i2 of this.#indexes({ allowStale: true })) {
33169
- const key2 = this.#keyList[i2];
33170
- const v = this.#valList[i2];
33171
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
33172
- if (value2 === undefined || key2 === undefined)
33173
- continue;
33174
- const entry = { value: value2 };
33175
- if (this.#ttls && this.#starts) {
33176
- entry.ttl = this.#ttls[i2];
33177
- const age = perf2.now() - this.#starts[i2];
33178
- entry.start = Math.floor(Date.now() - age);
33179
- }
33180
- if (this.#sizes) {
33181
- entry.size = this.#sizes[i2];
33182
- }
33183
- arr.unshift([key2, entry]);
33184
- }
33185
- return arr;
33186
- }
33187
- load(arr) {
33188
- this.clear();
33189
- for (const [key2, entry] of arr) {
33190
- if (entry.start) {
33191
- const age = Date.now() - entry.start;
33192
- entry.start = perf2.now() - age;
33193
- }
33194
- this.set(key2, entry.value, entry);
33195
- }
33196
- }
33197
- set(k, v, setOptions = {}) {
33198
- if (v === undefined) {
33199
- this.delete(k);
33200
- return this;
33201
- }
33202
- const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
33203
- let { noUpdateTTL = this.noUpdateTTL } = setOptions;
33204
- const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
33205
- if (this.maxEntrySize && size > this.maxEntrySize) {
33206
- if (status) {
33207
- status.set = "miss";
33208
- status.maxEntrySizeExceeded = true;
33209
- }
33210
- this.#delete(k, "set");
33211
- return this;
33212
- }
33213
- let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
33214
- if (index === undefined) {
33215
- index = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size;
33216
- this.#keyList[index] = k;
33217
- this.#valList[index] = v;
33218
- this.#keyMap.set(k, index);
33219
- this.#next[this.#tail] = index;
33220
- this.#prev[index] = this.#tail;
33221
- this.#tail = index;
33222
- this.#size++;
33223
- this.#addItemSize(index, size, status);
33224
- if (status)
33225
- status.set = "add";
33226
- noUpdateTTL = false;
33227
- } else {
33228
- this.#moveToTail(index);
33229
- const oldVal = this.#valList[index];
33230
- if (v !== oldVal) {
33231
- if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
33232
- oldVal.__abortController.abort(new Error("replaced"));
33233
- const { __staleWhileFetching: s } = oldVal;
33234
- if (s !== undefined && !noDisposeOnSet) {
33235
- if (this.#hasDispose) {
33236
- this.#dispose?.(s, k, "set");
33237
- }
33238
- if (this.#hasDisposeAfter) {
33239
- this.#disposed?.push([s, k, "set"]);
33240
- }
33241
- }
33242
- } else if (!noDisposeOnSet) {
33243
- if (this.#hasDispose) {
33244
- this.#dispose?.(oldVal, k, "set");
33245
- }
33246
- if (this.#hasDisposeAfter) {
33247
- this.#disposed?.push([oldVal, k, "set"]);
33248
- }
33249
- }
33250
- this.#removeItemSize(index);
33251
- this.#addItemSize(index, size, status);
33252
- this.#valList[index] = v;
33253
- if (status) {
33254
- status.set = "replace";
33255
- const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
33256
- if (oldValue !== undefined)
33257
- status.oldValue = oldValue;
33258
- }
33259
- } else if (status) {
33260
- status.set = "update";
33261
- }
33262
- }
33263
- if (ttl !== 0 && !this.#ttls) {
33264
- this.#initializeTTLTracking();
33265
- }
33266
- if (this.#ttls) {
33267
- if (!noUpdateTTL) {
33268
- this.#setItemTTL(index, ttl, start);
33269
- }
33270
- if (status)
33271
- this.#statusTTL(status, index);
33272
- }
33273
- if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
33274
- const dt2 = this.#disposed;
33275
- let task;
33276
- while (task = dt2?.shift()) {
33277
- this.#disposeAfter?.(...task);
33278
- }
33279
- }
33280
- return this;
33281
- }
33282
- pop() {
33283
- try {
33284
- while (this.#size) {
33285
- const val = this.#valList[this.#head];
33286
- this.#evict(true);
33287
- if (this.#isBackgroundFetch(val)) {
33288
- if (val.__staleWhileFetching) {
33289
- return val.__staleWhileFetching;
33290
- }
33291
- } else if (val !== undefined) {
33292
- return val;
33293
- }
33294
- }
33295
- } finally {
33296
- if (this.#hasDisposeAfter && this.#disposed) {
33297
- const dt2 = this.#disposed;
33298
- let task;
33299
- while (task = dt2?.shift()) {
33300
- this.#disposeAfter?.(...task);
33301
- }
33302
- }
33303
- }
33304
- }
33305
- #evict(free) {
33306
- const head = this.#head;
33307
- const k = this.#keyList[head];
33308
- const v = this.#valList[head];
33309
- if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
33310
- v.__abortController.abort(new Error("evicted"));
33311
- } else if (this.#hasDispose || this.#hasDisposeAfter) {
33312
- if (this.#hasDispose) {
33313
- this.#dispose?.(v, k, "evict");
33314
- }
33315
- if (this.#hasDisposeAfter) {
33316
- this.#disposed?.push([v, k, "evict"]);
33317
- }
33318
- }
33319
- this.#removeItemSize(head);
33320
- if (free) {
33321
- this.#keyList[head] = undefined;
33322
- this.#valList[head] = undefined;
33323
- this.#free.push(head);
33324
- }
33325
- if (this.#size === 1) {
33326
- this.#head = this.#tail = 0;
33327
- this.#free.length = 0;
33328
- } else {
33329
- this.#head = this.#next[head];
33330
- }
33331
- this.#keyMap.delete(k);
33332
- this.#size--;
33333
- return head;
33334
- }
33335
- has(k, hasOptions = {}) {
33336
- const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
33337
- const index = this.#keyMap.get(k);
33338
- if (index !== undefined) {
33339
- const v = this.#valList[index];
33340
- if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === undefined) {
33341
- return false;
33342
- }
33343
- if (!this.#isStale(index)) {
33344
- if (updateAgeOnHas) {
33345
- this.#updateItemAge(index);
33346
- }
33347
- if (status) {
33348
- status.has = "hit";
33349
- this.#statusTTL(status, index);
33350
- }
33351
- return true;
33352
- } else if (status) {
33353
- status.has = "stale";
33354
- this.#statusTTL(status, index);
33355
- }
33356
- } else if (status) {
33357
- status.has = "miss";
33358
- }
33359
- return false;
33360
- }
33361
- peek(k, peekOptions = {}) {
33362
- const { allowStale = this.allowStale } = peekOptions;
33363
- const index = this.#keyMap.get(k);
33364
- if (index === undefined || !allowStale && this.#isStale(index)) {
33365
- return;
33366
- }
33367
- const v = this.#valList[index];
33368
- return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
33369
- }
33370
- #backgroundFetch(k, index, options, context) {
33371
- const v = index === undefined ? undefined : this.#valList[index];
33372
- if (this.#isBackgroundFetch(v)) {
33373
- return v;
33374
- }
33375
- const ac = new AC2;
33376
- const { signal } = options;
33377
- signal?.addEventListener("abort", () => ac.abort(signal.reason), {
33378
- signal: ac.signal
33379
- });
33380
- const fetchOpts = {
33381
- signal: ac.signal,
33382
- options,
33383
- context
33384
- };
33385
- const cb = (v2, updateCache = false) => {
33386
- const { aborted } = ac.signal;
33387
- const ignoreAbort = options.ignoreFetchAbort && v2 !== undefined;
33388
- if (options.status) {
33389
- if (aborted && !updateCache) {
33390
- options.status.fetchAborted = true;
33391
- options.status.fetchError = ac.signal.reason;
33392
- if (ignoreAbort)
33393
- options.status.fetchAbortIgnored = true;
33394
- } else {
33395
- options.status.fetchResolved = true;
33396
- }
33397
- }
33398
- if (aborted && !ignoreAbort && !updateCache) {
33399
- return fetchFail(ac.signal.reason);
33400
- }
33401
- const bf2 = p;
33402
- if (this.#valList[index] === p) {
33403
- if (v2 === undefined) {
33404
- if (bf2.__staleWhileFetching) {
33405
- this.#valList[index] = bf2.__staleWhileFetching;
33406
- } else {
33407
- this.#delete(k, "fetch");
33408
- }
33409
- } else {
33410
- if (options.status)
33411
- options.status.fetchUpdated = true;
33412
- this.set(k, v2, fetchOpts.options);
33413
- }
33414
- }
33415
- return v2;
33416
- };
33417
- const eb = (er) => {
33418
- if (options.status) {
33419
- options.status.fetchRejected = true;
33420
- options.status.fetchError = er;
33421
- }
33422
- return fetchFail(er);
33423
- };
33424
- const fetchFail = (er) => {
33425
- const { aborted } = ac.signal;
33426
- const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
33427
- const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
33428
- const noDelete = allowStale || options.noDeleteOnFetchRejection;
33429
- const bf2 = p;
33430
- if (this.#valList[index] === p) {
33431
- const del = !noDelete || bf2.__staleWhileFetching === undefined;
33432
- if (del) {
33433
- this.#delete(k, "fetch");
33434
- } else if (!allowStaleAborted) {
33435
- this.#valList[index] = bf2.__staleWhileFetching;
33436
- }
33437
- }
33438
- if (allowStale) {
33439
- if (options.status && bf2.__staleWhileFetching !== undefined) {
33440
- options.status.returnedStale = true;
33441
- }
33442
- return bf2.__staleWhileFetching;
33443
- } else if (bf2.__returned === bf2) {
33444
- throw er;
33445
- }
33446
- };
33447
- const pcall = (res, rej) => {
33448
- const fmp = this.#fetchMethod?.(k, v, fetchOpts);
33449
- if (fmp && fmp instanceof Promise) {
33450
- fmp.then((v2) => res(v2 === undefined ? undefined : v2), rej);
33451
- }
33452
- ac.signal.addEventListener("abort", () => {
33453
- if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
33454
- res(undefined);
33455
- if (options.allowStaleOnFetchAbort) {
33456
- res = (v2) => cb(v2, true);
33457
- }
33458
- }
33459
- });
33460
- };
33461
- if (options.status)
33462
- options.status.fetchDispatched = true;
33463
- const p = new Promise(pcall).then(cb, eb);
33464
- const bf = Object.assign(p, {
33465
- __abortController: ac,
33466
- __staleWhileFetching: v,
33467
- __returned: undefined
33468
- });
33469
- if (index === undefined) {
33470
- this.set(k, bf, { ...fetchOpts.options, status: undefined });
33471
- index = this.#keyMap.get(k);
33472
- } else {
33473
- this.#valList[index] = bf;
33474
- }
33475
- return bf;
33476
- }
33477
- #isBackgroundFetch(p) {
33478
- if (!this.#hasFetchMethod)
33479
- return false;
33480
- const b = p;
33481
- return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC2;
33482
- }
33483
- async fetch(k, fetchOptions = {}) {
33484
- const {
33485
- allowStale = this.allowStale,
33486
- updateAgeOnGet = this.updateAgeOnGet,
33487
- noDeleteOnStaleGet = this.noDeleteOnStaleGet,
33488
- ttl = this.ttl,
33489
- noDisposeOnSet = this.noDisposeOnSet,
33490
- size = 0,
33491
- sizeCalculation = this.sizeCalculation,
33492
- noUpdateTTL = this.noUpdateTTL,
33493
- noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
33494
- allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
33495
- ignoreFetchAbort = this.ignoreFetchAbort,
33496
- allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
33497
- context,
33498
- forceRefresh = false,
33499
- status,
33500
- signal
33501
- } = fetchOptions;
33502
- if (!this.#hasFetchMethod) {
33503
- if (status)
33504
- status.fetch = "get";
33505
- return this.get(k, {
33506
- allowStale,
33507
- updateAgeOnGet,
33508
- noDeleteOnStaleGet,
33509
- status
33510
- });
33511
- }
33512
- const options = {
33513
- allowStale,
33514
- updateAgeOnGet,
33515
- noDeleteOnStaleGet,
33516
- ttl,
33517
- noDisposeOnSet,
33518
- size,
33519
- sizeCalculation,
33520
- noUpdateTTL,
33521
- noDeleteOnFetchRejection,
33522
- allowStaleOnFetchRejection,
33523
- allowStaleOnFetchAbort,
33524
- ignoreFetchAbort,
33525
- status,
33526
- signal
33527
- };
33528
- let index = this.#keyMap.get(k);
33529
- if (index === undefined) {
33530
- if (status)
33531
- status.fetch = "miss";
33532
- const p = this.#backgroundFetch(k, index, options, context);
33533
- return p.__returned = p;
33534
- } else {
33535
- const v = this.#valList[index];
33536
- if (this.#isBackgroundFetch(v)) {
33537
- const stale = allowStale && v.__staleWhileFetching !== undefined;
33538
- if (status) {
33539
- status.fetch = "inflight";
33540
- if (stale)
33541
- status.returnedStale = true;
33542
- }
33543
- return stale ? v.__staleWhileFetching : v.__returned = v;
33544
- }
33545
- const isStale = this.#isStale(index);
33546
- if (!forceRefresh && !isStale) {
33547
- if (status)
33548
- status.fetch = "hit";
33549
- this.#moveToTail(index);
33550
- if (updateAgeOnGet) {
33551
- this.#updateItemAge(index);
33552
- }
33553
- if (status)
33554
- this.#statusTTL(status, index);
33555
- return v;
33556
- }
33557
- const p = this.#backgroundFetch(k, index, options, context);
33558
- const hasStale = p.__staleWhileFetching !== undefined;
33559
- const staleVal = hasStale && allowStale;
33560
- if (status) {
33561
- status.fetch = isStale ? "stale" : "refresh";
33562
- if (staleVal && isStale)
33563
- status.returnedStale = true;
33564
- }
33565
- return staleVal ? p.__staleWhileFetching : p.__returned = p;
33566
- }
33567
- }
33568
- async forceFetch(k, fetchOptions = {}) {
33569
- const v = await this.fetch(k, fetchOptions);
33570
- if (v === undefined)
33571
- throw new Error("fetch() returned undefined");
33572
- return v;
33573
- }
33574
- memo(k, memoOptions = {}) {
33575
- const memoMethod = this.#memoMethod;
33576
- if (!memoMethod) {
33577
- throw new Error("no memoMethod provided to constructor");
33578
- }
33579
- const { context, forceRefresh, ...options } = memoOptions;
33580
- const v = this.get(k, options);
33581
- if (!forceRefresh && v !== undefined)
33582
- return v;
33583
- const vv = memoMethod(k, v, {
33584
- options,
33585
- context
33586
- });
33587
- this.set(k, vv, options);
33588
- return vv;
33589
- }
33590
- get(k, getOptions = {}) {
33591
- const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
33592
- const index = this.#keyMap.get(k);
33593
- if (index !== undefined) {
33594
- const value2 = this.#valList[index];
33595
- const fetching = this.#isBackgroundFetch(value2);
33596
- if (status)
33597
- this.#statusTTL(status, index);
33598
- if (this.#isStale(index)) {
33599
- if (status)
33600
- status.get = "stale";
33601
- if (!fetching) {
33602
- if (!noDeleteOnStaleGet) {
33603
- this.#delete(k, "expire");
33604
- }
33605
- if (status && allowStale)
33606
- status.returnedStale = true;
33607
- return allowStale ? value2 : undefined;
33608
- } else {
33609
- if (status && allowStale && value2.__staleWhileFetching !== undefined) {
33610
- status.returnedStale = true;
33611
- }
33612
- return allowStale ? value2.__staleWhileFetching : undefined;
33613
- }
33614
- } else {
33615
- if (status)
33616
- status.get = "hit";
33617
- if (fetching) {
33618
- return value2.__staleWhileFetching;
33619
- }
33620
- this.#moveToTail(index);
33621
- if (updateAgeOnGet) {
33622
- this.#updateItemAge(index);
33623
- }
33624
- return value2;
33625
- }
33626
- } else if (status) {
33627
- status.get = "miss";
33628
- }
33629
- }
33630
- #connect(p, n2) {
33631
- this.#prev[n2] = p;
33632
- this.#next[p] = n2;
33633
- }
33634
- #moveToTail(index) {
33635
- if (index !== this.#tail) {
33636
- if (index === this.#head) {
33637
- this.#head = this.#next[index];
33638
- } else {
33639
- this.#connect(this.#prev[index], this.#next[index]);
33640
- }
33641
- this.#connect(this.#tail, index);
33642
- this.#tail = index;
33643
- }
33644
- }
33645
- delete(k) {
33646
- return this.#delete(k, "delete");
33647
- }
33648
- #delete(k, reason) {
33649
- let deleted = false;
33650
- if (this.#size !== 0) {
33651
- const index = this.#keyMap.get(k);
33652
- if (index !== undefined) {
33653
- deleted = true;
33654
- if (this.#size === 1) {
33655
- this.#clear(reason);
33656
- } else {
33657
- this.#removeItemSize(index);
33658
- const v = this.#valList[index];
33659
- if (this.#isBackgroundFetch(v)) {
33660
- v.__abortController.abort(new Error("deleted"));
33661
- } else if (this.#hasDispose || this.#hasDisposeAfter) {
33662
- if (this.#hasDispose) {
33663
- this.#dispose?.(v, k, reason);
33664
- }
33665
- if (this.#hasDisposeAfter) {
33666
- this.#disposed?.push([v, k, reason]);
33667
- }
33668
- }
33669
- this.#keyMap.delete(k);
33670
- this.#keyList[index] = undefined;
33671
- this.#valList[index] = undefined;
33672
- if (index === this.#tail) {
33673
- this.#tail = this.#prev[index];
33674
- } else if (index === this.#head) {
33675
- this.#head = this.#next[index];
33676
- } else {
33677
- const pi = this.#prev[index];
33678
- this.#next[pi] = this.#next[index];
33679
- const ni = this.#next[index];
33680
- this.#prev[ni] = this.#prev[index];
33681
- }
33682
- this.#size--;
33683
- this.#free.push(index);
33684
- }
33685
- }
33686
- }
33687
- if (this.#hasDisposeAfter && this.#disposed?.length) {
33688
- const dt2 = this.#disposed;
33689
- let task;
33690
- while (task = dt2?.shift()) {
33691
- this.#disposeAfter?.(...task);
33692
- }
33693
- }
33694
- return deleted;
33695
- }
33696
- clear() {
33697
- return this.#clear("delete");
33698
- }
33699
- #clear(reason) {
33700
- for (const index of this.#rindexes({ allowStale: true })) {
33701
- const v = this.#valList[index];
33702
- if (this.#isBackgroundFetch(v)) {
33703
- v.__abortController.abort(new Error("deleted"));
33704
- } else {
33705
- const k = this.#keyList[index];
33706
- if (this.#hasDispose) {
33707
- this.#dispose?.(v, k, reason);
33708
- }
33709
- if (this.#hasDisposeAfter) {
33710
- this.#disposed?.push([v, k, reason]);
33711
- }
33712
- }
33713
- }
33714
- this.#keyMap.clear();
33715
- this.#valList.fill(undefined);
33716
- this.#keyList.fill(undefined);
33717
- if (this.#ttls && this.#starts) {
33718
- this.#ttls.fill(0);
33719
- this.#starts.fill(0);
33720
- }
33721
- if (this.#sizes) {
33722
- this.#sizes.fill(0);
33723
- }
33724
- this.#head = 0;
33725
- this.#tail = 0;
33726
- this.#free.length = 0;
33727
- this.#calculatedSize = 0;
33728
- this.#size = 0;
33729
- if (this.#hasDisposeAfter && this.#disposed) {
33730
- const dt2 = this.#disposed;
33731
- let task;
33732
- while (task = dt2?.shift()) {
33733
- this.#disposeAfter?.(...task);
33734
- }
33735
- }
33736
- }
33737
- }
33738
- exports.LRUCache = LRUCache2;
33739
- });
33740
-
33741
32626
  // ../../node_modules/minipass/dist/commonjs/index.js
33742
- var require_commonjs4 = __commonJS((exports) => {
32627
+ var require_commonjs3 = __commonJS((exports) => {
33743
32628
  var __importDefault = exports && exports.__importDefault || function(mod) {
33744
32629
  return mod && mod.__esModule ? mod : { default: mod };
33745
32630
  };
@@ -34411,7 +33296,7 @@ var require_commonjs4 = __commonJS((exports) => {
34411
33296
  });
34412
33297
 
34413
33298
  // ../../node_modules/path-scurry/dist/commonjs/index.js
34414
- var require_commonjs5 = __commonJS((exports) => {
33299
+ var require_commonjs4 = __commonJS((exports) => {
34415
33300
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) {
34416
33301
  if (k2 === undefined)
34417
33302
  k2 = k;
@@ -34446,14 +33331,14 @@ var require_commonjs5 = __commonJS((exports) => {
34446
33331
  };
34447
33332
  Object.defineProperty(exports, "__esModule", { value: true });
34448
33333
  exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = undefined;
34449
- var lru_cache_1 = require_commonjs3();
33334
+ var lru_cache_1 = require_commonjs();
34450
33335
  var node_path_1 = __require("node:path");
34451
33336
  var node_url_1 = __require("node:url");
34452
33337
  var fs_1 = __require("fs");
34453
33338
  var actualFS2 = __importStar(__require("node:fs"));
34454
33339
  var realpathSync2 = fs_1.realpathSync.native;
34455
33340
  var promises_1 = __require("node:fs/promises");
34456
- var minipass_1 = require_commonjs4();
33341
+ var minipass_1 = require_commonjs3();
34457
33342
  var defaultFS2 = {
34458
33343
  lstatSync: fs_1.lstatSync,
34459
33344
  readdir: fs_1.readdir,
@@ -36211,7 +35096,7 @@ var require_processor = __commonJS((exports) => {
36211
35096
  var require_walker2 = __commonJS((exports) => {
36212
35097
  Object.defineProperty(exports, "__esModule", { value: true });
36213
35098
  exports.GlobStream = exports.GlobWalker = exports.GlobUtil = undefined;
36214
- var minipass_1 = require_commonjs4();
35099
+ var minipass_1 = require_commonjs3();
36215
35100
  var ignore_js_1 = require_ignore2();
36216
35101
  var processor_js_1 = require_processor();
36217
35102
  var makeIgnore2 = (ignore, opts) => typeof ignore === "string" ? new ignore_js_1.Ignore([ignore], opts) : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore;
@@ -36550,7 +35435,7 @@ var require_glob = __commonJS((exports) => {
36550
35435
  exports.Glob = undefined;
36551
35436
  var minimatch_1 = require_commonjs2();
36552
35437
  var node_url_1 = __require("node:url");
36553
- var path_scurry_1 = require_commonjs5();
35438
+ var path_scurry_1 = require_commonjs4();
36554
35439
  var pattern_js_1 = require_pattern();
36555
35440
  var walker_js_1 = require_walker2();
36556
35441
  var defaultPlatform4 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
@@ -36747,7 +35632,7 @@ var require_has_magic = __commonJS((exports) => {
36747
35632
  });
36748
35633
 
36749
35634
  // ../../node_modules/glob/dist/commonjs/index.js
36750
- var require_commonjs6 = __commonJS((exports) => {
35635
+ var require_commonjs5 = __commonJS((exports) => {
36751
35636
  Object.defineProperty(exports, "__esModule", { value: true });
36752
35637
  exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = undefined;
36753
35638
  exports.globStreamSync = globStreamSync2;
@@ -37505,1569 +36390,454 @@ var require_retry = __commonJS((exports) => {
37505
36390
  }
37506
36391
  }
37507
36392
  }
37508
- for (var i2 = 0;i2 < methods.length; i2++) {
37509
- var method = methods[i2];
37510
- var original = obj[method];
37511
- obj[method] = function retryWrapper(original2) {
37512
- var op = exports.operation(options);
37513
- var args = Array.prototype.slice.call(arguments, 1);
37514
- var callback = args.pop();
37515
- args.push(function(err) {
37516
- if (op.retry(err)) {
37517
- return;
37518
- }
37519
- if (err) {
37520
- arguments[0] = op.mainError();
37521
- }
37522
- callback.apply(this, arguments);
37523
- });
37524
- op.attempt(function() {
37525
- original2.apply(obj, args);
37526
- });
37527
- }.bind(obj, original);
37528
- obj[method].options = options;
37529
- }
37530
- };
37531
- });
37532
-
37533
- // ../../node_modules/promise-retry/index.js
37534
- var require_promise_retry = __commonJS((exports, module) => {
37535
- var errcode = require_err_code();
37536
- var retry = require_retry();
37537
- var hasOwn = Object.prototype.hasOwnProperty;
37538
- function isRetryError(err) {
37539
- return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried");
37540
- }
37541
- function promiseRetry(fn, options) {
37542
- var temp;
37543
- var operation;
37544
- if (typeof fn === "object" && typeof options === "function") {
37545
- temp = options;
37546
- options = fn;
37547
- fn = temp;
37548
- }
37549
- operation = retry.operation(options);
37550
- return new Promise(function(resolve2, reject) {
37551
- operation.attempt(function(number) {
37552
- Promise.resolve().then(function() {
37553
- return fn(function(err) {
37554
- if (isRetryError(err)) {
37555
- err = err.retried;
37556
- }
37557
- throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
37558
- }, number);
37559
- }).then(resolve2, function(err) {
37560
- if (isRetryError(err)) {
37561
- err = err.retried;
37562
- if (operation.retry(err || new Error)) {
37563
- return;
37564
- }
37565
- }
37566
- reject(err);
37567
- });
37568
- });
37569
- });
37570
- }
37571
- module.exports = promiseRetry;
37572
- });
37573
-
37574
- // ../../node_modules/@npmcli/git/lib/errors.js
37575
- var require_errors2 = __commonJS((exports, module) => {
37576
- var maxRetry = 3;
37577
-
37578
- class GitError extends Error {
37579
- shouldRetry() {
37580
- return false;
37581
- }
37582
- }
37583
-
37584
- class GitConnectionError extends GitError {
37585
- constructor() {
37586
- super("A git connection error occurred");
37587
- }
37588
- shouldRetry(number) {
37589
- return number < maxRetry;
37590
- }
37591
- }
37592
-
37593
- class GitPathspecError extends GitError {
37594
- constructor() {
37595
- super("The git reference could not be found");
37596
- }
37597
- }
37598
-
37599
- class GitUnknownError extends GitError {
37600
- constructor() {
37601
- super("An unknown git error occurred");
37602
- }
37603
- }
37604
- module.exports = {
37605
- GitConnectionError,
37606
- GitPathspecError,
37607
- GitUnknownError
37608
- };
37609
- });
37610
-
37611
- // ../../node_modules/@npmcli/git/lib/make-error.js
37612
- var require_make_error = __commonJS((exports, module) => {
37613
- var {
37614
- GitConnectionError,
37615
- GitPathspecError,
37616
- GitUnknownError
37617
- } = require_errors2();
37618
- var connectionErrorRe = new RegExp([
37619
- "remote error: Internal Server Error",
37620
- "The remote end hung up unexpectedly",
37621
- "Connection timed out",
37622
- "Operation timed out",
37623
- "Failed to connect to .* Timed out",
37624
- "Connection reset by peer",
37625
- "SSL_ERROR_SYSCALL",
37626
- "The requested URL returned error: 503"
37627
- ].join("|"));
37628
- var missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/;
37629
- function makeError(er) {
37630
- const message = er.stderr;
37631
- let gitEr;
37632
- if (connectionErrorRe.test(message)) {
37633
- gitEr = new GitConnectionError(message);
37634
- } else if (missingPathspecRe.test(message)) {
37635
- gitEr = new GitPathspecError(message);
37636
- } else {
37637
- gitEr = new GitUnknownError(message);
37638
- }
37639
- return Object.assign(gitEr, er);
37640
- }
37641
- module.exports = makeError;
37642
- });
37643
-
37644
- // ../../node_modules/ini/lib/ini.js
37645
- var require_ini = __commonJS((exports, module) => {
37646
- var { hasOwnProperty } = Object.prototype;
37647
- var encode = (obj, opt = {}) => {
37648
- if (typeof opt === "string") {
37649
- opt = { section: opt };
37650
- }
37651
- opt.align = opt.align === true;
37652
- opt.newline = opt.newline === true;
37653
- opt.sort = opt.sort === true;
37654
- opt.whitespace = opt.whitespace === true || opt.align === true;
37655
- opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
37656
- opt.bracketedArray = opt.bracketedArray !== false;
37657
- const eol = opt.platform === "win32" ? `\r
37658
- ` : `
37659
- `;
37660
- const separator = opt.whitespace ? " = " : "=";
37661
- const children = [];
37662
- const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
37663
- let padToChars = 0;
37664
- if (opt.align) {
37665
- padToChars = safe(keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a3, b) => safe(a3).length >= safe(b).length ? a3 : b)).length;
37666
- }
37667
- let out = "";
37668
- const arraySuffix = opt.bracketedArray ? "[]" : "";
37669
- for (const k of keys) {
37670
- const val = obj[k];
37671
- if (val && Array.isArray(val)) {
37672
- for (const item of val) {
37673
- out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol;
37674
- }
37675
- } else if (val && typeof val === "object") {
37676
- children.push(k);
37677
- } else {
37678
- out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol;
37679
- }
37680
- }
37681
- if (opt.section && out.length) {
37682
- out = "[" + safe(opt.section) + "]" + (opt.newline ? eol + eol : eol) + out;
37683
- }
37684
- for (const k of children) {
37685
- const nk = splitSections(k, ".").join("\\.");
37686
- const section = (opt.section ? opt.section + "." : "") + nk;
37687
- const child = encode(obj[k], {
37688
- ...opt,
37689
- section
37690
- });
37691
- if (out.length && child.length) {
37692
- out += eol;
37693
- }
37694
- out += child;
37695
- }
37696
- return out;
37697
- };
37698
- function splitSections(str, separator) {
37699
- var lastMatchIndex = 0;
37700
- var lastSeparatorIndex = 0;
37701
- var nextIndex = 0;
37702
- var sections = [];
37703
- do {
37704
- nextIndex = str.indexOf(separator, lastMatchIndex);
37705
- if (nextIndex !== -1) {
37706
- lastMatchIndex = nextIndex + separator.length;
37707
- if (nextIndex > 0 && str[nextIndex - 1] === "\\") {
37708
- continue;
37709
- }
37710
- sections.push(str.slice(lastSeparatorIndex, nextIndex));
37711
- lastSeparatorIndex = nextIndex + separator.length;
37712
- }
37713
- } while (nextIndex !== -1);
37714
- sections.push(str.slice(lastSeparatorIndex));
37715
- return sections;
37716
- }
37717
- var decode = (str, opt = {}) => {
37718
- opt.bracketedArray = opt.bracketedArray !== false;
37719
- const out = Object.create(null);
37720
- let p = out;
37721
- let section = null;
37722
- const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
37723
- const lines2 = str.split(/[\r\n]+/g);
37724
- const duplicates = {};
37725
- for (const line of lines2) {
37726
- if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
37727
- continue;
37728
- }
37729
- const match2 = line.match(re);
37730
- if (!match2) {
37731
- continue;
37732
- }
37733
- if (match2[1] !== undefined) {
37734
- section = unsafe(match2[1]);
37735
- if (section === "__proto__") {
37736
- p = Object.create(null);
37737
- continue;
37738
- }
37739
- p = out[section] = out[section] || Object.create(null);
37740
- continue;
37741
- }
37742
- const keyRaw = unsafe(match2[2]);
37743
- let isArray;
37744
- if (opt.bracketedArray) {
37745
- isArray = keyRaw.length > 2 && keyRaw.slice(-2) === "[]";
37746
- } else {
37747
- duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;
37748
- isArray = duplicates[keyRaw] > 1;
37749
- }
37750
- const key2 = isArray && keyRaw.endsWith("[]") ? keyRaw.slice(0, -2) : keyRaw;
37751
- if (key2 === "__proto__") {
37752
- continue;
37753
- }
37754
- const valueRaw = match2[3] ? unsafe(match2[4]) : true;
37755
- const value2 = valueRaw === "true" || valueRaw === "false" || valueRaw === "null" ? JSON.parse(valueRaw) : valueRaw;
37756
- if (isArray) {
37757
- if (!hasOwnProperty.call(p, key2)) {
37758
- p[key2] = [];
37759
- } else if (!Array.isArray(p[key2])) {
37760
- p[key2] = [p[key2]];
37761
- }
37762
- }
37763
- if (Array.isArray(p[key2])) {
37764
- p[key2].push(value2);
37765
- } else {
37766
- p[key2] = value2;
37767
- }
37768
- }
37769
- const remove = [];
37770
- for (const k of Object.keys(out)) {
37771
- if (!hasOwnProperty.call(out, k) || typeof out[k] !== "object" || Array.isArray(out[k])) {
37772
- continue;
37773
- }
37774
- const parts = splitSections(k, ".");
37775
- p = out;
37776
- const l2 = parts.pop();
37777
- const nl = l2.replace(/\\\./g, ".");
37778
- for (const part of parts) {
37779
- if (part === "__proto__") {
37780
- continue;
37781
- }
37782
- if (!hasOwnProperty.call(p, part) || typeof p[part] !== "object") {
37783
- p[part] = Object.create(null);
37784
- }
37785
- p = p[part];
37786
- }
37787
- if (p === out && nl === l2) {
37788
- continue;
37789
- }
37790
- p[nl] = out[k];
37791
- remove.push(k);
37792
- }
37793
- for (const del of remove) {
37794
- delete out[del];
37795
- }
37796
- return out;
37797
- };
37798
- var isQuoted = (val) => {
37799
- return val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'");
37800
- };
37801
- var safe = (val) => {
37802
- if (typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) {
37803
- return JSON.stringify(val);
37804
- }
37805
- return val.split(";").join("\\;").split("#").join("\\#");
37806
- };
37807
- var unsafe = (val) => {
37808
- val = (val || "").trim();
37809
- if (isQuoted(val)) {
37810
- if (val.charAt(0) === "'") {
37811
- val = val.slice(1, -1);
37812
- }
37813
- try {
37814
- val = JSON.parse(val);
37815
- } catch {}
37816
- } else {
37817
- let esc = false;
37818
- let unesc = "";
37819
- for (let i2 = 0, l2 = val.length;i2 < l2; i2++) {
37820
- const c = val.charAt(i2);
37821
- if (esc) {
37822
- if ("\\;#".indexOf(c) !== -1) {
37823
- unesc += c;
37824
- } else {
37825
- unesc += "\\" + c;
37826
- }
37827
- esc = false;
37828
- } else if (";#".indexOf(c) !== -1) {
37829
- break;
37830
- } else if (c === "\\") {
37831
- esc = true;
37832
- } else {
37833
- unesc += c;
37834
- }
37835
- }
37836
- if (esc) {
37837
- unesc += "\\";
37838
- }
37839
- return unesc.trim();
37840
- }
37841
- return val;
37842
- };
37843
- module.exports = {
37844
- parse: decode,
37845
- decode,
37846
- stringify: encode,
37847
- encode,
37848
- safe,
37849
- unsafe
37850
- };
37851
- });
37852
-
37853
- // ../../node_modules/@npmcli/git/lib/opts.js
37854
- var require_opts = __commonJS((exports, module) => {
37855
- var fs4 = __require("node:fs");
37856
- var os = __require("node:os");
37857
- var path6 = __require("node:path");
37858
- var ini = require_ini();
37859
- var gitConfigPath = path6.join(os.homedir(), ".gitconfig");
37860
- var cachedConfig = null;
37861
- var loadGitConfig = () => {
37862
- if (cachedConfig === null) {
37863
- try {
37864
- cachedConfig = {};
37865
- if (fs4.existsSync(gitConfigPath)) {
37866
- const configContent = fs4.readFileSync(gitConfigPath, "utf-8");
37867
- cachedConfig = ini.parse(configContent);
37868
- }
37869
- } catch (error2) {
37870
- cachedConfig = {};
37871
- }
37872
- }
37873
- return cachedConfig;
37874
- };
37875
- var checkGitConfigs = () => {
37876
- const config3 = loadGitConfig();
37877
- return {
37878
- sshCommandSetInConfig: config3?.core?.sshCommand !== undefined,
37879
- askPassSetInConfig: config3?.core?.askpass !== undefined
37880
- };
37881
- };
37882
- var sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== undefined;
37883
- var askPassSetInEnv = process.env.GIT_ASKPASS !== undefined;
37884
- var { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs();
37885
- var finalGitEnv = {
37886
- ...askPassSetInEnv || askPassSetInConfig ? {} : {
37887
- GIT_ASKPASS: "echo"
37888
- },
37889
- ...sshCommandSetInEnv || sshCommandSetInConfig ? {} : {
37890
- GIT_SSH_COMMAND: "ssh -oStrictHostKeyChecking=accept-new"
37891
- }
37892
- };
37893
- module.exports = (opts = {}) => ({
37894
- stdioString: true,
37895
- ...opts,
37896
- shell: false,
37897
- env: opts.env || { ...finalGitEnv, ...process.env }
37898
- });
37899
- module.exports.loadGitConfig = loadGitConfig;
37900
- });
37901
-
37902
- // ../../node_modules/@npmcli/git/lib/which.js
37903
- var require_which = __commonJS((exports, module) => {
37904
- var which = require_lib5();
37905
- var gitPath;
37906
- try {
37907
- gitPath = which.sync("git");
37908
- } catch {}
37909
- module.exports = (opts = {}) => {
37910
- if (opts.git) {
37911
- return opts.git;
37912
- }
37913
- if (!gitPath || opts.git === false) {
37914
- return Object.assign(new Error("No git binary found in $PATH"), { code: "ENOGIT" });
37915
- }
37916
- return gitPath;
37917
- };
37918
- });
37919
-
37920
- // ../../node_modules/@npmcli/git/lib/spawn.js
37921
- var require_spawn = __commonJS((exports, module) => {
37922
- var spawn2 = require_lib6();
37923
- var promiseRetry = require_promise_retry();
37924
- var { log } = require_lib3();
37925
- var makeError = require_make_error();
37926
- var makeOpts = require_opts();
37927
- module.exports = (gitArgs, opts = {}) => {
37928
- const whichGit = require_which();
37929
- const gitPath = whichGit(opts);
37930
- if (gitPath instanceof Error) {
37931
- return Promise.reject(gitPath);
37932
- }
37933
- const args = opts.allowReplace || gitArgs[0] === "--no-replace-objects" ? gitArgs : ["--no-replace-objects", ...gitArgs];
37934
- let retryOpts = opts.retry;
37935
- if (retryOpts === null || retryOpts === undefined) {
37936
- retryOpts = {
37937
- retries: opts.fetchRetries || 2,
37938
- factor: opts.fetchRetryFactor || 10,
37939
- maxTimeout: opts.fetchRetryMaxtimeout || 60000,
37940
- minTimeout: opts.fetchRetryMintimeout || 1000
37941
- };
37942
- }
37943
- return promiseRetry((retryFn, number) => {
37944
- if (number !== 1) {
37945
- log.silly("git", `Retrying git command: ${args.join(" ")} attempt # ${number}`);
37946
- }
37947
- return spawn2(gitPath, args, makeOpts(opts)).catch((er) => {
37948
- const gitError = makeError(er);
37949
- if (!gitError.shouldRetry(number)) {
37950
- throw gitError;
37951
- }
37952
- retryFn(gitError);
37953
- });
37954
- }, retryOpts);
37955
- };
37956
- });
37957
-
37958
- // ../../node_modules/@npmcli/git/node_modules/lru-cache/dist/commonjs/index.js
37959
- var require_commonjs7 = __commonJS((exports) => {
37960
- Object.defineProperty(exports, "__esModule", { value: true });
37961
- exports.LRUCache = undefined;
37962
- var perf2 = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
37963
- var warned2 = new Set;
37964
- var PROCESS2 = typeof process === "object" && !!process ? process : {};
37965
- var emitWarning2 = (msg, type2, code, fn) => {
37966
- typeof PROCESS2.emitWarning === "function" ? PROCESS2.emitWarning(msg, type2, code, fn) : console.error(`[${code}] ${type2}: ${msg}`);
37967
- };
37968
- var AC2 = globalThis.AbortController;
37969
- var AS2 = globalThis.AbortSignal;
37970
- if (typeof AC2 === "undefined") {
37971
- AS2 = class AbortSignal2 {
37972
- onabort;
37973
- _onabort = [];
37974
- reason;
37975
- aborted = false;
37976
- addEventListener(_, fn) {
37977
- this._onabort.push(fn);
37978
- }
37979
- };
37980
- AC2 = class AbortController2 {
37981
- constructor() {
37982
- warnACPolyfill();
37983
- }
37984
- signal = new AS2;
37985
- abort(reason) {
37986
- if (this.signal.aborted)
37987
- return;
37988
- this.signal.reason = reason;
37989
- this.signal.aborted = true;
37990
- for (const fn of this.signal._onabort) {
37991
- fn(reason);
37992
- }
37993
- this.signal.onabort?.(reason);
37994
- }
37995
- };
37996
- let printACPolyfillWarning = PROCESS2.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
37997
- const warnACPolyfill = () => {
37998
- if (!printACPolyfillWarning)
37999
- return;
38000
- printACPolyfillWarning = false;
38001
- emitWarning2("AbortController is not defined. If using lru-cache in " + "node 14, load an AbortController polyfill from the " + "`node-abort-controller` package. A minimal polyfill is " + "provided for use by LRUCache.fetch(), but it should not be " + "relied upon in other contexts (eg, passing it to other APIs that " + "use AbortController/AbortSignal might have undesirable effects). " + "You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
38002
- };
38003
- }
38004
- var shouldWarn2 = (code) => !warned2.has(code);
38005
- var TYPE2 = Symbol("type");
38006
- var isPosInt2 = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
38007
- var getUintArray2 = (max) => !isPosInt2(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray2 : null;
38008
-
38009
- class ZeroArray2 extends Array {
38010
- constructor(size) {
38011
- super(size);
38012
- this.fill(0);
38013
- }
38014
- }
38015
-
38016
- class Stack2 {
38017
- heap;
38018
- length;
38019
- static #constructing = false;
38020
- static create(max) {
38021
- const HeapCls = getUintArray2(max);
38022
- if (!HeapCls)
38023
- return [];
38024
- Stack2.#constructing = true;
38025
- const s = new Stack2(max, HeapCls);
38026
- Stack2.#constructing = false;
38027
- return s;
38028
- }
38029
- constructor(max, HeapCls) {
38030
- if (!Stack2.#constructing) {
38031
- throw new TypeError("instantiate Stack using Stack.create(n)");
38032
- }
38033
- this.heap = new HeapCls(max);
38034
- this.length = 0;
38035
- }
38036
- push(n2) {
38037
- this.heap[this.length++] = n2;
38038
- }
38039
- pop() {
38040
- return this.heap[--this.length];
38041
- }
38042
- }
38043
-
38044
- class LRUCache2 {
38045
- #max;
38046
- #maxSize;
38047
- #dispose;
38048
- #disposeAfter;
38049
- #fetchMethod;
38050
- #memoMethod;
38051
- ttl;
38052
- ttlResolution;
38053
- ttlAutopurge;
38054
- updateAgeOnGet;
38055
- updateAgeOnHas;
38056
- allowStale;
38057
- noDisposeOnSet;
38058
- noUpdateTTL;
38059
- maxEntrySize;
38060
- sizeCalculation;
38061
- noDeleteOnFetchRejection;
38062
- noDeleteOnStaleGet;
38063
- allowStaleOnFetchAbort;
38064
- allowStaleOnFetchRejection;
38065
- ignoreFetchAbort;
38066
- #size;
38067
- #calculatedSize;
38068
- #keyMap;
38069
- #keyList;
38070
- #valList;
38071
- #next;
38072
- #prev;
38073
- #head;
38074
- #tail;
38075
- #free;
38076
- #disposed;
38077
- #sizes;
38078
- #starts;
38079
- #ttls;
38080
- #hasDispose;
38081
- #hasFetchMethod;
38082
- #hasDisposeAfter;
38083
- static unsafeExposeInternals(c) {
38084
- return {
38085
- starts: c.#starts,
38086
- ttls: c.#ttls,
38087
- sizes: c.#sizes,
38088
- keyMap: c.#keyMap,
38089
- keyList: c.#keyList,
38090
- valList: c.#valList,
38091
- next: c.#next,
38092
- prev: c.#prev,
38093
- get head() {
38094
- return c.#head;
38095
- },
38096
- get tail() {
38097
- return c.#tail;
38098
- },
38099
- free: c.#free,
38100
- isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
38101
- backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
38102
- moveToTail: (index) => c.#moveToTail(index),
38103
- indexes: (options) => c.#indexes(options),
38104
- rindexes: (options) => c.#rindexes(options),
38105
- isStale: (index) => c.#isStale(index)
38106
- };
38107
- }
38108
- get max() {
38109
- return this.#max;
38110
- }
38111
- get maxSize() {
38112
- return this.#maxSize;
38113
- }
38114
- get calculatedSize() {
38115
- return this.#calculatedSize;
38116
- }
38117
- get size() {
38118
- return this.#size;
38119
- }
38120
- get fetchMethod() {
38121
- return this.#fetchMethod;
38122
- }
38123
- get memoMethod() {
38124
- return this.#memoMethod;
38125
- }
38126
- get dispose() {
38127
- return this.#dispose;
38128
- }
38129
- get disposeAfter() {
38130
- return this.#disposeAfter;
38131
- }
38132
- constructor(options) {
38133
- const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
38134
- if (max !== 0 && !isPosInt2(max)) {
38135
- throw new TypeError("max option must be a nonnegative integer");
38136
- }
38137
- const UintArray = max ? getUintArray2(max) : Array;
38138
- if (!UintArray) {
38139
- throw new Error("invalid max value: " + max);
38140
- }
38141
- this.#max = max;
38142
- this.#maxSize = maxSize;
38143
- this.maxEntrySize = maxEntrySize || this.#maxSize;
38144
- this.sizeCalculation = sizeCalculation;
38145
- if (this.sizeCalculation) {
38146
- if (!this.#maxSize && !this.maxEntrySize) {
38147
- throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
38148
- }
38149
- if (typeof this.sizeCalculation !== "function") {
38150
- throw new TypeError("sizeCalculation set to non-function");
38151
- }
38152
- }
38153
- if (memoMethod !== undefined && typeof memoMethod !== "function") {
38154
- throw new TypeError("memoMethod must be a function if defined");
38155
- }
38156
- this.#memoMethod = memoMethod;
38157
- if (fetchMethod !== undefined && typeof fetchMethod !== "function") {
38158
- throw new TypeError("fetchMethod must be a function if specified");
38159
- }
38160
- this.#fetchMethod = fetchMethod;
38161
- this.#hasFetchMethod = !!fetchMethod;
38162
- this.#keyMap = new Map;
38163
- this.#keyList = new Array(max).fill(undefined);
38164
- this.#valList = new Array(max).fill(undefined);
38165
- this.#next = new UintArray(max);
38166
- this.#prev = new UintArray(max);
38167
- this.#head = 0;
38168
- this.#tail = 0;
38169
- this.#free = Stack2.create(max);
38170
- this.#size = 0;
38171
- this.#calculatedSize = 0;
38172
- if (typeof dispose === "function") {
38173
- this.#dispose = dispose;
38174
- }
38175
- if (typeof disposeAfter === "function") {
38176
- this.#disposeAfter = disposeAfter;
38177
- this.#disposed = [];
38178
- } else {
38179
- this.#disposeAfter = undefined;
38180
- this.#disposed = undefined;
38181
- }
38182
- this.#hasDispose = !!this.#dispose;
38183
- this.#hasDisposeAfter = !!this.#disposeAfter;
38184
- this.noDisposeOnSet = !!noDisposeOnSet;
38185
- this.noUpdateTTL = !!noUpdateTTL;
38186
- this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
38187
- this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
38188
- this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
38189
- this.ignoreFetchAbort = !!ignoreFetchAbort;
38190
- if (this.maxEntrySize !== 0) {
38191
- if (this.#maxSize !== 0) {
38192
- if (!isPosInt2(this.#maxSize)) {
38193
- throw new TypeError("maxSize must be a positive integer if specified");
38194
- }
38195
- }
38196
- if (!isPosInt2(this.maxEntrySize)) {
38197
- throw new TypeError("maxEntrySize must be a positive integer if specified");
38198
- }
38199
- this.#initializeSizeTracking();
38200
- }
38201
- this.allowStale = !!allowStale;
38202
- this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
38203
- this.updateAgeOnGet = !!updateAgeOnGet;
38204
- this.updateAgeOnHas = !!updateAgeOnHas;
38205
- this.ttlResolution = isPosInt2(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
38206
- this.ttlAutopurge = !!ttlAutopurge;
38207
- this.ttl = ttl || 0;
38208
- if (this.ttl) {
38209
- if (!isPosInt2(this.ttl)) {
38210
- throw new TypeError("ttl must be a positive integer if specified");
38211
- }
38212
- this.#initializeTTLTracking();
38213
- }
38214
- if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
38215
- throw new TypeError("At least one of max, maxSize, or ttl is required");
38216
- }
38217
- if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
38218
- const code = "LRU_CACHE_UNBOUNDED";
38219
- if (shouldWarn2(code)) {
38220
- warned2.add(code);
38221
- const msg = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
38222
- emitWarning2(msg, "UnboundedCacheWarning", code, LRUCache2);
38223
- }
38224
- }
38225
- }
38226
- getRemainingTTL(key2) {
38227
- return this.#keyMap.has(key2) ? Infinity : 0;
38228
- }
38229
- #initializeTTLTracking() {
38230
- const ttls = new ZeroArray2(this.#max);
38231
- const starts = new ZeroArray2(this.#max);
38232
- this.#ttls = ttls;
38233
- this.#starts = starts;
38234
- this.#setItemTTL = (index, ttl, start = perf2.now()) => {
38235
- starts[index] = ttl !== 0 ? start : 0;
38236
- ttls[index] = ttl;
38237
- if (ttl !== 0 && this.ttlAutopurge) {
38238
- const t3 = setTimeout(() => {
38239
- if (this.#isStale(index)) {
38240
- this.#delete(this.#keyList[index], "expire");
38241
- }
38242
- }, ttl + 1);
38243
- if (t3.unref) {
38244
- t3.unref();
38245
- }
38246
- }
38247
- };
38248
- this.#updateItemAge = (index) => {
38249
- starts[index] = ttls[index] !== 0 ? perf2.now() : 0;
38250
- };
38251
- this.#statusTTL = (status, index) => {
38252
- if (ttls[index]) {
38253
- const ttl = ttls[index];
38254
- const start = starts[index];
38255
- if (!ttl || !start)
38256
- return;
38257
- status.ttl = ttl;
38258
- status.start = start;
38259
- status.now = cachedNow || getNow();
38260
- const age = status.now - start;
38261
- status.remainingTTL = ttl - age;
38262
- }
38263
- };
38264
- let cachedNow = 0;
38265
- const getNow = () => {
38266
- const n2 = perf2.now();
38267
- if (this.ttlResolution > 0) {
38268
- cachedNow = n2;
38269
- const t3 = setTimeout(() => cachedNow = 0, this.ttlResolution);
38270
- if (t3.unref) {
38271
- t3.unref();
38272
- }
38273
- }
38274
- return n2;
38275
- };
38276
- this.getRemainingTTL = (key2) => {
38277
- const index = this.#keyMap.get(key2);
38278
- if (index === undefined) {
38279
- return 0;
38280
- }
38281
- const ttl = ttls[index];
38282
- const start = starts[index];
38283
- if (!ttl || !start) {
38284
- return Infinity;
38285
- }
38286
- const age = (cachedNow || getNow()) - start;
38287
- return ttl - age;
38288
- };
38289
- this.#isStale = (index) => {
38290
- const s = starts[index];
38291
- const t3 = ttls[index];
38292
- return !!t3 && !!s && (cachedNow || getNow()) - s > t3;
38293
- };
38294
- }
38295
- #updateItemAge = () => {};
38296
- #statusTTL = () => {};
38297
- #setItemTTL = () => {};
38298
- #isStale = () => false;
38299
- #initializeSizeTracking() {
38300
- const sizes = new ZeroArray2(this.#max);
38301
- this.#calculatedSize = 0;
38302
- this.#sizes = sizes;
38303
- this.#removeItemSize = (index) => {
38304
- this.#calculatedSize -= sizes[index];
38305
- sizes[index] = 0;
38306
- };
38307
- this.#requireSize = (k, v, size, sizeCalculation) => {
38308
- if (this.#isBackgroundFetch(v)) {
38309
- return 0;
38310
- }
38311
- if (!isPosInt2(size)) {
38312
- if (sizeCalculation) {
38313
- if (typeof sizeCalculation !== "function") {
38314
- throw new TypeError("sizeCalculation must be a function");
38315
- }
38316
- size = sizeCalculation(v, k);
38317
- if (!isPosInt2(size)) {
38318
- throw new TypeError("sizeCalculation return invalid (expect positive integer)");
38319
- }
38320
- } else {
38321
- throw new TypeError("invalid size value (must be positive integer). " + "When maxSize or maxEntrySize is used, sizeCalculation " + "or size must be set.");
38322
- }
38323
- }
38324
- return size;
38325
- };
38326
- this.#addItemSize = (index, size, status) => {
38327
- sizes[index] = size;
38328
- if (this.#maxSize) {
38329
- const maxSize = this.#maxSize - sizes[index];
38330
- while (this.#calculatedSize > maxSize) {
38331
- this.#evict(true);
38332
- }
38333
- }
38334
- this.#calculatedSize += sizes[index];
38335
- if (status) {
38336
- status.entrySize = size;
38337
- status.totalCalculatedSize = this.#calculatedSize;
38338
- }
38339
- };
38340
- }
38341
- #removeItemSize = (_i) => {};
38342
- #addItemSize = (_i, _s, _st) => {};
38343
- #requireSize = (_k, _v, size, sizeCalculation) => {
38344
- if (size || sizeCalculation) {
38345
- throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
38346
- }
38347
- return 0;
38348
- };
38349
- *#indexes({ allowStale = this.allowStale } = {}) {
38350
- if (this.#size) {
38351
- for (let i2 = this.#tail;; ) {
38352
- if (!this.#isValidIndex(i2)) {
38353
- break;
38354
- }
38355
- if (allowStale || !this.#isStale(i2)) {
38356
- yield i2;
38357
- }
38358
- if (i2 === this.#head) {
38359
- break;
38360
- } else {
38361
- i2 = this.#prev[i2];
38362
- }
38363
- }
38364
- }
38365
- }
38366
- *#rindexes({ allowStale = this.allowStale } = {}) {
38367
- if (this.#size) {
38368
- for (let i2 = this.#head;; ) {
38369
- if (!this.#isValidIndex(i2)) {
38370
- break;
38371
- }
38372
- if (allowStale || !this.#isStale(i2)) {
38373
- yield i2;
38374
- }
38375
- if (i2 === this.#tail) {
38376
- break;
38377
- } else {
38378
- i2 = this.#next[i2];
38379
- }
38380
- }
38381
- }
38382
- }
38383
- #isValidIndex(index) {
38384
- return index !== undefined && this.#keyMap.get(this.#keyList[index]) === index;
38385
- }
38386
- *entries() {
38387
- for (const i2 of this.#indexes()) {
38388
- if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
38389
- yield [this.#keyList[i2], this.#valList[i2]];
38390
- }
38391
- }
38392
- }
38393
- *rentries() {
38394
- for (const i2 of this.#rindexes()) {
38395
- if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
38396
- yield [this.#keyList[i2], this.#valList[i2]];
38397
- }
38398
- }
36393
+ for (var i2 = 0;i2 < methods.length; i2++) {
36394
+ var method = methods[i2];
36395
+ var original = obj[method];
36396
+ obj[method] = function retryWrapper(original2) {
36397
+ var op = exports.operation(options);
36398
+ var args = Array.prototype.slice.call(arguments, 1);
36399
+ var callback = args.pop();
36400
+ args.push(function(err) {
36401
+ if (op.retry(err)) {
36402
+ return;
36403
+ }
36404
+ if (err) {
36405
+ arguments[0] = op.mainError();
36406
+ }
36407
+ callback.apply(this, arguments);
36408
+ });
36409
+ op.attempt(function() {
36410
+ original2.apply(obj, args);
36411
+ });
36412
+ }.bind(obj, original);
36413
+ obj[method].options = options;
38399
36414
  }
38400
- *keys() {
38401
- for (const i2 of this.#indexes()) {
38402
- const k = this.#keyList[i2];
38403
- if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
38404
- yield k;
38405
- }
38406
- }
36415
+ };
36416
+ });
36417
+
36418
+ // ../../node_modules/promise-retry/index.js
36419
+ var require_promise_retry = __commonJS((exports, module) => {
36420
+ var errcode = require_err_code();
36421
+ var retry = require_retry();
36422
+ var hasOwn = Object.prototype.hasOwnProperty;
36423
+ function isRetryError(err) {
36424
+ return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried");
36425
+ }
36426
+ function promiseRetry(fn, options) {
36427
+ var temp;
36428
+ var operation;
36429
+ if (typeof fn === "object" && typeof options === "function") {
36430
+ temp = options;
36431
+ options = fn;
36432
+ fn = temp;
38407
36433
  }
38408
- *rkeys() {
38409
- for (const i2 of this.#rindexes()) {
38410
- const k = this.#keyList[i2];
38411
- if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
38412
- yield k;
38413
- }
38414
- }
36434
+ operation = retry.operation(options);
36435
+ return new Promise(function(resolve2, reject) {
36436
+ operation.attempt(function(number) {
36437
+ Promise.resolve().then(function() {
36438
+ return fn(function(err) {
36439
+ if (isRetryError(err)) {
36440
+ err = err.retried;
36441
+ }
36442
+ throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
36443
+ }, number);
36444
+ }).then(resolve2, function(err) {
36445
+ if (isRetryError(err)) {
36446
+ err = err.retried;
36447
+ if (operation.retry(err || new Error)) {
36448
+ return;
36449
+ }
36450
+ }
36451
+ reject(err);
36452
+ });
36453
+ });
36454
+ });
36455
+ }
36456
+ module.exports = promiseRetry;
36457
+ });
36458
+
36459
+ // ../../node_modules/@npmcli/git/lib/errors.js
36460
+ var require_errors2 = __commonJS((exports, module) => {
36461
+ var maxRetry = 3;
36462
+
36463
+ class GitError extends Error {
36464
+ shouldRetry() {
36465
+ return false;
38415
36466
  }
38416
- *values() {
38417
- for (const i2 of this.#indexes()) {
38418
- const v = this.#valList[i2];
38419
- if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
38420
- yield this.#valList[i2];
38421
- }
38422
- }
36467
+ }
36468
+
36469
+ class GitConnectionError extends GitError {
36470
+ constructor() {
36471
+ super("A git connection error occurred");
38423
36472
  }
38424
- *rvalues() {
38425
- for (const i2 of this.#rindexes()) {
38426
- const v = this.#valList[i2];
38427
- if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
38428
- yield this.#valList[i2];
38429
- }
38430
- }
36473
+ shouldRetry(number) {
36474
+ return number < maxRetry;
38431
36475
  }
38432
- [Symbol.iterator]() {
38433
- return this.entries();
36476
+ }
36477
+
36478
+ class GitPathspecError extends GitError {
36479
+ constructor() {
36480
+ super("The git reference could not be found");
38434
36481
  }
38435
- [Symbol.toStringTag] = "LRUCache";
38436
- find(fn, getOptions = {}) {
38437
- for (const i2 of this.#indexes()) {
38438
- const v = this.#valList[i2];
38439
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
38440
- if (value2 === undefined)
38441
- continue;
38442
- if (fn(value2, this.#keyList[i2], this)) {
38443
- return this.get(this.#keyList[i2], getOptions);
38444
- }
38445
- }
36482
+ }
36483
+
36484
+ class GitUnknownError extends GitError {
36485
+ constructor() {
36486
+ super("An unknown git error occurred");
38446
36487
  }
38447
- forEach(fn, thisp = this) {
38448
- for (const i2 of this.#indexes()) {
38449
- const v = this.#valList[i2];
38450
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
38451
- if (value2 === undefined)
38452
- continue;
38453
- fn.call(thisp, value2, this.#keyList[i2], this);
38454
- }
36488
+ }
36489
+ module.exports = {
36490
+ GitConnectionError,
36491
+ GitPathspecError,
36492
+ GitUnknownError
36493
+ };
36494
+ });
36495
+
36496
+ // ../../node_modules/@npmcli/git/lib/make-error.js
36497
+ var require_make_error = __commonJS((exports, module) => {
36498
+ var {
36499
+ GitConnectionError,
36500
+ GitPathspecError,
36501
+ GitUnknownError
36502
+ } = require_errors2();
36503
+ var connectionErrorRe = new RegExp([
36504
+ "remote error: Internal Server Error",
36505
+ "The remote end hung up unexpectedly",
36506
+ "Connection timed out",
36507
+ "Operation timed out",
36508
+ "Failed to connect to .* Timed out",
36509
+ "Connection reset by peer",
36510
+ "SSL_ERROR_SYSCALL",
36511
+ "The requested URL returned error: 503"
36512
+ ].join("|"));
36513
+ var missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/;
36514
+ function makeError(er) {
36515
+ const message = er.stderr;
36516
+ let gitEr;
36517
+ if (connectionErrorRe.test(message)) {
36518
+ gitEr = new GitConnectionError(message);
36519
+ } else if (missingPathspecRe.test(message)) {
36520
+ gitEr = new GitPathspecError(message);
36521
+ } else {
36522
+ gitEr = new GitUnknownError(message);
38455
36523
  }
38456
- rforEach(fn, thisp = this) {
38457
- for (const i2 of this.#rindexes()) {
38458
- const v = this.#valList[i2];
38459
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
38460
- if (value2 === undefined)
38461
- continue;
38462
- fn.call(thisp, value2, this.#keyList[i2], this);
38463
- }
36524
+ return Object.assign(gitEr, er);
36525
+ }
36526
+ module.exports = makeError;
36527
+ });
36528
+
36529
+ // ../../node_modules/ini/lib/ini.js
36530
+ var require_ini = __commonJS((exports, module) => {
36531
+ var { hasOwnProperty } = Object.prototype;
36532
+ var encode = (obj, opt = {}) => {
36533
+ if (typeof opt === "string") {
36534
+ opt = { section: opt };
38464
36535
  }
38465
- purgeStale() {
38466
- let deleted = false;
38467
- for (const i2 of this.#rindexes({ allowStale: true })) {
38468
- if (this.#isStale(i2)) {
38469
- this.#delete(this.#keyList[i2], "expire");
38470
- deleted = true;
38471
- }
38472
- }
38473
- return deleted;
36536
+ opt.align = opt.align === true;
36537
+ opt.newline = opt.newline === true;
36538
+ opt.sort = opt.sort === true;
36539
+ opt.whitespace = opt.whitespace === true || opt.align === true;
36540
+ opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
36541
+ opt.bracketedArray = opt.bracketedArray !== false;
36542
+ const eol = opt.platform === "win32" ? `\r
36543
+ ` : `
36544
+ `;
36545
+ const separator = opt.whitespace ? " = " : "=";
36546
+ const children = [];
36547
+ const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
36548
+ let padToChars = 0;
36549
+ if (opt.align) {
36550
+ padToChars = safe(keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a3, b) => safe(a3).length >= safe(b).length ? a3 : b)).length;
38474
36551
  }
38475
- info(key2) {
38476
- const i2 = this.#keyMap.get(key2);
38477
- if (i2 === undefined)
38478
- return;
38479
- const v = this.#valList[i2];
38480
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
38481
- if (value2 === undefined)
38482
- return;
38483
- const entry = { value: value2 };
38484
- if (this.#ttls && this.#starts) {
38485
- const ttl = this.#ttls[i2];
38486
- const start = this.#starts[i2];
38487
- if (ttl && start) {
38488
- const remain = ttl - (perf2.now() - start);
38489
- entry.ttl = remain;
38490
- entry.start = Date.now();
36552
+ let out = "";
36553
+ const arraySuffix = opt.bracketedArray ? "[]" : "";
36554
+ for (const k of keys) {
36555
+ const val = obj[k];
36556
+ if (val && Array.isArray(val)) {
36557
+ for (const item of val) {
36558
+ out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol;
38491
36559
  }
36560
+ } else if (val && typeof val === "object") {
36561
+ children.push(k);
36562
+ } else {
36563
+ out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol;
38492
36564
  }
38493
- if (this.#sizes) {
38494
- entry.size = this.#sizes[i2];
36565
+ }
36566
+ if (opt.section && out.length) {
36567
+ out = "[" + safe(opt.section) + "]" + (opt.newline ? eol + eol : eol) + out;
36568
+ }
36569
+ for (const k of children) {
36570
+ const nk = splitSections(k, ".").join("\\.");
36571
+ const section = (opt.section ? opt.section + "." : "") + nk;
36572
+ const child = encode(obj[k], {
36573
+ ...opt,
36574
+ section
36575
+ });
36576
+ if (out.length && child.length) {
36577
+ out += eol;
38495
36578
  }
38496
- return entry;
36579
+ out += child;
38497
36580
  }
38498
- dump() {
38499
- const arr = [];
38500
- for (const i2 of this.#indexes({ allowStale: true })) {
38501
- const key2 = this.#keyList[i2];
38502
- const v = this.#valList[i2];
38503
- const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
38504
- if (value2 === undefined || key2 === undefined)
36581
+ return out;
36582
+ };
36583
+ function splitSections(str, separator) {
36584
+ var lastMatchIndex = 0;
36585
+ var lastSeparatorIndex = 0;
36586
+ var nextIndex = 0;
36587
+ var sections = [];
36588
+ do {
36589
+ nextIndex = str.indexOf(separator, lastMatchIndex);
36590
+ if (nextIndex !== -1) {
36591
+ lastMatchIndex = nextIndex + separator.length;
36592
+ if (nextIndex > 0 && str[nextIndex - 1] === "\\") {
38505
36593
  continue;
38506
- const entry = { value: value2 };
38507
- if (this.#ttls && this.#starts) {
38508
- entry.ttl = this.#ttls[i2];
38509
- const age = perf2.now() - this.#starts[i2];
38510
- entry.start = Math.floor(Date.now() - age);
38511
- }
38512
- if (this.#sizes) {
38513
- entry.size = this.#sizes[i2];
38514
36594
  }
38515
- arr.unshift([key2, entry]);
36595
+ sections.push(str.slice(lastSeparatorIndex, nextIndex));
36596
+ lastSeparatorIndex = nextIndex + separator.length;
38516
36597
  }
38517
- return arr;
38518
- }
38519
- load(arr) {
38520
- this.clear();
38521
- for (const [key2, entry] of arr) {
38522
- if (entry.start) {
38523
- const age = Date.now() - entry.start;
38524
- entry.start = perf2.now() - age;
38525
- }
38526
- this.set(key2, entry.value, entry);
36598
+ } while (nextIndex !== -1);
36599
+ sections.push(str.slice(lastSeparatorIndex));
36600
+ return sections;
36601
+ }
36602
+ var decode = (str, opt = {}) => {
36603
+ opt.bracketedArray = opt.bracketedArray !== false;
36604
+ const out = Object.create(null);
36605
+ let p = out;
36606
+ let section = null;
36607
+ const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
36608
+ const lines2 = str.split(/[\r\n]+/g);
36609
+ const duplicates = {};
36610
+ for (const line of lines2) {
36611
+ if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
36612
+ continue;
38527
36613
  }
38528
- }
38529
- set(k, v, setOptions = {}) {
38530
- if (v === undefined) {
38531
- this.delete(k);
38532
- return this;
36614
+ const match2 = line.match(re);
36615
+ if (!match2) {
36616
+ continue;
38533
36617
  }
38534
- const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
38535
- let { noUpdateTTL = this.noUpdateTTL } = setOptions;
38536
- const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
38537
- if (this.maxEntrySize && size > this.maxEntrySize) {
38538
- if (status) {
38539
- status.set = "miss";
38540
- status.maxEntrySizeExceeded = true;
36618
+ if (match2[1] !== undefined) {
36619
+ section = unsafe(match2[1]);
36620
+ if (section === "__proto__") {
36621
+ p = Object.create(null);
36622
+ continue;
38541
36623
  }
38542
- this.#delete(k, "set");
38543
- return this;
36624
+ p = out[section] = out[section] || Object.create(null);
36625
+ continue;
38544
36626
  }
38545
- let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
38546
- if (index === undefined) {
38547
- index = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size;
38548
- this.#keyList[index] = k;
38549
- this.#valList[index] = v;
38550
- this.#keyMap.set(k, index);
38551
- this.#next[this.#tail] = index;
38552
- this.#prev[index] = this.#tail;
38553
- this.#tail = index;
38554
- this.#size++;
38555
- this.#addItemSize(index, size, status);
38556
- if (status)
38557
- status.set = "add";
38558
- noUpdateTTL = false;
36627
+ const keyRaw = unsafe(match2[2]);
36628
+ let isArray;
36629
+ if (opt.bracketedArray) {
36630
+ isArray = keyRaw.length > 2 && keyRaw.slice(-2) === "[]";
38559
36631
  } else {
38560
- this.#moveToTail(index);
38561
- const oldVal = this.#valList[index];
38562
- if (v !== oldVal) {
38563
- if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
38564
- oldVal.__abortController.abort(new Error("replaced"));
38565
- const { __staleWhileFetching: s } = oldVal;
38566
- if (s !== undefined && !noDisposeOnSet) {
38567
- if (this.#hasDispose) {
38568
- this.#dispose?.(s, k, "set");
38569
- }
38570
- if (this.#hasDisposeAfter) {
38571
- this.#disposed?.push([s, k, "set"]);
38572
- }
38573
- }
38574
- } else if (!noDisposeOnSet) {
38575
- if (this.#hasDispose) {
38576
- this.#dispose?.(oldVal, k, "set");
38577
- }
38578
- if (this.#hasDisposeAfter) {
38579
- this.#disposed?.push([oldVal, k, "set"]);
38580
- }
38581
- }
38582
- this.#removeItemSize(index);
38583
- this.#addItemSize(index, size, status);
38584
- this.#valList[index] = v;
38585
- if (status) {
38586
- status.set = "replace";
38587
- const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
38588
- if (oldValue !== undefined)
38589
- status.oldValue = oldValue;
38590
- }
38591
- } else if (status) {
38592
- status.set = "update";
38593
- }
36632
+ duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;
36633
+ isArray = duplicates[keyRaw] > 1;
38594
36634
  }
38595
- if (ttl !== 0 && !this.#ttls) {
38596
- this.#initializeTTLTracking();
36635
+ const key2 = isArray && keyRaw.endsWith("[]") ? keyRaw.slice(0, -2) : keyRaw;
36636
+ if (key2 === "__proto__") {
36637
+ continue;
38597
36638
  }
38598
- if (this.#ttls) {
38599
- if (!noUpdateTTL) {
38600
- this.#setItemTTL(index, ttl, start);
36639
+ const valueRaw = match2[3] ? unsafe(match2[4]) : true;
36640
+ const value2 = valueRaw === "true" || valueRaw === "false" || valueRaw === "null" ? JSON.parse(valueRaw) : valueRaw;
36641
+ if (isArray) {
36642
+ if (!hasOwnProperty.call(p, key2)) {
36643
+ p[key2] = [];
36644
+ } else if (!Array.isArray(p[key2])) {
36645
+ p[key2] = [p[key2]];
38601
36646
  }
38602
- if (status)
38603
- this.#statusTTL(status, index);
38604
36647
  }
38605
- if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
38606
- const dt2 = this.#disposed;
38607
- let task;
38608
- while (task = dt2?.shift()) {
38609
- this.#disposeAfter?.(...task);
38610
- }
36648
+ if (Array.isArray(p[key2])) {
36649
+ p[key2].push(value2);
36650
+ } else {
36651
+ p[key2] = value2;
38611
36652
  }
38612
- return this;
38613
36653
  }
38614
- pop() {
38615
- try {
38616
- while (this.#size) {
38617
- const val = this.#valList[this.#head];
38618
- this.#evict(true);
38619
- if (this.#isBackgroundFetch(val)) {
38620
- if (val.__staleWhileFetching) {
38621
- return val.__staleWhileFetching;
38622
- }
38623
- } else if (val !== undefined) {
38624
- return val;
38625
- }
38626
- }
38627
- } finally {
38628
- if (this.#hasDisposeAfter && this.#disposed) {
38629
- const dt2 = this.#disposed;
38630
- let task;
38631
- while (task = dt2?.shift()) {
38632
- this.#disposeAfter?.(...task);
38633
- }
38634
- }
36654
+ const remove = [];
36655
+ for (const k of Object.keys(out)) {
36656
+ if (!hasOwnProperty.call(out, k) || typeof out[k] !== "object" || Array.isArray(out[k])) {
36657
+ continue;
38635
36658
  }
38636
- }
38637
- #evict(free) {
38638
- const head = this.#head;
38639
- const k = this.#keyList[head];
38640
- const v = this.#valList[head];
38641
- if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
38642
- v.__abortController.abort(new Error("evicted"));
38643
- } else if (this.#hasDispose || this.#hasDisposeAfter) {
38644
- if (this.#hasDispose) {
38645
- this.#dispose?.(v, k, "evict");
36659
+ const parts = splitSections(k, ".");
36660
+ p = out;
36661
+ const l2 = parts.pop();
36662
+ const nl = l2.replace(/\\\./g, ".");
36663
+ for (const part of parts) {
36664
+ if (part === "__proto__") {
36665
+ continue;
38646
36666
  }
38647
- if (this.#hasDisposeAfter) {
38648
- this.#disposed?.push([v, k, "evict"]);
36667
+ if (!hasOwnProperty.call(p, part) || typeof p[part] !== "object") {
36668
+ p[part] = Object.create(null);
38649
36669
  }
36670
+ p = p[part];
38650
36671
  }
38651
- this.#removeItemSize(head);
38652
- if (free) {
38653
- this.#keyList[head] = undefined;
38654
- this.#valList[head] = undefined;
38655
- this.#free.push(head);
38656
- }
38657
- if (this.#size === 1) {
38658
- this.#head = this.#tail = 0;
38659
- this.#free.length = 0;
38660
- } else {
38661
- this.#head = this.#next[head];
36672
+ if (p === out && nl === l2) {
36673
+ continue;
38662
36674
  }
38663
- this.#keyMap.delete(k);
38664
- this.#size--;
38665
- return head;
36675
+ p[nl] = out[k];
36676
+ remove.push(k);
38666
36677
  }
38667
- has(k, hasOptions = {}) {
38668
- const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
38669
- const index = this.#keyMap.get(k);
38670
- if (index !== undefined) {
38671
- const v = this.#valList[index];
38672
- if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === undefined) {
38673
- return false;
38674
- }
38675
- if (!this.#isStale(index)) {
38676
- if (updateAgeOnHas) {
38677
- this.#updateItemAge(index);
38678
- }
38679
- if (status) {
38680
- status.has = "hit";
38681
- this.#statusTTL(status, index);
38682
- }
38683
- return true;
38684
- } else if (status) {
38685
- status.has = "stale";
38686
- this.#statusTTL(status, index);
38687
- }
38688
- } else if (status) {
38689
- status.has = "miss";
38690
- }
38691
- return false;
36678
+ for (const del of remove) {
36679
+ delete out[del];
38692
36680
  }
38693
- peek(k, peekOptions = {}) {
38694
- const { allowStale = this.allowStale } = peekOptions;
38695
- const index = this.#keyMap.get(k);
38696
- if (index === undefined || !allowStale && this.#isStale(index)) {
38697
- return;
38698
- }
38699
- const v = this.#valList[index];
38700
- return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
36681
+ return out;
36682
+ };
36683
+ var isQuoted = (val) => {
36684
+ return val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'");
36685
+ };
36686
+ var safe = (val) => {
36687
+ if (typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) {
36688
+ return JSON.stringify(val);
38701
36689
  }
38702
- #backgroundFetch(k, index, options, context) {
38703
- const v = index === undefined ? undefined : this.#valList[index];
38704
- if (this.#isBackgroundFetch(v)) {
38705
- return v;
36690
+ return val.split(";").join("\\;").split("#").join("\\#");
36691
+ };
36692
+ var unsafe = (val) => {
36693
+ val = (val || "").trim();
36694
+ if (isQuoted(val)) {
36695
+ if (val.charAt(0) === "'") {
36696
+ val = val.slice(1, -1);
38706
36697
  }
38707
- const ac = new AC2;
38708
- const { signal } = options;
38709
- signal?.addEventListener("abort", () => ac.abort(signal.reason), {
38710
- signal: ac.signal
38711
- });
38712
- const fetchOpts = {
38713
- signal: ac.signal,
38714
- options,
38715
- context
38716
- };
38717
- const cb = (v2, updateCache = false) => {
38718
- const { aborted } = ac.signal;
38719
- const ignoreAbort = options.ignoreFetchAbort && v2 !== undefined;
38720
- if (options.status) {
38721
- if (aborted && !updateCache) {
38722
- options.status.fetchAborted = true;
38723
- options.status.fetchError = ac.signal.reason;
38724
- if (ignoreAbort)
38725
- options.status.fetchAbortIgnored = true;
38726
- } else {
38727
- options.status.fetchResolved = true;
38728
- }
38729
- }
38730
- if (aborted && !ignoreAbort && !updateCache) {
38731
- return fetchFail(ac.signal.reason);
38732
- }
38733
- const bf2 = p;
38734
- if (this.#valList[index] === p) {
38735
- if (v2 === undefined) {
38736
- if (bf2.__staleWhileFetching) {
38737
- this.#valList[index] = bf2.__staleWhileFetching;
38738
- } else {
38739
- this.#delete(k, "fetch");
38740
- }
36698
+ try {
36699
+ val = JSON.parse(val);
36700
+ } catch {}
36701
+ } else {
36702
+ let esc = false;
36703
+ let unesc = "";
36704
+ for (let i2 = 0, l2 = val.length;i2 < l2; i2++) {
36705
+ const c = val.charAt(i2);
36706
+ if (esc) {
36707
+ if ("\\;#".indexOf(c) !== -1) {
36708
+ unesc += c;
38741
36709
  } else {
38742
- if (options.status)
38743
- options.status.fetchUpdated = true;
38744
- this.set(k, v2, fetchOpts.options);
38745
- }
38746
- }
38747
- return v2;
38748
- };
38749
- const eb = (er) => {
38750
- if (options.status) {
38751
- options.status.fetchRejected = true;
38752
- options.status.fetchError = er;
38753
- }
38754
- return fetchFail(er);
38755
- };
38756
- const fetchFail = (er) => {
38757
- const { aborted } = ac.signal;
38758
- const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
38759
- const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
38760
- const noDelete = allowStale || options.noDeleteOnFetchRejection;
38761
- const bf2 = p;
38762
- if (this.#valList[index] === p) {
38763
- const del = !noDelete || bf2.__staleWhileFetching === undefined;
38764
- if (del) {
38765
- this.#delete(k, "fetch");
38766
- } else if (!allowStaleAborted) {
38767
- this.#valList[index] = bf2.__staleWhileFetching;
38768
- }
38769
- }
38770
- if (allowStale) {
38771
- if (options.status && bf2.__staleWhileFetching !== undefined) {
38772
- options.status.returnedStale = true;
38773
- }
38774
- return bf2.__staleWhileFetching;
38775
- } else if (bf2.__returned === bf2) {
38776
- throw er;
38777
- }
38778
- };
38779
- const pcall = (res, rej) => {
38780
- const fmp = this.#fetchMethod?.(k, v, fetchOpts);
38781
- if (fmp && fmp instanceof Promise) {
38782
- fmp.then((v2) => res(v2 === undefined ? undefined : v2), rej);
38783
- }
38784
- ac.signal.addEventListener("abort", () => {
38785
- if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
38786
- res(undefined);
38787
- if (options.allowStaleOnFetchAbort) {
38788
- res = (v2) => cb(v2, true);
38789
- }
38790
- }
38791
- });
38792
- };
38793
- if (options.status)
38794
- options.status.fetchDispatched = true;
38795
- const p = new Promise(pcall).then(cb, eb);
38796
- const bf = Object.assign(p, {
38797
- __abortController: ac,
38798
- __staleWhileFetching: v,
38799
- __returned: undefined
38800
- });
38801
- if (index === undefined) {
38802
- this.set(k, bf, { ...fetchOpts.options, status: undefined });
38803
- index = this.#keyMap.get(k);
38804
- } else {
38805
- this.#valList[index] = bf;
38806
- }
38807
- return bf;
38808
- }
38809
- #isBackgroundFetch(p) {
38810
- if (!this.#hasFetchMethod)
38811
- return false;
38812
- const b = p;
38813
- return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC2;
38814
- }
38815
- async fetch(k, fetchOptions = {}) {
38816
- const {
38817
- allowStale = this.allowStale,
38818
- updateAgeOnGet = this.updateAgeOnGet,
38819
- noDeleteOnStaleGet = this.noDeleteOnStaleGet,
38820
- ttl = this.ttl,
38821
- noDisposeOnSet = this.noDisposeOnSet,
38822
- size = 0,
38823
- sizeCalculation = this.sizeCalculation,
38824
- noUpdateTTL = this.noUpdateTTL,
38825
- noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
38826
- allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
38827
- ignoreFetchAbort = this.ignoreFetchAbort,
38828
- allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
38829
- context,
38830
- forceRefresh = false,
38831
- status,
38832
- signal
38833
- } = fetchOptions;
38834
- if (!this.#hasFetchMethod) {
38835
- if (status)
38836
- status.fetch = "get";
38837
- return this.get(k, {
38838
- allowStale,
38839
- updateAgeOnGet,
38840
- noDeleteOnStaleGet,
38841
- status
38842
- });
38843
- }
38844
- const options = {
38845
- allowStale,
38846
- updateAgeOnGet,
38847
- noDeleteOnStaleGet,
38848
- ttl,
38849
- noDisposeOnSet,
38850
- size,
38851
- sizeCalculation,
38852
- noUpdateTTL,
38853
- noDeleteOnFetchRejection,
38854
- allowStaleOnFetchRejection,
38855
- allowStaleOnFetchAbort,
38856
- ignoreFetchAbort,
38857
- status,
38858
- signal
38859
- };
38860
- let index = this.#keyMap.get(k);
38861
- if (index === undefined) {
38862
- if (status)
38863
- status.fetch = "miss";
38864
- const p = this.#backgroundFetch(k, index, options, context);
38865
- return p.__returned = p;
38866
- } else {
38867
- const v = this.#valList[index];
38868
- if (this.#isBackgroundFetch(v)) {
38869
- const stale = allowStale && v.__staleWhileFetching !== undefined;
38870
- if (status) {
38871
- status.fetch = "inflight";
38872
- if (stale)
38873
- status.returnedStale = true;
38874
- }
38875
- return stale ? v.__staleWhileFetching : v.__returned = v;
38876
- }
38877
- const isStale = this.#isStale(index);
38878
- if (!forceRefresh && !isStale) {
38879
- if (status)
38880
- status.fetch = "hit";
38881
- this.#moveToTail(index);
38882
- if (updateAgeOnGet) {
38883
- this.#updateItemAge(index);
36710
+ unesc += "\\" + c;
38884
36711
  }
38885
- if (status)
38886
- this.#statusTTL(status, index);
38887
- return v;
38888
- }
38889
- const p = this.#backgroundFetch(k, index, options, context);
38890
- const hasStale = p.__staleWhileFetching !== undefined;
38891
- const staleVal = hasStale && allowStale;
38892
- if (status) {
38893
- status.fetch = isStale ? "stale" : "refresh";
38894
- if (staleVal && isStale)
38895
- status.returnedStale = true;
36712
+ esc = false;
36713
+ } else if (";#".indexOf(c) !== -1) {
36714
+ break;
36715
+ } else if (c === "\\") {
36716
+ esc = true;
36717
+ } else {
36718
+ unesc += c;
38896
36719
  }
38897
- return staleVal ? p.__staleWhileFetching : p.__returned = p;
38898
36720
  }
38899
- }
38900
- async forceFetch(k, fetchOptions = {}) {
38901
- const v = await this.fetch(k, fetchOptions);
38902
- if (v === undefined)
38903
- throw new Error("fetch() returned undefined");
38904
- return v;
38905
- }
38906
- memo(k, memoOptions = {}) {
38907
- const memoMethod = this.#memoMethod;
38908
- if (!memoMethod) {
38909
- throw new Error("no memoMethod provided to constructor");
36721
+ if (esc) {
36722
+ unesc += "\\";
38910
36723
  }
38911
- const { context, forceRefresh, ...options } = memoOptions;
38912
- const v = this.get(k, options);
38913
- if (!forceRefresh && v !== undefined)
38914
- return v;
38915
- const vv = memoMethod(k, v, {
38916
- options,
38917
- context
38918
- });
38919
- this.set(k, vv, options);
38920
- return vv;
36724
+ return unesc.trim();
38921
36725
  }
38922
- get(k, getOptions = {}) {
38923
- const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
38924
- const index = this.#keyMap.get(k);
38925
- if (index !== undefined) {
38926
- const value2 = this.#valList[index];
38927
- const fetching = this.#isBackgroundFetch(value2);
38928
- if (status)
38929
- this.#statusTTL(status, index);
38930
- if (this.#isStale(index)) {
38931
- if (status)
38932
- status.get = "stale";
38933
- if (!fetching) {
38934
- if (!noDeleteOnStaleGet) {
38935
- this.#delete(k, "expire");
38936
- }
38937
- if (status && allowStale)
38938
- status.returnedStale = true;
38939
- return allowStale ? value2 : undefined;
38940
- } else {
38941
- if (status && allowStale && value2.__staleWhileFetching !== undefined) {
38942
- status.returnedStale = true;
38943
- }
38944
- return allowStale ? value2.__staleWhileFetching : undefined;
38945
- }
38946
- } else {
38947
- if (status)
38948
- status.get = "hit";
38949
- if (fetching) {
38950
- return value2.__staleWhileFetching;
38951
- }
38952
- this.#moveToTail(index);
38953
- if (updateAgeOnGet) {
38954
- this.#updateItemAge(index);
38955
- }
38956
- return value2;
36726
+ return val;
36727
+ };
36728
+ module.exports = {
36729
+ parse: decode,
36730
+ decode,
36731
+ stringify: encode,
36732
+ encode,
36733
+ safe,
36734
+ unsafe
36735
+ };
36736
+ });
36737
+
36738
+ // ../../node_modules/@npmcli/git/lib/opts.js
36739
+ var require_opts = __commonJS((exports, module) => {
36740
+ var fs4 = __require("node:fs");
36741
+ var os = __require("node:os");
36742
+ var path6 = __require("node:path");
36743
+ var ini = require_ini();
36744
+ var gitConfigPath = path6.join(os.homedir(), ".gitconfig");
36745
+ var cachedConfig = null;
36746
+ var loadGitConfig = () => {
36747
+ if (cachedConfig === null) {
36748
+ try {
36749
+ cachedConfig = {};
36750
+ if (fs4.existsSync(gitConfigPath)) {
36751
+ const configContent = fs4.readFileSync(gitConfigPath, "utf-8");
36752
+ cachedConfig = ini.parse(configContent);
38957
36753
  }
38958
- } else if (status) {
38959
- status.get = "miss";
36754
+ } catch (error2) {
36755
+ cachedConfig = {};
38960
36756
  }
38961
36757
  }
38962
- #connect(p, n2) {
38963
- this.#prev[n2] = p;
38964
- this.#next[p] = n2;
36758
+ return cachedConfig;
36759
+ };
36760
+ var checkGitConfigs = () => {
36761
+ const config3 = loadGitConfig();
36762
+ return {
36763
+ sshCommandSetInConfig: config3?.core?.sshCommand !== undefined,
36764
+ askPassSetInConfig: config3?.core?.askpass !== undefined
36765
+ };
36766
+ };
36767
+ var sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== undefined;
36768
+ var askPassSetInEnv = process.env.GIT_ASKPASS !== undefined;
36769
+ var { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs();
36770
+ var finalGitEnv = {
36771
+ ...askPassSetInEnv || askPassSetInConfig ? {} : {
36772
+ GIT_ASKPASS: "echo"
36773
+ },
36774
+ ...sshCommandSetInEnv || sshCommandSetInConfig ? {} : {
36775
+ GIT_SSH_COMMAND: "ssh -oStrictHostKeyChecking=accept-new"
38965
36776
  }
38966
- #moveToTail(index) {
38967
- if (index !== this.#tail) {
38968
- if (index === this.#head) {
38969
- this.#head = this.#next[index];
38970
- } else {
38971
- this.#connect(this.#prev[index], this.#next[index]);
38972
- }
38973
- this.#connect(this.#tail, index);
38974
- this.#tail = index;
38975
- }
36777
+ };
36778
+ module.exports = (opts = {}) => ({
36779
+ stdioString: true,
36780
+ ...opts,
36781
+ shell: false,
36782
+ env: opts.env || { ...finalGitEnv, ...process.env }
36783
+ });
36784
+ module.exports.loadGitConfig = loadGitConfig;
36785
+ });
36786
+
36787
+ // ../../node_modules/@npmcli/git/lib/which.js
36788
+ var require_which = __commonJS((exports, module) => {
36789
+ var which = require_lib5();
36790
+ var gitPath;
36791
+ try {
36792
+ gitPath = which.sync("git");
36793
+ } catch {}
36794
+ module.exports = (opts = {}) => {
36795
+ if (opts.git) {
36796
+ return opts.git;
38976
36797
  }
38977
- delete(k) {
38978
- return this.#delete(k, "delete");
36798
+ if (!gitPath || opts.git === false) {
36799
+ return Object.assign(new Error("No git binary found in $PATH"), { code: "ENOGIT" });
38979
36800
  }
38980
- #delete(k, reason) {
38981
- let deleted = false;
38982
- if (this.#size !== 0) {
38983
- const index = this.#keyMap.get(k);
38984
- if (index !== undefined) {
38985
- deleted = true;
38986
- if (this.#size === 1) {
38987
- this.#clear(reason);
38988
- } else {
38989
- this.#removeItemSize(index);
38990
- const v = this.#valList[index];
38991
- if (this.#isBackgroundFetch(v)) {
38992
- v.__abortController.abort(new Error("deleted"));
38993
- } else if (this.#hasDispose || this.#hasDisposeAfter) {
38994
- if (this.#hasDispose) {
38995
- this.#dispose?.(v, k, reason);
38996
- }
38997
- if (this.#hasDisposeAfter) {
38998
- this.#disposed?.push([v, k, reason]);
38999
- }
39000
- }
39001
- this.#keyMap.delete(k);
39002
- this.#keyList[index] = undefined;
39003
- this.#valList[index] = undefined;
39004
- if (index === this.#tail) {
39005
- this.#tail = this.#prev[index];
39006
- } else if (index === this.#head) {
39007
- this.#head = this.#next[index];
39008
- } else {
39009
- const pi = this.#prev[index];
39010
- this.#next[pi] = this.#next[index];
39011
- const ni = this.#next[index];
39012
- this.#prev[ni] = this.#prev[index];
39013
- }
39014
- this.#size--;
39015
- this.#free.push(index);
39016
- }
39017
- }
39018
- }
39019
- if (this.#hasDisposeAfter && this.#disposed?.length) {
39020
- const dt2 = this.#disposed;
39021
- let task;
39022
- while (task = dt2?.shift()) {
39023
- this.#disposeAfter?.(...task);
39024
- }
39025
- }
39026
- return deleted;
36801
+ return gitPath;
36802
+ };
36803
+ });
36804
+
36805
+ // ../../node_modules/@npmcli/git/lib/spawn.js
36806
+ var require_spawn = __commonJS((exports, module) => {
36807
+ var spawn2 = require_lib6();
36808
+ var promiseRetry = require_promise_retry();
36809
+ var { log } = require_lib3();
36810
+ var makeError = require_make_error();
36811
+ var makeOpts = require_opts();
36812
+ module.exports = (gitArgs, opts = {}) => {
36813
+ const whichGit = require_which();
36814
+ const gitPath = whichGit(opts);
36815
+ if (gitPath instanceof Error) {
36816
+ return Promise.reject(gitPath);
39027
36817
  }
39028
- clear() {
39029
- return this.#clear("delete");
36818
+ const args = opts.allowReplace || gitArgs[0] === "--no-replace-objects" ? gitArgs : ["--no-replace-objects", ...gitArgs];
36819
+ let retryOpts = opts.retry;
36820
+ if (retryOpts === null || retryOpts === undefined) {
36821
+ retryOpts = {
36822
+ retries: opts.fetchRetries || 2,
36823
+ factor: opts.fetchRetryFactor || 10,
36824
+ maxTimeout: opts.fetchRetryMaxtimeout || 60000,
36825
+ minTimeout: opts.fetchRetryMintimeout || 1000
36826
+ };
39030
36827
  }
39031
- #clear(reason) {
39032
- for (const index of this.#rindexes({ allowStale: true })) {
39033
- const v = this.#valList[index];
39034
- if (this.#isBackgroundFetch(v)) {
39035
- v.__abortController.abort(new Error("deleted"));
39036
- } else {
39037
- const k = this.#keyList[index];
39038
- if (this.#hasDispose) {
39039
- this.#dispose?.(v, k, reason);
39040
- }
39041
- if (this.#hasDisposeAfter) {
39042
- this.#disposed?.push([v, k, reason]);
39043
- }
39044
- }
39045
- }
39046
- this.#keyMap.clear();
39047
- this.#valList.fill(undefined);
39048
- this.#keyList.fill(undefined);
39049
- if (this.#ttls && this.#starts) {
39050
- this.#ttls.fill(0);
39051
- this.#starts.fill(0);
39052
- }
39053
- if (this.#sizes) {
39054
- this.#sizes.fill(0);
36828
+ return promiseRetry((retryFn, number) => {
36829
+ if (number !== 1) {
36830
+ log.silly("git", `Retrying git command: ${args.join(" ")} attempt # ${number}`);
39055
36831
  }
39056
- this.#head = 0;
39057
- this.#tail = 0;
39058
- this.#free.length = 0;
39059
- this.#calculatedSize = 0;
39060
- this.#size = 0;
39061
- if (this.#hasDisposeAfter && this.#disposed) {
39062
- const dt2 = this.#disposed;
39063
- let task;
39064
- while (task = dt2?.shift()) {
39065
- this.#disposeAfter?.(...task);
36832
+ return spawn2(gitPath, args, makeOpts(opts)).catch((er) => {
36833
+ const gitError = makeError(er);
36834
+ if (!gitError.shouldRetry(number)) {
36835
+ throw gitError;
39066
36836
  }
39067
- }
39068
- }
39069
- }
39070
- exports.LRUCache = LRUCache2;
36837
+ retryFn(gitError);
36838
+ });
36839
+ }, retryOpts);
36840
+ };
39071
36841
  });
39072
36842
 
39073
36843
  // ../../node_modules/semver/functions/inc.js
@@ -40496,7 +38266,7 @@ var require_lines_to_revs = __commonJS((exports, module) => {
40496
38266
  // ../../node_modules/@npmcli/git/lib/revs.js
40497
38267
  var require_revs = __commonJS((exports, module) => {
40498
38268
  var spawn2 = require_spawn();
40499
- var { LRUCache: LRUCache2 } = require_commonjs7();
38269
+ var { LRUCache: LRUCache2 } = require_commonjs();
40500
38270
  var linesToRevs = require_lines_to_revs();
40501
38271
  var revsCache = new LRUCache2({
40502
38272
  max: 100,
@@ -43237,7 +41007,7 @@ var require_normalize = __commonJS((exports, module) => {
43237
41007
  var _glob;
43238
41008
  function lazyLoadGlob() {
43239
41009
  if (!_glob) {
43240
- _glob = require_commonjs6().glob;
41010
+ _glob = require_commonjs5().glob;
43241
41011
  }
43242
41012
  return _glob;
43243
41013
  }
@@ -230414,11 +228184,11 @@ var require_visit = __commonJS((exports) => {
230414
228184
  visit2.BREAK = BREAK;
230415
228185
  visit2.SKIP = SKIP;
230416
228186
  visit2.REMOVE = REMOVE;
230417
- function visit_(key3, node, visitor, path6) {
230418
- const ctrl = callVisitor(key3, node, visitor, path6);
228187
+ function visit_(key2, node, visitor, path6) {
228188
+ const ctrl = callVisitor(key2, node, visitor, path6);
230419
228189
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
230420
- replaceNode(key3, path6, ctrl);
230421
- return visit_(key3, ctrl, visitor, path6);
228190
+ replaceNode(key2, path6, ctrl);
228191
+ return visit_(key2, ctrl, visitor, path6);
230422
228192
  }
230423
228193
  if (typeof ctrl !== "symbol") {
230424
228194
  if (identity2.isCollection(node)) {
@@ -230462,11 +228232,11 @@ var require_visit = __commonJS((exports) => {
230462
228232
  visitAsync.BREAK = BREAK;
230463
228233
  visitAsync.SKIP = SKIP;
230464
228234
  visitAsync.REMOVE = REMOVE;
230465
- async function visitAsync_(key3, node, visitor, path6) {
230466
- const ctrl = await callVisitor(key3, node, visitor, path6);
228235
+ async function visitAsync_(key2, node, visitor, path6) {
228236
+ const ctrl = await callVisitor(key2, node, visitor, path6);
230467
228237
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
230468
- replaceNode(key3, path6, ctrl);
230469
- return visitAsync_(key3, ctrl, visitor, path6);
228238
+ replaceNode(key2, path6, ctrl);
228239
+ return visitAsync_(key2, ctrl, visitor, path6);
230470
228240
  }
230471
228241
  if (typeof ctrl !== "symbol") {
230472
228242
  if (identity2.isCollection(node)) {
@@ -230516,27 +228286,27 @@ var require_visit = __commonJS((exports) => {
230516
228286
  }
230517
228287
  return visitor;
230518
228288
  }
230519
- function callVisitor(key3, node, visitor, path6) {
228289
+ function callVisitor(key2, node, visitor, path6) {
230520
228290
  if (typeof visitor === "function")
230521
- return visitor(key3, node, path6);
228291
+ return visitor(key2, node, path6);
230522
228292
  if (identity2.isMap(node))
230523
- return visitor.Map?.(key3, node, path6);
228293
+ return visitor.Map?.(key2, node, path6);
230524
228294
  if (identity2.isSeq(node))
230525
- return visitor.Seq?.(key3, node, path6);
228295
+ return visitor.Seq?.(key2, node, path6);
230526
228296
  if (identity2.isPair(node))
230527
- return visitor.Pair?.(key3, node, path6);
228297
+ return visitor.Pair?.(key2, node, path6);
230528
228298
  if (identity2.isScalar(node))
230529
- return visitor.Scalar?.(key3, node, path6);
228299
+ return visitor.Scalar?.(key2, node, path6);
230530
228300
  if (identity2.isAlias(node))
230531
- return visitor.Alias?.(key3, node, path6);
228301
+ return visitor.Alias?.(key2, node, path6);
230532
228302
  return;
230533
228303
  }
230534
- function replaceNode(key3, path6, node) {
228304
+ function replaceNode(key2, path6, node) {
230535
228305
  const parent = path6[path6.length - 1];
230536
228306
  if (identity2.isCollection(parent)) {
230537
- parent.items[key3] = node;
228307
+ parent.items[key2] = node;
230538
228308
  } else if (identity2.isPair(parent)) {
230539
- if (key3 === "key")
228309
+ if (key2 === "key")
230540
228310
  parent.key = node;
230541
228311
  else
230542
228312
  parent.value = node;
@@ -230768,7 +228538,7 @@ var require_anchors = __commonJS((exports) => {
230768
228538
 
230769
228539
  // ../../node_modules/yaml/dist/doc/applyReviver.js
230770
228540
  var require_applyReviver = __commonJS((exports) => {
230771
- function applyReviver(reviver, obj, key3, val) {
228541
+ function applyReviver(reviver, obj, key2, val) {
230772
228542
  if (val && typeof val === "object") {
230773
228543
  if (Array.isArray(val)) {
230774
228544
  for (let i7 = 0, len = val.length;i7 < len; ++i7) {
@@ -230808,7 +228578,7 @@ var require_applyReviver = __commonJS((exports) => {
230808
228578
  }
230809
228579
  }
230810
228580
  }
230811
- return reviver.call(obj, key3, val);
228581
+ return reviver.call(obj, key2, val);
230812
228582
  }
230813
228583
  exports.applyReviver = applyReviver;
230814
228584
  });
@@ -231126,29 +228896,29 @@ var require_Collection = __commonJS((exports) => {
231126
228896
  if (isEmptyPath(path6))
231127
228897
  this.add(value4);
231128
228898
  else {
231129
- const [key3, ...rest] = path6;
231130
- const node = this.get(key3, true);
228899
+ const [key2, ...rest] = path6;
228900
+ const node = this.get(key2, true);
231131
228901
  if (identity2.isCollection(node))
231132
228902
  node.addIn(rest, value4);
231133
228903
  else if (node === undefined && this.schema)
231134
- this.set(key3, collectionFromPath(this.schema, rest, value4));
228904
+ this.set(key2, collectionFromPath(this.schema, rest, value4));
231135
228905
  else
231136
- throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
228906
+ throw new Error(`Expected YAML collection at ${key2}. Remaining path: ${rest}`);
231137
228907
  }
231138
228908
  }
231139
228909
  deleteIn(path6) {
231140
- const [key3, ...rest] = path6;
228910
+ const [key2, ...rest] = path6;
231141
228911
  if (rest.length === 0)
231142
- return this.delete(key3);
231143
- const node = this.get(key3, true);
228912
+ return this.delete(key2);
228913
+ const node = this.get(key2, true);
231144
228914
  if (identity2.isCollection(node))
231145
228915
  return node.deleteIn(rest);
231146
228916
  else
231147
- throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
228917
+ throw new Error(`Expected YAML collection at ${key2}. Remaining path: ${rest}`);
231148
228918
  }
231149
228919
  getIn(path6, keepScalar) {
231150
- const [key3, ...rest] = path6;
231151
- const node = this.get(key3, true);
228920
+ const [key2, ...rest] = path6;
228921
+ const node = this.get(key2, true);
231152
228922
  if (rest.length === 0)
231153
228923
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
231154
228924
  else
@@ -231163,24 +228933,24 @@ var require_Collection = __commonJS((exports) => {
231163
228933
  });
231164
228934
  }
231165
228935
  hasIn(path6) {
231166
- const [key3, ...rest] = path6;
228936
+ const [key2, ...rest] = path6;
231167
228937
  if (rest.length === 0)
231168
- return this.has(key3);
231169
- const node = this.get(key3, true);
228938
+ return this.has(key2);
228939
+ const node = this.get(key2, true);
231170
228940
  return identity2.isCollection(node) ? node.hasIn(rest) : false;
231171
228941
  }
231172
228942
  setIn(path6, value4) {
231173
- const [key3, ...rest] = path6;
228943
+ const [key2, ...rest] = path6;
231174
228944
  if (rest.length === 0) {
231175
- this.set(key3, value4);
228945
+ this.set(key2, value4);
231176
228946
  } else {
231177
- const node = this.get(key3, true);
228947
+ const node = this.get(key2, true);
231178
228948
  if (identity2.isCollection(node))
231179
228949
  node.setIn(rest, value4);
231180
228950
  else if (node === undefined && this.schema)
231181
- this.set(key3, collectionFromPath(this.schema, rest, value4));
228951
+ this.set(key2, collectionFromPath(this.schema, rest, value4));
231182
228952
  else
231183
- throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
228953
+ throw new Error(`Expected YAML collection at ${key2}. Remaining path: ${rest}`);
231184
228954
  }
231185
228955
  }
231186
228956
  }
@@ -231768,19 +229538,19 @@ var require_stringifyPair = __commonJS((exports) => {
231768
229538
  var Scalar = require_Scalar();
231769
229539
  var stringify3 = require_stringify();
231770
229540
  var stringifyComment = require_stringifyComment();
231771
- function stringifyPair2({ key: key3, value: value4 }, ctx, onComment, onChompKeep) {
229541
+ function stringifyPair2({ key: key2, value: value4 }, ctx, onComment, onChompKeep) {
231772
229542
  const { allNullValues, doc, indent: indent2, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
231773
- let keyComment = identity2.isNode(key3) && key3.comment || null;
229543
+ let keyComment = identity2.isNode(key2) && key2.comment || null;
231774
229544
  if (simpleKeys) {
231775
229545
  if (keyComment) {
231776
229546
  throw new Error("With simple keys, key nodes cannot have comments");
231777
229547
  }
231778
- if (identity2.isCollection(key3) || !identity2.isNode(key3) && typeof key3 === "object") {
229548
+ if (identity2.isCollection(key2) || !identity2.isNode(key2) && typeof key2 === "object") {
231779
229549
  const msg = "With simple keys, collection cannot be used as a key value";
231780
229550
  throw new Error(msg);
231781
229551
  }
231782
229552
  }
231783
- let explicitKey = !simpleKeys && (!key3 || keyComment && value4 == null && !ctx.inFlow || identity2.isCollection(key3) || (identity2.isScalar(key3) ? key3.type === Scalar.Scalar.BLOCK_FOLDED || key3.type === Scalar.Scalar.BLOCK_LITERAL : typeof key3 === "object"));
229553
+ let explicitKey = !simpleKeys && (!key2 || keyComment && value4 == null && !ctx.inFlow || identity2.isCollection(key2) || (identity2.isScalar(key2) ? key2.type === Scalar.Scalar.BLOCK_FOLDED || key2.type === Scalar.Scalar.BLOCK_LITERAL : typeof key2 === "object"));
231784
229554
  ctx = Object.assign({}, ctx, {
231785
229555
  allNullValues: false,
231786
229556
  implicitKey: !explicitKey && (simpleKeys || !allNullValues),
@@ -231788,7 +229558,7 @@ var require_stringifyPair = __commonJS((exports) => {
231788
229558
  });
231789
229559
  let keyCommentDone = false;
231790
229560
  let chompKeep = false;
231791
- let str = stringify3.stringify(key3, ctx, () => keyCommentDone = true, () => chompKeep = true);
229561
+ let str = stringify3.stringify(key2, ctx, () => keyCommentDone = true, () => chompKeep = true);
231792
229562
  if (!explicitKey && !ctx.inFlow && str.length > 1024) {
231793
229563
  if (simpleKeys)
231794
229564
  throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
@@ -231932,7 +229702,7 @@ var require_merge = __commonJS((exports) => {
231932
229702
  }),
231933
229703
  stringify: () => MERGE_KEY
231934
229704
  };
231935
- var isMergeKey = (ctx, key3) => (merge3.identify(key3) || identity2.isScalar(key3) && (!key3.type || key3.type === Scalar.Scalar.PLAIN) && merge3.identify(key3.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge3.tag && tag.default);
229705
+ var isMergeKey = (ctx, key2) => (merge3.identify(key2) || identity2.isScalar(key2) && (!key2.type || key2.type === Scalar.Scalar.PLAIN) && merge3.identify(key2.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge3.tag && tag.default);
231936
229706
  function addMergeToJSMap(ctx, map3, value4) {
231937
229707
  value4 = ctx && identity2.isAlias(value4) ? value4.resolve(ctx.doc) : value4;
231938
229708
  if (identity2.isSeq(value4))
@@ -231949,14 +229719,14 @@ var require_merge = __commonJS((exports) => {
231949
229719
  if (!identity2.isMap(source))
231950
229720
  throw new Error("Merge sources must be maps or map aliases");
231951
229721
  const srcMap = source.toJSON(null, ctx, Map);
231952
- for (const [key3, value5] of srcMap) {
229722
+ for (const [key2, value5] of srcMap) {
231953
229723
  if (map3 instanceof Map) {
231954
- if (!map3.has(key3))
231955
- map3.set(key3, value5);
229724
+ if (!map3.has(key2))
229725
+ map3.set(key2, value5);
231956
229726
  } else if (map3 instanceof Set) {
231957
- map3.add(key3);
231958
- } else if (!Object.prototype.hasOwnProperty.call(map3, key3)) {
231959
- Object.defineProperty(map3, key3, {
229727
+ map3.add(key2);
229728
+ } else if (!Object.prototype.hasOwnProperty.call(map3, key2)) {
229729
+ Object.defineProperty(map3, key2, {
231960
229730
  value: value5,
231961
229731
  writable: true,
231962
229732
  enumerable: true,
@@ -231978,19 +229748,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
231978
229748
  var stringify3 = require_stringify();
231979
229749
  var identity2 = require_identity();
231980
229750
  var toJS = require_toJS();
231981
- function addPairToJSMap(ctx, map3, { key: key3, value: value4 }) {
231982
- if (identity2.isNode(key3) && key3.addToJSMap)
231983
- key3.addToJSMap(ctx, map3, value4);
231984
- else if (merge3.isMergeKey(ctx, key3))
229751
+ function addPairToJSMap(ctx, map3, { key: key2, value: value4 }) {
229752
+ if (identity2.isNode(key2) && key2.addToJSMap)
229753
+ key2.addToJSMap(ctx, map3, value4);
229754
+ else if (merge3.isMergeKey(ctx, key2))
231985
229755
  merge3.addMergeToJSMap(ctx, map3, value4);
231986
229756
  else {
231987
- const jsKey = toJS.toJS(key3, "", ctx);
229757
+ const jsKey = toJS.toJS(key2, "", ctx);
231988
229758
  if (map3 instanceof Map) {
231989
229759
  map3.set(jsKey, toJS.toJS(value4, jsKey, ctx));
231990
229760
  } else if (map3 instanceof Set) {
231991
229761
  map3.add(jsKey);
231992
229762
  } else {
231993
- const stringKey = stringifyKey(key3, jsKey, ctx);
229763
+ const stringKey = stringifyKey(key2, jsKey, ctx);
231994
229764
  const jsValue = toJS.toJS(value4, stringKey, ctx);
231995
229765
  if (stringKey in map3)
231996
229766
  Object.defineProperty(map3, stringKey, {
@@ -232005,19 +229775,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
232005
229775
  }
232006
229776
  return map3;
232007
229777
  }
232008
- function stringifyKey(key3, jsKey, ctx) {
229778
+ function stringifyKey(key2, jsKey, ctx) {
232009
229779
  if (jsKey === null)
232010
229780
  return "";
232011
229781
  if (typeof jsKey !== "object")
232012
229782
  return String(jsKey);
232013
- if (identity2.isNode(key3) && ctx?.doc) {
229783
+ if (identity2.isNode(key2) && ctx?.doc) {
232014
229784
  const strCtx = stringify3.createStringifyContext(ctx.doc, {});
232015
229785
  strCtx.anchors = new Set;
232016
229786
  for (const node of ctx.anchors.keys())
232017
229787
  strCtx.anchors.add(node.anchor);
232018
229788
  strCtx.inFlow = true;
232019
229789
  strCtx.inStringifyKey = true;
232020
- const strKey = key3.toString(strCtx);
229790
+ const strKey = key2.toString(strCtx);
232021
229791
  if (!ctx.mapKeyWarned) {
232022
229792
  let jsonStr = JSON.stringify(strKey);
232023
229793
  if (jsonStr.length > 40)
@@ -232038,25 +229808,25 @@ var require_Pair = __commonJS((exports) => {
232038
229808
  var stringifyPair2 = require_stringifyPair();
232039
229809
  var addPairToJSMap = require_addPairToJSMap();
232040
229810
  var identity2 = require_identity();
232041
- function createPair(key3, value4, ctx) {
232042
- const k6 = createNode.createNode(key3, undefined, ctx);
229811
+ function createPair(key2, value4, ctx) {
229812
+ const k6 = createNode.createNode(key2, undefined, ctx);
232043
229813
  const v7 = createNode.createNode(value4, undefined, ctx);
232044
229814
  return new Pair(k6, v7);
232045
229815
  }
232046
229816
 
232047
229817
  class Pair {
232048
- constructor(key3, value4 = null) {
229818
+ constructor(key2, value4 = null) {
232049
229819
  Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.PAIR });
232050
- this.key = key3;
229820
+ this.key = key2;
232051
229821
  this.value = value4;
232052
229822
  }
232053
229823
  clone(schema) {
232054
- let { key: key3, value: value4 } = this;
232055
- if (identity2.isNode(key3))
232056
- key3 = key3.clone(schema);
229824
+ let { key: key2, value: value4 } = this;
229825
+ if (identity2.isNode(key2))
229826
+ key2 = key2.clone(schema);
232057
229827
  if (identity2.isNode(value4))
232058
229828
  value4 = value4.clone(schema);
232059
- return new Pair(key3, value4);
229829
+ return new Pair(key2, value4);
232060
229830
  }
232061
229831
  toJSON(_6, ctx) {
232062
229832
  const pair = ctx?.mapAsMap ? new Map : {};
@@ -232223,11 +229993,11 @@ var require_YAMLMap = __commonJS((exports) => {
232223
229993
  var identity2 = require_identity();
232224
229994
  var Pair = require_Pair();
232225
229995
  var Scalar = require_Scalar();
232226
- function findPair(items, key3) {
232227
- const k6 = identity2.isScalar(key3) ? key3.value : key3;
229996
+ function findPair(items, key2) {
229997
+ const k6 = identity2.isScalar(key2) ? key2.value : key2;
232228
229998
  for (const it2 of items) {
232229
229999
  if (identity2.isPair(it2)) {
232230
- if (it2.key === key3 || it2.key === k6)
230000
+ if (it2.key === key2 || it2.key === k6)
232231
230001
  return it2;
232232
230002
  if (identity2.isScalar(it2.key) && it2.key.value === k6)
232233
230003
  return it2;
@@ -232247,20 +230017,20 @@ var require_YAMLMap = __commonJS((exports) => {
232247
230017
  static from(schema, obj, ctx) {
232248
230018
  const { keepUndefined, replacer } = ctx;
232249
230019
  const map3 = new this(schema);
232250
- const add = (key3, value4) => {
230020
+ const add = (key2, value4) => {
232251
230021
  if (typeof replacer === "function")
232252
- value4 = replacer.call(obj, key3, value4);
232253
- else if (Array.isArray(replacer) && !replacer.includes(key3))
230022
+ value4 = replacer.call(obj, key2, value4);
230023
+ else if (Array.isArray(replacer) && !replacer.includes(key2))
232254
230024
  return;
232255
230025
  if (value4 !== undefined || keepUndefined)
232256
- map3.items.push(Pair.createPair(key3, value4, ctx));
230026
+ map3.items.push(Pair.createPair(key2, value4, ctx));
232257
230027
  };
232258
230028
  if (obj instanceof Map) {
232259
- for (const [key3, value4] of obj)
232260
- add(key3, value4);
230029
+ for (const [key2, value4] of obj)
230030
+ add(key2, value4);
232261
230031
  } else if (obj && typeof obj === "object") {
232262
- for (const key3 of Object.keys(obj))
232263
- add(key3, obj[key3]);
230032
+ for (const key2 of Object.keys(obj))
230033
+ add(key2, obj[key2]);
232264
230034
  }
232265
230035
  if (typeof schema.sortMapEntries === "function") {
232266
230036
  map3.items.sort(schema.sortMapEntries);
@@ -232294,23 +230064,23 @@ var require_YAMLMap = __commonJS((exports) => {
232294
230064
  this.items.push(_pair);
232295
230065
  }
232296
230066
  }
232297
- delete(key3) {
232298
- const it2 = findPair(this.items, key3);
230067
+ delete(key2) {
230068
+ const it2 = findPair(this.items, key2);
232299
230069
  if (!it2)
232300
230070
  return false;
232301
230071
  const del = this.items.splice(this.items.indexOf(it2), 1);
232302
230072
  return del.length > 0;
232303
230073
  }
232304
- get(key3, keepScalar) {
232305
- const it2 = findPair(this.items, key3);
230074
+ get(key2, keepScalar) {
230075
+ const it2 = findPair(this.items, key2);
232306
230076
  const node = it2?.value;
232307
230077
  return (!keepScalar && identity2.isScalar(node) ? node.value : node) ?? undefined;
232308
230078
  }
232309
- has(key3) {
232310
- return !!findPair(this.items, key3);
230079
+ has(key2) {
230080
+ return !!findPair(this.items, key2);
232311
230081
  }
232312
- set(key3, value4) {
232313
- this.add(new Pair.Pair(key3, value4), true);
230082
+ set(key2, value4) {
230083
+ this.add(new Pair.Pair(key2, value4), true);
232314
230084
  }
232315
230085
  toJSON(_6, ctx, Type) {
232316
230086
  const map3 = Type ? new Type : ctx?.mapAsMap ? new Map : {};
@@ -232381,28 +230151,28 @@ var require_YAMLSeq = __commonJS((exports) => {
232381
230151
  add(value4) {
232382
230152
  this.items.push(value4);
232383
230153
  }
232384
- delete(key3) {
232385
- const idx = asItemIndex(key3);
230154
+ delete(key2) {
230155
+ const idx = asItemIndex(key2);
232386
230156
  if (typeof idx !== "number")
232387
230157
  return false;
232388
230158
  const del = this.items.splice(idx, 1);
232389
230159
  return del.length > 0;
232390
230160
  }
232391
- get(key3, keepScalar) {
232392
- const idx = asItemIndex(key3);
230161
+ get(key2, keepScalar) {
230162
+ const idx = asItemIndex(key2);
232393
230163
  if (typeof idx !== "number")
232394
230164
  return;
232395
230165
  const it2 = this.items[idx];
232396
230166
  return !keepScalar && identity2.isScalar(it2) ? it2.value : it2;
232397
230167
  }
232398
- has(key3) {
232399
- const idx = asItemIndex(key3);
230168
+ has(key2) {
230169
+ const idx = asItemIndex(key2);
232400
230170
  return typeof idx === "number" && idx < this.items.length;
232401
230171
  }
232402
- set(key3, value4) {
232403
- const idx = asItemIndex(key3);
230172
+ set(key2, value4) {
230173
+ const idx = asItemIndex(key2);
232404
230174
  if (typeof idx !== "number")
232405
- throw new Error(`Expected a valid index, not ${key3}.`);
230175
+ throw new Error(`Expected a valid index, not ${key2}.`);
232406
230176
  const prev = this.items[idx];
232407
230177
  if (identity2.isScalar(prev) && Scalar.isScalarValue(value4))
232408
230178
  prev.value = value4;
@@ -232436,8 +230206,8 @@ var require_YAMLSeq = __commonJS((exports) => {
232436
230206
  let i7 = 0;
232437
230207
  for (let it2 of obj) {
232438
230208
  if (typeof replacer === "function") {
232439
- const key3 = obj instanceof Set ? it2 : String(i7++);
232440
- it2 = replacer.call(obj, key3, it2);
230209
+ const key2 = obj instanceof Set ? it2 : String(i7++);
230210
+ it2 = replacer.call(obj, key2, it2);
232441
230211
  }
232442
230212
  seq.items.push(createNode.createNode(it2, undefined, ctx));
232443
230213
  }
@@ -232445,8 +230215,8 @@ var require_YAMLSeq = __commonJS((exports) => {
232445
230215
  return seq;
232446
230216
  }
232447
230217
  }
232448
- function asItemIndex(key3) {
232449
- let idx = identity2.isScalar(key3) ? key3.value : key3;
230218
+ function asItemIndex(key2) {
230219
+ let idx = identity2.isScalar(key2) ? key2.value : key2;
232450
230220
  if (idx && typeof idx === "string")
232451
230221
  idx = Number(idx);
232452
230222
  return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
@@ -232820,25 +230590,25 @@ ${cn.comment}` : item.comment;
232820
230590
  for (let it2 of iterable) {
232821
230591
  if (typeof replacer === "function")
232822
230592
  it2 = replacer.call(iterable, String(i7++), it2);
232823
- let key3, value4;
230593
+ let key2, value4;
232824
230594
  if (Array.isArray(it2)) {
232825
230595
  if (it2.length === 2) {
232826
- key3 = it2[0];
230596
+ key2 = it2[0];
232827
230597
  value4 = it2[1];
232828
230598
  } else
232829
230599
  throw new TypeError(`Expected [key, value] tuple: ${it2}`);
232830
230600
  } else if (it2 && it2 instanceof Object) {
232831
230601
  const keys = Object.keys(it2);
232832
230602
  if (keys.length === 1) {
232833
- key3 = keys[0];
232834
- value4 = it2[key3];
230603
+ key2 = keys[0];
230604
+ value4 = it2[key2];
232835
230605
  } else {
232836
230606
  throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
232837
230607
  }
232838
230608
  } else {
232839
- key3 = it2;
230609
+ key2 = it2;
232840
230610
  }
232841
- pairs2.items.push(Pair.createPair(key3, value4, ctx));
230611
+ pairs2.items.push(Pair.createPair(key2, value4, ctx));
232842
230612
  }
232843
230613
  return pairs2;
232844
230614
  }
@@ -232879,16 +230649,16 @@ var require_omap = __commonJS((exports) => {
232879
230649
  if (ctx?.onCreate)
232880
230650
  ctx.onCreate(map3);
232881
230651
  for (const pair of this.items) {
232882
- let key3, value4;
230652
+ let key2, value4;
232883
230653
  if (identity2.isPair(pair)) {
232884
- key3 = toJS.toJS(pair.key, "", ctx);
232885
- value4 = toJS.toJS(pair.value, key3, ctx);
230654
+ key2 = toJS.toJS(pair.key, "", ctx);
230655
+ value4 = toJS.toJS(pair.value, key2, ctx);
232886
230656
  } else {
232887
- key3 = toJS.toJS(pair, "", ctx);
230657
+ key2 = toJS.toJS(pair, "", ctx);
232888
230658
  }
232889
- if (map3.has(key3))
230659
+ if (map3.has(key2))
232890
230660
  throw new Error("Ordered maps must not include duplicate keys");
232891
- map3.set(key3, value4);
230661
+ map3.set(key2, value4);
232892
230662
  }
232893
230663
  return map3;
232894
230664
  }
@@ -232909,12 +230679,12 @@ var require_omap = __commonJS((exports) => {
232909
230679
  resolve(seq, onError) {
232910
230680
  const pairs$1 = pairs.resolvePairs(seq, onError);
232911
230681
  const seenKeys = [];
232912
- for (const { key: key3 } of pairs$1.items) {
232913
- if (identity2.isScalar(key3)) {
232914
- if (seenKeys.includes(key3.value)) {
232915
- onError(`Ordered maps must not include duplicate keys: ${key3.value}`);
230682
+ for (const { key: key2 } of pairs$1.items) {
230683
+ if (identity2.isScalar(key2)) {
230684
+ if (seenKeys.includes(key2.value)) {
230685
+ onError(`Ordered maps must not include duplicate keys: ${key2.value}`);
232916
230686
  } else {
232917
- seenKeys.push(key3.value);
230687
+ seenKeys.push(key2.value);
232918
230688
  }
232919
230689
  }
232920
230690
  }
@@ -233088,30 +230858,30 @@ var require_set = __commonJS((exports) => {
233088
230858
  super(schema);
233089
230859
  this.tag = YAMLSet.tag;
233090
230860
  }
233091
- add(key3) {
230861
+ add(key2) {
233092
230862
  let pair;
233093
- if (identity2.isPair(key3))
233094
- pair = key3;
233095
- else if (key3 && typeof key3 === "object" && "key" in key3 && "value" in key3 && key3.value === null)
233096
- pair = new Pair.Pair(key3.key, null);
230863
+ if (identity2.isPair(key2))
230864
+ pair = key2;
230865
+ else if (key2 && typeof key2 === "object" && "key" in key2 && "value" in key2 && key2.value === null)
230866
+ pair = new Pair.Pair(key2.key, null);
233097
230867
  else
233098
- pair = new Pair.Pair(key3, null);
230868
+ pair = new Pair.Pair(key2, null);
233099
230869
  const prev = YAMLMap.findPair(this.items, pair.key);
233100
230870
  if (!prev)
233101
230871
  this.items.push(pair);
233102
230872
  }
233103
- get(key3, keepPair) {
233104
- const pair = YAMLMap.findPair(this.items, key3);
230873
+ get(key2, keepPair) {
230874
+ const pair = YAMLMap.findPair(this.items, key2);
233105
230875
  return !keepPair && identity2.isPair(pair) ? identity2.isScalar(pair.key) ? pair.key.value : pair.key : pair;
233106
230876
  }
233107
- set(key3, value4) {
230877
+ set(key2, value4) {
233108
230878
  if (typeof value4 !== "boolean")
233109
230879
  throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value4}`);
233110
- const prev = YAMLMap.findPair(this.items, key3);
230880
+ const prev = YAMLMap.findPair(this.items, key2);
233111
230881
  if (prev && !value4) {
233112
230882
  this.items.splice(this.items.indexOf(prev), 1);
233113
230883
  } else if (!prev && value4) {
233114
- this.items.push(new Pair.Pair(key3));
230884
+ this.items.push(new Pair.Pair(key2));
233115
230885
  }
233116
230886
  }
233117
230887
  toJSON(_6, ctx) {
@@ -233346,7 +231116,7 @@ var require_tags = __commonJS((exports) => {
233346
231116
  if (Array.isArray(customTags))
233347
231117
  tags = [];
233348
231118
  else {
233349
- const keys = Array.from(schemas.keys()).filter((key3) => key3 !== "yaml11").map((key3) => JSON.stringify(key3)).join(", ");
231119
+ const keys = Array.from(schemas.keys()).filter((key2) => key2 !== "yaml11").map((key2) => JSON.stringify(key2)).join(", ");
233350
231120
  throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
233351
231121
  }
233352
231122
  }
@@ -233362,7 +231132,7 @@ var require_tags = __commonJS((exports) => {
233362
231132
  const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
233363
231133
  if (!tagObj) {
233364
231134
  const tagName = JSON.stringify(tag);
233365
- const keys = Object.keys(tagsByName).map((key3) => JSON.stringify(key3)).join(", ");
231135
+ const keys = Object.keys(tagsByName).map((key2) => JSON.stringify(key2)).join(", ");
233366
231136
  throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
233367
231137
  }
233368
231138
  if (!tags2.includes(tagObj))
@@ -233597,13 +231367,13 @@ var require_Document = __commonJS((exports) => {
233597
231367
  setAnchors();
233598
231368
  return node;
233599
231369
  }
233600
- createPair(key3, value4, options = {}) {
233601
- const k6 = this.createNode(key3, null, options);
231370
+ createPair(key2, value4, options = {}) {
231371
+ const k6 = this.createNode(key2, null, options);
233602
231372
  const v7 = this.createNode(value4, null, options);
233603
231373
  return new Pair.Pair(k6, v7);
233604
231374
  }
233605
- delete(key3) {
233606
- return assertCollection(this.contents) ? this.contents.delete(key3) : false;
231375
+ delete(key2) {
231376
+ return assertCollection(this.contents) ? this.contents.delete(key2) : false;
233607
231377
  }
233608
231378
  deleteIn(path6) {
233609
231379
  if (Collection.isEmptyPath(path6)) {
@@ -233614,27 +231384,27 @@ var require_Document = __commonJS((exports) => {
233614
231384
  }
233615
231385
  return assertCollection(this.contents) ? this.contents.deleteIn(path6) : false;
233616
231386
  }
233617
- get(key3, keepScalar) {
233618
- return identity2.isCollection(this.contents) ? this.contents.get(key3, keepScalar) : undefined;
231387
+ get(key2, keepScalar) {
231388
+ return identity2.isCollection(this.contents) ? this.contents.get(key2, keepScalar) : undefined;
233619
231389
  }
233620
231390
  getIn(path6, keepScalar) {
233621
231391
  if (Collection.isEmptyPath(path6))
233622
231392
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
233623
231393
  return identity2.isCollection(this.contents) ? this.contents.getIn(path6, keepScalar) : undefined;
233624
231394
  }
233625
- has(key3) {
233626
- return identity2.isCollection(this.contents) ? this.contents.has(key3) : false;
231395
+ has(key2) {
231396
+ return identity2.isCollection(this.contents) ? this.contents.has(key2) : false;
233627
231397
  }
233628
231398
  hasIn(path6) {
233629
231399
  if (Collection.isEmptyPath(path6))
233630
231400
  return this.contents !== undefined;
233631
231401
  return identity2.isCollection(this.contents) ? this.contents.hasIn(path6) : false;
233632
231402
  }
233633
- set(key3, value4) {
231403
+ set(key2, value4) {
233634
231404
  if (this.contents == null) {
233635
- this.contents = Collection.collectionFromPath(this.schema, [key3], value4);
231405
+ this.contents = Collection.collectionFromPath(this.schema, [key2], value4);
233636
231406
  } else if (assertCollection(this.contents)) {
233637
- this.contents.set(key3, value4);
231407
+ this.contents.set(key2, value4);
233638
231408
  }
233639
231409
  }
233640
231410
  setIn(path6, value4) {
@@ -233918,25 +231688,25 @@ var require_resolve_props = __commonJS((exports) => {
233918
231688
 
233919
231689
  // ../../node_modules/yaml/dist/compose/util-contains-newline.js
233920
231690
  var require_util_contains_newline = __commonJS((exports) => {
233921
- function containsNewline(key3) {
233922
- if (!key3)
231691
+ function containsNewline(key2) {
231692
+ if (!key2)
233923
231693
  return null;
233924
- switch (key3.type) {
231694
+ switch (key2.type) {
233925
231695
  case "alias":
233926
231696
  case "scalar":
233927
231697
  case "double-quoted-scalar":
233928
231698
  case "single-quoted-scalar":
233929
- if (key3.source.includes(`
231699
+ if (key2.source.includes(`
233930
231700
  `))
233931
231701
  return true;
233932
- if (key3.end) {
233933
- for (const st2 of key3.end)
231702
+ if (key2.end) {
231703
+ for (const st2 of key2.end)
233934
231704
  if (st2.type === "newline")
233935
231705
  return true;
233936
231706
  }
233937
231707
  return false;
233938
231708
  case "flow-collection":
233939
- for (const it2 of key3.items) {
231709
+ for (const it2 of key2.items) {
233940
231710
  for (const st2 of it2.start)
233941
231711
  if (st2.type === "newline")
233942
231712
  return true;
@@ -234001,10 +231771,10 @@ var require_resolve_block_map = __commonJS((exports) => {
234001
231771
  let offset = bm.offset;
234002
231772
  let commentEnd = null;
234003
231773
  for (const collItem of bm.items) {
234004
- const { start: start3, key: key3, sep: sep3, value: value4 } = collItem;
231774
+ const { start: start3, key: key2, sep: sep3, value: value4 } = collItem;
234005
231775
  const keyProps = resolveProps.resolveProps(start3, {
234006
231776
  indicator: "explicit-key-ind",
234007
- next: key3 ?? sep3?.[0],
231777
+ next: key2 ?? sep3?.[0],
234008
231778
  offset,
234009
231779
  onError,
234010
231780
  parentIndent: bm.indent,
@@ -234012,10 +231782,10 @@ var require_resolve_block_map = __commonJS((exports) => {
234012
231782
  });
234013
231783
  const implicitKey = !keyProps.found;
234014
231784
  if (implicitKey) {
234015
- if (key3) {
234016
- if (key3.type === "block-seq")
231785
+ if (key2) {
231786
+ if (key2.type === "block-seq")
234017
231787
  onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
234018
- else if ("indent" in key3 && key3.indent !== bm.indent)
231788
+ else if ("indent" in key2 && key2.indent !== bm.indent)
234019
231789
  onError(offset, "BAD_INDENT", startColMsg);
234020
231790
  }
234021
231791
  if (!keyProps.anchor && !keyProps.tag && !sep3) {
@@ -234029,17 +231799,17 @@ var require_resolve_block_map = __commonJS((exports) => {
234029
231799
  }
234030
231800
  continue;
234031
231801
  }
234032
- if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key3)) {
234033
- onError(key3 ?? start3[start3.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
231802
+ if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key2)) {
231803
+ onError(key2 ?? start3[start3.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
234034
231804
  }
234035
231805
  } else if (keyProps.found?.indent !== bm.indent) {
234036
231806
  onError(offset, "BAD_INDENT", startColMsg);
234037
231807
  }
234038
231808
  ctx.atKey = true;
234039
231809
  const keyStart = keyProps.end;
234040
- const keyNode = key3 ? composeNode(ctx, key3, keyProps, onError) : composeEmptyNode(ctx, keyStart, start3, null, keyProps, onError);
231810
+ const keyNode = key2 ? composeNode(ctx, key2, keyProps, onError) : composeEmptyNode(ctx, keyStart, start3, null, keyProps, onError);
234041
231811
  if (ctx.schema.compat)
234042
- utilFlowIndentCheck.flowIndentCheck(bm.indent, key3, onError);
231812
+ utilFlowIndentCheck.flowIndentCheck(bm.indent, key2, onError);
234043
231813
  ctx.atKey = false;
234044
231814
  if (utilMapIncludes.mapIncludes(ctx, map3.items, keyNode))
234045
231815
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
@@ -234049,7 +231819,7 @@ var require_resolve_block_map = __commonJS((exports) => {
234049
231819
  offset: keyNode.range[2],
234050
231820
  onError,
234051
231821
  parentIndent: bm.indent,
234052
- startOnNewline: !key3 || key3.type === "block-scalar"
231822
+ startOnNewline: !key2 || key2.type === "block-scalar"
234053
231823
  });
234054
231824
  offset = valueProps.end;
234055
231825
  if (valueProps.found) {
@@ -234205,11 +231975,11 @@ var require_resolve_flow_collection = __commonJS((exports) => {
234205
231975
  let offset = fc.offset + fc.start.source.length;
234206
231976
  for (let i7 = 0;i7 < fc.items.length; ++i7) {
234207
231977
  const collItem = fc.items[i7];
234208
- const { start: start3, key: key3, sep: sep3, value: value4 } = collItem;
231978
+ const { start: start3, key: key2, sep: sep3, value: value4 } = collItem;
234209
231979
  const props = resolveProps.resolveProps(start3, {
234210
231980
  flow: fcName,
234211
231981
  indicator: "explicit-key-ind",
234212
- next: key3 ?? sep3?.[0],
231982
+ next: key2 ?? sep3?.[0],
234213
231983
  offset,
234214
231984
  onError,
234215
231985
  parentIndent: fc.indent,
@@ -234231,8 +232001,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
234231
232001
  offset = props.end;
234232
232002
  continue;
234233
232003
  }
234234
- if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key3))
234235
- onError(key3, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
232004
+ if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key2))
232005
+ onError(key2, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
234236
232006
  }
234237
232007
  if (i7 === 0) {
234238
232008
  if (props.comma)
@@ -234277,8 +232047,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
234277
232047
  } else {
234278
232048
  ctx.atKey = true;
234279
232049
  const keyStart = props.end;
234280
- const keyNode = key3 ? composeNode(ctx, key3, props, onError) : composeEmptyNode(ctx, keyStart, start3, null, props, onError);
234281
- if (isBlock(key3))
232050
+ const keyNode = key2 ? composeNode(ctx, key2, props, onError) : composeEmptyNode(ctx, keyStart, start3, null, props, onError);
232051
+ if (isBlock(key2))
234282
232052
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
234283
232053
  ctx.atKey = false;
234284
232054
  const valueProps = resolveProps.resolveProps(sep3 ?? [], {
@@ -235090,7 +232860,7 @@ var require_composer = __commonJS((exports) => {
235090
232860
  var node_process = __require("node:process");
235091
232861
  var directives4 = require_directives2();
235092
232862
  var Document = require_Document();
235093
- var errors3 = require_errors3();
232863
+ var errors2 = require_errors3();
235094
232864
  var identity2 = require_identity();
235095
232865
  var composeDoc = require_compose_doc();
235096
232866
  var resolveEnd = require_resolve_end();
@@ -235141,9 +232911,9 @@ var require_composer = __commonJS((exports) => {
235141
232911
  this.onError = (source, code2, message, warning) => {
235142
232912
  const pos = getErrorPos(source);
235143
232913
  if (warning)
235144
- this.warnings.push(new errors3.YAMLWarning(pos, code2, message));
232914
+ this.warnings.push(new errors2.YAMLWarning(pos, code2, message));
235145
232915
  else
235146
- this.errors.push(new errors3.YAMLParseError(pos, code2, message));
232916
+ this.errors.push(new errors2.YAMLParseError(pos, code2, message));
235147
232917
  };
235148
232918
  this.directives = new directives4.Directives({ version: options.version || "1.2" });
235149
232919
  this.options = options;
@@ -235227,7 +232997,7 @@ ${cb}` : comment;
235227
232997
  break;
235228
232998
  case "error": {
235229
232999
  const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
235230
- const error5 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
233000
+ const error5 = new errors2.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
235231
233001
  if (this.atDirectives || !this.doc)
235232
233002
  this.errors.push(error5);
235233
233003
  else
@@ -235237,7 +233007,7 @@ ${cb}` : comment;
235237
233007
  case "doc-end": {
235238
233008
  if (!this.doc) {
235239
233009
  const msg = "Unexpected doc-end without preceding document";
235240
- this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
233010
+ this.errors.push(new errors2.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
235241
233011
  break;
235242
233012
  }
235243
233013
  this.doc.directives.docEnd = true;
@@ -235252,7 +233022,7 @@ ${end.comment}` : end.comment;
235252
233022
  break;
235253
233023
  }
235254
233024
  default:
235255
- this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
233025
+ this.errors.push(new errors2.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
235256
233026
  }
235257
233027
  }
235258
233028
  *end(forceDoc = false, endOffset = -1) {
@@ -235278,7 +233048,7 @@ ${end.comment}` : end.comment;
235278
233048
  var require_cst_scalar = __commonJS((exports) => {
235279
233049
  var resolveBlockScalar = require_resolve_block_scalar();
235280
233050
  var resolveFlowScalar = require_resolve_flow_scalar();
235281
- var errors3 = require_errors3();
233051
+ var errors2 = require_errors3();
235282
233052
  var stringifyString = require_stringifyString();
235283
233053
  function resolveAsScalar(token, strict = true, onError) {
235284
233054
  if (token) {
@@ -235287,7 +233057,7 @@ var require_cst_scalar = __commonJS((exports) => {
235287
233057
  if (onError)
235288
233058
  onError(offset, code2, message);
235289
233059
  else
235290
- throw new errors3.YAMLParseError([offset, offset + 1], code2, message);
233060
+ throw new errors2.YAMLParseError([offset, offset + 1], code2, message);
235291
233061
  };
235292
233062
  switch (token.type) {
235293
233063
  case "scalar":
@@ -235401,9 +233171,9 @@ var require_cst_scalar = __commonJS((exports) => {
235401
233171
  if (!addEndtoBlockProps(props, "end" in token ? token.end : undefined))
235402
233172
  props.push({ type: "newline", offset: -1, indent: indent2, source: `
235403
233173
  ` });
235404
- for (const key3 of Object.keys(token))
235405
- if (key3 !== "type" && key3 !== "offset")
235406
- delete token[key3];
233174
+ for (const key2 of Object.keys(token))
233175
+ if (key2 !== "type" && key2 !== "offset")
233176
+ delete token[key2];
235407
233177
  Object.assign(token, { type: "block-scalar", indent: indent2, props, source: body });
235408
233178
  }
235409
233179
  }
@@ -235452,9 +233222,9 @@ var require_cst_scalar = __commonJS((exports) => {
235452
233222
  default: {
235453
233223
  const indent2 = "indent" in token ? token.indent : -1;
235454
233224
  const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st2) => st2.type === "space" || st2.type === "comment" || st2.type === "newline") : [];
235455
- for (const key3 of Object.keys(token))
235456
- if (key3 !== "type" && key3 !== "offset")
235457
- delete token[key3];
233225
+ for (const key2 of Object.keys(token))
233226
+ if (key2 !== "type" && key2 !== "offset")
233227
+ delete token[key2];
235458
233228
  Object.assign(token, { type: type4, indent: indent2, source, end });
235459
233229
  }
235460
233230
  }
@@ -235506,12 +233276,12 @@ var require_cst_stringify = __commonJS((exports) => {
235506
233276
  }
235507
233277
  }
235508
233278
  }
235509
- function stringifyItem({ start: start3, key: key3, sep: sep3, value: value4 }) {
233279
+ function stringifyItem({ start: start3, key: key2, sep: sep3, value: value4 }) {
235510
233280
  let res = "";
235511
233281
  for (const st2 of start3)
235512
233282
  res += st2.source;
235513
- if (key3)
235514
- res += stringifyToken(key3);
233283
+ if (key2)
233284
+ res += stringifyToken(key2);
235515
233285
  if (sep3)
235516
233286
  for (const st2 of sep3)
235517
233287
  res += st2.source;
@@ -236807,7 +234577,7 @@ var require_parser2 = __commonJS((exports) => {
236807
234577
  });
236808
234578
  } else if (isFlowToken(it2.key) && !includesToken(it2.sep, "newline")) {
236809
234579
  const start4 = getFirstKeyStartProps(it2.start);
236810
- const key3 = it2.key;
234580
+ const key2 = it2.key;
236811
234581
  const sep3 = it2.sep;
236812
234582
  sep3.push(this.sourceToken);
236813
234583
  delete it2.key;
@@ -236816,7 +234586,7 @@ var require_parser2 = __commonJS((exports) => {
236816
234586
  type: "block-map",
236817
234587
  offset: this.offset,
236818
234588
  indent: this.indent,
236819
- items: [{ start: start4, key: key3, sep: sep3 }]
234589
+ items: [{ start: start4, key: key2, sep: sep3 }]
236820
234590
  });
236821
234591
  } else if (start3.length > 0) {
236822
234592
  it2.sep = it2.sep.concat(start3, this.sourceToken);
@@ -237149,7 +234919,7 @@ var require_parser2 = __commonJS((exports) => {
237149
234919
  var require_public_api = __commonJS((exports) => {
237150
234920
  var composer = require_composer();
237151
234921
  var Document = require_Document();
237152
- var errors3 = require_errors3();
234922
+ var errors2 = require_errors3();
237153
234923
  var log = require_log();
237154
234924
  var identity2 = require_identity();
237155
234925
  var lineCounter = require_line_counter();
@@ -237166,8 +234936,8 @@ var require_public_api = __commonJS((exports) => {
237166
234936
  const docs = Array.from(composer$1.compose(parser$1.parse(source)));
237167
234937
  if (prettyErrors && lineCounter2)
237168
234938
  for (const doc of docs) {
237169
- doc.errors.forEach(errors3.prettifyError(source, lineCounter2));
237170
- doc.warnings.forEach(errors3.prettifyError(source, lineCounter2));
234939
+ doc.errors.forEach(errors2.prettifyError(source, lineCounter2));
234940
+ doc.warnings.forEach(errors2.prettifyError(source, lineCounter2));
237171
234941
  }
237172
234942
  if (docs.length > 0)
237173
234943
  return docs;
@@ -237182,13 +234952,13 @@ var require_public_api = __commonJS((exports) => {
237182
234952
  if (!doc)
237183
234953
  doc = _doc;
237184
234954
  else if (doc.options.logLevel !== "silent") {
237185
- doc.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
234955
+ doc.errors.push(new errors2.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
237186
234956
  break;
237187
234957
  }
237188
234958
  }
237189
234959
  if (prettyErrors && lineCounter2) {
237190
- doc.errors.forEach(errors3.prettifyError(source, lineCounter2));
237191
- doc.warnings.forEach(errors3.prettifyError(source, lineCounter2));
234960
+ doc.errors.forEach(errors2.prettifyError(source, lineCounter2));
234961
+ doc.warnings.forEach(errors2.prettifyError(source, lineCounter2));
237192
234962
  }
237193
234963
  return doc;
237194
234964
  }
@@ -243017,7 +240787,7 @@ minimatch.unescape = unescape2;
243017
240787
  // ../../node_modules/glob/dist/esm/glob.js
243018
240788
  import { fileURLToPath as fileURLToPath4 } from "node:url";
243019
240789
 
243020
- // ../../node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js
240790
+ // ../../node_modules/lru-cache/dist/esm/index.js
243021
240791
  var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
243022
240792
  var warned = new Set;
243023
240793
  var PROCESS = typeof process === "object" && !!process ? process : {};
@@ -247575,7 +245345,7 @@ function pruneCurrentEnv(currentEnv, env2) {
247575
245345
  var package_default = {
247576
245346
  name: "@settlemint/sdk-cli",
247577
245347
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
247578
- version: "2.2.3-pr09bf4cc8",
245348
+ version: "2.2.3-pr0f5033c1",
247579
245349
  type: "module",
247580
245350
  private: false,
247581
245351
  license: "FSL-1.1-MIT",
@@ -247620,13 +245390,13 @@ var package_default = {
247620
245390
  devDependencies: {
247621
245391
  "@commander-js/extra-typings": "11.1.0",
247622
245392
  commander: "11.1.0",
247623
- "@inquirer/confirm": "5.1.10",
247624
- "@inquirer/input": "4.1.10",
245393
+ "@inquirer/confirm": "5.1.9",
245394
+ "@inquirer/input": "4.1.9",
247625
245395
  "@inquirer/password": "4.0.12",
247626
- "@inquirer/select": "4.2.1",
247627
- "@settlemint/sdk-js": "2.2.3-pr09bf4cc8",
247628
- "@settlemint/sdk-utils": "2.2.3-pr09bf4cc8",
247629
- "@types/node": "22.15.17",
245396
+ "@inquirer/select": "4.2.0",
245397
+ "@settlemint/sdk-js": "2.2.3-pr0f5033c1",
245398
+ "@settlemint/sdk-utils": "2.2.3-pr0f5033c1",
245399
+ "@types/node": "22.15.14",
247630
245400
  "@types/semver": "7.7.0",
247631
245401
  "@types/which": "3.0.4",
247632
245402
  "get-tsconfig": "4.10.0",
@@ -247639,7 +245409,7 @@ var package_default = {
247639
245409
  yoctocolors: "2.1.1"
247640
245410
  },
247641
245411
  peerDependencies: {
247642
- hardhat: "2.24.0"
245412
+ hardhat: "2.23.0"
247643
245413
  },
247644
245414
  peerDependenciesMeta: {
247645
245415
  hardhat: {
@@ -248727,9 +246497,6 @@ function createPrompt(view) {
248727
246497
  cleanups.add(onExit((code, signal2) => {
248728
246498
  reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
248729
246499
  }));
248730
- const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
248731
- rl.on("SIGINT", sigint);
248732
- cleanups.add(() => rl.removeListener("SIGINT", sigint));
248733
246500
  const checkCursorPos = () => screen.checkCursorPos();
248734
246501
  rl.input.on("keypress", checkCursorPos);
248735
246502
  cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
@@ -251057,7 +248824,7 @@ var getPlatformConfigQuery = graphql(`
251057
248824
  disabled
251058
248825
  }
251059
248826
  }
251060
- preDeployedContracts
248827
+ preDeployedAbis
251061
248828
  sdkVersion
251062
248829
  kits {
251063
248830
  id
@@ -254646,473 +252413,20 @@ var esm_default4 = createPrompt((config3, done) => {
254646
252413
  return `${prefix} ${message}${defaultValue} ${formattedValue}`;
254647
252414
  });
254648
252415
 
254649
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/key.js
254650
- var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
254651
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/errors.js
254652
- class AbortPromptError2 extends Error {
254653
- name = "AbortPromptError";
254654
- message = "Prompt was aborted";
254655
- constructor(options) {
254656
- super();
254657
- this.cause = options?.cause;
254658
- }
254659
- }
254660
-
254661
- class CancelPromptError2 extends Error {
254662
- name = "CancelPromptError";
254663
- message = "Prompt was canceled";
254664
- }
254665
-
254666
- class ExitPromptError2 extends Error {
254667
- name = "ExitPromptError";
254668
- }
254669
-
254670
- class HookError2 extends Error {
254671
- name = "HookError";
254672
- }
254673
-
254674
- class ValidationError2 extends Error {
254675
- name = "ValidationError";
254676
- }
254677
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
254678
- import { AsyncResource as AsyncResource5 } from "node:async_hooks";
254679
-
254680
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
254681
- import { AsyncLocalStorage as AsyncLocalStorage2, AsyncResource as AsyncResource4 } from "node:async_hooks";
254682
- var hookStorage2 = new AsyncLocalStorage2;
254683
- function createStore2(rl) {
254684
- const store = {
254685
- rl,
254686
- hooks: [],
254687
- hooksCleanup: [],
254688
- hooksEffect: [],
254689
- index: 0,
254690
- handleChange() {}
254691
- };
254692
- return store;
254693
- }
254694
- function withHooks2(rl, cb) {
254695
- const store = createStore2(rl);
254696
- return hookStorage2.run(store, () => {
254697
- function cycle(render) {
254698
- store.handleChange = () => {
254699
- store.index = 0;
254700
- render();
254701
- };
254702
- store.handleChange();
254703
- }
254704
- return cb(cycle);
254705
- });
254706
- }
254707
- function getStore2() {
254708
- const store = hookStorage2.getStore();
254709
- if (!store) {
254710
- throw new HookError2("[Inquirer] Hook functions can only be called from within a prompt");
254711
- }
254712
- return store;
254713
- }
254714
- function readline3() {
254715
- return getStore2().rl;
254716
- }
254717
- function withUpdates2(fn) {
254718
- const wrapped = (...args) => {
254719
- const store = getStore2();
254720
- let shouldUpdate = false;
254721
- const oldHandleChange = store.handleChange;
254722
- store.handleChange = () => {
254723
- shouldUpdate = true;
254724
- };
254725
- const returnValue = fn(...args);
254726
- if (shouldUpdate) {
254727
- oldHandleChange();
254728
- }
254729
- store.handleChange = oldHandleChange;
254730
- return returnValue;
254731
- };
254732
- return AsyncResource4.bind(wrapped);
254733
- }
254734
- function withPointer2(cb) {
254735
- const store = getStore2();
254736
- const { index } = store;
254737
- const pointer = {
254738
- get() {
254739
- return store.hooks[index];
254740
- },
254741
- set(value4) {
254742
- store.hooks[index] = value4;
254743
- },
254744
- initialized: index in store.hooks
254745
- };
254746
- const returnValue = cb(pointer);
254747
- store.index++;
254748
- return returnValue;
254749
- }
254750
- function handleChange2() {
254751
- getStore2().handleChange();
254752
- }
254753
- var effectScheduler2 = {
254754
- queue(cb) {
254755
- const store = getStore2();
254756
- const { index } = store;
254757
- store.hooksEffect.push(() => {
254758
- store.hooksCleanup[index]?.();
254759
- const cleanFn = cb(readline3());
254760
- if (cleanFn != null && typeof cleanFn !== "function") {
254761
- throw new ValidationError2("useEffect return value must be a cleanup function or nothing.");
254762
- }
254763
- store.hooksCleanup[index] = cleanFn;
254764
- });
254765
- },
254766
- run() {
254767
- const store = getStore2();
254768
- withUpdates2(() => {
254769
- store.hooksEffect.forEach((effect) => {
254770
- effect();
254771
- });
254772
- store.hooksEffect.length = 0;
254773
- })();
254774
- },
254775
- clearAll() {
254776
- const store = getStore2();
254777
- store.hooksCleanup.forEach((cleanFn) => {
254778
- cleanFn?.();
254779
- });
254780
- store.hooksEffect.length = 0;
254781
- store.hooksCleanup.length = 0;
254782
- }
254783
- };
254784
-
254785
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-state.js
254786
- function useState2(defaultValue) {
254787
- return withPointer2((pointer) => {
254788
- const setFn = (newValue) => {
254789
- if (pointer.get() !== newValue) {
254790
- pointer.set(newValue);
254791
- handleChange2();
254792
- }
254793
- };
254794
- if (pointer.initialized) {
254795
- return [pointer.get(), setFn];
254796
- }
254797
- const value4 = typeof defaultValue === "function" ? defaultValue() : defaultValue;
254798
- pointer.set(value4);
254799
- return [value4, setFn];
254800
- });
254801
- }
254802
-
254803
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
254804
- function useEffect2(cb, depArray) {
254805
- withPointer2((pointer) => {
254806
- const oldDeps = pointer.get();
254807
- const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i6) => !Object.is(dep, oldDeps[i6]));
254808
- if (hasChanged) {
254809
- effectScheduler2.queue(cb);
254810
- }
254811
- pointer.set(depArray);
254812
- });
254813
- }
254814
-
254815
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/theme.js
254816
- var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
254817
- var defaultTheme2 = {
254818
- prefix: {
254819
- idle: import_yoctocolors_cjs4.default.blue("?"),
254820
- done: import_yoctocolors_cjs4.default.green(esm_default.tick)
254821
- },
254822
- spinner: {
254823
- interval: 80,
254824
- frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs4.default.yellow(frame))
254825
- },
254826
- style: {
254827
- answer: import_yoctocolors_cjs4.default.cyan,
254828
- message: import_yoctocolors_cjs4.default.bold,
254829
- error: (text2) => import_yoctocolors_cjs4.default.red(`> ${text2}`),
254830
- defaultAnswer: (text2) => import_yoctocolors_cjs4.default.dim(`(${text2})`),
254831
- help: import_yoctocolors_cjs4.default.dim,
254832
- highlight: import_yoctocolors_cjs4.default.cyan,
254833
- key: (text2) => import_yoctocolors_cjs4.default.cyan(import_yoctocolors_cjs4.default.bold(`<${text2}>`))
254834
- }
254835
- };
254836
-
254837
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
254838
- function isPlainObject3(value4) {
254839
- if (typeof value4 !== "object" || value4 === null)
254840
- return false;
254841
- let proto = value4;
254842
- while (Object.getPrototypeOf(proto) !== null) {
254843
- proto = Object.getPrototypeOf(proto);
254844
- }
254845
- return Object.getPrototypeOf(value4) === proto;
254846
- }
254847
- function deepMerge3(...objects) {
254848
- const output = {};
254849
- for (const obj of objects) {
254850
- for (const [key2, value4] of Object.entries(obj)) {
254851
- const prevValue = output[key2];
254852
- output[key2] = isPlainObject3(prevValue) && isPlainObject3(value4) ? deepMerge3(prevValue, value4) : value4;
254853
- }
254854
- }
254855
- return output;
254856
- }
254857
- function makeTheme2(...themes) {
254858
- const themesToMerge = [
254859
- defaultTheme2,
254860
- ...themes.filter((theme) => theme != null)
254861
- ];
254862
- return deepMerge3(...themesToMerge);
254863
- }
254864
-
254865
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
254866
- function usePrefix2({ status = "idle", theme }) {
254867
- const [showLoader, setShowLoader] = useState2(false);
254868
- const [tick, setTick] = useState2(0);
254869
- const { prefix, spinner: spinner2 } = makeTheme2(theme);
254870
- useEffect2(() => {
254871
- if (status === "loading") {
254872
- let tickInterval;
254873
- let inc = -1;
254874
- const delayTimeout = setTimeout(AsyncResource5.bind(() => {
254875
- setShowLoader(true);
254876
- tickInterval = setInterval(AsyncResource5.bind(() => {
254877
- inc = inc + 1;
254878
- setTick(inc % spinner2.frames.length);
254879
- }), spinner2.interval);
254880
- }), 300);
254881
- return () => {
254882
- clearTimeout(delayTimeout);
254883
- clearInterval(tickInterval);
254884
- };
254885
- } else {
254886
- setShowLoader(false);
254887
- }
254888
- }, [status]);
254889
- if (showLoader) {
254890
- return spinner2.frames[tick];
254891
- }
254892
- const iconName = status === "loading" ? "idle" : status;
254893
- return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
254894
- }
254895
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
254896
- function useRef2(val) {
254897
- return useState2({ current: val })[0];
254898
- }
254899
-
254900
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
254901
- function useKeypress2(userHandler) {
254902
- const signal = useRef2(userHandler);
254903
- signal.current = userHandler;
254904
- useEffect2((rl) => {
254905
- let ignore = false;
254906
- const handler = withUpdates2((_input, event) => {
254907
- if (ignore)
254908
- return;
254909
- signal.current(event, rl);
254910
- });
254911
- rl.input.on("keypress", handler);
254912
- return () => {
254913
- ignore = true;
254914
- rl.input.removeListener("keypress", handler);
254915
- };
254916
- }, []);
254917
- }
254918
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/utils.js
254919
- var import_cli_width2 = __toESM(require_cli_width(), 1);
254920
- var import_wrap_ansi2 = __toESM(require_wrap_ansi(), 1);
254921
- function breakLines2(content, width) {
254922
- return content.split(`
254923
- `).flatMap((line) => import_wrap_ansi2.default(line, width, { trim: false, hard: true }).split(`
254924
- `).map((str) => str.trimEnd())).join(`
254925
- `);
254926
- }
254927
- function readlineWidth2() {
254928
- return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
254929
- }
254930
-
254931
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
254932
- var import_mute_stream2 = __toESM(require_lib(), 1);
254933
- import * as readline4 from "node:readline";
254934
- import { AsyncResource as AsyncResource6 } from "node:async_hooks";
254935
-
254936
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
254937
- var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
254938
- import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
254939
- var height2 = (content) => content.split(`
254940
- `).length;
254941
- var lastLine2 = (content) => content.split(`
254942
- `).pop() ?? "";
254943
- function cursorDown2(n6) {
254944
- return n6 > 0 ? import_ansi_escapes3.default.cursorDown(n6) : "";
254945
- }
254946
-
254947
- class ScreenManager2 {
254948
- height = 0;
254949
- extraLinesUnderPrompt = 0;
254950
- cursorPos;
254951
- rl;
254952
- constructor(rl) {
254953
- this.rl = rl;
254954
- this.cursorPos = rl.getCursorPos();
254955
- }
254956
- write(content) {
254957
- this.rl.output.unmute();
254958
- this.rl.output.write(content);
254959
- this.rl.output.mute();
254960
- }
254961
- render(content, bottomContent = "") {
254962
- const promptLine = lastLine2(content);
254963
- const rawPromptLine = stripVTControlCharacters3(promptLine);
254964
- let prompt = rawPromptLine;
254965
- if (this.rl.line.length > 0) {
254966
- prompt = prompt.slice(0, -this.rl.line.length);
254967
- }
254968
- this.rl.setPrompt(prompt);
254969
- this.cursorPos = this.rl.getCursorPos();
254970
- const width = readlineWidth2();
254971
- content = breakLines2(content, width);
254972
- bottomContent = breakLines2(bottomContent, width);
254973
- if (rawPromptLine.length % width === 0) {
254974
- content += `
254975
- `;
254976
- }
254977
- let output = content + (bottomContent ? `
254978
- ` + bottomContent : "");
254979
- const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
254980
- const bottomContentHeight = promptLineUpDiff + (bottomContent ? height2(bottomContent) : 0);
254981
- if (bottomContentHeight > 0)
254982
- output += import_ansi_escapes3.default.cursorUp(bottomContentHeight);
254983
- output += import_ansi_escapes3.default.cursorTo(this.cursorPos.cols);
254984
- this.write(cursorDown2(this.extraLinesUnderPrompt) + import_ansi_escapes3.default.eraseLines(this.height) + output);
254985
- this.extraLinesUnderPrompt = bottomContentHeight;
254986
- this.height = height2(output);
254987
- }
254988
- checkCursorPos() {
254989
- const cursorPos = this.rl.getCursorPos();
254990
- if (cursorPos.cols !== this.cursorPos.cols) {
254991
- this.write(import_ansi_escapes3.default.cursorTo(cursorPos.cols));
254992
- this.cursorPos = cursorPos;
254993
- }
254994
- }
254995
- done({ clearContent }) {
254996
- this.rl.setPrompt("");
254997
- let output = cursorDown2(this.extraLinesUnderPrompt);
254998
- output += clearContent ? import_ansi_escapes3.default.eraseLines(this.height) : `
254999
- `;
255000
- output += import_ansi_escapes3.default.cursorShow;
255001
- this.write(output);
255002
- this.rl.close();
255003
- }
255004
- }
255005
-
255006
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
255007
- class PromisePolyfill2 extends Promise {
255008
- static withResolver() {
255009
- let resolve6;
255010
- let reject;
255011
- const promise = new Promise((res, rej) => {
255012
- resolve6 = res;
255013
- reject = rej;
255014
- });
255015
- return { promise, resolve: resolve6, reject };
255016
- }
255017
- }
255018
-
255019
- // ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
255020
- function getCallSites2() {
255021
- const _prepareStackTrace = Error.prepareStackTrace;
255022
- let result = [];
255023
- try {
255024
- Error.prepareStackTrace = (_5, callSites) => {
255025
- const callSitesWithoutCurrent = callSites.slice(1);
255026
- result = callSitesWithoutCurrent;
255027
- return callSitesWithoutCurrent;
255028
- };
255029
- new Error().stack;
255030
- } catch {
255031
- return result;
255032
- }
255033
- Error.prepareStackTrace = _prepareStackTrace;
255034
- return result;
255035
- }
255036
- function createPrompt2(view) {
255037
- const callSites = getCallSites2();
255038
- const prompt = (config3, context = {}) => {
255039
- const { input = process.stdin, signal } = context;
255040
- const cleanups = new Set;
255041
- const output = new import_mute_stream2.default;
255042
- output.pipe(context.output ?? process.stdout);
255043
- const rl = readline4.createInterface({
255044
- terminal: true,
255045
- input,
255046
- output
255047
- });
255048
- const screen = new ScreenManager2(rl);
255049
- const { promise, resolve: resolve6, reject } = PromisePolyfill2.withResolver();
255050
- const cancel3 = () => reject(new CancelPromptError2);
255051
- if (signal) {
255052
- const abort = () => reject(new AbortPromptError2({ cause: signal.reason }));
255053
- if (signal.aborted) {
255054
- abort();
255055
- return Object.assign(promise, { cancel: cancel3 });
255056
- }
255057
- signal.addEventListener("abort", abort);
255058
- cleanups.add(() => signal.removeEventListener("abort", abort));
255059
- }
255060
- cleanups.add(onExit((code2, signal2) => {
255061
- reject(new ExitPromptError2(`User force closed the prompt with ${code2} ${signal2}`));
255062
- }));
255063
- const checkCursorPos = () => screen.checkCursorPos();
255064
- rl.input.on("keypress", checkCursorPos);
255065
- cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
255066
- return withHooks2(rl, (cycle) => {
255067
- const hooksCleanup = AsyncResource6.bind(() => effectScheduler2.clearAll());
255068
- rl.on("close", hooksCleanup);
255069
- cleanups.add(() => rl.removeListener("close", hooksCleanup));
255070
- cycle(() => {
255071
- try {
255072
- const nextView = view(config3, (value4) => {
255073
- setImmediate(() => resolve6(value4));
255074
- });
255075
- if (nextView === undefined) {
255076
- const callerFilename = callSites[1]?.getFileName();
255077
- throw new Error(`Prompt functions must return a string.
255078
- at ${callerFilename}`);
255079
- }
255080
- const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
255081
- screen.render(content, bottomContent);
255082
- effectScheduler2.run();
255083
- } catch (error5) {
255084
- reject(error5);
255085
- }
255086
- });
255087
- return Object.assign(promise.then((answer) => {
255088
- effectScheduler2.clearAll();
255089
- return answer;
255090
- }, (error5) => {
255091
- effectScheduler2.clearAll();
255092
- throw error5;
255093
- }).finally(() => {
255094
- cleanups.forEach((cleanup) => cleanup());
255095
- screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
255096
- output.end();
255097
- }).then(() => promise), { cancel: cancel3 });
255098
- });
255099
- };
255100
- return prompt;
255101
- }
255102
252416
  // ../../node_modules/@inquirer/password/dist/esm/index.js
255103
- var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
255104
- var esm_default5 = createPrompt2((config3, done) => {
252417
+ var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
252418
+ var esm_default5 = createPrompt((config3, done) => {
255105
252419
  const { validate: validate3 = () => true } = config3;
255106
- const theme = makeTheme2(config3.theme);
255107
- const [status, setStatus] = useState2("idle");
255108
- const [errorMsg, setError] = useState2();
255109
- const [value4, setValue] = useState2("");
255110
- const prefix = usePrefix2({ status, theme });
255111
- useKeypress2(async (key3, rl) => {
252420
+ const theme = makeTheme(config3.theme);
252421
+ const [status, setStatus] = useState("idle");
252422
+ const [errorMsg, setError] = useState();
252423
+ const [value4, setValue] = useState("");
252424
+ const prefix = usePrefix({ status, theme });
252425
+ useKeypress(async (key2, rl) => {
255112
252426
  if (status !== "idle") {
255113
252427
  return;
255114
252428
  }
255115
- if (isEnterKey2(key3)) {
252429
+ if (isEnterKey(key2)) {
255116
252430
  const answer = value4;
255117
252431
  setStatus("loading");
255118
252432
  const isValid2 = await validate3(answer);
@@ -255137,7 +252451,7 @@ var esm_default5 = createPrompt2((config3, done) => {
255137
252451
  const maskChar = typeof config3.mask === "string" ? config3.mask : "*";
255138
252452
  formattedValue = maskChar.repeat(value4.length);
255139
252453
  } else if (status !== "done") {
255140
- helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes4.default.cursorHide}`;
252454
+ helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes3.default.cursorHide}`;
255141
252455
  }
255142
252456
  if (status === "done") {
255143
252457
  formattedValue = theme.style.answer(formattedValue);
@@ -256361,7 +253675,7 @@ var basename2 = function(p6, extension) {
256361
253675
  return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
256362
253676
  };
256363
253677
  // ../../node_modules/defu/dist/defu.mjs
256364
- function isPlainObject4(value4) {
253678
+ function isPlainObject3(value4) {
256365
253679
  if (value4 === null || typeof value4 !== "object") {
256366
253680
  return false;
256367
253681
  }
@@ -256378,27 +253692,27 @@ function isPlainObject4(value4) {
256378
253692
  return true;
256379
253693
  }
256380
253694
  function _defu(baseObject, defaults2, namespace = ".", merger) {
256381
- if (!isPlainObject4(defaults2)) {
253695
+ if (!isPlainObject3(defaults2)) {
256382
253696
  return _defu(baseObject, {}, namespace, merger);
256383
253697
  }
256384
253698
  const object = Object.assign({}, defaults2);
256385
- for (const key3 in baseObject) {
256386
- if (key3 === "__proto__" || key3 === "constructor") {
253699
+ for (const key2 in baseObject) {
253700
+ if (key2 === "__proto__" || key2 === "constructor") {
256387
253701
  continue;
256388
253702
  }
256389
- const value4 = baseObject[key3];
253703
+ const value4 = baseObject[key2];
256390
253704
  if (value4 === null || value4 === undefined) {
256391
253705
  continue;
256392
253706
  }
256393
- if (merger && merger(object, key3, value4, namespace)) {
253707
+ if (merger && merger(object, key2, value4, namespace)) {
256394
253708
  continue;
256395
253709
  }
256396
- if (Array.isArray(value4) && Array.isArray(object[key3])) {
256397
- object[key3] = [...value4, ...object[key3]];
256398
- } else if (isPlainObject4(value4) && isPlainObject4(object[key3])) {
256399
- object[key3] = _defu(value4, object[key3], (namespace ? `${namespace}.` : "") + key3.toString(), merger);
253710
+ if (Array.isArray(value4) && Array.isArray(object[key2])) {
253711
+ object[key2] = [...value4, ...object[key2]];
253712
+ } else if (isPlainObject3(value4) && isPlainObject3(object[key2])) {
253713
+ object[key2] = _defu(value4, object[key2], (namespace ? `${namespace}.` : "") + key2.toString(), merger);
256400
253714
  } else {
256401
- object[key3] = value4;
253715
+ object[key2] = value4;
256402
253716
  }
256403
253717
  }
256404
253718
  return object;
@@ -256407,15 +253721,15 @@ function createDefu(merger) {
256407
253721
  return (...arguments_4) => arguments_4.reduce((p6, c3) => _defu(p6, c3, "", merger), {});
256408
253722
  }
256409
253723
  var defu = createDefu();
256410
- var defuFn = createDefu((object, key3, currentValue) => {
256411
- if (object[key3] !== undefined && typeof currentValue === "function") {
256412
- object[key3] = currentValue(object[key3]);
253724
+ var defuFn = createDefu((object, key2, currentValue) => {
253725
+ if (object[key2] !== undefined && typeof currentValue === "function") {
253726
+ object[key2] = currentValue(object[key2]);
256413
253727
  return true;
256414
253728
  }
256415
253729
  });
256416
- var defuArrayFn = createDefu((object, key3, currentValue) => {
256417
- if (Array.isArray(object[key3]) && typeof currentValue === "function") {
256418
- object[key3] = currentValue(object[key3]);
253730
+ var defuArrayFn = createDefu((object, key2, currentValue) => {
253731
+ if (Array.isArray(object[key2]) && typeof currentValue === "function") {
253732
+ object[key2] = currentValue(object[key2]);
256419
253733
  return true;
256420
253734
  }
256421
253735
  });
@@ -259112,11 +256426,11 @@ function cacheDirectory() {
259112
256426
  }
259113
256427
  function normalizeHeaders(headers = {}) {
259114
256428
  const normalized = {};
259115
- for (const [key3, value4] of Object.entries(headers)) {
256429
+ for (const [key2, value4] of Object.entries(headers)) {
259116
256430
  if (!value4) {
259117
256431
  continue;
259118
256432
  }
259119
- normalized[key3.toLowerCase()] = value4;
256433
+ normalized[key2.toLowerCase()] = value4;
259120
256434
  }
259121
256435
  return normalized;
259122
256436
  }
@@ -260984,9 +258298,9 @@ function smartContractPortalMiddlewareCreateCommand() {
260984
258298
  }
260985
258299
  if (includePredeployedAbis && includePredeployedAbis.length > 0) {
260986
258300
  const platformConfig = await settlemint.platform.config();
260987
- const invalidPredeployedAbis = includePredeployedAbis.filter((abi) => !platformConfig.preDeployedContracts.some((contract) => contract === abi));
258301
+ const invalidPredeployedAbis = includePredeployedAbis.filter((abi) => !platformConfig.preDeployedAbis.some((predeployedAbi) => predeployedAbi === abi));
260988
258302
  if (invalidPredeployedAbis.length > 0) {
260989
- cancel2(`Invalid pre-deployed abis: '${invalidPredeployedAbis.join(", ")}'. Possible values: '${platformConfig.preDeployedContracts.sort().join(", ")}'`);
258303
+ cancel2(`Invalid pre-deployed abis: '${invalidPredeployedAbis.join(", ")}'. Possible values: '${platformConfig.preDeployedAbis.sort().join(", ")}'`);
260990
258304
  }
260991
258305
  }
260992
258306
  const result = await showSpinner(() => settlemint.middleware.create({
@@ -261750,7 +259064,7 @@ function jsonOutput(data) {
261750
259064
  var composer = require_composer();
261751
259065
  var Document = require_Document();
261752
259066
  var Schema = require_Schema();
261753
- var errors3 = require_errors3();
259067
+ var errors2 = require_errors3();
261754
259068
  var Alias = require_Alias();
261755
259069
  var identity2 = require_identity();
261756
259070
  var Pair = require_Pair();
@@ -261766,9 +259080,9 @@ var visit2 = require_visit();
261766
259080
  var $Composer = composer.Composer;
261767
259081
  var $Document = Document.Document;
261768
259082
  var $Schema = Schema.Schema;
261769
- var $YAMLError = errors3.YAMLError;
261770
- var $YAMLParseError = errors3.YAMLParseError;
261771
- var $YAMLWarning = errors3.YAMLWarning;
259083
+ var $YAMLError = errors2.YAMLError;
259084
+ var $YAMLParseError = errors2.YAMLParseError;
259085
+ var $YAMLWarning = errors2.YAMLWarning;
261772
259086
  var $Alias = Alias.Alias;
261773
259087
  var $isAlias = identity2.isAlias;
261774
259088
  var $isCollection = identity2.isCollection;
@@ -261841,7 +259155,7 @@ function configCommand() {
261841
259155
  providerName: provider.name,
261842
259156
  regionName: region.name
261843
259157
  }))).sort((a8, b4) => a8.providerId.localeCompare(b4.providerId) || a8.regionId.localeCompare(b4.regionId)),
261844
- preDeployedContracts: platformConfig.preDeployedContracts.sort()
259158
+ preDeployedAbis: platformConfig.preDeployedAbis.sort()
261845
259159
  };
261846
259160
  if (output === "json") {
261847
259161
  jsonOutput(platformConfigData);
@@ -261851,7 +259165,7 @@ function configCommand() {
261851
259165
  table("Templates (Kits)", platformConfigData.kits);
261852
259166
  table("Use cases (Smart Contract Sets)", platformConfigData.useCases);
261853
259167
  table("Providers and regions", platformConfigData.deploymentEngineTargets);
261854
- list("Pre-deployed abis (Smart Contract Portal)", platformConfigData.preDeployedContracts);
259168
+ list("Pre-deployed abis (Smart Contract Portal)", platformConfigData.preDeployedAbis);
261855
259169
  }
261856
259170
  outro("Platform configuration retrieved");
261857
259171
  });
@@ -262118,7 +259432,7 @@ async function getServicesAndMapResults({
262118
259432
  const application = await settlemint.application.read(applicationUniqueName);
262119
259433
  const services = await servicesSpinner(settlemint, applicationUniqueName, types2);
262120
259434
  const results = (types2 ?? SERVICE_TYPES).filter((serviceType) => !types2 || types2.includes(serviceType)).map((serviceType) => {
262121
- const [_6, labels] = Object.entries(LABELS_MAP).find(([key3, value4]) => value4.command === serviceType) ?? [
259435
+ const [_6, labels] = Object.entries(LABELS_MAP).find(([key2, value4]) => value4.command === serviceType) ?? [
262122
259436
  null,
262123
259437
  { plural: serviceType }
262124
259438
  ];
@@ -262353,11 +259667,11 @@ function createCommand4() {
262353
259667
 
262354
259668
  // src/utils/commands/passthrough-options.ts
262355
259669
  function mapPassthroughOptions(options, command) {
262356
- const optionArgs = Object.entries(options).map(([key3, value4]) => {
259670
+ const optionArgs = Object.entries(options).map(([key2, value4]) => {
262357
259671
  if (value4 === true) {
262358
- return `--${key3}`;
259672
+ return `--${key2}`;
262359
259673
  }
262360
- return `--${key3}=${value4}`;
259674
+ return `--${key2}=${value4}`;
262361
259675
  });
262362
259676
  return [...optionArgs, ...command.args];
262363
259677
  }
@@ -263396,4 +260710,4 @@ async function sdkCliCommand(argv = process.argv) {
263396
260710
  // src/cli.ts
263397
260711
  sdkCliCommand();
263398
260712
 
263399
- //# debugId=50FBDC2A0BADBC1B64756E2164756E21
260713
+ //# debugId=D1AD32A1C09D698564756E2164756E21