@storybook/nextjs-vite 10.0.0-beta.1 → 10.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_vdcj7jnvotc from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_vdcj7jnvotc from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_vdcj7jnvotc from "node:module";
1
+ import CJS_COMPAT_NODE_URL_q2ak3cgnwtp from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_q2ak3cgnwtp from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_q2ak3cgnwtp from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_vdcj7jnvotc.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_vdcj7jnvotc.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_vdcj7jnvotc.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_q2ak3cgnwtp.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_q2ak3cgnwtp.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_q2ak3cgnwtp.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -14,12 +14,1932 @@ import {
14
14
  __name,
15
15
  __require,
16
16
  __toESM
17
- } from "./_node-chunks/chunk-IRJBSU6R.js";
17
+ } from "./_node-chunks/chunk-PV5XU2CA.js";
18
18
 
19
- // ../../node_modules/postcss-load-config/node_modules/lilconfig/src/index.js
19
+ // ../../node_modules/semver/internal/constants.js
20
+ var require_constants = __commonJS({
21
+ "../../node_modules/semver/internal/constants.js"(exports, module) {
22
+ "use strict";
23
+ var SEMVER_SPEC_VERSION = "2.0.0";
24
+ var MAX_LENGTH = 256;
25
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
26
+ 9007199254740991;
27
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
28
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
29
+ var RELEASE_TYPES = [
30
+ "major",
31
+ "premajor",
32
+ "minor",
33
+ "preminor",
34
+ "patch",
35
+ "prepatch",
36
+ "prerelease"
37
+ ];
38
+ module.exports = {
39
+ MAX_LENGTH,
40
+ MAX_SAFE_COMPONENT_LENGTH,
41
+ MAX_SAFE_BUILD_LENGTH,
42
+ MAX_SAFE_INTEGER,
43
+ RELEASE_TYPES,
44
+ SEMVER_SPEC_VERSION,
45
+ FLAG_INCLUDE_PRERELEASE: 1,
46
+ FLAG_LOOSE: 2
47
+ };
48
+ }
49
+ });
50
+
51
+ // ../../node_modules/semver/internal/debug.js
52
+ var require_debug = __commonJS({
53
+ "../../node_modules/semver/internal/debug.js"(exports, module) {
54
+ "use strict";
55
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
56
+ };
57
+ module.exports = debug;
58
+ }
59
+ });
60
+
61
+ // ../../node_modules/semver/internal/re.js
62
+ var require_re = __commonJS({
63
+ "../../node_modules/semver/internal/re.js"(exports, module) {
64
+ "use strict";
65
+ var {
66
+ MAX_SAFE_COMPONENT_LENGTH,
67
+ MAX_SAFE_BUILD_LENGTH,
68
+ MAX_LENGTH
69
+ } = require_constants();
70
+ var debug = require_debug();
71
+ exports = module.exports = {};
72
+ var re = exports.re = [];
73
+ var safeRe = exports.safeRe = [];
74
+ var src = exports.src = [];
75
+ var safeSrc = exports.safeSrc = [];
76
+ var t = exports.t = {};
77
+ var R = 0;
78
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
79
+ var safeRegexReplacements = [
80
+ ["\\s", 1],
81
+ ["\\d", MAX_LENGTH],
82
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
83
+ ];
84
+ var makeSafeRegex = /* @__PURE__ */ __name((value) => {
85
+ for (const [token, max] of safeRegexReplacements) {
86
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
87
+ }
88
+ return value;
89
+ }, "makeSafeRegex");
90
+ var createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
91
+ const safe = makeSafeRegex(value);
92
+ const index = R++;
93
+ debug(name, index, value);
94
+ t[name] = index;
95
+ src[index] = value;
96
+ safeSrc[index] = safe;
97
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
98
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
99
+ }, "createToken");
100
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
101
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
102
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
103
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
104
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
105
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
106
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
107
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
108
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
109
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
110
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
111
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
112
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
113
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
114
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
115
+ createToken("GTLT", "((?:<|>)?=?)");
116
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
117
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
118
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
119
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
120
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
121
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
122
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
123
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
124
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
125
+ createToken("COERCERTL", src[t.COERCE], true);
126
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
127
+ createToken("LONETILDE", "(?:~>?)");
128
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
129
+ exports.tildeTrimReplace = "$1~";
130
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
131
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
132
+ createToken("LONECARET", "(?:\\^)");
133
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
134
+ exports.caretTrimReplace = "$1^";
135
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
136
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
137
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
138
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
139
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
140
+ exports.comparatorTrimReplace = "$1$2$3";
141
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
142
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
143
+ createToken("STAR", "(<|>)?=?\\s*\\*");
144
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
145
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
146
+ }
147
+ });
148
+
149
+ // ../../node_modules/semver/internal/parse-options.js
150
+ var require_parse_options = __commonJS({
151
+ "../../node_modules/semver/internal/parse-options.js"(exports, module) {
152
+ "use strict";
153
+ var looseOption = Object.freeze({ loose: true });
154
+ var emptyOpts = Object.freeze({});
155
+ var parseOptions = /* @__PURE__ */ __name((options) => {
156
+ if (!options) {
157
+ return emptyOpts;
158
+ }
159
+ if (typeof options !== "object") {
160
+ return looseOption;
161
+ }
162
+ return options;
163
+ }, "parseOptions");
164
+ module.exports = parseOptions;
165
+ }
166
+ });
167
+
168
+ // ../../node_modules/semver/internal/identifiers.js
169
+ var require_identifiers = __commonJS({
170
+ "../../node_modules/semver/internal/identifiers.js"(exports, module) {
171
+ "use strict";
172
+ var numeric = /^[0-9]+$/;
173
+ var compareIdentifiers = /* @__PURE__ */ __name((a, b) => {
174
+ const anum = numeric.test(a);
175
+ const bnum = numeric.test(b);
176
+ if (anum && bnum) {
177
+ a = +a;
178
+ b = +b;
179
+ }
180
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
181
+ }, "compareIdentifiers");
182
+ var rcompareIdentifiers = /* @__PURE__ */ __name((a, b) => compareIdentifiers(b, a), "rcompareIdentifiers");
183
+ module.exports = {
184
+ compareIdentifiers,
185
+ rcompareIdentifiers
186
+ };
187
+ }
188
+ });
189
+
190
+ // ../../node_modules/semver/classes/semver.js
191
+ var require_semver = __commonJS({
192
+ "../../node_modules/semver/classes/semver.js"(exports, module) {
193
+ "use strict";
194
+ var debug = require_debug();
195
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
196
+ var { safeRe: re, t } = require_re();
197
+ var parseOptions = require_parse_options();
198
+ var { compareIdentifiers } = require_identifiers();
199
+ var SemVer = class _SemVer {
200
+ static {
201
+ __name(this, "SemVer");
202
+ }
203
+ constructor(version, options) {
204
+ options = parseOptions(options);
205
+ if (version instanceof _SemVer) {
206
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
207
+ return version;
208
+ } else {
209
+ version = version.version;
210
+ }
211
+ } else if (typeof version !== "string") {
212
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
213
+ }
214
+ if (version.length > MAX_LENGTH) {
215
+ throw new TypeError(
216
+ `version is longer than ${MAX_LENGTH} characters`
217
+ );
218
+ }
219
+ debug("SemVer", version, options);
220
+ this.options = options;
221
+ this.loose = !!options.loose;
222
+ this.includePrerelease = !!options.includePrerelease;
223
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
224
+ if (!m) {
225
+ throw new TypeError(`Invalid Version: ${version}`);
226
+ }
227
+ this.raw = version;
228
+ this.major = +m[1];
229
+ this.minor = +m[2];
230
+ this.patch = +m[3];
231
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
232
+ throw new TypeError("Invalid major version");
233
+ }
234
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
235
+ throw new TypeError("Invalid minor version");
236
+ }
237
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
238
+ throw new TypeError("Invalid patch version");
239
+ }
240
+ if (!m[4]) {
241
+ this.prerelease = [];
242
+ } else {
243
+ this.prerelease = m[4].split(".").map((id) => {
244
+ if (/^[0-9]+$/.test(id)) {
245
+ const num = +id;
246
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
247
+ return num;
248
+ }
249
+ }
250
+ return id;
251
+ });
252
+ }
253
+ this.build = m[5] ? m[5].split(".") : [];
254
+ this.format();
255
+ }
256
+ format() {
257
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
258
+ if (this.prerelease.length) {
259
+ this.version += `-${this.prerelease.join(".")}`;
260
+ }
261
+ return this.version;
262
+ }
263
+ toString() {
264
+ return this.version;
265
+ }
266
+ compare(other) {
267
+ debug("SemVer.compare", this.version, this.options, other);
268
+ if (!(other instanceof _SemVer)) {
269
+ if (typeof other === "string" && other === this.version) {
270
+ return 0;
271
+ }
272
+ other = new _SemVer(other, this.options);
273
+ }
274
+ if (other.version === this.version) {
275
+ return 0;
276
+ }
277
+ return this.compareMain(other) || this.comparePre(other);
278
+ }
279
+ compareMain(other) {
280
+ if (!(other instanceof _SemVer)) {
281
+ other = new _SemVer(other, this.options);
282
+ }
283
+ return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
284
+ }
285
+ comparePre(other) {
286
+ if (!(other instanceof _SemVer)) {
287
+ other = new _SemVer(other, this.options);
288
+ }
289
+ if (this.prerelease.length && !other.prerelease.length) {
290
+ return -1;
291
+ } else if (!this.prerelease.length && other.prerelease.length) {
292
+ return 1;
293
+ } else if (!this.prerelease.length && !other.prerelease.length) {
294
+ return 0;
295
+ }
296
+ let i = 0;
297
+ do {
298
+ const a = this.prerelease[i];
299
+ const b = other.prerelease[i];
300
+ debug("prerelease compare", i, a, b);
301
+ if (a === void 0 && b === void 0) {
302
+ return 0;
303
+ } else if (b === void 0) {
304
+ return 1;
305
+ } else if (a === void 0) {
306
+ return -1;
307
+ } else if (a === b) {
308
+ continue;
309
+ } else {
310
+ return compareIdentifiers(a, b);
311
+ }
312
+ } while (++i);
313
+ }
314
+ compareBuild(other) {
315
+ if (!(other instanceof _SemVer)) {
316
+ other = new _SemVer(other, this.options);
317
+ }
318
+ let i = 0;
319
+ do {
320
+ const a = this.build[i];
321
+ const b = other.build[i];
322
+ debug("build compare", i, a, b);
323
+ if (a === void 0 && b === void 0) {
324
+ return 0;
325
+ } else if (b === void 0) {
326
+ return 1;
327
+ } else if (a === void 0) {
328
+ return -1;
329
+ } else if (a === b) {
330
+ continue;
331
+ } else {
332
+ return compareIdentifiers(a, b);
333
+ }
334
+ } while (++i);
335
+ }
336
+ // preminor will bump the version up to the next minor release, and immediately
337
+ // down to pre-release. premajor and prepatch work the same way.
338
+ inc(release, identifier, identifierBase) {
339
+ if (release.startsWith("pre")) {
340
+ if (!identifier && identifierBase === false) {
341
+ throw new Error("invalid increment argument: identifier is empty");
342
+ }
343
+ if (identifier) {
344
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
345
+ if (!match || match[1] !== identifier) {
346
+ throw new Error(`invalid identifier: ${identifier}`);
347
+ }
348
+ }
349
+ }
350
+ switch (release) {
351
+ case "premajor":
352
+ this.prerelease.length = 0;
353
+ this.patch = 0;
354
+ this.minor = 0;
355
+ this.major++;
356
+ this.inc("pre", identifier, identifierBase);
357
+ break;
358
+ case "preminor":
359
+ this.prerelease.length = 0;
360
+ this.patch = 0;
361
+ this.minor++;
362
+ this.inc("pre", identifier, identifierBase);
363
+ break;
364
+ case "prepatch":
365
+ this.prerelease.length = 0;
366
+ this.inc("patch", identifier, identifierBase);
367
+ this.inc("pre", identifier, identifierBase);
368
+ break;
369
+ // If the input is a non-prerelease version, this acts the same as
370
+ // prepatch.
371
+ case "prerelease":
372
+ if (this.prerelease.length === 0) {
373
+ this.inc("patch", identifier, identifierBase);
374
+ }
375
+ this.inc("pre", identifier, identifierBase);
376
+ break;
377
+ case "release":
378
+ if (this.prerelease.length === 0) {
379
+ throw new Error(`version ${this.raw} is not a prerelease`);
380
+ }
381
+ this.prerelease.length = 0;
382
+ break;
383
+ case "major":
384
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
385
+ this.major++;
386
+ }
387
+ this.minor = 0;
388
+ this.patch = 0;
389
+ this.prerelease = [];
390
+ break;
391
+ case "minor":
392
+ if (this.patch !== 0 || this.prerelease.length === 0) {
393
+ this.minor++;
394
+ }
395
+ this.patch = 0;
396
+ this.prerelease = [];
397
+ break;
398
+ case "patch":
399
+ if (this.prerelease.length === 0) {
400
+ this.patch++;
401
+ }
402
+ this.prerelease = [];
403
+ break;
404
+ // This probably shouldn't be used publicly.
405
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
406
+ case "pre": {
407
+ const base = Number(identifierBase) ? 1 : 0;
408
+ if (this.prerelease.length === 0) {
409
+ this.prerelease = [base];
410
+ } else {
411
+ let i = this.prerelease.length;
412
+ while (--i >= 0) {
413
+ if (typeof this.prerelease[i] === "number") {
414
+ this.prerelease[i]++;
415
+ i = -2;
416
+ }
417
+ }
418
+ if (i === -1) {
419
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
420
+ throw new Error("invalid increment argument: identifier already exists");
421
+ }
422
+ this.prerelease.push(base);
423
+ }
424
+ }
425
+ if (identifier) {
426
+ let prerelease = [identifier, base];
427
+ if (identifierBase === false) {
428
+ prerelease = [identifier];
429
+ }
430
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
431
+ if (isNaN(this.prerelease[1])) {
432
+ this.prerelease = prerelease;
433
+ }
434
+ } else {
435
+ this.prerelease = prerelease;
436
+ }
437
+ }
438
+ break;
439
+ }
440
+ default:
441
+ throw new Error(`invalid increment argument: ${release}`);
442
+ }
443
+ this.raw = this.format();
444
+ if (this.build.length) {
445
+ this.raw += `+${this.build.join(".")}`;
446
+ }
447
+ return this;
448
+ }
449
+ };
450
+ module.exports = SemVer;
451
+ }
452
+ });
453
+
454
+ // ../../node_modules/semver/functions/parse.js
455
+ var require_parse = __commonJS({
456
+ "../../node_modules/semver/functions/parse.js"(exports, module) {
457
+ "use strict";
458
+ var SemVer = require_semver();
459
+ var parse2 = /* @__PURE__ */ __name((version, options, throwErrors = false) => {
460
+ if (version instanceof SemVer) {
461
+ return version;
462
+ }
463
+ try {
464
+ return new SemVer(version, options);
465
+ } catch (er) {
466
+ if (!throwErrors) {
467
+ return null;
468
+ }
469
+ throw er;
470
+ }
471
+ }, "parse");
472
+ module.exports = parse2;
473
+ }
474
+ });
475
+
476
+ // ../../node_modules/semver/functions/valid.js
477
+ var require_valid = __commonJS({
478
+ "../../node_modules/semver/functions/valid.js"(exports, module) {
479
+ "use strict";
480
+ var parse2 = require_parse();
481
+ var valid = /* @__PURE__ */ __name((version, options) => {
482
+ const v = parse2(version, options);
483
+ return v ? v.version : null;
484
+ }, "valid");
485
+ module.exports = valid;
486
+ }
487
+ });
488
+
489
+ // ../../node_modules/semver/functions/clean.js
490
+ var require_clean = __commonJS({
491
+ "../../node_modules/semver/functions/clean.js"(exports, module) {
492
+ "use strict";
493
+ var parse2 = require_parse();
494
+ var clean = /* @__PURE__ */ __name((version, options) => {
495
+ const s = parse2(version.trim().replace(/^[=v]+/, ""), options);
496
+ return s ? s.version : null;
497
+ }, "clean");
498
+ module.exports = clean;
499
+ }
500
+ });
501
+
502
+ // ../../node_modules/semver/functions/inc.js
503
+ var require_inc = __commonJS({
504
+ "../../node_modules/semver/functions/inc.js"(exports, module) {
505
+ "use strict";
506
+ var SemVer = require_semver();
507
+ var inc = /* @__PURE__ */ __name((version, release, options, identifier, identifierBase) => {
508
+ if (typeof options === "string") {
509
+ identifierBase = identifier;
510
+ identifier = options;
511
+ options = void 0;
512
+ }
513
+ try {
514
+ return new SemVer(
515
+ version instanceof SemVer ? version.version : version,
516
+ options
517
+ ).inc(release, identifier, identifierBase).version;
518
+ } catch (er) {
519
+ return null;
520
+ }
521
+ }, "inc");
522
+ module.exports = inc;
523
+ }
524
+ });
525
+
526
+ // ../../node_modules/semver/functions/diff.js
527
+ var require_diff = __commonJS({
528
+ "../../node_modules/semver/functions/diff.js"(exports, module) {
529
+ "use strict";
530
+ var parse2 = require_parse();
531
+ var diff = /* @__PURE__ */ __name((version1, version2) => {
532
+ const v1 = parse2(version1, null, true);
533
+ const v2 = parse2(version2, null, true);
534
+ const comparison = v1.compare(v2);
535
+ if (comparison === 0) {
536
+ return null;
537
+ }
538
+ const v1Higher = comparison > 0;
539
+ const highVersion = v1Higher ? v1 : v2;
540
+ const lowVersion = v1Higher ? v2 : v1;
541
+ const highHasPre = !!highVersion.prerelease.length;
542
+ const lowHasPre = !!lowVersion.prerelease.length;
543
+ if (lowHasPre && !highHasPre) {
544
+ if (!lowVersion.patch && !lowVersion.minor) {
545
+ return "major";
546
+ }
547
+ if (lowVersion.compareMain(highVersion) === 0) {
548
+ if (lowVersion.minor && !lowVersion.patch) {
549
+ return "minor";
550
+ }
551
+ return "patch";
552
+ }
553
+ }
554
+ const prefix = highHasPre ? "pre" : "";
555
+ if (v1.major !== v2.major) {
556
+ return prefix + "major";
557
+ }
558
+ if (v1.minor !== v2.minor) {
559
+ return prefix + "minor";
560
+ }
561
+ if (v1.patch !== v2.patch) {
562
+ return prefix + "patch";
563
+ }
564
+ return "prerelease";
565
+ }, "diff");
566
+ module.exports = diff;
567
+ }
568
+ });
569
+
570
+ // ../../node_modules/semver/functions/major.js
571
+ var require_major = __commonJS({
572
+ "../../node_modules/semver/functions/major.js"(exports, module) {
573
+ "use strict";
574
+ var SemVer = require_semver();
575
+ var major = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).major, "major");
576
+ module.exports = major;
577
+ }
578
+ });
579
+
580
+ // ../../node_modules/semver/functions/minor.js
581
+ var require_minor = __commonJS({
582
+ "../../node_modules/semver/functions/minor.js"(exports, module) {
583
+ "use strict";
584
+ var SemVer = require_semver();
585
+ var minor = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).minor, "minor");
586
+ module.exports = minor;
587
+ }
588
+ });
589
+
590
+ // ../../node_modules/semver/functions/patch.js
591
+ var require_patch = __commonJS({
592
+ "../../node_modules/semver/functions/patch.js"(exports, module) {
593
+ "use strict";
594
+ var SemVer = require_semver();
595
+ var patch = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).patch, "patch");
596
+ module.exports = patch;
597
+ }
598
+ });
599
+
600
+ // ../../node_modules/semver/functions/prerelease.js
601
+ var require_prerelease = __commonJS({
602
+ "../../node_modules/semver/functions/prerelease.js"(exports, module) {
603
+ "use strict";
604
+ var parse2 = require_parse();
605
+ var prerelease = /* @__PURE__ */ __name((version, options) => {
606
+ const parsed = parse2(version, options);
607
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
608
+ }, "prerelease");
609
+ module.exports = prerelease;
610
+ }
611
+ });
612
+
613
+ // ../../node_modules/semver/functions/compare.js
614
+ var require_compare = __commonJS({
615
+ "../../node_modules/semver/functions/compare.js"(exports, module) {
616
+ "use strict";
617
+ var SemVer = require_semver();
618
+ var compare = /* @__PURE__ */ __name((a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)), "compare");
619
+ module.exports = compare;
620
+ }
621
+ });
622
+
623
+ // ../../node_modules/semver/functions/rcompare.js
624
+ var require_rcompare = __commonJS({
625
+ "../../node_modules/semver/functions/rcompare.js"(exports, module) {
626
+ "use strict";
627
+ var compare = require_compare();
628
+ var rcompare = /* @__PURE__ */ __name((a, b, loose) => compare(b, a, loose), "rcompare");
629
+ module.exports = rcompare;
630
+ }
631
+ });
632
+
633
+ // ../../node_modules/semver/functions/compare-loose.js
634
+ var require_compare_loose = __commonJS({
635
+ "../../node_modules/semver/functions/compare-loose.js"(exports, module) {
636
+ "use strict";
637
+ var compare = require_compare();
638
+ var compareLoose = /* @__PURE__ */ __name((a, b) => compare(a, b, true), "compareLoose");
639
+ module.exports = compareLoose;
640
+ }
641
+ });
642
+
643
+ // ../../node_modules/semver/functions/compare-build.js
644
+ var require_compare_build = __commonJS({
645
+ "../../node_modules/semver/functions/compare-build.js"(exports, module) {
646
+ "use strict";
647
+ var SemVer = require_semver();
648
+ var compareBuild = /* @__PURE__ */ __name((a, b, loose) => {
649
+ const versionA = new SemVer(a, loose);
650
+ const versionB = new SemVer(b, loose);
651
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
652
+ }, "compareBuild");
653
+ module.exports = compareBuild;
654
+ }
655
+ });
656
+
657
+ // ../../node_modules/semver/functions/sort.js
658
+ var require_sort = __commonJS({
659
+ "../../node_modules/semver/functions/sort.js"(exports, module) {
660
+ "use strict";
661
+ var compareBuild = require_compare_build();
662
+ var sort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(a, b, loose)), "sort");
663
+ module.exports = sort;
664
+ }
665
+ });
666
+
667
+ // ../../node_modules/semver/functions/rsort.js
668
+ var require_rsort = __commonJS({
669
+ "../../node_modules/semver/functions/rsort.js"(exports, module) {
670
+ "use strict";
671
+ var compareBuild = require_compare_build();
672
+ var rsort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(b, a, loose)), "rsort");
673
+ module.exports = rsort;
674
+ }
675
+ });
676
+
677
+ // ../../node_modules/semver/functions/gt.js
678
+ var require_gt = __commonJS({
679
+ "../../node_modules/semver/functions/gt.js"(exports, module) {
680
+ "use strict";
681
+ var compare = require_compare();
682
+ var gt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) > 0, "gt");
683
+ module.exports = gt;
684
+ }
685
+ });
686
+
687
+ // ../../node_modules/semver/functions/lt.js
688
+ var require_lt = __commonJS({
689
+ "../../node_modules/semver/functions/lt.js"(exports, module) {
690
+ "use strict";
691
+ var compare = require_compare();
692
+ var lt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) < 0, "lt");
693
+ module.exports = lt;
694
+ }
695
+ });
696
+
697
+ // ../../node_modules/semver/functions/eq.js
698
+ var require_eq = __commonJS({
699
+ "../../node_modules/semver/functions/eq.js"(exports, module) {
700
+ "use strict";
701
+ var compare = require_compare();
702
+ var eq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) === 0, "eq");
703
+ module.exports = eq;
704
+ }
705
+ });
706
+
707
+ // ../../node_modules/semver/functions/neq.js
708
+ var require_neq = __commonJS({
709
+ "../../node_modules/semver/functions/neq.js"(exports, module) {
710
+ "use strict";
711
+ var compare = require_compare();
712
+ var neq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) !== 0, "neq");
713
+ module.exports = neq;
714
+ }
715
+ });
716
+
717
+ // ../../node_modules/semver/functions/gte.js
718
+ var require_gte = __commonJS({
719
+ "../../node_modules/semver/functions/gte.js"(exports, module) {
720
+ "use strict";
721
+ var compare = require_compare();
722
+ var gte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) >= 0, "gte");
723
+ module.exports = gte;
724
+ }
725
+ });
726
+
727
+ // ../../node_modules/semver/functions/lte.js
728
+ var require_lte = __commonJS({
729
+ "../../node_modules/semver/functions/lte.js"(exports, module) {
730
+ "use strict";
731
+ var compare = require_compare();
732
+ var lte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) <= 0, "lte");
733
+ module.exports = lte;
734
+ }
735
+ });
736
+
737
+ // ../../node_modules/semver/functions/cmp.js
738
+ var require_cmp = __commonJS({
739
+ "../../node_modules/semver/functions/cmp.js"(exports, module) {
740
+ "use strict";
741
+ var eq = require_eq();
742
+ var neq = require_neq();
743
+ var gt = require_gt();
744
+ var gte = require_gte();
745
+ var lt = require_lt();
746
+ var lte = require_lte();
747
+ var cmp = /* @__PURE__ */ __name((a, op, b, loose) => {
748
+ switch (op) {
749
+ case "===":
750
+ if (typeof a === "object") {
751
+ a = a.version;
752
+ }
753
+ if (typeof b === "object") {
754
+ b = b.version;
755
+ }
756
+ return a === b;
757
+ case "!==":
758
+ if (typeof a === "object") {
759
+ a = a.version;
760
+ }
761
+ if (typeof b === "object") {
762
+ b = b.version;
763
+ }
764
+ return a !== b;
765
+ case "":
766
+ case "=":
767
+ case "==":
768
+ return eq(a, b, loose);
769
+ case "!=":
770
+ return neq(a, b, loose);
771
+ case ">":
772
+ return gt(a, b, loose);
773
+ case ">=":
774
+ return gte(a, b, loose);
775
+ case "<":
776
+ return lt(a, b, loose);
777
+ case "<=":
778
+ return lte(a, b, loose);
779
+ default:
780
+ throw new TypeError(`Invalid operator: ${op}`);
781
+ }
782
+ }, "cmp");
783
+ module.exports = cmp;
784
+ }
785
+ });
786
+
787
+ // ../../node_modules/semver/functions/coerce.js
788
+ var require_coerce = __commonJS({
789
+ "../../node_modules/semver/functions/coerce.js"(exports, module) {
790
+ "use strict";
791
+ var SemVer = require_semver();
792
+ var parse2 = require_parse();
793
+ var { safeRe: re, t } = require_re();
794
+ var coerce = /* @__PURE__ */ __name((version, options) => {
795
+ if (version instanceof SemVer) {
796
+ return version;
797
+ }
798
+ if (typeof version === "number") {
799
+ version = String(version);
800
+ }
801
+ if (typeof version !== "string") {
802
+ return null;
803
+ }
804
+ options = options || {};
805
+ let match = null;
806
+ if (!options.rtl) {
807
+ match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
808
+ } else {
809
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
810
+ let next;
811
+ while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
812
+ if (!match || next.index + next[0].length !== match.index + match[0].length) {
813
+ match = next;
814
+ }
815
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
816
+ }
817
+ coerceRtlRegex.lastIndex = -1;
818
+ }
819
+ if (match === null) {
820
+ return null;
821
+ }
822
+ const major = match[2];
823
+ const minor = match[3] || "0";
824
+ const patch = match[4] || "0";
825
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
826
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
827
+ return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options);
828
+ }, "coerce");
829
+ module.exports = coerce;
830
+ }
831
+ });
832
+
833
+ // ../../node_modules/semver/internal/lrucache.js
834
+ var require_lrucache = __commonJS({
835
+ "../../node_modules/semver/internal/lrucache.js"(exports, module) {
836
+ "use strict";
837
+ var LRUCache = class {
838
+ static {
839
+ __name(this, "LRUCache");
840
+ }
841
+ constructor() {
842
+ this.max = 1e3;
843
+ this.map = /* @__PURE__ */ new Map();
844
+ }
845
+ get(key) {
846
+ const value = this.map.get(key);
847
+ if (value === void 0) {
848
+ return void 0;
849
+ } else {
850
+ this.map.delete(key);
851
+ this.map.set(key, value);
852
+ return value;
853
+ }
854
+ }
855
+ delete(key) {
856
+ return this.map.delete(key);
857
+ }
858
+ set(key, value) {
859
+ const deleted = this.delete(key);
860
+ if (!deleted && value !== void 0) {
861
+ if (this.map.size >= this.max) {
862
+ const firstKey = this.map.keys().next().value;
863
+ this.delete(firstKey);
864
+ }
865
+ this.map.set(key, value);
866
+ }
867
+ return this;
868
+ }
869
+ };
870
+ module.exports = LRUCache;
871
+ }
872
+ });
873
+
874
+ // ../../node_modules/semver/classes/range.js
875
+ var require_range = __commonJS({
876
+ "../../node_modules/semver/classes/range.js"(exports, module) {
877
+ "use strict";
878
+ var SPACE_CHARACTERS = /\s+/g;
879
+ var Range = class _Range {
880
+ static {
881
+ __name(this, "Range");
882
+ }
883
+ constructor(range, options) {
884
+ options = parseOptions(options);
885
+ if (range instanceof _Range) {
886
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
887
+ return range;
888
+ } else {
889
+ return new _Range(range.raw, options);
890
+ }
891
+ }
892
+ if (range instanceof Comparator) {
893
+ this.raw = range.value;
894
+ this.set = [[range]];
895
+ this.formatted = void 0;
896
+ return this;
897
+ }
898
+ this.options = options;
899
+ this.loose = !!options.loose;
900
+ this.includePrerelease = !!options.includePrerelease;
901
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
902
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
903
+ if (!this.set.length) {
904
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
905
+ }
906
+ if (this.set.length > 1) {
907
+ const first = this.set[0];
908
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
909
+ if (this.set.length === 0) {
910
+ this.set = [first];
911
+ } else if (this.set.length > 1) {
912
+ for (const c of this.set) {
913
+ if (c.length === 1 && isAny(c[0])) {
914
+ this.set = [c];
915
+ break;
916
+ }
917
+ }
918
+ }
919
+ }
920
+ this.formatted = void 0;
921
+ }
922
+ get range() {
923
+ if (this.formatted === void 0) {
924
+ this.formatted = "";
925
+ for (let i = 0; i < this.set.length; i++) {
926
+ if (i > 0) {
927
+ this.formatted += "||";
928
+ }
929
+ const comps = this.set[i];
930
+ for (let k = 0; k < comps.length; k++) {
931
+ if (k > 0) {
932
+ this.formatted += " ";
933
+ }
934
+ this.formatted += comps[k].toString().trim();
935
+ }
936
+ }
937
+ }
938
+ return this.formatted;
939
+ }
940
+ format() {
941
+ return this.range;
942
+ }
943
+ toString() {
944
+ return this.range;
945
+ }
946
+ parseRange(range) {
947
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
948
+ const memoKey = memoOpts + ":" + range;
949
+ const cached = cache.get(memoKey);
950
+ if (cached) {
951
+ return cached;
952
+ }
953
+ const loose = this.options.loose;
954
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
955
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
956
+ debug("hyphen replace", range);
957
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
958
+ debug("comparator trim", range);
959
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
960
+ debug("tilde trim", range);
961
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
962
+ debug("caret trim", range);
963
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
964
+ if (loose) {
965
+ rangeList = rangeList.filter((comp) => {
966
+ debug("loose invalid filter", comp, this.options);
967
+ return !!comp.match(re[t.COMPARATORLOOSE]);
968
+ });
969
+ }
970
+ debug("range list", rangeList);
971
+ const rangeMap = /* @__PURE__ */ new Map();
972
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
973
+ for (const comp of comparators) {
974
+ if (isNullSet(comp)) {
975
+ return [comp];
976
+ }
977
+ rangeMap.set(comp.value, comp);
978
+ }
979
+ if (rangeMap.size > 1 && rangeMap.has("")) {
980
+ rangeMap.delete("");
981
+ }
982
+ const result = [...rangeMap.values()];
983
+ cache.set(memoKey, result);
984
+ return result;
985
+ }
986
+ intersects(range, options) {
987
+ if (!(range instanceof _Range)) {
988
+ throw new TypeError("a Range is required");
989
+ }
990
+ return this.set.some((thisComparators) => {
991
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
992
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
993
+ return rangeComparators.every((rangeComparator) => {
994
+ return thisComparator.intersects(rangeComparator, options);
995
+ });
996
+ });
997
+ });
998
+ });
999
+ }
1000
+ // if ANY of the sets match ALL of its comparators, then pass
1001
+ test(version) {
1002
+ if (!version) {
1003
+ return false;
1004
+ }
1005
+ if (typeof version === "string") {
1006
+ try {
1007
+ version = new SemVer(version, this.options);
1008
+ } catch (er) {
1009
+ return false;
1010
+ }
1011
+ }
1012
+ for (let i = 0; i < this.set.length; i++) {
1013
+ if (testSet(this.set[i], version, this.options)) {
1014
+ return true;
1015
+ }
1016
+ }
1017
+ return false;
1018
+ }
1019
+ };
1020
+ module.exports = Range;
1021
+ var LRU = require_lrucache();
1022
+ var cache = new LRU();
1023
+ var parseOptions = require_parse_options();
1024
+ var Comparator = require_comparator();
1025
+ var debug = require_debug();
1026
+ var SemVer = require_semver();
1027
+ var {
1028
+ safeRe: re,
1029
+ t,
1030
+ comparatorTrimReplace,
1031
+ tildeTrimReplace,
1032
+ caretTrimReplace
1033
+ } = require_re();
1034
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1035
+ var isNullSet = /* @__PURE__ */ __name((c) => c.value === "<0.0.0-0", "isNullSet");
1036
+ var isAny = /* @__PURE__ */ __name((c) => c.value === "", "isAny");
1037
+ var isSatisfiable = /* @__PURE__ */ __name((comparators, options) => {
1038
+ let result = true;
1039
+ const remainingComparators = comparators.slice();
1040
+ let testComparator = remainingComparators.pop();
1041
+ while (result && remainingComparators.length) {
1042
+ result = remainingComparators.every((otherComparator) => {
1043
+ return testComparator.intersects(otherComparator, options);
1044
+ });
1045
+ testComparator = remainingComparators.pop();
1046
+ }
1047
+ return result;
1048
+ }, "isSatisfiable");
1049
+ var parseComparator = /* @__PURE__ */ __name((comp, options) => {
1050
+ debug("comp", comp, options);
1051
+ comp = replaceCarets(comp, options);
1052
+ debug("caret", comp);
1053
+ comp = replaceTildes(comp, options);
1054
+ debug("tildes", comp);
1055
+ comp = replaceXRanges(comp, options);
1056
+ debug("xrange", comp);
1057
+ comp = replaceStars(comp, options);
1058
+ debug("stars", comp);
1059
+ return comp;
1060
+ }, "parseComparator");
1061
+ var isX = /* @__PURE__ */ __name((id) => !id || id.toLowerCase() === "x" || id === "*", "isX");
1062
+ var replaceTildes = /* @__PURE__ */ __name((comp, options) => {
1063
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1064
+ }, "replaceTildes");
1065
+ var replaceTilde = /* @__PURE__ */ __name((comp, options) => {
1066
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1067
+ return comp.replace(r, (_, M, m, p, pr) => {
1068
+ debug("tilde", comp, _, M, m, p, pr);
1069
+ let ret;
1070
+ if (isX(M)) {
1071
+ ret = "";
1072
+ } else if (isX(m)) {
1073
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
1074
+ } else if (isX(p)) {
1075
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
1076
+ } else if (pr) {
1077
+ debug("replaceTilde pr", pr);
1078
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1079
+ } else {
1080
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1081
+ }
1082
+ debug("tilde return", ret);
1083
+ return ret;
1084
+ });
1085
+ }, "replaceTilde");
1086
+ var replaceCarets = /* @__PURE__ */ __name((comp, options) => {
1087
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1088
+ }, "replaceCarets");
1089
+ var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
1090
+ debug("caret", comp, options);
1091
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1092
+ const z = options.includePrerelease ? "-0" : "";
1093
+ return comp.replace(r, (_, M, m, p, pr) => {
1094
+ debug("caret", comp, _, M, m, p, pr);
1095
+ let ret;
1096
+ if (isX(M)) {
1097
+ ret = "";
1098
+ } else if (isX(m)) {
1099
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1100
+ } else if (isX(p)) {
1101
+ if (M === "0") {
1102
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1103
+ } else {
1104
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1105
+ }
1106
+ } else if (pr) {
1107
+ debug("replaceCaret pr", pr);
1108
+ if (M === "0") {
1109
+ if (m === "0") {
1110
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1111
+ } else {
1112
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1113
+ }
1114
+ } else {
1115
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1116
+ }
1117
+ } else {
1118
+ debug("no pr");
1119
+ if (M === "0") {
1120
+ if (m === "0") {
1121
+ ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
1122
+ } else {
1123
+ ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
1124
+ }
1125
+ } else {
1126
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1127
+ }
1128
+ }
1129
+ debug("caret return", ret);
1130
+ return ret;
1131
+ });
1132
+ }, "replaceCaret");
1133
+ var replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
1134
+ debug("replaceXRanges", comp, options);
1135
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1136
+ }, "replaceXRanges");
1137
+ var replaceXRange = /* @__PURE__ */ __name((comp, options) => {
1138
+ comp = comp.trim();
1139
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1140
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1141
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
1142
+ const xM = isX(M);
1143
+ const xm = xM || isX(m);
1144
+ const xp = xm || isX(p);
1145
+ const anyX = xp;
1146
+ if (gtlt === "=" && anyX) {
1147
+ gtlt = "";
1148
+ }
1149
+ pr = options.includePrerelease ? "-0" : "";
1150
+ if (xM) {
1151
+ if (gtlt === ">" || gtlt === "<") {
1152
+ ret = "<0.0.0-0";
1153
+ } else {
1154
+ ret = "*";
1155
+ }
1156
+ } else if (gtlt && anyX) {
1157
+ if (xm) {
1158
+ m = 0;
1159
+ }
1160
+ p = 0;
1161
+ if (gtlt === ">") {
1162
+ gtlt = ">=";
1163
+ if (xm) {
1164
+ M = +M + 1;
1165
+ m = 0;
1166
+ p = 0;
1167
+ } else {
1168
+ m = +m + 1;
1169
+ p = 0;
1170
+ }
1171
+ } else if (gtlt === "<=") {
1172
+ gtlt = "<";
1173
+ if (xm) {
1174
+ M = +M + 1;
1175
+ } else {
1176
+ m = +m + 1;
1177
+ }
1178
+ }
1179
+ if (gtlt === "<") {
1180
+ pr = "-0";
1181
+ }
1182
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
1183
+ } else if (xm) {
1184
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1185
+ } else if (xp) {
1186
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1187
+ }
1188
+ debug("xRange return", ret);
1189
+ return ret;
1190
+ });
1191
+ }, "replaceXRange");
1192
+ var replaceStars = /* @__PURE__ */ __name((comp, options) => {
1193
+ debug("replaceStars", comp, options);
1194
+ return comp.trim().replace(re[t.STAR], "");
1195
+ }, "replaceStars");
1196
+ var replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
1197
+ debug("replaceGTE0", comp, options);
1198
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1199
+ }, "replaceGTE0");
1200
+ var hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1201
+ if (isX(fM)) {
1202
+ from = "";
1203
+ } else if (isX(fm)) {
1204
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1205
+ } else if (isX(fp)) {
1206
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1207
+ } else if (fpr) {
1208
+ from = `>=${from}`;
1209
+ } else {
1210
+ from = `>=${from}${incPr ? "-0" : ""}`;
1211
+ }
1212
+ if (isX(tM)) {
1213
+ to = "";
1214
+ } else if (isX(tm)) {
1215
+ to = `<${+tM + 1}.0.0-0`;
1216
+ } else if (isX(tp)) {
1217
+ to = `<${tM}.${+tm + 1}.0-0`;
1218
+ } else if (tpr) {
1219
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1220
+ } else if (incPr) {
1221
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1222
+ } else {
1223
+ to = `<=${to}`;
1224
+ }
1225
+ return `${from} ${to}`.trim();
1226
+ }, "hyphenReplace");
1227
+ var testSet = /* @__PURE__ */ __name((set, version, options) => {
1228
+ for (let i = 0; i < set.length; i++) {
1229
+ if (!set[i].test(version)) {
1230
+ return false;
1231
+ }
1232
+ }
1233
+ if (version.prerelease.length && !options.includePrerelease) {
1234
+ for (let i = 0; i < set.length; i++) {
1235
+ debug(set[i].semver);
1236
+ if (set[i].semver === Comparator.ANY) {
1237
+ continue;
1238
+ }
1239
+ if (set[i].semver.prerelease.length > 0) {
1240
+ const allowed = set[i].semver;
1241
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1242
+ return true;
1243
+ }
1244
+ }
1245
+ }
1246
+ return false;
1247
+ }
1248
+ return true;
1249
+ }, "testSet");
1250
+ }
1251
+ });
1252
+
1253
+ // ../../node_modules/semver/classes/comparator.js
1254
+ var require_comparator = __commonJS({
1255
+ "../../node_modules/semver/classes/comparator.js"(exports, module) {
1256
+ "use strict";
1257
+ var ANY = Symbol("SemVer ANY");
1258
+ var Comparator = class _Comparator {
1259
+ static {
1260
+ __name(this, "Comparator");
1261
+ }
1262
+ static get ANY() {
1263
+ return ANY;
1264
+ }
1265
+ constructor(comp, options) {
1266
+ options = parseOptions(options);
1267
+ if (comp instanceof _Comparator) {
1268
+ if (comp.loose === !!options.loose) {
1269
+ return comp;
1270
+ } else {
1271
+ comp = comp.value;
1272
+ }
1273
+ }
1274
+ comp = comp.trim().split(/\s+/).join(" ");
1275
+ debug("comparator", comp, options);
1276
+ this.options = options;
1277
+ this.loose = !!options.loose;
1278
+ this.parse(comp);
1279
+ if (this.semver === ANY) {
1280
+ this.value = "";
1281
+ } else {
1282
+ this.value = this.operator + this.semver.version;
1283
+ }
1284
+ debug("comp", this);
1285
+ }
1286
+ parse(comp) {
1287
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1288
+ const m = comp.match(r);
1289
+ if (!m) {
1290
+ throw new TypeError(`Invalid comparator: ${comp}`);
1291
+ }
1292
+ this.operator = m[1] !== void 0 ? m[1] : "";
1293
+ if (this.operator === "=") {
1294
+ this.operator = "";
1295
+ }
1296
+ if (!m[2]) {
1297
+ this.semver = ANY;
1298
+ } else {
1299
+ this.semver = new SemVer(m[2], this.options.loose);
1300
+ }
1301
+ }
1302
+ toString() {
1303
+ return this.value;
1304
+ }
1305
+ test(version) {
1306
+ debug("Comparator.test", version, this.options.loose);
1307
+ if (this.semver === ANY || version === ANY) {
1308
+ return true;
1309
+ }
1310
+ if (typeof version === "string") {
1311
+ try {
1312
+ version = new SemVer(version, this.options);
1313
+ } catch (er) {
1314
+ return false;
1315
+ }
1316
+ }
1317
+ return cmp(version, this.operator, this.semver, this.options);
1318
+ }
1319
+ intersects(comp, options) {
1320
+ if (!(comp instanceof _Comparator)) {
1321
+ throw new TypeError("a Comparator is required");
1322
+ }
1323
+ if (this.operator === "") {
1324
+ if (this.value === "") {
1325
+ return true;
1326
+ }
1327
+ return new Range(comp.value, options).test(this.value);
1328
+ } else if (comp.operator === "") {
1329
+ if (comp.value === "") {
1330
+ return true;
1331
+ }
1332
+ return new Range(this.value, options).test(comp.semver);
1333
+ }
1334
+ options = parseOptions(options);
1335
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1336
+ return false;
1337
+ }
1338
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1339
+ return false;
1340
+ }
1341
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1342
+ return true;
1343
+ }
1344
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1345
+ return true;
1346
+ }
1347
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1348
+ return true;
1349
+ }
1350
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1351
+ return true;
1352
+ }
1353
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1354
+ return true;
1355
+ }
1356
+ return false;
1357
+ }
1358
+ };
1359
+ module.exports = Comparator;
1360
+ var parseOptions = require_parse_options();
1361
+ var { safeRe: re, t } = require_re();
1362
+ var cmp = require_cmp();
1363
+ var debug = require_debug();
1364
+ var SemVer = require_semver();
1365
+ var Range = require_range();
1366
+ }
1367
+ });
1368
+
1369
+ // ../../node_modules/semver/functions/satisfies.js
1370
+ var require_satisfies = __commonJS({
1371
+ "../../node_modules/semver/functions/satisfies.js"(exports, module) {
1372
+ "use strict";
1373
+ var Range = require_range();
1374
+ var satisfies = /* @__PURE__ */ __name((version, range, options) => {
1375
+ try {
1376
+ range = new Range(range, options);
1377
+ } catch (er) {
1378
+ return false;
1379
+ }
1380
+ return range.test(version);
1381
+ }, "satisfies");
1382
+ module.exports = satisfies;
1383
+ }
1384
+ });
1385
+
1386
+ // ../../node_modules/semver/ranges/to-comparators.js
1387
+ var require_to_comparators = __commonJS({
1388
+ "../../node_modules/semver/ranges/to-comparators.js"(exports, module) {
1389
+ "use strict";
1390
+ var Range = require_range();
1391
+ var toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")), "toComparators");
1392
+ module.exports = toComparators;
1393
+ }
1394
+ });
1395
+
1396
+ // ../../node_modules/semver/ranges/max-satisfying.js
1397
+ var require_max_satisfying = __commonJS({
1398
+ "../../node_modules/semver/ranges/max-satisfying.js"(exports, module) {
1399
+ "use strict";
1400
+ var SemVer = require_semver();
1401
+ var Range = require_range();
1402
+ var maxSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
1403
+ let max = null;
1404
+ let maxSV = null;
1405
+ let rangeObj = null;
1406
+ try {
1407
+ rangeObj = new Range(range, options);
1408
+ } catch (er) {
1409
+ return null;
1410
+ }
1411
+ versions.forEach((v) => {
1412
+ if (rangeObj.test(v)) {
1413
+ if (!max || maxSV.compare(v) === -1) {
1414
+ max = v;
1415
+ maxSV = new SemVer(max, options);
1416
+ }
1417
+ }
1418
+ });
1419
+ return max;
1420
+ }, "maxSatisfying");
1421
+ module.exports = maxSatisfying;
1422
+ }
1423
+ });
1424
+
1425
+ // ../../node_modules/semver/ranges/min-satisfying.js
1426
+ var require_min_satisfying = __commonJS({
1427
+ "../../node_modules/semver/ranges/min-satisfying.js"(exports, module) {
1428
+ "use strict";
1429
+ var SemVer = require_semver();
1430
+ var Range = require_range();
1431
+ var minSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
1432
+ let min = null;
1433
+ let minSV = null;
1434
+ let rangeObj = null;
1435
+ try {
1436
+ rangeObj = new Range(range, options);
1437
+ } catch (er) {
1438
+ return null;
1439
+ }
1440
+ versions.forEach((v) => {
1441
+ if (rangeObj.test(v)) {
1442
+ if (!min || minSV.compare(v) === 1) {
1443
+ min = v;
1444
+ minSV = new SemVer(min, options);
1445
+ }
1446
+ }
1447
+ });
1448
+ return min;
1449
+ }, "minSatisfying");
1450
+ module.exports = minSatisfying;
1451
+ }
1452
+ });
1453
+
1454
+ // ../../node_modules/semver/ranges/min-version.js
1455
+ var require_min_version = __commonJS({
1456
+ "../../node_modules/semver/ranges/min-version.js"(exports, module) {
1457
+ "use strict";
1458
+ var SemVer = require_semver();
1459
+ var Range = require_range();
1460
+ var gt = require_gt();
1461
+ var minVersion = /* @__PURE__ */ __name((range, loose) => {
1462
+ range = new Range(range, loose);
1463
+ let minver = new SemVer("0.0.0");
1464
+ if (range.test(minver)) {
1465
+ return minver;
1466
+ }
1467
+ minver = new SemVer("0.0.0-0");
1468
+ if (range.test(minver)) {
1469
+ return minver;
1470
+ }
1471
+ minver = null;
1472
+ for (let i = 0; i < range.set.length; ++i) {
1473
+ const comparators = range.set[i];
1474
+ let setMin = null;
1475
+ comparators.forEach((comparator) => {
1476
+ const compver = new SemVer(comparator.semver.version);
1477
+ switch (comparator.operator) {
1478
+ case ">":
1479
+ if (compver.prerelease.length === 0) {
1480
+ compver.patch++;
1481
+ } else {
1482
+ compver.prerelease.push(0);
1483
+ }
1484
+ compver.raw = compver.format();
1485
+ /* fallthrough */
1486
+ case "":
1487
+ case ">=":
1488
+ if (!setMin || gt(compver, setMin)) {
1489
+ setMin = compver;
1490
+ }
1491
+ break;
1492
+ case "<":
1493
+ case "<=":
1494
+ break;
1495
+ /* istanbul ignore next */
1496
+ default:
1497
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
1498
+ }
1499
+ });
1500
+ if (setMin && (!minver || gt(minver, setMin))) {
1501
+ minver = setMin;
1502
+ }
1503
+ }
1504
+ if (minver && range.test(minver)) {
1505
+ return minver;
1506
+ }
1507
+ return null;
1508
+ }, "minVersion");
1509
+ module.exports = minVersion;
1510
+ }
1511
+ });
1512
+
1513
+ // ../../node_modules/semver/ranges/valid.js
1514
+ var require_valid2 = __commonJS({
1515
+ "../../node_modules/semver/ranges/valid.js"(exports, module) {
1516
+ "use strict";
1517
+ var Range = require_range();
1518
+ var validRange = /* @__PURE__ */ __name((range, options) => {
1519
+ try {
1520
+ return new Range(range, options).range || "*";
1521
+ } catch (er) {
1522
+ return null;
1523
+ }
1524
+ }, "validRange");
1525
+ module.exports = validRange;
1526
+ }
1527
+ });
1528
+
1529
+ // ../../node_modules/semver/ranges/outside.js
1530
+ var require_outside = __commonJS({
1531
+ "../../node_modules/semver/ranges/outside.js"(exports, module) {
1532
+ "use strict";
1533
+ var SemVer = require_semver();
1534
+ var Comparator = require_comparator();
1535
+ var { ANY } = Comparator;
1536
+ var Range = require_range();
1537
+ var satisfies = require_satisfies();
1538
+ var gt = require_gt();
1539
+ var lt = require_lt();
1540
+ var lte = require_lte();
1541
+ var gte = require_gte();
1542
+ var outside = /* @__PURE__ */ __name((version, range, hilo, options) => {
1543
+ version = new SemVer(version, options);
1544
+ range = new Range(range, options);
1545
+ let gtfn, ltefn, ltfn, comp, ecomp;
1546
+ switch (hilo) {
1547
+ case ">":
1548
+ gtfn = gt;
1549
+ ltefn = lte;
1550
+ ltfn = lt;
1551
+ comp = ">";
1552
+ ecomp = ">=";
1553
+ break;
1554
+ case "<":
1555
+ gtfn = lt;
1556
+ ltefn = gte;
1557
+ ltfn = gt;
1558
+ comp = "<";
1559
+ ecomp = "<=";
1560
+ break;
1561
+ default:
1562
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
1563
+ }
1564
+ if (satisfies(version, range, options)) {
1565
+ return false;
1566
+ }
1567
+ for (let i = 0; i < range.set.length; ++i) {
1568
+ const comparators = range.set[i];
1569
+ let high = null;
1570
+ let low = null;
1571
+ comparators.forEach((comparator) => {
1572
+ if (comparator.semver === ANY) {
1573
+ comparator = new Comparator(">=0.0.0");
1574
+ }
1575
+ high = high || comparator;
1576
+ low = low || comparator;
1577
+ if (gtfn(comparator.semver, high.semver, options)) {
1578
+ high = comparator;
1579
+ } else if (ltfn(comparator.semver, low.semver, options)) {
1580
+ low = comparator;
1581
+ }
1582
+ });
1583
+ if (high.operator === comp || high.operator === ecomp) {
1584
+ return false;
1585
+ }
1586
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1587
+ return false;
1588
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1589
+ return false;
1590
+ }
1591
+ }
1592
+ return true;
1593
+ }, "outside");
1594
+ module.exports = outside;
1595
+ }
1596
+ });
1597
+
1598
+ // ../../node_modules/semver/ranges/gtr.js
1599
+ var require_gtr = __commonJS({
1600
+ "../../node_modules/semver/ranges/gtr.js"(exports, module) {
1601
+ "use strict";
1602
+ var outside = require_outside();
1603
+ var gtr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, ">", options), "gtr");
1604
+ module.exports = gtr;
1605
+ }
1606
+ });
1607
+
1608
+ // ../../node_modules/semver/ranges/ltr.js
1609
+ var require_ltr = __commonJS({
1610
+ "../../node_modules/semver/ranges/ltr.js"(exports, module) {
1611
+ "use strict";
1612
+ var outside = require_outside();
1613
+ var ltr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, "<", options), "ltr");
1614
+ module.exports = ltr;
1615
+ }
1616
+ });
1617
+
1618
+ // ../../node_modules/semver/ranges/intersects.js
1619
+ var require_intersects = __commonJS({
1620
+ "../../node_modules/semver/ranges/intersects.js"(exports, module) {
1621
+ "use strict";
1622
+ var Range = require_range();
1623
+ var intersects = /* @__PURE__ */ __name((r1, r2, options) => {
1624
+ r1 = new Range(r1, options);
1625
+ r2 = new Range(r2, options);
1626
+ return r1.intersects(r2, options);
1627
+ }, "intersects");
1628
+ module.exports = intersects;
1629
+ }
1630
+ });
1631
+
1632
+ // ../../node_modules/semver/ranges/simplify.js
1633
+ var require_simplify = __commonJS({
1634
+ "../../node_modules/semver/ranges/simplify.js"(exports, module) {
1635
+ "use strict";
1636
+ var satisfies = require_satisfies();
1637
+ var compare = require_compare();
1638
+ module.exports = (versions, range, options) => {
1639
+ const set = [];
1640
+ let first = null;
1641
+ let prev = null;
1642
+ const v = versions.sort((a, b) => compare(a, b, options));
1643
+ for (const version of v) {
1644
+ const included = satisfies(version, range, options);
1645
+ if (included) {
1646
+ prev = version;
1647
+ if (!first) {
1648
+ first = version;
1649
+ }
1650
+ } else {
1651
+ if (prev) {
1652
+ set.push([first, prev]);
1653
+ }
1654
+ prev = null;
1655
+ first = null;
1656
+ }
1657
+ }
1658
+ if (first) {
1659
+ set.push([first, null]);
1660
+ }
1661
+ const ranges = [];
1662
+ for (const [min, max] of set) {
1663
+ if (min === max) {
1664
+ ranges.push(min);
1665
+ } else if (!max && min === v[0]) {
1666
+ ranges.push("*");
1667
+ } else if (!max) {
1668
+ ranges.push(`>=${min}`);
1669
+ } else if (min === v[0]) {
1670
+ ranges.push(`<=${max}`);
1671
+ } else {
1672
+ ranges.push(`${min} - ${max}`);
1673
+ }
1674
+ }
1675
+ const simplified = ranges.join(" || ");
1676
+ const original = typeof range.raw === "string" ? range.raw : String(range);
1677
+ return simplified.length < original.length ? simplified : range;
1678
+ };
1679
+ }
1680
+ });
1681
+
1682
+ // ../../node_modules/semver/ranges/subset.js
1683
+ var require_subset = __commonJS({
1684
+ "../../node_modules/semver/ranges/subset.js"(exports, module) {
1685
+ "use strict";
1686
+ var Range = require_range();
1687
+ var Comparator = require_comparator();
1688
+ var { ANY } = Comparator;
1689
+ var satisfies = require_satisfies();
1690
+ var compare = require_compare();
1691
+ var subset = /* @__PURE__ */ __name((sub, dom, options = {}) => {
1692
+ if (sub === dom) {
1693
+ return true;
1694
+ }
1695
+ sub = new Range(sub, options);
1696
+ dom = new Range(dom, options);
1697
+ let sawNonNull = false;
1698
+ OUTER: for (const simpleSub of sub.set) {
1699
+ for (const simpleDom of dom.set) {
1700
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
1701
+ sawNonNull = sawNonNull || isSub !== null;
1702
+ if (isSub) {
1703
+ continue OUTER;
1704
+ }
1705
+ }
1706
+ if (sawNonNull) {
1707
+ return false;
1708
+ }
1709
+ }
1710
+ return true;
1711
+ }, "subset");
1712
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1713
+ var minimumVersion = [new Comparator(">=0.0.0")];
1714
+ var simpleSubset = /* @__PURE__ */ __name((sub, dom, options) => {
1715
+ if (sub === dom) {
1716
+ return true;
1717
+ }
1718
+ if (sub.length === 1 && sub[0].semver === ANY) {
1719
+ if (dom.length === 1 && dom[0].semver === ANY) {
1720
+ return true;
1721
+ } else if (options.includePrerelease) {
1722
+ sub = minimumVersionWithPreRelease;
1723
+ } else {
1724
+ sub = minimumVersion;
1725
+ }
1726
+ }
1727
+ if (dom.length === 1 && dom[0].semver === ANY) {
1728
+ if (options.includePrerelease) {
1729
+ return true;
1730
+ } else {
1731
+ dom = minimumVersion;
1732
+ }
1733
+ }
1734
+ const eqSet = /* @__PURE__ */ new Set();
1735
+ let gt, lt;
1736
+ for (const c of sub) {
1737
+ if (c.operator === ">" || c.operator === ">=") {
1738
+ gt = higherGT(gt, c, options);
1739
+ } else if (c.operator === "<" || c.operator === "<=") {
1740
+ lt = lowerLT(lt, c, options);
1741
+ } else {
1742
+ eqSet.add(c.semver);
1743
+ }
1744
+ }
1745
+ if (eqSet.size > 1) {
1746
+ return null;
1747
+ }
1748
+ let gtltComp;
1749
+ if (gt && lt) {
1750
+ gtltComp = compare(gt.semver, lt.semver, options);
1751
+ if (gtltComp > 0) {
1752
+ return null;
1753
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1754
+ return null;
1755
+ }
1756
+ }
1757
+ for (const eq of eqSet) {
1758
+ if (gt && !satisfies(eq, String(gt), options)) {
1759
+ return null;
1760
+ }
1761
+ if (lt && !satisfies(eq, String(lt), options)) {
1762
+ return null;
1763
+ }
1764
+ for (const c of dom) {
1765
+ if (!satisfies(eq, String(c), options)) {
1766
+ return false;
1767
+ }
1768
+ }
1769
+ return true;
1770
+ }
1771
+ let higher, lower;
1772
+ let hasDomLT, hasDomGT;
1773
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1774
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1775
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1776
+ needDomLTPre = false;
1777
+ }
1778
+ for (const c of dom) {
1779
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1780
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1781
+ if (gt) {
1782
+ if (needDomGTPre) {
1783
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1784
+ needDomGTPre = false;
1785
+ }
1786
+ }
1787
+ if (c.operator === ">" || c.operator === ">=") {
1788
+ higher = higherGT(gt, c, options);
1789
+ if (higher === c && higher !== gt) {
1790
+ return false;
1791
+ }
1792
+ } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
1793
+ return false;
1794
+ }
1795
+ }
1796
+ if (lt) {
1797
+ if (needDomLTPre) {
1798
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1799
+ needDomLTPre = false;
1800
+ }
1801
+ }
1802
+ if (c.operator === "<" || c.operator === "<=") {
1803
+ lower = lowerLT(lt, c, options);
1804
+ if (lower === c && lower !== lt) {
1805
+ return false;
1806
+ }
1807
+ } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
1808
+ return false;
1809
+ }
1810
+ }
1811
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
1812
+ return false;
1813
+ }
1814
+ }
1815
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
1816
+ return false;
1817
+ }
1818
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
1819
+ return false;
1820
+ }
1821
+ if (needDomGTPre || needDomLTPre) {
1822
+ return false;
1823
+ }
1824
+ return true;
1825
+ }, "simpleSubset");
1826
+ var higherGT = /* @__PURE__ */ __name((a, b, options) => {
1827
+ if (!a) {
1828
+ return b;
1829
+ }
1830
+ const comp = compare(a.semver, b.semver, options);
1831
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1832
+ }, "higherGT");
1833
+ var lowerLT = /* @__PURE__ */ __name((a, b, options) => {
1834
+ if (!a) {
1835
+ return b;
1836
+ }
1837
+ const comp = compare(a.semver, b.semver, options);
1838
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1839
+ }, "lowerLT");
1840
+ module.exports = subset;
1841
+ }
1842
+ });
1843
+
1844
+ // ../../node_modules/semver/index.js
1845
+ var require_semver2 = __commonJS({
1846
+ "../../node_modules/semver/index.js"(exports, module) {
1847
+ "use strict";
1848
+ var internalRe = require_re();
1849
+ var constants = require_constants();
1850
+ var SemVer = require_semver();
1851
+ var identifiers = require_identifiers();
1852
+ var parse2 = require_parse();
1853
+ var valid = require_valid();
1854
+ var clean = require_clean();
1855
+ var inc = require_inc();
1856
+ var diff = require_diff();
1857
+ var major = require_major();
1858
+ var minor = require_minor();
1859
+ var patch = require_patch();
1860
+ var prerelease = require_prerelease();
1861
+ var compare = require_compare();
1862
+ var rcompare = require_rcompare();
1863
+ var compareLoose = require_compare_loose();
1864
+ var compareBuild = require_compare_build();
1865
+ var sort = require_sort();
1866
+ var rsort = require_rsort();
1867
+ var gt = require_gt();
1868
+ var lt = require_lt();
1869
+ var eq = require_eq();
1870
+ var neq = require_neq();
1871
+ var gte = require_gte();
1872
+ var lte = require_lte();
1873
+ var cmp = require_cmp();
1874
+ var coerce = require_coerce();
1875
+ var Comparator = require_comparator();
1876
+ var Range = require_range();
1877
+ var satisfies = require_satisfies();
1878
+ var toComparators = require_to_comparators();
1879
+ var maxSatisfying = require_max_satisfying();
1880
+ var minSatisfying = require_min_satisfying();
1881
+ var minVersion = require_min_version();
1882
+ var validRange = require_valid2();
1883
+ var outside = require_outside();
1884
+ var gtr = require_gtr();
1885
+ var ltr = require_ltr();
1886
+ var intersects = require_intersects();
1887
+ var simplifyRange = require_simplify();
1888
+ var subset = require_subset();
1889
+ module.exports = {
1890
+ parse: parse2,
1891
+ valid,
1892
+ clean,
1893
+ inc,
1894
+ diff,
1895
+ major,
1896
+ minor,
1897
+ patch,
1898
+ prerelease,
1899
+ compare,
1900
+ rcompare,
1901
+ compareLoose,
1902
+ compareBuild,
1903
+ sort,
1904
+ rsort,
1905
+ gt,
1906
+ lt,
1907
+ eq,
1908
+ neq,
1909
+ gte,
1910
+ lte,
1911
+ cmp,
1912
+ coerce,
1913
+ Comparator,
1914
+ Range,
1915
+ satisfies,
1916
+ toComparators,
1917
+ maxSatisfying,
1918
+ minSatisfying,
1919
+ minVersion,
1920
+ validRange,
1921
+ outside,
1922
+ gtr,
1923
+ ltr,
1924
+ intersects,
1925
+ simplifyRange,
1926
+ subset,
1927
+ SemVer,
1928
+ re: internalRe.re,
1929
+ src: internalRe.src,
1930
+ tokens: internalRe.t,
1931
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1932
+ RELEASE_TYPES: constants.RELEASE_TYPES,
1933
+ compareIdentifiers: identifiers.compareIdentifiers,
1934
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
1935
+ };
1936
+ }
1937
+ });
1938
+
1939
+ // ../../node_modules/lilconfig/src/index.js
20
1940
  var require_src = __commonJS({
21
- "../../node_modules/postcss-load-config/node_modules/lilconfig/src/index.js"(exports, module) {
22
- var path = __require("path");
1941
+ "../../node_modules/lilconfig/src/index.js"(exports, module) {
1942
+ var path2 = __require("path");
23
1943
  var fs = __require("fs");
24
1944
  var os = __require("os");
25
1945
  var url = __require("url");
@@ -43,7 +1963,7 @@ var require_src = __commonJS({
43
1963
  }
44
1964
  __name(getDefaultSearchPlaces, "getDefaultSearchPlaces");
45
1965
  function parentDir(p) {
46
- return path.dirname(p) || path.sep;
1966
+ return path2.dirname(p) || path2.sep;
47
1967
  }
48
1968
  __name(parentDir, "parentDir");
49
1969
  var jsonLoader = /* @__PURE__ */ __name((_, content) => JSON.parse(content), "jsonLoader");
@@ -97,14 +2017,14 @@ var require_src = __commonJS({
97
2017
  }
98
2018
  };
99
2019
  conf.searchPlaces.forEach((place) => {
100
- const key = path.extname(place) || "noExt";
101
- const loader = conf.loaders[key];
102
- if (!loader) {
2020
+ const key = path2.extname(place) || "noExt";
2021
+ const loader2 = conf.loaders[key];
2022
+ if (!loader2) {
103
2023
  throw new Error(`Missing loader for extension "${place}"`);
104
2024
  }
105
- if (typeof loader !== "function") {
2025
+ if (typeof loader2 !== "function") {
106
2026
  throw new Error(
107
- `Loader for extension "${place}" is not a function: Received ${typeof loader}.`
2027
+ `Loader for extension "${place}" is not a function: Received ${typeof loader2}.`
108
2028
  );
109
2029
  }
110
2030
  });
@@ -123,9 +2043,9 @@ var require_src = __commonJS({
123
2043
  if (!filepath) throw new Error("load must pass a non-empty string");
124
2044
  }
125
2045
  __name(validateFilePath, "validateFilePath");
126
- function validateLoader(loader, ext) {
127
- if (!loader) throw new Error(`No loader specified for extension "${ext}"`);
128
- if (typeof loader !== "function") throw new Error("loader is not a function");
2046
+ function validateLoader(loader2, ext) {
2047
+ if (!loader2) throw new Error(`No loader specified for extension "${ext}"`);
2048
+ if (typeof loader2 !== "function") throw new Error("loader is not a function");
129
2049
  }
130
2050
  __name(validateLoader, "validateLoader");
131
2051
  var makeEmplace = /* @__PURE__ */ __name((enableCache) => (c, filepath, res) => {
@@ -163,17 +2083,17 @@ var require_src = __commonJS({
163
2083
  visited.add(dir);
164
2084
  }
165
2085
  for (const searchPlace of searchPlaces) {
166
- const filepath = path.join(dir, searchPlace);
2086
+ const filepath = path2.join(dir, searchPlace);
167
2087
  try {
168
2088
  await fs.promises.access(filepath);
169
2089
  } catch {
170
2090
  continue;
171
2091
  }
172
2092
  const content = String(await fsReadFileAsync(filepath));
173
- const loaderKey = path.extname(searchPlace) || "noExt";
174
- const loader = loaders[loaderKey];
2093
+ const loaderKey = path2.extname(searchPlace) || "noExt";
2094
+ const loader2 = loaders[loaderKey];
175
2095
  if (searchPlace === "package.json") {
176
- const pkg = await loader(filepath, content);
2096
+ const pkg = await loader2(filepath, content);
177
2097
  const maybeConfig = getPackageProp(packageProp, pkg);
178
2098
  if (maybeConfig != null) {
179
2099
  result.config = maybeConfig;
@@ -188,8 +2108,8 @@ var require_src = __commonJS({
188
2108
  result.isEmpty = true;
189
2109
  result.config = void 0;
190
2110
  } else {
191
- validateLoader(loader, loaderKey);
192
- result.config = await loader(filepath, content);
2111
+ validateLoader(loader2, loaderKey);
2112
+ result.config = await loader2(filepath, content);
193
2113
  }
194
2114
  result.filepath = filepath;
195
2115
  break dirLoop;
@@ -208,17 +2128,17 @@ var require_src = __commonJS({
208
2128
  },
209
2129
  async load(filepath) {
210
2130
  validateFilePath(filepath);
211
- const absPath = path.resolve(process.cwd(), filepath);
2131
+ const absPath = path2.resolve(process.cwd(), filepath);
212
2132
  if (cache && loadCache.has(absPath)) {
213
2133
  return loadCache.get(absPath);
214
2134
  }
215
- const { base, ext } = path.parse(absPath);
2135
+ const { base, ext } = path2.parse(absPath);
216
2136
  const loaderKey = ext || "noExt";
217
- const loader = loaders[loaderKey];
218
- validateLoader(loader, loaderKey);
2137
+ const loader2 = loaders[loaderKey];
2138
+ validateLoader(loader2, loaderKey);
219
2139
  const content = String(await fsReadFileAsync(absPath));
220
2140
  if (base === "package.json") {
221
- const pkg = await loader(absPath, content);
2141
+ const pkg = await loader2(absPath, content);
222
2142
  return emplace(
223
2143
  loadCache,
224
2144
  absPath,
@@ -243,7 +2163,7 @@ var require_src = __commonJS({
243
2163
  isEmpty: true
244
2164
  })
245
2165
  );
246
- result.config = isEmpty ? void 0 : await loader(absPath, content);
2166
+ result.config = isEmpty ? void 0 : await loader2(absPath, content);
247
2167
  return emplace(
248
2168
  loadCache,
249
2169
  absPath,
@@ -295,17 +2215,17 @@ var require_src = __commonJS({
295
2215
  visited.add(dir);
296
2216
  }
297
2217
  for (const searchPlace of searchPlaces) {
298
- const filepath = path.join(dir, searchPlace);
2218
+ const filepath = path2.join(dir, searchPlace);
299
2219
  try {
300
2220
  fs.accessSync(filepath);
301
2221
  } catch {
302
2222
  continue;
303
2223
  }
304
- const loaderKey = path.extname(searchPlace) || "noExt";
305
- const loader = loaders[loaderKey];
2224
+ const loaderKey = path2.extname(searchPlace) || "noExt";
2225
+ const loader2 = loaders[loaderKey];
306
2226
  const content = String(fs.readFileSync(filepath));
307
2227
  if (searchPlace === "package.json") {
308
- const pkg = loader(filepath, content);
2228
+ const pkg = loader2(filepath, content);
309
2229
  const maybeConfig = getPackageProp(packageProp, pkg);
310
2230
  if (maybeConfig != null) {
311
2231
  result.config = maybeConfig;
@@ -320,8 +2240,8 @@ var require_src = __commonJS({
320
2240
  result.isEmpty = true;
321
2241
  result.config = void 0;
322
2242
  } else {
323
- validateLoader(loader, loaderKey);
324
- result.config = loader(filepath, content);
2243
+ validateLoader(loader2, loaderKey);
2244
+ result.config = loader2(filepath, content);
325
2245
  }
326
2246
  result.filepath = filepath;
327
2247
  break dirLoop;
@@ -340,17 +2260,17 @@ var require_src = __commonJS({
340
2260
  },
341
2261
  load(filepath) {
342
2262
  validateFilePath(filepath);
343
- const absPath = path.resolve(process.cwd(), filepath);
2263
+ const absPath = path2.resolve(process.cwd(), filepath);
344
2264
  if (cache && loadCache.has(absPath)) {
345
2265
  return loadCache.get(absPath);
346
2266
  }
347
- const { base, ext } = path.parse(absPath);
2267
+ const { base, ext } = path2.parse(absPath);
348
2268
  const loaderKey = ext || "noExt";
349
- const loader = loaders[loaderKey];
350
- validateLoader(loader, loaderKey);
2269
+ const loader2 = loaders[loaderKey];
2270
+ validateLoader(loader2, loaderKey);
351
2271
  const content = String(fs.readFileSync(absPath));
352
2272
  if (base === "package.json") {
353
- const pkg = loader(absPath, content);
2273
+ const pkg = loader2(absPath, content);
354
2274
  return transform({
355
2275
  config: getPackageProp(packageProp, pkg),
356
2276
  filepath: absPath
@@ -371,7 +2291,7 @@ var require_src = __commonJS({
371
2291
  isEmpty: true
372
2292
  })
373
2293
  );
374
- result.config = isEmpty ? void 0 : loader(absPath, content);
2294
+ result.config = isEmpty ? void 0 : loader2(absPath, content);
375
2295
  return emplace(
376
2296
  loadCache,
377
2297
  absPath,
@@ -398,16 +2318,16 @@ var require_src = __commonJS({
398
2318
  // ../../node_modules/postcss-load-config/src/req.js
399
2319
  var require_req = __commonJS({
400
2320
  "../../node_modules/postcss-load-config/src/req.js"(exports, module) {
401
- var { createRequire: createRequire2 } = __require("node:module");
402
- var { pathToFileURL } = __require("node:url");
2321
+ var { createRequire: createRequire3 } = __require("node:module");
2322
+ var { pathToFileURL: pathToFileURL2 } = __require("node:url");
403
2323
  var TS_EXT_RE = /\.[mc]?ts$/;
404
2324
  var tsx;
405
2325
  var jiti;
406
2326
  var importError = [];
407
2327
  async function req(name, rootFile = __filename) {
408
- let url = createRequire2(rootFile).resolve(name);
2328
+ let url = createRequire3(rootFile).resolve(name);
409
2329
  try {
410
- return (await import(`${pathToFileURL(url)}?t=${Date.now()}`)).default;
2330
+ return (await import(`${pathToFileURL2(url)}?t=${Date.now()}`)).default;
411
2331
  } catch (err) {
412
2332
  if (!TS_EXT_RE.test(url)) {
413
2333
  throw err;
@@ -426,7 +2346,7 @@ var require_req = __commonJS({
426
2346
  }
427
2347
  if (jiti === void 0) {
428
2348
  try {
429
- jiti = (await import("./_node-chunks/jiti-B65Y7N6M.js")).default;
2349
+ jiti = (await import("./_node-chunks/jiti-4KRK5JFB.js")).default;
430
2350
  } catch (error) {
431
2351
  importError.push(error);
432
2352
  }
@@ -448,10 +2368,10 @@ Error: ${importError.map((error) => error.message).join("\n")}`
448
2368
  var require_options = __commonJS({
449
2369
  "../../node_modules/postcss-load-config/src/options.js"(exports, module) {
450
2370
  var req = require_req();
451
- async function options(config, file) {
452
- if (config.parser && typeof config.parser === "string") {
2371
+ async function options(config2, file) {
2372
+ if (config2.parser && typeof config2.parser === "string") {
453
2373
  try {
454
- config.parser = await req(config.parser, file);
2374
+ config2.parser = await req(config2.parser, file);
455
2375
  } catch (err) {
456
2376
  throw new Error(
457
2377
  `Loading PostCSS Parser failed: ${err.message}
@@ -460,9 +2380,9 @@ var require_options = __commonJS({
460
2380
  );
461
2381
  }
462
2382
  }
463
- if (config.syntax && typeof config.syntax === "string") {
2383
+ if (config2.syntax && typeof config2.syntax === "string") {
464
2384
  try {
465
- config.syntax = await req(config.syntax, file);
2385
+ config2.syntax = await req(config2.syntax, file);
466
2386
  } catch (err) {
467
2387
  throw new Error(
468
2388
  `Loading PostCSS Syntax failed: ${err.message}
@@ -471,9 +2391,9 @@ var require_options = __commonJS({
471
2391
  );
472
2392
  }
473
2393
  }
474
- if (config.stringifier && typeof config.stringifier === "string") {
2394
+ if (config2.stringifier && typeof config2.stringifier === "string") {
475
2395
  try {
476
- config.stringifier = await req(config.stringifier, file);
2396
+ config2.stringifier = await req(config2.stringifier, file);
477
2397
  } catch (err) {
478
2398
  throw new Error(
479
2399
  `Loading PostCSS Stringifier failed: ${err.message}
@@ -482,7 +2402,7 @@ var require_options = __commonJS({
482
2402
  );
483
2403
  }
484
2404
  }
485
- return config;
2405
+ return config2;
486
2406
  }
487
2407
  __name(options, "options");
488
2408
  module.exports = options;
@@ -509,12 +2429,12 @@ var require_plugins = __commonJS({
509
2429
  }
510
2430
  }
511
2431
  __name(load, "load");
512
- async function plugins(config, file) {
2432
+ async function plugins(config2, file) {
513
2433
  let list = [];
514
- if (Array.isArray(config.plugins)) {
515
- list = config.plugins.filter(Boolean);
2434
+ if (Array.isArray(config2.plugins)) {
2435
+ list = config2.plugins.filter(Boolean);
516
2436
  } else {
517
- list = Object.entries(config.plugins).filter(([, options]) => {
2437
+ list = Object.entries(config2.plugins).filter(([, options]) => {
518
2438
  return options !== false;
519
2439
  }).map(([plugin, options]) => {
520
2440
  return load(plugin, options, file);
@@ -550,8 +2470,8 @@ var require_plugins = __commonJS({
550
2470
  // ../../node_modules/postcss-load-config/src/index.js
551
2471
  var require_src2 = __commonJS({
552
2472
  "../../node_modules/postcss-load-config/src/index.js"(exports, module) {
553
- var { resolve } = __require("node:path");
554
- var config = require_src();
2473
+ var { resolve: resolve2 } = __require("node:path");
2474
+ var config2 = require_src();
555
2475
  var loadOptions = require_options();
556
2476
  var loadPlugins = require_plugins();
557
2477
  var req = require_req();
@@ -590,15 +2510,15 @@ var require_src2 = __commonJS({
590
2510
  return ctx;
591
2511
  }
592
2512
  __name(createContext, "createContext");
593
- async function loader(filepath) {
2513
+ async function loader2(filepath) {
594
2514
  return req(filepath);
595
2515
  }
596
- __name(loader, "loader");
2516
+ __name(loader2, "loader");
597
2517
  var yaml;
598
2518
  async function yamlLoader(_, content) {
599
2519
  if (!yaml) {
600
2520
  try {
601
- yaml = await import("./_node-chunks/dist-DJQHMCL2.js");
2521
+ yaml = await import("./_node-chunks/dist-NXTPHIJH.js");
602
2522
  } catch (e) {
603
2523
  throw new Error(
604
2524
  `'yaml' is required for the YAML configuration files. Make sure it is installed
@@ -609,18 +2529,18 @@ Error: ${e.message}`
609
2529
  return yaml.parse(content);
610
2530
  }
611
2531
  __name(yamlLoader, "yamlLoader");
612
- var withLoaders = /* @__PURE__ */ __name((options = {}) => {
2532
+ var withLoaders2 = /* @__PURE__ */ __name((options = {}) => {
613
2533
  let moduleName = "postcss";
614
2534
  return {
615
2535
  ...options,
616
2536
  loaders: {
617
2537
  ...options.loaders,
618
- ".cjs": loader,
619
- ".cts": loader,
620
- ".js": loader,
621
- ".mjs": loader,
622
- ".mts": loader,
623
- ".ts": loader,
2538
+ ".cjs": loader2,
2539
+ ".cts": loader2,
2540
+ ".js": loader2,
2541
+ ".mjs": loader2,
2542
+ ".mts": loader2,
2543
+ ".ts": loader2,
624
2544
  ".yaml": yamlLoader,
625
2545
  ".yml": yamlLoader
626
2546
  },
@@ -646,12 +2566,12 @@ Error: ${e.message}`
646
2566
  ]
647
2567
  };
648
2568
  }, "withLoaders");
649
- function rc(ctx, path, options) {
2569
+ function rc(ctx, path2, options) {
650
2570
  ctx = createContext(ctx);
651
- path = path ? resolve(path) : process.cwd();
652
- return config.lilconfig("postcss", withLoaders(options)).search(path).then((result) => {
2571
+ path2 = path2 ? resolve2(path2) : process.cwd();
2572
+ return config2.lilconfig("postcss", withLoaders2(options)).search(path2).then((result) => {
653
2573
  if (!result) {
654
- throw new Error(`No PostCSS Config found in: ${path}`);
2574
+ throw new Error(`No PostCSS Config found in: ${path2}`);
655
2575
  }
656
2576
  return processResult(ctx, result);
657
2577
  });
@@ -662,31 +2582,591 @@ Error: ${e.message}`
662
2582
  });
663
2583
 
664
2584
  // src/preset.ts
2585
+ var import_semver = __toESM(require_semver2(), 1);
2586
+ import { createRequire as createRequire2 } from "node:module";
2587
+ import { dirname as dirname2 } from "node:path";
2588
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
2589
+ import { viteFinal as reactViteFinal } from "@storybook/react-vite/preset";
2590
+
2591
+ // src/find-postcss-config.ts
2592
+ var import_lilconfig = __toESM(require_src(), 1);
665
2593
  var import_postcss_load_config = __toESM(require_src2(), 1);
2594
+ import { readFile, writeFile } from "node:fs/promises";
666
2595
  import { createRequire } from "node:module";
667
- import { dirname } from "node:path";
668
- import { fileURLToPath } from "node:url";
669
2596
  import { getProjectRoot } from "storybook/internal/common";
670
2597
  import { IncompatiblePostCssConfigError } from "storybook/internal/server-errors";
671
- import { viteFinal as reactViteFinal } from "@storybook/react-vite/preset";
672
2598
  var require2 = createRequire(import.meta.url);
673
- var vitePluginStorybookNextjs = require2("vite-plugin-storybook-nextjs");
674
- var core = /* @__PURE__ */ __name(async (config, options) => {
2599
+ async function loader(filepath) {
2600
+ return require2(filepath);
2601
+ }
2602
+ __name(loader, "loader");
2603
+ var withLoaders = /* @__PURE__ */ __name((options = {}) => {
2604
+ const moduleName = "postcss";
2605
+ return {
2606
+ ...options,
2607
+ loaders: {
2608
+ ...options.loaders,
2609
+ ".cjs": loader,
2610
+ ".cts": loader,
2611
+ ".js": loader,
2612
+ ".mjs": loader,
2613
+ ".mts": loader,
2614
+ ".ts": loader
2615
+ },
2616
+ searchPlaces: [
2617
+ ...options.searchPlaces ?? [],
2618
+ "package.json",
2619
+ `.${moduleName}rc`,
2620
+ `.${moduleName}rc.json`,
2621
+ `.${moduleName}rc.ts`,
2622
+ `.${moduleName}rc.cts`,
2623
+ `.${moduleName}rc.mts`,
2624
+ `.${moduleName}rc.js`,
2625
+ `.${moduleName}rc.cjs`,
2626
+ `.${moduleName}rc.mjs`,
2627
+ `${moduleName}.config.ts`,
2628
+ `${moduleName}.config.cts`,
2629
+ `${moduleName}.config.mts`,
2630
+ `${moduleName}.config.js`,
2631
+ `${moduleName}.config.cjs`,
2632
+ `${moduleName}.config.mjs`
2633
+ ]
2634
+ };
2635
+ }, "withLoaders");
2636
+ async function postCssFindConfig(path2, options = {}) {
2637
+ const result = await import_lilconfig.default.lilconfig("postcss", withLoaders(options)).search(path2);
2638
+ return result ? result.filepath : null;
2639
+ }
2640
+ __name(postCssFindConfig, "postCssFindConfig");
2641
+ var normalizePostCssConfig = /* @__PURE__ */ __name(async (searchPath) => {
2642
+ const configPath = await postCssFindConfig(searchPath);
2643
+ if (!configPath) {
2644
+ return true;
2645
+ }
2646
+ let error;
2647
+ try {
2648
+ await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() });
2649
+ return true;
2650
+ } catch (e) {
2651
+ if (e instanceof Error) {
2652
+ error = e;
2653
+ }
2654
+ }
2655
+ if (!error) {
2656
+ return true;
2657
+ }
2658
+ if (error.message.includes("No PostCSS Config found")) {
2659
+ return true;
2660
+ }
2661
+ if (error.message.includes("Invalid PostCSS Plugin found")) {
2662
+ const originalContent = await readFile(configPath, "utf8");
2663
+ try {
2664
+ const modifiedContent = originalContent.replace(
2665
+ 'plugins: ["@tailwindcss/postcss"]',
2666
+ 'plugins: { "@tailwindcss/postcss": {} }'
2667
+ );
2668
+ await writeFile(configPath, modifiedContent, "utf8");
2669
+ await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() });
2670
+ return true;
2671
+ } catch (e) {
2672
+ await writeFile(configPath, originalContent, "utf8");
2673
+ throw new IncompatiblePostCssConfigError({ error });
2674
+ }
2675
+ }
2676
+ return false;
2677
+ }, "normalizePostCssConfig");
2678
+
2679
+ // src/utils.ts
2680
+ import { readFileSync } from "node:fs";
2681
+ import { join as join2 } from "node:path";
2682
+
2683
+ // ../../core/src/shared/utils/module.ts
2684
+ import { fileURLToPath, pathToFileURL } from "node:url";
2685
+
2686
+ // ../../node_modules/exsolve/dist/index.mjs
2687
+ import assert from "node:assert";
2688
+ import v8 from "node:v8";
2689
+ import { format, inspect } from "node:util";
2690
+ var own$1 = {}.hasOwnProperty;
2691
+ var classRegExp = /^([A-Z][a-z\d]*)+$/;
2692
+ var kTypes = /* @__PURE__ */ new Set([
2693
+ "string",
2694
+ "function",
2695
+ "number",
2696
+ "object",
2697
+ // Accept 'Function' and 'Object' as alternative to the lower cased version.
2698
+ "Function",
2699
+ "Object",
2700
+ "boolean",
2701
+ "bigint",
2702
+ "symbol"
2703
+ ]);
2704
+ var messages = /* @__PURE__ */ new Map();
2705
+ var nodeInternalPrefix = "__node_internal_";
2706
+ var userStackTraceLimit;
2707
+ function formatList(array, type = "and") {
2708
+ return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
2709
+ }
2710
+ __name(formatList, "formatList");
2711
+ function createError(sym, value, constructor) {
2712
+ messages.set(sym, value);
2713
+ return makeNodeErrorWithCode(constructor, sym);
2714
+ }
2715
+ __name(createError, "createError");
2716
+ function makeNodeErrorWithCode(Base, key) {
2717
+ return /* @__PURE__ */ __name(function NodeError(...parameters) {
2718
+ const limit = Error.stackTraceLimit;
2719
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
2720
+ const error = new Base();
2721
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
2722
+ const message = getMessage(key, parameters, error);
2723
+ Object.defineProperties(error, {
2724
+ // Note: no need to implement `kIsNodeError` symbol, would be hard,
2725
+ // probably.
2726
+ message: {
2727
+ value: message,
2728
+ enumerable: false,
2729
+ writable: true,
2730
+ configurable: true
2731
+ },
2732
+ toString: {
2733
+ /** @this {Error} */
2734
+ value() {
2735
+ return `${this.name} [${key}]: ${this.message}`;
2736
+ },
2737
+ enumerable: false,
2738
+ writable: true,
2739
+ configurable: true
2740
+ }
2741
+ });
2742
+ captureLargerStackTrace(error);
2743
+ error.code = key;
2744
+ return error;
2745
+ }, "NodeError");
2746
+ }
2747
+ __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
2748
+ function isErrorStackTraceLimitWritable() {
2749
+ try {
2750
+ if (v8.startupSnapshot.isBuildingSnapshot()) {
2751
+ return false;
2752
+ }
2753
+ } catch {
2754
+ }
2755
+ const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
2756
+ if (desc === void 0) {
2757
+ return Object.isExtensible(Error);
2758
+ }
2759
+ return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
2760
+ }
2761
+ __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
2762
+ function hideStackFrames(wrappedFunction) {
2763
+ const hidden = nodeInternalPrefix + wrappedFunction.name;
2764
+ Object.defineProperty(wrappedFunction, "name", { value: hidden });
2765
+ return wrappedFunction;
2766
+ }
2767
+ __name(hideStackFrames, "hideStackFrames");
2768
+ var captureLargerStackTrace = hideStackFrames(function(error) {
2769
+ const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
2770
+ if (stackTraceLimitIsWritable) {
2771
+ userStackTraceLimit = Error.stackTraceLimit;
2772
+ Error.stackTraceLimit = Number.POSITIVE_INFINITY;
2773
+ }
2774
+ Error.captureStackTrace(error);
2775
+ if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
2776
+ return error;
2777
+ });
2778
+ function getMessage(key, parameters, self) {
2779
+ const message = messages.get(key);
2780
+ assert(message !== void 0, "expected `message` to be found");
2781
+ if (typeof message === "function") {
2782
+ assert(
2783
+ message.length <= parameters.length,
2784
+ // Default options do not count.
2785
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
2786
+ );
2787
+ return Reflect.apply(message, self, parameters);
2788
+ }
2789
+ const regex = /%[dfijoOs]/g;
2790
+ let expectedLength = 0;
2791
+ while (regex.exec(message) !== null) expectedLength++;
2792
+ assert(
2793
+ expectedLength === parameters.length,
2794
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
2795
+ );
2796
+ if (parameters.length === 0) return message;
2797
+ parameters.unshift(message);
2798
+ return Reflect.apply(format, null, parameters);
2799
+ }
2800
+ __name(getMessage, "getMessage");
2801
+ function determineSpecificType(value) {
2802
+ if (value === null || value === void 0) {
2803
+ return String(value);
2804
+ }
2805
+ if (typeof value === "function" && value.name) {
2806
+ return `function ${value.name}`;
2807
+ }
2808
+ if (typeof value === "object") {
2809
+ if (value.constructor && value.constructor.name) {
2810
+ return `an instance of ${value.constructor.name}`;
2811
+ }
2812
+ return `${inspect(value, { depth: -1 })}`;
2813
+ }
2814
+ let inspected = inspect(value, { colors: false });
2815
+ if (inspected.length > 28) {
2816
+ inspected = `${inspected.slice(0, 25)}...`;
2817
+ }
2818
+ return `type ${typeof value} (${inspected})`;
2819
+ }
2820
+ __name(determineSpecificType, "determineSpecificType");
2821
+ createError(
2822
+ "ERR_INVALID_ARG_TYPE",
2823
+ (name, expected, actual) => {
2824
+ assert(typeof name === "string", "'name' must be a string");
2825
+ if (!Array.isArray(expected)) {
2826
+ expected = [expected];
2827
+ }
2828
+ let message = "The ";
2829
+ if (name.endsWith(" argument")) {
2830
+ message += `${name} `;
2831
+ } else {
2832
+ const type = name.includes(".") ? "property" : "argument";
2833
+ message += `"${name}" ${type} `;
2834
+ }
2835
+ message += "must be ";
2836
+ const types = [];
2837
+ const instances = [];
2838
+ const other = [];
2839
+ for (const value of expected) {
2840
+ assert(
2841
+ typeof value === "string",
2842
+ "All expected entries have to be of type string"
2843
+ );
2844
+ if (kTypes.has(value)) {
2845
+ types.push(value.toLowerCase());
2846
+ } else if (classRegExp.exec(value) === null) {
2847
+ assert(
2848
+ value !== "object",
2849
+ 'The value "object" should be written as "Object"'
2850
+ );
2851
+ other.push(value);
2852
+ } else {
2853
+ instances.push(value);
2854
+ }
2855
+ }
2856
+ if (instances.length > 0) {
2857
+ const pos = types.indexOf("object");
2858
+ if (pos !== -1) {
2859
+ types.slice(pos, 1);
2860
+ instances.push("Object");
2861
+ }
2862
+ }
2863
+ if (types.length > 0) {
2864
+ message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
2865
+ types,
2866
+ "or"
2867
+ )}`;
2868
+ if (instances.length > 0 || other.length > 0) message += " or ";
2869
+ }
2870
+ if (instances.length > 0) {
2871
+ message += `an instance of ${formatList(instances, "or")}`;
2872
+ if (other.length > 0) message += " or ";
2873
+ }
2874
+ if (other.length > 0) {
2875
+ if (other.length > 1) {
2876
+ message += `one of ${formatList(other, "or")}`;
2877
+ } else {
2878
+ if (other[0]?.toLowerCase() !== other[0]) message += "an ";
2879
+ message += `${other[0]}`;
2880
+ }
2881
+ }
2882
+ message += `. Received ${determineSpecificType(actual)}`;
2883
+ return message;
2884
+ },
2885
+ TypeError
2886
+ );
2887
+ var ERR_INVALID_MODULE_SPECIFIER = createError(
2888
+ "ERR_INVALID_MODULE_SPECIFIER",
2889
+ /**
2890
+ * @param {string} request
2891
+ * @param {string} reason
2892
+ * @param {string} [base]
2893
+ */
2894
+ (request, reason, base) => {
2895
+ return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
2896
+ },
2897
+ TypeError
2898
+ );
2899
+ var ERR_INVALID_PACKAGE_CONFIG = createError(
2900
+ "ERR_INVALID_PACKAGE_CONFIG",
2901
+ (path2, base, message) => {
2902
+ return `Invalid package config ${path2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
2903
+ },
2904
+ Error
2905
+ );
2906
+ var ERR_INVALID_PACKAGE_TARGET = createError(
2907
+ "ERR_INVALID_PACKAGE_TARGET",
2908
+ (packagePath, key, target, isImport = false, base) => {
2909
+ const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
2910
+ if (key === ".") {
2911
+ assert(isImport === false);
2912
+ return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
2913
+ }
2914
+ return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
2915
+ target
2916
+ )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
2917
+ },
2918
+ Error
2919
+ );
2920
+ var ERR_MODULE_NOT_FOUND = createError(
2921
+ "ERR_MODULE_NOT_FOUND",
2922
+ (path2, base, exactUrl = false) => {
2923
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path2}' imported from ${base}`;
2924
+ },
2925
+ Error
2926
+ );
2927
+ createError(
2928
+ "ERR_NETWORK_IMPORT_DISALLOWED",
2929
+ "import of '%s' by %s is not supported: %s",
2930
+ Error
2931
+ );
2932
+ var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
2933
+ "ERR_PACKAGE_IMPORT_NOT_DEFINED",
2934
+ (specifier, packagePath, base) => {
2935
+ return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
2936
+ },
2937
+ TypeError
2938
+ );
2939
+ var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
2940
+ "ERR_PACKAGE_PATH_NOT_EXPORTED",
2941
+ /**
2942
+ * @param {string} packagePath
2943
+ * @param {string} subpath
2944
+ * @param {string} [base]
2945
+ */
2946
+ (packagePath, subpath, base) => {
2947
+ if (subpath === ".")
2948
+ return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
2949
+ return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
2950
+ },
2951
+ Error
2952
+ );
2953
+ var ERR_UNSUPPORTED_DIR_IMPORT = createError(
2954
+ "ERR_UNSUPPORTED_DIR_IMPORT",
2955
+ "Directory import '%s' is not supported resolving ES modules imported from %s",
2956
+ Error
2957
+ );
2958
+ var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
2959
+ "ERR_UNSUPPORTED_RESOLVE_REQUEST",
2960
+ 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
2961
+ TypeError
2962
+ );
2963
+ var ERR_UNKNOWN_FILE_EXTENSION = createError(
2964
+ "ERR_UNKNOWN_FILE_EXTENSION",
2965
+ (extension, path2) => {
2966
+ return `Unknown file extension "${extension}" for ${path2}`;
2967
+ },
2968
+ TypeError
2969
+ );
2970
+ createError(
2971
+ "ERR_INVALID_ARG_VALUE",
2972
+ (name, value, reason = "is invalid") => {
2973
+ let inspected = inspect(value);
2974
+ if (inspected.length > 128) {
2975
+ inspected = `${inspected.slice(0, 128)}...`;
2976
+ }
2977
+ const type = name.includes(".") ? "property" : "argument";
2978
+ return `The ${type} '${name}' ${reason}. Received ${inspected}`;
2979
+ },
2980
+ TypeError
2981
+ // Note: extra classes have been shaken out.
2982
+ // , RangeError
2983
+ );
2984
+ var hasOwnProperty$1 = {}.hasOwnProperty;
2985
+ var hasOwnProperty = {}.hasOwnProperty;
2986
+ var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
2987
+ var own = {}.hasOwnProperty;
2988
+ var isWindows = (() => process.platform === "win32")();
2989
+ var globalCache = (() => (
2990
+ // eslint-disable-next-line unicorn/no-unreadable-iife
2991
+ globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
2992
+ ))();
2993
+
2994
+ // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
2995
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
2996
+ function normalizeWindowsPath(input = "") {
2997
+ if (!input) {
2998
+ return input;
2999
+ }
3000
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
3001
+ }
3002
+ __name(normalizeWindowsPath, "normalizeWindowsPath");
3003
+ var _UNC_REGEX = /^[/\\]{2}/;
3004
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
3005
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
3006
+ var normalize = /* @__PURE__ */ __name(function(path2) {
3007
+ if (path2.length === 0) {
3008
+ return ".";
3009
+ }
3010
+ path2 = normalizeWindowsPath(path2);
3011
+ const isUNCPath = path2.match(_UNC_REGEX);
3012
+ const isPathAbsolute = isAbsolute(path2);
3013
+ const trailingSeparator = path2[path2.length - 1] === "/";
3014
+ path2 = normalizeString(path2, !isPathAbsolute);
3015
+ if (path2.length === 0) {
3016
+ if (isPathAbsolute) {
3017
+ return "/";
3018
+ }
3019
+ return trailingSeparator ? "./" : ".";
3020
+ }
3021
+ if (trailingSeparator) {
3022
+ path2 += "/";
3023
+ }
3024
+ if (_DRIVE_LETTER_RE.test(path2)) {
3025
+ path2 += "/";
3026
+ }
3027
+ if (isUNCPath) {
3028
+ if (!isPathAbsolute) {
3029
+ return `//./${path2}`;
3030
+ }
3031
+ return `//${path2}`;
3032
+ }
3033
+ return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
3034
+ }, "normalize");
3035
+ var join = /* @__PURE__ */ __name(function(...arguments_) {
3036
+ if (arguments_.length === 0) {
3037
+ return ".";
3038
+ }
3039
+ let joined;
3040
+ for (const argument of arguments_) {
3041
+ if (argument && argument.length > 0) {
3042
+ if (joined === void 0) {
3043
+ joined = argument;
3044
+ } else {
3045
+ joined += `/${argument}`;
3046
+ }
3047
+ }
3048
+ }
3049
+ if (joined === void 0) {
3050
+ return ".";
3051
+ }
3052
+ return normalize(joined.replace(/\/\/+/g, "/"));
3053
+ }, "join");
3054
+ function normalizeString(path2, allowAboveRoot) {
3055
+ let res = "";
3056
+ let lastSegmentLength = 0;
3057
+ let lastSlash = -1;
3058
+ let dots = 0;
3059
+ let char = null;
3060
+ for (let index = 0; index <= path2.length; ++index) {
3061
+ if (index < path2.length) {
3062
+ char = path2[index];
3063
+ } else if (char === "/") {
3064
+ break;
3065
+ } else {
3066
+ char = "/";
3067
+ }
3068
+ if (char === "/") {
3069
+ if (lastSlash === index - 1 || dots === 1) ;
3070
+ else if (dots === 2) {
3071
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
3072
+ if (res.length > 2) {
3073
+ const lastSlashIndex = res.lastIndexOf("/");
3074
+ if (lastSlashIndex === -1) {
3075
+ res = "";
3076
+ lastSegmentLength = 0;
3077
+ } else {
3078
+ res = res.slice(0, lastSlashIndex);
3079
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
3080
+ }
3081
+ lastSlash = index;
3082
+ dots = 0;
3083
+ continue;
3084
+ } else if (res.length > 0) {
3085
+ res = "";
3086
+ lastSegmentLength = 0;
3087
+ lastSlash = index;
3088
+ dots = 0;
3089
+ continue;
3090
+ }
3091
+ }
3092
+ if (allowAboveRoot) {
3093
+ res += res.length > 0 ? "/.." : "..";
3094
+ lastSegmentLength = 2;
3095
+ }
3096
+ } else {
3097
+ if (res.length > 0) {
3098
+ res += `/${path2.slice(lastSlash + 1, index)}`;
3099
+ } else {
3100
+ res = path2.slice(lastSlash + 1, index);
3101
+ }
3102
+ lastSegmentLength = index - lastSlash - 1;
3103
+ }
3104
+ lastSlash = index;
3105
+ dots = 0;
3106
+ } else if (char === "." && dots !== -1) {
3107
+ ++dots;
3108
+ } else {
3109
+ dots = -1;
3110
+ }
3111
+ }
3112
+ return res;
3113
+ }
3114
+ __name(normalizeString, "normalizeString");
3115
+ var isAbsolute = /* @__PURE__ */ __name(function(p) {
3116
+ return _IS_ABSOLUTE_RE.test(p);
3117
+ }, "isAbsolute");
3118
+ var dirname = /* @__PURE__ */ __name(function(p) {
3119
+ const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
3120
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
3121
+ segments[0] += "/";
3122
+ }
3123
+ return segments.join("/") || (isAbsolute(p) ? "/" : ".");
3124
+ }, "dirname");
3125
+
3126
+ // ../../core/src/shared/utils/module.ts
3127
+ var importMetaResolve = /* @__PURE__ */ __name((...args) => {
3128
+ if (typeof import.meta.resolve !== "function" && process.env.VITEST === "true") {
3129
+ console.warn(
3130
+ "importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
3131
+ );
3132
+ return pathToFileURL(args[0]).href;
3133
+ }
3134
+ return import.meta.resolve(...args);
3135
+ }, "importMetaResolve");
3136
+ var resolvePackageDir = /* @__PURE__ */ __name((pkg, parent) => {
3137
+ return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
3138
+ }, "resolvePackageDir");
3139
+
3140
+ // src/utils.ts
3141
+ var getNextjsVersion = /* @__PURE__ */ __name(() => JSON.parse(readFileSync(join2(resolvePackageDir("next"), "package.json"), "utf8")).version, "getNextjsVersion");
3142
+
3143
+ // src/preset.ts
3144
+ var require3 = createRequire2(import.meta.url);
3145
+ var vitePluginStorybookNextjs = require3("vite-plugin-storybook-nextjs");
3146
+ var core = /* @__PURE__ */ __name(async (config2, options) => {
675
3147
  const framework = await options.presets.apply("framework");
676
3148
  return {
677
- ...config,
3149
+ ...config2,
678
3150
  builder: {
679
- name: import.meta.resolve("@storybook/builder-vite"),
3151
+ name: fileURLToPath2(import.meta.resolve("@storybook/builder-vite")),
680
3152
  options: {
681
3153
  ...typeof framework === "string" ? {} : framework.options.builder || {}
682
3154
  }
683
3155
  },
684
- renderer: import.meta.resolve("@storybook/react/preset")
3156
+ renderer: fileURLToPath2(import.meta.resolve("@storybook/react/preset"))
685
3157
  };
686
3158
  }, "core");
687
3159
  var previewAnnotations = /* @__PURE__ */ __name((entry = []) => {
688
- const result = [...entry, import.meta.resolve("@storybook/nextjs-vite/preview")];
689
- return result;
3160
+ const annotations = [
3161
+ ...entry,
3162
+ fileURLToPath2(import.meta.resolve("@storybook/nextjs-vite/preview"))
3163
+ ];
3164
+ const nextjsVersion = getNextjsVersion();
3165
+ const isNext16orNewer = import_semver.default.gte(nextjsVersion, "16.0.0");
3166
+ if (!isNext16orNewer) {
3167
+ annotations.push(fileURLToPath2(import.meta.resolve("@storybook/nextjs-vite/config/preview")));
3168
+ }
3169
+ return annotations;
690
3170
  }, "previewAnnotations");
691
3171
  var optimizeViteDeps = [
692
3172
  "@storybook/nextjs-vite/navigation.mock",
@@ -694,30 +3174,24 @@ var optimizeViteDeps = [
694
3174
  "@storybook/nextjs-vite > styled-jsx",
695
3175
  "@storybook/nextjs-vite > styled-jsx/style"
696
3176
  ];
697
- var viteFinal = /* @__PURE__ */ __name(async (config, options) => {
698
- const reactConfig = await reactViteFinal(config, options);
699
- try {
700
- const inlineOptions = config.css?.postcss;
701
- const searchPath = typeof inlineOptions === "string" ? inlineOptions : config.root;
702
- await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() });
703
- } catch (e) {
704
- if (!e.message.includes("No PostCSS Config found")) {
705
- if (e.message.includes("Invalid PostCSS Plugin found")) {
706
- throw new IncompatiblePostCssConfigError({ error: e });
707
- }
708
- }
3177
+ var viteFinal = /* @__PURE__ */ __name(async (config2, options) => {
3178
+ const reactConfig = await reactViteFinal(config2, options);
3179
+ const inlineOptions = config2.css?.postcss;
3180
+ const searchPath = typeof inlineOptions === "string" ? inlineOptions : config2.root;
3181
+ if (searchPath) {
3182
+ await normalizePostCssConfig(searchPath);
709
3183
  }
710
3184
  const { nextConfigPath } = await options.presets.apply("frameworkOptions");
711
- const nextDir = nextConfigPath ? dirname(nextConfigPath) : void 0;
3185
+ const nextDir = nextConfigPath ? dirname2(nextConfigPath) : void 0;
712
3186
  return {
713
3187
  ...reactConfig,
714
3188
  resolve: {
715
3189
  ...reactConfig?.resolve ?? {},
716
3190
  alias: {
717
3191
  ...reactConfig?.resolve?.alias ?? {},
718
- "styled-jsx": dirname(fileURLToPath(import.meta.resolve("styled-jsx/package.json"))),
719
- "styled-jsx/style": fileURLToPath(import.meta.resolve("styled-jsx/style")),
720
- "styled-jsx/style.js": fileURLToPath(import.meta.resolve("styled-jsx/style"))
3192
+ "styled-jsx": dirname2(fileURLToPath2(import.meta.resolve("styled-jsx/package.json"))),
3193
+ "styled-jsx/style": fileURLToPath2(import.meta.resolve("styled-jsx/style")),
3194
+ "styled-jsx/style.js": fileURLToPath2(import.meta.resolve("styled-jsx/style"))
721
3195
  }
722
3196
  },
723
3197
  plugins: [...reactConfig?.plugins ?? [], vitePluginStorybookNextjs({ dir: nextDir })]