storybook 9.0.0-alpha.1 → 9.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +31 -29
  2. package/assets/browser/favicon.svg +1 -0
  3. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  4. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  5. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  6. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  7. package/assets/docs/message-reference.png +0 -0
  8. package/assets/server/addon.tsconfig.json +6 -0
  9. package/assets/server/base-preview-body.html +119 -0
  10. package/assets/server/base-preview-head.html +451 -0
  11. package/assets/server/template.ejs +87 -0
  12. package/bin/index.cjs +1 -1
  13. package/dist/babel/index.cjs +54034 -0
  14. package/dist/babel/index.d.ts +7488 -0
  15. package/dist/babel/index.js +54044 -0
  16. package/dist/bin/index.cjs +124 -0
  17. package/dist/bin/index.js +118 -0
  18. package/dist/builder-manager/index.cjs +2167 -0
  19. package/dist/builder-manager/index.d.ts +19 -0
  20. package/dist/builder-manager/index.js +2189 -0
  21. package/dist/channels/index.cjs +1938 -0
  22. package/dist/channels/index.d.ts +108 -0
  23. package/dist/channels/index.js +1885 -0
  24. package/dist/cli/bin/index.cjs +2687 -0
  25. package/dist/cli/bin/index.d.ts +2 -0
  26. package/dist/cli/bin/index.js +2707 -0
  27. package/dist/cli/index.cjs +17327 -0
  28. package/dist/cli/index.d.ts +209 -0
  29. package/dist/cli/index.js +17349 -0
  30. package/dist/client-logger/index.cjs +112 -0
  31. package/dist/client-logger/index.d.ts +29 -0
  32. package/dist/client-logger/index.js +70 -0
  33. package/dist/common/index.cjs +20558 -0
  34. package/dist/common/index.d.ts +955 -0
  35. package/dist/common/index.js +20643 -0
  36. package/dist/components/index.cjs +30056 -0
  37. package/dist/components/index.d.ts +1423 -0
  38. package/dist/components/index.js +25416 -0
  39. package/dist/core-events/index.cjs +167 -0
  40. package/dist/core-events/index.d.ts +313 -0
  41. package/dist/core-events/index.js +149 -0
  42. package/dist/core-server/index.cjs +37872 -0
  43. package/dist/core-server/index.d.ts +462 -0
  44. package/dist/core-server/index.js +37966 -0
  45. package/dist/core-server/presets/common-manager.js +28 -0
  46. package/dist/core-server/presets/common-override-preset.cjs +4824 -0
  47. package/dist/core-server/presets/common-override-preset.js +4829 -0
  48. package/dist/core-server/presets/common-preset.cjs +10228 -0
  49. package/dist/core-server/presets/common-preset.js +10306 -0
  50. package/dist/csf/index.cjs +223 -0
  51. package/dist/csf/index.d.ts +752 -0
  52. package/dist/csf/index.js +216 -0
  53. package/dist/csf-tools/index.cjs +1422 -0
  54. package/dist/csf-tools/index.d.ts +250 -0
  55. package/dist/csf-tools/index.js +1439 -0
  56. package/dist/docs-tools/index.cjs +923 -0
  57. package/dist/docs-tools/index.d.ts +162 -0
  58. package/dist/docs-tools/index.js +909 -0
  59. package/dist/index.cjs +17 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -7
  62. package/dist/instrumenter/index.cjs +3273 -0
  63. package/dist/instrumenter/index.d.ts +104 -0
  64. package/dist/instrumenter/index.js +4800 -0
  65. package/dist/manager/globals-module-info.cjs +666 -0
  66. package/dist/manager/globals-module-info.d.ts +36 -0
  67. package/dist/manager/globals-module-info.js +653 -0
  68. package/dist/manager/globals-runtime.js +41567 -0
  69. package/dist/manager/globals.cjs +43 -0
  70. package/dist/manager/globals.d.ts +21 -0
  71. package/dist/manager/globals.js +30 -0
  72. package/dist/manager/runtime.js +12043 -0
  73. package/dist/manager-api/index.cjs +10772 -0
  74. package/dist/manager-api/index.d.ts +1211 -0
  75. package/dist/manager-api/index.js +4547 -0
  76. package/dist/manager-errors.d.ts +65 -0
  77. package/dist/manager-errors.js +83 -0
  78. package/dist/node-logger/index.cjs +1642 -0
  79. package/dist/node-logger/index.d.ts +117 -0
  80. package/dist/node-logger/index.js +1652 -0
  81. package/dist/preview/globals.cjs +34 -0
  82. package/dist/preview/globals.d.ts +12 -0
  83. package/dist/preview/globals.js +21 -0
  84. package/dist/preview/runtime.js +7723 -0
  85. package/dist/preview-api/index.cjs +5658 -0
  86. package/dist/preview-api/index.d.ts +1356 -0
  87. package/dist/preview-api/index.js +5665 -0
  88. package/dist/preview-errors.cjs +486 -0
  89. package/dist/preview-errors.d.ts +188 -0
  90. package/dist/preview-errors.js +433 -0
  91. package/dist/router/index.cjs +3320 -0
  92. package/dist/router/index.d.ts +385 -0
  93. package/dist/router/index.js +1849 -0
  94. package/dist/server-errors.cjs +710 -0
  95. package/dist/server-errors.d.ts +272 -0
  96. package/dist/server-errors.js +711 -0
  97. package/dist/telemetry/index.cjs +3683 -0
  98. package/dist/telemetry/index.d.ts +112 -0
  99. package/dist/telemetry/index.js +3720 -0
  100. package/dist/theming/create.cjs +2422 -0
  101. package/dist/theming/create.d.ts +50 -0
  102. package/dist/theming/create.js +990 -0
  103. package/dist/theming/index.cjs +4832 -0
  104. package/dist/theming/index.d.ts +11939 -0
  105. package/dist/theming/index.js +3253 -0
  106. package/dist/types/index.cjs +27 -0
  107. package/dist/types/index.d.ts +2541 -0
  108. package/dist/types/index.js +7 -0
  109. package/package.json +308 -212
  110. package/.eslintrc.cjs +0 -31
  111. package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
  112. package/core/babel/index.cjs +0 -1
  113. package/core/babel/index.d.ts +0 -2
  114. package/core/babel/index.js +0 -1
  115. package/core/builder-manager/index.cjs +0 -1
  116. package/core/builder-manager/index.d.ts +0 -2
  117. package/core/builder-manager/index.js +0 -1
  118. package/core/channels/index.cjs +0 -1
  119. package/core/channels/index.d.ts +0 -2
  120. package/core/channels/index.js +0 -1
  121. package/core/cli/bin/index.cjs +0 -1
  122. package/core/cli/bin/index.d.ts +0 -2
  123. package/core/cli/bin/index.js +0 -1
  124. package/core/cli/index.cjs +0 -1
  125. package/core/cli/index.d.ts +0 -2
  126. package/core/cli/index.js +0 -1
  127. package/core/client-logger/index.cjs +0 -1
  128. package/core/client-logger/index.d.ts +0 -2
  129. package/core/client-logger/index.js +0 -1
  130. package/core/common/index.cjs +0 -1
  131. package/core/common/index.d.ts +0 -2
  132. package/core/common/index.js +0 -1
  133. package/core/components/index.cjs +0 -1
  134. package/core/components/index.d.ts +0 -2
  135. package/core/components/index.js +0 -1
  136. package/core/core-events/index.cjs +0 -1
  137. package/core/core-events/index.d.ts +0 -2
  138. package/core/core-events/index.js +0 -1
  139. package/core/core-server/index.cjs +0 -1
  140. package/core/core-server/index.d.ts +0 -2
  141. package/core/core-server/index.js +0 -1
  142. package/core/core-server/presets/common-manager.js +0 -1
  143. package/core/core-server/presets/common-override-preset.cjs +0 -1
  144. package/core/core-server/presets/common-override-preset.js +0 -1
  145. package/core/core-server/presets/common-preset.cjs +0 -1
  146. package/core/core-server/presets/common-preset.js +0 -1
  147. package/core/csf/index.cjs +0 -1
  148. package/core/csf/index.d.ts +0 -2
  149. package/core/csf/index.js +0 -1
  150. package/core/csf-tools/index.cjs +0 -1
  151. package/core/csf-tools/index.d.ts +0 -2
  152. package/core/csf-tools/index.js +0 -1
  153. package/core/docs-tools/index.cjs +0 -1
  154. package/core/docs-tools/index.d.ts +0 -2
  155. package/core/docs-tools/index.js +0 -1
  156. package/core/index.cjs +0 -1
  157. package/core/index.d.ts +0 -2
  158. package/core/index.js +0 -1
  159. package/core/manager/globals-module-info.cjs +0 -1
  160. package/core/manager/globals-module-info.d.ts +0 -2
  161. package/core/manager/globals-module-info.js +0 -1
  162. package/core/manager/globals-runtime.js +0 -1
  163. package/core/manager/globals.cjs +0 -1
  164. package/core/manager/globals.d.ts +0 -2
  165. package/core/manager/globals.js +0 -1
  166. package/core/manager-api/index.cjs +0 -1
  167. package/core/manager-api/index.d.ts +0 -2
  168. package/core/manager-api/index.js +0 -1
  169. package/core/manager-errors.d.ts +0 -2
  170. package/core/manager-errors.js +0 -1
  171. package/core/node-logger/index.cjs +0 -1
  172. package/core/node-logger/index.d.ts +0 -2
  173. package/core/node-logger/index.js +0 -1
  174. package/core/preview/globals.cjs +0 -1
  175. package/core/preview/globals.d.ts +0 -2
  176. package/core/preview/globals.js +0 -1
  177. package/core/preview/runtime.js +0 -1
  178. package/core/preview-api/index.cjs +0 -1
  179. package/core/preview-api/index.d.ts +0 -2
  180. package/core/preview-api/index.js +0 -1
  181. package/core/preview-errors.cjs +0 -1
  182. package/core/preview-errors.d.ts +0 -2
  183. package/core/preview-errors.js +0 -1
  184. package/core/router/index.cjs +0 -1
  185. package/core/router/index.d.ts +0 -2
  186. package/core/router/index.js +0 -1
  187. package/core/server-errors.cjs +0 -1
  188. package/core/server-errors.d.ts +0 -2
  189. package/core/server-errors.js +0 -1
  190. package/core/telemetry/index.cjs +0 -1
  191. package/core/telemetry/index.d.ts +0 -2
  192. package/core/telemetry/index.js +0 -1
  193. package/core/theming/create.cjs +0 -1
  194. package/core/theming/create.d.ts +0 -2
  195. package/core/theming/create.js +0 -1
  196. package/core/theming/index.cjs +0 -1
  197. package/core/theming/index.d.ts +0 -2
  198. package/core/theming/index.js +0 -1
  199. package/core/types/index.cjs +0 -1
  200. package/core/types/index.d.ts +0 -2
  201. package/core/types/index.js +0 -1
  202. package/core.cjs +0 -0
  203. package/core.d.ts +0 -0
  204. package/core.js +0 -1
  205. package/dist/chunk-OWLSIX54.js +0 -8
  206. package/dist/core-path.cjs +0 -1
  207. package/dist/core-path.d.ts +0 -3
  208. package/dist/core-path.js +0 -9
  209. package/dist/proxy.cjs +0 -1
  210. package/dist/proxy.d.ts +0 -2
  211. package/dist/proxy.js +0 -9
@@ -0,0 +1,3683 @@
1
+ "use strict";
2
+ var Cs = Object.create;
3
+ var Z = Object.defineProperty;
4
+ var Os = Object.getOwnPropertyDescriptor;
5
+ var As = Object.getOwnPropertyNames;
6
+ var Rs = Object.getPrototypeOf, _s = Object.prototype.hasOwnProperty;
7
+ var o = (e, t) => Z(e, "name", { value: t, configurable: !0 });
8
+ var p = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Gs = (e, t) => {
9
+ for (var r in t)
10
+ Z(e, r, { get: t[r], enumerable: !0 });
11
+ }, Ir = (e, t, r, n) => {
12
+ if (t && typeof t == "object" || typeof t == "function")
13
+ for (let i of As(t))
14
+ !_s.call(e, i) && i !== r && Z(e, i, { get: () => t[i], enumerable: !(n = Os(t, i)) || n.enumerable });
15
+ return e;
16
+ };
17
+ var b = (e, t, r) => (r = e != null ? Cs(Rs(e)) : {}, Ir(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ t || !e || !e.__esModule ? Z(r, "default", { value: e, enumerable: !0 }) : r,
23
+ e
24
+ )), js = (e) => Ir(Z({}, "__esModule", { value: !0 }), e);
25
+
26
+ // ../node_modules/picocolors/picocolors.js
27
+ var Ar = p((Ol, pt) => {
28
+ var xe = process || {}, Cr = xe.argv || [], be = xe.env || {}, Ns = !(be.NO_COLOR || Cr.includes("--no-color")) && (!!be.FORCE_COLOR || Cr.
29
+ includes("--color") || xe.platform === "win32" || (xe.stdout || {}).isTTY && be.TERM !== "dumb" || !!be.CI), Bs = /* @__PURE__ */ o((e, t, r = e) => (n) => {
30
+ let i = "" + n, s = i.indexOf(t, e.length);
31
+ return ~s ? e + Ds(i, t, r, s) + t : e + i + t;
32
+ }, "formatter"), Ds = /* @__PURE__ */ o((e, t, r, n) => {
33
+ let i = "", s = 0;
34
+ do
35
+ i += e.substring(s, n) + r, s = n + t.length, n = e.indexOf(t, s);
36
+ while (~n);
37
+ return i + e.substring(s);
38
+ }, "replaceClose"), Or = /* @__PURE__ */ o((e = Ns) => {
39
+ let t = e ? Bs : () => String;
40
+ return {
41
+ isColorSupported: e,
42
+ reset: t("\x1B[0m", "\x1B[0m"),
43
+ bold: t("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
44
+ dim: t("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
45
+ italic: t("\x1B[3m", "\x1B[23m"),
46
+ underline: t("\x1B[4m", "\x1B[24m"),
47
+ inverse: t("\x1B[7m", "\x1B[27m"),
48
+ hidden: t("\x1B[8m", "\x1B[28m"),
49
+ strikethrough: t("\x1B[9m", "\x1B[29m"),
50
+ black: t("\x1B[30m", "\x1B[39m"),
51
+ red: t("\x1B[31m", "\x1B[39m"),
52
+ green: t("\x1B[32m", "\x1B[39m"),
53
+ yellow: t("\x1B[33m", "\x1B[39m"),
54
+ blue: t("\x1B[34m", "\x1B[39m"),
55
+ magenta: t("\x1B[35m", "\x1B[39m"),
56
+ cyan: t("\x1B[36m", "\x1B[39m"),
57
+ white: t("\x1B[37m", "\x1B[39m"),
58
+ gray: t("\x1B[90m", "\x1B[39m"),
59
+ bgBlack: t("\x1B[40m", "\x1B[49m"),
60
+ bgRed: t("\x1B[41m", "\x1B[49m"),
61
+ bgGreen: t("\x1B[42m", "\x1B[49m"),
62
+ bgYellow: t("\x1B[43m", "\x1B[49m"),
63
+ bgBlue: t("\x1B[44m", "\x1B[49m"),
64
+ bgMagenta: t("\x1B[45m", "\x1B[49m"),
65
+ bgCyan: t("\x1B[46m", "\x1B[49m"),
66
+ bgWhite: t("\x1B[47m", "\x1B[49m"),
67
+ blackBright: t("\x1B[90m", "\x1B[39m"),
68
+ redBright: t("\x1B[91m", "\x1B[39m"),
69
+ greenBright: t("\x1B[92m", "\x1B[39m"),
70
+ yellowBright: t("\x1B[93m", "\x1B[39m"),
71
+ blueBright: t("\x1B[94m", "\x1B[39m"),
72
+ magentaBright: t("\x1B[95m", "\x1B[39m"),
73
+ cyanBright: t("\x1B[96m", "\x1B[39m"),
74
+ whiteBright: t("\x1B[97m", "\x1B[39m"),
75
+ bgBlackBright: t("\x1B[100m", "\x1B[49m"),
76
+ bgRedBright: t("\x1B[101m", "\x1B[49m"),
77
+ bgGreenBright: t("\x1B[102m", "\x1B[49m"),
78
+ bgYellowBright: t("\x1B[103m", "\x1B[49m"),
79
+ bgBlueBright: t("\x1B[104m", "\x1B[49m"),
80
+ bgMagentaBright: t("\x1B[105m", "\x1B[49m"),
81
+ bgCyanBright: t("\x1B[106m", "\x1B[49m"),
82
+ bgWhiteBright: t("\x1B[107m", "\x1B[49m")
83
+ };
84
+ }, "createColors");
85
+ pt.exports = Or();
86
+ pt.exports.createColors = Or;
87
+ });
88
+
89
+ // ../node_modules/isexe/windows.js
90
+ var Mr = p((Nl, Dr) => {
91
+ Dr.exports = Br;
92
+ Br.sync = Ls;
93
+ var jr = require("fs");
94
+ function Ms(e, t) {
95
+ var r = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
96
+ if (!r || (r = r.split(";"), r.indexOf("") !== -1))
97
+ return !0;
98
+ for (var n = 0; n < r.length; n++) {
99
+ var i = r[n].toLowerCase();
100
+ if (i && e.substr(-i.length).toLowerCase() === i)
101
+ return !0;
102
+ }
103
+ return !1;
104
+ }
105
+ o(Ms, "checkPathExt");
106
+ function Nr(e, t, r) {
107
+ return !e.isSymbolicLink() && !e.isFile() ? !1 : Ms(t, r);
108
+ }
109
+ o(Nr, "checkStat");
110
+ function Br(e, t, r) {
111
+ jr.stat(e, function(n, i) {
112
+ r(n, n ? !1 : Nr(i, e, t));
113
+ });
114
+ }
115
+ o(Br, "isexe");
116
+ function Ls(e, t) {
117
+ return Nr(jr.statSync(e), e, t);
118
+ }
119
+ o(Ls, "sync");
120
+ });
121
+
122
+ // ../node_modules/isexe/mode.js
123
+ var qr = p((Dl, $r) => {
124
+ $r.exports = Fr;
125
+ Fr.sync = Fs;
126
+ var Lr = require("fs");
127
+ function Fr(e, t, r) {
128
+ Lr.stat(e, function(n, i) {
129
+ r(n, n ? !1 : Ur(i, t));
130
+ });
131
+ }
132
+ o(Fr, "isexe");
133
+ function Fs(e, t) {
134
+ return Ur(Lr.statSync(e), t);
135
+ }
136
+ o(Fs, "sync");
137
+ function Ur(e, t) {
138
+ return e.isFile() && Us(e, t);
139
+ }
140
+ o(Ur, "checkStat");
141
+ function Us(e, t) {
142
+ var r = e.mode, n = e.uid, i = e.gid, s = t.uid !== void 0 ? t.uid : process.getuid && process.getuid(), a = t.gid !== void 0 ? t.gid : process.
143
+ getgid && process.getgid(), c = parseInt("100", 8), u = parseInt("010", 8), l = parseInt("001", 8), f = c | u, x = r & l || r & u && i ===
144
+ a || r & c && n === s || r & f && s === 0;
145
+ return x;
146
+ }
147
+ o(Us, "checkMode");
148
+ });
149
+
150
+ // ../node_modules/isexe/index.js
151
+ var Hr = p((Fl, Wr) => {
152
+ var Ll = require("fs"), we;
153
+ process.platform === "win32" || global.TESTING_WINDOWS ? we = Mr() : we = qr();
154
+ Wr.exports = yt;
155
+ yt.sync = $s;
156
+ function yt(e, t, r) {
157
+ if (typeof t == "function" && (r = t, t = {}), !r) {
158
+ if (typeof Promise != "function")
159
+ throw new TypeError("callback not provided");
160
+ return new Promise(function(n, i) {
161
+ yt(e, t || {}, function(s, a) {
162
+ s ? i(s) : n(a);
163
+ });
164
+ });
165
+ }
166
+ we(e, t || {}, function(n, i) {
167
+ n && (n.code === "EACCES" || t && t.ignoreErrors) && (n = null, i = !1), r(n, i);
168
+ });
169
+ }
170
+ o(yt, "isexe");
171
+ function $s(e, t) {
172
+ try {
173
+ return we.sync(e, t || {});
174
+ } catch (r) {
175
+ if (t && t.ignoreErrors || r.code === "EACCES")
176
+ return !1;
177
+ throw r;
178
+ }
179
+ }
180
+ o($s, "sync");
181
+ });
182
+
183
+ // ../node_modules/cross-spawn/node_modules/which/which.js
184
+ var Qr = p(($l, Xr) => {
185
+ var U = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Vr = require("path"), qs = U ? "\
186
+ ;" : ":", zr = Hr(), Jr = /* @__PURE__ */ o((e) => Object.assign(new Error(`not found: ${e}`), { code: "ENOENT" }), "getNotFoundError"), Kr = /* @__PURE__ */ o(
187
+ (e, t) => {
188
+ let r = t.colon || qs, n = e.match(/\//) || U && e.match(/\\/) ? [""] : [
189
+ // windows always checks the cwd first
190
+ ...U ? [process.cwd()] : [],
191
+ ...(t.path || process.env.PATH || /* istanbul ignore next: very unusual */
192
+ "").split(r)
193
+ ], i = U ? t.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", s = U ? i.split(r) : [""];
194
+ return U && e.indexOf(".") !== -1 && s[0] !== "" && s.unshift(""), {
195
+ pathEnv: n,
196
+ pathExt: s,
197
+ pathExtExe: i
198
+ };
199
+ }, "getPathInfo"), Yr = /* @__PURE__ */ o((e, t, r) => {
200
+ typeof t == "function" && (r = t, t = {}), t || (t = {});
201
+ let { pathEnv: n, pathExt: i, pathExtExe: s } = Kr(e, t), a = [], c = /* @__PURE__ */ o((l) => new Promise((f, x) => {
202
+ if (l === n.length)
203
+ return t.all && a.length ? f(a) : x(Jr(e));
204
+ let g = n[l], m = /^".*"$/.test(g) ? g.slice(1, -1) : g, y = Vr.join(m, e), h = !m && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + y : y;
205
+ f(u(h, l, 0));
206
+ }), "step"), u = /* @__PURE__ */ o((l, f, x) => new Promise((g, m) => {
207
+ if (x === i.length)
208
+ return g(c(f + 1));
209
+ let y = i[x];
210
+ zr(l + y, { pathExt: s }, (h, S) => {
211
+ if (!h && S)
212
+ if (t.all)
213
+ a.push(l + y);
214
+ else
215
+ return g(l + y);
216
+ return g(u(l, f, x + 1));
217
+ });
218
+ }), "subStep");
219
+ return r ? c(0).then((l) => r(null, l), r) : c(0);
220
+ }, "which"), Ws = /* @__PURE__ */ o((e, t) => {
221
+ t = t || {};
222
+ let { pathEnv: r, pathExt: n, pathExtExe: i } = Kr(e, t), s = [];
223
+ for (let a = 0; a < r.length; a++) {
224
+ let c = r[a], u = /^".*"$/.test(c) ? c.slice(1, -1) : c, l = Vr.join(u, e), f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + l : l;
225
+ for (let x = 0; x < n.length; x++) {
226
+ let g = f + n[x];
227
+ try {
228
+ if (zr.sync(g, { pathExt: i }))
229
+ if (t.all)
230
+ s.push(g);
231
+ else
232
+ return g;
233
+ } catch {
234
+ }
235
+ }
236
+ }
237
+ if (t.all && s.length)
238
+ return s;
239
+ if (t.nothrow)
240
+ return null;
241
+ throw Jr(e);
242
+ }, "whichSync");
243
+ Xr.exports = Yr;
244
+ Yr.sync = Ws;
245
+ });
246
+
247
+ // ../node_modules/path-key/index.js
248
+ var bt = p((Wl, gt) => {
249
+ "use strict";
250
+ var Zr = /* @__PURE__ */ o((e = {}) => {
251
+ let t = e.env || process.env;
252
+ return (e.platform || process.platform) !== "win32" ? "PATH" : Object.keys(t).reverse().find((n) => n.toUpperCase() === "PATH") || "Path";
253
+ }, "pathKey");
254
+ gt.exports = Zr;
255
+ gt.exports.default = Zr;
256
+ });
257
+
258
+ // ../node_modules/cross-spawn/lib/util/resolveCommand.js
259
+ var nn = p((Vl, rn) => {
260
+ "use strict";
261
+ var en = require("path"), Hs = Qr(), Vs = bt();
262
+ function tn(e, t) {
263
+ let r = e.options.env || process.env, n = process.cwd(), i = e.options.cwd != null, s = i && process.chdir !== void 0 && !process.chdir.
264
+ disabled;
265
+ if (s)
266
+ try {
267
+ process.chdir(e.options.cwd);
268
+ } catch {
269
+ }
270
+ let a;
271
+ try {
272
+ a = Hs.sync(e.command, {
273
+ path: r[Vs({ env: r })],
274
+ pathExt: t ? en.delimiter : void 0
275
+ });
276
+ } catch {
277
+ } finally {
278
+ s && process.chdir(n);
279
+ }
280
+ return a && (a = en.resolve(i ? e.options.cwd : "", a)), a;
281
+ }
282
+ o(tn, "resolveCommandAttempt");
283
+ function zs(e) {
284
+ return tn(e) || tn(e, !0);
285
+ }
286
+ o(zs, "resolveCommand");
287
+ rn.exports = zs;
288
+ });
289
+
290
+ // ../node_modules/cross-spawn/lib/util/escape.js
291
+ var on = p((Jl, St) => {
292
+ "use strict";
293
+ var xt = /([()\][%!^"`<>&|;, *?])/g;
294
+ function Js(e) {
295
+ return e = e.replace(xt, "^$1"), e;
296
+ }
297
+ o(Js, "escapeCommand");
298
+ function Ks(e, t) {
299
+ return e = `${e}`, e = e.replace(/(\\*)"/g, '$1$1\\"'), e = e.replace(/(\\*)$/, "$1$1"), e = `"${e}"`, e = e.replace(xt, "^$1"), t && (e =
300
+ e.replace(xt, "^$1")), e;
301
+ }
302
+ o(Ks, "escapeArgument");
303
+ St.exports.command = Js;
304
+ St.exports.argument = Ks;
305
+ });
306
+
307
+ // ../node_modules/shebang-regex/index.js
308
+ var an = p((Yl, sn) => {
309
+ "use strict";
310
+ sn.exports = /^#!(.*)/;
311
+ });
312
+
313
+ // ../node_modules/shebang-command/index.js
314
+ var un = p((Xl, cn) => {
315
+ "use strict";
316
+ var Ys = an();
317
+ cn.exports = (e = "") => {
318
+ let t = e.match(Ys);
319
+ if (!t)
320
+ return null;
321
+ let [r, n] = t[0].replace(/#! ?/, "").split(" "), i = r.split("/").pop();
322
+ return i === "env" ? n : n ? `${i} ${n}` : i;
323
+ };
324
+ });
325
+
326
+ // ../node_modules/cross-spawn/lib/util/readShebang.js
327
+ var fn = p((Ql, ln) => {
328
+ "use strict";
329
+ var wt = require("fs"), Xs = un();
330
+ function Qs(e) {
331
+ let r = Buffer.alloc(150), n;
332
+ try {
333
+ n = wt.openSync(e, "r"), wt.readSync(n, r, 0, 150, 0), wt.closeSync(n);
334
+ } catch {
335
+ }
336
+ return Xs(r.toString());
337
+ }
338
+ o(Qs, "readShebang");
339
+ ln.exports = Qs;
340
+ });
341
+
342
+ // ../node_modules/cross-spawn/lib/parse.js
343
+ var hn = p((ef, mn) => {
344
+ "use strict";
345
+ var Zs = require("path"), pn = nn(), dn = on(), ea = fn(), ta = process.platform === "win32", ra = /\.(?:com|exe)$/i, na = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
346
+ function oa(e) {
347
+ e.file = pn(e);
348
+ let t = e.file && ea(e.file);
349
+ return t ? (e.args.unshift(e.file), e.command = t, pn(e)) : e.file;
350
+ }
351
+ o(oa, "detectShebang");
352
+ function ia(e) {
353
+ if (!ta)
354
+ return e;
355
+ let t = oa(e), r = !ra.test(t);
356
+ if (e.options.forceShell || r) {
357
+ let n = na.test(t);
358
+ e.command = Zs.normalize(e.command), e.command = dn.command(e.command), e.args = e.args.map((s) => dn.argument(s, n));
359
+ let i = [e.command].concat(e.args).join(" ");
360
+ e.args = ["/d", "/s", "/c", `"${i}"`], e.command = process.env.comspec || "cmd.exe", e.options.windowsVerbatimArguments = !0;
361
+ }
362
+ return e;
363
+ }
364
+ o(ia, "parseNonShell");
365
+ function sa(e, t, r) {
366
+ t && !Array.isArray(t) && (r = t, t = null), t = t ? t.slice(0) : [], r = Object.assign({}, r);
367
+ let n = {
368
+ command: e,
369
+ args: t,
370
+ options: r,
371
+ file: void 0,
372
+ original: {
373
+ command: e,
374
+ args: t
375
+ }
376
+ };
377
+ return r.shell ? n : ia(n);
378
+ }
379
+ o(sa, "parse");
380
+ mn.exports = sa;
381
+ });
382
+
383
+ // ../node_modules/cross-spawn/lib/enoent.js
384
+ var bn = p((rf, gn) => {
385
+ "use strict";
386
+ var vt = process.platform === "win32";
387
+ function Pt(e, t) {
388
+ return Object.assign(new Error(`${t} ${e.command} ENOENT`), {
389
+ code: "ENOENT",
390
+ errno: "ENOENT",
391
+ syscall: `${t} ${e.command}`,
392
+ path: e.command,
393
+ spawnargs: e.args
394
+ });
395
+ }
396
+ o(Pt, "notFoundError");
397
+ function aa(e, t) {
398
+ if (!vt)
399
+ return;
400
+ let r = e.emit;
401
+ e.emit = function(n, i) {
402
+ if (n === "exit") {
403
+ let s = yn(i, t, "spawn");
404
+ if (s)
405
+ return r.call(e, "error", s);
406
+ }
407
+ return r.apply(e, arguments);
408
+ };
409
+ }
410
+ o(aa, "hookChildProcess");
411
+ function yn(e, t) {
412
+ return vt && e === 1 && !t.file ? Pt(t.original, "spawn") : null;
413
+ }
414
+ o(yn, "verifyENOENT");
415
+ function ca(e, t) {
416
+ return vt && e === 1 && !t.file ? Pt(t.original, "spawnSync") : null;
417
+ }
418
+ o(ca, "verifyENOENTSync");
419
+ gn.exports = {
420
+ hookChildProcess: aa,
421
+ verifyENOENT: yn,
422
+ verifyENOENTSync: ca,
423
+ notFoundError: Pt
424
+ };
425
+ });
426
+
427
+ // ../node_modules/cross-spawn/index.js
428
+ var kt = p((of, $) => {
429
+ "use strict";
430
+ var xn = require("child_process"), Et = hn(), Tt = bn();
431
+ function Sn(e, t, r) {
432
+ let n = Et(e, t, r), i = xn.spawn(n.command, n.args, n.options);
433
+ return Tt.hookChildProcess(i, n), i;
434
+ }
435
+ o(Sn, "spawn");
436
+ function ua(e, t, r) {
437
+ let n = Et(e, t, r), i = xn.spawnSync(n.command, n.args, n.options);
438
+ return i.error = i.error || Tt.verifyENOENTSync(i.status, n), i;
439
+ }
440
+ o(ua, "spawnSync");
441
+ $.exports = Sn;
442
+ $.exports.spawn = Sn;
443
+ $.exports.sync = ua;
444
+ $.exports._parse = Et;
445
+ $.exports._enoent = Tt;
446
+ });
447
+
448
+ // ../node_modules/execa/node_modules/strip-final-newline/index.js
449
+ var vn = p((af, wn) => {
450
+ "use strict";
451
+ wn.exports = (e) => {
452
+ let t = typeof e == "string" ? `
453
+ ` : 10, r = typeof e == "string" ? "\r" : 13;
454
+ return e[e.length - 1] === t && (e = e.slice(0, e.length - 1)), e[e.length - 1] === r && (e = e.slice(0, e.length - 1)), e;
455
+ };
456
+ });
457
+
458
+ // ../node_modules/npm-run-path/index.js
459
+ var Tn = p((cf, re) => {
460
+ "use strict";
461
+ var te = require("path"), Pn = bt(), En = /* @__PURE__ */ o((e) => {
462
+ e = {
463
+ cwd: process.cwd(),
464
+ path: process.env[Pn()],
465
+ execPath: process.execPath,
466
+ ...e
467
+ };
468
+ let t, r = te.resolve(e.cwd), n = [];
469
+ for (; t !== r; )
470
+ n.push(te.join(r, "node_modules/.bin")), t = r, r = te.resolve(r, "..");
471
+ let i = te.resolve(e.cwd, e.execPath, "..");
472
+ return n.push(i), n.concat(e.path).join(te.delimiter);
473
+ }, "npmRunPath");
474
+ re.exports = En;
475
+ re.exports.default = En;
476
+ re.exports.env = (e) => {
477
+ e = {
478
+ env: process.env,
479
+ ...e
480
+ };
481
+ let t = { ...e.env }, r = Pn({ env: t });
482
+ return e.path = t[r], t[r] = re.exports(e), t;
483
+ };
484
+ });
485
+
486
+ // ../node_modules/mimic-fn/index.js
487
+ var In = p((lf, It) => {
488
+ "use strict";
489
+ var kn = /* @__PURE__ */ o((e, t) => {
490
+ for (let r of Reflect.ownKeys(t))
491
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
492
+ return e;
493
+ }, "mimicFn");
494
+ It.exports = kn;
495
+ It.exports.default = kn;
496
+ });
497
+
498
+ // ../node_modules/onetime/index.js
499
+ var On = p((pf, Pe) => {
500
+ "use strict";
501
+ var la = In(), ve = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ o((e, t = {}) => {
502
+ if (typeof e != "function")
503
+ throw new TypeError("Expected a function");
504
+ let r, n = 0, i = e.displayName || e.name || "<anonymous>", s = /* @__PURE__ */ o(function(...a) {
505
+ if (ve.set(s, ++n), n === 1)
506
+ r = e.apply(this, a), e = null;
507
+ else if (t.throw === !0)
508
+ throw new Error(`Function \`${i}\` can only be called once`);
509
+ return r;
510
+ }, "onetime");
511
+ return la(s, e), ve.set(s, n), s;
512
+ }, "onetime");
513
+ Pe.exports = Cn;
514
+ Pe.exports.default = Cn;
515
+ Pe.exports.callCount = (e) => {
516
+ if (!ve.has(e))
517
+ throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);
518
+ return ve.get(e);
519
+ };
520
+ });
521
+
522
+ // ../node_modules/execa/node_modules/human-signals/build/src/core.js
523
+ var An = p((Ee) => {
524
+ "use strict";
525
+ Object.defineProperty(Ee, "__esModule", { value: !0 });
526
+ Ee.SIGNALS = void 0;
527
+ var fa = [
528
+ {
529
+ name: "SIGHUP",
530
+ number: 1,
531
+ action: "terminate",
532
+ description: "Terminal closed",
533
+ standard: "posix"
534
+ },
535
+ {
536
+ name: "SIGINT",
537
+ number: 2,
538
+ action: "terminate",
539
+ description: "User interruption with CTRL-C",
540
+ standard: "ansi"
541
+ },
542
+ {
543
+ name: "SIGQUIT",
544
+ number: 3,
545
+ action: "core",
546
+ description: "User interruption with CTRL-\\",
547
+ standard: "posix"
548
+ },
549
+ {
550
+ name: "SIGILL",
551
+ number: 4,
552
+ action: "core",
553
+ description: "Invalid machine instruction",
554
+ standard: "ansi"
555
+ },
556
+ {
557
+ name: "SIGTRAP",
558
+ number: 5,
559
+ action: "core",
560
+ description: "Debugger breakpoint",
561
+ standard: "posix"
562
+ },
563
+ {
564
+ name: "SIGABRT",
565
+ number: 6,
566
+ action: "core",
567
+ description: "Aborted",
568
+ standard: "ansi"
569
+ },
570
+ {
571
+ name: "SIGIOT",
572
+ number: 6,
573
+ action: "core",
574
+ description: "Aborted",
575
+ standard: "bsd"
576
+ },
577
+ {
578
+ name: "SIGBUS",
579
+ number: 7,
580
+ action: "core",
581
+ description: "Bus error due to misaligned, non-existing address or paging error",
582
+ standard: "bsd"
583
+ },
584
+ {
585
+ name: "SIGEMT",
586
+ number: 7,
587
+ action: "terminate",
588
+ description: "Command should be emulated but is not implemented",
589
+ standard: "other"
590
+ },
591
+ {
592
+ name: "SIGFPE",
593
+ number: 8,
594
+ action: "core",
595
+ description: "Floating point arithmetic error",
596
+ standard: "ansi"
597
+ },
598
+ {
599
+ name: "SIGKILL",
600
+ number: 9,
601
+ action: "terminate",
602
+ description: "Forced termination",
603
+ standard: "posix",
604
+ forced: !0
605
+ },
606
+ {
607
+ name: "SIGUSR1",
608
+ number: 10,
609
+ action: "terminate",
610
+ description: "Application-specific signal",
611
+ standard: "posix"
612
+ },
613
+ {
614
+ name: "SIGSEGV",
615
+ number: 11,
616
+ action: "core",
617
+ description: "Segmentation fault",
618
+ standard: "ansi"
619
+ },
620
+ {
621
+ name: "SIGUSR2",
622
+ number: 12,
623
+ action: "terminate",
624
+ description: "Application-specific signal",
625
+ standard: "posix"
626
+ },
627
+ {
628
+ name: "SIGPIPE",
629
+ number: 13,
630
+ action: "terminate",
631
+ description: "Broken pipe or socket",
632
+ standard: "posix"
633
+ },
634
+ {
635
+ name: "SIGALRM",
636
+ number: 14,
637
+ action: "terminate",
638
+ description: "Timeout or timer",
639
+ standard: "posix"
640
+ },
641
+ {
642
+ name: "SIGTERM",
643
+ number: 15,
644
+ action: "terminate",
645
+ description: "Termination",
646
+ standard: "ansi"
647
+ },
648
+ {
649
+ name: "SIGSTKFLT",
650
+ number: 16,
651
+ action: "terminate",
652
+ description: "Stack is empty or overflowed",
653
+ standard: "other"
654
+ },
655
+ {
656
+ name: "SIGCHLD",
657
+ number: 17,
658
+ action: "ignore",
659
+ description: "Child process terminated, paused or unpaused",
660
+ standard: "posix"
661
+ },
662
+ {
663
+ name: "SIGCLD",
664
+ number: 17,
665
+ action: "ignore",
666
+ description: "Child process terminated, paused or unpaused",
667
+ standard: "other"
668
+ },
669
+ {
670
+ name: "SIGCONT",
671
+ number: 18,
672
+ action: "unpause",
673
+ description: "Unpaused",
674
+ standard: "posix",
675
+ forced: !0
676
+ },
677
+ {
678
+ name: "SIGSTOP",
679
+ number: 19,
680
+ action: "pause",
681
+ description: "Paused",
682
+ standard: "posix",
683
+ forced: !0
684
+ },
685
+ {
686
+ name: "SIGTSTP",
687
+ number: 20,
688
+ action: "pause",
689
+ description: 'Paused using CTRL-Z or "suspend"',
690
+ standard: "posix"
691
+ },
692
+ {
693
+ name: "SIGTTIN",
694
+ number: 21,
695
+ action: "pause",
696
+ description: "Background process cannot read terminal input",
697
+ standard: "posix"
698
+ },
699
+ {
700
+ name: "SIGBREAK",
701
+ number: 21,
702
+ action: "terminate",
703
+ description: "User interruption with CTRL-BREAK",
704
+ standard: "other"
705
+ },
706
+ {
707
+ name: "SIGTTOU",
708
+ number: 22,
709
+ action: "pause",
710
+ description: "Background process cannot write to terminal output",
711
+ standard: "posix"
712
+ },
713
+ {
714
+ name: "SIGURG",
715
+ number: 23,
716
+ action: "ignore",
717
+ description: "Socket received out-of-band data",
718
+ standard: "bsd"
719
+ },
720
+ {
721
+ name: "SIGXCPU",
722
+ number: 24,
723
+ action: "core",
724
+ description: "Process timed out",
725
+ standard: "bsd"
726
+ },
727
+ {
728
+ name: "SIGXFSZ",
729
+ number: 25,
730
+ action: "core",
731
+ description: "File too big",
732
+ standard: "bsd"
733
+ },
734
+ {
735
+ name: "SIGVTALRM",
736
+ number: 26,
737
+ action: "terminate",
738
+ description: "Timeout or timer",
739
+ standard: "bsd"
740
+ },
741
+ {
742
+ name: "SIGPROF",
743
+ number: 27,
744
+ action: "terminate",
745
+ description: "Timeout or timer",
746
+ standard: "bsd"
747
+ },
748
+ {
749
+ name: "SIGWINCH",
750
+ number: 28,
751
+ action: "ignore",
752
+ description: "Terminal window size changed",
753
+ standard: "bsd"
754
+ },
755
+ {
756
+ name: "SIGIO",
757
+ number: 29,
758
+ action: "terminate",
759
+ description: "I/O is available",
760
+ standard: "other"
761
+ },
762
+ {
763
+ name: "SIGPOLL",
764
+ number: 29,
765
+ action: "terminate",
766
+ description: "Watched event",
767
+ standard: "other"
768
+ },
769
+ {
770
+ name: "SIGINFO",
771
+ number: 29,
772
+ action: "ignore",
773
+ description: "Request for process information",
774
+ standard: "other"
775
+ },
776
+ {
777
+ name: "SIGPWR",
778
+ number: 30,
779
+ action: "terminate",
780
+ description: "Device running out of power",
781
+ standard: "systemv"
782
+ },
783
+ {
784
+ name: "SIGSYS",
785
+ number: 31,
786
+ action: "core",
787
+ description: "Invalid system call",
788
+ standard: "other"
789
+ },
790
+ {
791
+ name: "SIGUNUSED",
792
+ number: 31,
793
+ action: "terminate",
794
+ description: "Invalid system call",
795
+ standard: "other"
796
+ }
797
+ ];
798
+ Ee.SIGNALS = fa;
799
+ });
800
+
801
+ // ../node_modules/execa/node_modules/human-signals/build/src/realtime.js
802
+ var Ct = p((q) => {
803
+ "use strict";
804
+ Object.defineProperty(q, "__esModule", { value: !0 });
805
+ q.SIGRTMAX = q.getRealtimeSignals = void 0;
806
+ var pa = /* @__PURE__ */ o(function() {
807
+ let e = _n - Rn + 1;
808
+ return Array.from({ length: e }, da);
809
+ }, "getRealtimeSignals");
810
+ q.getRealtimeSignals = pa;
811
+ var da = /* @__PURE__ */ o(function(e, t) {
812
+ return {
813
+ name: `SIGRT${t + 1}`,
814
+ number: Rn + t,
815
+ action: "terminate",
816
+ description: "Application-specific signal (realtime)",
817
+ standard: "posix"
818
+ };
819
+ }, "getRealtimeSignal"), Rn = 34, _n = 64;
820
+ q.SIGRTMAX = _n;
821
+ });
822
+
823
+ // ../node_modules/execa/node_modules/human-signals/build/src/signals.js
824
+ var Gn = p((Te) => {
825
+ "use strict";
826
+ Object.defineProperty(Te, "__esModule", { value: !0 });
827
+ Te.getSignals = void 0;
828
+ var ma = require("os"), ha = An(), ya = Ct(), ga = /* @__PURE__ */ o(function() {
829
+ let e = (0, ya.getRealtimeSignals)();
830
+ return [...ha.SIGNALS, ...e].map(ba);
831
+ }, "getSignals");
832
+ Te.getSignals = ga;
833
+ var ba = /* @__PURE__ */ o(function({
834
+ name: e,
835
+ number: t,
836
+ description: r,
837
+ action: n,
838
+ forced: i = !1,
839
+ standard: s
840
+ }) {
841
+ let {
842
+ signals: { [e]: a }
843
+ } = ma.constants, c = a !== void 0;
844
+ return { name: e, number: c ? a : t, description: r, supported: c, action: n, forced: i, standard: s };
845
+ }, "normalizeSignal");
846
+ });
847
+
848
+ // ../node_modules/execa/node_modules/human-signals/build/src/main.js
849
+ var Nn = p((W) => {
850
+ "use strict";
851
+ Object.defineProperty(W, "__esModule", { value: !0 });
852
+ W.signalsByNumber = W.signalsByName = void 0;
853
+ var xa = require("os"), jn = Gn(), Sa = Ct(), wa = /* @__PURE__ */ o(function() {
854
+ return (0, jn.getSignals)().reduce(va, {});
855
+ }, "getSignalsByName"), va = /* @__PURE__ */ o(function(e, { name: t, number: r, description: n, supported: i, action: s, forced: a, standard: c }) {
856
+ return {
857
+ ...e,
858
+ [t]: { name: t, number: r, description: n, supported: i, action: s, forced: a, standard: c }
859
+ };
860
+ }, "getSignalByName"), Pa = wa();
861
+ W.signalsByName = Pa;
862
+ var Ea = /* @__PURE__ */ o(function() {
863
+ let e = (0, jn.getSignals)(), t = Sa.SIGRTMAX + 1, r = Array.from({ length: t }, (n, i) => Ta(i, e));
864
+ return Object.assign({}, ...r);
865
+ }, "getSignalsByNumber"), Ta = /* @__PURE__ */ o(function(e, t) {
866
+ let r = ka(e, t);
867
+ if (r === void 0)
868
+ return {};
869
+ let { name: n, description: i, supported: s, action: a, forced: c, standard: u } = r;
870
+ return {
871
+ [e]: {
872
+ name: n,
873
+ number: e,
874
+ description: i,
875
+ supported: s,
876
+ action: a,
877
+ forced: c,
878
+ standard: u
879
+ }
880
+ };
881
+ }, "getSignalByNumber"), ka = /* @__PURE__ */ o(function(e, t) {
882
+ let r = t.find(({ name: n }) => xa.constants.signals[n] === e);
883
+ return r !== void 0 ? r : t.find((n) => n.number === e);
884
+ }, "findSignalByNumber"), Ia = Ea();
885
+ W.signalsByNumber = Ia;
886
+ });
887
+
888
+ // ../node_modules/execa/lib/error.js
889
+ var Dn = p((wf, Bn) => {
890
+ "use strict";
891
+ var { signalsByName: Ca } = Nn(), Oa = /* @__PURE__ */ o(({ timedOut: e, timeout: t, errorCode: r, signal: n, signalDescription: i, exitCode: s,
892
+ isCanceled: a }) => e ? `timed out after ${t} milliseconds` : a ? "was canceled" : r !== void 0 ? `failed with ${r}` : n !== void 0 ? `was\
893
+ killed with ${n} (${i})` : s !== void 0 ? `failed with exit code ${s}` : "failed", "getErrorPrefix"), Aa = /* @__PURE__ */ o(({
894
+ stdout: e,
895
+ stderr: t,
896
+ all: r,
897
+ error: n,
898
+ signal: i,
899
+ exitCode: s,
900
+ command: a,
901
+ escapedCommand: c,
902
+ timedOut: u,
903
+ isCanceled: l,
904
+ killed: f,
905
+ parsed: { options: { timeout: x } }
906
+ }) => {
907
+ s = s === null ? void 0 : s, i = i === null ? void 0 : i;
908
+ let g = i === void 0 ? void 0 : Ca[i].description, m = n && n.code, h = `Command ${Oa({ timedOut: u, timeout: x, errorCode: m, signal: i,
909
+ signalDescription: g, exitCode: s, isCanceled: l })}: ${a}`, S = Object.prototype.toString.call(n) === "[object Error]", k = S ? `${h}
910
+ ${n.message}` : h, E = [k, t, e].filter(Boolean).join(`
911
+ `);
912
+ return S ? (n.originalMessage = n.message, n.message = E) : n = new Error(E), n.shortMessage = k, n.command = a, n.escapedCommand = c, n.
913
+ exitCode = s, n.signal = i, n.signalDescription = g, n.stdout = e, n.stderr = t, r !== void 0 && (n.all = r), "bufferedData" in n && delete n.
914
+ bufferedData, n.failed = !0, n.timedOut = !!u, n.isCanceled = l, n.killed = f && !u, n;
915
+ }, "makeError");
916
+ Bn.exports = Aa;
917
+ });
918
+
919
+ // ../node_modules/execa/lib/stdio.js
920
+ var Ln = p((Pf, Ot) => {
921
+ "use strict";
922
+ var ke = ["stdin", "stdout", "stderr"], Ra = /* @__PURE__ */ o((e) => ke.some((t) => e[t] !== void 0), "hasAlias"), Mn = /* @__PURE__ */ o(
923
+ (e) => {
924
+ if (!e)
925
+ return;
926
+ let { stdio: t } = e;
927
+ if (t === void 0)
928
+ return ke.map((n) => e[n]);
929
+ if (Ra(e))
930
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ke.map((n) => `\`${n}\``).join(", ")}`);
931
+ if (typeof t == "string")
932
+ return t;
933
+ if (!Array.isArray(t))
934
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);
935
+ let r = Math.max(t.length, ke.length);
936
+ return Array.from({ length: r }, (n, i) => t[i]);
937
+ }, "normalizeStdio");
938
+ Ot.exports = Mn;
939
+ Ot.exports.node = (e) => {
940
+ let t = Mn(e);
941
+ return t === "ipc" ? "ipc" : t === void 0 || typeof t == "string" ? [t, t, t, "ipc"] : t.includes("ipc") ? t : [...t, "ipc"];
942
+ };
943
+ });
944
+
945
+ // ../node_modules/signal-exit/signals.js
946
+ var Fn = p((Tf, Ie) => {
947
+ Ie.exports = [
948
+ "SIGABRT",
949
+ "SIGALRM",
950
+ "SIGHUP",
951
+ "SIGINT",
952
+ "SIGTERM"
953
+ ];
954
+ process.platform !== "win32" && Ie.exports.push(
955
+ "SIGVTALRM",
956
+ "SIGXCPU",
957
+ "SIGXFSZ",
958
+ "SIGUSR2",
959
+ "SIGTRAP",
960
+ "SIGSYS",
961
+ "SIGQUIT",
962
+ "SIGIOT"
963
+ // should detect profiler and enable/disable accordingly.
964
+ // see #21
965
+ // 'SIGPROF'
966
+ );
967
+ process.platform === "linux" && Ie.exports.push(
968
+ "SIGIO",
969
+ "SIGPOLL",
970
+ "SIGPWR",
971
+ "SIGSTKFLT",
972
+ "SIGUNUSED"
973
+ );
974
+ });
975
+
976
+ // ../node_modules/signal-exit/index.js
977
+ var Hn = p((kf, z) => {
978
+ var w = global.process, j = /* @__PURE__ */ o(function(e) {
979
+ return e && typeof e == "object" && typeof e.removeListener == "function" && typeof e.emit == "function" && typeof e.reallyExit == "func\
980
+ tion" && typeof e.listeners == "function" && typeof e.kill == "function" && typeof e.pid == "number" && typeof e.on == "function";
981
+ }, "processOk");
982
+ j(w) ? (Un = require("assert"), H = Fn(), $n = /^win/i.test(w.platform), ne = require("events"), typeof ne != "function" && (ne = ne.EventEmitter),
983
+ w.__signal_exit_emitter__ ? P = w.__signal_exit_emitter__ : (P = w.__signal_exit_emitter__ = new ne(), P.count = 0, P.emitted = {}), P.infinite ||
984
+ (P.setMaxListeners(1 / 0), P.infinite = !0), z.exports = function(e, t) {
985
+ if (!j(global.process))
986
+ return function() {
987
+ };
988
+ Un.equal(typeof e, "function", "a callback must be provided for exit handler"), V === !1 && At();
989
+ var r = "exit";
990
+ t && t.alwaysLast && (r = "afterexit");
991
+ var n = /* @__PURE__ */ o(function() {
992
+ P.removeListener(r, e), P.listeners("exit").length === 0 && P.listeners("afterexit").length === 0 && Ce();
993
+ }, "remove");
994
+ return P.on(r, e), n;
995
+ }, Ce = /* @__PURE__ */ o(function() {
996
+ !V || !j(global.process) || (V = !1, H.forEach(function(t) {
997
+ try {
998
+ w.removeListener(t, Oe[t]);
999
+ } catch {
1000
+ }
1001
+ }), w.emit = Ae, w.reallyExit = Rt, P.count -= 1);
1002
+ }, "unload"), z.exports.unload = Ce, N = /* @__PURE__ */ o(function(t, r, n) {
1003
+ P.emitted[t] || (P.emitted[t] = !0, P.emit(t, r, n));
1004
+ }, "emit"), Oe = {}, H.forEach(function(e) {
1005
+ Oe[e] = /* @__PURE__ */ o(function() {
1006
+ if (j(global.process)) {
1007
+ var r = w.listeners(e);
1008
+ r.length === P.count && (Ce(), N("exit", null, e), N("afterexit", null, e), $n && e === "SIGHUP" && (e = "SIGINT"), w.kill(w.pid, e));
1009
+ }
1010
+ }, "listener");
1011
+ }), z.exports.signals = function() {
1012
+ return H;
1013
+ }, V = !1, At = /* @__PURE__ */ o(function() {
1014
+ V || !j(global.process) || (V = !0, P.count += 1, H = H.filter(function(t) {
1015
+ try {
1016
+ return w.on(t, Oe[t]), !0;
1017
+ } catch {
1018
+ return !1;
1019
+ }
1020
+ }), w.emit = Wn, w.reallyExit = qn);
1021
+ }, "load"), z.exports.load = At, Rt = w.reallyExit, qn = /* @__PURE__ */ o(function(t) {
1022
+ j(global.process) && (w.exitCode = t || /* istanbul ignore next */
1023
+ 0, N("exit", w.exitCode, null), N("afterexit", w.exitCode, null), Rt.call(w, w.exitCode));
1024
+ }, "processReallyExit"), Ae = w.emit, Wn = /* @__PURE__ */ o(function(t, r) {
1025
+ if (t === "exit" && j(global.process)) {
1026
+ r !== void 0 && (w.exitCode = r);
1027
+ var n = Ae.apply(this, arguments);
1028
+ return N("exit", w.exitCode, null), N("afterexit", w.exitCode, null), n;
1029
+ } else
1030
+ return Ae.apply(this, arguments);
1031
+ }, "processEmit")) : z.exports = function() {
1032
+ return function() {
1033
+ };
1034
+ };
1035
+ var Un, H, $n, ne, P, Ce, N, Oe, V, At, Rt, qn, Ae, Wn;
1036
+ });
1037
+
1038
+ // ../node_modules/execa/lib/kill.js
1039
+ var zn = p((Cf, Vn) => {
1040
+ "use strict";
1041
+ var _a = require("os"), Ga = Hn(), ja = 1e3 * 5, Na = /* @__PURE__ */ o((e, t = "SIGTERM", r = {}) => {
1042
+ let n = e(t);
1043
+ return Ba(e, t, r, n), n;
1044
+ }, "spawnedKill"), Ba = /* @__PURE__ */ o((e, t, r, n) => {
1045
+ if (!Da(t, r, n))
1046
+ return;
1047
+ let i = La(r), s = setTimeout(() => {
1048
+ e("SIGKILL");
1049
+ }, i);
1050
+ s.unref && s.unref();
1051
+ }, "setKillTimeout"), Da = /* @__PURE__ */ o((e, { forceKillAfterTimeout: t }, r) => Ma(e) && t !== !1 && r, "shouldForceKill"), Ma = /* @__PURE__ */ o(
1052
+ (e) => e === _a.constants.signals.SIGTERM || typeof e == "string" && e.toUpperCase() === "SIGTERM", "isSigterm"), La = /* @__PURE__ */ o(({
1053
+ forceKillAfterTimeout: e = !0 }) => {
1054
+ if (e === !0)
1055
+ return ja;
1056
+ if (!Number.isFinite(e) || e < 0)
1057
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
1058
+ return e;
1059
+ }, "getForceKillAfterTimeout"), Fa = /* @__PURE__ */ o((e, t) => {
1060
+ e.kill() && (t.isCanceled = !0);
1061
+ }, "spawnedCancel"), Ua = /* @__PURE__ */ o((e, t, r) => {
1062
+ e.kill(t), r(Object.assign(new Error("Timed out"), { timedOut: !0, signal: t }));
1063
+ }, "timeoutKill"), $a = /* @__PURE__ */ o((e, { timeout: t, killSignal: r = "SIGTERM" }, n) => {
1064
+ if (t === 0 || t === void 0)
1065
+ return n;
1066
+ let i, s = new Promise((c, u) => {
1067
+ i = setTimeout(() => {
1068
+ Ua(e, r, u);
1069
+ }, t);
1070
+ }), a = n.finally(() => {
1071
+ clearTimeout(i);
1072
+ });
1073
+ return Promise.race([s, a]);
1074
+ }, "setupTimeout"), qa = /* @__PURE__ */ o(({ timeout: e }) => {
1075
+ if (e !== void 0 && (!Number.isFinite(e) || e < 0))
1076
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
1077
+ }, "validateTimeout"), Wa = /* @__PURE__ */ o(async (e, { cleanup: t, detached: r }, n) => {
1078
+ if (!t || r)
1079
+ return n;
1080
+ let i = Ga(() => {
1081
+ e.kill();
1082
+ });
1083
+ return n.finally(() => {
1084
+ i();
1085
+ });
1086
+ }, "setExitHandler");
1087
+ Vn.exports = {
1088
+ spawnedKill: Na,
1089
+ spawnedCancel: Fa,
1090
+ setupTimeout: $a,
1091
+ validateTimeout: qa,
1092
+ setExitHandler: Wa
1093
+ };
1094
+ });
1095
+
1096
+ // ../node_modules/is-stream/index.js
1097
+ var Kn = p((Af, Jn) => {
1098
+ "use strict";
1099
+ var C = /* @__PURE__ */ o((e) => e !== null && typeof e == "object" && typeof e.pipe == "function", "isStream");
1100
+ C.writable = (e) => C(e) && e.writable !== !1 && typeof e._write == "function" && typeof e._writableState == "object";
1101
+ C.readable = (e) => C(e) && e.readable !== !1 && typeof e._read == "function" && typeof e._readableState == "object";
1102
+ C.duplex = (e) => C.writable(e) && C.readable(e);
1103
+ C.transform = (e) => C.duplex(e) && typeof e._transform == "function";
1104
+ Jn.exports = C;
1105
+ });
1106
+
1107
+ // ../node_modules/get-stream/buffer-stream.js
1108
+ var Xn = p((_f, Yn) => {
1109
+ "use strict";
1110
+ var { PassThrough: Ha } = require("stream");
1111
+ Yn.exports = (e) => {
1112
+ e = { ...e };
1113
+ let { array: t } = e, { encoding: r } = e, n = r === "buffer", i = !1;
1114
+ t ? i = !(r || n) : r = r || "utf8", n && (r = null);
1115
+ let s = new Ha({ objectMode: i });
1116
+ r && s.setEncoding(r);
1117
+ let a = 0, c = [];
1118
+ return s.on("data", (u) => {
1119
+ c.push(u), i ? a = c.length : a += u.length;
1120
+ }), s.getBufferedValue = () => t ? c : n ? Buffer.concat(c, a) : c.join(""), s.getBufferedLength = () => a, s;
1121
+ };
1122
+ });
1123
+
1124
+ // ../node_modules/get-stream/index.js
1125
+ var Qn = p((Gf, oe) => {
1126
+ "use strict";
1127
+ var { constants: Va } = require("buffer"), za = require("stream"), { promisify: Ja } = require("util"), Ka = Xn(), Ya = Ja(za.pipeline), Re = class extends Error {
1128
+ static {
1129
+ o(this, "MaxBufferError");
1130
+ }
1131
+ constructor() {
1132
+ super("maxBuffer exceeded"), this.name = "MaxBufferError";
1133
+ }
1134
+ };
1135
+ async function _t(e, t) {
1136
+ if (!e)
1137
+ throw new Error("Expected a stream");
1138
+ t = {
1139
+ maxBuffer: 1 / 0,
1140
+ ...t
1141
+ };
1142
+ let { maxBuffer: r } = t, n = Ka(t);
1143
+ return await new Promise((i, s) => {
1144
+ let a = /* @__PURE__ */ o((c) => {
1145
+ c && n.getBufferedLength() <= Va.MAX_LENGTH && (c.bufferedData = n.getBufferedValue()), s(c);
1146
+ }, "rejectPromise");
1147
+ (async () => {
1148
+ try {
1149
+ await Ya(e, n), i();
1150
+ } catch (c) {
1151
+ a(c);
1152
+ }
1153
+ })(), n.on("data", () => {
1154
+ n.getBufferedLength() > r && a(new Re());
1155
+ });
1156
+ }), n.getBufferedValue();
1157
+ }
1158
+ o(_t, "getStream");
1159
+ oe.exports = _t;
1160
+ oe.exports.buffer = (e, t) => _t(e, { ...t, encoding: "buffer" });
1161
+ oe.exports.array = (e, t) => _t(e, { ...t, array: !0 });
1162
+ oe.exports.MaxBufferError = Re;
1163
+ });
1164
+
1165
+ // ../node_modules/merge-stream/index.js
1166
+ var Gt = p((Nf, Zn) => {
1167
+ "use strict";
1168
+ var { PassThrough: Xa } = require("stream");
1169
+ Zn.exports = function() {
1170
+ var e = [], t = new Xa({ objectMode: !0 });
1171
+ return t.setMaxListeners(0), t.add = r, t.isEmpty = n, t.on("unpipe", i), Array.prototype.slice.call(arguments).forEach(r), t;
1172
+ function r(s) {
1173
+ return Array.isArray(s) ? (s.forEach(r), this) : (e.push(s), s.once("end", i.bind(null, s)), s.once("error", t.emit.bind(t, "error")),
1174
+ s.pipe(t, { end: !1 }), this);
1175
+ }
1176
+ o(r, "add");
1177
+ function n() {
1178
+ return e.length == 0;
1179
+ }
1180
+ o(n, "isEmpty");
1181
+ function i(s) {
1182
+ e = e.filter(function(a) {
1183
+ return a !== s;
1184
+ }), !e.length && t.readable && t.end();
1185
+ }
1186
+ o(i, "remove");
1187
+ };
1188
+ });
1189
+
1190
+ // ../node_modules/execa/lib/stream.js
1191
+ var no = p((Df, ro) => {
1192
+ "use strict";
1193
+ var to = Kn(), eo = Qn(), Qa = Gt(), Za = /* @__PURE__ */ o((e, t) => {
1194
+ t === void 0 || e.stdin === void 0 || (to(t) ? t.pipe(e.stdin) : e.stdin.end(t));
1195
+ }, "handleInput"), ec = /* @__PURE__ */ o((e, { all: t }) => {
1196
+ if (!t || !e.stdout && !e.stderr)
1197
+ return;
1198
+ let r = Qa();
1199
+ return e.stdout && r.add(e.stdout), e.stderr && r.add(e.stderr), r;
1200
+ }, "makeAllStream"), jt = /* @__PURE__ */ o(async (e, t) => {
1201
+ if (e) {
1202
+ e.destroy();
1203
+ try {
1204
+ return await t;
1205
+ } catch (r) {
1206
+ return r.bufferedData;
1207
+ }
1208
+ }
1209
+ }, "getBufferedData"), Nt = /* @__PURE__ */ o((e, { encoding: t, buffer: r, maxBuffer: n }) => {
1210
+ if (!(!e || !r))
1211
+ return t ? eo(e, { encoding: t, maxBuffer: n }) : eo.buffer(e, { maxBuffer: n });
1212
+ }, "getStreamPromise"), tc = /* @__PURE__ */ o(async ({ stdout: e, stderr: t, all: r }, { encoding: n, buffer: i, maxBuffer: s }, a) => {
1213
+ let c = Nt(e, { encoding: n, buffer: i, maxBuffer: s }), u = Nt(t, { encoding: n, buffer: i, maxBuffer: s }), l = Nt(r, { encoding: n, buffer: i,
1214
+ maxBuffer: s * 2 });
1215
+ try {
1216
+ return await Promise.all([a, c, u, l]);
1217
+ } catch (f) {
1218
+ return Promise.all([
1219
+ { error: f, signal: f.signal, timedOut: f.timedOut },
1220
+ jt(e, c),
1221
+ jt(t, u),
1222
+ jt(r, l)
1223
+ ]);
1224
+ }
1225
+ }, "getSpawnedResult"), rc = /* @__PURE__ */ o(({ input: e }) => {
1226
+ if (to(e))
1227
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
1228
+ }, "validateInputSync");
1229
+ ro.exports = {
1230
+ handleInput: Za,
1231
+ makeAllStream: ec,
1232
+ getSpawnedResult: tc,
1233
+ validateInputSync: rc
1234
+ };
1235
+ });
1236
+
1237
+ // ../node_modules/execa/lib/promise.js
1238
+ var io = p((Lf, oo) => {
1239
+ "use strict";
1240
+ var nc = (async () => {
1241
+ })().constructor.prototype, oc = ["then", "catch", "finally"].map((e) => [
1242
+ e,
1243
+ Reflect.getOwnPropertyDescriptor(nc, e)
1244
+ ]), ic = /* @__PURE__ */ o((e, t) => {
1245
+ for (let [r, n] of oc) {
1246
+ let i = typeof t == "function" ? (...s) => Reflect.apply(n.value, t(), s) : n.value.bind(t);
1247
+ Reflect.defineProperty(e, r, { ...n, value: i });
1248
+ }
1249
+ return e;
1250
+ }, "mergePromise"), sc = /* @__PURE__ */ o((e) => new Promise((t, r) => {
1251
+ e.on("exit", (n, i) => {
1252
+ t({ exitCode: n, signal: i });
1253
+ }), e.on("error", (n) => {
1254
+ r(n);
1255
+ }), e.stdin && e.stdin.on("error", (n) => {
1256
+ r(n);
1257
+ });
1258
+ }), "getSpawnedPromise");
1259
+ oo.exports = {
1260
+ mergePromise: ic,
1261
+ getSpawnedPromise: sc
1262
+ };
1263
+ });
1264
+
1265
+ // ../node_modules/execa/lib/command.js
1266
+ var co = p((Uf, ao) => {
1267
+ "use strict";
1268
+ var so = /* @__PURE__ */ o((e, t = []) => Array.isArray(t) ? [e, ...t] : [e], "normalizeArgs"), ac = /^[\w.-]+$/, cc = /"/g, uc = /* @__PURE__ */ o(
1269
+ (e) => typeof e != "string" || ac.test(e) ? e : `"${e.replace(cc, '\\"')}"`, "escapeArg"), lc = /* @__PURE__ */ o((e, t) => so(e, t).join(
1270
+ " "), "joinCommand"), fc = /* @__PURE__ */ o((e, t) => so(e, t).map((r) => uc(r)).join(" "), "getEscapedCommand"), pc = / +/g, dc = /* @__PURE__ */ o(
1271
+ (e) => {
1272
+ let t = [];
1273
+ for (let r of e.trim().split(pc)) {
1274
+ let n = t[t.length - 1];
1275
+ n && n.endsWith("\\") ? t[t.length - 1] = `${n.slice(0, -1)} ${r}` : t.push(r);
1276
+ }
1277
+ return t;
1278
+ }, "parseCommand");
1279
+ ao.exports = {
1280
+ joinCommand: lc,
1281
+ getEscapedCommand: fc,
1282
+ parseCommand: dc
1283
+ };
1284
+ });
1285
+
1286
+ // ../node_modules/execa/index.js
1287
+ var yo = p((qf, J) => {
1288
+ "use strict";
1289
+ var mc = require("path"), Bt = require("child_process"), hc = kt(), yc = vn(), gc = Tn(), bc = On(), _e = Dn(), lo = Ln(), { spawnedKill: xc,
1290
+ spawnedCancel: Sc, setupTimeout: wc, validateTimeout: vc, setExitHandler: Pc } = zn(), { handleInput: Ec, getSpawnedResult: Tc, makeAllStream: kc,
1291
+ validateInputSync: Ic } = no(), { mergePromise: uo, getSpawnedPromise: Cc } = io(), { joinCommand: fo, parseCommand: po, getEscapedCommand: mo } = co(),
1292
+ Oc = 1e3 * 1e3 * 100, Ac = /* @__PURE__ */ o(({ env: e, extendEnv: t, preferLocal: r, localDir: n, execPath: i }) => {
1293
+ let s = t ? { ...process.env, ...e } : e;
1294
+ return r ? gc.env({ env: s, cwd: n, execPath: i }) : s;
1295
+ }, "getEnv"), ho = /* @__PURE__ */ o((e, t, r = {}) => {
1296
+ let n = hc._parse(e, t, r);
1297
+ return e = n.command, t = n.args, r = n.options, r = {
1298
+ maxBuffer: Oc,
1299
+ buffer: !0,
1300
+ stripFinalNewline: !0,
1301
+ extendEnv: !0,
1302
+ preferLocal: !1,
1303
+ localDir: r.cwd || process.cwd(),
1304
+ execPath: process.execPath,
1305
+ encoding: "utf8",
1306
+ reject: !0,
1307
+ cleanup: !0,
1308
+ all: !1,
1309
+ windowsHide: !0,
1310
+ ...r
1311
+ }, r.env = Ac(r), r.stdio = lo(r), process.platform === "win32" && mc.basename(e, ".exe") === "cmd" && t.unshift("/q"), { file: e, args: t,
1312
+ options: r, parsed: n };
1313
+ }, "handleArguments"), ie = /* @__PURE__ */ o((e, t, r) => typeof t != "string" && !Buffer.isBuffer(t) ? r === void 0 ? void 0 : "" : e.stripFinalNewline ?
1314
+ yc(t) : t, "handleOutput"), Ge = /* @__PURE__ */ o((e, t, r) => {
1315
+ let n = ho(e, t, r), i = fo(e, t), s = mo(e, t);
1316
+ vc(n.options);
1317
+ let a;
1318
+ try {
1319
+ a = Bt.spawn(n.file, n.args, n.options);
1320
+ } catch (m) {
1321
+ let y = new Bt.ChildProcess(), h = Promise.reject(_e({
1322
+ error: m,
1323
+ stdout: "",
1324
+ stderr: "",
1325
+ all: "",
1326
+ command: i,
1327
+ escapedCommand: s,
1328
+ parsed: n,
1329
+ timedOut: !1,
1330
+ isCanceled: !1,
1331
+ killed: !1
1332
+ }));
1333
+ return uo(y, h);
1334
+ }
1335
+ let c = Cc(a), u = wc(a, n.options, c), l = Pc(a, n.options, u), f = { isCanceled: !1 };
1336
+ a.kill = xc.bind(null, a.kill.bind(a)), a.cancel = Sc.bind(null, a, f);
1337
+ let g = bc(/* @__PURE__ */ o(async () => {
1338
+ let [{ error: m, exitCode: y, signal: h, timedOut: S }, k, E, O] = await Tc(a, n.options, l), _ = ie(n.options, k), G = ie(n.options, E),
1339
+ d = ie(n.options, O);
1340
+ if (m || y !== 0 || h !== null) {
1341
+ let v = _e({
1342
+ error: m,
1343
+ exitCode: y,
1344
+ signal: h,
1345
+ stdout: _,
1346
+ stderr: G,
1347
+ all: d,
1348
+ command: i,
1349
+ escapedCommand: s,
1350
+ parsed: n,
1351
+ timedOut: S,
1352
+ isCanceled: f.isCanceled,
1353
+ killed: a.killed
1354
+ });
1355
+ if (!n.options.reject)
1356
+ return v;
1357
+ throw v;
1358
+ }
1359
+ return {
1360
+ command: i,
1361
+ escapedCommand: s,
1362
+ exitCode: 0,
1363
+ stdout: _,
1364
+ stderr: G,
1365
+ all: d,
1366
+ failed: !1,
1367
+ timedOut: !1,
1368
+ isCanceled: !1,
1369
+ killed: !1
1370
+ };
1371
+ }, "handlePromise"));
1372
+ return Ec(a, n.options.input), a.all = kc(a, n.options), uo(a, g);
1373
+ }, "execa");
1374
+ J.exports = Ge;
1375
+ J.exports.sync = (e, t, r) => {
1376
+ let n = ho(e, t, r), i = fo(e, t), s = mo(e, t);
1377
+ Ic(n.options);
1378
+ let a;
1379
+ try {
1380
+ a = Bt.spawnSync(n.file, n.args, n.options);
1381
+ } catch (l) {
1382
+ throw _e({
1383
+ error: l,
1384
+ stdout: "",
1385
+ stderr: "",
1386
+ all: "",
1387
+ command: i,
1388
+ escapedCommand: s,
1389
+ parsed: n,
1390
+ timedOut: !1,
1391
+ isCanceled: !1,
1392
+ killed: !1
1393
+ });
1394
+ }
1395
+ let c = ie(n.options, a.stdout, a.error), u = ie(n.options, a.stderr, a.error);
1396
+ if (a.error || a.status !== 0 || a.signal !== null) {
1397
+ let l = _e({
1398
+ stdout: c,
1399
+ stderr: u,
1400
+ error: a.error,
1401
+ signal: a.signal,
1402
+ exitCode: a.status,
1403
+ command: i,
1404
+ escapedCommand: s,
1405
+ parsed: n,
1406
+ timedOut: a.error && a.error.code === "ETIMEDOUT",
1407
+ isCanceled: !1,
1408
+ killed: a.signal !== null
1409
+ });
1410
+ if (!n.options.reject)
1411
+ return l;
1412
+ throw l;
1413
+ }
1414
+ return {
1415
+ command: i,
1416
+ escapedCommand: s,
1417
+ exitCode: 0,
1418
+ stdout: c,
1419
+ stderr: u,
1420
+ failed: !1,
1421
+ timedOut: !1,
1422
+ isCanceled: !1,
1423
+ killed: !1
1424
+ };
1425
+ };
1426
+ J.exports.command = (e, t) => {
1427
+ let [r, ...n] = po(e);
1428
+ return Ge(r, n, t);
1429
+ };
1430
+ J.exports.commandSync = (e, t) => {
1431
+ let [r, ...n] = po(e);
1432
+ return Ge.sync(r, n, t);
1433
+ };
1434
+ J.exports.node = (e, t, r = {}) => {
1435
+ t && !Array.isArray(t) && typeof t == "object" && (r = t, t = []);
1436
+ let n = lo.node(r), i = process.execArgv.filter((c) => !c.startsWith("--inspect")), {
1437
+ nodePath: s = process.execPath,
1438
+ nodeOptions: a = i
1439
+ } = r;
1440
+ return Ge(
1441
+ s,
1442
+ [
1443
+ ...a,
1444
+ e,
1445
+ ...Array.isArray(t) ? t : []
1446
+ ],
1447
+ {
1448
+ ...r,
1449
+ stdin: void 0,
1450
+ stdout: void 0,
1451
+ stderr: void 0,
1452
+ stdio: n,
1453
+ shell: !1
1454
+ }
1455
+ );
1456
+ };
1457
+ });
1458
+
1459
+ // ../node_modules/detect-package-manager/dist/index.js
1460
+ var So = p((xo) => {
1461
+ var Rc = Object.create, Be = Object.defineProperty, _c = Object.getOwnPropertyDescriptor, Gc = Object.getOwnPropertyNames, jc = Object.getPrototypeOf,
1462
+ Nc = Object.prototype.hasOwnProperty, go = /* @__PURE__ */ o((e) => Be(e, "__esModule", { value: !0 }), "__markAsModule"), Bc = /* @__PURE__ */ o(
1463
+ (e, t) => {
1464
+ go(e);
1465
+ for (var r in t)
1466
+ Be(e, r, { get: t[r], enumerable: !0 });
1467
+ }, "__export"), Dc = /* @__PURE__ */ o((e, t, r) => {
1468
+ if (t && typeof t == "object" || typeof t == "function")
1469
+ for (let n of Gc(t))
1470
+ !Nc.call(e, n) && n !== "default" && Be(e, n, { get: /* @__PURE__ */ o(() => t[n], "get"), enumerable: !(r = _c(t, n)) || r.enumerable });
1471
+ return e;
1472
+ }, "__reExport"), Mt = /* @__PURE__ */ o((e) => Dc(go(Be(e != null ? Rc(jc(e)) : {}, "default", e && e.__esModule && "default" in e ? { get: /* @__PURE__ */ o(
1473
+ () => e.default, "get"), enumerable: !0 } : { value: e, enumerable: !0 })), e), "__toModule");
1474
+ Bc(xo, {
1475
+ clearCache: /* @__PURE__ */ o(() => $c, "clearCache"),
1476
+ detect: /* @__PURE__ */ o(() => Fc, "detect"),
1477
+ getNpmVersion: /* @__PURE__ */ o(() => Uc, "getNpmVersion")
1478
+ });
1479
+ var Mc = Mt(require("fs")), je = Mt(require("path")), bo = Mt(yo());
1480
+ async function Ne(e) {
1481
+ try {
1482
+ return await Mc.promises.access(e), !0;
1483
+ } catch {
1484
+ return !1;
1485
+ }
1486
+ }
1487
+ o(Ne, "pathExists");
1488
+ var B = /* @__PURE__ */ new Map();
1489
+ function Dt(e) {
1490
+ let t = `has_global_${e}`;
1491
+ return B.has(t) ? Promise.resolve(B.get(t)) : (0, bo.default)(e, ["--version"]).then((r) => /^\d+.\d+.\d+$/.test(r.stdout)).then((r) => (B.
1492
+ set(t, r), r)).catch(() => !1);
1493
+ }
1494
+ o(Dt, "hasGlobalInstallation");
1495
+ function Lc(e = ".") {
1496
+ let t = `lockfile_${e}`;
1497
+ return B.has(t) ? Promise.resolve(B.get(t)) : Promise.all([
1498
+ Ne((0, je.resolve)(e, "yarn.lock")),
1499
+ Ne((0, je.resolve)(e, "package-lock.json")),
1500
+ Ne((0, je.resolve)(e, "pnpm-lock.yaml")),
1501
+ Ne((0, je.resolve)(e, "bun.lockb"))
1502
+ ]).then(([r, n, i, s]) => {
1503
+ let a = null;
1504
+ return r ? a = "yarn" : i ? a = "pnpm" : s ? a = "bun" : n && (a = "npm"), B.set(t, a), a;
1505
+ });
1506
+ }
1507
+ o(Lc, "getTypeofLockFile");
1508
+ var Fc = /* @__PURE__ */ o(async ({
1509
+ cwd: e,
1510
+ includeGlobalBun: t
1511
+ } = {}) => {
1512
+ let r = await Lc(e);
1513
+ if (r)
1514
+ return r;
1515
+ let [n, i, s] = await Promise.all([
1516
+ Dt("yarn"),
1517
+ Dt("pnpm"),
1518
+ t && Dt("bun")
1519
+ ]);
1520
+ return n ? "yarn" : i ? "pnpm" : s ? "bun" : "npm";
1521
+ }, "detect");
1522
+ function Uc(e) {
1523
+ return (0, bo.default)(e || "npm", ["--version"]).then((t) => t.stdout);
1524
+ }
1525
+ o(Uc, "getNpmVersion");
1526
+ function $c() {
1527
+ return B.clear();
1528
+ }
1529
+ o($c, "clearCache");
1530
+ });
1531
+
1532
+ // ../node_modules/walk-up-path/dist/cjs/index.js
1533
+ var vo = p((De) => {
1534
+ "use strict";
1535
+ Object.defineProperty(De, "__esModule", { value: !0 });
1536
+ De.walkUp = void 0;
1537
+ var wo = require("path"), qc = /* @__PURE__ */ o(function* (e) {
1538
+ for (e = (0, wo.resolve)(e); e; ) {
1539
+ yield e;
1540
+ let t = (0, wo.dirname)(e);
1541
+ if (t === e)
1542
+ break;
1543
+ e = t;
1544
+ }
1545
+ }, "walkUp");
1546
+ De.walkUp = qc;
1547
+ });
1548
+
1549
+ // ../node_modules/common-path-prefix/index.js
1550
+ var Gi = p((Wd, _i) => {
1551
+ "use strict";
1552
+ var { sep: zu } = require("path"), Ju = /* @__PURE__ */ o((e) => {
1553
+ for (let t of e) {
1554
+ let r = /(\/|\\)/.exec(t);
1555
+ if (r !== null) return r[0];
1556
+ }
1557
+ return zu;
1558
+ }, "determineSeparator");
1559
+ _i.exports = /* @__PURE__ */ o(function(t, r = Ju(t)) {
1560
+ let [n = "", ...i] = t;
1561
+ if (n === "" || i.length === 0) return "";
1562
+ let s = n.split(r), a = s.length;
1563
+ for (let u of i) {
1564
+ let l = u.split(r);
1565
+ for (let f = 0; f < a; f++)
1566
+ l[f] !== s[f] && (a = f);
1567
+ if (a === 0) return "";
1568
+ }
1569
+ let c = s.slice(0, a).join(r);
1570
+ return c.endsWith(r) ? c : c + r;
1571
+ }, "commonPathPrefix");
1572
+ });
1573
+
1574
+ // ../node_modules/fetch-retry/index.js
1575
+ var ds = p((Wh, ps) => {
1576
+ "use strict";
1577
+ ps.exports = function(e, t) {
1578
+ if (t = t || {}, typeof e != "function")
1579
+ throw new R("fetch must be a function");
1580
+ if (typeof t != "object")
1581
+ throw new R("defaults must be an object");
1582
+ if (t.retries !== void 0 && !at(t.retries))
1583
+ throw new R("retries must be a positive integer");
1584
+ if (t.retryDelay !== void 0 && !at(t.retryDelay) && typeof t.retryDelay != "function")
1585
+ throw new R("retryDelay must be a positive integer or a function returning a positive integer");
1586
+ if (t.retryOn !== void 0 && !Array.isArray(t.retryOn) && typeof t.retryOn != "function")
1587
+ throw new R("retryOn property expects an array or function");
1588
+ var r = {
1589
+ retries: 3,
1590
+ retryDelay: 1e3,
1591
+ retryOn: []
1592
+ };
1593
+ return t = Object.assign(r, t), /* @__PURE__ */ o(function(i, s) {
1594
+ var a = t.retries, c = t.retryDelay, u = t.retryOn;
1595
+ if (s && s.retries !== void 0)
1596
+ if (at(s.retries))
1597
+ a = s.retries;
1598
+ else
1599
+ throw new R("retries must be a positive integer");
1600
+ if (s && s.retryDelay !== void 0)
1601
+ if (at(s.retryDelay) || typeof s.retryDelay == "function")
1602
+ c = s.retryDelay;
1603
+ else
1604
+ throw new R("retryDelay must be a positive integer or a function returning a positive integer");
1605
+ if (s && s.retryOn)
1606
+ if (Array.isArray(s.retryOn) || typeof s.retryOn == "function")
1607
+ u = s.retryOn;
1608
+ else
1609
+ throw new R("retryOn property expects an array or function");
1610
+ return new Promise(function(l, f) {
1611
+ var x = /* @__PURE__ */ o(function(m) {
1612
+ var y = typeof Request < "u" && i instanceof Request ? i.clone() : i;
1613
+ e(y, s).then(function(h) {
1614
+ if (Array.isArray(u) && u.indexOf(h.status) === -1)
1615
+ l(h);
1616
+ else if (typeof u == "function")
1617
+ try {
1618
+ return Promise.resolve(u(m, null, h)).then(function(S) {
1619
+ S ? g(m, null, h) : l(h);
1620
+ }).catch(f);
1621
+ } catch (S) {
1622
+ f(S);
1623
+ }
1624
+ else
1625
+ m < a ? g(m, null, h) : l(h);
1626
+ }).catch(function(h) {
1627
+ if (typeof u == "function")
1628
+ try {
1629
+ Promise.resolve(u(m, h, null)).then(function(S) {
1630
+ S ? g(m, h, null) : f(h);
1631
+ }).catch(function(S) {
1632
+ f(S);
1633
+ });
1634
+ } catch (S) {
1635
+ f(S);
1636
+ }
1637
+ else m < a ? g(m, h, null) : f(h);
1638
+ });
1639
+ }, "wrappedFetch");
1640
+ function g(m, y, h) {
1641
+ var S = typeof c == "function" ? c(m, y, h) : c;
1642
+ setTimeout(function() {
1643
+ x(++m);
1644
+ }, S);
1645
+ }
1646
+ o(g, "retry"), x(0);
1647
+ });
1648
+ }, "fetchRetry");
1649
+ };
1650
+ function at(e) {
1651
+ return Number.isInteger(e) && e >= 0;
1652
+ }
1653
+ o(at, "isPositiveInteger");
1654
+ function R(e) {
1655
+ this.name = "ArgumentError", this.message = e;
1656
+ }
1657
+ o(R, "ArgumentError");
1658
+ });
1659
+
1660
+ // src/telemetry/index.ts
1661
+ var Il = {};
1662
+ Gs(Il, {
1663
+ addToGlobalContext: () => ks,
1664
+ cleanPaths: () => F,
1665
+ computeStorybookMetadata: () => fs,
1666
+ getPrecedingUpgrade: () => vs,
1667
+ getStorybookMetadata: () => Sr,
1668
+ isExampleStoryId: () => Tl,
1669
+ metaFrameworks: () => br,
1670
+ oneWayHash: () => ct,
1671
+ removeAnsiEscapeCodes: () => mt,
1672
+ sanitizeAddonName: () => xr,
1673
+ sanitizeError: () => ee,
1674
+ telemetry: () => kl
1675
+ });
1676
+ module.exports = js(Il);
1677
+ var kr = require("storybook/internal/node-logger");
1678
+
1679
+ // src/telemetry/notify.ts
1680
+ var dt = require("storybook/internal/common"), Se = b(Ar(), 1);
1681
+ var Rr = "telemetry-notification-date", L = console, _r = /* @__PURE__ */ o(async () => {
1682
+ await dt.cache.get(Rr, null) || (dt.cache.set(Rr, Date.now()), L.log(), L.log(
1683
+ `${Se.default.magenta(
1684
+ Se.default.bold("attention")
1685
+ )} => Storybook now collects completely anonymous telemetry regarding usage.`
1686
+ ), L.log("This information is used to shape Storybook's roadmap and prioritize features."), L.log(
1687
+ "You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"
1688
+ ), L.log(Se.default.cyan("https://storybook.js.org/telemetry")), L.log());
1689
+ }, "notify");
1690
+
1691
+ // src/telemetry/sanitize.ts
1692
+ var ht = b(require("node:path"), 1);
1693
+ function Gr(e) {
1694
+ return e.replace(/[-[/{}()*+?.\\^$|]/g, "\\$&");
1695
+ }
1696
+ o(Gr, "regexpEscape");
1697
+ function mt(e = "") {
1698
+ return e.replace(/\u001B\[[0-9;]*m/g, "");
1699
+ }
1700
+ o(mt, "removeAnsiEscapeCodes");
1701
+ function F(e, t = ht.default.sep) {
1702
+ if (!e)
1703
+ return e;
1704
+ let r = process.cwd().split(t);
1705
+ for (; r.length > 1; ) {
1706
+ let n = r.join(t), i = new RegExp(Gr(n), "gi");
1707
+ e = e.replace(i, "$SNIP");
1708
+ let s = r.join(t + t), a = new RegExp(Gr(s), "gi");
1709
+ e = e.replace(a, "$SNIP"), r.pop();
1710
+ }
1711
+ return e;
1712
+ }
1713
+ o(F, "cleanPaths");
1714
+ function ee(e, t = ht.default.sep) {
1715
+ try {
1716
+ e = {
1717
+ ...JSON.parse(JSON.stringify(e)),
1718
+ message: mt(e.message),
1719
+ stack: mt(e.stack),
1720
+ cause: e.cause,
1721
+ name: e.name
1722
+ };
1723
+ let r = F(JSON.stringify(e), t);
1724
+ return JSON.parse(r);
1725
+ } catch (r) {
1726
+ return `Sanitization error: ${r?.message}`;
1727
+ }
1728
+ }
1729
+ o(ee, "sanitizeError");
1730
+
1731
+ // src/telemetry/storybook-metadata.ts
1732
+ var us = require("node:path"), A = require("storybook/internal/common"), ls = require("storybook/internal/csf-tools"), st = b(So(), 1);
1733
+
1734
+ // ../node_modules/fd-package-json/dist/esm/main.js
1735
+ var Po = b(vo(), 1), Eo = require("node:path"), Me = require("node:fs/promises"), To = require("node:fs");
1736
+ async function Wc(e) {
1737
+ try {
1738
+ return (await (0, Me.stat)(e)).isFile();
1739
+ } catch {
1740
+ return !1;
1741
+ }
1742
+ }
1743
+ o(Wc, "fileExists");
1744
+ async function Lt(e) {
1745
+ for (let t of (0, Po.walkUp)(e)) {
1746
+ let r = (0, Eo.resolve)(t, "package.json");
1747
+ if (await Wc(r))
1748
+ return r;
1749
+ }
1750
+ return null;
1751
+ }
1752
+ o(Lt, "findPackagePath");
1753
+ async function ko(e) {
1754
+ let t = await Lt(e);
1755
+ if (!t)
1756
+ return null;
1757
+ try {
1758
+ let r = await (0, Me.readFile)(t, { encoding: "utf8" });
1759
+ return JSON.parse(r);
1760
+ } catch {
1761
+ return null;
1762
+ }
1763
+ }
1764
+ o(ko, "findPackage");
1765
+
1766
+ // src/telemetry/get-application-file-count.ts
1767
+ var Ki = require("node:path");
1768
+
1769
+ // src/telemetry/exec-command-count-lines.ts
1770
+ var Ai = require("node:readline");
1771
+
1772
+ // node_modules/execa/index.js
1773
+ var Pi = require("node:buffer"), Ei = b(require("node:path"), 1), Qe = b(require("node:child_process"), 1), ue = b(require("node:process"), 1),
1774
+ Ti = b(kt(), 1);
1775
+
1776
+ // ../node_modules/strip-final-newline/index.js
1777
+ function Ft(e) {
1778
+ let t = typeof e == "string" ? `
1779
+ ` : 10, r = typeof e == "string" ? "\r" : 13;
1780
+ return e[e.length - 1] === t && (e = e.slice(0, -1)), e[e.length - 1] === r && (e = e.slice(0, -1)), e;
1781
+ }
1782
+ o(Ft, "stripFinalNewline");
1783
+
1784
+ // node_modules/npm-run-path/index.js
1785
+ var se = b(require("node:process"), 1), K = b(require("node:path"), 1), Io = b(require("node:url"), 1);
1786
+
1787
+ // node_modules/path-key/index.js
1788
+ function Le(e = {}) {
1789
+ let {
1790
+ env: t = process.env,
1791
+ platform: r = process.platform
1792
+ } = e;
1793
+ return r !== "win32" ? "PATH" : Object.keys(t).reverse().find((n) => n.toUpperCase() === "PATH") || "Path";
1794
+ }
1795
+ o(Le, "pathKey");
1796
+
1797
+ // node_modules/npm-run-path/index.js
1798
+ function Hc(e = {}) {
1799
+ let {
1800
+ cwd: t = se.default.cwd(),
1801
+ path: r = se.default.env[Le()],
1802
+ execPath: n = se.default.execPath
1803
+ } = e, i, s = t instanceof URL ? Io.default.fileURLToPath(t) : t, a = K.default.resolve(s), c = [];
1804
+ for (; i !== a; )
1805
+ c.push(K.default.join(a, "node_modules/.bin")), i = a, a = K.default.resolve(a, "..");
1806
+ return c.push(K.default.resolve(s, n, "..")), [...c, r].join(K.default.delimiter);
1807
+ }
1808
+ o(Hc, "npmRunPath");
1809
+ function Co({ env: e = se.default.env, ...t } = {}) {
1810
+ e = { ...e };
1811
+ let r = Le({ env: e });
1812
+ return t.path = e[r], e[r] = Hc(t), e;
1813
+ }
1814
+ o(Co, "npmRunPathEnv");
1815
+
1816
+ // node_modules/mimic-fn/index.js
1817
+ var Vc = /* @__PURE__ */ o((e, t, r, n) => {
1818
+ if (r === "length" || r === "prototype" || r === "arguments" || r === "caller")
1819
+ return;
1820
+ let i = Object.getOwnPropertyDescriptor(e, r), s = Object.getOwnPropertyDescriptor(t, r);
1821
+ !zc(i, s) && n || Object.defineProperty(e, r, s);
1822
+ }, "copyProperty"), zc = /* @__PURE__ */ o(function(e, t) {
1823
+ return e === void 0 || e.configurable || e.writable === t.writable && e.enumerable === t.enumerable && e.configurable === t.configurable &&
1824
+ (e.writable || e.value === t.value);
1825
+ }, "canCopyProperty"), Jc = /* @__PURE__ */ o((e, t) => {
1826
+ let r = Object.getPrototypeOf(t);
1827
+ r !== Object.getPrototypeOf(e) && Object.setPrototypeOf(e, r);
1828
+ }, "changePrototype"), Kc = /* @__PURE__ */ o((e, t) => `/* Wrapped ${e}*/
1829
+ ${t}`, "wrappedToString"), Yc = Object.getOwnPropertyDescriptor(Function.prototype, "toString"), Xc = Object.getOwnPropertyDescriptor(Function.
1830
+ prototype.toString, "name"), Qc = /* @__PURE__ */ o((e, t, r) => {
1831
+ let n = r === "" ? "" : `with ${r.trim()}() `, i = Kc.bind(null, n, t.toString());
1832
+ Object.defineProperty(i, "name", Xc), Object.defineProperty(e, "toString", { ...Yc, value: i });
1833
+ }, "changeToString");
1834
+ function Ut(e, t, { ignoreNonConfigurable: r = !1 } = {}) {
1835
+ let { name: n } = e;
1836
+ for (let i of Reflect.ownKeys(t))
1837
+ Vc(e, t, i, r);
1838
+ return Jc(e, t), Qc(e, t, n), e;
1839
+ }
1840
+ o(Ut, "mimicFunction");
1841
+
1842
+ // node_modules/onetime/index.js
1843
+ var Fe = /* @__PURE__ */ new WeakMap(), Oo = /* @__PURE__ */ o((e, t = {}) => {
1844
+ if (typeof e != "function")
1845
+ throw new TypeError("Expected a function");
1846
+ let r, n = 0, i = e.displayName || e.name || "<anonymous>", s = /* @__PURE__ */ o(function(...a) {
1847
+ if (Fe.set(s, ++n), n === 1)
1848
+ r = e.apply(this, a), e = null;
1849
+ else if (t.throw === !0)
1850
+ throw new Error(`Function \`${i}\` can only be called once`);
1851
+ return r;
1852
+ }, "onetime");
1853
+ return Ut(s, e), Fe.set(s, n), s;
1854
+ }, "onetime");
1855
+ Oo.callCount = (e) => {
1856
+ if (!Fe.has(e))
1857
+ throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);
1858
+ return Fe.get(e);
1859
+ };
1860
+ var Ao = Oo;
1861
+
1862
+ // node_modules/execa/lib/error.js
1863
+ var Do = b(require("node:process"), 1);
1864
+
1865
+ // node_modules/human-signals/build/src/main.js
1866
+ var No = require("node:os");
1867
+
1868
+ // node_modules/human-signals/build/src/realtime.js
1869
+ var Ro = /* @__PURE__ */ o(() => {
1870
+ let e = $t - _o + 1;
1871
+ return Array.from({ length: e }, Zc);
1872
+ }, "getRealtimeSignals"), Zc = /* @__PURE__ */ o((e, t) => ({
1873
+ name: `SIGRT${t + 1}`,
1874
+ number: _o + t,
1875
+ action: "terminate",
1876
+ description: "Application-specific signal (realtime)",
1877
+ standard: "posix"
1878
+ }), "getRealtimeSignal"), _o = 34, $t = 64;
1879
+
1880
+ // node_modules/human-signals/build/src/signals.js
1881
+ var jo = require("node:os");
1882
+
1883
+ // node_modules/human-signals/build/src/core.js
1884
+ var Go = [
1885
+ {
1886
+ name: "SIGHUP",
1887
+ number: 1,
1888
+ action: "terminate",
1889
+ description: "Terminal closed",
1890
+ standard: "posix"
1891
+ },
1892
+ {
1893
+ name: "SIGINT",
1894
+ number: 2,
1895
+ action: "terminate",
1896
+ description: "User interruption with CTRL-C",
1897
+ standard: "ansi"
1898
+ },
1899
+ {
1900
+ name: "SIGQUIT",
1901
+ number: 3,
1902
+ action: "core",
1903
+ description: "User interruption with CTRL-\\",
1904
+ standard: "posix"
1905
+ },
1906
+ {
1907
+ name: "SIGILL",
1908
+ number: 4,
1909
+ action: "core",
1910
+ description: "Invalid machine instruction",
1911
+ standard: "ansi"
1912
+ },
1913
+ {
1914
+ name: "SIGTRAP",
1915
+ number: 5,
1916
+ action: "core",
1917
+ description: "Debugger breakpoint",
1918
+ standard: "posix"
1919
+ },
1920
+ {
1921
+ name: "SIGABRT",
1922
+ number: 6,
1923
+ action: "core",
1924
+ description: "Aborted",
1925
+ standard: "ansi"
1926
+ },
1927
+ {
1928
+ name: "SIGIOT",
1929
+ number: 6,
1930
+ action: "core",
1931
+ description: "Aborted",
1932
+ standard: "bsd"
1933
+ },
1934
+ {
1935
+ name: "SIGBUS",
1936
+ number: 7,
1937
+ action: "core",
1938
+ description: "Bus error due to misaligned, non-existing address or paging error",
1939
+ standard: "bsd"
1940
+ },
1941
+ {
1942
+ name: "SIGEMT",
1943
+ number: 7,
1944
+ action: "terminate",
1945
+ description: "Command should be emulated but is not implemented",
1946
+ standard: "other"
1947
+ },
1948
+ {
1949
+ name: "SIGFPE",
1950
+ number: 8,
1951
+ action: "core",
1952
+ description: "Floating point arithmetic error",
1953
+ standard: "ansi"
1954
+ },
1955
+ {
1956
+ name: "SIGKILL",
1957
+ number: 9,
1958
+ action: "terminate",
1959
+ description: "Forced termination",
1960
+ standard: "posix",
1961
+ forced: !0
1962
+ },
1963
+ {
1964
+ name: "SIGUSR1",
1965
+ number: 10,
1966
+ action: "terminate",
1967
+ description: "Application-specific signal",
1968
+ standard: "posix"
1969
+ },
1970
+ {
1971
+ name: "SIGSEGV",
1972
+ number: 11,
1973
+ action: "core",
1974
+ description: "Segmentation fault",
1975
+ standard: "ansi"
1976
+ },
1977
+ {
1978
+ name: "SIGUSR2",
1979
+ number: 12,
1980
+ action: "terminate",
1981
+ description: "Application-specific signal",
1982
+ standard: "posix"
1983
+ },
1984
+ {
1985
+ name: "SIGPIPE",
1986
+ number: 13,
1987
+ action: "terminate",
1988
+ description: "Broken pipe or socket",
1989
+ standard: "posix"
1990
+ },
1991
+ {
1992
+ name: "SIGALRM",
1993
+ number: 14,
1994
+ action: "terminate",
1995
+ description: "Timeout or timer",
1996
+ standard: "posix"
1997
+ },
1998
+ {
1999
+ name: "SIGTERM",
2000
+ number: 15,
2001
+ action: "terminate",
2002
+ description: "Termination",
2003
+ standard: "ansi"
2004
+ },
2005
+ {
2006
+ name: "SIGSTKFLT",
2007
+ number: 16,
2008
+ action: "terminate",
2009
+ description: "Stack is empty or overflowed",
2010
+ standard: "other"
2011
+ },
2012
+ {
2013
+ name: "SIGCHLD",
2014
+ number: 17,
2015
+ action: "ignore",
2016
+ description: "Child process terminated, paused or unpaused",
2017
+ standard: "posix"
2018
+ },
2019
+ {
2020
+ name: "SIGCLD",
2021
+ number: 17,
2022
+ action: "ignore",
2023
+ description: "Child process terminated, paused or unpaused",
2024
+ standard: "other"
2025
+ },
2026
+ {
2027
+ name: "SIGCONT",
2028
+ number: 18,
2029
+ action: "unpause",
2030
+ description: "Unpaused",
2031
+ standard: "posix",
2032
+ forced: !0
2033
+ },
2034
+ {
2035
+ name: "SIGSTOP",
2036
+ number: 19,
2037
+ action: "pause",
2038
+ description: "Paused",
2039
+ standard: "posix",
2040
+ forced: !0
2041
+ },
2042
+ {
2043
+ name: "SIGTSTP",
2044
+ number: 20,
2045
+ action: "pause",
2046
+ description: 'Paused using CTRL-Z or "suspend"',
2047
+ standard: "posix"
2048
+ },
2049
+ {
2050
+ name: "SIGTTIN",
2051
+ number: 21,
2052
+ action: "pause",
2053
+ description: "Background process cannot read terminal input",
2054
+ standard: "posix"
2055
+ },
2056
+ {
2057
+ name: "SIGBREAK",
2058
+ number: 21,
2059
+ action: "terminate",
2060
+ description: "User interruption with CTRL-BREAK",
2061
+ standard: "other"
2062
+ },
2063
+ {
2064
+ name: "SIGTTOU",
2065
+ number: 22,
2066
+ action: "pause",
2067
+ description: "Background process cannot write to terminal output",
2068
+ standard: "posix"
2069
+ },
2070
+ {
2071
+ name: "SIGURG",
2072
+ number: 23,
2073
+ action: "ignore",
2074
+ description: "Socket received out-of-band data",
2075
+ standard: "bsd"
2076
+ },
2077
+ {
2078
+ name: "SIGXCPU",
2079
+ number: 24,
2080
+ action: "core",
2081
+ description: "Process timed out",
2082
+ standard: "bsd"
2083
+ },
2084
+ {
2085
+ name: "SIGXFSZ",
2086
+ number: 25,
2087
+ action: "core",
2088
+ description: "File too big",
2089
+ standard: "bsd"
2090
+ },
2091
+ {
2092
+ name: "SIGVTALRM",
2093
+ number: 26,
2094
+ action: "terminate",
2095
+ description: "Timeout or timer",
2096
+ standard: "bsd"
2097
+ },
2098
+ {
2099
+ name: "SIGPROF",
2100
+ number: 27,
2101
+ action: "terminate",
2102
+ description: "Timeout or timer",
2103
+ standard: "bsd"
2104
+ },
2105
+ {
2106
+ name: "SIGWINCH",
2107
+ number: 28,
2108
+ action: "ignore",
2109
+ description: "Terminal window size changed",
2110
+ standard: "bsd"
2111
+ },
2112
+ {
2113
+ name: "SIGIO",
2114
+ number: 29,
2115
+ action: "terminate",
2116
+ description: "I/O is available",
2117
+ standard: "other"
2118
+ },
2119
+ {
2120
+ name: "SIGPOLL",
2121
+ number: 29,
2122
+ action: "terminate",
2123
+ description: "Watched event",
2124
+ standard: "other"
2125
+ },
2126
+ {
2127
+ name: "SIGINFO",
2128
+ number: 29,
2129
+ action: "ignore",
2130
+ description: "Request for process information",
2131
+ standard: "other"
2132
+ },
2133
+ {
2134
+ name: "SIGPWR",
2135
+ number: 30,
2136
+ action: "terminate",
2137
+ description: "Device running out of power",
2138
+ standard: "systemv"
2139
+ },
2140
+ {
2141
+ name: "SIGSYS",
2142
+ number: 31,
2143
+ action: "core",
2144
+ description: "Invalid system call",
2145
+ standard: "other"
2146
+ },
2147
+ {
2148
+ name: "SIGUNUSED",
2149
+ number: 31,
2150
+ action: "terminate",
2151
+ description: "Invalid system call",
2152
+ standard: "other"
2153
+ }
2154
+ ];
2155
+
2156
+ // node_modules/human-signals/build/src/signals.js
2157
+ var qt = /* @__PURE__ */ o(() => {
2158
+ let e = Ro();
2159
+ return [...Go, ...e].map(eu);
2160
+ }, "getSignals"), eu = /* @__PURE__ */ o(({
2161
+ name: e,
2162
+ number: t,
2163
+ description: r,
2164
+ action: n,
2165
+ forced: i = !1,
2166
+ standard: s
2167
+ }) => {
2168
+ let {
2169
+ signals: { [e]: a }
2170
+ } = jo.constants, c = a !== void 0;
2171
+ return { name: e, number: c ? a : t, description: r, supported: c, action: n, forced: i, standard: s };
2172
+ }, "normalizeSignal");
2173
+
2174
+ // node_modules/human-signals/build/src/main.js
2175
+ var tu = /* @__PURE__ */ o(() => {
2176
+ let e = qt();
2177
+ return Object.fromEntries(e.map(ru));
2178
+ }, "getSignalsByName"), ru = /* @__PURE__ */ o(({
2179
+ name: e,
2180
+ number: t,
2181
+ description: r,
2182
+ supported: n,
2183
+ action: i,
2184
+ forced: s,
2185
+ standard: a
2186
+ }) => [e, { name: e, number: t, description: r, supported: n, action: i, forced: s, standard: a }], "getSignalByName"), Bo = tu(), nu = /* @__PURE__ */ o(
2187
+ () => {
2188
+ let e = qt(), t = $t + 1, r = Array.from(
2189
+ { length: t },
2190
+ (n, i) => ou(i, e)
2191
+ );
2192
+ return Object.assign({}, ...r);
2193
+ }, "getSignalsByNumber"), ou = /* @__PURE__ */ o((e, t) => {
2194
+ let r = iu(e, t);
2195
+ if (r === void 0)
2196
+ return {};
2197
+ let { name: n, description: i, supported: s, action: a, forced: c, standard: u } = r;
2198
+ return {
2199
+ [e]: {
2200
+ name: n,
2201
+ number: e,
2202
+ description: i,
2203
+ supported: s,
2204
+ action: a,
2205
+ forced: c,
2206
+ standard: u
2207
+ }
2208
+ };
2209
+ }, "getSignalByNumber"), iu = /* @__PURE__ */ o((e, t) => {
2210
+ let r = t.find(({ name: n }) => No.constants.signals[n] === e);
2211
+ return r !== void 0 ? r : t.find((n) => n.number === e);
2212
+ }, "findSignalByNumber"), bp = nu();
2213
+
2214
+ // node_modules/execa/lib/error.js
2215
+ var su = /* @__PURE__ */ o(({ timedOut: e, timeout: t, errorCode: r, signal: n, signalDescription: i, exitCode: s, isCanceled: a }) => e ? `\
2216
+ timed out after ${t} milliseconds` : a ? "was canceled" : r !== void 0 ? `failed with ${r}` : n !== void 0 ? `was killed with ${n} (${i})` :
2217
+ s !== void 0 ? `failed with exit code ${s}` : "failed", "getErrorPrefix"), ae = /* @__PURE__ */ o(({
2218
+ stdout: e,
2219
+ stderr: t,
2220
+ all: r,
2221
+ error: n,
2222
+ signal: i,
2223
+ exitCode: s,
2224
+ command: a,
2225
+ escapedCommand: c,
2226
+ timedOut: u,
2227
+ isCanceled: l,
2228
+ killed: f,
2229
+ parsed: { options: { timeout: x, cwd: g = Do.default.cwd() } }
2230
+ }) => {
2231
+ s = s === null ? void 0 : s, i = i === null ? void 0 : i;
2232
+ let m = i === void 0 ? void 0 : Bo[i].description, y = n && n.code, S = `Command ${su({ timedOut: u, timeout: x, errorCode: y, signal: i, signalDescription: m,
2233
+ exitCode: s, isCanceled: l })}: ${a}`, k = Object.prototype.toString.call(n) === "[object Error]", E = k ? `${S}
2234
+ ${n.message}` : S, O = [E, t, e].filter(Boolean).join(`
2235
+ `);
2236
+ return k ? (n.originalMessage = n.message, n.message = O) : n = new Error(O), n.shortMessage = E, n.command = a, n.escapedCommand = c, n.exitCode =
2237
+ s, n.signal = i, n.signalDescription = m, n.stdout = e, n.stderr = t, n.cwd = g, r !== void 0 && (n.all = r), "bufferedData" in n && delete n.
2238
+ bufferedData, n.failed = !0, n.timedOut = !!u, n.isCanceled = l, n.killed = f && !u, n;
2239
+ }, "makeError");
2240
+
2241
+ // node_modules/execa/lib/stdio.js
2242
+ var Ue = ["stdin", "stdout", "stderr"], au = /* @__PURE__ */ o((e) => Ue.some((t) => e[t] !== void 0), "hasAlias"), Mo = /* @__PURE__ */ o((e) => {
2243
+ if (!e)
2244
+ return;
2245
+ let { stdio: t } = e;
2246
+ if (t === void 0)
2247
+ return Ue.map((n) => e[n]);
2248
+ if (au(e))
2249
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Ue.map((n) => `\`${n}\``).join(", ")}`);
2250
+ if (typeof t == "string")
2251
+ return t;
2252
+ if (!Array.isArray(t))
2253
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);
2254
+ let r = Math.max(t.length, Ue.length);
2255
+ return Array.from({ length: r }, (n, i) => t[i]);
2256
+ }, "normalizeStdio");
2257
+
2258
+ // node_modules/execa/lib/kill.js
2259
+ var Fo = b(require("node:os"), 1);
2260
+
2261
+ // node_modules/signal-exit/dist/mjs/signals.js
2262
+ var D = [];
2263
+ D.push("SIGHUP", "SIGINT", "SIGTERM");
2264
+ process.platform !== "win32" && D.push(
2265
+ "SIGALRM",
2266
+ "SIGABRT",
2267
+ "SIGVTALRM",
2268
+ "SIGXCPU",
2269
+ "SIGXFSZ",
2270
+ "SIGUSR2",
2271
+ "SIGTRAP",
2272
+ "SIGSYS",
2273
+ "SIGQUIT",
2274
+ "SIGIOT"
2275
+ // should detect profiler and enable/disable accordingly.
2276
+ // see #21
2277
+ // 'SIGPROF'
2278
+ );
2279
+ process.platform === "linux" && D.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
2280
+
2281
+ // node_modules/signal-exit/dist/mjs/index.js
2282
+ var $e = /* @__PURE__ */ o((e) => !!e && typeof e == "object" && typeof e.removeListener == "function" && typeof e.emit == "function" && typeof e.
2283
+ reallyExit == "function" && typeof e.listeners == "function" && typeof e.kill == "function" && typeof e.pid == "number" && typeof e.on == "f\
2284
+ unction", "processOk"), Wt = Symbol.for("signal-exit emitter"), Ht = globalThis, cu = Object.defineProperty.bind(Object), Vt = class {
2285
+ static {
2286
+ o(this, "Emitter");
2287
+ }
2288
+ emitted = {
2289
+ afterExit: !1,
2290
+ exit: !1
2291
+ };
2292
+ listeners = {
2293
+ afterExit: [],
2294
+ exit: []
2295
+ };
2296
+ count = 0;
2297
+ id = Math.random();
2298
+ constructor() {
2299
+ if (Ht[Wt])
2300
+ return Ht[Wt];
2301
+ cu(Ht, Wt, {
2302
+ value: this,
2303
+ writable: !1,
2304
+ enumerable: !1,
2305
+ configurable: !1
2306
+ });
2307
+ }
2308
+ on(t, r) {
2309
+ this.listeners[t].push(r);
2310
+ }
2311
+ removeListener(t, r) {
2312
+ let n = this.listeners[t], i = n.indexOf(r);
2313
+ i !== -1 && (i === 0 && n.length === 1 ? n.length = 0 : n.splice(i, 1));
2314
+ }
2315
+ emit(t, r, n) {
2316
+ if (this.emitted[t])
2317
+ return !1;
2318
+ this.emitted[t] = !0;
2319
+ let i = !1;
2320
+ for (let s of this.listeners[t])
2321
+ i = s(r, n) === !0 || i;
2322
+ return t === "exit" && (i = this.emit("afterExit", r, n) || i), i;
2323
+ }
2324
+ }, qe = class {
2325
+ static {
2326
+ o(this, "SignalExitBase");
2327
+ }
2328
+ }, uu = /* @__PURE__ */ o((e) => ({
2329
+ onExit(t, r) {
2330
+ return e.onExit(t, r);
2331
+ },
2332
+ load() {
2333
+ return e.load();
2334
+ },
2335
+ unload() {
2336
+ return e.unload();
2337
+ }
2338
+ }), "signalExitWrap"), zt = class extends qe {
2339
+ static {
2340
+ o(this, "SignalExitFallback");
2341
+ }
2342
+ onExit() {
2343
+ return () => {
2344
+ };
2345
+ }
2346
+ load() {
2347
+ }
2348
+ unload() {
2349
+ }
2350
+ }, Jt = class extends qe {
2351
+ static {
2352
+ o(this, "SignalExit");
2353
+ }
2354
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
2355
+ // so use a supported signal instead
2356
+ /* c8 ignore start */
2357
+ #s = Kt.platform === "win32" ? "SIGINT" : "SIGHUP";
2358
+ /* c8 ignore stop */
2359
+ #t = new Vt();
2360
+ #e;
2361
+ #o;
2362
+ #i;
2363
+ #n = {};
2364
+ #r = !1;
2365
+ constructor(t) {
2366
+ super(), this.#e = t, this.#n = {};
2367
+ for (let r of D)
2368
+ this.#n[r] = () => {
2369
+ let n = this.#e.listeners(r), { count: i } = this.#t, s = t;
2370
+ if (typeof s.__signal_exit_emitter__ == "object" && typeof s.__signal_exit_emitter__.count == "number" && (i += s.__signal_exit_emitter__.
2371
+ count), n.length === i) {
2372
+ this.unload();
2373
+ let a = this.#t.emit("exit", null, r), c = r === "SIGHUP" ? this.#s : r;
2374
+ a || t.kill(t.pid, c);
2375
+ }
2376
+ };
2377
+ this.#i = t.reallyExit, this.#o = t.emit;
2378
+ }
2379
+ onExit(t, r) {
2380
+ if (!$e(this.#e))
2381
+ return () => {
2382
+ };
2383
+ this.#r === !1 && this.load();
2384
+ let n = r?.alwaysLast ? "afterExit" : "exit";
2385
+ return this.#t.on(n, t), () => {
2386
+ this.#t.removeListener(n, t), this.#t.listeners.exit.length === 0 && this.#t.listeners.afterExit.length === 0 && this.unload();
2387
+ };
2388
+ }
2389
+ load() {
2390
+ if (!this.#r) {
2391
+ this.#r = !0, this.#t.count += 1;
2392
+ for (let t of D)
2393
+ try {
2394
+ let r = this.#n[t];
2395
+ r && this.#e.on(t, r);
2396
+ } catch {
2397
+ }
2398
+ this.#e.emit = (t, ...r) => this.#c(t, ...r), this.#e.reallyExit = (t) => this.#a(t);
2399
+ }
2400
+ }
2401
+ unload() {
2402
+ this.#r && (this.#r = !1, D.forEach((t) => {
2403
+ let r = this.#n[t];
2404
+ if (!r)
2405
+ throw new Error("Listener not defined for signal: " + t);
2406
+ try {
2407
+ this.#e.removeListener(t, r);
2408
+ } catch {
2409
+ }
2410
+ }), this.#e.emit = this.#o, this.#e.reallyExit = this.#i, this.#t.count -= 1);
2411
+ }
2412
+ #a(t) {
2413
+ return $e(this.#e) ? (this.#e.exitCode = t || 0, this.#t.emit("exit", this.#e.exitCode, null), this.#i.call(this.#e, this.#e.exitCode)) :
2414
+ 0;
2415
+ }
2416
+ #c(t, ...r) {
2417
+ let n = this.#o;
2418
+ if (t === "exit" && $e(this.#e)) {
2419
+ typeof r[0] == "number" && (this.#e.exitCode = r[0]);
2420
+ let i = n.call(this.#e, t, ...r);
2421
+ return this.#t.emit("exit", this.#e.exitCode, null), i;
2422
+ } else
2423
+ return n.call(this.#e, t, ...r);
2424
+ }
2425
+ }, Kt = globalThis.process, {
2426
+ /**
2427
+ * Called when the process is exiting, whether via signal, explicit
2428
+ * exit, or running out of stuff to do.
2429
+ *
2430
+ * If the global process object is not suitable for instrumentation,
2431
+ * then this will be a no-op.
2432
+ *
2433
+ * Returns a function that may be used to unload signal-exit.
2434
+ */
2435
+ onExit: Lo,
2436
+ /**
2437
+ * Load the listeners. Likely you never need to call this, unless
2438
+ * doing a rather deep integration with signal-exit functionality.
2439
+ * Mostly exposed for the benefit of testing.
2440
+ *
2441
+ * @internal
2442
+ */
2443
+ load: Cp,
2444
+ /**
2445
+ * Unload the listeners. Likely you never need to call this, unless
2446
+ * doing a rather deep integration with signal-exit functionality.
2447
+ * Mostly exposed for the benefit of testing.
2448
+ *
2449
+ * @internal
2450
+ */
2451
+ unload: Op
2452
+ } = uu($e(Kt) ? new Jt(Kt) : new zt());
2453
+
2454
+ // node_modules/execa/lib/kill.js
2455
+ var lu = 1e3 * 5, Uo = /* @__PURE__ */ o((e, t = "SIGTERM", r = {}) => {
2456
+ let n = e(t);
2457
+ return fu(e, t, r, n), n;
2458
+ }, "spawnedKill"), fu = /* @__PURE__ */ o((e, t, r, n) => {
2459
+ if (!pu(t, r, n))
2460
+ return;
2461
+ let i = mu(r), s = setTimeout(() => {
2462
+ e("SIGKILL");
2463
+ }, i);
2464
+ s.unref && s.unref();
2465
+ }, "setKillTimeout"), pu = /* @__PURE__ */ o((e, { forceKillAfterTimeout: t }, r) => du(e) && t !== !1 && r, "shouldForceKill"), du = /* @__PURE__ */ o(
2466
+ (e) => e === Fo.default.constants.signals.SIGTERM || typeof e == "string" && e.toUpperCase() === "SIGTERM", "isSigterm"), mu = /* @__PURE__ */ o(
2467
+ ({ forceKillAfterTimeout: e = !0 }) => {
2468
+ if (e === !0)
2469
+ return lu;
2470
+ if (!Number.isFinite(e) || e < 0)
2471
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
2472
+ return e;
2473
+ }, "getForceKillAfterTimeout"), $o = /* @__PURE__ */ o((e, t) => {
2474
+ e.kill() && (t.isCanceled = !0);
2475
+ }, "spawnedCancel"), hu = /* @__PURE__ */ o((e, t, r) => {
2476
+ e.kill(t), r(Object.assign(new Error("Timed out"), { timedOut: !0, signal: t }));
2477
+ }, "timeoutKill"), qo = /* @__PURE__ */ o((e, { timeout: t, killSignal: r = "SIGTERM" }, n) => {
2478
+ if (t === 0 || t === void 0)
2479
+ return n;
2480
+ let i, s = new Promise((c, u) => {
2481
+ i = setTimeout(() => {
2482
+ hu(e, r, u);
2483
+ }, t);
2484
+ }), a = n.finally(() => {
2485
+ clearTimeout(i);
2486
+ });
2487
+ return Promise.race([s, a]);
2488
+ }, "setupTimeout"), Wo = /* @__PURE__ */ o(({ timeout: e }) => {
2489
+ if (e !== void 0 && (!Number.isFinite(e) || e < 0))
2490
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
2491
+ }, "validateTimeout"), Ho = /* @__PURE__ */ o(async (e, { cleanup: t, detached: r }, n) => {
2492
+ if (!t || r)
2493
+ return n;
2494
+ let i = Lo(() => {
2495
+ e.kill();
2496
+ });
2497
+ return n.finally(() => {
2498
+ i();
2499
+ });
2500
+ }, "setExitHandler");
2501
+
2502
+ // node_modules/execa/lib/pipe.js
2503
+ var Vo = require("node:fs"), zo = require("node:child_process");
2504
+
2505
+ // node_modules/is-stream/index.js
2506
+ function We(e) {
2507
+ return e !== null && typeof e == "object" && typeof e.pipe == "function";
2508
+ }
2509
+ o(We, "isStream");
2510
+ function Yt(e) {
2511
+ return We(e) && e.writable !== !1 && typeof e._write == "function" && typeof e._writableState == "object";
2512
+ }
2513
+ o(Yt, "isWritableStream");
2514
+
2515
+ // node_modules/execa/lib/pipe.js
2516
+ var yu = /* @__PURE__ */ o((e) => e instanceof zo.ChildProcess && typeof e.then == "function", "isExecaChildProcess"), Xt = /* @__PURE__ */ o(
2517
+ (e, t, r) => {
2518
+ if (typeof r == "string")
2519
+ return e[t].pipe((0, Vo.createWriteStream)(r)), e;
2520
+ if (Yt(r))
2521
+ return e[t].pipe(r), e;
2522
+ if (!yu(r))
2523
+ throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
2524
+ if (!Yt(r.stdin))
2525
+ throw new TypeError("The target child process's stdin must be available.");
2526
+ return e[t].pipe(r.stdin), r;
2527
+ }, "pipeToTarget"), Jo = /* @__PURE__ */ o((e) => {
2528
+ e.stdout !== null && (e.pipeStdout = Xt.bind(void 0, e, "stdout")), e.stderr !== null && (e.pipeStderr = Xt.bind(void 0, e, "stderr")), e.
2529
+ all !== void 0 && (e.pipeAll = Xt.bind(void 0, e, "all"));
2530
+ }, "addPipeMethods");
2531
+
2532
+ // node_modules/execa/lib/stream.js
2533
+ var Ye = require("node:fs"), oi = require("node:timers/promises");
2534
+
2535
+ // node_modules/get-stream/source/contents.js
2536
+ var ce = /* @__PURE__ */ o(async (e, { init: t, convertChunk: r, getSize: n, truncateChunk: i, addChunk: s, getFinalChunk: a, finalize: c }, {
2537
+ maxBuffer: u = Number.POSITIVE_INFINITY } = {}) => {
2538
+ if (!bu(e))
2539
+ throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
2540
+ let l = t();
2541
+ l.length = 0;
2542
+ try {
2543
+ for await (let f of e) {
2544
+ let x = xu(f), g = r[x](f, l);
2545
+ Xo({ convertedChunk: g, state: l, getSize: n, truncateChunk: i, addChunk: s, maxBuffer: u });
2546
+ }
2547
+ return gu({ state: l, convertChunk: r, getSize: n, truncateChunk: i, addChunk: s, getFinalChunk: a, maxBuffer: u }), c(l);
2548
+ } catch (f) {
2549
+ throw f.bufferedData = c(l), f;
2550
+ }
2551
+ }, "getStreamContents"), gu = /* @__PURE__ */ o(({ state: e, getSize: t, truncateChunk: r, addChunk: n, getFinalChunk: i, maxBuffer: s }) => {
2552
+ let a = i(e);
2553
+ a !== void 0 && Xo({ convertedChunk: a, state: e, getSize: t, truncateChunk: r, addChunk: n, maxBuffer: s });
2554
+ }, "appendFinalChunk"), Xo = /* @__PURE__ */ o(({ convertedChunk: e, state: t, getSize: r, truncateChunk: n, addChunk: i, maxBuffer: s }) => {
2555
+ let a = r(e), c = t.length + a;
2556
+ if (c <= s) {
2557
+ Ko(e, t, i, c);
2558
+ return;
2559
+ }
2560
+ let u = n(e, s - t.length);
2561
+ throw u !== void 0 && Ko(u, t, i, s), new He();
2562
+ }, "appendChunk"), Ko = /* @__PURE__ */ o((e, t, r, n) => {
2563
+ t.contents = r(e, t, n), t.length = n;
2564
+ }, "addNewChunk"), bu = /* @__PURE__ */ o((e) => typeof e == "object" && e !== null && typeof e[Symbol.asyncIterator] == "function", "isAsyn\
2565
+ cIterable"), xu = /* @__PURE__ */ o((e) => {
2566
+ let t = typeof e;
2567
+ if (t === "string")
2568
+ return "string";
2569
+ if (t !== "object" || e === null)
2570
+ return "others";
2571
+ if (globalThis.Buffer?.isBuffer(e))
2572
+ return "buffer";
2573
+ let r = Yo.call(e);
2574
+ return r === "[object ArrayBuffer]" ? "arrayBuffer" : r === "[object DataView]" ? "dataView" : Number.isInteger(e.byteLength) && Number.isInteger(
2575
+ e.byteOffset) && Yo.call(e.buffer) === "[object ArrayBuffer]" ? "typedArray" : "others";
2576
+ }, "getChunkType"), { toString: Yo } = Object.prototype, He = class extends Error {
2577
+ static {
2578
+ o(this, "MaxBufferError");
2579
+ }
2580
+ name = "MaxBufferError";
2581
+ constructor() {
2582
+ super("maxBuffer exceeded");
2583
+ }
2584
+ };
2585
+
2586
+ // node_modules/get-stream/source/utils.js
2587
+ var Qt = /* @__PURE__ */ o((e) => e, "identity"), Zt = /* @__PURE__ */ o(() => {
2588
+ }, "noop"), er = /* @__PURE__ */ o(({ contents: e }) => e, "getContentsProp"), Ve = /* @__PURE__ */ o((e) => {
2589
+ throw new Error(`Streams in object mode are not supported: ${String(e)}`);
2590
+ }, "throwObjectStream"), ze = /* @__PURE__ */ o((e) => e.length, "getLengthProp");
2591
+
2592
+ // node_modules/get-stream/source/array-buffer.js
2593
+ async function tr(e, t) {
2594
+ return ce(e, Cu, t);
2595
+ }
2596
+ o(tr, "getStreamAsArrayBuffer");
2597
+ var Su = /* @__PURE__ */ o(() => ({ contents: new ArrayBuffer(0) }), "initArrayBuffer"), wu = /* @__PURE__ */ o((e) => vu.encode(e), "useTex\
2598
+ tEncoder"), vu = new TextEncoder(), Qo = /* @__PURE__ */ o((e) => new Uint8Array(e), "useUint8Array"), Zo = /* @__PURE__ */ o((e) => new Uint8Array(
2599
+ e.buffer, e.byteOffset, e.byteLength), "useUint8ArrayWithOffset"), Pu = /* @__PURE__ */ o((e, t) => e.slice(0, t), "truncateArrayBufferChunk"),
2600
+ Eu = /* @__PURE__ */ o((e, { contents: t, length: r }, n) => {
2601
+ let i = ri() ? ku(t, n) : Tu(t, n);
2602
+ return new Uint8Array(i).set(e, r), i;
2603
+ }, "addArrayBufferChunk"), Tu = /* @__PURE__ */ o((e, t) => {
2604
+ if (t <= e.byteLength)
2605
+ return e;
2606
+ let r = new ArrayBuffer(ti(t));
2607
+ return new Uint8Array(r).set(new Uint8Array(e), 0), r;
2608
+ }, "resizeArrayBufferSlow"), ku = /* @__PURE__ */ o((e, t) => {
2609
+ if (t <= e.maxByteLength)
2610
+ return e.resize(t), e;
2611
+ let r = new ArrayBuffer(t, { maxByteLength: ti(t) });
2612
+ return new Uint8Array(r).set(new Uint8Array(e), 0), r;
2613
+ }, "resizeArrayBuffer"), ti = /* @__PURE__ */ o((e) => ei ** Math.ceil(Math.log(e) / Math.log(ei)), "getNewContentsLength"), ei = 2, Iu = /* @__PURE__ */ o(
2614
+ ({ contents: e, length: t }) => ri() ? e : e.slice(0, t), "finalizeArrayBuffer"), ri = /* @__PURE__ */ o(() => "resize" in ArrayBuffer.prototype,
2615
+ "hasArrayBufferResize"), Cu = {
2616
+ init: Su,
2617
+ convertChunk: {
2618
+ string: wu,
2619
+ buffer: Qo,
2620
+ arrayBuffer: Qo,
2621
+ dataView: Zo,
2622
+ typedArray: Zo,
2623
+ others: Ve
2624
+ },
2625
+ getSize: ze,
2626
+ truncateChunk: Pu,
2627
+ addChunk: Eu,
2628
+ getFinalChunk: Zt,
2629
+ finalize: Iu
2630
+ };
2631
+
2632
+ // node_modules/get-stream/source/buffer.js
2633
+ async function Je(e, t) {
2634
+ if (!("Buffer" in globalThis))
2635
+ throw new Error("getStreamAsBuffer() is only supported in Node.js");
2636
+ try {
2637
+ return ni(await tr(e, t));
2638
+ } catch (r) {
2639
+ throw r.bufferedData !== void 0 && (r.bufferedData = ni(r.bufferedData)), r;
2640
+ }
2641
+ }
2642
+ o(Je, "getStreamAsBuffer");
2643
+ var ni = /* @__PURE__ */ o((e) => globalThis.Buffer.from(e), "arrayBufferToNodeBuffer");
2644
+
2645
+ // node_modules/get-stream/source/string.js
2646
+ async function rr(e, t) {
2647
+ return ce(e, Gu, t);
2648
+ }
2649
+ o(rr, "getStreamAsString");
2650
+ var Ou = /* @__PURE__ */ o(() => ({ contents: "", textDecoder: new TextDecoder() }), "initString"), Ke = /* @__PURE__ */ o((e, { textDecoder: t }) => t.
2651
+ decode(e, { stream: !0 }), "useTextDecoder"), Au = /* @__PURE__ */ o((e, { contents: t }) => t + e, "addStringChunk"), Ru = /* @__PURE__ */ o(
2652
+ (e, t) => e.slice(0, t), "truncateStringChunk"), _u = /* @__PURE__ */ o(({ textDecoder: e }) => {
2653
+ let t = e.decode();
2654
+ return t === "" ? void 0 : t;
2655
+ }, "getFinalStringChunk"), Gu = {
2656
+ init: Ou,
2657
+ convertChunk: {
2658
+ string: Qt,
2659
+ buffer: Ke,
2660
+ arrayBuffer: Ke,
2661
+ dataView: Ke,
2662
+ typedArray: Ke,
2663
+ others: Ve
2664
+ },
2665
+ getSize: ze,
2666
+ truncateChunk: Ru,
2667
+ addChunk: Au,
2668
+ getFinalChunk: _u,
2669
+ finalize: er
2670
+ };
2671
+
2672
+ // node_modules/execa/lib/stream.js
2673
+ var ii = b(Gt(), 1);
2674
+ var si = /* @__PURE__ */ o((e) => {
2675
+ if (e !== void 0)
2676
+ throw new TypeError("The `input` and `inputFile` options cannot be both set.");
2677
+ }, "validateInputOptions"), ju = /* @__PURE__ */ o(({ input: e, inputFile: t }) => typeof t != "string" ? e : (si(e), (0, Ye.readFileSync)(t)),
2678
+ "getInputSync"), ai = /* @__PURE__ */ o((e) => {
2679
+ let t = ju(e);
2680
+ if (We(t))
2681
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
2682
+ return t;
2683
+ }, "handleInputSync"), Nu = /* @__PURE__ */ o(({ input: e, inputFile: t }) => typeof t != "string" ? e : (si(e), (0, Ye.createReadStream)(t)),
2684
+ "getInput"), ci = /* @__PURE__ */ o((e, t) => {
2685
+ let r = Nu(t);
2686
+ r !== void 0 && (We(r) ? r.pipe(e.stdin) : e.stdin.end(r));
2687
+ }, "handleInput"), ui = /* @__PURE__ */ o((e, { all: t }) => {
2688
+ if (!t || !e.stdout && !e.stderr)
2689
+ return;
2690
+ let r = (0, ii.default)();
2691
+ return e.stdout && r.add(e.stdout), e.stderr && r.add(e.stderr), r;
2692
+ }, "makeAllStream"), nr = /* @__PURE__ */ o(async (e, t) => {
2693
+ if (!(!e || t === void 0)) {
2694
+ await (0, oi.setTimeout)(0), e.destroy();
2695
+ try {
2696
+ return await t;
2697
+ } catch (r) {
2698
+ return r.bufferedData;
2699
+ }
2700
+ }
2701
+ }, "getBufferedData"), or = /* @__PURE__ */ o((e, { encoding: t, buffer: r, maxBuffer: n }) => {
2702
+ if (!(!e || !r))
2703
+ return t === "utf8" || t === "utf-8" ? rr(e, { maxBuffer: n }) : t === null || t === "buffer" ? Je(e, { maxBuffer: n }) : Bu(e, n, t);
2704
+ }, "getStreamPromise"), Bu = /* @__PURE__ */ o(async (e, t, r) => (await Je(e, { maxBuffer: t })).toString(r), "applyEncoding"), li = /* @__PURE__ */ o(
2705
+ async ({ stdout: e, stderr: t, all: r }, { encoding: n, buffer: i, maxBuffer: s }, a) => {
2706
+ let c = or(e, { encoding: n, buffer: i, maxBuffer: s }), u = or(t, { encoding: n, buffer: i, maxBuffer: s }), l = or(r, { encoding: n, buffer: i,
2707
+ maxBuffer: s * 2 });
2708
+ try {
2709
+ return await Promise.all([a, c, u, l]);
2710
+ } catch (f) {
2711
+ return Promise.all([
2712
+ { error: f, signal: f.signal, timedOut: f.timedOut },
2713
+ nr(e, c),
2714
+ nr(t, u),
2715
+ nr(r, l)
2716
+ ]);
2717
+ }
2718
+ }, "getSpawnedResult");
2719
+
2720
+ // node_modules/execa/lib/promise.js
2721
+ var Du = (async () => {
2722
+ })().constructor.prototype, Mu = ["then", "catch", "finally"].map((e) => [
2723
+ e,
2724
+ Reflect.getOwnPropertyDescriptor(Du, e)
2725
+ ]), ir = /* @__PURE__ */ o((e, t) => {
2726
+ for (let [r, n] of Mu) {
2727
+ let i = typeof t == "function" ? (...s) => Reflect.apply(n.value, t(), s) : n.value.bind(t);
2728
+ Reflect.defineProperty(e, r, { ...n, value: i });
2729
+ }
2730
+ }, "mergePromise"), fi = /* @__PURE__ */ o((e) => new Promise((t, r) => {
2731
+ e.on("exit", (n, i) => {
2732
+ t({ exitCode: n, signal: i });
2733
+ }), e.on("error", (n) => {
2734
+ r(n);
2735
+ }), e.stdin && e.stdin.on("error", (n) => {
2736
+ r(n);
2737
+ });
2738
+ }), "getSpawnedPromise");
2739
+
2740
+ // node_modules/execa/lib/command.js
2741
+ var mi = require("node:buffer"), hi = require("node:child_process");
2742
+ var yi = /* @__PURE__ */ o((e, t = []) => Array.isArray(t) ? [e, ...t] : [e], "normalizeArgs"), Lu = /^[\w.-]+$/, Fu = /* @__PURE__ */ o((e) => typeof e !=
2743
+ "string" || Lu.test(e) ? e : `"${e.replaceAll('"', '\\"')}"`, "escapeArg"), sr = /* @__PURE__ */ o((e, t) => yi(e, t).join(" "), "joinComman\
2744
+ d"), ar = /* @__PURE__ */ o((e, t) => yi(e, t).map((r) => Fu(r)).join(" "), "getEscapedCommand"), gi = / +/g, bi = /* @__PURE__ */ o((e) => {
2745
+ let t = [];
2746
+ for (let r of e.trim().split(gi)) {
2747
+ let n = t.at(-1);
2748
+ n && n.endsWith("\\") ? t[t.length - 1] = `${n.slice(0, -1)} ${r}` : t.push(r);
2749
+ }
2750
+ return t;
2751
+ }, "parseCommand"), pi = /* @__PURE__ */ o((e) => {
2752
+ let t = typeof e;
2753
+ if (t === "string")
2754
+ return e;
2755
+ if (t === "number")
2756
+ return String(e);
2757
+ if (t === "object" && e !== null && !(e instanceof hi.ChildProcess) && "stdout" in e) {
2758
+ let r = typeof e.stdout;
2759
+ if (r === "string")
2760
+ return e.stdout;
2761
+ if (mi.Buffer.isBuffer(e.stdout))
2762
+ return e.stdout.toString();
2763
+ throw new TypeError(`Unexpected "${r}" stdout in template expression`);
2764
+ }
2765
+ throw new TypeError(`Unexpected "${t}" in template expression`);
2766
+ }, "parseExpression"), di = /* @__PURE__ */ o((e, t, r) => r || e.length === 0 || t.length === 0 ? [...e, ...t] : [
2767
+ ...e.slice(0, -1),
2768
+ `${e.at(-1)}${t[0]}`,
2769
+ ...t.slice(1)
2770
+ ], "concatTokens"), Uu = /* @__PURE__ */ o(({ templates: e, expressions: t, tokens: r, index: n, template: i }) => {
2771
+ let s = i ?? e.raw[n], a = s.split(gi).filter(Boolean), c = di(
2772
+ r,
2773
+ a,
2774
+ s.startsWith(" ")
2775
+ );
2776
+ if (n === t.length)
2777
+ return c;
2778
+ let u = t[n], l = Array.isArray(u) ? u.map((f) => pi(f)) : [pi(u)];
2779
+ return di(
2780
+ c,
2781
+ l,
2782
+ s.endsWith(" ")
2783
+ );
2784
+ }, "parseTemplate"), cr = /* @__PURE__ */ o((e, t) => {
2785
+ let r = [];
2786
+ for (let [n, i] of e.entries())
2787
+ r = Uu({ templates: e, expressions: t, tokens: r, index: n, template: i });
2788
+ return r;
2789
+ }, "parseTemplates");
2790
+
2791
+ // node_modules/execa/lib/verbose.js
2792
+ var xi = require("node:util"), Si = b(require("node:process"), 1);
2793
+ var wi = (0, xi.debuglog)("execa").enabled, Xe = /* @__PURE__ */ o((e, t) => String(e).padStart(t, "0"), "padField"), $u = /* @__PURE__ */ o(
2794
+ () => {
2795
+ let e = /* @__PURE__ */ new Date();
2796
+ return `${Xe(e.getHours(), 2)}:${Xe(e.getMinutes(), 2)}:${Xe(e.getSeconds(), 2)}.${Xe(e.getMilliseconds(), 3)}`;
2797
+ }, "getTimestamp"), ur = /* @__PURE__ */ o((e, { verbose: t }) => {
2798
+ t && Si.default.stderr.write(`[${$u()}] ${e}
2799
+ `);
2800
+ }, "logCommand");
2801
+
2802
+ // node_modules/execa/index.js
2803
+ var qu = 1e3 * 1e3 * 100, Wu = /* @__PURE__ */ o(({ env: e, extendEnv: t, preferLocal: r, localDir: n, execPath: i }) => {
2804
+ let s = t ? { ...ue.default.env, ...e } : e;
2805
+ return r ? Co({ env: s, cwd: n, execPath: i }) : s;
2806
+ }, "getEnv"), ki = /* @__PURE__ */ o((e, t, r = {}) => {
2807
+ let n = Ti.default._parse(e, t, r);
2808
+ return e = n.command, t = n.args, r = n.options, r = {
2809
+ maxBuffer: qu,
2810
+ buffer: !0,
2811
+ stripFinalNewline: !0,
2812
+ extendEnv: !0,
2813
+ preferLocal: !1,
2814
+ localDir: r.cwd || ue.default.cwd(),
2815
+ execPath: ue.default.execPath,
2816
+ encoding: "utf8",
2817
+ reject: !0,
2818
+ cleanup: !0,
2819
+ all: !1,
2820
+ windowsHide: !0,
2821
+ verbose: wi,
2822
+ ...r
2823
+ }, r.env = Wu(r), r.stdio = Mo(r), ue.default.platform === "win32" && Ei.default.basename(e, ".exe") === "cmd" && t.unshift("/q"), { file: e,
2824
+ args: t, options: r, parsed: n };
2825
+ }, "handleArguments"), le = /* @__PURE__ */ o((e, t, r) => typeof t != "string" && !Pi.Buffer.isBuffer(t) ? r === void 0 ? void 0 : "" : e.stripFinalNewline ?
2826
+ Ft(t) : t, "handleOutput");
2827
+ function Ii(e, t, r) {
2828
+ let n = ki(e, t, r), i = sr(e, t), s = ar(e, t);
2829
+ ur(s, n.options), Wo(n.options);
2830
+ let a;
2831
+ try {
2832
+ a = Qe.default.spawn(n.file, n.args, n.options);
2833
+ } catch (m) {
2834
+ let y = new Qe.default.ChildProcess(), h = Promise.reject(ae({
2835
+ error: m,
2836
+ stdout: "",
2837
+ stderr: "",
2838
+ all: "",
2839
+ command: i,
2840
+ escapedCommand: s,
2841
+ parsed: n,
2842
+ timedOut: !1,
2843
+ isCanceled: !1,
2844
+ killed: !1
2845
+ }));
2846
+ return ir(y, h), y;
2847
+ }
2848
+ let c = fi(a), u = qo(a, n.options, c), l = Ho(a, n.options, u), f = { isCanceled: !1 };
2849
+ a.kill = Uo.bind(null, a.kill.bind(a)), a.cancel = $o.bind(null, a, f);
2850
+ let g = Ao(/* @__PURE__ */ o(async () => {
2851
+ let [{ error: m, exitCode: y, signal: h, timedOut: S }, k, E, O] = await li(a, n.options, l), _ = le(n.options, k), G = le(n.options, E),
2852
+ d = le(n.options, O);
2853
+ if (m || y !== 0 || h !== null) {
2854
+ let v = ae({
2855
+ error: m,
2856
+ exitCode: y,
2857
+ signal: h,
2858
+ stdout: _,
2859
+ stderr: G,
2860
+ all: d,
2861
+ command: i,
2862
+ escapedCommand: s,
2863
+ parsed: n,
2864
+ timedOut: S,
2865
+ isCanceled: f.isCanceled || (n.options.signal ? n.options.signal.aborted : !1),
2866
+ killed: a.killed
2867
+ });
2868
+ if (!n.options.reject)
2869
+ return v;
2870
+ throw v;
2871
+ }
2872
+ return {
2873
+ command: i,
2874
+ escapedCommand: s,
2875
+ exitCode: 0,
2876
+ stdout: _,
2877
+ stderr: G,
2878
+ all: d,
2879
+ failed: !1,
2880
+ timedOut: !1,
2881
+ isCanceled: !1,
2882
+ killed: !1
2883
+ };
2884
+ }, "handlePromise"));
2885
+ return ci(a, n.options), a.all = ui(a, n.options), Jo(a), ir(a, g), a;
2886
+ }
2887
+ o(Ii, "execa");
2888
+ function Hu(e, t, r) {
2889
+ let n = ki(e, t, r), i = sr(e, t), s = ar(e, t);
2890
+ ur(s, n.options);
2891
+ let a = ai(n.options), c;
2892
+ try {
2893
+ c = Qe.default.spawnSync(n.file, n.args, { ...n.options, input: a });
2894
+ } catch (f) {
2895
+ throw ae({
2896
+ error: f,
2897
+ stdout: "",
2898
+ stderr: "",
2899
+ all: "",
2900
+ command: i,
2901
+ escapedCommand: s,
2902
+ parsed: n,
2903
+ timedOut: !1,
2904
+ isCanceled: !1,
2905
+ killed: !1
2906
+ });
2907
+ }
2908
+ let u = le(n.options, c.stdout, c.error), l = le(n.options, c.stderr, c.error);
2909
+ if (c.error || c.status !== 0 || c.signal !== null) {
2910
+ let f = ae({
2911
+ stdout: u,
2912
+ stderr: l,
2913
+ error: c.error,
2914
+ signal: c.signal,
2915
+ exitCode: c.status,
2916
+ command: i,
2917
+ escapedCommand: s,
2918
+ parsed: n,
2919
+ timedOut: c.error && c.error.code === "ETIMEDOUT",
2920
+ isCanceled: !1,
2921
+ killed: c.signal !== null
2922
+ });
2923
+ if (!n.options.reject)
2924
+ return f;
2925
+ throw f;
2926
+ }
2927
+ return {
2928
+ command: i,
2929
+ escapedCommand: s,
2930
+ exitCode: 0,
2931
+ stdout: u,
2932
+ stderr: l,
2933
+ failed: !1,
2934
+ timedOut: !1,
2935
+ isCanceled: !1,
2936
+ killed: !1
2937
+ };
2938
+ }
2939
+ o(Hu, "execaSync");
2940
+ var Vu = /* @__PURE__ */ o(({ input: e, inputFile: t, stdio: r }) => e === void 0 && t === void 0 && r === void 0 ? { stdin: "inherit" } : {},
2941
+ "normalizeScriptStdin"), vi = /* @__PURE__ */ o((e = {}) => ({
2942
+ preferLocal: !0,
2943
+ ...Vu(e),
2944
+ ...e
2945
+ }), "normalizeScriptOptions");
2946
+ function Ci(e) {
2947
+ function t(r, ...n) {
2948
+ if (!Array.isArray(r))
2949
+ return Ci({ ...e, ...r });
2950
+ let [i, ...s] = cr(r, n);
2951
+ return Ii(i, s, vi(e));
2952
+ }
2953
+ return o(t, "$"), t.sync = (r, ...n) => {
2954
+ if (!Array.isArray(r))
2955
+ throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
2956
+ let [i, ...s] = cr(r, n);
2957
+ return Hu(i, s, vi(e));
2958
+ }, t;
2959
+ }
2960
+ o(Ci, "create$");
2961
+ var jd = Ci();
2962
+ function Oi(e, t) {
2963
+ let [r, ...n] = bi(e);
2964
+ return Ii(r, n, t);
2965
+ }
2966
+ o(Oi, "execaCommand");
2967
+
2968
+ // src/telemetry/exec-command-count-lines.ts
2969
+ async function Ze(e, t) {
2970
+ let r = Oi(e, { shell: !0, buffer: !1, ...t });
2971
+ if (!r.stdout)
2972
+ throw new Error("Unexpected missing stdout");
2973
+ let n = 0, i = (0, Ai.createInterface)(r.stdout);
2974
+ return i.on("line", () => {
2975
+ n += 1;
2976
+ }), await r, i.close(), n;
2977
+ }
2978
+ o(Ze, "execCommandCountLines");
2979
+
2980
+ // ../node_modules/slash/index.js
2981
+ function lr(e) {
2982
+ return e.startsWith("\\\\?\\") ? e : e.replace(/\\/g, "/");
2983
+ }
2984
+ o(lr, "slash");
2985
+
2986
+ // src/common/utils/file-cache.ts
2987
+ var fe = require("node:crypto"), T = require("node:fs"), I = require("node:fs/promises"), Ri = require("node:os"), Y = require("node:path");
2988
+ var et = class {
2989
+ static {
2990
+ o(this, "FileSystemCache");
2991
+ }
2992
+ constructor(t = {}) {
2993
+ this.prefix = (t.ns || t.prefix || "") + "-", this.hash_alg = t.hash_alg || "md5", this.cache_dir = t.basePath || (0, Y.join)((0, Ri.tmpdir)(),
2994
+ (0, fe.randomBytes)(15).toString("base64").replace(/\//g, "-")), this.ttl = t.ttl || 0, (0, fe.createHash)(this.hash_alg), (0, T.mkdirSync)(
2995
+ this.cache_dir, { recursive: !0 });
2996
+ }
2997
+ generateHash(t) {
2998
+ return (0, Y.join)(this.cache_dir, this.prefix + (0, fe.createHash)(this.hash_alg).update(t).digest("hex"));
2999
+ }
3000
+ isExpired(t, r) {
3001
+ return t.ttl != null && r > t.ttl;
3002
+ }
3003
+ parseCacheData(t, r) {
3004
+ let n = JSON.parse(t);
3005
+ return this.isExpired(n, Date.now()) ? r : n.content;
3006
+ }
3007
+ parseSetData(t, r, n = {}) {
3008
+ let i = n.ttl ?? this.ttl;
3009
+ return JSON.stringify({ key: t, content: r, ...i && { ttl: Date.now() + i * 1e3 } });
3010
+ }
3011
+ async get(t, r) {
3012
+ try {
3013
+ let n = await (0, I.readFile)(this.generateHash(t), "utf8");
3014
+ return this.parseCacheData(n, r);
3015
+ } catch {
3016
+ return r;
3017
+ }
3018
+ }
3019
+ getSync(t, r) {
3020
+ try {
3021
+ let n = (0, T.readFileSync)(this.generateHash(t), "utf8");
3022
+ return this.parseCacheData(n, r);
3023
+ } catch {
3024
+ return r;
3025
+ }
3026
+ }
3027
+ async set(t, r, n = {}) {
3028
+ let i = typeof n == "number" ? { ttl: n } : n;
3029
+ (0, T.mkdirSync)(this.cache_dir, { recursive: !0 }), await (0, I.writeFile)(this.generateHash(t), this.parseSetData(t, r, i), {
3030
+ encoding: i.encoding || "utf8"
3031
+ });
3032
+ }
3033
+ setSync(t, r, n = {}) {
3034
+ let i = typeof n == "number" ? { ttl: n } : n;
3035
+ (0, T.mkdirSync)(this.cache_dir, { recursive: !0 }), (0, T.writeFileSync)(this.generateHash(t), this.parseSetData(t, r, i), {
3036
+ encoding: i.encoding || "utf8"
3037
+ });
3038
+ }
3039
+ async setMany(t, r) {
3040
+ await Promise.all(t.map((n) => this.set(n.key, n.content ?? n.value, r)));
3041
+ }
3042
+ setManySync(t, r) {
3043
+ t.forEach((n) => this.setSync(n.key, n.content ?? n.value, r));
3044
+ }
3045
+ async remove(t) {
3046
+ await (0, I.rm)(this.generateHash(t), { force: !0 });
3047
+ }
3048
+ removeSync(t) {
3049
+ (0, T.rmSync)(this.generateHash(t), { force: !0 });
3050
+ }
3051
+ async clear() {
3052
+ let t = await (0, I.readdir)(this.cache_dir);
3053
+ await Promise.all(
3054
+ t.filter((r) => r.startsWith(this.prefix)).map((r) => (0, I.rm)((0, Y.join)(this.cache_dir, r), { force: !0 }))
3055
+ );
3056
+ }
3057
+ clearSync() {
3058
+ (0, T.readdirSync)(this.cache_dir).filter((t) => t.startsWith(this.prefix)).forEach((t) => (0, T.rmSync)((0, Y.join)(this.cache_dir, t),
3059
+ { force: !0 }));
3060
+ }
3061
+ async getAll() {
3062
+ let t = Date.now(), r = await (0, I.readdir)(this.cache_dir);
3063
+ return (await Promise.all(
3064
+ r.filter((i) => i.startsWith(this.prefix)).map((i) => (0, I.readFile)((0, Y.join)(this.cache_dir, i), "utf8"))
3065
+ )).map((i) => JSON.parse(i)).filter((i) => i.content && !this.isExpired(i, t));
3066
+ }
3067
+ async load() {
3068
+ return {
3069
+ files: (await this.getAll()).map((r) => ({
3070
+ path: this.generateHash(r.key),
3071
+ value: r.content,
3072
+ key: r.key
3073
+ }))
3074
+ };
3075
+ }
3076
+ };
3077
+ function fr(e) {
3078
+ return new et(e);
3079
+ }
3080
+ o(fr, "createFileSystemCache");
3081
+
3082
+ // src/common/utils/resolve-path-in-sb-cache.ts
3083
+ var hr = require("node:path");
3084
+
3085
+ // ../node_modules/find-cache-dir/index.js
3086
+ var Hi = b(require("node:process"), 1), X = b(require("node:path"), 1), de = b(require("node:fs"), 1), Vi = b(Gi(), 1);
3087
+
3088
+ // ../node_modules/pkg-dir/index.js
3089
+ var Ui = b(require("node:path"), 1);
3090
+
3091
+ // ../node_modules/pkg-dir/node_modules/find-up/index.js
3092
+ var pe = b(require("node:path"), 1), Li = require("node:url");
3093
+
3094
+ // ../node_modules/locate-path/index.js
3095
+ var ji = b(require("node:process"), 1), Ni = b(require("node:path"), 1), tt = b(require("node:fs"), 1), Bi = require("node:url");
3096
+ var Di = {
3097
+ directory: "isDirectory",
3098
+ file: "isFile"
3099
+ };
3100
+ function Ku(e) {
3101
+ if (!Object.hasOwnProperty.call(Di, e))
3102
+ throw new Error(`Invalid type specified: ${e}`);
3103
+ }
3104
+ o(Ku, "checkType");
3105
+ var Yu = /* @__PURE__ */ o((e, t) => t[Di[e]](), "matchType"), Xu = /* @__PURE__ */ o((e) => e instanceof URL ? (0, Bi.fileURLToPath)(e) : e,
3106
+ "toPath");
3107
+ function pr(e, {
3108
+ cwd: t = ji.default.cwd(),
3109
+ type: r = "file",
3110
+ allowSymlinks: n = !0
3111
+ } = {}) {
3112
+ Ku(r), t = Xu(t);
3113
+ let i = n ? tt.default.statSync : tt.default.lstatSync;
3114
+ for (let s of e)
3115
+ try {
3116
+ let a = i(Ni.default.resolve(t, s), {
3117
+ throwIfNoEntry: !1
3118
+ });
3119
+ if (!a)
3120
+ continue;
3121
+ if (Yu(r, a))
3122
+ return s;
3123
+ } catch {
3124
+ }
3125
+ }
3126
+ o(pr, "locatePathSync");
3127
+
3128
+ // ../node_modules/pkg-dir/node_modules/path-exists/index.js
3129
+ var Mi = b(require("node:fs"), 1);
3130
+
3131
+ // ../node_modules/pkg-dir/node_modules/find-up/index.js
3132
+ var Qu = /* @__PURE__ */ o((e) => e instanceof URL ? (0, Li.fileURLToPath)(e) : e, "toPath"), Zu = Symbol("findUpStop");
3133
+ function el(e, t = {}) {
3134
+ let r = pe.default.resolve(Qu(t.cwd) || ""), { root: n } = pe.default.parse(r), i = t.stopAt || n, s = t.limit || Number.POSITIVE_INFINITY,
3135
+ a = [e].flat(), c = /* @__PURE__ */ o((l) => {
3136
+ if (typeof e != "function")
3137
+ return pr(a, l);
3138
+ let f = e(l.cwd);
3139
+ return typeof f == "string" ? pr([f], l) : f;
3140
+ }, "runMatcher"), u = [];
3141
+ for (; ; ) {
3142
+ let l = c({ ...t, cwd: r });
3143
+ if (l === Zu || (l && u.push(pe.default.resolve(r, l)), r === i || u.length >= s))
3144
+ break;
3145
+ r = pe.default.dirname(r);
3146
+ }
3147
+ return u;
3148
+ }
3149
+ o(el, "findUpMultipleSync");
3150
+ function Fi(e, t = {}) {
3151
+ return el(e, { ...t, limit: 1 })[0];
3152
+ }
3153
+ o(Fi, "findUpSync");
3154
+
3155
+ // ../node_modules/pkg-dir/index.js
3156
+ function $i({ cwd: e } = {}) {
3157
+ let t = Fi("package.json", { cwd: e });
3158
+ return t && Ui.default.dirname(t);
3159
+ }
3160
+ o($i, "packageDirectorySync");
3161
+
3162
+ // ../node_modules/find-cache-dir/index.js
3163
+ var { env: dr, cwd: tl } = Hi.default, qi = /* @__PURE__ */ o((e) => {
3164
+ try {
3165
+ return de.default.accessSync(e, de.default.constants.W_OK), !0;
3166
+ } catch {
3167
+ return !1;
3168
+ }
3169
+ }, "isWritable");
3170
+ function Wi(e, t) {
3171
+ return t.create && de.default.mkdirSync(e, { recursive: !0 }), e;
3172
+ }
3173
+ o(Wi, "useDirectory");
3174
+ function rl(e) {
3175
+ let t = X.default.join(e, "node_modules");
3176
+ if (!(!qi(t) && (de.default.existsSync(t) || !qi(X.default.join(e)))))
3177
+ return t;
3178
+ }
3179
+ o(rl, "getNodeModuleDirectory");
3180
+ function mr(e = {}) {
3181
+ if (dr.CACHE_DIR && !["true", "false", "1", "0"].includes(dr.CACHE_DIR))
3182
+ return Wi(X.default.join(dr.CACHE_DIR, e.name), e);
3183
+ let { cwd: t = tl(), files: r } = e;
3184
+ if (r) {
3185
+ if (!Array.isArray(r))
3186
+ throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof r}\`.`);
3187
+ t = (0, Vi.default)(r.map((i) => X.default.resolve(t, i)));
3188
+ }
3189
+ if (t = $i({ cwd: t }), !(!t || !rl(t)))
3190
+ return Wi(X.default.join(t, "node_modules", ".cache", e.name), e);
3191
+ }
3192
+ o(mr, "findCacheDirectory");
3193
+
3194
+ // src/common/utils/resolve-path-in-sb-cache.ts
3195
+ function zi(e, t = "default") {
3196
+ let r = mr({ name: "storybook" });
3197
+ return r ||= (0, hr.join)(process.cwd(), "node_modules", ".cache", "storybook"), (0, hr.join)(r, t, e);
3198
+ }
3199
+ o(zi, "resolvePathInStorybookCache");
3200
+
3201
+ // src/telemetry/run-telemetry-operation.ts
3202
+ var Ji = fr({
3203
+ basePath: zi("telemetry"),
3204
+ ns: "storybook",
3205
+ ttl: 24 * 60 * 60 * 1e3
3206
+ // 24h
3207
+ }), rt = /* @__PURE__ */ o(async (e, t) => {
3208
+ let r = await Ji.get(e);
3209
+ return r === void 0 && (r = await t(), r !== void 0 && await Ji.set(e, r)), r;
3210
+ }, "runTelemetryOperation");
3211
+
3212
+ // src/telemetry/get-application-file-count.ts
3213
+ var nl = ["page", "screen"], ol = ["js", "jsx", "ts", "tsx"], il = /* @__PURE__ */ o(async (e) => {
3214
+ let r = nl.flatMap((n) => [
3215
+ n,
3216
+ [n[0].toUpperCase(), ...n.slice(1)].join("")
3217
+ ]).flatMap(
3218
+ (n) => ol.map((i) => `"${e}${Ki.sep}*${n}*.${i}"`)
3219
+ );
3220
+ try {
3221
+ let n = `git ls-files -- ${r.join(" ")}`;
3222
+ return await Ze(n);
3223
+ } catch {
3224
+ return;
3225
+ }
3226
+ }, "getApplicationFilesCountUncached"), Yi = /* @__PURE__ */ o(async (e) => rt(
3227
+ "applicationFiles",
3228
+ async () => il(e)
3229
+ ), "getApplicationFileCount");
3230
+
3231
+ // src/telemetry/get-chromatic-version.ts
3232
+ function Xi(e) {
3233
+ let t = e.dependencies?.chromatic || e.devDependencies?.chromatic || e.peerDependencies?.chromatic;
3234
+ return t || (e.scripts && Object.values(e.scripts).find((r) => r?.match(/chromatic/)) ? "latest" : void 0);
3235
+ }
3236
+ o(Xi, "getChromaticVersionSpecifier");
3237
+
3238
+ // src/telemetry/get-framework-info.ts
3239
+ var ts = require("node:path"), rs = require("storybook/internal/common");
3240
+
3241
+ // src/telemetry/package-json.ts
3242
+ var Qi = require("node:fs/promises"), Zi = require("node:path");
3243
+ var yr = /* @__PURE__ */ o(async (e) => {
3244
+ let t = Object.keys(e);
3245
+ return Promise.all(t.map(nt));
3246
+ }, "getActualPackageVersions"), nt = /* @__PURE__ */ o(async (e) => {
3247
+ try {
3248
+ let t = await gr(e);
3249
+ return {
3250
+ name: e,
3251
+ version: t.version
3252
+ };
3253
+ } catch {
3254
+ return { name: e, version: null };
3255
+ }
3256
+ }, "getActualPackageVersion"), gr = /* @__PURE__ */ o(async (e) => {
3257
+ let t = require.resolve((0, Zi.join)(e, "package.json"), {
3258
+ paths: [process.cwd()]
3259
+ });
3260
+ return JSON.parse(await (0, Qi.readFile)(t, { encoding: "utf8" }));
3261
+ }, "getActualPackageJson");
3262
+
3263
+ // src/telemetry/get-framework-info.ts
3264
+ var sl = [
3265
+ "html",
3266
+ "react",
3267
+ "svelte",
3268
+ "vue3",
3269
+ "preact",
3270
+ "server",
3271
+ "vue",
3272
+ "web-components",
3273
+ "angular",
3274
+ "ember"
3275
+ ], al = ["builder-webpack5", "builder-vite"];
3276
+ function es(e, t) {
3277
+ let { name: r = "", version: n, dependencies: i, devDependencies: s, peerDependencies: a } = e, c = {
3278
+ // We include the framework itself because it may be a renderer too (e.g. angular)
3279
+ [r]: n,
3280
+ ...i,
3281
+ ...s,
3282
+ ...a
3283
+ };
3284
+ return t.map((u) => `@storybook/${u}`).find((u) => c[u]);
3285
+ }
3286
+ o(es, "findMatchingPackage");
3287
+ var cl = /* @__PURE__ */ o((e) => {
3288
+ let t = (0, ts.normalize)(e).replace(new RegExp(/\\/, "g"), "/");
3289
+ return Object.keys(rs.frameworkPackages).find((n) => t.endsWith(n)) || F(e).replace(/.*node_modules[\\/]/, "");
3290
+ }, "getFrameworkPackageName");
3291
+ async function ns(e) {
3292
+ if (!e?.framework)
3293
+ return {};
3294
+ let t = typeof e.framework == "string" ? e.framework : e.framework?.name;
3295
+ if (!t)
3296
+ return {};
3297
+ let r = await gr(t);
3298
+ if (!r)
3299
+ return {};
3300
+ let n = es(r, al), i = es(r, sl), s = cl(t), a = typeof e.framework == "object" ? e.framework.options : {};
3301
+ return {
3302
+ framework: {
3303
+ name: s,
3304
+ options: a
3305
+ },
3306
+ builder: n,
3307
+ renderer: i
3308
+ };
3309
+ }
3310
+ o(ns, "getFrameworkInfo");
3311
+
3312
+ // src/telemetry/get-has-router-package.ts
3313
+ var ul = /* @__PURE__ */ new Set([
3314
+ "react-router",
3315
+ "react-router-dom",
3316
+ "remix",
3317
+ "@tanstack/react-router",
3318
+ "expo-router",
3319
+ "@reach/router",
3320
+ "react-easy-router",
3321
+ "@remix-run/router",
3322
+ "wouter",
3323
+ "wouter-preact",
3324
+ "preact-router",
3325
+ "vue-router",
3326
+ "unplugin-vue-router",
3327
+ "@angular/router",
3328
+ "@solidjs/router",
3329
+ // metaframeworks that imply routing
3330
+ "next",
3331
+ "react-scripts",
3332
+ "gatsby",
3333
+ "nuxt",
3334
+ "@sveltejs/kit"
3335
+ ]);
3336
+ function os(e) {
3337
+ return Object.keys(e?.dependencies ?? {}).some(
3338
+ (t) => ul.has(t)
3339
+ );
3340
+ }
3341
+ o(os, "getHasRouterPackage");
3342
+
3343
+ // src/telemetry/get-monorepo-type.ts
3344
+ var me = require("node:fs"), ot = require("node:path"), ss = require("storybook/internal/common");
3345
+ var is = {
3346
+ Nx: "nx.json",
3347
+ Turborepo: "turbo.json",
3348
+ Lerna: "lerna.json",
3349
+ Rush: "rush.json",
3350
+ Lage: "lage.config.json"
3351
+ }, as = /* @__PURE__ */ o(() => {
3352
+ let e = (0, ss.getProjectRoot)();
3353
+ if (!e)
3354
+ return;
3355
+ let r = Object.keys(is).find((i) => {
3356
+ let s = (0, ot.join)(e, is[i]);
3357
+ return (0, me.existsSync)(s);
3358
+ });
3359
+ if (r)
3360
+ return r;
3361
+ if (!(0, me.existsSync)((0, ot.join)(e, "package.json")))
3362
+ return;
3363
+ if (JSON.parse(
3364
+ (0, me.readFileSync)((0, ot.join)(e, "package.json"), { encoding: "utf8" })
3365
+ )?.workspaces)
3366
+ return "Workspaces";
3367
+ }, "getMonorepoType");
3368
+
3369
+ // src/telemetry/get-portable-stories-usage.ts
3370
+ var ll = /* @__PURE__ */ o(async (e) => {
3371
+ try {
3372
+ let t = "git grep -l composeStor" + (e ? ` -- ${e}` : "");
3373
+ return await Ze(t);
3374
+ } catch (t) {
3375
+ return t.exitCode === 1 ? 0 : void 0;
3376
+ }
3377
+ }, "getPortableStoriesFileCountUncached"), cs = /* @__PURE__ */ o(async (e) => rt(
3378
+ "portableStories",
3379
+ async () => ll(e)
3380
+ ), "getPortableStoriesFileCount");
3381
+
3382
+ // src/telemetry/storybook-metadata.ts
3383
+ var br = {
3384
+ next: "Next",
3385
+ "react-scripts": "CRA",
3386
+ gatsby: "Gatsby",
3387
+ "@nuxtjs/storybook": "nuxt",
3388
+ "@nrwl/storybook": "nx",
3389
+ "@vue/cli-service": "vue-cli",
3390
+ "@sveltejs/kit": "sveltekit"
3391
+ }, xr = /* @__PURE__ */ o((e) => F(e).replace(/\/dist\/.*/, "").replace(/\.[mc]?[tj]?s[x]?$/, "").replace(/\/register$/, "").replace(/\/manager$/,
3392
+ "").replace(/\/preset$/, ""), "sanitizeAddonName"), fs = /* @__PURE__ */ o(async ({
3393
+ packageJsonPath: e,
3394
+ packageJson: t,
3395
+ mainConfig: r
3396
+ }) => {
3397
+ let n = {
3398
+ generatedAt: (/* @__PURE__ */ new Date()).getTime(),
3399
+ hasCustomBabel: !1,
3400
+ hasCustomWebpack: !1,
3401
+ hasStaticDirs: !1,
3402
+ hasStorybookEslint: !1,
3403
+ refCount: 0
3404
+ }, i = {
3405
+ ...t?.dependencies,
3406
+ ...t?.devDependencies,
3407
+ ...t?.peerDependencies
3408
+ }, s = Object.keys(i).find((d) => !!br[d]);
3409
+ if (s) {
3410
+ let { version: d } = await nt(s);
3411
+ n.metaFramework = {
3412
+ name: br[s],
3413
+ packageName: s,
3414
+ version: d
3415
+ };
3416
+ }
3417
+ let a = [
3418
+ "playwright",
3419
+ "vitest",
3420
+ "jest",
3421
+ "cypress",
3422
+ "nightwatch",
3423
+ "webdriver",
3424
+ "@web/test-runner",
3425
+ "puppeteer",
3426
+ "karma",
3427
+ "jasmine",
3428
+ "chai",
3429
+ "testing-library",
3430
+ "@ngneat/spectator",
3431
+ "wdio",
3432
+ "msw",
3433
+ "miragejs",
3434
+ "sinon"
3435
+ ], c = Object.keys(i).filter(
3436
+ (d) => a.find((v) => d.includes(v))
3437
+ );
3438
+ n.testPackages = Object.fromEntries(
3439
+ await Promise.all(
3440
+ c.map(async (d) => [d, (await nt(d))?.version])
3441
+ )
3442
+ ), n.hasRouterPackage = os(t);
3443
+ let u = as();
3444
+ u && (n.monorepo = u);
3445
+ try {
3446
+ let d = await (0, st.detect)({ cwd: (0, A.getProjectRoot)() }), v = await (0, st.getNpmVersion)(d);
3447
+ n.packageManager = {
3448
+ type: d,
3449
+ version: v
3450
+ };
3451
+ } catch {
3452
+ }
3453
+ n.hasCustomBabel = !!r.babel, n.hasCustomWebpack = !!r.webpackFinal, n.hasStaticDirs = !!r.staticDirs, typeof r.typescript == "object" && (n.
3454
+ typescriptOptions = r.typescript);
3455
+ let l = await ns(r);
3456
+ typeof r.refs == "object" && (n.refCount = Object.keys(r.refs).length), typeof r.features == "object" && (n.features = r.features);
3457
+ let f = {};
3458
+ r.addons && r.addons.forEach((d) => {
3459
+ let v, ge;
3460
+ typeof d == "string" ? v = xr(d) : (d.name.includes("addon-essentials") && (ge = d.options), v = xr(d.name)), f[v] = {
3461
+ options: ge,
3462
+ version: void 0
3463
+ };
3464
+ });
3465
+ let x = Xi(t);
3466
+ x && (f.chromatic = {
3467
+ version: void 0,
3468
+ versionSpecifier: x,
3469
+ options: void 0
3470
+ }), (await yr(f)).forEach(({ name: d, version: v }) => {
3471
+ f[d].version = v;
3472
+ });
3473
+ let m = Object.keys(f), y = Object.keys(i).filter((d) => d.includes("storybook") && !m.includes(d)).reduce((d, v) => ({
3474
+ ...d,
3475
+ [v]: { version: void 0 }
3476
+ }), {});
3477
+ (await yr(y)).forEach(({ name: d, version: v }) => {
3478
+ y[d].version = v;
3479
+ });
3480
+ let S = i.typescript ? "typescript" : "javascript", k = !!i["eslint-plugin-storybook"], E = (0, A.getStorybookInfo)(t);
3481
+ try {
3482
+ let { previewConfig: d } = E;
3483
+ if (d) {
3484
+ let v = await (0, ls.readConfig)(d), ge = !!(v.getFieldNode(["globals"]) || v.getFieldNode(["globalTypes"]));
3485
+ n.preview = { ...n.preview, usesGlobals: ge };
3486
+ }
3487
+ } catch {
3488
+ }
3489
+ let O = y[E.frameworkPackage]?.version, _ = await cs(), G = await Yi((0, us.dirname)(e));
3490
+ return {
3491
+ ...n,
3492
+ ...l,
3493
+ portableStoriesFileCount: _,
3494
+ applicationFileCount: G,
3495
+ storybookVersion: O,
3496
+ storybookVersionSpecifier: E.version,
3497
+ language: S,
3498
+ storybookPackages: y,
3499
+ addons: f,
3500
+ hasStorybookEslint: k
3501
+ };
3502
+ }, "computeStorybookMetadata");
3503
+ async function fl() {
3504
+ let e = await Lt(process.cwd());
3505
+ return e ? {
3506
+ packageJsonPath: e,
3507
+ packageJson: await ko(e) || {}
3508
+ } : {
3509
+ packageJsonPath: process.cwd(),
3510
+ packageJson: {}
3511
+ };
3512
+ }
3513
+ o(fl, "getPackageJsonDetails");
3514
+ var it, Sr = /* @__PURE__ */ o(async (e) => {
3515
+ if (it)
3516
+ return it;
3517
+ let { packageJson: t, packageJsonPath: r } = await fl(), n = (e || (0, A.getStorybookConfiguration)(
3518
+ String(t?.scripts?.storybook || ""),
3519
+ "-c",
3520
+ "--config-dir"
3521
+ )) ?? ".storybook", i = await (0, A.loadMainConfig)({ configDir: n });
3522
+ return it = await fs({ mainConfig: i, packageJson: t, packageJsonPath: r }), it;
3523
+ }, "getStorybookMetadata");
3524
+
3525
+ // src/telemetry/telemetry.ts
3526
+ var Es = b(require("node:os"), 1), Ts = b(ds(), 1);
3527
+
3528
+ // ../node_modules/nanoid/index.js
3529
+ var wr = require("crypto");
3530
+
3531
+ // ../node_modules/nanoid/url-alphabet/index.js
3532
+ var ms = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3533
+
3534
+ // ../node_modules/nanoid/index.js
3535
+ var pl = 128, M, Q, dl = /* @__PURE__ */ o((e) => {
3536
+ !M || M.length < e ? (M = Buffer.allocUnsafe(e * pl), (0, wr.randomFillSync)(M), Q = 0) : Q + e > M.length && ((0, wr.randomFillSync)(M), Q =
3537
+ 0), Q += e;
3538
+ }, "fillPool");
3539
+ var he = /* @__PURE__ */ o((e = 21) => {
3540
+ dl(e -= 0);
3541
+ let t = "";
3542
+ for (let r = Q - e; r < Q; r++)
3543
+ t += ms[M[r] & 63];
3544
+ return t;
3545
+ }, "nanoid");
3546
+
3547
+ // src/telemetry/anonymous-id.ts
3548
+ var ys = require("node:path"), gs = require("storybook/internal/common"), bs = require("child_process");
3549
+
3550
+ // src/telemetry/one-way-hash.ts
3551
+ var hs = require("crypto");
3552
+ var ct = /* @__PURE__ */ o((e) => {
3553
+ let t = (0, hs.createHash)("sha256");
3554
+ return t.update("storybook-telemetry-salt"), t.update(e), t.digest("hex");
3555
+ }, "oneWayHash");
3556
+
3557
+ // src/telemetry/anonymous-id.ts
3558
+ function ml(e) {
3559
+ let n = e.trim().replace(/#.*$/, "").replace(/^.*@/, "").replace(/^.*\/\//, "");
3560
+ return (n.endsWith(".git") ? n : `${n}.git`).replace(":", "/");
3561
+ }
3562
+ o(ml, "normalizeGitUrl");
3563
+ function hl(e, t) {
3564
+ return `${ml(e)}${lr(t)}`;
3565
+ }
3566
+ o(hl, "unhashedProjectId");
3567
+ var ut, xs = /* @__PURE__ */ o(() => {
3568
+ if (ut)
3569
+ return ut;
3570
+ try {
3571
+ let e = (0, gs.getProjectRoot)(), t = (0, ys.relative)(e, process.cwd()), r = (0, bs.execSync)("git config --local --get remote.origin.u\
3572
+ rl", {
3573
+ timeout: 1e3,
3574
+ stdio: "pipe"
3575
+ });
3576
+ ut = ct(hl(String(r), t));
3577
+ } catch {
3578
+ }
3579
+ return ut;
3580
+ }, "getAnonymousProjectId");
3581
+
3582
+ // src/telemetry/event-cache.ts
3583
+ var lt = require("storybook/internal/common");
3584
+ var vr = Promise.resolve(), yl = /* @__PURE__ */ o(async (e, t) => {
3585
+ let r = await lt.cache.get("lastEvents") || {};
3586
+ r[e] = { body: t, timestamp: Date.now() }, await lt.cache.set("lastEvents", r);
3587
+ }, "setHelper"), ws = /* @__PURE__ */ o(async (e, t) => (await vr, vr = yl(e, t), vr), "set");
3588
+ var gl = /* @__PURE__ */ o((e) => {
3589
+ let { body: t, timestamp: r } = e;
3590
+ return {
3591
+ timestamp: r,
3592
+ eventType: t?.eventType,
3593
+ eventId: t?.eventId,
3594
+ sessionId: t?.sessionId
3595
+ };
3596
+ }, "upgradeFields"), bl = ["init", "upgrade"], xl = ["build", "dev", "error"], Ss = /* @__PURE__ */ o((e, t) => {
3597
+ let r = t.map((n) => e?.[n]).filter(Boolean).sort((n, i) => i.timestamp - n.timestamp);
3598
+ return r.length > 0 ? r[0] : void 0;
3599
+ }, "lastEvent"), vs = /* @__PURE__ */ o(async (e = void 0) => {
3600
+ let t = e || await lt.cache.get("lastEvents") || {}, r = Ss(t, bl), n = Ss(t, xl);
3601
+ if (r)
3602
+ return !n?.timestamp || r.timestamp > n.timestamp ? gl(r) : void 0;
3603
+ }, "getPrecedingUpgrade");
3604
+
3605
+ // src/telemetry/fetch.ts
3606
+ var Ps = global.fetch;
3607
+
3608
+ // src/telemetry/session-id.ts
3609
+ var Pr = require("storybook/internal/common");
3610
+ var Sl = 1e3 * 60 * 60 * 2, ye;
3611
+ var Er = /* @__PURE__ */ o(async () => {
3612
+ let e = Date.now();
3613
+ if (!ye) {
3614
+ let t = await Pr.cache.get("session");
3615
+ t && t.lastUsed >= e - Sl ? ye = t.id : ye = he();
3616
+ }
3617
+ return await Pr.cache.set("session", { id: ye, lastUsed: e }), ye;
3618
+ }, "getSessionId");
3619
+
3620
+ // src/telemetry/telemetry.ts
3621
+ var wl = (0, Ts.default)(Ps), vl = process.env.STORYBOOK_TELEMETRY_URL || "https://storybook.js.org/event-log", ft = [], ks = /* @__PURE__ */ o(
3622
+ (e, t) => {
3623
+ Tr[e] = t;
3624
+ }, "addToGlobalContext"), Pl = /* @__PURE__ */ o(() => {
3625
+ try {
3626
+ let e = Es.platform();
3627
+ return e === "win32" ? "Windows" : e === "darwin" ? "macOS" : e === "linux" ? "Linux" : `Other: ${e}`;
3628
+ } catch {
3629
+ return "Unknown";
3630
+ }
3631
+ }, "getOperatingSystem"), Tr = {
3632
+ inCI: !!process.env.CI,
3633
+ isTTY: process.stdout.isTTY,
3634
+ platform: Pl(),
3635
+ nodeVersion: process.versions.node
3636
+ }, El = /* @__PURE__ */ o(async (e, t, r) => {
3637
+ let { eventType: n, payload: i, metadata: s, ...a } = e, c = await Er(), u = he(), l = { ...a, eventType: n, eventId: u, sessionId: c, metadata: s,
3638
+ payload: i, context: t };
3639
+ return wl(vl, {
3640
+ method: "post",
3641
+ body: JSON.stringify(l),
3642
+ headers: { "Content-Type": "application/json" },
3643
+ retries: 3,
3644
+ retryOn: [503, 504],
3645
+ retryDelay: /* @__PURE__ */ o((f) => 2 ** f * (typeof r?.retryDelay == "number" && !Number.isNaN(r?.retryDelay) ? r.retryDelay : 1e3), "\
3646
+ retryDelay")
3647
+ });
3648
+ }, "prepareRequest");
3649
+ async function Is(e, t = { retryDelay: 1e3, immediate: !1 }) {
3650
+ let { eventType: r, payload: n, metadata: i, ...s } = e, a = t.stripMetadata ? Tr : {
3651
+ ...Tr,
3652
+ anonymousId: xs()
3653
+ }, c;
3654
+ try {
3655
+ c = El(e, a, t), ft.push(c), t.immediate ? await Promise.all(ft) : await c;
3656
+ let u = await Er(), l = he(), f = { ...s, eventType: r, eventId: l, sessionId: u, metadata: i, payload: n, context: a };
3657
+ await ws(r, f);
3658
+ } catch {
3659
+ } finally {
3660
+ ft = ft.filter((u) => u !== c);
3661
+ }
3662
+ }
3663
+ o(Is, "sendTelemetry");
3664
+
3665
+ // src/telemetry/index.ts
3666
+ var Tl = /* @__PURE__ */ o((e) => e.startsWith("example-button--") || e.startsWith("example-header--") || e.startsWith("example-page--"), "i\
3667
+ sExampleStoryId"), kl = /* @__PURE__ */ o(async (e, t = {}, r = {}) => {
3668
+ e !== "boot" && r.notify !== !1 && await _r();
3669
+ let n = {
3670
+ eventType: e,
3671
+ payload: t
3672
+ };
3673
+ try {
3674
+ r?.stripMetadata || (n.metadata = await Sr(r?.configDir));
3675
+ } catch (i) {
3676
+ n.payload.metadataErrorMessage = ee(i).message, r?.enableCrashReports && (n.payload.metadataError = ee(i));
3677
+ } finally {
3678
+ let { error: i } = n.payload;
3679
+ i && (n.payload.error = ee(i)), (!n.payload.error || r?.enableCrashReports) && (process.env?.STORYBOOK_TELEMETRY_DEBUG && (kr.logger.info(
3680
+ `
3681
+ [telemetry]`), kr.logger.info(JSON.stringify(n, null, 2))), await Is(n, r));
3682
+ }
3683
+ }, "telemetry");