likec4 1.48.0 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/__app__/src/likec4.js +5941 -4496
- package/__app__/src/routes/index.js +3 -153
- package/__app__/src/routes/projects.js +21 -1087
- package/__app__/src/routes/single.js +1228 -16
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +4649 -1897
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +169 -141
- package/dist/THIRD-PARTY-LICENSES.md +1769 -0
- package/dist/_chunks/LikeC4.mjs +1154 -202
- package/dist/_chunks/binary.mjs +72 -0
- package/dist/_chunks/index.d.mts +234 -140
- package/dist/_chunks/index2.d.mts +2043 -1828
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +30 -0
- package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -785
- package/dist/_chunks/libs/@chevrotain/utils.mjs +1 -37
- package/dist/_chunks/libs/@hono/mcp.mjs +34 -0
- package/dist/_chunks/libs/@hono/node-server.mjs +1 -436
- package/dist/_chunks/libs/@logtape/logtape.d.mts +741 -0
- package/dist/_chunks/libs/@logtape/logtape.mjs +6 -1354
- package/dist/_chunks/libs/@lume/kiwi.mjs +1 -1355
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +114 -14
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +12 -25105
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -1503
- package/dist/_chunks/libs/@nanostores/react.d.mts +61 -1
- package/dist/_chunks/libs/@nanostores/react.mjs +1 -30
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +1 -10
- package/dist/_chunks/libs/@smithy/util-base64.mjs +1 -100
- package/dist/_chunks/libs/ajv.mjs +1 -777
- package/dist/_chunks/libs/atomically.mjs +1 -362
- package/dist/_chunks/libs/birpc.mjs +1 -201
- package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -850
- package/dist/_chunks/libs/chevrotain.mjs +55 -6229
- package/dist/_chunks/libs/conf.mjs +1 -2258
- package/dist/_chunks/libs/defu.mjs +1 -42
- package/dist/_chunks/libs/esm-env.mjs +1 -5
- package/dist/_chunks/libs/eventemitter3.mjs +1 -243
- package/dist/_chunks/libs/fast-equals.mjs +1 -446
- package/dist/_chunks/libs/find-up-simple.mjs +1 -24
- package/dist/_chunks/libs/get-port.mjs +1 -107
- package/dist/_chunks/libs/is-docker.mjs +1 -26
- package/dist/_chunks/libs/is-error-instance.mjs +1 -26
- package/dist/_chunks/libs/is-inside-container.mjs +1 -20
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
- package/dist/_chunks/libs/isexe.mjs +1 -127
- package/dist/_chunks/libs/json5.mjs +14 -959
- package/dist/_chunks/libs/khroma.mjs +1 -605
- package/dist/_chunks/libs/ky.mjs +2 -807
- package/dist/_chunks/libs/langium.d.mts +2913 -2876
- package/dist/_chunks/libs/langium.mjs +33 -20351
- package/dist/_chunks/libs/merge-error-cause.mjs +2 -746
- package/dist/_chunks/libs/p-limit.mjs +1 -120
- package/dist/_chunks/libs/p-queue.mjs +1 -449
- package/dist/_chunks/libs/package-manager-detector.mjs +1 -559
- package/dist/_chunks/libs/package-up.mjs +1 -10
- package/dist/_chunks/libs/pako.mjs +1 -0
- package/dist/_chunks/libs/parse-ms.mjs +1 -36
- package/dist/_chunks/libs/pathe.mjs +1 -0
- package/dist/_chunks/libs/picomatch.mjs +1 -1673
- package/dist/_chunks/libs/pretty-ms.mjs +1 -80
- package/dist/_chunks/libs/remeda.mjs +2 -690
- package/dist/_chunks/libs/safe-stringify.mjs +1 -21
- package/dist/_chunks/libs/strip-indent.mjs +1 -15
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -88
- package/dist/_chunks/libs/ts-graphviz.mjs +4 -725
- package/dist/_chunks/libs/ufo.mjs +1 -240
- package/dist/_chunks/libs/which.mjs +1 -84
- package/dist/_chunks/libs/word-wrap.mjs +12 -43
- package/dist/_chunks/rolldown-runtime.mjs +1 -48
- package/dist/_chunks/sequence.mjs +1 -0
- package/dist/_chunks/src.mjs +15 -0
- package/dist/_chunks/src2.mjs +499 -0
- package/dist/cli/index.mjs +77 -1952
- package/dist/config/index.d.mts +2 -2
- package/dist/config/index.mjs +1 -6
- package/dist/index.d.mts +150 -7
- package/dist/index.mjs +1 -21
- package/dist/model/builder.mjs +1 -3
- package/dist/model/index.d.mts +57 -3
- package/dist/model/index.mjs +1 -5
- package/dist/vite-plugin/index.d.mts +7 -3
- package/dist/vite-plugin/index.mjs +1 -22
- package/dist/vite-plugin/internal.d.mts +6 -7
- package/dist/vite-plugin/internal.mjs +1 -68
- package/package.json +64 -45
- package/react/{index.d.ts → index.d.mts} +114 -72
- package/react/{index.js → index.mjs} +21320 -22041
- package/react/package.json +2 -5
- package/vite-plugin-modules.d.ts +10 -5
- package/dist/_chunks/LikeC4.d.mts +0 -121
- package/dist/_chunks/config-app.prod.d.mts +0 -18
- package/dist/_chunks/config-app.prod.mjs +0 -188
- package/dist/_chunks/config-webcomponent.prod.mjs +0 -71
- package/dist/_chunks/define-config.mjs +0 -409
- package/dist/_chunks/index3.d.mts +0 -60
- package/dist/_chunks/libs/@chevrotain/gast.mjs +0 -3969
- package/dist/_chunks/libs/hono.mjs +0 -1829
- package/dist/_chunks/libs/nanoid.mjs +0 -29
- package/dist/_chunks/libs/nanostores.d.mts +0 -63
- package/dist/_chunks/libs/nanostores.mjs +0 -198
- package/dist/_chunks/model.mjs +0 -12
- package/dist/_chunks/module.d.mts +0 -71
- package/dist/_chunks/module.mjs +0 -18657
- package/dist/_chunks/plugin.mjs +0 -996
- package/dist/_chunks/sequence-view.mjs +0 -575
- package/dist/_chunks/vite-build.mjs +0 -69
- package/dist/_chunks/vite-dev.mjs +0 -79
- package/dist/_chunks/vite-preview.mjs +0 -27
- package/dist/language/module.d.mts +0 -5
- package/dist/language/module.mjs +0 -20
- package/dist/vite/vite-build.d.mts +0 -26
- package/dist/vite/vite-build.mjs +0 -27
- package/dist/vite/vite-dev.d.mts +0 -34
- package/dist/vite/vite-dev.mjs +0 -29
- package/dist/vite/vite-preview.d.mts +0 -20
- package/dist/vite/vite-preview.mjs +0 -26
- /package/dist/_chunks/{index4.d.mts → libs/@chevrotain/types.d.mts} +0 -0
|
@@ -1,2258 +1 @@
|
|
|
1
|
-
import { s as __toESM, t as __commonJSMin } from "../rolldown-runtime.mjs";
|
|
2
|
-
import { i as require_dist } from "./@modelcontextprotocol/sdk.mjs";
|
|
3
|
-
import { t as writeFileSync } from "./atomically.mjs";
|
|
4
|
-
import { t as require__2020 } from "./ajv.mjs";
|
|
5
|
-
import fs from "node:fs";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import { isDeepStrictEqual } from "node:util";
|
|
8
|
-
import process$1 from "node:process";
|
|
9
|
-
import crypto from "node:crypto";
|
|
10
|
-
import os from "node:os";
|
|
11
|
-
import assert from "node:assert";
|
|
12
|
-
|
|
13
|
-
//#region ../../node_modules/.pnpm/dot-prop@10.1.0/node_modules/dot-prop/index.js
|
|
14
|
-
const isObject = (value) => {
|
|
15
|
-
const type = typeof value;
|
|
16
|
-
return value !== null && (type === "object" || type === "function");
|
|
17
|
-
};
|
|
18
|
-
const disallowedKeys = new Set([
|
|
19
|
-
"__proto__",
|
|
20
|
-
"prototype",
|
|
21
|
-
"constructor"
|
|
22
|
-
]);
|
|
23
|
-
const MAX_ARRAY_INDEX = 1e6;
|
|
24
|
-
const isDigit = (character) => character >= "0" && character <= "9";
|
|
25
|
-
function shouldCoerceToNumber(segment) {
|
|
26
|
-
if (segment === "0") return true;
|
|
27
|
-
if (/^[1-9]\d*$/.test(segment)) {
|
|
28
|
-
const parsedNumber = Number.parseInt(segment, 10);
|
|
29
|
-
return parsedNumber <= Number.MAX_SAFE_INTEGER && parsedNumber <= MAX_ARRAY_INDEX;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
function processSegment(segment, parts) {
|
|
34
|
-
if (disallowedKeys.has(segment)) return false;
|
|
35
|
-
if (segment && shouldCoerceToNumber(segment)) parts.push(Number.parseInt(segment, 10));
|
|
36
|
-
else parts.push(segment);
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
function parsePath(path) {
|
|
40
|
-
if (typeof path !== "string") throw new TypeError(`Expected a string, got ${typeof path}`);
|
|
41
|
-
const parts = [];
|
|
42
|
-
let currentSegment = "";
|
|
43
|
-
let currentPart = "start";
|
|
44
|
-
let isEscaping = false;
|
|
45
|
-
let position = 0;
|
|
46
|
-
for (const character of path) {
|
|
47
|
-
position++;
|
|
48
|
-
if (isEscaping) {
|
|
49
|
-
currentSegment += character;
|
|
50
|
-
isEscaping = false;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (character === "\\") {
|
|
54
|
-
if (currentPart === "index") throw new Error(`Invalid character '${character}' in an index at position ${position}`);
|
|
55
|
-
if (currentPart === "indexEnd") throw new Error(`Invalid character '${character}' after an index at position ${position}`);
|
|
56
|
-
isEscaping = true;
|
|
57
|
-
currentPart = currentPart === "start" ? "property" : currentPart;
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
switch (character) {
|
|
61
|
-
case ".":
|
|
62
|
-
if (currentPart === "index") throw new Error(`Invalid character '${character}' in an index at position ${position}`);
|
|
63
|
-
if (currentPart === "indexEnd") {
|
|
64
|
-
currentPart = "property";
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
if (!processSegment(currentSegment, parts)) return [];
|
|
68
|
-
currentSegment = "";
|
|
69
|
-
currentPart = "property";
|
|
70
|
-
break;
|
|
71
|
-
case "[":
|
|
72
|
-
if (currentPart === "index") throw new Error(`Invalid character '${character}' in an index at position ${position}`);
|
|
73
|
-
if (currentPart === "indexEnd") {
|
|
74
|
-
currentPart = "index";
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
if (currentPart === "property" || currentPart === "start") {
|
|
78
|
-
if ((currentSegment || currentPart === "property") && !processSegment(currentSegment, parts)) return [];
|
|
79
|
-
currentSegment = "";
|
|
80
|
-
}
|
|
81
|
-
currentPart = "index";
|
|
82
|
-
break;
|
|
83
|
-
case "]":
|
|
84
|
-
if (currentPart === "index") {
|
|
85
|
-
if (currentSegment === "") {
|
|
86
|
-
currentSegment = (parts.pop() || "") + "[]";
|
|
87
|
-
currentPart = "property";
|
|
88
|
-
} else {
|
|
89
|
-
const parsedNumber = Number.parseInt(currentSegment, 10);
|
|
90
|
-
if (!Number.isNaN(parsedNumber) && Number.isFinite(parsedNumber) && parsedNumber >= 0 && parsedNumber <= Number.MAX_SAFE_INTEGER && parsedNumber <= MAX_ARRAY_INDEX && currentSegment === String(parsedNumber)) parts.push(parsedNumber);
|
|
91
|
-
else parts.push(currentSegment);
|
|
92
|
-
currentSegment = "";
|
|
93
|
-
currentPart = "indexEnd";
|
|
94
|
-
}
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
if (currentPart === "indexEnd") throw new Error(`Invalid character '${character}' after an index at position ${position}`);
|
|
98
|
-
currentSegment += character;
|
|
99
|
-
break;
|
|
100
|
-
default:
|
|
101
|
-
if (currentPart === "index" && !isDigit(character)) throw new Error(`Invalid character '${character}' in an index at position ${position}`);
|
|
102
|
-
if (currentPart === "indexEnd") throw new Error(`Invalid character '${character}' after an index at position ${position}`);
|
|
103
|
-
if (currentPart === "start") currentPart = "property";
|
|
104
|
-
currentSegment += character;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (isEscaping) currentSegment += "\\";
|
|
108
|
-
switch (currentPart) {
|
|
109
|
-
case "property":
|
|
110
|
-
if (!processSegment(currentSegment, parts)) return [];
|
|
111
|
-
break;
|
|
112
|
-
case "index": throw new Error("Index was not closed");
|
|
113
|
-
case "start":
|
|
114
|
-
parts.push("");
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
return parts;
|
|
118
|
-
}
|
|
119
|
-
function normalizePath(path) {
|
|
120
|
-
if (typeof path === "string") return parsePath(path);
|
|
121
|
-
if (Array.isArray(path)) {
|
|
122
|
-
const normalized = [];
|
|
123
|
-
for (const [index, segment] of path.entries()) {
|
|
124
|
-
if (typeof segment !== "string" && typeof segment !== "number") throw new TypeError(`Expected a string or number for path segment at index ${index}, got ${typeof segment}`);
|
|
125
|
-
if (typeof segment === "number" && !Number.isFinite(segment)) throw new TypeError(`Path segment at index ${index} must be a finite number, got ${segment}`);
|
|
126
|
-
if (disallowedKeys.has(segment)) return [];
|
|
127
|
-
if (typeof segment === "string" && shouldCoerceToNumber(segment)) normalized.push(Number.parseInt(segment, 10));
|
|
128
|
-
else normalized.push(segment);
|
|
129
|
-
}
|
|
130
|
-
return normalized;
|
|
131
|
-
}
|
|
132
|
-
return [];
|
|
133
|
-
}
|
|
134
|
-
function getProperty(object, path, value) {
|
|
135
|
-
if (!isObject(object) || typeof path !== "string" && !Array.isArray(path)) return value === void 0 ? object : value;
|
|
136
|
-
const pathArray = normalizePath(path);
|
|
137
|
-
if (pathArray.length === 0) return value;
|
|
138
|
-
for (let index = 0; index < pathArray.length; index++) {
|
|
139
|
-
const key = pathArray[index];
|
|
140
|
-
object = object[key];
|
|
141
|
-
if (object === void 0 || object === null) {
|
|
142
|
-
if (index !== pathArray.length - 1) return value;
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return object === void 0 ? value : object;
|
|
147
|
-
}
|
|
148
|
-
function setProperty(object, path, value) {
|
|
149
|
-
if (!isObject(object) || typeof path !== "string" && !Array.isArray(path)) return object;
|
|
150
|
-
const root = object;
|
|
151
|
-
const pathArray = normalizePath(path);
|
|
152
|
-
if (pathArray.length === 0) return object;
|
|
153
|
-
for (let index = 0; index < pathArray.length; index++) {
|
|
154
|
-
const key = pathArray[index];
|
|
155
|
-
if (index === pathArray.length - 1) object[key] = value;
|
|
156
|
-
else if (!isObject(object[key])) {
|
|
157
|
-
const shouldCreateArray = typeof pathArray[index + 1] === "number";
|
|
158
|
-
object[key] = shouldCreateArray ? [] : {};
|
|
159
|
-
}
|
|
160
|
-
object = object[key];
|
|
161
|
-
}
|
|
162
|
-
return root;
|
|
163
|
-
}
|
|
164
|
-
function deleteProperty(object, path) {
|
|
165
|
-
if (!isObject(object) || typeof path !== "string" && !Array.isArray(path)) return false;
|
|
166
|
-
const pathArray = normalizePath(path);
|
|
167
|
-
if (pathArray.length === 0) return false;
|
|
168
|
-
for (let index = 0; index < pathArray.length; index++) {
|
|
169
|
-
const key = pathArray[index];
|
|
170
|
-
if (index === pathArray.length - 1) {
|
|
171
|
-
if (!Object.hasOwn(object, key)) return false;
|
|
172
|
-
delete object[key];
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
object = object[key];
|
|
176
|
-
if (!isObject(object)) return false;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function hasProperty(object, path) {
|
|
180
|
-
if (!isObject(object) || typeof path !== "string" && !Array.isArray(path)) return false;
|
|
181
|
-
const pathArray = normalizePath(path);
|
|
182
|
-
if (pathArray.length === 0) return false;
|
|
183
|
-
for (const key of pathArray) {
|
|
184
|
-
if (!isObject(object) || !(key in object)) return false;
|
|
185
|
-
object = object[key];
|
|
186
|
-
}
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region ../../node_modules/.pnpm/env-paths@3.0.0/node_modules/env-paths/index.js
|
|
192
|
-
const homedir = os.homedir();
|
|
193
|
-
const tmpdir$1 = os.tmpdir();
|
|
194
|
-
const { env } = process$1;
|
|
195
|
-
const macos = (name) => {
|
|
196
|
-
const library = path.join(homedir, "Library");
|
|
197
|
-
return {
|
|
198
|
-
data: path.join(library, "Application Support", name),
|
|
199
|
-
config: path.join(library, "Preferences", name),
|
|
200
|
-
cache: path.join(library, "Caches", name),
|
|
201
|
-
log: path.join(library, "Logs", name),
|
|
202
|
-
temp: path.join(tmpdir$1, name)
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
const windows = (name) => {
|
|
206
|
-
const appData = env.APPDATA || path.join(homedir, "AppData", "Roaming");
|
|
207
|
-
const localAppData = env.LOCALAPPDATA || path.join(homedir, "AppData", "Local");
|
|
208
|
-
return {
|
|
209
|
-
data: path.join(localAppData, name, "Data"),
|
|
210
|
-
config: path.join(appData, name, "Config"),
|
|
211
|
-
cache: path.join(localAppData, name, "Cache"),
|
|
212
|
-
log: path.join(localAppData, name, "Log"),
|
|
213
|
-
temp: path.join(tmpdir$1, name)
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
const linux = (name) => {
|
|
217
|
-
const username = path.basename(homedir);
|
|
218
|
-
return {
|
|
219
|
-
data: path.join(env.XDG_DATA_HOME || path.join(homedir, ".local", "share"), name),
|
|
220
|
-
config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, ".config"), name),
|
|
221
|
-
cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, ".cache"), name),
|
|
222
|
-
log: path.join(env.XDG_STATE_HOME || path.join(homedir, ".local", "state"), name),
|
|
223
|
-
temp: path.join(tmpdir$1, username, name)
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
227
|
-
if (typeof name !== "string") throw new TypeError(`Expected a string, got ${typeof name}`);
|
|
228
|
-
if (suffix) name += `-${suffix}`;
|
|
229
|
-
if (process$1.platform === "darwin") return macos(name);
|
|
230
|
-
if (process$1.platform === "win32") return windows(name);
|
|
231
|
-
return linux(name);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region ../../node_modules/.pnpm/mimic-function@5.0.1/node_modules/mimic-function/index.js
|
|
236
|
-
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
237
|
-
if (property === "length" || property === "prototype") return;
|
|
238
|
-
if (property === "arguments" || property === "caller") return;
|
|
239
|
-
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
240
|
-
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
241
|
-
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) return;
|
|
242
|
-
Object.defineProperty(to, property, fromDescriptor);
|
|
243
|
-
};
|
|
244
|
-
const canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
245
|
-
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
246
|
-
};
|
|
247
|
-
const changePrototype = (to, from) => {
|
|
248
|
-
const fromPrototype = Object.getPrototypeOf(from);
|
|
249
|
-
if (fromPrototype === Object.getPrototypeOf(to)) return;
|
|
250
|
-
Object.setPrototypeOf(to, fromPrototype);
|
|
251
|
-
};
|
|
252
|
-
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`;
|
|
253
|
-
const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
254
|
-
const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
255
|
-
const changeToString = (to, from, name) => {
|
|
256
|
-
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
257
|
-
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
258
|
-
Object.defineProperty(newToString, "name", toStringName);
|
|
259
|
-
const { writable, enumerable, configurable } = toStringDescriptor;
|
|
260
|
-
Object.defineProperty(to, "toString", {
|
|
261
|
-
value: newToString,
|
|
262
|
-
writable,
|
|
263
|
-
enumerable,
|
|
264
|
-
configurable
|
|
265
|
-
});
|
|
266
|
-
};
|
|
267
|
-
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
268
|
-
const { name } = to;
|
|
269
|
-
for (const property of Reflect.ownKeys(from)) copyProperty(to, from, property, ignoreNonConfigurable);
|
|
270
|
-
changePrototype(to, from);
|
|
271
|
-
changeToString(to, from, name);
|
|
272
|
-
return to;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region ../../node_modules/.pnpm/debounce-fn@6.0.0/node_modules/debounce-fn/index.js
|
|
277
|
-
const debounceFunction = (inputFunction, options = {}) => {
|
|
278
|
-
if (typeof inputFunction !== "function") throw new TypeError(`Expected the first argument to be a function, got \`${typeof inputFunction}\``);
|
|
279
|
-
const { wait = 0, maxWait = Number.POSITIVE_INFINITY, before = false, after = true } = options;
|
|
280
|
-
if (wait < 0 || maxWait < 0) throw new RangeError("`wait` and `maxWait` must not be negative.");
|
|
281
|
-
if (!before && !after) throw new Error("Both `before` and `after` are false, function wouldn't be called.");
|
|
282
|
-
let timeout;
|
|
283
|
-
let maxTimeout;
|
|
284
|
-
let result;
|
|
285
|
-
const debouncedFunction = function(...arguments_) {
|
|
286
|
-
const context = this;
|
|
287
|
-
const later = () => {
|
|
288
|
-
timeout = void 0;
|
|
289
|
-
if (maxTimeout) {
|
|
290
|
-
clearTimeout(maxTimeout);
|
|
291
|
-
maxTimeout = void 0;
|
|
292
|
-
}
|
|
293
|
-
if (after) result = inputFunction.apply(context, arguments_);
|
|
294
|
-
};
|
|
295
|
-
const maxLater = () => {
|
|
296
|
-
maxTimeout = void 0;
|
|
297
|
-
if (timeout) {
|
|
298
|
-
clearTimeout(timeout);
|
|
299
|
-
timeout = void 0;
|
|
300
|
-
}
|
|
301
|
-
if (after) result = inputFunction.apply(context, arguments_);
|
|
302
|
-
};
|
|
303
|
-
const shouldCallNow = before && !timeout;
|
|
304
|
-
clearTimeout(timeout);
|
|
305
|
-
timeout = setTimeout(later, wait);
|
|
306
|
-
if (maxWait > 0 && maxWait !== Number.POSITIVE_INFINITY && !maxTimeout) maxTimeout = setTimeout(maxLater, maxWait);
|
|
307
|
-
if (shouldCallNow) result = inputFunction.apply(context, arguments_);
|
|
308
|
-
return result;
|
|
309
|
-
};
|
|
310
|
-
mimicFunction(debouncedFunction, inputFunction);
|
|
311
|
-
debouncedFunction.cancel = () => {
|
|
312
|
-
if (timeout) {
|
|
313
|
-
clearTimeout(timeout);
|
|
314
|
-
timeout = void 0;
|
|
315
|
-
}
|
|
316
|
-
if (maxTimeout) {
|
|
317
|
-
clearTimeout(maxTimeout);
|
|
318
|
-
maxTimeout = void 0;
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
return debouncedFunction;
|
|
322
|
-
};
|
|
323
|
-
var debounce_fn_default = debounceFunction;
|
|
324
|
-
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
|
|
327
|
-
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
328
|
-
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
329
|
-
const MAX_LENGTH = 256;
|
|
330
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
331
|
-
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
332
|
-
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
333
|
-
const RELEASE_TYPES = [
|
|
334
|
-
"major",
|
|
335
|
-
"premajor",
|
|
336
|
-
"minor",
|
|
337
|
-
"preminor",
|
|
338
|
-
"patch",
|
|
339
|
-
"prepatch",
|
|
340
|
-
"prerelease"
|
|
341
|
-
];
|
|
342
|
-
module.exports = {
|
|
343
|
-
MAX_LENGTH,
|
|
344
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
345
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
346
|
-
MAX_SAFE_INTEGER,
|
|
347
|
-
RELEASE_TYPES,
|
|
348
|
-
SEMVER_SPEC_VERSION,
|
|
349
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
350
|
-
FLAG_LOOSE: 2
|
|
351
|
-
};
|
|
352
|
-
}));
|
|
353
|
-
|
|
354
|
-
//#endregion
|
|
355
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
|
|
356
|
-
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
357
|
-
const debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
358
|
-
module.exports = debug;
|
|
359
|
-
}));
|
|
360
|
-
|
|
361
|
-
//#endregion
|
|
362
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
|
|
363
|
-
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
364
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
365
|
-
const debug = require_debug();
|
|
366
|
-
exports = module.exports = {};
|
|
367
|
-
const re = exports.re = [];
|
|
368
|
-
const safeRe = exports.safeRe = [];
|
|
369
|
-
const src = exports.src = [];
|
|
370
|
-
const safeSrc = exports.safeSrc = [];
|
|
371
|
-
const t = exports.t = {};
|
|
372
|
-
let R = 0;
|
|
373
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
374
|
-
const safeRegexReplacements = [
|
|
375
|
-
["\\s", 1],
|
|
376
|
-
["\\d", MAX_LENGTH],
|
|
377
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
378
|
-
];
|
|
379
|
-
const makeSafeRegex = (value) => {
|
|
380
|
-
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
381
|
-
return value;
|
|
382
|
-
};
|
|
383
|
-
const createToken = (name, value, isGlobal) => {
|
|
384
|
-
const safe = makeSafeRegex(value);
|
|
385
|
-
const index = R++;
|
|
386
|
-
debug(name, index, value);
|
|
387
|
-
t[name] = index;
|
|
388
|
-
src[index] = value;
|
|
389
|
-
safeSrc[index] = safe;
|
|
390
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
391
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
392
|
-
};
|
|
393
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
394
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
395
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
396
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
397
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
398
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
399
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
400
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
401
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
402
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
403
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
404
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
405
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
406
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
407
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
408
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
409
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
410
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
411
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
412
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
413
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
414
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
415
|
-
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
416
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
417
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
418
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
419
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
420
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
421
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
422
|
-
exports.tildeTrimReplace = "$1~";
|
|
423
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
424
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
425
|
-
createToken("LONECARET", "(?:\\^)");
|
|
426
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
427
|
-
exports.caretTrimReplace = "$1^";
|
|
428
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
429
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
430
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
431
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
432
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
433
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
434
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
435
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
436
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
437
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
438
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
439
|
-
}));
|
|
440
|
-
|
|
441
|
-
//#endregion
|
|
442
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
|
|
443
|
-
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
444
|
-
const looseOption = Object.freeze({ loose: true });
|
|
445
|
-
const emptyOpts = Object.freeze({});
|
|
446
|
-
const parseOptions = (options) => {
|
|
447
|
-
if (!options) return emptyOpts;
|
|
448
|
-
if (typeof options !== "object") return looseOption;
|
|
449
|
-
return options;
|
|
450
|
-
};
|
|
451
|
-
module.exports = parseOptions;
|
|
452
|
-
}));
|
|
453
|
-
|
|
454
|
-
//#endregion
|
|
455
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
|
|
456
|
-
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
457
|
-
const numeric = /^[0-9]+$/;
|
|
458
|
-
const compareIdentifiers = (a, b) => {
|
|
459
|
-
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
460
|
-
const anum = numeric.test(a);
|
|
461
|
-
const bnum = numeric.test(b);
|
|
462
|
-
if (anum && bnum) {
|
|
463
|
-
a = +a;
|
|
464
|
-
b = +b;
|
|
465
|
-
}
|
|
466
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
467
|
-
};
|
|
468
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
469
|
-
module.exports = {
|
|
470
|
-
compareIdentifiers,
|
|
471
|
-
rcompareIdentifiers
|
|
472
|
-
};
|
|
473
|
-
}));
|
|
474
|
-
|
|
475
|
-
//#endregion
|
|
476
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
|
|
477
|
-
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
478
|
-
const debug = require_debug();
|
|
479
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
480
|
-
const { safeRe: re, t } = require_re();
|
|
481
|
-
const parseOptions = require_parse_options();
|
|
482
|
-
const { compareIdentifiers } = require_identifiers();
|
|
483
|
-
var SemVer = class SemVer {
|
|
484
|
-
constructor(version, options) {
|
|
485
|
-
options = parseOptions(options);
|
|
486
|
-
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
487
|
-
else version = version.version;
|
|
488
|
-
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
489
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
490
|
-
debug("SemVer", version, options);
|
|
491
|
-
this.options = options;
|
|
492
|
-
this.loose = !!options.loose;
|
|
493
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
494
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
495
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
496
|
-
this.raw = version;
|
|
497
|
-
this.major = +m[1];
|
|
498
|
-
this.minor = +m[2];
|
|
499
|
-
this.patch = +m[3];
|
|
500
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
501
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
502
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
503
|
-
if (!m[4]) this.prerelease = [];
|
|
504
|
-
else this.prerelease = m[4].split(".").map((id) => {
|
|
505
|
-
if (/^[0-9]+$/.test(id)) {
|
|
506
|
-
const num = +id;
|
|
507
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
508
|
-
}
|
|
509
|
-
return id;
|
|
510
|
-
});
|
|
511
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
512
|
-
this.format();
|
|
513
|
-
}
|
|
514
|
-
format() {
|
|
515
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
516
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
517
|
-
return this.version;
|
|
518
|
-
}
|
|
519
|
-
toString() {
|
|
520
|
-
return this.version;
|
|
521
|
-
}
|
|
522
|
-
compare(other) {
|
|
523
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
524
|
-
if (!(other instanceof SemVer)) {
|
|
525
|
-
if (typeof other === "string" && other === this.version) return 0;
|
|
526
|
-
other = new SemVer(other, this.options);
|
|
527
|
-
}
|
|
528
|
-
if (other.version === this.version) return 0;
|
|
529
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
530
|
-
}
|
|
531
|
-
compareMain(other) {
|
|
532
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
533
|
-
if (this.major < other.major) return -1;
|
|
534
|
-
if (this.major > other.major) return 1;
|
|
535
|
-
if (this.minor < other.minor) return -1;
|
|
536
|
-
if (this.minor > other.minor) return 1;
|
|
537
|
-
if (this.patch < other.patch) return -1;
|
|
538
|
-
if (this.patch > other.patch) return 1;
|
|
539
|
-
return 0;
|
|
540
|
-
}
|
|
541
|
-
comparePre(other) {
|
|
542
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
543
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
544
|
-
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
545
|
-
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
546
|
-
let i = 0;
|
|
547
|
-
do {
|
|
548
|
-
const a = this.prerelease[i];
|
|
549
|
-
const b = other.prerelease[i];
|
|
550
|
-
debug("prerelease compare", i, a, b);
|
|
551
|
-
if (a === void 0 && b === void 0) return 0;
|
|
552
|
-
else if (b === void 0) return 1;
|
|
553
|
-
else if (a === void 0) return -1;
|
|
554
|
-
else if (a === b) continue;
|
|
555
|
-
else return compareIdentifiers(a, b);
|
|
556
|
-
} while (++i);
|
|
557
|
-
}
|
|
558
|
-
compareBuild(other) {
|
|
559
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
560
|
-
let i = 0;
|
|
561
|
-
do {
|
|
562
|
-
const a = this.build[i];
|
|
563
|
-
const b = other.build[i];
|
|
564
|
-
debug("build compare", i, a, b);
|
|
565
|
-
if (a === void 0 && b === void 0) return 0;
|
|
566
|
-
else if (b === void 0) return 1;
|
|
567
|
-
else if (a === void 0) return -1;
|
|
568
|
-
else if (a === b) continue;
|
|
569
|
-
else return compareIdentifiers(a, b);
|
|
570
|
-
} while (++i);
|
|
571
|
-
}
|
|
572
|
-
inc(release, identifier, identifierBase) {
|
|
573
|
-
if (release.startsWith("pre")) {
|
|
574
|
-
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
575
|
-
if (identifier) {
|
|
576
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
577
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
switch (release) {
|
|
581
|
-
case "premajor":
|
|
582
|
-
this.prerelease.length = 0;
|
|
583
|
-
this.patch = 0;
|
|
584
|
-
this.minor = 0;
|
|
585
|
-
this.major++;
|
|
586
|
-
this.inc("pre", identifier, identifierBase);
|
|
587
|
-
break;
|
|
588
|
-
case "preminor":
|
|
589
|
-
this.prerelease.length = 0;
|
|
590
|
-
this.patch = 0;
|
|
591
|
-
this.minor++;
|
|
592
|
-
this.inc("pre", identifier, identifierBase);
|
|
593
|
-
break;
|
|
594
|
-
case "prepatch":
|
|
595
|
-
this.prerelease.length = 0;
|
|
596
|
-
this.inc("patch", identifier, identifierBase);
|
|
597
|
-
this.inc("pre", identifier, identifierBase);
|
|
598
|
-
break;
|
|
599
|
-
case "prerelease":
|
|
600
|
-
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
601
|
-
this.inc("pre", identifier, identifierBase);
|
|
602
|
-
break;
|
|
603
|
-
case "release":
|
|
604
|
-
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
605
|
-
this.prerelease.length = 0;
|
|
606
|
-
break;
|
|
607
|
-
case "major":
|
|
608
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
609
|
-
this.minor = 0;
|
|
610
|
-
this.patch = 0;
|
|
611
|
-
this.prerelease = [];
|
|
612
|
-
break;
|
|
613
|
-
case "minor":
|
|
614
|
-
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
615
|
-
this.patch = 0;
|
|
616
|
-
this.prerelease = [];
|
|
617
|
-
break;
|
|
618
|
-
case "patch":
|
|
619
|
-
if (this.prerelease.length === 0) this.patch++;
|
|
620
|
-
this.prerelease = [];
|
|
621
|
-
break;
|
|
622
|
-
case "pre": {
|
|
623
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
624
|
-
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
625
|
-
else {
|
|
626
|
-
let i = this.prerelease.length;
|
|
627
|
-
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
628
|
-
this.prerelease[i]++;
|
|
629
|
-
i = -2;
|
|
630
|
-
}
|
|
631
|
-
if (i === -1) {
|
|
632
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
633
|
-
this.prerelease.push(base);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
if (identifier) {
|
|
637
|
-
let prerelease = [identifier, base];
|
|
638
|
-
if (identifierBase === false) prerelease = [identifier];
|
|
639
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
640
|
-
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
641
|
-
} else this.prerelease = prerelease;
|
|
642
|
-
}
|
|
643
|
-
break;
|
|
644
|
-
}
|
|
645
|
-
default: throw new Error(`invalid increment argument: ${release}`);
|
|
646
|
-
}
|
|
647
|
-
this.raw = this.format();
|
|
648
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
649
|
-
return this;
|
|
650
|
-
}
|
|
651
|
-
};
|
|
652
|
-
module.exports = SemVer;
|
|
653
|
-
}));
|
|
654
|
-
|
|
655
|
-
//#endregion
|
|
656
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js
|
|
657
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
658
|
-
const SemVer = require_semver$1();
|
|
659
|
-
const parse = (version, options, throwErrors = false) => {
|
|
660
|
-
if (version instanceof SemVer) return version;
|
|
661
|
-
try {
|
|
662
|
-
return new SemVer(version, options);
|
|
663
|
-
} catch (er) {
|
|
664
|
-
if (!throwErrors) return null;
|
|
665
|
-
throw er;
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
module.exports = parse;
|
|
669
|
-
}));
|
|
670
|
-
|
|
671
|
-
//#endregion
|
|
672
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
|
|
673
|
-
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
674
|
-
const parse = require_parse();
|
|
675
|
-
const valid = (version, options) => {
|
|
676
|
-
const v = parse(version, options);
|
|
677
|
-
return v ? v.version : null;
|
|
678
|
-
};
|
|
679
|
-
module.exports = valid;
|
|
680
|
-
}));
|
|
681
|
-
|
|
682
|
-
//#endregion
|
|
683
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
|
|
684
|
-
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
685
|
-
const parse = require_parse();
|
|
686
|
-
const clean = (version, options) => {
|
|
687
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
688
|
-
return s ? s.version : null;
|
|
689
|
-
};
|
|
690
|
-
module.exports = clean;
|
|
691
|
-
}));
|
|
692
|
-
|
|
693
|
-
//#endregion
|
|
694
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js
|
|
695
|
-
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
696
|
-
const SemVer = require_semver$1();
|
|
697
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
698
|
-
if (typeof options === "string") {
|
|
699
|
-
identifierBase = identifier;
|
|
700
|
-
identifier = options;
|
|
701
|
-
options = void 0;
|
|
702
|
-
}
|
|
703
|
-
try {
|
|
704
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
705
|
-
} catch (er) {
|
|
706
|
-
return null;
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
module.exports = inc;
|
|
710
|
-
}));
|
|
711
|
-
|
|
712
|
-
//#endregion
|
|
713
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
|
|
714
|
-
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
715
|
-
const parse = require_parse();
|
|
716
|
-
const diff = (version1, version2) => {
|
|
717
|
-
const v1 = parse(version1, null, true);
|
|
718
|
-
const v2 = parse(version2, null, true);
|
|
719
|
-
const comparison = v1.compare(v2);
|
|
720
|
-
if (comparison === 0) return null;
|
|
721
|
-
const v1Higher = comparison > 0;
|
|
722
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
723
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
724
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
725
|
-
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
726
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
727
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
728
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
729
|
-
return "patch";
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
const prefix = highHasPre ? "pre" : "";
|
|
733
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
734
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
735
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
736
|
-
return "prerelease";
|
|
737
|
-
};
|
|
738
|
-
module.exports = diff;
|
|
739
|
-
}));
|
|
740
|
-
|
|
741
|
-
//#endregion
|
|
742
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js
|
|
743
|
-
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
744
|
-
const SemVer = require_semver$1();
|
|
745
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
746
|
-
module.exports = major;
|
|
747
|
-
}));
|
|
748
|
-
|
|
749
|
-
//#endregion
|
|
750
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js
|
|
751
|
-
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
752
|
-
const SemVer = require_semver$1();
|
|
753
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
754
|
-
module.exports = minor;
|
|
755
|
-
}));
|
|
756
|
-
|
|
757
|
-
//#endregion
|
|
758
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js
|
|
759
|
-
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
760
|
-
const SemVer = require_semver$1();
|
|
761
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
762
|
-
module.exports = patch;
|
|
763
|
-
}));
|
|
764
|
-
|
|
765
|
-
//#endregion
|
|
766
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
|
|
767
|
-
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
768
|
-
const parse = require_parse();
|
|
769
|
-
const prerelease = (version, options) => {
|
|
770
|
-
const parsed = parse(version, options);
|
|
771
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
772
|
-
};
|
|
773
|
-
module.exports = prerelease;
|
|
774
|
-
}));
|
|
775
|
-
|
|
776
|
-
//#endregion
|
|
777
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js
|
|
778
|
-
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
779
|
-
const SemVer = require_semver$1();
|
|
780
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
781
|
-
module.exports = compare;
|
|
782
|
-
}));
|
|
783
|
-
|
|
784
|
-
//#endregion
|
|
785
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js
|
|
786
|
-
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
787
|
-
const compare = require_compare();
|
|
788
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
789
|
-
module.exports = rcompare;
|
|
790
|
-
}));
|
|
791
|
-
|
|
792
|
-
//#endregion
|
|
793
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js
|
|
794
|
-
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
795
|
-
const compare = require_compare();
|
|
796
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
797
|
-
module.exports = compareLoose;
|
|
798
|
-
}));
|
|
799
|
-
|
|
800
|
-
//#endregion
|
|
801
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js
|
|
802
|
-
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
803
|
-
const SemVer = require_semver$1();
|
|
804
|
-
const compareBuild = (a, b, loose) => {
|
|
805
|
-
const versionA = new SemVer(a, loose);
|
|
806
|
-
const versionB = new SemVer(b, loose);
|
|
807
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
808
|
-
};
|
|
809
|
-
module.exports = compareBuild;
|
|
810
|
-
}));
|
|
811
|
-
|
|
812
|
-
//#endregion
|
|
813
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js
|
|
814
|
-
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
815
|
-
const compareBuild = require_compare_build();
|
|
816
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
817
|
-
module.exports = sort;
|
|
818
|
-
}));
|
|
819
|
-
|
|
820
|
-
//#endregion
|
|
821
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js
|
|
822
|
-
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
823
|
-
const compareBuild = require_compare_build();
|
|
824
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
825
|
-
module.exports = rsort;
|
|
826
|
-
}));
|
|
827
|
-
|
|
828
|
-
//#endregion
|
|
829
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js
|
|
830
|
-
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
831
|
-
const compare = require_compare();
|
|
832
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
833
|
-
module.exports = gt;
|
|
834
|
-
}));
|
|
835
|
-
|
|
836
|
-
//#endregion
|
|
837
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js
|
|
838
|
-
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
839
|
-
const compare = require_compare();
|
|
840
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
841
|
-
module.exports = lt;
|
|
842
|
-
}));
|
|
843
|
-
|
|
844
|
-
//#endregion
|
|
845
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js
|
|
846
|
-
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
847
|
-
const compare = require_compare();
|
|
848
|
-
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
849
|
-
module.exports = eq;
|
|
850
|
-
}));
|
|
851
|
-
|
|
852
|
-
//#endregion
|
|
853
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js
|
|
854
|
-
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
855
|
-
const compare = require_compare();
|
|
856
|
-
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
857
|
-
module.exports = neq;
|
|
858
|
-
}));
|
|
859
|
-
|
|
860
|
-
//#endregion
|
|
861
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js
|
|
862
|
-
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
863
|
-
const compare = require_compare();
|
|
864
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
865
|
-
module.exports = gte;
|
|
866
|
-
}));
|
|
867
|
-
|
|
868
|
-
//#endregion
|
|
869
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js
|
|
870
|
-
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
871
|
-
const compare = require_compare();
|
|
872
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
873
|
-
module.exports = lte;
|
|
874
|
-
}));
|
|
875
|
-
|
|
876
|
-
//#endregion
|
|
877
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js
|
|
878
|
-
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
879
|
-
const eq = require_eq();
|
|
880
|
-
const neq = require_neq();
|
|
881
|
-
const gt = require_gt();
|
|
882
|
-
const gte = require_gte();
|
|
883
|
-
const lt = require_lt();
|
|
884
|
-
const lte = require_lte();
|
|
885
|
-
const cmp = (a, op, b, loose) => {
|
|
886
|
-
switch (op) {
|
|
887
|
-
case "===":
|
|
888
|
-
if (typeof a === "object") a = a.version;
|
|
889
|
-
if (typeof b === "object") b = b.version;
|
|
890
|
-
return a === b;
|
|
891
|
-
case "!==":
|
|
892
|
-
if (typeof a === "object") a = a.version;
|
|
893
|
-
if (typeof b === "object") b = b.version;
|
|
894
|
-
return a !== b;
|
|
895
|
-
case "":
|
|
896
|
-
case "=":
|
|
897
|
-
case "==": return eq(a, b, loose);
|
|
898
|
-
case "!=": return neq(a, b, loose);
|
|
899
|
-
case ">": return gt(a, b, loose);
|
|
900
|
-
case ">=": return gte(a, b, loose);
|
|
901
|
-
case "<": return lt(a, b, loose);
|
|
902
|
-
case "<=": return lte(a, b, loose);
|
|
903
|
-
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
module.exports = cmp;
|
|
907
|
-
}));
|
|
908
|
-
|
|
909
|
-
//#endregion
|
|
910
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js
|
|
911
|
-
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
912
|
-
const SemVer = require_semver$1();
|
|
913
|
-
const parse = require_parse();
|
|
914
|
-
const { safeRe: re, t } = require_re();
|
|
915
|
-
const coerce = (version, options) => {
|
|
916
|
-
if (version instanceof SemVer) return version;
|
|
917
|
-
if (typeof version === "number") version = String(version);
|
|
918
|
-
if (typeof version !== "string") return null;
|
|
919
|
-
options = options || {};
|
|
920
|
-
let match = null;
|
|
921
|
-
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
922
|
-
else {
|
|
923
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
924
|
-
let next;
|
|
925
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
926
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
927
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
928
|
-
}
|
|
929
|
-
coerceRtlRegex.lastIndex = -1;
|
|
930
|
-
}
|
|
931
|
-
if (match === null) return null;
|
|
932
|
-
const major = match[2];
|
|
933
|
-
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
934
|
-
};
|
|
935
|
-
module.exports = coerce;
|
|
936
|
-
}));
|
|
937
|
-
|
|
938
|
-
//#endregion
|
|
939
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js
|
|
940
|
-
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
941
|
-
var LRUCache = class {
|
|
942
|
-
constructor() {
|
|
943
|
-
this.max = 1e3;
|
|
944
|
-
this.map = /* @__PURE__ */ new Map();
|
|
945
|
-
}
|
|
946
|
-
get(key) {
|
|
947
|
-
const value = this.map.get(key);
|
|
948
|
-
if (value === void 0) return;
|
|
949
|
-
else {
|
|
950
|
-
this.map.delete(key);
|
|
951
|
-
this.map.set(key, value);
|
|
952
|
-
return value;
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
delete(key) {
|
|
956
|
-
return this.map.delete(key);
|
|
957
|
-
}
|
|
958
|
-
set(key, value) {
|
|
959
|
-
if (!this.delete(key) && value !== void 0) {
|
|
960
|
-
if (this.map.size >= this.max) {
|
|
961
|
-
const firstKey = this.map.keys().next().value;
|
|
962
|
-
this.delete(firstKey);
|
|
963
|
-
}
|
|
964
|
-
this.map.set(key, value);
|
|
965
|
-
}
|
|
966
|
-
return this;
|
|
967
|
-
}
|
|
968
|
-
};
|
|
969
|
-
module.exports = LRUCache;
|
|
970
|
-
}));
|
|
971
|
-
|
|
972
|
-
//#endregion
|
|
973
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js
|
|
974
|
-
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
975
|
-
const SPACE_CHARACTERS = /\s+/g;
|
|
976
|
-
var Range = class Range {
|
|
977
|
-
constructor(range, options) {
|
|
978
|
-
options = parseOptions(options);
|
|
979
|
-
if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
980
|
-
else return new Range(range.raw, options);
|
|
981
|
-
if (range instanceof Comparator) {
|
|
982
|
-
this.raw = range.value;
|
|
983
|
-
this.set = [[range]];
|
|
984
|
-
this.formatted = void 0;
|
|
985
|
-
return this;
|
|
986
|
-
}
|
|
987
|
-
this.options = options;
|
|
988
|
-
this.loose = !!options.loose;
|
|
989
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
990
|
-
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
991
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
992
|
-
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
993
|
-
if (this.set.length > 1) {
|
|
994
|
-
const first = this.set[0];
|
|
995
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
996
|
-
if (this.set.length === 0) this.set = [first];
|
|
997
|
-
else if (this.set.length > 1) {
|
|
998
|
-
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
999
|
-
this.set = [c];
|
|
1000
|
-
break;
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
this.formatted = void 0;
|
|
1005
|
-
}
|
|
1006
|
-
get range() {
|
|
1007
|
-
if (this.formatted === void 0) {
|
|
1008
|
-
this.formatted = "";
|
|
1009
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
1010
|
-
if (i > 0) this.formatted += "||";
|
|
1011
|
-
const comps = this.set[i];
|
|
1012
|
-
for (let k = 0; k < comps.length; k++) {
|
|
1013
|
-
if (k > 0) this.formatted += " ";
|
|
1014
|
-
this.formatted += comps[k].toString().trim();
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
return this.formatted;
|
|
1019
|
-
}
|
|
1020
|
-
format() {
|
|
1021
|
-
return this.range;
|
|
1022
|
-
}
|
|
1023
|
-
toString() {
|
|
1024
|
-
return this.range;
|
|
1025
|
-
}
|
|
1026
|
-
parseRange(range) {
|
|
1027
|
-
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
1028
|
-
const cached = cache.get(memoKey);
|
|
1029
|
-
if (cached) return cached;
|
|
1030
|
-
const loose = this.options.loose;
|
|
1031
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1032
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1033
|
-
debug("hyphen replace", range);
|
|
1034
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1035
|
-
debug("comparator trim", range);
|
|
1036
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1037
|
-
debug("tilde trim", range);
|
|
1038
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1039
|
-
debug("caret trim", range);
|
|
1040
|
-
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1041
|
-
if (loose) rangeList = rangeList.filter((comp) => {
|
|
1042
|
-
debug("loose invalid filter", comp, this.options);
|
|
1043
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1044
|
-
});
|
|
1045
|
-
debug("range list", rangeList);
|
|
1046
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
|
1047
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
1048
|
-
for (const comp of comparators) {
|
|
1049
|
-
if (isNullSet(comp)) return [comp];
|
|
1050
|
-
rangeMap.set(comp.value, comp);
|
|
1051
|
-
}
|
|
1052
|
-
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
1053
|
-
const result = [...rangeMap.values()];
|
|
1054
|
-
cache.set(memoKey, result);
|
|
1055
|
-
return result;
|
|
1056
|
-
}
|
|
1057
|
-
intersects(range, options) {
|
|
1058
|
-
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
1059
|
-
return this.set.some((thisComparators) => {
|
|
1060
|
-
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1061
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1062
|
-
return rangeComparators.every((rangeComparator) => {
|
|
1063
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
1064
|
-
});
|
|
1065
|
-
});
|
|
1066
|
-
});
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
test(version) {
|
|
1070
|
-
if (!version) return false;
|
|
1071
|
-
if (typeof version === "string") try {
|
|
1072
|
-
version = new SemVer(version, this.options);
|
|
1073
|
-
} catch (er) {
|
|
1074
|
-
return false;
|
|
1075
|
-
}
|
|
1076
|
-
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
1077
|
-
return false;
|
|
1078
|
-
}
|
|
1079
|
-
};
|
|
1080
|
-
module.exports = Range;
|
|
1081
|
-
const cache = new (require_lrucache())();
|
|
1082
|
-
const parseOptions = require_parse_options();
|
|
1083
|
-
const Comparator = require_comparator();
|
|
1084
|
-
const debug = require_debug();
|
|
1085
|
-
const SemVer = require_semver$1();
|
|
1086
|
-
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
1087
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1088
|
-
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
1089
|
-
const isAny = (c) => c.value === "";
|
|
1090
|
-
const isSatisfiable = (comparators, options) => {
|
|
1091
|
-
let result = true;
|
|
1092
|
-
const remainingComparators = comparators.slice();
|
|
1093
|
-
let testComparator = remainingComparators.pop();
|
|
1094
|
-
while (result && remainingComparators.length) {
|
|
1095
|
-
result = remainingComparators.every((otherComparator) => {
|
|
1096
|
-
return testComparator.intersects(otherComparator, options);
|
|
1097
|
-
});
|
|
1098
|
-
testComparator = remainingComparators.pop();
|
|
1099
|
-
}
|
|
1100
|
-
return result;
|
|
1101
|
-
};
|
|
1102
|
-
const parseComparator = (comp, options) => {
|
|
1103
|
-
comp = comp.replace(re[t.BUILD], "");
|
|
1104
|
-
debug("comp", comp, options);
|
|
1105
|
-
comp = replaceCarets(comp, options);
|
|
1106
|
-
debug("caret", comp);
|
|
1107
|
-
comp = replaceTildes(comp, options);
|
|
1108
|
-
debug("tildes", comp);
|
|
1109
|
-
comp = replaceXRanges(comp, options);
|
|
1110
|
-
debug("xrange", comp);
|
|
1111
|
-
comp = replaceStars(comp, options);
|
|
1112
|
-
debug("stars", comp);
|
|
1113
|
-
return comp;
|
|
1114
|
-
};
|
|
1115
|
-
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1116
|
-
const replaceTildes = (comp, options) => {
|
|
1117
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1118
|
-
};
|
|
1119
|
-
const replaceTilde = (comp, options) => {
|
|
1120
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1121
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1122
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
1123
|
-
let ret;
|
|
1124
|
-
if (isX(M)) ret = "";
|
|
1125
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1126
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1127
|
-
else if (pr) {
|
|
1128
|
-
debug("replaceTilde pr", pr);
|
|
1129
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1130
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1131
|
-
debug("tilde return", ret);
|
|
1132
|
-
return ret;
|
|
1133
|
-
});
|
|
1134
|
-
};
|
|
1135
|
-
const replaceCarets = (comp, options) => {
|
|
1136
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1137
|
-
};
|
|
1138
|
-
const replaceCaret = (comp, options) => {
|
|
1139
|
-
debug("caret", comp, options);
|
|
1140
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1141
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
1142
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1143
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
1144
|
-
let ret;
|
|
1145
|
-
if (isX(M)) ret = "";
|
|
1146
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1147
|
-
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1148
|
-
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1149
|
-
else if (pr) {
|
|
1150
|
-
debug("replaceCaret pr", pr);
|
|
1151
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1152
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1153
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1154
|
-
} else {
|
|
1155
|
-
debug("no pr");
|
|
1156
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1157
|
-
else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1158
|
-
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1159
|
-
}
|
|
1160
|
-
debug("caret return", ret);
|
|
1161
|
-
return ret;
|
|
1162
|
-
});
|
|
1163
|
-
};
|
|
1164
|
-
const replaceXRanges = (comp, options) => {
|
|
1165
|
-
debug("replaceXRanges", comp, options);
|
|
1166
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1167
|
-
};
|
|
1168
|
-
const replaceXRange = (comp, options) => {
|
|
1169
|
-
comp = comp.trim();
|
|
1170
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1171
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1172
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1173
|
-
const xM = isX(M);
|
|
1174
|
-
const xm = xM || isX(m);
|
|
1175
|
-
const xp = xm || isX(p);
|
|
1176
|
-
const anyX = xp;
|
|
1177
|
-
if (gtlt === "=" && anyX) gtlt = "";
|
|
1178
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
1179
|
-
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
1180
|
-
else ret = "*";
|
|
1181
|
-
else if (gtlt && anyX) {
|
|
1182
|
-
if (xm) m = 0;
|
|
1183
|
-
p = 0;
|
|
1184
|
-
if (gtlt === ">") {
|
|
1185
|
-
gtlt = ">=";
|
|
1186
|
-
if (xm) {
|
|
1187
|
-
M = +M + 1;
|
|
1188
|
-
m = 0;
|
|
1189
|
-
p = 0;
|
|
1190
|
-
} else {
|
|
1191
|
-
m = +m + 1;
|
|
1192
|
-
p = 0;
|
|
1193
|
-
}
|
|
1194
|
-
} else if (gtlt === "<=") {
|
|
1195
|
-
gtlt = "<";
|
|
1196
|
-
if (xm) M = +M + 1;
|
|
1197
|
-
else m = +m + 1;
|
|
1198
|
-
}
|
|
1199
|
-
if (gtlt === "<") pr = "-0";
|
|
1200
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1201
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1202
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1203
|
-
debug("xRange return", ret);
|
|
1204
|
-
return ret;
|
|
1205
|
-
});
|
|
1206
|
-
};
|
|
1207
|
-
const replaceStars = (comp, options) => {
|
|
1208
|
-
debug("replaceStars", comp, options);
|
|
1209
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
1210
|
-
};
|
|
1211
|
-
const replaceGTE0 = (comp, options) => {
|
|
1212
|
-
debug("replaceGTE0", comp, options);
|
|
1213
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1214
|
-
};
|
|
1215
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1216
|
-
if (isX(fM)) from = "";
|
|
1217
|
-
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1218
|
-
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1219
|
-
else if (fpr) from = `>=${from}`;
|
|
1220
|
-
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1221
|
-
if (isX(tM)) to = "";
|
|
1222
|
-
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
1223
|
-
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
1224
|
-
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1225
|
-
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1226
|
-
else to = `<=${to}`;
|
|
1227
|
-
return `${from} ${to}`.trim();
|
|
1228
|
-
};
|
|
1229
|
-
const testSet = (set, version, options) => {
|
|
1230
|
-
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
1231
|
-
if (version.prerelease.length && !options.includePrerelease) {
|
|
1232
|
-
for (let i = 0; i < set.length; i++) {
|
|
1233
|
-
debug(set[i].semver);
|
|
1234
|
-
if (set[i].semver === Comparator.ANY) continue;
|
|
1235
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
1236
|
-
const allowed = set[i].semver;
|
|
1237
|
-
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
return false;
|
|
1241
|
-
}
|
|
1242
|
-
return true;
|
|
1243
|
-
};
|
|
1244
|
-
}));
|
|
1245
|
-
|
|
1246
|
-
//#endregion
|
|
1247
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js
|
|
1248
|
-
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1249
|
-
const ANY = Symbol("SemVer ANY");
|
|
1250
|
-
var Comparator = class Comparator {
|
|
1251
|
-
static get ANY() {
|
|
1252
|
-
return ANY;
|
|
1253
|
-
}
|
|
1254
|
-
constructor(comp, options) {
|
|
1255
|
-
options = parseOptions(options);
|
|
1256
|
-
if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
|
|
1257
|
-
else comp = comp.value;
|
|
1258
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
1259
|
-
debug("comparator", comp, options);
|
|
1260
|
-
this.options = options;
|
|
1261
|
-
this.loose = !!options.loose;
|
|
1262
|
-
this.parse(comp);
|
|
1263
|
-
if (this.semver === ANY) this.value = "";
|
|
1264
|
-
else this.value = this.operator + this.semver.version;
|
|
1265
|
-
debug("comp", this);
|
|
1266
|
-
}
|
|
1267
|
-
parse(comp) {
|
|
1268
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1269
|
-
const m = comp.match(r);
|
|
1270
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1271
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1272
|
-
if (this.operator === "=") this.operator = "";
|
|
1273
|
-
if (!m[2]) this.semver = ANY;
|
|
1274
|
-
else this.semver = new SemVer(m[2], this.options.loose);
|
|
1275
|
-
}
|
|
1276
|
-
toString() {
|
|
1277
|
-
return this.value;
|
|
1278
|
-
}
|
|
1279
|
-
test(version) {
|
|
1280
|
-
debug("Comparator.test", version, this.options.loose);
|
|
1281
|
-
if (this.semver === ANY || version === ANY) return true;
|
|
1282
|
-
if (typeof version === "string") try {
|
|
1283
|
-
version = new SemVer(version, this.options);
|
|
1284
|
-
} catch (er) {
|
|
1285
|
-
return false;
|
|
1286
|
-
}
|
|
1287
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
1288
|
-
}
|
|
1289
|
-
intersects(comp, options) {
|
|
1290
|
-
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
1291
|
-
if (this.operator === "") {
|
|
1292
|
-
if (this.value === "") return true;
|
|
1293
|
-
return new Range(comp.value, options).test(this.value);
|
|
1294
|
-
} else if (comp.operator === "") {
|
|
1295
|
-
if (comp.value === "") return true;
|
|
1296
|
-
return new Range(this.value, options).test(comp.semver);
|
|
1297
|
-
}
|
|
1298
|
-
options = parseOptions(options);
|
|
1299
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
1300
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1301
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1302
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1303
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1304
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1305
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1306
|
-
return false;
|
|
1307
|
-
}
|
|
1308
|
-
};
|
|
1309
|
-
module.exports = Comparator;
|
|
1310
|
-
const parseOptions = require_parse_options();
|
|
1311
|
-
const { safeRe: re, t } = require_re();
|
|
1312
|
-
const cmp = require_cmp();
|
|
1313
|
-
const debug = require_debug();
|
|
1314
|
-
const SemVer = require_semver$1();
|
|
1315
|
-
const Range = require_range();
|
|
1316
|
-
}));
|
|
1317
|
-
|
|
1318
|
-
//#endregion
|
|
1319
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js
|
|
1320
|
-
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1321
|
-
const Range = require_range();
|
|
1322
|
-
const satisfies = (version, range, options) => {
|
|
1323
|
-
try {
|
|
1324
|
-
range = new Range(range, options);
|
|
1325
|
-
} catch (er) {
|
|
1326
|
-
return false;
|
|
1327
|
-
}
|
|
1328
|
-
return range.test(version);
|
|
1329
|
-
};
|
|
1330
|
-
module.exports = satisfies;
|
|
1331
|
-
}));
|
|
1332
|
-
|
|
1333
|
-
//#endregion
|
|
1334
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js
|
|
1335
|
-
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1336
|
-
const Range = require_range();
|
|
1337
|
-
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1338
|
-
module.exports = toComparators;
|
|
1339
|
-
}));
|
|
1340
|
-
|
|
1341
|
-
//#endregion
|
|
1342
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js
|
|
1343
|
-
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1344
|
-
const SemVer = require_semver$1();
|
|
1345
|
-
const Range = require_range();
|
|
1346
|
-
const maxSatisfying = (versions, range, options) => {
|
|
1347
|
-
let max = null;
|
|
1348
|
-
let maxSV = null;
|
|
1349
|
-
let rangeObj = null;
|
|
1350
|
-
try {
|
|
1351
|
-
rangeObj = new Range(range, options);
|
|
1352
|
-
} catch (er) {
|
|
1353
|
-
return null;
|
|
1354
|
-
}
|
|
1355
|
-
versions.forEach((v) => {
|
|
1356
|
-
if (rangeObj.test(v)) {
|
|
1357
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
1358
|
-
max = v;
|
|
1359
|
-
maxSV = new SemVer(max, options);
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
return max;
|
|
1364
|
-
};
|
|
1365
|
-
module.exports = maxSatisfying;
|
|
1366
|
-
}));
|
|
1367
|
-
|
|
1368
|
-
//#endregion
|
|
1369
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js
|
|
1370
|
-
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1371
|
-
const SemVer = require_semver$1();
|
|
1372
|
-
const Range = require_range();
|
|
1373
|
-
const minSatisfying = (versions, range, options) => {
|
|
1374
|
-
let min = null;
|
|
1375
|
-
let minSV = null;
|
|
1376
|
-
let rangeObj = null;
|
|
1377
|
-
try {
|
|
1378
|
-
rangeObj = new Range(range, options);
|
|
1379
|
-
} catch (er) {
|
|
1380
|
-
return null;
|
|
1381
|
-
}
|
|
1382
|
-
versions.forEach((v) => {
|
|
1383
|
-
if (rangeObj.test(v)) {
|
|
1384
|
-
if (!min || minSV.compare(v) === 1) {
|
|
1385
|
-
min = v;
|
|
1386
|
-
minSV = new SemVer(min, options);
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
return min;
|
|
1391
|
-
};
|
|
1392
|
-
module.exports = minSatisfying;
|
|
1393
|
-
}));
|
|
1394
|
-
|
|
1395
|
-
//#endregion
|
|
1396
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js
|
|
1397
|
-
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1398
|
-
const SemVer = require_semver$1();
|
|
1399
|
-
const Range = require_range();
|
|
1400
|
-
const gt = require_gt();
|
|
1401
|
-
const minVersion = (range, loose) => {
|
|
1402
|
-
range = new Range(range, loose);
|
|
1403
|
-
let minver = new SemVer("0.0.0");
|
|
1404
|
-
if (range.test(minver)) return minver;
|
|
1405
|
-
minver = new SemVer("0.0.0-0");
|
|
1406
|
-
if (range.test(minver)) return minver;
|
|
1407
|
-
minver = null;
|
|
1408
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
1409
|
-
const comparators = range.set[i];
|
|
1410
|
-
let setMin = null;
|
|
1411
|
-
comparators.forEach((comparator) => {
|
|
1412
|
-
const compver = new SemVer(comparator.semver.version);
|
|
1413
|
-
switch (comparator.operator) {
|
|
1414
|
-
case ">":
|
|
1415
|
-
if (compver.prerelease.length === 0) compver.patch++;
|
|
1416
|
-
else compver.prerelease.push(0);
|
|
1417
|
-
compver.raw = compver.format();
|
|
1418
|
-
case "":
|
|
1419
|
-
case ">=":
|
|
1420
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1421
|
-
break;
|
|
1422
|
-
case "<":
|
|
1423
|
-
case "<=": break;
|
|
1424
|
-
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1425
|
-
}
|
|
1426
|
-
});
|
|
1427
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1428
|
-
}
|
|
1429
|
-
if (minver && range.test(minver)) return minver;
|
|
1430
|
-
return null;
|
|
1431
|
-
};
|
|
1432
|
-
module.exports = minVersion;
|
|
1433
|
-
}));
|
|
1434
|
-
|
|
1435
|
-
//#endregion
|
|
1436
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js
|
|
1437
|
-
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1438
|
-
const Range = require_range();
|
|
1439
|
-
const validRange = (range, options) => {
|
|
1440
|
-
try {
|
|
1441
|
-
return new Range(range, options).range || "*";
|
|
1442
|
-
} catch (er) {
|
|
1443
|
-
return null;
|
|
1444
|
-
}
|
|
1445
|
-
};
|
|
1446
|
-
module.exports = validRange;
|
|
1447
|
-
}));
|
|
1448
|
-
|
|
1449
|
-
//#endregion
|
|
1450
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js
|
|
1451
|
-
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1452
|
-
const SemVer = require_semver$1();
|
|
1453
|
-
const Comparator = require_comparator();
|
|
1454
|
-
const { ANY } = Comparator;
|
|
1455
|
-
const Range = require_range();
|
|
1456
|
-
const satisfies = require_satisfies();
|
|
1457
|
-
const gt = require_gt();
|
|
1458
|
-
const lt = require_lt();
|
|
1459
|
-
const lte = require_lte();
|
|
1460
|
-
const gte = require_gte();
|
|
1461
|
-
const outside = (version, range, hilo, options) => {
|
|
1462
|
-
version = new SemVer(version, options);
|
|
1463
|
-
range = new Range(range, options);
|
|
1464
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1465
|
-
switch (hilo) {
|
|
1466
|
-
case ">":
|
|
1467
|
-
gtfn = gt;
|
|
1468
|
-
ltefn = lte;
|
|
1469
|
-
ltfn = lt;
|
|
1470
|
-
comp = ">";
|
|
1471
|
-
ecomp = ">=";
|
|
1472
|
-
break;
|
|
1473
|
-
case "<":
|
|
1474
|
-
gtfn = lt;
|
|
1475
|
-
ltefn = gte;
|
|
1476
|
-
ltfn = gt;
|
|
1477
|
-
comp = "<";
|
|
1478
|
-
ecomp = "<=";
|
|
1479
|
-
break;
|
|
1480
|
-
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1481
|
-
}
|
|
1482
|
-
if (satisfies(version, range, options)) return false;
|
|
1483
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
1484
|
-
const comparators = range.set[i];
|
|
1485
|
-
let high = null;
|
|
1486
|
-
let low = null;
|
|
1487
|
-
comparators.forEach((comparator) => {
|
|
1488
|
-
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
1489
|
-
high = high || comparator;
|
|
1490
|
-
low = low || comparator;
|
|
1491
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1492
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1493
|
-
});
|
|
1494
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1495
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1496
|
-
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1497
|
-
}
|
|
1498
|
-
return true;
|
|
1499
|
-
};
|
|
1500
|
-
module.exports = outside;
|
|
1501
|
-
}));
|
|
1502
|
-
|
|
1503
|
-
//#endregion
|
|
1504
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js
|
|
1505
|
-
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1506
|
-
const outside = require_outside();
|
|
1507
|
-
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1508
|
-
module.exports = gtr;
|
|
1509
|
-
}));
|
|
1510
|
-
|
|
1511
|
-
//#endregion
|
|
1512
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js
|
|
1513
|
-
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1514
|
-
const outside = require_outside();
|
|
1515
|
-
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1516
|
-
module.exports = ltr;
|
|
1517
|
-
}));
|
|
1518
|
-
|
|
1519
|
-
//#endregion
|
|
1520
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js
|
|
1521
|
-
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1522
|
-
const Range = require_range();
|
|
1523
|
-
const intersects = (r1, r2, options) => {
|
|
1524
|
-
r1 = new Range(r1, options);
|
|
1525
|
-
r2 = new Range(r2, options);
|
|
1526
|
-
return r1.intersects(r2, options);
|
|
1527
|
-
};
|
|
1528
|
-
module.exports = intersects;
|
|
1529
|
-
}));
|
|
1530
|
-
|
|
1531
|
-
//#endregion
|
|
1532
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js
|
|
1533
|
-
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1534
|
-
const satisfies = require_satisfies();
|
|
1535
|
-
const compare = require_compare();
|
|
1536
|
-
module.exports = (versions, range, options) => {
|
|
1537
|
-
const set = [];
|
|
1538
|
-
let first = null;
|
|
1539
|
-
let prev = null;
|
|
1540
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1541
|
-
for (const version of v) if (satisfies(version, range, options)) {
|
|
1542
|
-
prev = version;
|
|
1543
|
-
if (!first) first = version;
|
|
1544
|
-
} else {
|
|
1545
|
-
if (prev) set.push([first, prev]);
|
|
1546
|
-
prev = null;
|
|
1547
|
-
first = null;
|
|
1548
|
-
}
|
|
1549
|
-
if (first) set.push([first, null]);
|
|
1550
|
-
const ranges = [];
|
|
1551
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
1552
|
-
else if (!max && min === v[0]) ranges.push("*");
|
|
1553
|
-
else if (!max) ranges.push(`>=${min}`);
|
|
1554
|
-
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
1555
|
-
else ranges.push(`${min} - ${max}`);
|
|
1556
|
-
const simplified = ranges.join(" || ");
|
|
1557
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1558
|
-
return simplified.length < original.length ? simplified : range;
|
|
1559
|
-
};
|
|
1560
|
-
}));
|
|
1561
|
-
|
|
1562
|
-
//#endregion
|
|
1563
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js
|
|
1564
|
-
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1565
|
-
const Range = require_range();
|
|
1566
|
-
const Comparator = require_comparator();
|
|
1567
|
-
const { ANY } = Comparator;
|
|
1568
|
-
const satisfies = require_satisfies();
|
|
1569
|
-
const compare = require_compare();
|
|
1570
|
-
const subset = (sub, dom, options = {}) => {
|
|
1571
|
-
if (sub === dom) return true;
|
|
1572
|
-
sub = new Range(sub, options);
|
|
1573
|
-
dom = new Range(dom, options);
|
|
1574
|
-
let sawNonNull = false;
|
|
1575
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
1576
|
-
for (const simpleDom of dom.set) {
|
|
1577
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1578
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
1579
|
-
if (isSub) continue OUTER;
|
|
1580
|
-
}
|
|
1581
|
-
if (sawNonNull) return false;
|
|
1582
|
-
}
|
|
1583
|
-
return true;
|
|
1584
|
-
};
|
|
1585
|
-
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1586
|
-
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
1587
|
-
const simpleSubset = (sub, dom, options) => {
|
|
1588
|
-
if (sub === dom) return true;
|
|
1589
|
-
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
1590
|
-
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
1591
|
-
else sub = minimumVersion;
|
|
1592
|
-
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1593
|
-
else dom = minimumVersion;
|
|
1594
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
1595
|
-
let gt, lt;
|
|
1596
|
-
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
1597
|
-
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
1598
|
-
else eqSet.add(c.semver);
|
|
1599
|
-
if (eqSet.size > 1) return null;
|
|
1600
|
-
let gtltComp;
|
|
1601
|
-
if (gt && lt) {
|
|
1602
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1603
|
-
if (gtltComp > 0) return null;
|
|
1604
|
-
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
1605
|
-
}
|
|
1606
|
-
for (const eq of eqSet) {
|
|
1607
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1608
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1609
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
1610
|
-
return true;
|
|
1611
|
-
}
|
|
1612
|
-
let higher, lower;
|
|
1613
|
-
let hasDomLT, hasDomGT;
|
|
1614
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1615
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1616
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
1617
|
-
for (const c of dom) {
|
|
1618
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1619
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1620
|
-
if (gt) {
|
|
1621
|
-
if (needDomGTPre) {
|
|
1622
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
1623
|
-
}
|
|
1624
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
1625
|
-
higher = higherGT(gt, c, options);
|
|
1626
|
-
if (higher === c && higher !== gt) return false;
|
|
1627
|
-
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
|
|
1628
|
-
}
|
|
1629
|
-
if (lt) {
|
|
1630
|
-
if (needDomLTPre) {
|
|
1631
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
1632
|
-
}
|
|
1633
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
1634
|
-
lower = lowerLT(lt, c, options);
|
|
1635
|
-
if (lower === c && lower !== lt) return false;
|
|
1636
|
-
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
|
|
1637
|
-
}
|
|
1638
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
1639
|
-
}
|
|
1640
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
1641
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
1642
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
1643
|
-
return true;
|
|
1644
|
-
};
|
|
1645
|
-
const higherGT = (a, b, options) => {
|
|
1646
|
-
if (!a) return b;
|
|
1647
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1648
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1649
|
-
};
|
|
1650
|
-
const lowerLT = (a, b, options) => {
|
|
1651
|
-
if (!a) return b;
|
|
1652
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1653
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1654
|
-
};
|
|
1655
|
-
module.exports = subset;
|
|
1656
|
-
}));
|
|
1657
|
-
|
|
1658
|
-
//#endregion
|
|
1659
|
-
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js
|
|
1660
|
-
var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1661
|
-
const internalRe = require_re();
|
|
1662
|
-
const constants = require_constants();
|
|
1663
|
-
const SemVer = require_semver$1();
|
|
1664
|
-
const identifiers = require_identifiers();
|
|
1665
|
-
const parse = require_parse();
|
|
1666
|
-
const valid = require_valid$1();
|
|
1667
|
-
const clean = require_clean();
|
|
1668
|
-
const inc = require_inc();
|
|
1669
|
-
const diff = require_diff();
|
|
1670
|
-
const major = require_major();
|
|
1671
|
-
const minor = require_minor();
|
|
1672
|
-
const patch = require_patch();
|
|
1673
|
-
const prerelease = require_prerelease();
|
|
1674
|
-
const compare = require_compare();
|
|
1675
|
-
const rcompare = require_rcompare();
|
|
1676
|
-
const compareLoose = require_compare_loose();
|
|
1677
|
-
const compareBuild = require_compare_build();
|
|
1678
|
-
const sort = require_sort();
|
|
1679
|
-
const rsort = require_rsort();
|
|
1680
|
-
const gt = require_gt();
|
|
1681
|
-
const lt = require_lt();
|
|
1682
|
-
const eq = require_eq();
|
|
1683
|
-
const neq = require_neq();
|
|
1684
|
-
const gte = require_gte();
|
|
1685
|
-
const lte = require_lte();
|
|
1686
|
-
const cmp = require_cmp();
|
|
1687
|
-
const coerce = require_coerce();
|
|
1688
|
-
const Comparator = require_comparator();
|
|
1689
|
-
const Range = require_range();
|
|
1690
|
-
const satisfies = require_satisfies();
|
|
1691
|
-
const toComparators = require_to_comparators();
|
|
1692
|
-
const maxSatisfying = require_max_satisfying();
|
|
1693
|
-
const minSatisfying = require_min_satisfying();
|
|
1694
|
-
const minVersion = require_min_version();
|
|
1695
|
-
const validRange = require_valid();
|
|
1696
|
-
const outside = require_outside();
|
|
1697
|
-
const gtr = require_gtr();
|
|
1698
|
-
const ltr = require_ltr();
|
|
1699
|
-
const intersects = require_intersects();
|
|
1700
|
-
const simplifyRange = require_simplify();
|
|
1701
|
-
const subset = require_subset();
|
|
1702
|
-
module.exports = {
|
|
1703
|
-
parse,
|
|
1704
|
-
valid,
|
|
1705
|
-
clean,
|
|
1706
|
-
inc,
|
|
1707
|
-
diff,
|
|
1708
|
-
major,
|
|
1709
|
-
minor,
|
|
1710
|
-
patch,
|
|
1711
|
-
prerelease,
|
|
1712
|
-
compare,
|
|
1713
|
-
rcompare,
|
|
1714
|
-
compareLoose,
|
|
1715
|
-
compareBuild,
|
|
1716
|
-
sort,
|
|
1717
|
-
rsort,
|
|
1718
|
-
gt,
|
|
1719
|
-
lt,
|
|
1720
|
-
eq,
|
|
1721
|
-
neq,
|
|
1722
|
-
gte,
|
|
1723
|
-
lte,
|
|
1724
|
-
cmp,
|
|
1725
|
-
coerce,
|
|
1726
|
-
Comparator,
|
|
1727
|
-
Range,
|
|
1728
|
-
satisfies,
|
|
1729
|
-
toComparators,
|
|
1730
|
-
maxSatisfying,
|
|
1731
|
-
minSatisfying,
|
|
1732
|
-
minVersion,
|
|
1733
|
-
validRange,
|
|
1734
|
-
outside,
|
|
1735
|
-
gtr,
|
|
1736
|
-
ltr,
|
|
1737
|
-
intersects,
|
|
1738
|
-
simplifyRange,
|
|
1739
|
-
subset,
|
|
1740
|
-
SemVer,
|
|
1741
|
-
re: internalRe.re,
|
|
1742
|
-
src: internalRe.src,
|
|
1743
|
-
tokens: internalRe.t,
|
|
1744
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1745
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1746
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1747
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1748
|
-
};
|
|
1749
|
-
}));
|
|
1750
|
-
|
|
1751
|
-
//#endregion
|
|
1752
|
-
//#region ../../node_modules/.pnpm/uint8array-extras@1.5.0/node_modules/uint8array-extras/index.js
|
|
1753
|
-
const objectToString = Object.prototype.toString;
|
|
1754
|
-
const uint8ArrayStringified = "[object Uint8Array]";
|
|
1755
|
-
const arrayBufferStringified = "[object ArrayBuffer]";
|
|
1756
|
-
function isType(value, typeConstructor, typeStringified) {
|
|
1757
|
-
if (!value) return false;
|
|
1758
|
-
if (value.constructor === typeConstructor) return true;
|
|
1759
|
-
return objectToString.call(value) === typeStringified;
|
|
1760
|
-
}
|
|
1761
|
-
function isUint8Array(value) {
|
|
1762
|
-
return isType(value, Uint8Array, uint8ArrayStringified);
|
|
1763
|
-
}
|
|
1764
|
-
function isArrayBuffer(value) {
|
|
1765
|
-
return isType(value, ArrayBuffer, arrayBufferStringified);
|
|
1766
|
-
}
|
|
1767
|
-
function isUint8ArrayOrArrayBuffer(value) {
|
|
1768
|
-
return isUint8Array(value) || isArrayBuffer(value);
|
|
1769
|
-
}
|
|
1770
|
-
function assertUint8Array(value) {
|
|
1771
|
-
if (!isUint8Array(value)) throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof value}\``);
|
|
1772
|
-
}
|
|
1773
|
-
function assertUint8ArrayOrArrayBuffer(value) {
|
|
1774
|
-
if (!isUint8ArrayOrArrayBuffer(value)) throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof value}\``);
|
|
1775
|
-
}
|
|
1776
|
-
function concatUint8Arrays(arrays, totalLength) {
|
|
1777
|
-
if (arrays.length === 0) return new Uint8Array(0);
|
|
1778
|
-
totalLength ??= arrays.reduce((accumulator, currentValue) => accumulator + currentValue.length, 0);
|
|
1779
|
-
const returnValue = new Uint8Array(totalLength);
|
|
1780
|
-
let offset = 0;
|
|
1781
|
-
for (const array of arrays) {
|
|
1782
|
-
assertUint8Array(array);
|
|
1783
|
-
returnValue.set(array, offset);
|
|
1784
|
-
offset += array.length;
|
|
1785
|
-
}
|
|
1786
|
-
return returnValue;
|
|
1787
|
-
}
|
|
1788
|
-
const cachedDecoders = { utf8: new globalThis.TextDecoder("utf8") };
|
|
1789
|
-
function uint8ArrayToString(array, encoding = "utf8") {
|
|
1790
|
-
assertUint8ArrayOrArrayBuffer(array);
|
|
1791
|
-
cachedDecoders[encoding] ??= new globalThis.TextDecoder(encoding);
|
|
1792
|
-
return cachedDecoders[encoding].decode(array);
|
|
1793
|
-
}
|
|
1794
|
-
function assertString(value) {
|
|
1795
|
-
if (typeof value !== "string") throw new TypeError(`Expected \`string\`, got \`${typeof value}\``);
|
|
1796
|
-
}
|
|
1797
|
-
const cachedEncoder = new globalThis.TextEncoder();
|
|
1798
|
-
function stringToUint8Array(string) {
|
|
1799
|
-
assertString(string);
|
|
1800
|
-
return cachedEncoder.encode(string);
|
|
1801
|
-
}
|
|
1802
|
-
const byteToHexLookupTable = Array.from({ length: 256 }, (_, index) => index.toString(16).padStart(2, "0"));
|
|
1803
|
-
|
|
1804
|
-
//#endregion
|
|
1805
|
-
//#region ../../node_modules/.pnpm/conf@15.0.2/node_modules/conf/dist/source/index.js
|
|
1806
|
-
var import__2020 = require__2020();
|
|
1807
|
-
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
1808
|
-
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
1809
|
-
const encryptionAlgorithm = "aes-256-cbc";
|
|
1810
|
-
const createPlainObject = () => Object.create(null);
|
|
1811
|
-
const isExist = (data) => data !== void 0;
|
|
1812
|
-
const checkValueType = (key, value) => {
|
|
1813
|
-
const nonJsonTypes = new Set([
|
|
1814
|
-
"undefined",
|
|
1815
|
-
"symbol",
|
|
1816
|
-
"function"
|
|
1817
|
-
]);
|
|
1818
|
-
const type = typeof value;
|
|
1819
|
-
if (nonJsonTypes.has(type)) throw new TypeError(`Setting a value of type \`${type}\` for key \`${key}\` is not allowed as it's not supported by JSON`);
|
|
1820
|
-
};
|
|
1821
|
-
const INTERNAL_KEY = "__internal__";
|
|
1822
|
-
const MIGRATION_KEY = `${INTERNAL_KEY}.migrations.version`;
|
|
1823
|
-
var Conf = class {
|
|
1824
|
-
path;
|
|
1825
|
-
events;
|
|
1826
|
-
#validator;
|
|
1827
|
-
#encryptionKey;
|
|
1828
|
-
#options;
|
|
1829
|
-
#defaultValues = {};
|
|
1830
|
-
#isInMigration = false;
|
|
1831
|
-
#watcher;
|
|
1832
|
-
#watchFile;
|
|
1833
|
-
#debouncedChangeHandler;
|
|
1834
|
-
constructor(partialOptions = {}) {
|
|
1835
|
-
const options = this.#prepareOptions(partialOptions);
|
|
1836
|
-
this.#options = options;
|
|
1837
|
-
this.#setupValidator(options);
|
|
1838
|
-
this.#applyDefaultValues(options);
|
|
1839
|
-
this.#configureSerialization(options);
|
|
1840
|
-
this.events = new EventTarget();
|
|
1841
|
-
this.#encryptionKey = options.encryptionKey;
|
|
1842
|
-
this.path = this.#resolvePath(options);
|
|
1843
|
-
this.#initializeStore(options);
|
|
1844
|
-
if (options.watch) this._watch();
|
|
1845
|
-
}
|
|
1846
|
-
get(key, defaultValue) {
|
|
1847
|
-
if (this.#options.accessPropertiesByDotNotation) return this._get(key, defaultValue);
|
|
1848
|
-
const { store } = this;
|
|
1849
|
-
return key in store ? store[key] : defaultValue;
|
|
1850
|
-
}
|
|
1851
|
-
set(key, value) {
|
|
1852
|
-
if (typeof key !== "string" && typeof key !== "object") throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof key}`);
|
|
1853
|
-
if (typeof key !== "object" && value === void 0) throw new TypeError("Use `delete()` to clear values");
|
|
1854
|
-
if (this._containsReservedKey(key)) throw new TypeError(`Please don't use the ${INTERNAL_KEY} key, as it's used to manage this module internal operations.`);
|
|
1855
|
-
const { store } = this;
|
|
1856
|
-
const set = (key, value) => {
|
|
1857
|
-
checkValueType(key, value);
|
|
1858
|
-
if (this.#options.accessPropertiesByDotNotation) setProperty(store, key, value);
|
|
1859
|
-
else {
|
|
1860
|
-
if (key === "__proto__" || key === "constructor" || key === "prototype") return;
|
|
1861
|
-
store[key] = value;
|
|
1862
|
-
}
|
|
1863
|
-
};
|
|
1864
|
-
if (typeof key === "object") {
|
|
1865
|
-
const object = key;
|
|
1866
|
-
for (const [key, value] of Object.entries(object)) set(key, value);
|
|
1867
|
-
} else set(key, value);
|
|
1868
|
-
this.store = store;
|
|
1869
|
-
}
|
|
1870
|
-
has(key) {
|
|
1871
|
-
if (this.#options.accessPropertiesByDotNotation) return hasProperty(this.store, key);
|
|
1872
|
-
return key in this.store;
|
|
1873
|
-
}
|
|
1874
|
-
appendToArray(key, value) {
|
|
1875
|
-
checkValueType(key, value);
|
|
1876
|
-
const array = this.#options.accessPropertiesByDotNotation ? this._get(key, []) : key in this.store ? this.store[key] : [];
|
|
1877
|
-
if (!Array.isArray(array)) throw new TypeError(`The key \`${key}\` is already set to a non-array value`);
|
|
1878
|
-
this.set(key, [...array, value]);
|
|
1879
|
-
}
|
|
1880
|
-
/**
|
|
1881
|
-
Reset items to their default values, as defined by the `defaults` or `schema` option.
|
|
1882
|
-
|
|
1883
|
-
@see `clear()` to reset all items.
|
|
1884
|
-
|
|
1885
|
-
@param keys - The keys of the items to reset.
|
|
1886
|
-
*/
|
|
1887
|
-
reset(...keys) {
|
|
1888
|
-
for (const key of keys) if (isExist(this.#defaultValues[key])) this.set(key, this.#defaultValues[key]);
|
|
1889
|
-
}
|
|
1890
|
-
delete(key) {
|
|
1891
|
-
const { store } = this;
|
|
1892
|
-
if (this.#options.accessPropertiesByDotNotation) deleteProperty(store, key);
|
|
1893
|
-
else delete store[key];
|
|
1894
|
-
this.store = store;
|
|
1895
|
-
}
|
|
1896
|
-
/**
|
|
1897
|
-
Delete all items.
|
|
1898
|
-
|
|
1899
|
-
This resets known items to their default values, if defined by the `defaults` or `schema` option.
|
|
1900
|
-
*/
|
|
1901
|
-
clear() {
|
|
1902
|
-
const newStore = createPlainObject();
|
|
1903
|
-
for (const key of Object.keys(this.#defaultValues)) if (isExist(this.#defaultValues[key])) {
|
|
1904
|
-
checkValueType(key, this.#defaultValues[key]);
|
|
1905
|
-
if (this.#options.accessPropertiesByDotNotation) setProperty(newStore, key, this.#defaultValues[key]);
|
|
1906
|
-
else newStore[key] = this.#defaultValues[key];
|
|
1907
|
-
}
|
|
1908
|
-
this.store = newStore;
|
|
1909
|
-
}
|
|
1910
|
-
onDidChange(key, callback) {
|
|
1911
|
-
if (typeof key !== "string") throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof key}`);
|
|
1912
|
-
if (typeof callback !== "function") throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof callback}`);
|
|
1913
|
-
return this._handleValueChange(() => this.get(key), callback);
|
|
1914
|
-
}
|
|
1915
|
-
/**
|
|
1916
|
-
Watches the whole config object, calling `callback` on any changes.
|
|
1917
|
-
|
|
1918
|
-
@param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
|
|
1919
|
-
@returns A function, that when called, will unsubscribe.
|
|
1920
|
-
*/
|
|
1921
|
-
onDidAnyChange(callback) {
|
|
1922
|
-
if (typeof callback !== "function") throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof callback}`);
|
|
1923
|
-
return this._handleStoreChange(callback);
|
|
1924
|
-
}
|
|
1925
|
-
get size() {
|
|
1926
|
-
return Object.keys(this.store).filter((key) => !this._isReservedKeyPath(key)).length;
|
|
1927
|
-
}
|
|
1928
|
-
/**
|
|
1929
|
-
Get all the config as an object or replace the current config with an object.
|
|
1930
|
-
|
|
1931
|
-
@example
|
|
1932
|
-
```
|
|
1933
|
-
console.log(config.store);
|
|
1934
|
-
//=> {name: 'John', age: 30}
|
|
1935
|
-
```
|
|
1936
|
-
|
|
1937
|
-
@example
|
|
1938
|
-
```
|
|
1939
|
-
config.store = {
|
|
1940
|
-
hello: 'world'
|
|
1941
|
-
};
|
|
1942
|
-
```
|
|
1943
|
-
*/
|
|
1944
|
-
get store() {
|
|
1945
|
-
try {
|
|
1946
|
-
const data = fs.readFileSync(this.path, this.#encryptionKey ? null : "utf8");
|
|
1947
|
-
const dataString = this._decryptData(data);
|
|
1948
|
-
const deserializedData = this._deserialize(dataString);
|
|
1949
|
-
if (!this.#isInMigration) this._validate(deserializedData);
|
|
1950
|
-
return Object.assign(createPlainObject(), deserializedData);
|
|
1951
|
-
} catch (error) {
|
|
1952
|
-
if (error?.code === "ENOENT") {
|
|
1953
|
-
this._ensureDirectory();
|
|
1954
|
-
return createPlainObject();
|
|
1955
|
-
}
|
|
1956
|
-
if (this.#options.clearInvalidConfig) {
|
|
1957
|
-
const errorInstance = error;
|
|
1958
|
-
if (errorInstance.name === "SyntaxError") return createPlainObject();
|
|
1959
|
-
if (errorInstance.message?.startsWith("Config schema violation:")) return createPlainObject();
|
|
1960
|
-
}
|
|
1961
|
-
throw error;
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
set store(value) {
|
|
1965
|
-
this._ensureDirectory();
|
|
1966
|
-
if (!hasProperty(value, INTERNAL_KEY)) try {
|
|
1967
|
-
const data = fs.readFileSync(this.path, this.#encryptionKey ? null : "utf8");
|
|
1968
|
-
const dataString = this._decryptData(data);
|
|
1969
|
-
const currentStore = this._deserialize(dataString);
|
|
1970
|
-
if (hasProperty(currentStore, INTERNAL_KEY)) setProperty(value, INTERNAL_KEY, getProperty(currentStore, INTERNAL_KEY));
|
|
1971
|
-
} catch {}
|
|
1972
|
-
if (!this.#isInMigration) this._validate(value);
|
|
1973
|
-
this._write(value);
|
|
1974
|
-
this.events.dispatchEvent(new Event("change"));
|
|
1975
|
-
}
|
|
1976
|
-
*[Symbol.iterator]() {
|
|
1977
|
-
for (const [key, value] of Object.entries(this.store)) if (!this._isReservedKeyPath(key)) yield [key, value];
|
|
1978
|
-
}
|
|
1979
|
-
/**
|
|
1980
|
-
Close the file watcher if one exists. This is useful in tests to prevent the process from hanging.
|
|
1981
|
-
*/
|
|
1982
|
-
_closeWatcher() {
|
|
1983
|
-
if (this.#watcher) {
|
|
1984
|
-
this.#watcher.close();
|
|
1985
|
-
this.#watcher = void 0;
|
|
1986
|
-
}
|
|
1987
|
-
if (this.#watchFile) {
|
|
1988
|
-
fs.unwatchFile(this.path);
|
|
1989
|
-
this.#watchFile = false;
|
|
1990
|
-
}
|
|
1991
|
-
this.#debouncedChangeHandler = void 0;
|
|
1992
|
-
}
|
|
1993
|
-
_decryptData(data) {
|
|
1994
|
-
if (!this.#encryptionKey) return typeof data === "string" ? data : uint8ArrayToString(data);
|
|
1995
|
-
try {
|
|
1996
|
-
const initializationVector = data.slice(0, 16);
|
|
1997
|
-
const password = crypto.pbkdf2Sync(this.#encryptionKey, initializationVector, 1e4, 32, "sha512");
|
|
1998
|
-
const decipher = crypto.createDecipheriv(encryptionAlgorithm, password, initializationVector);
|
|
1999
|
-
const slice = data.slice(17);
|
|
2000
|
-
const dataUpdate = typeof slice === "string" ? stringToUint8Array(slice) : slice;
|
|
2001
|
-
return uint8ArrayToString(concatUint8Arrays([decipher.update(dataUpdate), decipher.final()]));
|
|
2002
|
-
} catch {
|
|
2003
|
-
try {
|
|
2004
|
-
const initializationVector = data.slice(0, 16);
|
|
2005
|
-
const password = crypto.pbkdf2Sync(this.#encryptionKey, initializationVector.toString(), 1e4, 32, "sha512");
|
|
2006
|
-
const decipher = crypto.createDecipheriv(encryptionAlgorithm, password, initializationVector);
|
|
2007
|
-
const slice = data.slice(17);
|
|
2008
|
-
const dataUpdate = typeof slice === "string" ? stringToUint8Array(slice) : slice;
|
|
2009
|
-
return uint8ArrayToString(concatUint8Arrays([decipher.update(dataUpdate), decipher.final()]));
|
|
2010
|
-
} catch {}
|
|
2011
|
-
}
|
|
2012
|
-
return typeof data === "string" ? data : uint8ArrayToString(data);
|
|
2013
|
-
}
|
|
2014
|
-
_handleStoreChange(callback) {
|
|
2015
|
-
let currentValue = this.store;
|
|
2016
|
-
const onChange = () => {
|
|
2017
|
-
const oldValue = currentValue;
|
|
2018
|
-
const newValue = this.store;
|
|
2019
|
-
if (isDeepStrictEqual(newValue, oldValue)) return;
|
|
2020
|
-
currentValue = newValue;
|
|
2021
|
-
callback.call(this, newValue, oldValue);
|
|
2022
|
-
};
|
|
2023
|
-
this.events.addEventListener("change", onChange);
|
|
2024
|
-
return () => {
|
|
2025
|
-
this.events.removeEventListener("change", onChange);
|
|
2026
|
-
};
|
|
2027
|
-
}
|
|
2028
|
-
_handleValueChange(getter, callback) {
|
|
2029
|
-
let currentValue = getter();
|
|
2030
|
-
const onChange = () => {
|
|
2031
|
-
const oldValue = currentValue;
|
|
2032
|
-
const newValue = getter();
|
|
2033
|
-
if (isDeepStrictEqual(newValue, oldValue)) return;
|
|
2034
|
-
currentValue = newValue;
|
|
2035
|
-
callback.call(this, newValue, oldValue);
|
|
2036
|
-
};
|
|
2037
|
-
this.events.addEventListener("change", onChange);
|
|
2038
|
-
return () => {
|
|
2039
|
-
this.events.removeEventListener("change", onChange);
|
|
2040
|
-
};
|
|
2041
|
-
}
|
|
2042
|
-
_deserialize = (value) => JSON.parse(value);
|
|
2043
|
-
_serialize = (value) => JSON.stringify(value, void 0, " ");
|
|
2044
|
-
_validate(data) {
|
|
2045
|
-
if (!this.#validator) return;
|
|
2046
|
-
if (this.#validator(data) || !this.#validator.errors) return;
|
|
2047
|
-
const errors = this.#validator.errors.map(({ instancePath, message = "" }) => `\`${instancePath.slice(1)}\` ${message}`);
|
|
2048
|
-
throw new Error("Config schema violation: " + errors.join("; "));
|
|
2049
|
-
}
|
|
2050
|
-
_ensureDirectory() {
|
|
2051
|
-
fs.mkdirSync(path.dirname(this.path), { recursive: true });
|
|
2052
|
-
}
|
|
2053
|
-
_write(value) {
|
|
2054
|
-
let data = this._serialize(value);
|
|
2055
|
-
if (this.#encryptionKey) {
|
|
2056
|
-
const initializationVector = crypto.randomBytes(16);
|
|
2057
|
-
const password = crypto.pbkdf2Sync(this.#encryptionKey, initializationVector, 1e4, 32, "sha512");
|
|
2058
|
-
const cipher = crypto.createCipheriv(encryptionAlgorithm, password, initializationVector);
|
|
2059
|
-
data = concatUint8Arrays([
|
|
2060
|
-
initializationVector,
|
|
2061
|
-
stringToUint8Array(":"),
|
|
2062
|
-
cipher.update(stringToUint8Array(data)),
|
|
2063
|
-
cipher.final()
|
|
2064
|
-
]);
|
|
2065
|
-
}
|
|
2066
|
-
if (process$1.env.SNAP) fs.writeFileSync(this.path, data, { mode: this.#options.configFileMode });
|
|
2067
|
-
else try {
|
|
2068
|
-
writeFileSync(this.path, data, { mode: this.#options.configFileMode });
|
|
2069
|
-
} catch (error) {
|
|
2070
|
-
if (error?.code === "EXDEV") {
|
|
2071
|
-
fs.writeFileSync(this.path, data, { mode: this.#options.configFileMode });
|
|
2072
|
-
return;
|
|
2073
|
-
}
|
|
2074
|
-
throw error;
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
_watch() {
|
|
2078
|
-
this._ensureDirectory();
|
|
2079
|
-
if (!fs.existsSync(this.path)) this._write(createPlainObject());
|
|
2080
|
-
if (process$1.platform === "win32" || process$1.platform === "darwin") {
|
|
2081
|
-
this.#debouncedChangeHandler ??= debounce_fn_default(() => {
|
|
2082
|
-
this.events.dispatchEvent(new Event("change"));
|
|
2083
|
-
}, { wait: 100 });
|
|
2084
|
-
const directory = path.dirname(this.path);
|
|
2085
|
-
const basename = path.basename(this.path);
|
|
2086
|
-
this.#watcher = fs.watch(directory, {
|
|
2087
|
-
persistent: false,
|
|
2088
|
-
encoding: "utf8"
|
|
2089
|
-
}, (_eventType, filename) => {
|
|
2090
|
-
if (filename && filename !== basename) return;
|
|
2091
|
-
if (typeof this.#debouncedChangeHandler === "function") this.#debouncedChangeHandler();
|
|
2092
|
-
});
|
|
2093
|
-
} else {
|
|
2094
|
-
this.#debouncedChangeHandler ??= debounce_fn_default(() => {
|
|
2095
|
-
this.events.dispatchEvent(new Event("change"));
|
|
2096
|
-
}, { wait: 1e3 });
|
|
2097
|
-
fs.watchFile(this.path, { persistent: false }, (_current, _previous) => {
|
|
2098
|
-
if (typeof this.#debouncedChangeHandler === "function") this.#debouncedChangeHandler();
|
|
2099
|
-
});
|
|
2100
|
-
this.#watchFile = true;
|
|
2101
|
-
}
|
|
2102
|
-
}
|
|
2103
|
-
_migrate(migrations, versionToMigrate, beforeEachMigration) {
|
|
2104
|
-
let previousMigratedVersion = this._get(MIGRATION_KEY, "0.0.0");
|
|
2105
|
-
const newerVersions = Object.keys(migrations).filter((candidateVersion) => this._shouldPerformMigration(candidateVersion, previousMigratedVersion, versionToMigrate));
|
|
2106
|
-
let storeBackup = structuredClone(this.store);
|
|
2107
|
-
for (const version of newerVersions) try {
|
|
2108
|
-
if (beforeEachMigration) beforeEachMigration(this, {
|
|
2109
|
-
fromVersion: previousMigratedVersion,
|
|
2110
|
-
toVersion: version,
|
|
2111
|
-
finalVersion: versionToMigrate,
|
|
2112
|
-
versions: newerVersions
|
|
2113
|
-
});
|
|
2114
|
-
const migration = migrations[version];
|
|
2115
|
-
migration?.(this);
|
|
2116
|
-
this._set(MIGRATION_KEY, version);
|
|
2117
|
-
previousMigratedVersion = version;
|
|
2118
|
-
storeBackup = structuredClone(this.store);
|
|
2119
|
-
} catch (error) {
|
|
2120
|
-
this.store = storeBackup;
|
|
2121
|
-
try {
|
|
2122
|
-
this._write(storeBackup);
|
|
2123
|
-
} catch {}
|
|
2124
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
2125
|
-
throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${errorMessage}`);
|
|
2126
|
-
}
|
|
2127
|
-
if (this._isVersionInRangeFormat(previousMigratedVersion) || !import_semver.default.eq(previousMigratedVersion, versionToMigrate)) this._set(MIGRATION_KEY, versionToMigrate);
|
|
2128
|
-
}
|
|
2129
|
-
_containsReservedKey(key) {
|
|
2130
|
-
if (typeof key === "string") return this._isReservedKeyPath(key);
|
|
2131
|
-
if (!key || typeof key !== "object") return false;
|
|
2132
|
-
return this._objectContainsReservedKey(key);
|
|
2133
|
-
}
|
|
2134
|
-
_objectContainsReservedKey(value) {
|
|
2135
|
-
if (!value || typeof value !== "object") return false;
|
|
2136
|
-
for (const [candidateKey, candidateValue] of Object.entries(value)) {
|
|
2137
|
-
if (this._isReservedKeyPath(candidateKey)) return true;
|
|
2138
|
-
if (this._objectContainsReservedKey(candidateValue)) return true;
|
|
2139
|
-
}
|
|
2140
|
-
return false;
|
|
2141
|
-
}
|
|
2142
|
-
_isReservedKeyPath(candidate) {
|
|
2143
|
-
return candidate === INTERNAL_KEY || candidate.startsWith(`${INTERNAL_KEY}.`);
|
|
2144
|
-
}
|
|
2145
|
-
_isVersionInRangeFormat(version) {
|
|
2146
|
-
return import_semver.default.clean(version) === null;
|
|
2147
|
-
}
|
|
2148
|
-
_shouldPerformMigration(candidateVersion, previousMigratedVersion, versionToMigrate) {
|
|
2149
|
-
if (this._isVersionInRangeFormat(candidateVersion)) {
|
|
2150
|
-
if (previousMigratedVersion !== "0.0.0" && import_semver.default.satisfies(previousMigratedVersion, candidateVersion)) return false;
|
|
2151
|
-
return import_semver.default.satisfies(versionToMigrate, candidateVersion);
|
|
2152
|
-
}
|
|
2153
|
-
if (import_semver.default.lte(candidateVersion, previousMigratedVersion)) return false;
|
|
2154
|
-
if (import_semver.default.gt(candidateVersion, versionToMigrate)) return false;
|
|
2155
|
-
return true;
|
|
2156
|
-
}
|
|
2157
|
-
_get(key, defaultValue) {
|
|
2158
|
-
return getProperty(this.store, key, defaultValue);
|
|
2159
|
-
}
|
|
2160
|
-
_set(key, value) {
|
|
2161
|
-
const { store } = this;
|
|
2162
|
-
setProperty(store, key, value);
|
|
2163
|
-
this.store = store;
|
|
2164
|
-
}
|
|
2165
|
-
#prepareOptions(partialOptions) {
|
|
2166
|
-
const options = {
|
|
2167
|
-
configName: "config",
|
|
2168
|
-
fileExtension: "json",
|
|
2169
|
-
projectSuffix: "nodejs",
|
|
2170
|
-
clearInvalidConfig: false,
|
|
2171
|
-
accessPropertiesByDotNotation: true,
|
|
2172
|
-
configFileMode: 438,
|
|
2173
|
-
...partialOptions
|
|
2174
|
-
};
|
|
2175
|
-
if (!options.cwd) {
|
|
2176
|
-
if (!options.projectName) throw new Error("Please specify the `projectName` option.");
|
|
2177
|
-
options.cwd = envPaths(options.projectName, { suffix: options.projectSuffix }).config;
|
|
2178
|
-
}
|
|
2179
|
-
if (typeof options.fileExtension === "string") options.fileExtension = options.fileExtension.replace(/^\.+/, "");
|
|
2180
|
-
return options;
|
|
2181
|
-
}
|
|
2182
|
-
#setupValidator(options) {
|
|
2183
|
-
if (!(options.schema ?? options.ajvOptions ?? options.rootSchema)) return;
|
|
2184
|
-
if (options.schema && typeof options.schema !== "object") throw new TypeError("The `schema` option must be an object.");
|
|
2185
|
-
const ajvFormats = import_dist.default.default;
|
|
2186
|
-
const ajv = new import__2020.Ajv2020({
|
|
2187
|
-
allErrors: true,
|
|
2188
|
-
useDefaults: true,
|
|
2189
|
-
...options.ajvOptions
|
|
2190
|
-
});
|
|
2191
|
-
ajvFormats(ajv);
|
|
2192
|
-
const schema = {
|
|
2193
|
-
...options.rootSchema,
|
|
2194
|
-
type: "object",
|
|
2195
|
-
properties: options.schema
|
|
2196
|
-
};
|
|
2197
|
-
this.#validator = ajv.compile(schema);
|
|
2198
|
-
this.#captureSchemaDefaults(options.schema);
|
|
2199
|
-
}
|
|
2200
|
-
#captureSchemaDefaults(schemaConfig) {
|
|
2201
|
-
const schemaEntries = Object.entries(schemaConfig ?? {});
|
|
2202
|
-
for (const [key, schemaDefinition] of schemaEntries) {
|
|
2203
|
-
if (!schemaDefinition || typeof schemaDefinition !== "object") continue;
|
|
2204
|
-
if (!Object.hasOwn(schemaDefinition, "default")) continue;
|
|
2205
|
-
const { default: defaultValue } = schemaDefinition;
|
|
2206
|
-
if (defaultValue === void 0) continue;
|
|
2207
|
-
this.#defaultValues[key] = defaultValue;
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
#applyDefaultValues(options) {
|
|
2211
|
-
if (options.defaults) Object.assign(this.#defaultValues, options.defaults);
|
|
2212
|
-
}
|
|
2213
|
-
#configureSerialization(options) {
|
|
2214
|
-
if (options.serialize) this._serialize = options.serialize;
|
|
2215
|
-
if (options.deserialize) this._deserialize = options.deserialize;
|
|
2216
|
-
}
|
|
2217
|
-
#resolvePath(options) {
|
|
2218
|
-
const normalizedFileExtension = typeof options.fileExtension === "string" ? options.fileExtension : void 0;
|
|
2219
|
-
const fileExtension = normalizedFileExtension ? `.${normalizedFileExtension}` : "";
|
|
2220
|
-
return path.resolve(options.cwd, `${options.configName ?? "config"}${fileExtension}`);
|
|
2221
|
-
}
|
|
2222
|
-
#initializeStore(options) {
|
|
2223
|
-
if (options.migrations) {
|
|
2224
|
-
this.#runMigrations(options);
|
|
2225
|
-
this._validate(this.store);
|
|
2226
|
-
return;
|
|
2227
|
-
}
|
|
2228
|
-
const fileStore = this.store;
|
|
2229
|
-
const storeWithDefaults = Object.assign(createPlainObject(), options.defaults ?? {}, fileStore);
|
|
2230
|
-
this._validate(storeWithDefaults);
|
|
2231
|
-
try {
|
|
2232
|
-
assert.deepEqual(fileStore, storeWithDefaults);
|
|
2233
|
-
} catch {
|
|
2234
|
-
this.store = storeWithDefaults;
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
#runMigrations(options) {
|
|
2238
|
-
const { migrations, projectVersion } = options;
|
|
2239
|
-
if (!migrations) return;
|
|
2240
|
-
if (!projectVersion) throw new Error("Please specify the `projectVersion` option.");
|
|
2241
|
-
this.#isInMigration = true;
|
|
2242
|
-
try {
|
|
2243
|
-
const fileStore = this.store;
|
|
2244
|
-
const storeWithDefaults = Object.assign(createPlainObject(), options.defaults ?? {}, fileStore);
|
|
2245
|
-
try {
|
|
2246
|
-
assert.deepEqual(fileStore, storeWithDefaults);
|
|
2247
|
-
} catch {
|
|
2248
|
-
this._write(storeWithDefaults);
|
|
2249
|
-
}
|
|
2250
|
-
this._migrate(migrations, projectVersion, options.beforeEachMigration);
|
|
2251
|
-
} finally {
|
|
2252
|
-
this.#isInMigration = false;
|
|
2253
|
-
}
|
|
2254
|
-
}
|
|
2255
|
-
};
|
|
2256
|
-
|
|
2257
|
-
//#endregion
|
|
2258
|
-
export { require_semver as n, Conf as t };
|
|
1
|
+
import{s as e,t}from"../rolldown-runtime.mjs";import{r as n}from"./@modelcontextprotocol/sdk.mjs";import{t as r}from"./atomically.mjs";import{t as i}from"./ajv.mjs";import{isDeepStrictEqual as a}from"node:util";import o from"node:path";import s from"node:fs";import c from"node:os";import l from"node:process";import u from"node:crypto";import d from"node:assert";const f=e=>{let t=typeof e;return e!==null&&(t===`object`||t===`function`)},p=new Set([`__proto__`,`prototype`,`constructor`]),m=1e6,h=e=>e>=`0`&&e<=`9`;function g(e){if(e===`0`)return!0;if(/^[1-9]\d*$/.test(e)){let t=Number.parseInt(e,10);return t<=2**53-1&&t<=m}return!1}function _(e,t){return p.has(e)?!1:(e&&g(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}function v(e){if(typeof e!=`string`)throw TypeError(`Expected a string, got ${typeof e}`);let t=[],n=``,r=`start`,i=!1,a=0;for(let o of e){if(a++,i){n+=o,i=!1;continue}if(o===`\\`){if(r===`index`)throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`)throw Error(`Invalid character '${o}' after an index at position ${a}`);i=!0,r=r===`start`?`property`:r;continue}switch(o){case`.`:if(r===`index`)throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`){r=`property`;break}if(!_(n,t))return[];n=``,r=`property`;break;case`[`:if(r===`index`)throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`){r=`index`;break}if(r===`property`||r===`start`){if((n||r===`property`)&&!_(n,t))return[];n=``}r=`index`;break;case`]`:if(r===`index`){if(n===``)n=(t.pop()||``)+`[]`,r=`property`;else{let e=Number.parseInt(n,10);!Number.isNaN(e)&&Number.isFinite(e)&&e>=0&&e<=2**53-1&&e<=m&&n===String(e)?t.push(e):t.push(n),n=``,r=`indexEnd`}break}if(r===`indexEnd`)throw Error(`Invalid character '${o}' after an index at position ${a}`);n+=o;break;default:if(r===`index`&&!h(o))throw Error(`Invalid character '${o}' in an index at position ${a}`);if(r===`indexEnd`)throw Error(`Invalid character '${o}' after an index at position ${a}`);r===`start`&&(r=`property`),n+=o}}switch(i&&(n+=`\\`),r){case`property`:if(!_(n,t))return[];break;case`index`:throw Error(`Index was not closed`);case`start`:t.push(``);break}return t}function y(e){if(typeof e==`string`)return v(e);if(Array.isArray(e)){let t=[];for(let[n,r]of e.entries()){if(typeof r!=`string`&&typeof r!=`number`)throw TypeError(`Expected a string or number for path segment at index ${n}, got ${typeof r}`);if(typeof r==`number`&&!Number.isFinite(r))throw TypeError(`Path segment at index ${n} must be a finite number, got ${r}`);if(p.has(r))return[];typeof r==`string`&&g(r)?t.push(Number.parseInt(r,10)):t.push(r)}return t}return[]}function b(e,t,n){if(!f(e)||typeof t!=`string`&&!Array.isArray(t))return n===void 0?e:n;let r=y(t);if(r.length===0)return n;for(let t=0;t<r.length;t++){let i=r[t];if(e=e[i],e==null){if(t!==r.length-1)return n;break}}return e===void 0?n:e}function x(e,t,n){if(!f(e)||typeof t!=`string`&&!Array.isArray(t))return e;let r=e,i=y(t);if(i.length===0)return e;for(let t=0;t<i.length;t++){let r=i[t];if(t===i.length-1)e[r]=n;else if(!f(e[r])){let n=typeof i[t+1]==`number`;e[r]=n?[]:{}}e=e[r]}return r}function S(e,t){if(!f(e)||typeof t!=`string`&&!Array.isArray(t))return!1;let n=y(t);if(n.length===0)return!1;for(let t=0;t<n.length;t++){let r=n[t];if(t===n.length-1)return Object.hasOwn(e,r)?(delete e[r],!0):!1;if(e=e[r],!f(e))return!1}}function C(e,t){if(!f(e)||typeof t!=`string`&&!Array.isArray(t))return!1;let n=y(t);if(n.length===0)return!1;for(let t of n){if(!f(e)||!(t in e))return!1;e=e[t]}return!0}const w=c.homedir(),T=c.tmpdir(),{env:E}=l,ee=e=>{let t=o.join(w,`Library`);return{data:o.join(t,`Application Support`,e),config:o.join(t,`Preferences`,e),cache:o.join(t,`Caches`,e),log:o.join(t,`Logs`,e),temp:o.join(T,e)}},te=e=>{let t=E.APPDATA||o.join(w,`AppData`,`Roaming`),n=E.LOCALAPPDATA||o.join(w,`AppData`,`Local`);return{data:o.join(n,e,`Data`),config:o.join(t,e,`Config`),cache:o.join(n,e,`Cache`),log:o.join(n,e,`Log`),temp:o.join(T,e)}},ne=e=>{let t=o.basename(w);return{data:o.join(E.XDG_DATA_HOME||o.join(w,`.local`,`share`),e),config:o.join(E.XDG_CONFIG_HOME||o.join(w,`.config`),e),cache:o.join(E.XDG_CACHE_HOME||o.join(w,`.cache`),e),log:o.join(E.XDG_STATE_HOME||o.join(w,`.local`,`state`),e),temp:o.join(T,t,e)}};function re(e,{suffix:t=`nodejs`}={}){if(typeof e!=`string`)throw TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),l.platform===`darwin`?ee(e):l.platform===`win32`?te(e):ne(e)}const ie=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!ae(i,a)&&r||Object.defineProperty(e,n,a)},ae=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},oe=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},se=(e,t)=>`/* Wrapped ${e}*/\n${t}`,ce=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),le=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),ue=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=se.bind(null,r,t.toString());Object.defineProperty(i,`name`,le);let{writable:a,enumerable:o,configurable:s}=ce;Object.defineProperty(e,`toString`,{value:i,writable:a,enumerable:o,configurable:s})};function de(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))ie(e,t,r,n);return oe(e,t),ue(e,t,r),e}const fe=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:n=0,maxWait:r=1/0,before:i=!1,after:a=!0}=t;if(n<0||r<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!a)throw Error("Both `before` and `after` are false, function wouldn't be called.");let o,s,c,l=function(...t){let l=this,u=()=>{o=void 0,s&&=(clearTimeout(s),void 0),a&&(c=e.apply(l,t))},d=()=>{s=void 0,o&&=(clearTimeout(o),void 0),a&&(c=e.apply(l,t))},f=i&&!o;return clearTimeout(o),o=setTimeout(u,n),r>0&&r!==1/0&&!s&&(s=setTimeout(d,r)),f&&(c=e.apply(l,t)),c};return de(l,e),l.cancel=()=>{o&&=(clearTimeout(o),void 0),s&&=(clearTimeout(s),void 0)},l};var D=t(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),O=t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),k=t(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=D(),a=O();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),A=t(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({}),i=e=>e?typeof e==`object`?e:n:r;t.exports=i})),j=t(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},i=(e,t)=>r(t,e);t.exports={compareIdentifiers:r,rcompareIdentifiers:i}})),M=t(((e,t)=>{let n=O(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=D(),{safeRe:a,t:o}=k(),s=A(),{compareIdentifiers:c}=j();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),N=t(((e,t)=>{let n=M(),r=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}};t.exports=r})),pe=t(((e,t)=>{let n=N(),r=(e,t)=>{let r=n(e,t);return r?r.version:null};t.exports=r})),me=t(((e,t)=>{let n=N(),r=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null};t.exports=r})),he=t(((e,t)=>{let n=M(),r=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}};t.exports=r})),ge=t(((e,t)=>{let n=N(),r=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`};t.exports=r})),_e=t(((e,t)=>{let n=M(),r=(e,t)=>new n(e,t).major;t.exports=r})),ve=t(((e,t)=>{let n=M(),r=(e,t)=>new n(e,t).minor;t.exports=r})),ye=t(((e,t)=>{let n=M(),r=(e,t)=>new n(e,t).patch;t.exports=r})),be=t(((e,t)=>{let n=N(),r=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null};t.exports=r})),P=t(((e,t)=>{let n=M(),r=(e,t,r)=>new n(e,r).compare(new n(t,r));t.exports=r})),xe=t(((e,t)=>{let n=P(),r=(e,t,r)=>n(t,e,r);t.exports=r})),Se=t(((e,t)=>{let n=P(),r=(e,t)=>n(e,t,!0);t.exports=r})),F=t(((e,t)=>{let n=M(),r=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)};t.exports=r})),Ce=t(((e,t)=>{let n=F(),r=(e,t)=>e.sort((e,r)=>n(e,r,t));t.exports=r})),we=t(((e,t)=>{let n=F(),r=(e,t)=>e.sort((e,r)=>n(r,e,t));t.exports=r})),I=t(((e,t)=>{let n=P(),r=(e,t,r)=>n(e,t,r)>0;t.exports=r})),L=t(((e,t)=>{let n=P(),r=(e,t,r)=>n(e,t,r)<0;t.exports=r})),Te=t(((e,t)=>{let n=P(),r=(e,t,r)=>n(e,t,r)===0;t.exports=r})),R=t(((e,t)=>{let n=P(),r=(e,t,r)=>n(e,t,r)!==0;t.exports=r})),z=t(((e,t)=>{let n=P(),r=(e,t,r)=>n(e,t,r)>=0;t.exports=r})),B=t(((e,t)=>{let n=P(),r=(e,t,r)=>n(e,t,r)<=0;t.exports=r})),V=t(((e,t)=>{let n=Te(),r=R(),i=I(),a=z(),o=L(),s=B(),c=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}};t.exports=c})),Ee=t(((e,t)=>{let n=M(),r=N(),{safeRe:i,t:a}=k(),o=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)};t.exports=o})),De=t(((e,t)=>{var n=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};t.exports=n})),H=t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,te(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>ee(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ne(this.set[t],e,this.options))return!0;return!1}};let r=new(De()),i=A(),a=U(),o=O(),s=M(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=k(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=D(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=E(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>T(e,t)).join(` `)),T=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},E=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),ee=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),te=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ne=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),U=t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=A(),{safeRe:i,t:a}=k(),o=V(),s=O(),c=M(),l=H()})),W=t(((e,t)=>{let n=H(),r=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)};t.exports=r})),Oe=t(((e,t)=>{let n=H(),r=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `));t.exports=r})),ke=t(((e,t)=>{let n=M(),r=H(),i=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a};t.exports=i})),Ae=t(((e,t)=>{let n=M(),r=H(),i=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a};t.exports=i})),je=t(((e,t)=>{let n=M(),r=H(),i=I(),a=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null};t.exports=a})),Me=t(((e,t)=>{let n=H(),r=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}};t.exports=r})),G=t(((e,t)=>{let n=M(),r=U(),{ANY:i}=r,a=H(),o=W(),s=I(),c=L(),l=B(),u=z(),d=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0};t.exports=d})),Ne=t(((e,t)=>{let n=G(),r=(e,t,r)=>n(e,t,`>`,r);t.exports=r})),Pe=t(((e,t)=>{let n=G(),r=(e,t,r)=>n(e,t,`<`,r);t.exports=r})),Fe=t(((e,t)=>{let n=H(),r=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r));t.exports=r})),Ie=t(((e,t)=>{let n=W(),r=P();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),Le=t(((e,t)=>{let n=H(),r=U(),{ANY:i}=r,a=W(),o=P(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Re=t(((e,t)=>{let n=k(),r=D(),i=M(),a=j();t.exports={parse:N(),valid:pe(),clean:me(),inc:he(),diff:ge(),major:_e(),minor:ve(),patch:ye(),prerelease:be(),compare:P(),rcompare:xe(),compareLoose:Se(),compareBuild:F(),sort:Ce(),rsort:we(),gt:I(),lt:L(),eq:Te(),neq:R(),gte:z(),lte:B(),cmp:V(),coerce:Ee(),Comparator:U(),Range:H(),satisfies:W(),toComparators:Oe(),maxSatisfying:ke(),minSatisfying:Ae(),minVersion:je(),validRange:Me(),outside:G(),gtr:Ne(),ltr:Pe(),intersects:Fe(),simplifyRange:Ie(),subset:Le(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}));const ze=Object.prototype.toString;function Be(e,t,n){return e?e.constructor===t?!0:ze.call(e)===n:!1}function Ve(e){return Be(e,Uint8Array,`[object Uint8Array]`)}function He(e){return Be(e,ArrayBuffer,`[object ArrayBuffer]`)}function Ue(e){return Ve(e)||He(e)}function We(e){if(!Ve(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function Ge(e){if(!Ue(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function K(e,t){if(e.length===0)return new Uint8Array;t??=e.reduce((e,t)=>e+t.length,0);let n=new Uint8Array(t),r=0;for(let t of e)We(t),n.set(t,r),r+=t.length;return n}const Ke={utf8:new globalThis.TextDecoder(`utf8`)};function q(e,t=`utf8`){return Ge(e),Ke[t]??=new globalThis.TextDecoder(t),Ke[t].decode(e)}function qe(e){if(typeof e!=`string`)throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}const Je=new globalThis.TextEncoder;function J(e){return qe(e),Je.encode(e)}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));var Ye=i(),Xe=e(n(),1),Y=e(Re(),1);const Ze=`aes-256-cbc`,Qe=new Set([`aes-256-cbc`,`aes-256-gcm`,`aes-256-ctr`]),$e=e=>typeof e==`string`&&Qe.has(e),X=()=>Object.create(null),et=e=>e!==void 0,Z=(e,t)=>{let n=new Set([`undefined`,`symbol`,`function`]),r=typeof t;if(n.has(r))throw TypeError(`Setting a value of type \`${r}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},Q=`__internal__`,$=`${Q}.migrations.version`;var tt=class{path;events;#e;#t;#n;#r;#i={};#a=!1;#o;#s;#c;constructor(e={}){let t=this.#l(e);this.#r=t,this.#u(t),this.#f(t),this.#p(t),this.events=new EventTarget,this.#t=t.encryptionKey,this.#n=t.encryptionAlgorithm??Ze,this.path=this.#m(t),this.#h(t),t.watch&&this._watch()}get(e,t){if(this.#r.accessPropertiesByDotNotation)return this._get(e,t);let{store:n}=this;return e in n?n[e]:t}set(e,t){if(typeof e!=`string`&&typeof e!=`object`)throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=`object`&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${Q} key, as it's used to manage this module internal operations.`);let{store:n}=this,r=(e,t)=>{if(Z(e,t),this.#r.accessPropertiesByDotNotation)x(n,e,t);else{if(e===`__proto__`||e===`constructor`||e===`prototype`)return;n[e]=t}};if(typeof e==`object`){let t=e;for(let[e,n]of Object.entries(t))r(e,n)}else r(e,t);this.store=n}has(e){return this.#r.accessPropertiesByDotNotation?C(this.store,e):e in this.store}appendToArray(e,t){Z(e,t);let n=this.#r.accessPropertiesByDotNotation?this._get(e,[]):e in this.store?this.store[e]:[];if(!Array.isArray(n))throw TypeError(`The key \`${e}\` is already set to a non-array value`);this.set(e,[...n,t])}reset(...e){for(let t of e)et(this.#i[t])&&this.set(t,this.#i[t])}delete(e){let{store:t}=this;this.#r.accessPropertiesByDotNotation?S(t,e):delete t[e],this.store=t}clear(){let e=X();for(let t of Object.keys(this.#i))et(this.#i[t])&&(Z(t,this.#i[t]),this.#r.accessPropertiesByDotNotation?x(e,t,this.#i[t]):e[t]=this.#i[t]);this.store=e}onDidChange(e,t){if(typeof e!=`string`)throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=`function`)throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleValueChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=`function`)throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleStoreChange(e)}get size(){return Object.keys(this.store).filter(e=>!this._isReservedKeyPath(e)).length}get store(){try{let e=s.readFileSync(this.path,this.#t?null:`utf8`),t=this._decryptData(e),n=e=>{let t=this._deserialize(e);return this.#a||this._validate(t),Object.assign(X(),t)};return n(t)}catch(e){if(e?.code===`ENOENT`)return this._ensureDirectory(),X();if(this.#r.clearInvalidConfig){let t=e;if(t.name===`SyntaxError`||t.message?.startsWith(`Config schema violation:`)||t.message===`Failed to decrypt config data.`)return X()}throw e}}set store(e){if(this._ensureDirectory(),!C(e,Q))try{let t=s.readFileSync(this.path,this.#t?null:`utf8`),n=this._decryptData(t),r=this._deserialize(n);C(r,Q)&&x(e,Q,b(r,Q))}catch{}this.#a||this._validate(e),this._write(e),this.events.dispatchEvent(new Event(`change`))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))this._isReservedKeyPath(e)||(yield[e,t])}_closeWatcher(){this.#o&&=(this.#o.close(),void 0),this.#s&&=(s.unwatchFile(this.path),!1),this.#c=void 0}_decryptData(e){let t=this.#t;if(!t)return typeof e==`string`?e:q(e);let n=this.#n,r=n===`aes-256-gcm`?16:0,i=`:`.codePointAt(0),a=typeof e==`string`?e.codePointAt(16):e[16];if(!(i!==void 0&&a===i)){if(n===`aes-256-cbc`)return typeof e==`string`?e:q(e);throw Error(`Failed to decrypt config data.`)}let o=e=>{if(r===0)return{ciphertext:e};let t=e.length-r;if(t<0)throw Error(`Invalid authentication tag length.`);return{ciphertext:e.slice(0,t),authenticationTag:e.slice(t)}},s=e.slice(0,16),c=e.slice(17),l=typeof c==`string`?J(c):c,d=e=>{let{ciphertext:r,authenticationTag:i}=o(l),a=u.pbkdf2Sync(t,e,1e4,32,`sha512`),c=u.createDecipheriv(n,a,s);return i&&c.setAuthTag(i),q(K([c.update(r),c.final()]))};try{return d(s)}catch{try{return d(s.toString())}catch{}}if(n===`aes-256-cbc`)return typeof e==`string`?e:q(e);throw Error(`Failed to decrypt config data.`)}_handleStoreChange(e){let t=this.store,n=()=>{let n=t,r=this.store;a(r,n)||(t=r,e.call(this,r,n))};return this.events.addEventListener(`change`,n),()=>{this.events.removeEventListener(`change`,n)}}_handleValueChange(e,t){let n=e(),r=()=>{let r=n,i=e();a(i,r)||(n=i,t.call(this,i,r))};return this.events.addEventListener(`change`,r),()=>{this.events.removeEventListener(`change`,r)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0,` `);_validate(e){if(!this.#e||this.#e(e)||!this.#e.errors)return;let t=this.#e.errors.map(({instancePath:e,message:t=``})=>`\`${e.slice(1)}\` ${t}`);throw Error(`Config schema violation: `+t.join(`; `))}_ensureDirectory(){s.mkdirSync(o.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e),n=this.#t;if(n){let e=u.randomBytes(16),r=u.pbkdf2Sync(n,e,1e4,32,`sha512`),i=u.createCipheriv(this.#n,r,e),a=K([i.update(J(t)),i.final()]),o=[e,J(`:`),a];this.#n===`aes-256-gcm`&&o.push(i.getAuthTag()),t=K(o)}if(l.env.SNAP)s.writeFileSync(this.path,t,{mode:this.#r.configFileMode});else try{r(this.path,t,{mode:this.#r.configFileMode})}catch(e){if(e?.code===`EXDEV`){s.writeFileSync(this.path,t,{mode:this.#r.configFileMode});return}throw e}}_watch(){if(this._ensureDirectory(),s.existsSync(this.path)||this._write(X()),l.platform===`win32`||l.platform===`darwin`){this.#c??=fe(()=>{this.events.dispatchEvent(new Event(`change`))},{wait:100});let e=o.dirname(this.path),t=o.basename(this.path);this.#o=s.watch(e,{persistent:!1,encoding:`utf8`},(e,n)=>{n&&n!==t||typeof this.#c==`function`&&this.#c()})}else this.#c??=fe(()=>{this.events.dispatchEvent(new Event(`change`))},{wait:1e3}),s.watchFile(this.path,{persistent:!1},(e,t)=>{typeof this.#c==`function`&&this.#c()}),this.#s=!0}_migrate(e,t,n){let r=this._get($,`0.0.0`),i=Object.keys(e).filter(e=>this._shouldPerformMigration(e,r,t)),a=structuredClone(this.store);for(let o of i)try{n&&n(this,{fromVersion:r,toVersion:o,finalVersion:t,versions:i});let s=e[o];s?.(this),this._set($,o),r=o,a=structuredClone(this.store)}catch(e){this.store=a;let t=e instanceof Error?e.message:String(e);throw Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${t}`)}(this._isVersionInRangeFormat(r)||!Y.default.eq(r,t))&&this._set($,t)}_containsReservedKey(e){return typeof e==`string`?this._isReservedKeyPath(e):!e||typeof e!=`object`?!1:this._objectContainsReservedKey(e)}_objectContainsReservedKey(e){if(!e||typeof e!=`object`)return!1;for(let[t,n]of Object.entries(e))if(this._isReservedKeyPath(t)||this._objectContainsReservedKey(n))return!0;return!1}_isReservedKeyPath(e){return e===Q||e.startsWith(`${Q}.`)}_isVersionInRangeFormat(e){return Y.default.clean(e)===null}_shouldPerformMigration(e,t,n){return this._isVersionInRangeFormat(e)?t!==`0.0.0`&&Y.default.satisfies(t,e)?!1:Y.default.satisfies(n,e):!(Y.default.lte(e,t)||Y.default.gt(e,n))}_get(e,t){return b(this.store,e,t)}_set(e,t){let{store:n}=this;x(n,e,t),this.store=n}#l(e){let t={configName:`config`,fileExtension:`json`,projectSuffix:`nodejs`,clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(t.encryptionAlgorithm??=Ze,!$e(t.encryptionAlgorithm))throw TypeError(`The \`encryptionAlgorithm\` option must be one of: ${[...Qe].join(`, `)}`);if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=re(t.projectName,{suffix:t.projectSuffix}).config}return typeof t.fileExtension==`string`&&(t.fileExtension=t.fileExtension.replace(/^\.+/,``)),t}#u(e){if(!(e.schema??e.ajvOptions??e.rootSchema))return;if(e.schema&&typeof e.schema!=`object`)throw TypeError("The `schema` option must be an object.");let t=Xe.default.default,n=new Ye.Ajv2020({allErrors:!0,useDefaults:!0,...e.ajvOptions});t(n);let r={...e.rootSchema,type:`object`,properties:e.schema};this.#e=n.compile(r),this.#d(e.schema)}#d(e){let t=Object.entries(e??{});for(let[e,n]of t){if(!n||typeof n!=`object`||!Object.hasOwn(n,`default`))continue;let{default:t}=n;t!==void 0&&(this.#i[e]=t)}}#f(e){e.defaults&&Object.assign(this.#i,e.defaults)}#p(e){e.serialize&&(this._serialize=e.serialize),e.deserialize&&(this._deserialize=e.deserialize)}#m(e){let t=typeof e.fileExtension==`string`?e.fileExtension:void 0,n=t?`.${t}`:``;return o.resolve(e.cwd,`${e.configName??`config`}${n}`)}#h(e){if(e.migrations){this.#g(e),this._validate(this.store);return}let t=this.store,n=Object.assign(X(),e.defaults??{},t);this._validate(n);try{d.deepEqual(t,n)}catch{this.store=n}}#g(e){let{migrations:t,projectVersion:n}=e;if(t){if(!n)throw Error("Please specify the `projectVersion` option.");this.#a=!0;try{let r=this.store,i=Object.assign(X(),e.defaults??{},r);try{d.deepEqual(r,i)}catch{this._write(i)}this._migrate(t,n,e.beforeEachMigration)}finally{this.#a=!1}}}};export{Re as n,tt as t};
|