@storybook/react 11.0.0-alpha.6 → 11.0.0-alpha.8

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.
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ocq9hq78ba8 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ocq9hq78ba8 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ocq9hq78ba8 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_lya8clainfq from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_lya8clainfq from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_lya8clainfq from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ocq9hq78ba8.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ocq9hq78ba8.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ocq9hq78ba8.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_lya8clainfq.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_lya8clainfq.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_lya8clainfq.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -2203,22 +2203,22 @@ var require_createProject = __commonJS({
2203
2203
  // ../../../node_modules/vscode-uri/lib/umd/index.js
2204
2204
  var require_umd = __commonJS({
2205
2205
  "../../../node_modules/vscode-uri/lib/umd/index.js"(exports, module) {
2206
- (function(t4, e) {
2206
+ (function(t, e) {
2207
2207
  if (typeof exports == "object" && typeof module == "object") module.exports = e();
2208
2208
  else if (typeof define == "function" && define.amd) define([], e);
2209
2209
  else {
2210
2210
  var r = e();
2211
- for (var n in r) (typeof exports == "object" ? exports : t4)[n] = r[n];
2211
+ for (var n in r) (typeof exports == "object" ? exports : t)[n] = r[n];
2212
2212
  }
2213
2213
  })(exports, (() => (() => {
2214
2214
  "use strict";
2215
- var t4 = { 975: (t5) => {
2216
- function e2(t6) {
2217
- if (typeof t6 != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(t6));
2215
+ var t = { 975: (t2) => {
2216
+ function e2(t3) {
2217
+ if (typeof t3 != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(t3));
2218
2218
  }
2219
- function r2(t6, e3) {
2220
- for (var r3, n3 = "", i2 = 0, o = -1, s = 0, a = 0; a <= t6.length; ++a) {
2221
- if (a < t6.length) r3 = t6.charCodeAt(a);
2219
+ function r2(t3, e3) {
2220
+ for (var r3, n3 = "", i2 = 0, o = -1, s = 0, a = 0; a <= t3.length; ++a) {
2221
+ if (a < t3.length) r3 = t3.charCodeAt(a);
2222
2222
  else {
2223
2223
  if (r3 === 47) break;
2224
2224
  r3 = 47;
@@ -2238,70 +2238,70 @@ var require_umd = __commonJS({
2238
2238
  }
2239
2239
  }
2240
2240
  e3 && (n3.length > 0 ? n3 += "/.." : n3 = "..", i2 = 2);
2241
- } else n3.length > 0 ? n3 += "/" + t6.slice(o + 1, a) : n3 = t6.slice(o + 1, a), i2 = a - o - 1;
2241
+ } else n3.length > 0 ? n3 += "/" + t3.slice(o + 1, a) : n3 = t3.slice(o + 1, a), i2 = a - o - 1;
2242
2242
  o = a, s = 0;
2243
2243
  } else r3 === 46 && s !== -1 ? ++s : s = -1;
2244
2244
  }
2245
2245
  return n3;
2246
2246
  }
2247
2247
  var n2 = { resolve: function() {
2248
- for (var t6, n3 = "", i2 = !1, o = arguments.length - 1; o >= -1 && !i2; o--) {
2248
+ for (var t3, n3 = "", i2 = !1, o = arguments.length - 1; o >= -1 && !i2; o--) {
2249
2249
  var s;
2250
- o >= 0 ? s = arguments[o] : (t6 === void 0 && (t6 = process.cwd()), s = t6), e2(s), s.length !== 0 && (n3 = s + "/" + n3, i2 = s.charCodeAt(0) === 47);
2250
+ o >= 0 ? s = arguments[o] : (t3 === void 0 && (t3 = process.cwd()), s = t3), e2(s), s.length !== 0 && (n3 = s + "/" + n3, i2 = s.charCodeAt(0) === 47);
2251
2251
  }
2252
2252
  return n3 = r2(n3, !i2), i2 ? n3.length > 0 ? "/" + n3 : "/" : n3.length > 0 ? n3 : ".";
2253
- }, normalize: function(t6) {
2254
- if (e2(t6), t6.length === 0) return ".";
2255
- var n3 = t6.charCodeAt(0) === 47, i2 = t6.charCodeAt(t6.length - 1) === 47;
2256
- return (t6 = r2(t6, !n3)).length !== 0 || n3 || (t6 = "."), t6.length > 0 && i2 && (t6 += "/"), n3 ? "/" + t6 : t6;
2257
- }, isAbsolute: function(t6) {
2258
- return e2(t6), t6.length > 0 && t6.charCodeAt(0) === 47;
2253
+ }, normalize: function(t3) {
2254
+ if (e2(t3), t3.length === 0) return ".";
2255
+ var n3 = t3.charCodeAt(0) === 47, i2 = t3.charCodeAt(t3.length - 1) === 47;
2256
+ return (t3 = r2(t3, !n3)).length !== 0 || n3 || (t3 = "."), t3.length > 0 && i2 && (t3 += "/"), n3 ? "/" + t3 : t3;
2257
+ }, isAbsolute: function(t3) {
2258
+ return e2(t3), t3.length > 0 && t3.charCodeAt(0) === 47;
2259
2259
  }, join: function() {
2260
2260
  if (arguments.length === 0) return ".";
2261
- for (var t6, r3 = 0; r3 < arguments.length; ++r3) {
2261
+ for (var t3, r3 = 0; r3 < arguments.length; ++r3) {
2262
2262
  var i2 = arguments[r3];
2263
- e2(i2), i2.length > 0 && (t6 === void 0 ? t6 = i2 : t6 += "/" + i2);
2263
+ e2(i2), i2.length > 0 && (t3 === void 0 ? t3 = i2 : t3 += "/" + i2);
2264
2264
  }
2265
- return t6 === void 0 ? "." : n2.normalize(t6);
2266
- }, relative: function(t6, r3) {
2267
- if (e2(t6), e2(r3), t6 === r3 || (t6 = n2.resolve(t6)) === (r3 = n2.resolve(r3))) return "";
2268
- for (var i2 = 1; i2 < t6.length && t6.charCodeAt(i2) === 47; ++i2) ;
2269
- for (var o = t6.length, s = o - i2, a = 1; a < r3.length && r3.charCodeAt(a) === 47; ++a) ;
2265
+ return t3 === void 0 ? "." : n2.normalize(t3);
2266
+ }, relative: function(t3, r3) {
2267
+ if (e2(t3), e2(r3), t3 === r3 || (t3 = n2.resolve(t3)) === (r3 = n2.resolve(r3))) return "";
2268
+ for (var i2 = 1; i2 < t3.length && t3.charCodeAt(i2) === 47; ++i2) ;
2269
+ for (var o = t3.length, s = o - i2, a = 1; a < r3.length && r3.charCodeAt(a) === 47; ++a) ;
2270
2270
  for (var h = r3.length - a, c = s < h ? s : h, f = -1, u = 0; u <= c; ++u) {
2271
2271
  if (u === c) {
2272
2272
  if (h > c) {
2273
2273
  if (r3.charCodeAt(a + u) === 47) return r3.slice(a + u + 1);
2274
2274
  if (u === 0) return r3.slice(a + u);
2275
- } else s > c && (t6.charCodeAt(i2 + u) === 47 ? f = u : u === 0 && (f = 0));
2275
+ } else s > c && (t3.charCodeAt(i2 + u) === 47 ? f = u : u === 0 && (f = 0));
2276
2276
  break;
2277
2277
  }
2278
- var l = t6.charCodeAt(i2 + u);
2278
+ var l = t3.charCodeAt(i2 + u);
2279
2279
  if (l !== r3.charCodeAt(a + u)) break;
2280
2280
  l === 47 && (f = u);
2281
2281
  }
2282
2282
  var d = "";
2283
- for (u = i2 + f + 1; u <= o; ++u) u !== o && t6.charCodeAt(u) !== 47 || (d.length === 0 ? d += ".." : d += "/..");
2283
+ for (u = i2 + f + 1; u <= o; ++u) u !== o && t3.charCodeAt(u) !== 47 || (d.length === 0 ? d += ".." : d += "/..");
2284
2284
  return d.length > 0 ? d + r3.slice(a + f) : (a += f, r3.charCodeAt(a) === 47 && ++a, r3.slice(a));
2285
- }, _makeLong: function(t6) {
2286
- return t6;
2287
- }, dirname: function(t6) {
2288
- if (e2(t6), t6.length === 0) return ".";
2289
- for (var r3 = t6.charCodeAt(0), n3 = r3 === 47, i2 = -1, o = !0, s = t6.length - 1; s >= 1; --s) if ((r3 = t6.charCodeAt(s)) === 47) {
2285
+ }, _makeLong: function(t3) {
2286
+ return t3;
2287
+ }, dirname: function(t3) {
2288
+ if (e2(t3), t3.length === 0) return ".";
2289
+ for (var r3 = t3.charCodeAt(0), n3 = r3 === 47, i2 = -1, o = !0, s = t3.length - 1; s >= 1; --s) if ((r3 = t3.charCodeAt(s)) === 47) {
2290
2290
  if (!o) {
2291
2291
  i2 = s;
2292
2292
  break;
2293
2293
  }
2294
2294
  } else o = !1;
2295
- return i2 === -1 ? n3 ? "/" : "." : n3 && i2 === 1 ? "//" : t6.slice(0, i2);
2296
- }, basename: function(t6, r3) {
2295
+ return i2 === -1 ? n3 ? "/" : "." : n3 && i2 === 1 ? "//" : t3.slice(0, i2);
2296
+ }, basename: function(t3, r3) {
2297
2297
  if (r3 !== void 0 && typeof r3 != "string") throw new TypeError('"ext" argument must be a string');
2298
- e2(t6);
2298
+ e2(t3);
2299
2299
  var n3, i2 = 0, o = -1, s = !0;
2300
- if (r3 !== void 0 && r3.length > 0 && r3.length <= t6.length) {
2301
- if (r3.length === t6.length && r3 === t6) return "";
2300
+ if (r3 !== void 0 && r3.length > 0 && r3.length <= t3.length) {
2301
+ if (r3.length === t3.length && r3 === t3) return "";
2302
2302
  var a = r3.length - 1, h = -1;
2303
- for (n3 = t6.length - 1; n3 >= 0; --n3) {
2304
- var c = t6.charCodeAt(n3);
2303
+ for (n3 = t3.length - 1; n3 >= 0; --n3) {
2304
+ var c = t3.charCodeAt(n3);
2305
2305
  if (c === 47) {
2306
2306
  if (!s) {
2307
2307
  i2 = n3 + 1;
@@ -2309,79 +2309,79 @@ var require_umd = __commonJS({
2309
2309
  }
2310
2310
  } else h === -1 && (s = !1, h = n3 + 1), a >= 0 && (c === r3.charCodeAt(a) ? --a == -1 && (o = n3) : (a = -1, o = h));
2311
2311
  }
2312
- return i2 === o ? o = h : o === -1 && (o = t6.length), t6.slice(i2, o);
2312
+ return i2 === o ? o = h : o === -1 && (o = t3.length), t3.slice(i2, o);
2313
2313
  }
2314
- for (n3 = t6.length - 1; n3 >= 0; --n3) if (t6.charCodeAt(n3) === 47) {
2314
+ for (n3 = t3.length - 1; n3 >= 0; --n3) if (t3.charCodeAt(n3) === 47) {
2315
2315
  if (!s) {
2316
2316
  i2 = n3 + 1;
2317
2317
  break;
2318
2318
  }
2319
2319
  } else o === -1 && (s = !1, o = n3 + 1);
2320
- return o === -1 ? "" : t6.slice(i2, o);
2321
- }, extname: function(t6) {
2322
- e2(t6);
2323
- for (var r3 = -1, n3 = 0, i2 = -1, o = !0, s = 0, a = t6.length - 1; a >= 0; --a) {
2324
- var h = t6.charCodeAt(a);
2320
+ return o === -1 ? "" : t3.slice(i2, o);
2321
+ }, extname: function(t3) {
2322
+ e2(t3);
2323
+ for (var r3 = -1, n3 = 0, i2 = -1, o = !0, s = 0, a = t3.length - 1; a >= 0; --a) {
2324
+ var h = t3.charCodeAt(a);
2325
2325
  if (h !== 47) i2 === -1 && (o = !1, i2 = a + 1), h === 46 ? r3 === -1 ? r3 = a : s !== 1 && (s = 1) : r3 !== -1 && (s = -1);
2326
2326
  else if (!o) {
2327
2327
  n3 = a + 1;
2328
2328
  break;
2329
2329
  }
2330
2330
  }
2331
- return r3 === -1 || i2 === -1 || s === 0 || s === 1 && r3 === i2 - 1 && r3 === n3 + 1 ? "" : t6.slice(r3, i2);
2332
- }, format: function(t6) {
2333
- if (t6 === null || typeof t6 != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t6);
2334
- return (function(t7, e3) {
2331
+ return r3 === -1 || i2 === -1 || s === 0 || s === 1 && r3 === i2 - 1 && r3 === n3 + 1 ? "" : t3.slice(r3, i2);
2332
+ }, format: function(t3) {
2333
+ if (t3 === null || typeof t3 != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t3);
2334
+ return (function(t4, e3) {
2335
2335
  var r3 = e3.dir || e3.root, n3 = e3.base || (e3.name || "") + (e3.ext || "");
2336
2336
  return r3 ? r3 === e3.root ? r3 + n3 : r3 + "/" + n3 : n3;
2337
- })(0, t6);
2338
- }, parse: function(t6) {
2339
- e2(t6);
2337
+ })(0, t3);
2338
+ }, parse: function(t3) {
2339
+ e2(t3);
2340
2340
  var r3 = { root: "", dir: "", base: "", ext: "", name: "" };
2341
- if (t6.length === 0) return r3;
2342
- var n3, i2 = t6.charCodeAt(0), o = i2 === 47;
2341
+ if (t3.length === 0) return r3;
2342
+ var n3, i2 = t3.charCodeAt(0), o = i2 === 47;
2343
2343
  o ? (r3.root = "/", n3 = 1) : n3 = 0;
2344
- for (var s = -1, a = 0, h = -1, c = !0, f = t6.length - 1, u = 0; f >= n3; --f) if ((i2 = t6.charCodeAt(f)) !== 47) h === -1 && (c = !1, h = f + 1), i2 === 46 ? s === -1 ? s = f : u !== 1 && (u = 1) : s !== -1 && (u = -1);
2344
+ for (var s = -1, a = 0, h = -1, c = !0, f = t3.length - 1, u = 0; f >= n3; --f) if ((i2 = t3.charCodeAt(f)) !== 47) h === -1 && (c = !1, h = f + 1), i2 === 46 ? s === -1 ? s = f : u !== 1 && (u = 1) : s !== -1 && (u = -1);
2345
2345
  else if (!c) {
2346
2346
  a = f + 1;
2347
2347
  break;
2348
2348
  }
2349
- return s === -1 || h === -1 || u === 0 || u === 1 && s === h - 1 && s === a + 1 ? h !== -1 && (r3.base = r3.name = a === 0 && o ? t6.slice(1, h) : t6.slice(a, h)) : (a === 0 && o ? (r3.name = t6.slice(1, s), r3.base = t6.slice(1, h)) : (r3.name = t6.slice(a, s), r3.base = t6.slice(a, h)), r3.ext = t6.slice(s, h)), a > 0 ? r3.dir = t6.slice(0, a - 1) : o && (r3.dir = "/"), r3;
2349
+ return s === -1 || h === -1 || u === 0 || u === 1 && s === h - 1 && s === a + 1 ? h !== -1 && (r3.base = r3.name = a === 0 && o ? t3.slice(1, h) : t3.slice(a, h)) : (a === 0 && o ? (r3.name = t3.slice(1, s), r3.base = t3.slice(1, h)) : (r3.name = t3.slice(a, s), r3.base = t3.slice(a, h)), r3.ext = t3.slice(s, h)), a > 0 ? r3.dir = t3.slice(0, a - 1) : o && (r3.dir = "/"), r3;
2350
2350
  }, sep: "/", delimiter: ":", win32: null, posix: null };
2351
- n2.posix = n2, t5.exports = n2;
2352
- }, 70: (t5, e2) => {
2351
+ n2.posix = n2, t2.exports = n2;
2352
+ }, 70: (t2, e2) => {
2353
2353
  if (Object.defineProperty(e2, "__esModule", { value: !0 }), e2.isWindows = void 0, typeof process == "object") e2.isWindows = process.platform === "win32";
2354
2354
  else if (typeof navigator == "object") {
2355
- let t6 = navigator.userAgent;
2356
- e2.isWindows = t6.indexOf("Windows") >= 0;
2355
+ let t3 = navigator.userAgent;
2356
+ e2.isWindows = t3.indexOf("Windows") >= 0;
2357
2357
  }
2358
- }, 231: (t5, e2, r2) => {
2358
+ }, 231: (t2, e2, r2) => {
2359
2359
  Object.defineProperty(e2, "__esModule", { value: !0 }), e2.uriToFsPath = e2.URI = void 0;
2360
2360
  let n2 = r2(70), i2 = /^\w[\w\d+.-]*$/, o = /^\//, s = /^\/\//;
2361
- function a(t6, e3) {
2362
- if (!t6.scheme && e3) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t6.authority}", path: "${t6.path}", query: "${t6.query}", fragment: "${t6.fragment}"}`);
2363
- if (t6.scheme && !i2.test(t6.scheme)) throw new Error("[UriError]: Scheme contains illegal characters.");
2364
- if (t6.path) {
2365
- if (t6.authority) {
2366
- if (!o.test(t6.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
2367
- } else if (s.test(t6.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
2361
+ function a(t3, e3) {
2362
+ if (!t3.scheme && e3) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t3.authority}", path: "${t3.path}", query: "${t3.query}", fragment: "${t3.fragment}"}`);
2363
+ if (t3.scheme && !i2.test(t3.scheme)) throw new Error("[UriError]: Scheme contains illegal characters.");
2364
+ if (t3.path) {
2365
+ if (t3.authority) {
2366
+ if (!o.test(t3.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
2367
+ } else if (s.test(t3.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
2368
2368
  }
2369
2369
  }
2370
2370
  let h = "", c = "/", f = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
2371
2371
  class u {
2372
- static isUri(t6) {
2373
- return t6 instanceof u || !!t6 && typeof t6.authority == "string" && typeof t6.fragment == "string" && typeof t6.path == "string" && typeof t6.query == "string" && typeof t6.scheme == "string" && typeof t6.fsPath == "string" && typeof t6.with == "function" && typeof t6.toString == "function";
2372
+ static isUri(t3) {
2373
+ return t3 instanceof u || !!t3 && typeof t3.authority == "string" && typeof t3.fragment == "string" && typeof t3.path == "string" && typeof t3.query == "string" && typeof t3.scheme == "string" && typeof t3.fsPath == "string" && typeof t3.with == "function" && typeof t3.toString == "function";
2374
2374
  }
2375
2375
  scheme;
2376
2376
  authority;
2377
2377
  path;
2378
2378
  query;
2379
2379
  fragment;
2380
- constructor(t6, e3, r3, n3, i3, o2 = !1) {
2381
- typeof t6 == "object" ? (this.scheme = t6.scheme || h, this.authority = t6.authority || h, this.path = t6.path || h, this.query = t6.query || h, this.fragment = t6.fragment || h) : (this.scheme = /* @__PURE__ */ (function(t7, e4) {
2382
- return t7 || e4 ? t7 : "file";
2383
- })(t6, o2), this.authority = e3 || h, this.path = (function(t7, e4) {
2384
- switch (t7) {
2380
+ constructor(t3, e3, r3, n3, i3, o2 = !1) {
2381
+ typeof t3 == "object" ? (this.scheme = t3.scheme || h, this.authority = t3.authority || h, this.path = t3.path || h, this.query = t3.query || h, this.fragment = t3.fragment || h) : (this.scheme = /* @__PURE__ */ (function(t4, e4) {
2382
+ return t4 || e4 ? t4 : "file";
2383
+ })(t3, o2), this.authority = e3 || h, this.path = (function(t4, e4) {
2384
+ switch (t4) {
2385
2385
  case "https":
2386
2386
  case "http":
2387
2387
  case "file":
@@ -2393,42 +2393,42 @@ var require_umd = __commonJS({
2393
2393
  get fsPath() {
2394
2394
  return v(this, !1);
2395
2395
  }
2396
- with(t6) {
2397
- if (!t6) return this;
2398
- let { scheme: e3, authority: r3, path: n3, query: i3, fragment: o2 } = t6;
2396
+ with(t3) {
2397
+ if (!t3) return this;
2398
+ let { scheme: e3, authority: r3, path: n3, query: i3, fragment: o2 } = t3;
2399
2399
  return e3 === void 0 ? e3 = this.scheme : e3 === null && (e3 = h), r3 === void 0 ? r3 = this.authority : r3 === null && (r3 = h), n3 === void 0 ? n3 = this.path : n3 === null && (n3 = h), i3 === void 0 ? i3 = this.query : i3 === null && (i3 = h), o2 === void 0 ? o2 = this.fragment : o2 === null && (o2 = h), e3 === this.scheme && r3 === this.authority && n3 === this.path && i3 === this.query && o2 === this.fragment ? this : new d(e3, r3, n3, i3, o2);
2400
2400
  }
2401
- static parse(t6, e3 = !1) {
2402
- let r3 = f.exec(t6);
2401
+ static parse(t3, e3 = !1) {
2402
+ let r3 = f.exec(t3);
2403
2403
  return r3 ? new d(r3[2] || h, w(r3[4] || h), w(r3[5] || h), w(r3[7] || h), w(r3[9] || h), e3) : new d(h, h, h, h, h);
2404
2404
  }
2405
- static file(t6) {
2405
+ static file(t3) {
2406
2406
  let e3 = h;
2407
- if (n2.isWindows && (t6 = t6.replace(/\\/g, c)), t6[0] === c && t6[1] === c) {
2408
- let r3 = t6.indexOf(c, 2);
2409
- r3 === -1 ? (e3 = t6.substring(2), t6 = c) : (e3 = t6.substring(2, r3), t6 = t6.substring(r3) || c);
2407
+ if (n2.isWindows && (t3 = t3.replace(/\\/g, c)), t3[0] === c && t3[1] === c) {
2408
+ let r3 = t3.indexOf(c, 2);
2409
+ r3 === -1 ? (e3 = t3.substring(2), t3 = c) : (e3 = t3.substring(2, r3), t3 = t3.substring(r3) || c);
2410
2410
  }
2411
- return new d("file", e3, t6, h, h);
2411
+ return new d("file", e3, t3, h, h);
2412
2412
  }
2413
- static from(t6) {
2414
- let e3 = new d(t6.scheme, t6.authority, t6.path, t6.query, t6.fragment);
2413
+ static from(t3) {
2414
+ let e3 = new d(t3.scheme, t3.authority, t3.path, t3.query, t3.fragment);
2415
2415
  return a(e3, !0), e3;
2416
2416
  }
2417
- toString(t6 = !1) {
2418
- return y(this, t6);
2417
+ toString(t3 = !1) {
2418
+ return y(this, t3);
2419
2419
  }
2420
2420
  toJSON() {
2421
2421
  return this;
2422
2422
  }
2423
- static revive(t6) {
2424
- if (t6) {
2425
- if (t6 instanceof u) return t6;
2423
+ static revive(t3) {
2424
+ if (t3) {
2425
+ if (t3 instanceof u) return t3;
2426
2426
  {
2427
- let e3 = new d(t6);
2428
- return e3._formatted = t6.external, e3._fsPath = t6._sep === l ? t6.fsPath : null, e3;
2427
+ let e3 = new d(t3);
2428
+ return e3._formatted = t3.external, e3._fsPath = t3._sep === l ? t3.fsPath : null, e3;
2429
2429
  }
2430
2430
  }
2431
- return t6;
2431
+ return t3;
2432
2432
  }
2433
2433
  }
2434
2434
  e2.URI = u;
@@ -2439,112 +2439,112 @@ var require_umd = __commonJS({
2439
2439
  get fsPath() {
2440
2440
  return this._fsPath || (this._fsPath = v(this, !1)), this._fsPath;
2441
2441
  }
2442
- toString(t6 = !1) {
2443
- return t6 ? y(this, !0) : (this._formatted || (this._formatted = y(this, !1)), this._formatted);
2442
+ toString(t3 = !1) {
2443
+ return t3 ? y(this, !0) : (this._formatted || (this._formatted = y(this, !1)), this._formatted);
2444
2444
  }
2445
2445
  toJSON() {
2446
- let t6 = { $mid: 1 };
2447
- return this._fsPath && (t6.fsPath = this._fsPath, t6._sep = l), this._formatted && (t6.external = this._formatted), this.path && (t6.path = this.path), this.scheme && (t6.scheme = this.scheme), this.authority && (t6.authority = this.authority), this.query && (t6.query = this.query), this.fragment && (t6.fragment = this.fragment), t6;
2446
+ let t3 = { $mid: 1 };
2447
+ return this._fsPath && (t3.fsPath = this._fsPath, t3._sep = l), this._formatted && (t3.external = this._formatted), this.path && (t3.path = this.path), this.scheme && (t3.scheme = this.scheme), this.authority && (t3.authority = this.authority), this.query && (t3.query = this.query), this.fragment && (t3.fragment = this.fragment), t3;
2448
2448
  }
2449
2449
  }
2450
2450
  let p = { 58: "%3A", 47: "%2F", 63: "%3F", 35: "%23", 91: "%5B", 93: "%5D", 64: "%40", 33: "%21", 36: "%24", 38: "%26", 39: "%27", 40: "%28", 41: "%29", 42: "%2A", 43: "%2B", 44: "%2C", 59: "%3B", 61: "%3D", 32: "%20" };
2451
- function g(t6, e3, r3) {
2451
+ function g(t3, e3, r3) {
2452
2452
  let n3, i3 = -1;
2453
- for (let o2 = 0; o2 < t6.length; o2++) {
2454
- let s2 = t6.charCodeAt(o2);
2455
- if (s2 >= 97 && s2 <= 122 || s2 >= 65 && s2 <= 90 || s2 >= 48 && s2 <= 57 || s2 === 45 || s2 === 46 || s2 === 95 || s2 === 126 || e3 && s2 === 47 || r3 && s2 === 91 || r3 && s2 === 93 || r3 && s2 === 58) i3 !== -1 && (n3 += encodeURIComponent(t6.substring(i3, o2)), i3 = -1), n3 !== void 0 && (n3 += t6.charAt(o2));
2453
+ for (let o2 = 0; o2 < t3.length; o2++) {
2454
+ let s2 = t3.charCodeAt(o2);
2455
+ if (s2 >= 97 && s2 <= 122 || s2 >= 65 && s2 <= 90 || s2 >= 48 && s2 <= 57 || s2 === 45 || s2 === 46 || s2 === 95 || s2 === 126 || e3 && s2 === 47 || r3 && s2 === 91 || r3 && s2 === 93 || r3 && s2 === 58) i3 !== -1 && (n3 += encodeURIComponent(t3.substring(i3, o2)), i3 = -1), n3 !== void 0 && (n3 += t3.charAt(o2));
2456
2456
  else {
2457
- n3 === void 0 && (n3 = t6.substr(0, o2));
2457
+ n3 === void 0 && (n3 = t3.substr(0, o2));
2458
2458
  let e4 = p[s2];
2459
- e4 !== void 0 ? (i3 !== -1 && (n3 += encodeURIComponent(t6.substring(i3, o2)), i3 = -1), n3 += e4) : i3 === -1 && (i3 = o2);
2459
+ e4 !== void 0 ? (i3 !== -1 && (n3 += encodeURIComponent(t3.substring(i3, o2)), i3 = -1), n3 += e4) : i3 === -1 && (i3 = o2);
2460
2460
  }
2461
2461
  }
2462
- return i3 !== -1 && (n3 += encodeURIComponent(t6.substring(i3))), n3 !== void 0 ? n3 : t6;
2462
+ return i3 !== -1 && (n3 += encodeURIComponent(t3.substring(i3))), n3 !== void 0 ? n3 : t3;
2463
2463
  }
2464
- function m(t6) {
2464
+ function m(t3) {
2465
2465
  let e3;
2466
- for (let r3 = 0; r3 < t6.length; r3++) {
2467
- let n3 = t6.charCodeAt(r3);
2468
- n3 === 35 || n3 === 63 ? (e3 === void 0 && (e3 = t6.substr(0, r3)), e3 += p[n3]) : e3 !== void 0 && (e3 += t6[r3]);
2466
+ for (let r3 = 0; r3 < t3.length; r3++) {
2467
+ let n3 = t3.charCodeAt(r3);
2468
+ n3 === 35 || n3 === 63 ? (e3 === void 0 && (e3 = t3.substr(0, r3)), e3 += p[n3]) : e3 !== void 0 && (e3 += t3[r3]);
2469
2469
  }
2470
- return e3 !== void 0 ? e3 : t6;
2470
+ return e3 !== void 0 ? e3 : t3;
2471
2471
  }
2472
- function v(t6, e3) {
2472
+ function v(t3, e3) {
2473
2473
  let r3;
2474
- return r3 = t6.authority && t6.path.length > 1 && t6.scheme === "file" ? `//${t6.authority}${t6.path}` : t6.path.charCodeAt(0) === 47 && (t6.path.charCodeAt(1) >= 65 && t6.path.charCodeAt(1) <= 90 || t6.path.charCodeAt(1) >= 97 && t6.path.charCodeAt(1) <= 122) && t6.path.charCodeAt(2) === 58 ? e3 ? t6.path.substr(1) : t6.path[1].toLowerCase() + t6.path.substr(2) : t6.path, n2.isWindows && (r3 = r3.replace(/\//g, "\\")), r3;
2474
+ return r3 = t3.authority && t3.path.length > 1 && t3.scheme === "file" ? `//${t3.authority}${t3.path}` : t3.path.charCodeAt(0) === 47 && (t3.path.charCodeAt(1) >= 65 && t3.path.charCodeAt(1) <= 90 || t3.path.charCodeAt(1) >= 97 && t3.path.charCodeAt(1) <= 122) && t3.path.charCodeAt(2) === 58 ? e3 ? t3.path.substr(1) : t3.path[1].toLowerCase() + t3.path.substr(2) : t3.path, n2.isWindows && (r3 = r3.replace(/\//g, "\\")), r3;
2475
2475
  }
2476
- function y(t6, e3) {
2477
- let r3 = e3 ? m : g, n3 = "", { scheme: i3, authority: o2, path: s2, query: a2, fragment: h2 } = t6;
2476
+ function y(t3, e3) {
2477
+ let r3 = e3 ? m : g, n3 = "", { scheme: i3, authority: o2, path: s2, query: a2, fragment: h2 } = t3;
2478
2478
  if (i3 && (n3 += i3, n3 += ":"), (o2 || i3 === "file") && (n3 += c, n3 += c), o2) {
2479
- let t7 = o2.indexOf("@");
2480
- if (t7 !== -1) {
2481
- let e4 = o2.substr(0, t7);
2482
- o2 = o2.substr(t7 + 1), t7 = e4.lastIndexOf(":"), t7 === -1 ? n3 += r3(e4, !1, !1) : (n3 += r3(e4.substr(0, t7), !1, !1), n3 += ":", n3 += r3(e4.substr(t7 + 1), !1, !0)), n3 += "@";
2479
+ let t4 = o2.indexOf("@");
2480
+ if (t4 !== -1) {
2481
+ let e4 = o2.substr(0, t4);
2482
+ o2 = o2.substr(t4 + 1), t4 = e4.lastIndexOf(":"), t4 === -1 ? n3 += r3(e4, !1, !1) : (n3 += r3(e4.substr(0, t4), !1, !1), n3 += ":", n3 += r3(e4.substr(t4 + 1), !1, !0)), n3 += "@";
2483
2483
  }
2484
- o2 = o2.toLowerCase(), t7 = o2.lastIndexOf(":"), t7 === -1 ? n3 += r3(o2, !1, !0) : (n3 += r3(o2.substr(0, t7), !1, !0), n3 += o2.substr(t7));
2484
+ o2 = o2.toLowerCase(), t4 = o2.lastIndexOf(":"), t4 === -1 ? n3 += r3(o2, !1, !0) : (n3 += r3(o2.substr(0, t4), !1, !0), n3 += o2.substr(t4));
2485
2485
  }
2486
2486
  if (s2) {
2487
2487
  if (s2.length >= 3 && s2.charCodeAt(0) === 47 && s2.charCodeAt(2) === 58) {
2488
- let t7 = s2.charCodeAt(1);
2489
- t7 >= 65 && t7 <= 90 && (s2 = `/${String.fromCharCode(t7 + 32)}:${s2.substr(3)}`);
2488
+ let t4 = s2.charCodeAt(1);
2489
+ t4 >= 65 && t4 <= 90 && (s2 = `/${String.fromCharCode(t4 + 32)}:${s2.substr(3)}`);
2490
2490
  } else if (s2.length >= 2 && s2.charCodeAt(1) === 58) {
2491
- let t7 = s2.charCodeAt(0);
2492
- t7 >= 65 && t7 <= 90 && (s2 = `${String.fromCharCode(t7 + 32)}:${s2.substr(2)}`);
2491
+ let t4 = s2.charCodeAt(0);
2492
+ t4 >= 65 && t4 <= 90 && (s2 = `${String.fromCharCode(t4 + 32)}:${s2.substr(2)}`);
2493
2493
  }
2494
2494
  n3 += r3(s2, !0, !1);
2495
2495
  }
2496
2496
  return a2 && (n3 += "?", n3 += r3(a2, !1, !1)), h2 && (n3 += "#", n3 += e3 ? h2 : g(h2, !1, !1)), n3;
2497
2497
  }
2498
- function b(t6) {
2498
+ function b(t3) {
2499
2499
  try {
2500
- return decodeURIComponent(t6);
2500
+ return decodeURIComponent(t3);
2501
2501
  } catch {
2502
- return t6.length > 3 ? t6.substr(0, 3) + b(t6.substr(3)) : t6;
2502
+ return t3.length > 3 ? t3.substr(0, 3) + b(t3.substr(3)) : t3;
2503
2503
  }
2504
2504
  }
2505
2505
  e2.uriToFsPath = v;
2506
2506
  let C = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
2507
- function w(t6) {
2508
- return t6.match(C) ? t6.replace(C, ((t7) => b(t7))) : t6;
2507
+ function w(t3) {
2508
+ return t3.match(C) ? t3.replace(C, ((t4) => b(t4))) : t3;
2509
2509
  }
2510
- }, 552: function(t5, e2, r2) {
2511
- var n2 = this && this.__createBinding || (Object.create ? function(t6, e3, r3, n3) {
2510
+ }, 552: function(t2, e2, r2) {
2511
+ var n2 = this && this.__createBinding || (Object.create ? function(t3, e3, r3, n3) {
2512
2512
  n3 === void 0 && (n3 = r3);
2513
2513
  var i3 = Object.getOwnPropertyDescriptor(e3, r3);
2514
2514
  i3 && !("get" in i3 ? !e3.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: !0, get: function() {
2515
2515
  return e3[r3];
2516
- } }), Object.defineProperty(t6, n3, i3);
2517
- } : function(t6, e3, r3, n3) {
2518
- n3 === void 0 && (n3 = r3), t6[n3] = e3[r3];
2519
- }), i2 = this && this.__setModuleDefault || (Object.create ? function(t6, e3) {
2520
- Object.defineProperty(t6, "default", { enumerable: !0, value: e3 });
2521
- } : function(t6, e3) {
2522
- t6.default = e3;
2523
- }), o = this && this.__importStar || function(t6) {
2524
- if (t6 && t6.__esModule) return t6;
2516
+ } }), Object.defineProperty(t3, n3, i3);
2517
+ } : function(t3, e3, r3, n3) {
2518
+ n3 === void 0 && (n3 = r3), t3[n3] = e3[r3];
2519
+ }), i2 = this && this.__setModuleDefault || (Object.create ? function(t3, e3) {
2520
+ Object.defineProperty(t3, "default", { enumerable: !0, value: e3 });
2521
+ } : function(t3, e3) {
2522
+ t3.default = e3;
2523
+ }), o = this && this.__importStar || function(t3) {
2524
+ if (t3 && t3.__esModule) return t3;
2525
2525
  var e3 = {};
2526
- if (t6 != null) for (var r3 in t6) r3 !== "default" && Object.prototype.hasOwnProperty.call(t6, r3) && n2(e3, t6, r3);
2527
- return i2(e3, t6), e3;
2526
+ if (t3 != null) for (var r3 in t3) r3 !== "default" && Object.prototype.hasOwnProperty.call(t3, r3) && n2(e3, t3, r3);
2527
+ return i2(e3, t3), e3;
2528
2528
  };
2529
2529
  Object.defineProperty(e2, "__esModule", { value: !0 }), e2.Utils = void 0;
2530
2530
  let s = o(r2(975)), a = s.posix || s, h = "/";
2531
2531
  var c;
2532
- (function(t6) {
2533
- t6.joinPath = function(t7, ...e3) {
2534
- return t7.with({ path: a.join(t7.path, ...e3) });
2535
- }, t6.resolvePath = function(t7, ...e3) {
2536
- let r3 = t7.path, n3 = !1;
2532
+ (function(t3) {
2533
+ t3.joinPath = function(t4, ...e3) {
2534
+ return t4.with({ path: a.join(t4.path, ...e3) });
2535
+ }, t3.resolvePath = function(t4, ...e3) {
2536
+ let r3 = t4.path, n3 = !1;
2537
2537
  r3[0] !== h && (r3 = h + r3, n3 = !0);
2538
2538
  let i3 = a.resolve(r3, ...e3);
2539
- return n3 && i3[0] === h && !t7.authority && (i3 = i3.substring(1)), t7.with({ path: i3 });
2540
- }, t6.dirname = function(t7) {
2541
- if (t7.path.length === 0 || t7.path === h) return t7;
2542
- let e3 = a.dirname(t7.path);
2543
- return e3.length === 1 && e3.charCodeAt(0) === 46 && (e3 = ""), t7.with({ path: e3 });
2544
- }, t6.basename = function(t7) {
2545
- return a.basename(t7.path);
2546
- }, t6.extname = function(t7) {
2547
- return a.extname(t7.path);
2539
+ return n3 && i3[0] === h && !t4.authority && (i3 = i3.substring(1)), t4.with({ path: i3 });
2540
+ }, t3.dirname = function(t4) {
2541
+ if (t4.path.length === 0 || t4.path === h) return t4;
2542
+ let e3 = a.dirname(t4.path);
2543
+ return e3.length === 1 && e3.charCodeAt(0) === 46 && (e3 = ""), t4.with({ path: e3 });
2544
+ }, t3.basename = function(t4) {
2545
+ return a.basename(t4.path);
2546
+ }, t3.extname = function(t4) {
2547
+ return a.extname(t4.path);
2548
2548
  };
2549
2549
  })(c || (e2.Utils = c = {}));
2550
2550
  } }, e = {};
@@ -2552,18 +2552,18 @@ var require_umd = __commonJS({
2552
2552
  var i2 = e[n2];
2553
2553
  if (i2 !== void 0) return i2.exports;
2554
2554
  var o = e[n2] = { exports: {} };
2555
- return t4[n2].call(o.exports, o, o.exports, r), o.exports;
2555
+ return t[n2].call(o.exports, o, o.exports, r), o.exports;
2556
2556
  }
2557
2557
  var n = {};
2558
2558
  return (() => {
2559
- var t5 = n;
2560
- Object.defineProperty(t5, "__esModule", { value: !0 }), t5.Utils = t5.URI = void 0;
2559
+ var t2 = n;
2560
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Utils = t2.URI = void 0;
2561
2561
  let e2 = r(231);
2562
- Object.defineProperty(t5, "URI", { enumerable: !0, get: function() {
2562
+ Object.defineProperty(t2, "URI", { enumerable: !0, get: function() {
2563
2563
  return e2.URI;
2564
2564
  } });
2565
2565
  let i2 = r(552);
2566
- Object.defineProperty(t5, "Utils", { enumerable: !0, get: function() {
2566
+ Object.defineProperty(t2, "Utils", { enumerable: !0, get: function() {
2567
2567
  return i2.Utils;
2568
2568
  } });
2569
2569
  })(), n;
@@ -6167,7 +6167,7 @@ __export(acorn_exports, {
6167
6167
  lineBreak: () => lineBreak,
6168
6168
  lineBreakG: () => lineBreakG,
6169
6169
  nonASCIIwhitespace: () => nonASCIIwhitespace,
6170
- parse: () => parse3,
6170
+ parse: () => parse4,
6171
6171
  parseExpressionAt: () => parseExpressionAt2,
6172
6172
  tokContexts: () => types,
6173
6173
  tokTypes: () => types$1,
@@ -6335,7 +6335,7 @@ function stringToNumber(str, isLegacyOctalNumericLiteral) {
6335
6335
  function stringToBigInt(str) {
6336
6336
  return typeof BigInt != "function" ? null : BigInt(str.replace(/_/g, ""));
6337
6337
  }
6338
- function parse3(input, options) {
6338
+ function parse4(input, options) {
6339
6339
  return Parser.parse(input, options);
6340
6340
  }
6341
6341
  function parseExpressionAt2(input, pos, options) {
@@ -7825,7 +7825,7 @@ var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars,
7825
7825
  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
7826
7826
  return this.enterScope(functionFlags(isAsync, !1) | SCOPE_ARROW), this.initFunction(node), this.options.ecmaVersion >= 8 && (node.async = !!isAsync), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, node.params = this.toAssignableList(params, !0), this.parseFunctionBody(node, !0, !1, forInit), this.yieldPos = oldYieldPos, this.awaitPos = oldAwaitPos, this.awaitIdentPos = oldAwaitIdentPos, this.finishNode(node, "ArrowFunctionExpression");
7827
7827
  };
7828
- pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
7828
+ pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod2, forInit) {
7829
7829
  var isExpression = isArrowFunction && this.type !== types$1.braceL, oldStrict = this.strict, useStrict = !1;
7830
7830
  if (isExpression)
7831
7831
  node.body = this.parseMaybeAssign(forInit), node.expression = !0, this.checkParams(node, !1);
@@ -7833,7 +7833,7 @@ var astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars,
7833
7833
  var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
7834
7834
  (!oldStrict || nonSimple) && (useStrict = this.strictDirective(this.end), useStrict && nonSimple && this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
7835
7835
  var oldLabels = this.labels;
7836
- this.labels = [], useStrict && (this.strict = !0), this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)), this.strict && node.id && this.checkLValSimple(node.id, BIND_OUTSIDE), node.body = this.parseBlock(!1, void 0, useStrict && !oldStrict), node.expression = !1, this.adaptDirectivePrologue(node.body.body), this.labels = oldLabels;
7836
+ this.labels = [], useStrict && (this.strict = !0), this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod2 && this.isSimpleParamList(node.params)), this.strict && node.id && this.checkLValSimple(node.id, BIND_OUTSIDE), node.body = this.parseBlock(!1, void 0, useStrict && !oldStrict), node.expression = !1, this.adaptDirectivePrologue(node.body.body), this.labels = oldLabels;
7837
7837
  }
7838
7838
  this.exitScope();
7839
7839
  };
@@ -10235,12 +10235,12 @@ var require_dist2 = __commonJS({
10235
10235
  "../../../node_modules/@base2/pretty-print-object/dist/index.js"(exports) {
10236
10236
  "use strict";
10237
10237
  var __assign = exports && exports.__assign || function() {
10238
- return __assign = Object.assign || function(t4) {
10238
+ return __assign = Object.assign || function(t) {
10239
10239
  for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
10240
10240
  s = arguments[i2];
10241
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t4[p] = s[p]);
10241
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
10242
10242
  }
10243
- return t4;
10243
+ return t;
10244
10244
  }, __assign.apply(this, arguments);
10245
10245
  }, __spreadArrays = exports && exports.__spreadArrays || function() {
10246
10246
  for (var s = 0, i2 = 0, il = arguments.length; i2 < il; i2++) s += arguments[i2].length;
@@ -10331,7 +10331,7 @@ var require_dist2 = __commonJS({
10331
10331
  var require_react_is_production_min = __commonJS({
10332
10332
  "../../../node_modules/react-element-to-jsx-string/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
10333
10333
  "use strict";
10334
- var b = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), p = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t4 = /* @__PURE__ */ Symbol.for("react.offscreen"), u;
10334
+ var b = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), p = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t = /* @__PURE__ */ Symbol.for("react.offscreen"), u;
10335
10335
  u = /* @__PURE__ */ Symbol.for("react.module.reference");
10336
10336
  function v(a) {
10337
10337
  if (typeof a == "object" && a !== null) {
@@ -10418,7 +10418,7 @@ var require_react_is_production_min = __commonJS({
10418
10418
  return v(a) === n;
10419
10419
  };
10420
10420
  exports.isValidElementType = function(a) {
10421
- return typeof a == "string" || typeof a == "function" || a === d || a === f || a === e || a === m || a === n || a === t4 || typeof a == "object" && a !== null && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || a.getModuleId !== void 0);
10421
+ return typeof a == "string" || typeof a == "function" || a === d || a === f || a === e || a === m || a === n || a === t || typeof a == "object" && a !== null && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || a.getModuleId !== void 0);
10422
10422
  };
10423
10423
  exports.typeOf = v;
10424
10424
  }
@@ -11655,12 +11655,12 @@ var require_tsconfig_loader = __commonJS({
11655
11655
  "../../../node_modules/tsconfig-paths/lib/tsconfig-loader.js"(exports) {
11656
11656
  "use strict";
11657
11657
  var __assign = exports && exports.__assign || function() {
11658
- return __assign = Object.assign || function(t4) {
11658
+ return __assign = Object.assign || function(t) {
11659
11659
  for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) {
11660
11660
  s = arguments[i2];
11661
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t4[p] = s[p]);
11661
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
11662
11662
  }
11663
- return t4;
11663
+ return t;
11664
11664
  }, __assign.apply(this, arguments);
11665
11665
  };
11666
11666
  Object.defineProperty(exports, "__esModule", { value: !0 });
@@ -13444,9 +13444,9 @@ function serializeType(typescript, checker, type, isRequired, depth = 0) {
13444
13444
  return { name: checker.typeToString(type) };
13445
13445
  if (type.isUnion()) {
13446
13446
  let nonUndefinedTypes = type.types.filter(
13447
- (t4) => !(t4.getFlags() & typescript.TypeFlags.Undefined)
13447
+ (t) => !(t.getFlags() & typescript.TypeFlags.Undefined)
13448
13448
  ), booleanLiterals = nonUndefinedTypes.filter(
13449
- (t4) => t4.getFlags() & typescript.TypeFlags.BooleanLiteral
13449
+ (t) => t.getFlags() & typescript.TypeFlags.BooleanLiteral
13450
13450
  );
13451
13451
  if (booleanLiterals.length === 2 && booleanLiterals.length === nonUndefinedTypes.length)
13452
13452
  return { name: "boolean" };
@@ -14097,6 +14097,12 @@ function createReactProjectFactory(typescript) {
14097
14097
  }
14098
14098
  };
14099
14099
  }
14100
+ function assertTypeScriptCompilerApi(typescript) {
14101
+ if (typeof typescript?.sys?.fileExists != "function")
14102
+ throw new Error(
14103
+ "The resolved `typescript` package does not expose the compiler API (`ts.sys` is undefined). This happens when `typescript` resolves to a build without the full API, such as the TypeScript 7 native-preview package. Component metadata extraction requires a standard TypeScript installation."
14104
+ );
14105
+ }
14100
14106
  var ComponentMetaManager = class extends BaseComponentMetaManager {
14101
14107
  /**
14102
14108
  * @param recycleHeapPressureRatio Fraction of the V8 heap limit at which the shared program(s)
@@ -14104,6 +14110,7 @@ var ComponentMetaManager = class extends BaseComponentMetaManager {
14104
14110
  * to disable recycling and assert the OOM still happens without the fix.
14105
14111
  */
14106
14112
  constructor(typescript, recycleHeapPressureRatio) {
14113
+ assertTypeScriptCompilerApi(typescript);
14107
14114
  let { factory, fsFileSnapshots } = createReactProjectFactory(typescript);
14108
14115
  super(typescript, factory, recycleHeapPressureRatio), this.fsFileSnapshots = fsFileSnapshots;
14109
14116
  }
@@ -14128,6 +14135,296 @@ var ComponentMetaManager = class extends BaseComponentMetaManager {
14128
14135
  }
14129
14136
  };
14130
14137
 
14138
+ // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
14139
+ var _lazyMatch = () => {
14140
+ var __lib__ = (() => {
14141
+ var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
14142
+ for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
14143
+ }, H = (r, e, n, a) => {
14144
+ if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
14145
+ return r;
14146
+ }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
14147
+ q(w, { default: () => re });
14148
+ var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
14149
+ let e = /* @__PURE__ */ new Map();
14150
+ return (n) => {
14151
+ let a = e.get(n);
14152
+ if (a) return a;
14153
+ let t = r(n);
14154
+ return e.set(n, t), t;
14155
+ };
14156
+ }, rr = (r, e, n = {}) => {
14157
+ let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
14158
+ if (v(e)(a) && a.index === r.length) return a.output;
14159
+ throw new Error(`Failed to parse at index ${a.indexMax}`);
14160
+ }, i2 = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
14161
+ let n = {};
14162
+ for (let a of r) {
14163
+ if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
14164
+ let t = a.charCodeAt(0);
14165
+ n[t] = !0;
14166
+ }
14167
+ return (a) => {
14168
+ let t = a.index, o = a.input;
14169
+ for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
14170
+ let u = a.index;
14171
+ if (u > t) {
14172
+ if (!h(e) && !a.options.silent) {
14173
+ let s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
14174
+ h(c) || a.output.push(c);
14175
+ }
14176
+ a.indexMax = Math.max(a.indexMax, a.index);
14177
+ }
14178
+ return !0;
14179
+ };
14180
+ }, nr = (r, e) => {
14181
+ let n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
14182
+ return g((o) => {
14183
+ t.lastIndex = o.index;
14184
+ let u = t.exec(o.input);
14185
+ if (u) {
14186
+ if (!h(e) && !o.options.silent) {
14187
+ let s = d(e) ? e(...u, o.input, String(o.index)) : e;
14188
+ h(s) || o.output.push(s);
14189
+ }
14190
+ return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
14191
+ } else return !1;
14192
+ });
14193
+ }, ar = (r, e) => (n) => {
14194
+ if (n.input.startsWith(r, n.index)) {
14195
+ if (!h(e) && !n.options.silent) {
14196
+ let t = d(e) ? e(r, n.input, String(n.index)) : e;
14197
+ h(t) || n.output.push(t);
14198
+ }
14199
+ return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
14200
+ } else return !1;
14201
+ }, C = (r, e, n, a) => {
14202
+ let t = v(r);
14203
+ return g(_(M((o) => {
14204
+ let u = 0;
14205
+ for (; u < n; ) {
14206
+ let s = o.index;
14207
+ if (!t(o) || (u += 1, o.index === s)) break;
14208
+ }
14209
+ return u >= e;
14210
+ })));
14211
+ }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
14212
+ let n = r.map(v);
14213
+ return g(_(M((a) => {
14214
+ for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return !1;
14215
+ return !0;
14216
+ })));
14217
+ }, l = (r, e) => {
14218
+ let n = r.map(v);
14219
+ return g(_((a) => {
14220
+ for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return !0;
14221
+ return !1;
14222
+ }));
14223
+ }, M = (r, e = !1) => {
14224
+ let n = v(r);
14225
+ return (a) => {
14226
+ let t = a.index, o = a.output.length, u = n(a);
14227
+ return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
14228
+ };
14229
+ }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
14230
+ let r = 0;
14231
+ return (e) => {
14232
+ let n = v(e), a = r += 1;
14233
+ return (t) => {
14234
+ var o;
14235
+ if (t.options.memoization === !1) return n(t);
14236
+ let u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
14237
+ if (c === !1) return !1;
14238
+ if (W(c)) return t.index = c, !0;
14239
+ if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), !0;
14240
+ {
14241
+ let Z = t.output.length;
14242
+ if (n(t)) {
14243
+ let D = t.index, U = t.output.length;
14244
+ if (U > Z) {
14245
+ let ee = t.output.slice(Z, U);
14246
+ s.set(u, { index: D, output: ee });
14247
+ } else s.set(u, D);
14248
+ return !0;
14249
+ } else return s.set(u, !1), !1;
14250
+ }
14251
+ };
14252
+ };
14253
+ })(), E = (r) => {
14254
+ let e;
14255
+ return (n) => (e || (e = v(r())), e(n));
14256
+ }, v = Y((r) => {
14257
+ if (d(r)) return Q(r) ? E(r) : r;
14258
+ if (b(r) || X(r)) return i2(r);
14259
+ if (A(r)) return x(r);
14260
+ if (K(r)) return l(Object.values(r));
14261
+ throw new Error("Invalid rule");
14262
+ }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
14263
+ let e = "";
14264
+ for (; r > 0; ) {
14265
+ let n = (r - 1) % 26;
14266
+ e = P[n] + e, r = Math.floor((r - 1) / 26);
14267
+ }
14268
+ return e;
14269
+ }, O = (r) => {
14270
+ let e = 0;
14271
+ for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
14272
+ return e;
14273
+ }, S = (r, e) => {
14274
+ if (e < r) return S(e, r);
14275
+ let n = [];
14276
+ for (; r <= e; ) n.push(r++);
14277
+ return n;
14278
+ }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
14279
+ let e = {};
14280
+ return (n) => e[n] ?? (e[n] = r(n));
14281
+ }, sr = i2(/^\*\*\/\*$/, ".*"), cr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i2(/\\./, p), pr = i2(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i2(/./, p), hr = i2(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i2(/^(!!)+/, ""), fr = l([hr, dr]), xr = i2(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i2(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i2(/\/(\*\*)$/, "(?:/.*|$)"), _r = i2(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i2(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i2(/\*/, "[^/]*"), N = l([Sr, yr]), k = i2("?", "[^/]"), $r = i2("[", p), wr = i2("]", p), Ar = i2(/[!^]/, "^/"), br = i2(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i2(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i2(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i2("{", "(?:"), Or = i2("}", ")"), Rr = i2(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i2(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i2(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i2("{", "(?:"), Br = i2("}", ")"), Ir = i2(",", "|"), Fr = i2(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i2(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i2(/\\./, p), qr = i2(/./, p), Hr = i2(/\*\*\*+/, "*"), Jr = i2(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i2(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
14282
+ let n = Array.isArray(r) ? r : [r];
14283
+ if (!n.length) return !1;
14284
+ let a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
14285
+ return a.some((s) => s.test(o));
14286
+ };
14287
+ $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
14288
+ var re = $;
14289
+ return J(w);
14290
+ })();
14291
+ return __lib__.default || __lib__;
14292
+ }, _match, zeptomatch = (path2, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path2, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
14293
+ function normalizeWindowsPath(input = "") {
14294
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
14295
+ }
14296
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/, sep = "/", normalize = function(path2) {
14297
+ if (path2.length === 0)
14298
+ return ".";
14299
+ path2 = normalizeWindowsPath(path2);
14300
+ let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
14301
+ return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
14302
+ }, join3 = function(...segments) {
14303
+ let path2 = "";
14304
+ for (let seg of segments)
14305
+ if (seg)
14306
+ if (path2.length > 0) {
14307
+ let pathTrailing = path2[path2.length - 1] === "/", segLeading = seg[0] === "/";
14308
+ pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
14309
+ } else
14310
+ path2 += seg;
14311
+ return normalize(path2);
14312
+ };
14313
+ function cwd() {
14314
+ return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
14315
+ }
14316
+ var resolve2 = function(...arguments_) {
14317
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
14318
+ let resolvedPath = "", resolvedAbsolute = !1;
14319
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
14320
+ let path2 = index >= 0 ? arguments_[index] : cwd();
14321
+ !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path2));
14322
+ }
14323
+ return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
14324
+ };
14325
+ function normalizeString(path2, allowAboveRoot) {
14326
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
14327
+ for (let index = 0; index <= path2.length; ++index) {
14328
+ if (index < path2.length)
14329
+ char = path2[index];
14330
+ else {
14331
+ if (char === "/")
14332
+ break;
14333
+ char = "/";
14334
+ }
14335
+ if (char === "/") {
14336
+ if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
14337
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
14338
+ if (res.length > 2) {
14339
+ let lastSlashIndex = res.lastIndexOf("/");
14340
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
14341
+ continue;
14342
+ } else if (res.length > 0) {
14343
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
14344
+ continue;
14345
+ }
14346
+ }
14347
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
14348
+ } else
14349
+ res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
14350
+ lastSlash = index, dots = 0;
14351
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
14352
+ }
14353
+ return res;
14354
+ }
14355
+ var isAbsolute2 = function(p) {
14356
+ return _IS_ABSOLUTE_RE.test(p);
14357
+ }, toNamespacedPath = function(p) {
14358
+ return normalizeWindowsPath(p);
14359
+ }, extname = function(p) {
14360
+ if (p === "..") return "";
14361
+ let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
14362
+ return match && match[1] || "";
14363
+ }, relative = function(from, to) {
14364
+ let _from = resolve2(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve2(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
14365
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
14366
+ return _to.join("/");
14367
+ let _fromCopy = [..._from];
14368
+ for (let segment of _fromCopy) {
14369
+ if (_to[0] !== segment)
14370
+ break;
14371
+ _from.shift(), _to.shift();
14372
+ }
14373
+ return [..._from.map(() => ".."), ..._to].join("/");
14374
+ }, dirname3 = function(p) {
14375
+ let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
14376
+ return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
14377
+ }, format = function(p) {
14378
+ let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
14379
+ Boolean
14380
+ );
14381
+ return normalizeWindowsPath(
14382
+ p.root ? resolve2(...segments) : segments.join("/")
14383
+ );
14384
+ }, basename = function(p, extension) {
14385
+ let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
14386
+ for (let i2 = segments.length - 1; i2 >= 0; i2--) {
14387
+ let val = segments[i2];
14388
+ if (val) {
14389
+ lastSegment = val;
14390
+ break;
14391
+ }
14392
+ }
14393
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
14394
+ }, parse = function(p) {
14395
+ let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base2 = basename(p), extension = extname(base2);
14396
+ return {
14397
+ root,
14398
+ dir: dirname3(p),
14399
+ base: base2,
14400
+ ext: extension,
14401
+ name: base2.slice(0, base2.length - extension.length)
14402
+ };
14403
+ }, matchesGlob = (path2, pattern) => zeptomatch(pattern, normalize(path2)), _path = {
14404
+ __proto__: null,
14405
+ basename,
14406
+ dirname: dirname3,
14407
+ extname,
14408
+ format,
14409
+ isAbsolute: isAbsolute2,
14410
+ join: join3,
14411
+ matchesGlob,
14412
+ normalize,
14413
+ normalizeString,
14414
+ parse,
14415
+ relative,
14416
+ resolve: resolve2,
14417
+ sep,
14418
+ toNamespacedPath
14419
+ };
14420
+
14421
+ // ../../../node_modules/pathe/dist/index.mjs
14422
+ var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
14423
+ get(_, prop) {
14424
+ return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
14425
+ }
14426
+ }), posix = mix(":"), win32 = mix(";");
14427
+
14131
14428
  // src/extractProps.ts
14132
14429
  import {
14133
14430
  TypeSystem,
@@ -14320,7 +14617,7 @@ function parseExpression(expression) {
14320
14617
  return null;
14321
14618
  }
14322
14619
  }
14323
- function parse4(value) {
14620
+ function parse5(value) {
14324
14621
  let ast = acornParser.parse(`(${value})`, { ecmaVersion: 2020 }), parsingResult = {
14325
14622
  inferredType: { type: "Unknown" /* UNKNOWN */ },
14326
14623
  ast
@@ -14338,7 +14635,7 @@ function parse4(value) {
14338
14635
  // src/docs/lib/inspection/inspectValue.ts
14339
14636
  function inspectValue(value) {
14340
14637
  try {
14341
- return { ...parse4(value) };
14638
+ return { ...parse5(value) };
14342
14639
  } catch {
14343
14640
  }
14344
14641
  return { inferredType: { type: "Unknown" /* UNKNOWN */ } };
@@ -14488,13 +14785,13 @@ function _arrayLikeToArray(r, a) {
14488
14785
  function _arrayWithoutHoles(r) {
14489
14786
  if (Array.isArray(r)) return _arrayLikeToArray(r);
14490
14787
  }
14491
- function _defineProperty(e, r, t4) {
14788
+ function _defineProperty(e, r, t) {
14492
14789
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
14493
- value: t4,
14790
+ value: t,
14494
14791
  enumerable: !0,
14495
14792
  configurable: !0,
14496
14793
  writable: !0
14497
- }) : e[r] = t4, e;
14794
+ }) : e[r] = t, e;
14498
14795
  }
14499
14796
  function _iterableToArray(r) {
14500
14797
  if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
@@ -14504,22 +14801,22 @@ function _nonIterableSpread() {
14504
14801
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
14505
14802
  }
14506
14803
  function ownKeys(e, r) {
14507
- var t4 = Object.keys(e);
14804
+ var t = Object.keys(e);
14508
14805
  if (Object.getOwnPropertySymbols) {
14509
14806
  var o = Object.getOwnPropertySymbols(e);
14510
14807
  r && (o = o.filter(function(r2) {
14511
14808
  return Object.getOwnPropertyDescriptor(e, r2).enumerable;
14512
- })), t4.push.apply(t4, o);
14809
+ })), t.push.apply(t, o);
14513
14810
  }
14514
- return t4;
14811
+ return t;
14515
14812
  }
14516
14813
  function _objectSpread2(e) {
14517
14814
  for (var r = 1; r < arguments.length; r++) {
14518
- var t4 = arguments[r] != null ? arguments[r] : {};
14519
- r % 2 ? ownKeys(Object(t4), !0).forEach(function(r2) {
14520
- _defineProperty(e, r2, t4[r2]);
14521
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t4)) : ownKeys(Object(t4)).forEach(function(r2) {
14522
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t4, r2));
14815
+ var t = arguments[r] != null ? arguments[r] : {};
14816
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r2) {
14817
+ _defineProperty(e, r2, t[r2]);
14818
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
14819
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
14523
14820
  });
14524
14821
  }
14525
14822
  return e;
@@ -14527,18 +14824,18 @@ function _objectSpread2(e) {
14527
14824
  function _toConsumableArray(r) {
14528
14825
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
14529
14826
  }
14530
- function _toPrimitive(t4, r) {
14531
- if (typeof t4 != "object" || !t4) return t4;
14532
- var e = t4[Symbol.toPrimitive];
14827
+ function _toPrimitive(t, r) {
14828
+ if (typeof t != "object" || !t) return t;
14829
+ var e = t[Symbol.toPrimitive];
14533
14830
  if (e !== void 0) {
14534
- var i2 = e.call(t4, r || "default");
14831
+ var i2 = e.call(t, r || "default");
14535
14832
  if (typeof i2 != "object") return i2;
14536
14833
  throw new TypeError("@@toPrimitive must return a primitive value.");
14537
14834
  }
14538
- return (r === "string" ? String : Number)(t4);
14835
+ return (r === "string" ? String : Number)(t);
14539
14836
  }
14540
- function _toPropertyKey(t4) {
14541
- var i2 = _toPrimitive(t4, "string");
14837
+ function _toPropertyKey(t) {
14838
+ var i2 = _toPrimitive(t, "string");
14542
14839
  return typeof i2 == "symbol" ? i2 : i2 + "";
14543
14840
  }
14544
14841
  function _typeof(o) {
@@ -14552,8 +14849,8 @@ function _typeof(o) {
14552
14849
  function _unsupportedIterableToArray(r, a) {
14553
14850
  if (r) {
14554
14851
  if (typeof r == "string") return _arrayLikeToArray(r, a);
14555
- var t4 = {}.toString.call(r).slice(8, -1);
14556
- return t4 === "Object" && r.constructor && (t4 = r.constructor.name), t4 === "Map" || t4 === "Set" ? Array.from(r) : t4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t4) ? _arrayLikeToArray(r, a) : void 0;
14852
+ var t = {}.toString.call(r).slice(8, -1);
14853
+ return t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set" ? Array.from(r) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
14557
14854
  }
14558
14855
  }
14559
14856
  function safeSortObject(value, seen) {
@@ -15318,20 +15615,19 @@ var extractArgTypes = (component) => {
15318
15615
  // src/componentManifest/reactDocgen.ts
15319
15616
  var import_ts_dedent2 = __toESM(require_dist(), 1), TsconfigPaths = __toESM(require_lib2(), 1);
15320
15617
  import { existsSync as existsSync2 } from "node:fs";
15321
- import { dirname as dirname3, sep } from "node:path";
15322
- import { babelParse, types as t } from "storybook/internal/babel";
15618
+ import { dirname as dirname4, sep as sep2 } from "node:path";
15323
15619
  import {
15324
15620
  findTsconfigPathForPath,
15325
15621
  getTsconfigPathsBaseDir,
15326
15622
  supportedExtensions as supportedExtensions2
15327
15623
  } from "storybook/internal/common";
15328
- import { extractJSDocInfo } from "storybook/internal/csf-tools";
15624
+ import { extractJSDocInfo, parseModule } from "storybook/internal/csf-tools";
15329
15625
  import { logger as logger3 } from "storybook/internal/node-logger";
15330
15626
  import {
15331
15627
  builtinHandlers as docgenHandlers,
15332
15628
  builtinResolvers as docgenResolver,
15333
15629
  makeFsImporter,
15334
- parse as parse5
15630
+ parse as parse6
15335
15631
  } from "react-docgen";
15336
15632
 
15337
15633
  // src/componentManifest/reactDocgen/actualNameHandler.ts
@@ -15469,6 +15765,8 @@ var exportNameHandler = (documentation, componentDefinition) => {
15469
15765
  }
15470
15766
  if (stmt.isExportDefaultDeclaration()) {
15471
15767
  let decl = stmt.get("declaration");
15768
+ for (; decl.isTSAsExpression() || decl.isParenthesizedExpression(); )
15769
+ decl = decl.get("expression");
15472
15770
  if (decl.isIdentifier() && decl.node.name === localName) {
15473
15771
  documentation.set("exportName", "default");
15474
15772
  return;
@@ -15481,7 +15779,21 @@ var exportNameHandler = (documentation, componentDefinition) => {
15481
15779
  // src/componentManifest/reactDocgen.ts
15482
15780
  var defaultHandlers = Object.values(docgenHandlers).map((handler) => handler), defaultResolver2 = new docgenResolver.FindExportedDefinitionsResolver(), handlers = [...defaultHandlers, actualNameHandler_default, exportNameHandler_default];
15483
15781
  function getMatchingDocgen(docgens, component) {
15484
- return docgens.length === 0 ? void 0 : docgens.length === 1 ? docgens[0] : docgens.find(
15782
+ if (docgens.length === 0)
15783
+ return;
15784
+ if (docgens.length === 1)
15785
+ return docgens[0];
15786
+ if (component.importName === "default") {
15787
+ let defaultExports = docgens.filter((docgen) => docgen.exportName === "default");
15788
+ if (defaultExports.length === 1)
15789
+ return defaultExports[0];
15790
+ let names = new Set([component.localImportName, component.componentName].filter(Boolean)), matchingName = docgens.find(
15791
+ (docgen) => names.has(docgen.actualName) || docgen.displayName && names.has(docgen.displayName)
15792
+ );
15793
+ if (matchingName)
15794
+ return matchingName;
15795
+ }
15796
+ return docgens.find(
15485
15797
  (docgen) => [component.importName, component.localImportName].includes(docgen.exportName)
15486
15798
  ) ?? docgens.find(
15487
15799
  (docgen) => [component.importName, component.localImportName, component.componentName].includes(
@@ -15507,7 +15819,7 @@ var getTsConfig = cached(
15507
15819
  },
15508
15820
  { name: "getTsConfig" }
15509
15821
  ), parseWithReactDocgen = cached(
15510
- (code, path2) => parse5(code, {
15822
+ (code, path2) => parse6(code, {
15511
15823
  resolver: defaultResolver2,
15512
15824
  handlers,
15513
15825
  importer: getReactDocgenImporter(),
@@ -15516,15 +15828,15 @@ var getTsConfig = cached(
15516
15828
  { key: (code, path2) => path2, name: "parseWithReactDocgen" }
15517
15829
  ), getExportPaths = cached(
15518
15830
  (code, filePath) => {
15519
- let ast;
15831
+ let program;
15520
15832
  try {
15521
- ast = babelParse(code);
15833
+ program = parseModule(code, filePath).program;
15522
15834
  } catch {
15523
15835
  return [];
15524
15836
  }
15525
- let basedir = dirname3(filePath);
15526
- return ast.program.body.flatMap(
15527
- (statement) => t.isExportAllDeclaration(statement) ? [statement.source.value] : t.isExportNamedDeclaration(statement) && statement.source && !statement.declaration ? [statement.source.value] : []
15837
+ let basedir = dirname4(filePath);
15838
+ return program.body.flatMap(
15839
+ (statement) => statement.type === "ExportAllDeclaration" ? [statement.source.value] : statement.type === "ExportNamedDeclaration" && statement.source && !statement.declaration ? [statement.source.value] : []
15528
15840
  ).map((id) => matchPath(id, filePath)).flatMap((id) => {
15529
15841
  try {
15530
15842
  return [cachedResolveImport(id, { basedir })];
@@ -15650,10 +15962,10 @@ Prefer relative imports if possible.`
15650
15962
  function getReactDocgenImporter() {
15651
15963
  return makeFsImporter((filename, basedir) => {
15652
15964
  let mappedFilenameByPaths = matchPath(filename, basedir), result = cachedResolveImport(mappedFilenameByPaths, { basedir });
15653
- if (result.includes(`${sep}react-native${sep}index.js`)) {
15965
+ if (result.includes(`${sep2}react-native${sep2}index.js`)) {
15654
15966
  let replaced = result.replace(
15655
- `${sep}react-native${sep}index.js`,
15656
- `${sep}react-native-web${sep}dist${sep}index.js`
15967
+ `${sep2}react-native${sep2}index.js`,
15968
+ `${sep2}react-native-web${sep2}dist${sep2}index.js`
15657
15969
  );
15658
15970
  if (existsSync2(replaced) && supportedExtensions2.find((ext) => result.endsWith(ext)))
15659
15971
  return replaced;
@@ -15668,494 +15980,164 @@ function getImportTag(docgen) {
15668
15980
  return (jsdocComment ? extractJSDocInfo(jsdocComment).tags : void 0)?.import?.[0];
15669
15981
  }
15670
15982
 
15671
- // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
15672
- var _lazyMatch = () => {
15673
- var __lib__ = (() => {
15674
- var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
15675
- for (var n in e) m(r, n, { get: e[n], enumerable: !0 });
15676
- }, H = (r, e, n, a) => {
15677
- if (e && typeof e == "object" || typeof e == "function") for (let t4 of G(e)) !T.call(r, t4) && t4 !== n && m(r, t4, { get: () => e[t4], enumerable: !(a = V(e, t4)) || a.enumerable });
15678
- return r;
15679
- }, J = (r) => H(m({}, "__esModule", { value: !0 }), r), w = {};
15680
- q(w, { default: () => re });
15681
- var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
15682
- let e = /* @__PURE__ */ new Map();
15683
- return (n) => {
15684
- let a = e.get(n);
15685
- if (a) return a;
15686
- let t4 = r(n);
15687
- return e.set(n, t4), t4;
15688
- };
15689
- }, rr = (r, e, n = {}) => {
15690
- let a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
15691
- if (v(e)(a) && a.index === r.length) return a.output;
15692
- throw new Error(`Failed to parse at index ${a.indexMax}`);
15693
- }, i2 = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
15694
- let n = {};
15695
- for (let a of r) {
15696
- if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
15697
- let t4 = a.charCodeAt(0);
15698
- n[t4] = !0;
15699
- }
15700
- return (a) => {
15701
- let t4 = a.index, o = a.input;
15702
- for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
15703
- let u = a.index;
15704
- if (u > t4) {
15705
- if (!h(e) && !a.options.silent) {
15706
- let s = a.input.slice(t4, u), c = d(e) ? e(s, o, String(t4)) : e;
15707
- h(c) || a.output.push(c);
15708
- }
15709
- a.indexMax = Math.max(a.indexMax, a.index);
15710
- }
15711
- return !0;
15712
- };
15713
- }, nr = (r, e) => {
15714
- let n = r.source, a = r.flags.replace(/y|$/, "y"), t4 = new RegExp(n, a);
15715
- return g((o) => {
15716
- t4.lastIndex = o.index;
15717
- let u = t4.exec(o.input);
15718
- if (u) {
15719
- if (!h(e) && !o.options.silent) {
15720
- let s = d(e) ? e(...u, o.input, String(o.index)) : e;
15721
- h(s) || o.output.push(s);
15722
- }
15723
- return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), !0;
15724
- } else return !1;
15725
- });
15726
- }, ar = (r, e) => (n) => {
15727
- if (n.input.startsWith(r, n.index)) {
15728
- if (!h(e) && !n.options.silent) {
15729
- let t4 = d(e) ? e(r, n.input, String(n.index)) : e;
15730
- h(t4) || n.output.push(t4);
15731
- }
15732
- return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), !0;
15733
- } else return !1;
15734
- }, C = (r, e, n, a) => {
15735
- let t4 = v(r);
15736
- return g(_(M((o) => {
15737
- let u = 0;
15738
- for (; u < n; ) {
15739
- let s = o.index;
15740
- if (!t4(o) || (u += 1, o.index === s)) break;
15741
- }
15742
- return u >= e;
15743
- })));
15744
- }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
15745
- let n = r.map(v);
15746
- return g(_(M((a) => {
15747
- for (let t4 = 0, o = n.length; t4 < o; t4++) if (!n[t4](a)) return !1;
15748
- return !0;
15749
- })));
15750
- }, l = (r, e) => {
15751
- let n = r.map(v);
15752
- return g(_((a) => {
15753
- for (let t4 = 0, o = n.length; t4 < o; t4++) if (n[t4](a)) return !0;
15754
- return !1;
15755
- }));
15756
- }, M = (r, e = !1) => {
15757
- let n = v(r);
15758
- return (a) => {
15759
- let t4 = a.index, o = a.output.length, u = n(a);
15760
- return (!u || e) && (a.index = t4, a.output.length !== o && (a.output.length = o)), u;
15761
- };
15762
- }, _ = (r, e) => v(r), g = /* @__PURE__ */ (() => {
15763
- let r = 0;
15764
- return (e) => {
15765
- let n = v(e), a = r += 1;
15766
- return (t4) => {
15767
- var o;
15768
- if (t4.options.memoization === !1) return n(t4);
15769
- let u = t4.index, s = (o = t4.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
15770
- if (c === !1) return !1;
15771
- if (W(c)) return t4.index = c, !0;
15772
- if (c) return t4.index = c.index, c.output?.length && t4.output.push(...c.output), !0;
15773
- {
15774
- let Z = t4.output.length;
15775
- if (n(t4)) {
15776
- let D = t4.index, U = t4.output.length;
15777
- if (U > Z) {
15778
- let ee = t4.output.slice(Z, U);
15779
- s.set(u, { index: D, output: ee });
15780
- } else s.set(u, D);
15781
- return !0;
15782
- } else return s.set(u, !1), !1;
15783
- }
15784
- };
15785
- };
15786
- })(), E = (r) => {
15787
- let e;
15788
- return (n) => (e || (e = v(r())), e(n));
15789
- }, v = Y((r) => {
15790
- if (d(r)) return Q(r) ? E(r) : r;
15791
- if (b(r) || X(r)) return i2(r);
15792
- if (A(r)) return x(r);
15793
- if (K(r)) return l(Object.values(r));
15794
- throw new Error("Invalid rule");
15795
- }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
15796
- let e = "";
15797
- for (; r > 0; ) {
15798
- let n = (r - 1) % 26;
15799
- e = P[n] + e, r = Math.floor((r - 1) / 26);
15800
- }
15801
- return e;
15802
- }, O = (r) => {
15803
- let e = 0;
15804
- for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
15805
- return e;
15806
- }, S = (r, e) => {
15807
- if (e < r) return S(e, r);
15808
- let n = [];
15809
- for (; r <= e; ) n.push(r++);
15810
- return n;
15811
- }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: !1 }).join("")), ur = (r) => {
15812
- let e = {};
15813
- return (n) => e[n] ?? (e[n] = r(n));
15814
- }, sr = i2(/^\*\*\/\*$/, ".*"), cr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i2(/\\./, p), pr = i2(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i2(/./, p), hr = i2(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i2(/^(!!)+/, ""), fr = l([hr, dr]), xr = i2(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i2(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i2(/\/(\*\*)$/, "(?:/.*|$)"), _r = i2(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i2(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i2(/\*/, "[^/]*"), N = l([Sr, yr]), k = i2("?", "[^/]"), $r = i2("[", p), wr = i2("]", p), Ar = i2(/[!^]/, "^/"), br = i2(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i2(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i2(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i2("{", "(?:"), Or = i2("}", ")"), Rr = i2(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i2(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i2(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i2("{", "(?:"), Br = i2("}", ")"), Ir = i2(",", "|"), Fr = i2(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i2(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i2(/\\./, p), qr = i2(/./, p), Hr = i2(/\*\*\*+/, "*"), Jr = i2(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i2(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
15815
- let n = Array.isArray(r) ? r : [r];
15816
- if (!n.length) return !1;
15817
- let a = n.map($.compile), t4 = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t4 ? "/" : "");
15818
- return a.some((s) => s.test(o));
15819
- };
15820
- $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
15821
- var re = $;
15822
- return J(w);
15823
- })();
15824
- return __lib__.default || __lib__;
15825
- }, _match, zeptomatch = (path2, pattern) => (_match || (_match = _lazyMatch(), _lazyMatch = null), _match(path2, pattern)), _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
15826
- function normalizeWindowsPath(input = "") {
15827
- return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
15828
- }
15829
- var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/, sep2 = "/", normalize = function(path2) {
15830
- if (path2.length === 0)
15831
- return ".";
15832
- path2 = normalizeWindowsPath(path2);
15833
- let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path2), trailingSeparator = path2[path2.length - 1] === "/";
15834
- return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2);
15835
- }, join3 = function(...segments) {
15836
- let path2 = "";
15837
- for (let seg of segments)
15838
- if (seg)
15839
- if (path2.length > 0) {
15840
- let pathTrailing = path2[path2.length - 1] === "/", segLeading = seg[0] === "/";
15841
- pathTrailing && segLeading ? path2 += seg.slice(1) : path2 += pathTrailing || segLeading ? seg : `/${seg}`;
15842
- } else
15843
- path2 += seg;
15844
- return normalize(path2);
15845
- };
15846
- function cwd() {
15847
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
15848
- }
15849
- var resolve3 = function(...arguments_) {
15850
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
15851
- let resolvedPath = "", resolvedAbsolute = !1;
15852
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
15853
- let path2 = index >= 0 ? arguments_[index] : cwd();
15854
- !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path2));
15855
- }
15856
- return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
15857
- };
15858
- function normalizeString(path2, allowAboveRoot) {
15859
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
15860
- for (let index = 0; index <= path2.length; ++index) {
15861
- if (index < path2.length)
15862
- char = path2[index];
15863
- else {
15864
- if (char === "/")
15865
- break;
15866
- char = "/";
15867
- }
15868
- if (char === "/") {
15869
- if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
15870
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
15871
- if (res.length > 2) {
15872
- let lastSlashIndex = res.lastIndexOf("/");
15873
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
15874
- continue;
15875
- } else if (res.length > 0) {
15876
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
15877
- continue;
15878
- }
15879
- }
15880
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
15881
- } else
15882
- res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
15883
- lastSlash = index, dots = 0;
15884
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
15885
- }
15886
- return res;
15887
- }
15888
- var isAbsolute2 = function(p) {
15889
- return _IS_ABSOLUTE_RE.test(p);
15890
- }, toNamespacedPath = function(p) {
15891
- return normalizeWindowsPath(p);
15892
- }, extname = function(p) {
15893
- if (p === "..") return "";
15894
- let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
15895
- return match && match[1] || "";
15896
- }, relative = function(from, to) {
15897
- let _from = resolve3(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve3(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
15898
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
15899
- return _to.join("/");
15900
- let _fromCopy = [..._from];
15901
- for (let segment of _fromCopy) {
15902
- if (_to[0] !== segment)
15903
- break;
15904
- _from.shift(), _to.shift();
15905
- }
15906
- return [..._from.map(() => ".."), ..._to].join("/");
15907
- }, dirname4 = function(p) {
15908
- let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
15909
- return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
15910
- }, format = function(p) {
15911
- let ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "", segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
15912
- Boolean
15913
- );
15914
- return normalizeWindowsPath(
15915
- p.root ? resolve3(...segments) : segments.join("/")
15916
- );
15917
- }, basename = function(p, extension) {
15918
- let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
15919
- for (let i2 = segments.length - 1; i2 >= 0; i2--) {
15920
- let val = segments[i2];
15921
- if (val) {
15922
- lastSegment = val;
15923
- break;
15924
- }
15925
- }
15926
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
15927
- }, parse6 = function(p) {
15928
- let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base2 = basename(p), extension = extname(base2);
15929
- return {
15930
- root,
15931
- dir: dirname4(p),
15932
- base: base2,
15933
- ext: extension,
15934
- name: base2.slice(0, base2.length - extension.length)
15935
- };
15936
- }, matchesGlob = (path2, pattern) => zeptomatch(pattern, normalize(path2)), _path = {
15937
- __proto__: null,
15938
- basename,
15939
- dirname: dirname4,
15940
- extname,
15941
- format,
15942
- isAbsolute: isAbsolute2,
15943
- join: join3,
15944
- matchesGlob,
15945
- normalize,
15946
- normalizeString,
15947
- parse: parse6,
15948
- relative,
15949
- resolve: resolve3,
15950
- sep: sep2,
15951
- toNamespacedPath
15952
- };
15953
-
15954
- // ../../../node_modules/pathe/dist/index.mjs
15955
- var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms = { posix: void 0, win32: void 0 }, mix = (del = delimiter) => new Proxy(_path, {
15956
- get(_, prop) {
15957
- return prop === "delimiter" ? del : prop === "posix" ? posix : prop === "win32" ? win32 : _platforms[prop] || _path[prop];
15958
- }
15959
- }), posix = mix(":"), win32 = mix(";");
15960
-
15961
15983
  // src/componentManifest/generateCodeSnippet.ts
15962
- import { types as t2 } from "storybook/internal/babel";
15963
15984
  import {
15985
+ textOf,
15986
+ collectImportBindings,
15964
15987
  createStoryArgsResolver,
15965
- metaObjectPath,
15988
+ isCanonicalCsf2BindCall,
15989
+ isStringLiteral,
15990
+ lineIndent,
15991
+ metaObject,
15966
15992
  normalizeStoryDeclaration,
15967
- resolveRenderFunction
15993
+ parseModule as parseModule2,
15994
+ placeableTextOf,
15995
+ reindent,
15996
+ resolveRenderFunction,
15997
+ storyShapeError,
15998
+ walk
15968
15999
  } from "storybook/internal/csf-tools";
15969
16000
  function renderFunctionOf(resolution) {
15970
- return resolution.kind === "resolved" ? resolution.path : resolution.kind === "unresolved" ? resolution.shadowedRender : void 0;
16001
+ return resolution.kind === "resolved" ? resolution.node : resolution.kind === "unresolved" ? resolution.shadowedRender : void 0;
15971
16002
  }
15972
16003
  function getCodeSnippet(csf, storyName, componentName, resolver = createStoryArgsResolver(csf)) {
15973
- let { args, imports, unresolved } = resolver.resolve(storyName);
15974
- return {
15975
- node: buildSnippetNode(csf, storyName, componentName, args, resolver.ctx),
16004
+ let { args, imports, unresolved } = resolver.resolve(storyName), importedBind = importedBoundStory(csf, storyName, args);
16005
+ return importedBind ? {
16006
+ code: importedBind.code,
16007
+ imports: [...imports, importedBind.importRef],
16008
+ unresolved
16009
+ } : {
16010
+ code: buildSnippet(csf, storyName, componentName, args, resolver),
15976
16011
  imports,
15977
16012
  unresolved
15978
16013
  };
15979
16014
  }
15980
- function buildSnippetNode(csf, storyName, componentName, merged, ctx) {
15981
- let storyDeclaration = csf._storyDeclarationPath[storyName];
16015
+ function importedBoundStory(csf, storyName, args) {
16016
+ let declaration = csf._storyExports[storyName];
16017
+ if (declaration?.type !== "VariableDeclarator" || !isCanonicalCsf2BindCall(declaration.init))
16018
+ return;
16019
+ let local = declaration.init.callee.object.name, binding = collectImportBindings(csf.program).get(local);
16020
+ if (!binding)
16021
+ return;
16022
+ let values = Object.entries(args).map(
16023
+ ([key, value]) => ` ${JSON.stringify(key)}: ${placeableTextOf(value)}`
16024
+ ), argsObject = values.length ? `{
16025
+ ${values.join(`,
16026
+ `)}
16027
+ }` : "{}";
16028
+ return {
16029
+ code: `const ${storyName} = () => ${textOf(declaration.init)}(${argsObject});`,
16030
+ importRef: {
16031
+ localImportName: local,
16032
+ importId: binding.importId,
16033
+ importName: binding.importName,
16034
+ ...binding.importName === "*" ? { namespace: local } : {}
16035
+ }
16036
+ };
16037
+ }
16038
+ function buildSnippet(csf, storyName, componentName, merged, resolver) {
16039
+ let editor = csf.editor, storyDeclaration = csf._storyExports[storyName];
15982
16040
  if (!storyDeclaration) {
15983
- let message = "Expected story to be a function or variable declaration";
15984
- throw csf._storyPaths[storyName]?.buildCodeFrameError(message) ?? message;
15985
- }
15986
- let normalizedStory = normalizeStoryDeclaration(storyDeclaration), storyFn;
15987
- normalizedStory.type === "fn" && (storyFn = normalizedStory.path);
15988
- let storyConfigPath = normalizedStory.type === "config" ? normalizedStory.path : void 0, metaRender = resolveRenderFunction(metaObjectPath(csf), storyDeclaration, ctx), storyRender = resolveRenderFunction(storyConfigPath, storyDeclaration, ctx);
15989
- storyFn || (storyFn = renderFunctionOf(storyRender) ?? (storyRender.kind === "missing" ? renderFunctionOf(metaRender) : void 0));
15990
- let entries = Object.entries(merged).filter(([k]) => k !== "children"), validEntries = entries.filter(([k, v]) => isValidJsxAttrName(k) && v != null), invalidEntries = entries.filter(([k, v]) => !isValidJsxAttrName(k) && v != null), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => a != null);
15991
- if (storyFn) {
15992
- let fn = storyFn.node;
15993
- if (t2.isArrowFunctionExpression(fn) && (t2.isJSXElement(fn.body) || t2.isJSXFragment(fn.body))) {
15994
- let spreadRes = transformArgsSpreadsInJsx(fn.body, merged), inlineRes = inlineArgsInJsx(spreadRes.node, merged);
15995
- if (spreadRes.changed || inlineRes.changed) {
15996
- let newFn = t2.arrowFunctionExpression(
15997
- remainingParams(fn, inlineRes.node),
15998
- inlineRes.node,
15999
- fn.async
16000
- );
16001
- return t2.variableDeclaration("const", [
16002
- t2.variableDeclarator(t2.identifier(storyName), newFn)
16003
- ]);
16004
- }
16005
- }
16006
- let stmts = t2.isFunctionDeclaration(fn) || t2.isObjectMethod(fn) || t2.isArrowFunctionExpression(fn) && t2.isBlockStatement(fn.body) || t2.isFunctionExpression(fn) && t2.isBlockStatement(fn.body) ? fn.body.body : void 0;
16007
- if (stmts) {
16008
- let changed = !1, newBody = stmts.map((stmt) => {
16009
- if (t2.isReturnStatement(stmt) && stmt.argument && (t2.isJSXElement(stmt.argument) || t2.isJSXFragment(stmt.argument))) {
16010
- let spreadRes = transformArgsSpreadsInJsx(stmt.argument, merged), inlineRes = inlineArgsInJsx(spreadRes.node, merged);
16011
- if (spreadRes.changed || inlineRes.changed)
16012
- return changed = !0, t2.returnStatement(inlineRes.node);
16013
- }
16014
- return stmt;
16015
- });
16016
- if (changed) {
16017
- let body = t2.blockStatement(newBody), params = remainingParams(fn, body);
16018
- return t2.isFunctionDeclaration(fn) ? t2.functionDeclaration(t2.identifier(storyName), params, body, fn.generator, fn.async) : t2.variableDeclaration("const", [
16019
- t2.variableDeclarator(
16020
- t2.identifier(storyName),
16021
- t2.arrowFunctionExpression(params, body, fn.async)
16022
- )
16023
- ]);
16024
- }
16025
- }
16026
- return t2.isFunctionDeclaration(fn) ? t2.functionDeclaration(t2.identifier(storyName), fn.params, fn.body, fn.generator, fn.async) : t2.variableDeclaration("const", [
16027
- t2.variableDeclarator(
16028
- t2.identifier(storyName),
16029
- t2.isObjectMethod(fn) ? t2.arrowFunctionExpression(fn.params, fn.body, fn.async) : fn
16041
+ let message = "Expected story to be a function or variable declaration", statement = csf.program.body.find(
16042
+ (node) => node.type === "ExportNamedDeclaration" && node.specifiers.some(
16043
+ (specifier) => (specifier.exported.type === "Identifier" ? specifier.exported.name : specifier.exported.value) === storyName
16030
16044
  )
16031
- ]);
16045
+ );
16046
+ throw statement ? storyShapeError(message, statement, editor) : message;
16032
16047
  }
16048
+ let normalizedStory = normalizeStoryDeclaration(storyDeclaration, editor), storyFn = normalizedStory.type === "fn" ? normalizedStory.node : void 0, storyConfig = normalizedStory.type === "config" ? normalizedStory.node : void 0, metaRender = resolveRenderFunction(metaObject(csf), editor, resolver.ctx), storyRender = resolveRenderFunction(storyConfig, editor, resolver.ctx);
16049
+ if (storyFn || (storyFn = renderFunctionOf(storyRender) ?? (storyRender.kind === "missing" ? renderFunctionOf(metaRender) : void 0)), storyFn)
16050
+ return functionSnippet(
16051
+ editor.code,
16052
+ storyName,
16053
+ storyFn,
16054
+ isMethod(editor.parentOf(storyFn)),
16055
+ merged
16056
+ );
16033
16057
  invariant(componentName, "Could not generate snippet without component name.");
16034
- let invalidSpread = buildInvalidSpread(invalidEntries), name = t2.jsxIdentifier(componentName), openingElAttrs = invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs, children = toJsxChildren(merged.children), selfClosing = children.length === 0, arrow = t2.arrowFunctionExpression(
16035
- [],
16036
- t2.jsxElement(
16037
- t2.jsxOpeningElement(name, openingElAttrs, selfClosing),
16038
- selfClosing ? null : t2.jsxClosingElement(name),
16039
- children,
16040
- selfClosing
16041
- )
16042
- );
16043
- return t2.variableDeclaration("const", [t2.variableDeclarator(t2.identifier(storyName), arrow)]);
16058
+ let attrs = injectedAttributes(merged, /* @__PURE__ */ new Set()), children = toJsxChildren(merged.children), opening = [componentName, ...attrs].join(" "), element = children ? `<${opening}>${children}</${componentName}>` : `<${opening} />`;
16059
+ return `const ${storyName} = () => ${element};`;
16044
16060
  }
16045
- function remainingParams(fn, body) {
16046
- return readsArgs(body) ? fn.params : [];
16061
+ var isMethod = (parent) => parent?.type === "Property" && (parent.method || parent.kind !== "init");
16062
+ function functionSnippet(code, storyName, fn, method, merged) {
16063
+ let asyncPrefix = fn.async ? "async " : "", params = fn.params.length ? code.slice(fn.params[0].start, fn.params[fn.params.length - 1].end) : "", edits = [];
16064
+ if (fn.type === "ArrowFunctionExpression" && isJsx(fn.body)) {
16065
+ if (rewriteJsx(code, fn.body, merged, edits)) {
16066
+ let body = printRange(code, fn.body, edits), kept = readsArgs(`${asyncPrefix}() => (${body});`) ? params : "";
16067
+ return `const ${storyName} = ${asyncPrefix}(${kept}) => ${body};`;
16068
+ }
16069
+ } else if (fn.body?.type === "BlockStatement") {
16070
+ let changed = !1;
16071
+ for (let statement of fn.body.body)
16072
+ statement.type === "ReturnStatement" && isJsx(statement.argument) && (changed = rewriteJsx(code, statement.argument, merged, edits) || changed);
16073
+ if (changed) {
16074
+ let body = printRange(code, fn.body, edits), head = `${asyncPrefix}function${fn.generator ? "*" : ""}`, kept = readsArgs(`${head} f() ${body}`) ? params : "";
16075
+ return fn.type === "FunctionDeclaration" ? `${asyncPrefix}function${fn.generator ? "*" : ""} ${storyName}(${kept}) ${body}` : `const ${storyName} = ${asyncPrefix}(${kept}) => ${body};`;
16076
+ }
16077
+ }
16078
+ return fn.type === "FunctionDeclaration" && fn.body ? `${asyncPrefix}function${fn.generator ? "*" : ""} ${storyName}(${params}) ${printRange(code, fn.body, [])}` : method && fn.body ? `const ${storyName} = ${asyncPrefix}(${params}) => ${printRange(code, fn.body, [])};` : `const ${storyName} = ${printRange(code, fn, [])};`;
16079
+ }
16080
+ var isJsx = (node) => node?.type === "JSXElement" || node?.type === "JSXFragment";
16081
+ function printRange(code, range, edits) {
16082
+ let text = "", cursor = range.start;
16083
+ for (let edit of [...edits].sort((a, b) => a.start - b.start || a.end - b.end))
16084
+ text += code.slice(cursor, edit.start) + edit.text, cursor = edit.end;
16085
+ return text += code.slice(cursor, range.end), reindent(text, lineIndent(code, range.start), "");
16047
16086
  }
16048
- function readsArgs(node) {
16087
+ function readsArgs(source) {
16049
16088
  let named = /* @__PURE__ */ new Set(), reads = !1;
16050
- return t2.traverseFast(node, (current2) => {
16051
- t2.isMemberExpression(current2) && !current2.computed && named.add(current2.property), (t2.isObjectProperty(current2) || t2.isObjectMethod(current2)) && !current2.computed && named.add(current2.key), t2.isIdentifier(current2) && current2.name === "args" && !named.has(current2) && (reads = !0);
16089
+ return walk(parseModule2(source).program, (current2) => {
16090
+ current2.type === "MemberExpression" && !current2.computed && named.add(current2.property), current2.type === "Property" && !current2.computed && !current2.shorthand && named.add(current2.key), current2.type === "Identifier" && current2.name === "args" && !named.has(current2) && (reads = !0);
16052
16091
  }), reads;
16053
16092
  }
16054
- function buildInvalidSpread(entries) {
16055
- if (entries.length === 0)
16056
- return null;
16057
- let objectProps = entries.map(
16058
- ([k, v]) => t2.objectProperty(t2.stringLiteral(k), t2.isExpression(v) ? v : t2.identifier("undefined"))
16059
- );
16060
- return t2.jsxSpreadAttribute(t2.objectExpression(objectProps));
16093
+ var isValidJsxAttrName = (n) => /^[A-Za-z_][A-Za-z0-9_:-]*$/.test(n), toAttr = (key, value) => value.type === "Literal" && typeof value.value == "boolean" ? value.value ? key : `${key}={false}` : isStringLiteral(value) && !/["&\r\n]/.test(value.value) ? `${key}="${value.value}"` : `${key}={${placeableTextOf(value)}}`;
16094
+ function injectedAttributes(merged, existing) {
16095
+ let entries = Object.entries(merged).filter(
16096
+ ([k, v]) => v != null && k !== "children" && !existing.has(k)
16097
+ ), attrs = entries.filter(([k]) => isValidJsxAttrName(k)).map(([k, v]) => toAttr(k, v)), invalid = entries.filter(([k]) => !isValidJsxAttrName(k));
16098
+ if (invalid.length > 0) {
16099
+ let members = invalid.map(([k, v]) => `${JSON.stringify(k)}: ${placeableTextOf(v)}`);
16100
+ attrs.push(`{...{ ${members.join(", ")} }}`);
16101
+ }
16102
+ return attrs;
16061
16103
  }
16062
- var isValidJsxAttrName = (n) => /^[A-Za-z_][A-Za-z0-9_:-]*$/.test(n), toAttr = (key, value) => t2.isBooleanLiteral(value) ? value.value ? t2.jsxAttribute(t2.jsxIdentifier(key), null) : t2.jsxAttribute(t2.jsxIdentifier(key), t2.jsxExpressionContainer(value)) : t2.isStringLiteral(value) ? t2.jsxAttribute(t2.jsxIdentifier(key), t2.stringLiteral(value.value)) : t2.isExpression(value) ? t2.jsxAttribute(t2.jsxIdentifier(key), t2.jsxExpressionContainer(value)) : null, toJsxChildren = (node) => node ? t2.isStringLiteral(node) ? [t2.jsxText(node.value)] : t2.isJSXElement(node) || t2.isJSXFragment(node) ? [node] : t2.isExpression(node) ? [t2.jsxExpressionContainer(node)] : [] : [];
16104
+ var toJsxChildren = (node) => node ? isStringLiteral(node) && !/[{}<>&\r\n]/.test(node.value) ? node.value : isJsx(node) ? textOf(node) : `{${placeableTextOf(node)}}` : "";
16063
16105
  function getArgsMemberKey(expr) {
16064
- if (t2.isMemberExpression(expr) && t2.isIdentifier(expr.object) && expr.object.name === "args") {
16065
- if (t2.isIdentifier(expr.property) && !expr.computed)
16066
- return expr.property.name;
16067
- if (t2.isStringLiteral(expr.property) && expr.computed)
16068
- return expr.property.value;
16069
- }
16070
- if (t2.isOptionalMemberExpression?.(expr) && t2.isIdentifier(expr.object) && expr.object.name === "args") {
16071
- let prop = expr.property;
16072
- if (t2.isIdentifier(prop) && !expr.computed)
16073
- return prop.name;
16074
- if (t2.isStringLiteral(prop) && expr.computed)
16075
- return prop.value;
16076
- }
16077
- return null;
16106
+ let member = expr.type === "ChainExpression" ? expr.expression : expr;
16107
+ return member.type !== "MemberExpression" || member.object.type !== "Identifier" || member.object.name !== "args" ? null : member.property.type === "Identifier" && !member.computed ? member.property.name : isStringLiteral(member.property) && member.computed ? member.property.value : null;
16078
16108
  }
16079
- function inlineArgsInJsx(node, merged) {
16109
+ function rewriteJsx(code, node, merged, edits) {
16080
16110
  let changed = !1;
16081
- if (t2.isJSXElement(node)) {
16082
- let opening = node.openingElement, newAttrs = opening.attributes.flatMap((a) => {
16083
- if (!t2.isJSXAttribute(a))
16084
- return [a];
16085
- let name = t2.isJSXIdentifier(a.name) ? a.name.name : null;
16086
- if (!(name && a.value && t2.isJSXExpressionContainer(a.value)))
16087
- return [a];
16088
- let key = getArgsMemberKey(a.value.expression);
16089
- if (!(key && key in merged))
16090
- return [a];
16091
- let repl = toAttr(name, merged[key]);
16092
- return changed = !0, repl ? [repl] : [];
16093
- }), newChildren = node.children.flatMap((c) => {
16094
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16095
- let res = inlineArgsInJsx(c, merged);
16096
- return changed ||= res.changed, [res.node];
16097
- }
16098
- return t2.isJSXExpressionContainer(c) && getArgsMemberKey(c.expression) === "children" && merged.children ? (changed = !0, toJsxChildren(merged.children)) : [c];
16099
- }), selfClosing = opening.selfClosing && newChildren.length === 0;
16100
- return {
16101
- node: t2.jsxElement(
16102
- t2.jsxOpeningElement(opening.name, newAttrs, selfClosing),
16103
- selfClosing ? null : node.closingElement ?? t2.jsxClosingElement(opening.name),
16104
- newChildren,
16105
- selfClosing
16106
- ),
16107
- changed
16108
- };
16109
- }
16110
- let fragChildren = node.children.flatMap((c) => {
16111
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16112
- let res = inlineArgsInJsx(c, merged);
16113
- return changed ||= res.changed, [res.node];
16114
- }
16115
- return t2.isJSXExpressionContainer(c) && getArgsMemberKey(c.expression) === "children" && "children" in merged ? (changed = !0, toJsxChildren(merged.children)) : [c];
16116
- });
16117
- return { node: t2.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
16118
- }
16119
- function transformArgsSpreadsInJsx(node, merged) {
16120
- let changed = !1, makeInjectedPieces = (existing) => {
16121
- let entries = Object.entries(merged).filter(([k, v]) => v != null && k !== "children"), validEntries = entries.filter(([k]) => isValidJsxAttrName(k)), invalidEntries = entries.filter(([k]) => !isValidJsxAttrName(k)), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => !!a).filter((a) => t2.isJSXIdentifier(a.name) && !existing.has(a.name.name)), invalidSpread = buildInvalidSpread(invalidEntries.filter(([k]) => !existing.has(k)));
16122
- return invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs;
16123
- };
16124
- if (t2.isJSXElement(node)) {
16125
- let opening = node.openingElement, attrs = opening.attributes, isArgsSpread = (a) => t2.isJSXSpreadAttribute(a) && t2.isIdentifier(a.argument) && a.argument.name === "args", sawArgsSpread = attrs.some(isArgsSpread), firstIdx = attrs.findIndex(isArgsSpread), nonArgsAttrs = attrs.filter((a) => !isArgsSpread(a)), insertionIndex = sawArgsSpread ? attrs.slice(0, firstIdx).filter((a) => !isArgsSpread(a)).length : 0, newAttrs = sawArgsSpread ? (() => {
16111
+ if (node.type === "JSXElement") {
16112
+ let opening = node.openingElement, attrs = opening.attributes, isArgsSpread = (a) => a.type === "JSXSpreadAttribute" && a.argument.type === "Identifier" && a.argument.name === "args", firstSpread = attrs.findIndex(isArgsSpread), tagEnd = (opening.typeArguments ?? opening.name).end;
16113
+ if (firstSpread !== -1) {
16114
+ changed = !0;
16126
16115
  let existing = new Set(
16127
- nonArgsAttrs.filter((a) => t2.isJSXAttribute(a)).flatMap((a) => t2.isJSXIdentifier(a.name) ? [a.name.name] : [])
16128
- ), pieces = makeInjectedPieces(existing);
16129
- return changed = !0, [
16130
- ...nonArgsAttrs.slice(0, insertionIndex),
16131
- ...pieces,
16132
- ...nonArgsAttrs.slice(insertionIndex)
16133
- ];
16134
- })() : nonArgsAttrs, newChildren = node.children.flatMap((c) => {
16135
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16136
- let res = transformArgsSpreadsInJsx(c, merged);
16137
- return changed ||= res.changed, [res.node];
16116
+ attrs.flatMap(
16117
+ (a) => a.type === "JSXAttribute" && a.name.type === "JSXIdentifier" ? [a.name.name] : []
16118
+ )
16119
+ ), pieces = injectedAttributes(merged, existing).join(" ");
16120
+ if (attrs.forEach((a, index) => {
16121
+ isArgsSpread(a) && (index === firstSpread && pieces ? edits.push({ start: a.start, end: a.end, text: pieces }) : edits.push({ start: index > 0 ? attrs[index - 1].end : tagEnd, end: a.end, text: "" }));
16122
+ }), node.children.length === 0 && merged.children) {
16123
+ let children = toJsxChildren(merged.children);
16124
+ if (opening.selfClosing) {
16125
+ let name = code.slice(opening.name.start, opening.name.end), lastEnd = attrs.length > 0 ? attrs[attrs.length - 1].end : tagEnd;
16126
+ edits.push({ start: lastEnd, end: opening.end, text: `>${children}</${name}>` });
16127
+ } else
16128
+ edits.push({ start: opening.end, end: opening.end, text: children });
16138
16129
  }
16139
- return [c];
16140
- }), children = sawArgsSpread && newChildren.length === 0 && merged.children ? (changed = !0, toJsxChildren(merged.children)) : newChildren, selfClosing = children.length === 0;
16141
- return {
16142
- node: t2.jsxElement(
16143
- t2.jsxOpeningElement(opening.name, newAttrs, selfClosing),
16144
- selfClosing ? null : node.closingElement ?? t2.jsxClosingElement(opening.name),
16145
- children,
16146
- selfClosing
16147
- ),
16148
- changed
16149
- };
16150
- }
16151
- let fragChildren = node.children.flatMap((c) => {
16152
- if (t2.isJSXElement(c) || t2.isJSXFragment(c)) {
16153
- let res = transformArgsSpreadsInJsx(c, merged);
16154
- return changed ||= res.changed, [res.node];
16155
16130
  }
16156
- return [c];
16157
- });
16158
- return { node: t2.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
16131
+ for (let a of attrs) {
16132
+ if (a.type !== "JSXAttribute" || a.name.type !== "JSXIdentifier" || a.value?.type !== "JSXExpressionContainer")
16133
+ continue;
16134
+ let key = getArgsMemberKey(a.value.expression);
16135
+ key !== null && Object.hasOwn(merged, key) && (edits.push({ start: a.start, end: a.end, text: toAttr(a.name.name, merged[key]) }), changed = !0);
16136
+ }
16137
+ }
16138
+ for (let child of node.children)
16139
+ isJsx(child) ? changed = rewriteJsx(code, child, merged, edits) || changed : child.type === "JSXExpressionContainer" && getArgsMemberKey(child.expression) === "children" && merged.children && (edits.push({ start: child.start, end: child.end, text: toJsxChildren(merged.children) }), changed = !0);
16140
+ return changed;
16159
16141
  }
16160
16142
 
16161
16143
  // src/componentManifest/reactDocgenTypescript.ts
@@ -16364,7 +16346,6 @@ function normalizeFileName(typescript, fileName) {
16364
16346
  }
16365
16347
 
16366
16348
  // src/componentManifest/resolveComponents.ts
16367
- import { recast } from "storybook/internal/babel";
16368
16349
  import { extractDeclaredSubcomponents } from "storybook/internal/common";
16369
16350
  import { storyNameFromExport } from "storybook/internal/csf/csf-utils";
16370
16351
  import {
@@ -16376,11 +16357,11 @@ import {
16376
16357
 
16377
16358
  // src/componentManifest/getComponentImports.ts
16378
16359
  import { dirname as dirname6 } from "node:path";
16379
- import { types as t3 } from "storybook/internal/babel";
16380
16360
  import {
16381
16361
  buildImportStatements,
16382
- collectImportBindings,
16383
- resolveComponentImport
16362
+ collectImportBindings as collectImportBindings2,
16363
+ resolveComponentImport,
16364
+ walk as walk2
16384
16365
  } from "storybook/internal/csf-tools";
16385
16366
  import { logger as logger5 } from "storybook/internal/node-logger";
16386
16367
  var baseIdentifier = (component) => component.split(".")[0] ?? component, getComponents = async ({
@@ -16390,28 +16371,21 @@ var baseIdentifier = (component) => component.split(".")[0] ?? component, getCom
16390
16371
  docgenEngine,
16391
16372
  additionalComponentNames = []
16392
16373
  }) => {
16393
- let { reactDocgenTypescriptOptions } = typescriptOptions, program = csf._file.path, componentSet = /* @__PURE__ */ new Set(), componentDepth = /* @__PURE__ */ new Map(), localToImport = collectImportBindings(program), jsxDepth = 0;
16394
- program.traverse({
16395
- JSXElement: {
16396
- enter() {
16397
- jsxDepth++;
16398
- },
16399
- exit() {
16400
- jsxDepth--;
16401
- }
16402
- },
16403
- JSXOpeningElement(p) {
16404
- let n = p.node.name, name;
16405
- if (t3.isJSXIdentifier(n))
16406
- name = n.name, name && /[A-Z]/.test(name.charAt(0)) && componentSet.add(name);
16407
- else if (t3.isJSXMemberExpression(n)) {
16408
- let jsxNameToString = (nm) => t3.isJSXIdentifier(nm) ? nm.name : `${jsxNameToString(nm.object)}.${jsxNameToString(nm.property)}`;
16409
- name = jsxNameToString(n), componentSet.add(name);
16410
- }
16411
- if (name) {
16412
- let depth = jsxDepth - 1, existing = componentDepth.get(name);
16413
- (existing === void 0 || depth < existing) && componentDepth.set(name, depth);
16414
- }
16374
+ let { reactDocgenTypescriptOptions } = typescriptOptions, componentSet = /* @__PURE__ */ new Set(), componentDepth = /* @__PURE__ */ new Map(), localToImport = collectImportBindings2(csf.program), jsxDepth = /* @__PURE__ */ new Map();
16375
+ walk2(csf.program, (node, parent) => {
16376
+ let depth = (parent ? jsxDepth.get(parent) ?? 0 : 0) + (node.type === "JSXElement" ? 1 : 0);
16377
+ if (jsxDepth.set(node, depth), node.type !== "JSXOpeningElement")
16378
+ return;
16379
+ let n = node.name, name;
16380
+ if (n.type === "JSXIdentifier")
16381
+ name = n.name, name && /[A-Z]/.test(name.charAt(0)) && componentSet.add(name);
16382
+ else if (n.type === "JSXMemberExpression") {
16383
+ let jsxNameToString = (nm) => nm.type === "JSXIdentifier" ? nm.name : `${jsxNameToString(nm.object)}.${jsxNameToString(nm.property)}`;
16384
+ name = jsxNameToString(n), componentSet.add(name);
16385
+ }
16386
+ if (name) {
16387
+ let wrappingDepth = depth - 1, existing = componentDepth.get(name);
16388
+ (existing === void 0 || wrappingDepth < existing) && componentDepth.set(name, wrappingDepth);
16415
16389
  }
16416
16390
  });
16417
16391
  let metaComp = csf._meta?.component;
@@ -16419,8 +16393,8 @@ var baseIdentifier = (component) => component.split(".")[0] ?? component, getCom
16419
16393
  for (let componentName of additionalComponentNames)
16420
16394
  componentSet.add(componentName);
16421
16395
  let components = Array.from(componentSet).sort((a, b) => a.localeCompare(b)), isLocallyDefinedWithoutImport = (base2) => {
16422
- let binding = program.scope.getBinding(base2);
16423
- return binding ? !!!(binding.path.isImportSpecifier?.() || binding.path.isImportDefaultSpecifier?.() || binding.path.isImportNamespaceSpecifier?.()) : !1;
16396
+ let binding = csf.editor.scopes.program.bindings.get(base2);
16397
+ return binding ? binding.kind !== "import" : !1;
16424
16398
  }, filteredComponents = components.filter(
16425
16399
  (c) => !isLocallyDefinedWithoutImport(baseIdentifier(c))
16426
16400
  );
@@ -16510,7 +16484,7 @@ function findMatchingComponent(components, componentName, title) {
16510
16484
  return best;
16511
16485
  }
16512
16486
  async function resolveStoryFileComponents(options) {
16513
- let { storyPath, title, typescriptOptions, docgenEngine } = options, storyFile = cachedReadTextFileSync(storyPath), csf = loadCsf(storyFile, { makeTitle: () => title }).parse(), componentName = csf._meta?.component, declaredSubcomponents = extractDeclaredSubcomponents(csf), allComponents = await getComponents({
16487
+ let { storyPath, title, typescriptOptions, docgenEngine } = options, storyFile = cachedReadTextFileSync(storyPath), csf = loadCsf(storyFile, { makeTitle: () => title, fileName: storyPath }).parse(), componentName = csf._meta?.component, declaredSubcomponents = extractDeclaredSubcomponents(csf), allComponents = await getComponents({
16514
16488
  additionalComponentNames: declaredSubcomponents.map(
16515
16489
  (subcomponent) => subcomponent.componentName
16516
16490
  ),
@@ -16529,13 +16503,16 @@ function extractStorySnippets(csf, componentName, filterStoryIds, references) {
16529
16503
  return { stories: Object.entries(csf._stories).filter(([, story]) => !filterStoryIds || filterStoryIds.has(story.id)).map(([storyExport, story]) => {
16530
16504
  let name = story.name ?? storyNameFromExport(storyExport);
16531
16505
  try {
16532
- let { description, summary } = extractStoryJSDocInfo(csf._storyStatements[storyExport]), snippet = getCodeSnippet(csf, storyExport, componentName, resolver);
16506
+ let { description, summary } = extractStoryJSDocInfo(
16507
+ csf._storyStatements[storyExport],
16508
+ csf.editor
16509
+ ), snippet = getCodeSnippet(csf, storyExport, componentName, resolver);
16533
16510
  imports.push(...snippet.imports);
16534
16511
  let warning = unresolvedWarning(snippet.unresolved);
16535
16512
  return {
16536
16513
  id: story.id,
16537
16514
  name,
16538
- snippet: recast.print(snippet.node).code,
16515
+ snippet: snippet.code,
16539
16516
  description,
16540
16517
  summary,
16541
16518
  ...warning ? { warning } : {}
@@ -16553,10 +16530,22 @@ import {
16553
16530
  buildImportStatements as buildImportStatements2,
16554
16531
  createStoryReferenceResolver,
16555
16532
  extractComponentDescription,
16556
- extractDescription
16533
+ extractDescription,
16534
+ storyShapeError as storyShapeError2
16557
16535
  } from "storybook/internal/csf-tools";
16558
- var openStoryReferences = createStoryReferenceResolver();
16559
- function getPackageInfo(componentPath, fallbackPath) {
16536
+ var openStoryReferences = createStoryReferenceResolver(), ROOT_ENTRY_FIELDS = ["main", "module", "types", "typings", "browser"];
16537
+ function hasRootEntry(pkg) {
16538
+ let { exports } = pkg;
16539
+ if (exports === void 0)
16540
+ return ROOT_ENTRY_FIELDS.some((field) => field in pkg);
16541
+ if (typeof exports != "object" || Array.isArray(exports))
16542
+ return !0;
16543
+ if (exports === null)
16544
+ return !1;
16545
+ let subpaths = Object.keys(exports).filter((key) => key.startsWith("."));
16546
+ return subpaths.length === 0 || subpaths.includes(".");
16547
+ }
16548
+ function getImportablePackageName(componentPath, fallbackPath) {
16560
16549
  let nearestPkg = cachedFindUp("package.json", {
16561
16550
  cwd: posix.dirname(componentPath ?? fallbackPath)
16562
16551
  });
@@ -16564,7 +16553,7 @@ function getPackageInfo(componentPath, fallbackPath) {
16564
16553
  if (!nearestPkg)
16565
16554
  return;
16566
16555
  let parsed = JSON.parse(cachedReadTextFileSync(nearestPkg));
16567
- return typeof parsed == "object" && parsed && "name" in parsed && typeof parsed.name == "string" ? parsed.name : void 0;
16556
+ return typeof parsed != "object" || !parsed || typeof parsed.name != "string" ? void 0 : parsed.private !== !0 || hasRootEntry(parsed) ? parsed.name : void 0;
16568
16557
  } catch {
16569
16558
  return;
16570
16559
  }
@@ -16653,10 +16642,15 @@ function buildStoryDocsFromResolved({
16653
16642
  allComponents,
16654
16643
  filterStoryIds
16655
16644
  }) {
16656
- let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), fallbackImport = getFallbackImport(packageName, componentName), storyEntries = extractStorySnippets(csf, component?.componentName, filterStoryIds, {
16657
- filePath: storyPath,
16658
- ...openStoryReferences()
16659
- }), argRefs = storyEntries.imports.map((ref2) => ({ ...ref2, isPackage: !0 })), imports = buildImportStatements2({ refs: [...allComponents, ...argRefs], packageName }).join(`
16645
+ let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getImportablePackageName(component?.path, storyPath), fallbackImport = getFallbackImport(packageName, componentName), storyEntries = extractStorySnippets(
16646
+ csf,
16647
+ component?.componentName ?? componentName,
16648
+ filterStoryIds,
16649
+ {
16650
+ filePath: storyPath,
16651
+ ...openStoryReferences()
16652
+ }
16653
+ ), argRefs = storyEntries.imports.map((ref2) => ({ ...ref2, isPackage: !0 })), imports = buildImportStatements2({ refs: [...allComponents, ...argRefs], packageName }).join(`
16660
16654
  `).trim() || fallbackImport;
16661
16655
  return {
16662
16656
  id,
@@ -16677,7 +16671,7 @@ function buildComponentDocgenFromResolved({
16677
16671
  subcomponents,
16678
16672
  docgenEngine
16679
16673
  }) {
16680
- let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), base2 = {
16674
+ let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getImportablePackageName(component?.path, storyPath), base2 = {
16681
16675
  id,
16682
16676
  name: componentName ?? title,
16683
16677
  path: storyFilePath,
@@ -16703,14 +16697,14 @@ function buildComponentDocgenFromResolved({
16703
16697
  jsDocTags: base2.jsDocTags ?? {},
16704
16698
  error: docgenError ?? {
16705
16699
  name: error.name,
16706
- message: (csf._metaStatementPath?.buildCodeFrameError(error.message).message ?? error.message) + `
16700
+ message: (csf._metaStatement ? storyShapeError2(error.message, csf._metaStatement, csf.editor).message : error.message) + `
16707
16701
 
16708
16702
  ${entry.importPath}:
16709
16703
  ${storyFile}`
16710
16704
  }
16711
16705
  };
16712
16706
  }
16713
- let metaJsDoc = extractDescription(csf._metaStatement) || void 0, { description, summary, jsDocTags } = extractComponentDescription(
16707
+ let metaJsDoc = extractDescription(csf._metaStatement, csf.editor) || void 0, { description, summary, jsDocTags } = extractComponentDescription(
16714
16708
  metaJsDoc,
16715
16709
  docgenDescription,
16716
16710
  docgenJsDocTags
@@ -16782,12 +16776,13 @@ function buildReactComponentDocgenFromResolved({
16782
16776
  export {
16783
16777
  __commonJS,
16784
16778
  __toESM,
16779
+ join3 as join,
16780
+ isAbsolute2 as isAbsolute,
16781
+ posix,
16785
16782
  extractArgTypes,
16786
16783
  invalidateCache,
16787
16784
  cachedReadFileSync,
16788
16785
  parseWithReactDocgen,
16789
- join3 as join,
16790
- posix,
16791
16786
  getCodeSnippet,
16792
16787
  invalidateParser,
16793
16788
  resolveStoryFileComponents,