@storybook/builder-webpack5 10.1.0-alpha.1 → 10.1.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,91 +1,34 @@
1
- import CJS_COMPAT_NODE_URL_o0h2pkg2c5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_o0h2pkg2c5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_o0h2pkg2c5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_m38t2lu80n from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_m38t2lu80n from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_m38t2lu80n from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_o0h2pkg2c5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_o0h2pkg2c5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_o0h2pkg2c5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_m38t2lu80n.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_m38t2lu80n.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_m38t2lu80n.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  getVirtualModules
14
- } from "./_node-chunks/chunk-7N6JQ3AR.js";
14
+ } from "./_node-chunks/chunk-EGL5WHAF.js";
15
15
  import {
16
16
  __commonJS,
17
- __name,
18
17
  __require,
19
18
  __toESM
20
- } from "./_node-chunks/chunk-TMJDR5EF.js";
19
+ } from "./_node-chunks/chunk-A3CZ3LUF.js";
21
20
 
22
21
  // ../../node_modules/pretty-hrtime/index.js
23
22
  var require_pretty_hrtime = __commonJS({
24
23
  "../../node_modules/pretty-hrtime/index.js"(exports, module) {
25
24
  "use strict";
26
- var minimalDesc = ["h", "min", "s", "ms", "\u03BCs", "ns"];
27
- var verboseDesc = ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"];
28
- var convert = [60 * 60, 60, 1, 1e6, 1e3, 1];
25
+ var minimalDesc = ["h", "min", "s", "ms", "\u03BCs", "ns"], verboseDesc = ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"], convert = [3600, 60, 1, 1e6, 1e3, 1];
29
26
  module.exports = function(source, opts) {
30
27
  var verbose, precise, i, spot, sourceAtStep, valAtStep, decimals, strAtStep, results, totalSeconds;
31
- verbose = false;
32
- precise = false;
33
- if (opts) {
34
- verbose = opts.verbose || false;
35
- precise = opts.precise || false;
36
- }
37
- if (!Array.isArray(source) || source.length !== 2) {
38
- return "";
39
- }
40
- if (typeof source[0] !== "number" || typeof source[1] !== "number") {
28
+ if (verbose = !1, precise = !1, opts && (verbose = opts.verbose || !1, precise = opts.precise || !1), !Array.isArray(source) || source.length !== 2 || typeof source[0] != "number" || typeof source[1] != "number")
41
29
  return "";
42
- }
43
- if (source[1] < 0) {
44
- totalSeconds = source[0] + source[1] / 1e9;
45
- source[0] = parseInt(totalSeconds);
46
- source[1] = parseFloat((totalSeconds % 1).toPrecision(9)) * 1e9;
47
- }
48
- results = "";
49
- for (i = 0; i < 6; i++) {
50
- spot = i < 3 ? 0 : 1;
51
- sourceAtStep = source[spot];
52
- if (i !== 3 && i !== 0) {
53
- sourceAtStep = sourceAtStep % convert[i - 1];
54
- }
55
- if (i === 2) {
56
- sourceAtStep += source[1] / 1e9;
57
- }
58
- valAtStep = sourceAtStep / convert[i];
59
- if (valAtStep >= 1) {
60
- if (verbose) {
61
- valAtStep = Math.floor(valAtStep);
62
- }
63
- if (!precise) {
64
- decimals = valAtStep >= 10 ? 0 : 2;
65
- strAtStep = valAtStep.toFixed(decimals);
66
- } else {
67
- strAtStep = valAtStep.toString();
68
- }
69
- if (strAtStep.indexOf(".") > -1 && strAtStep[strAtStep.length - 1] === "0") {
70
- strAtStep = strAtStep.replace(/\.?0+$/, "");
71
- }
72
- if (results) {
73
- results += " ";
74
- }
75
- results += strAtStep;
76
- if (verbose) {
77
- results += " " + verboseDesc[i];
78
- if (strAtStep !== "1") {
79
- results += "s";
80
- }
81
- } else {
82
- results += " " + minimalDesc[i];
83
- }
84
- if (!verbose) {
85
- break;
86
- }
87
- }
88
- }
30
+ for (source[1] < 0 && (totalSeconds = source[0] + source[1] / 1e9, source[0] = parseInt(totalSeconds), source[1] = parseFloat((totalSeconds % 1).toPrecision(9)) * 1e9), results = "", i = 0; i < 6 && (spot = i < 3 ? 0 : 1, sourceAtStep = source[spot], i !== 3 && i !== 0 && (sourceAtStep = sourceAtStep % convert[i - 1]), i === 2 && (sourceAtStep += source[1] / 1e9), valAtStep = sourceAtStep / convert[i], !(valAtStep >= 1 && (verbose && (valAtStep = Math.floor(valAtStep)), precise ? strAtStep = valAtStep.toString() : (decimals = valAtStep >= 10 ? 0 : 2, strAtStep = valAtStep.toFixed(decimals)), strAtStep.indexOf(".") > -1 && strAtStep[strAtStep.length - 1] === "0" && (strAtStep = strAtStep.replace(/\.?0+$/, "")), results && (results += " "), results += strAtStep, verbose ? (results += " " + verboseDesc[i], strAtStep !== "1" && (results += "s")) : results += " " + minimalDesc[i], !verbose))); i++)
31
+ ;
89
32
  return results;
90
33
  };
91
34
  }
@@ -94,19 +37,13 @@ var require_pretty_hrtime = __commonJS({
94
37
  // ../../node_modules/totalist/sync/index.js
95
38
  var require_sync = __commonJS({
96
39
  "../../node_modules/totalist/sync/index.js"(exports) {
97
- var { join: join2, resolve: resolve2 } = __require("path");
98
- var { readdirSync, statSync } = __require("fs");
40
+ var { join: join2, resolve: resolve2 } = __require("path"), { readdirSync, statSync } = __require("fs");
99
41
  function totalist(dir, callback, pre = "") {
100
42
  dir = resolve2(".", dir);
101
- let arr = readdirSync(dir);
102
- let i = 0, abs, stats;
103
- for (; i < arr.length; i++) {
104
- abs = join2(dir, arr[i]);
105
- stats = statSync(abs);
106
- stats.isDirectory() ? totalist(abs, callback, join2(pre, arr[i])) : callback(join2(pre, arr[i]), abs, stats);
107
- }
43
+ let arr = readdirSync(dir), i = 0, abs, stats;
44
+ for (; i < arr.length; i++)
45
+ abs = join2(dir, arr[i]), stats = statSync(abs), stats.isDirectory() ? totalist(abs, callback, join2(pre, arr[i])) : callback(join2(pre, arr[i]), abs, stats);
108
46
  }
109
- __name(totalist, "totalist");
110
47
  exports.totalist = totalist;
111
48
  }
112
49
  });
@@ -123,22 +60,10 @@ var require_build = __commonJS({
123
60
  let pathname = raw, search = "", query, hash;
124
61
  if (raw.length > 1) {
125
62
  let idx = raw.indexOf("#", 1);
126
- if (idx !== -1) {
127
- hash = raw.substring(idx);
128
- pathname = raw.substring(0, idx);
129
- }
130
- idx = pathname.indexOf("?", 1);
131
- if (idx !== -1) {
132
- search = pathname.substring(idx);
133
- pathname = pathname.substring(0, idx);
134
- if (search.length > 1) {
135
- query = qs.parse(search.substring(1));
136
- }
137
- }
63
+ idx !== -1 && (hash = raw.substring(idx), pathname = raw.substring(0, idx)), idx = pathname.indexOf("?", 1), idx !== -1 && (search = pathname.substring(idx), pathname = pathname.substring(0, idx), search.length > 1 && (query = qs.parse(search.substring(1))));
138
64
  }
139
65
  return req._parsedUrl = { pathname, search, query, hash, raw };
140
66
  }
141
- __name(parse2, "parse");
142
67
  exports.parse = parse2;
143
68
  }
144
69
  });
@@ -151,447 +76,445 @@ var require_mrmime = __commonJS({
151
76
  "3gp": "video/3gpp",
152
77
  "3gpp": "video/3gpp",
153
78
  "3mf": "model/3mf",
154
- "aac": "audio/aac",
155
- "ac": "application/pkix-attr-cert",
156
- "adp": "audio/adpcm",
157
- "adts": "audio/aac",
158
- "ai": "application/postscript",
159
- "aml": "application/automationml-aml+xml",
160
- "amlx": "application/automationml-amlx+zip",
161
- "amr": "audio/amr",
162
- "apng": "image/apng",
163
- "appcache": "text/cache-manifest",
164
- "appinstaller": "application/appinstaller",
165
- "appx": "application/appx",
166
- "appxbundle": "application/appxbundle",
167
- "asc": "application/pgp-keys",
168
- "atom": "application/atom+xml",
169
- "atomcat": "application/atomcat+xml",
170
- "atomdeleted": "application/atomdeleted+xml",
171
- "atomsvc": "application/atomsvc+xml",
172
- "au": "audio/basic",
173
- "avci": "image/avci",
174
- "avcs": "image/avcs",
175
- "avif": "image/avif",
176
- "aw": "application/applixware",
177
- "bdoc": "application/bdoc",
178
- "bin": "application/octet-stream",
179
- "bmp": "image/bmp",
180
- "bpk": "application/octet-stream",
181
- "btf": "image/prs.btif",
182
- "btif": "image/prs.btif",
183
- "buffer": "application/octet-stream",
184
- "ccxml": "application/ccxml+xml",
185
- "cdfx": "application/cdfx+xml",
186
- "cdmia": "application/cdmi-capability",
187
- "cdmic": "application/cdmi-container",
188
- "cdmid": "application/cdmi-domain",
189
- "cdmio": "application/cdmi-object",
190
- "cdmiq": "application/cdmi-queue",
191
- "cer": "application/pkix-cert",
192
- "cgm": "image/cgm",
193
- "cjs": "application/node",
194
- "class": "application/java-vm",
195
- "coffee": "text/coffeescript",
196
- "conf": "text/plain",
197
- "cpl": "application/cpl+xml",
198
- "cpt": "application/mac-compactpro",
199
- "crl": "application/pkix-crl",
200
- "css": "text/css",
201
- "csv": "text/csv",
202
- "cu": "application/cu-seeme",
203
- "cwl": "application/cwl",
204
- "cww": "application/prs.cww",
205
- "davmount": "application/davmount+xml",
206
- "dbk": "application/docbook+xml",
207
- "deb": "application/octet-stream",
208
- "def": "text/plain",
209
- "deploy": "application/octet-stream",
210
- "dib": "image/bmp",
79
+ aac: "audio/aac",
80
+ ac: "application/pkix-attr-cert",
81
+ adp: "audio/adpcm",
82
+ adts: "audio/aac",
83
+ ai: "application/postscript",
84
+ aml: "application/automationml-aml+xml",
85
+ amlx: "application/automationml-amlx+zip",
86
+ amr: "audio/amr",
87
+ apng: "image/apng",
88
+ appcache: "text/cache-manifest",
89
+ appinstaller: "application/appinstaller",
90
+ appx: "application/appx",
91
+ appxbundle: "application/appxbundle",
92
+ asc: "application/pgp-keys",
93
+ atom: "application/atom+xml",
94
+ atomcat: "application/atomcat+xml",
95
+ atomdeleted: "application/atomdeleted+xml",
96
+ atomsvc: "application/atomsvc+xml",
97
+ au: "audio/basic",
98
+ avci: "image/avci",
99
+ avcs: "image/avcs",
100
+ avif: "image/avif",
101
+ aw: "application/applixware",
102
+ bdoc: "application/bdoc",
103
+ bin: "application/octet-stream",
104
+ bmp: "image/bmp",
105
+ bpk: "application/octet-stream",
106
+ btf: "image/prs.btif",
107
+ btif: "image/prs.btif",
108
+ buffer: "application/octet-stream",
109
+ ccxml: "application/ccxml+xml",
110
+ cdfx: "application/cdfx+xml",
111
+ cdmia: "application/cdmi-capability",
112
+ cdmic: "application/cdmi-container",
113
+ cdmid: "application/cdmi-domain",
114
+ cdmio: "application/cdmi-object",
115
+ cdmiq: "application/cdmi-queue",
116
+ cer: "application/pkix-cert",
117
+ cgm: "image/cgm",
118
+ cjs: "application/node",
119
+ class: "application/java-vm",
120
+ coffee: "text/coffeescript",
121
+ conf: "text/plain",
122
+ cpl: "application/cpl+xml",
123
+ cpt: "application/mac-compactpro",
124
+ crl: "application/pkix-crl",
125
+ css: "text/css",
126
+ csv: "text/csv",
127
+ cu: "application/cu-seeme",
128
+ cwl: "application/cwl",
129
+ cww: "application/prs.cww",
130
+ davmount: "application/davmount+xml",
131
+ dbk: "application/docbook+xml",
132
+ deb: "application/octet-stream",
133
+ def: "text/plain",
134
+ deploy: "application/octet-stream",
135
+ dib: "image/bmp",
211
136
  "disposition-notification": "message/disposition-notification",
212
- "dist": "application/octet-stream",
213
- "distz": "application/octet-stream",
214
- "dll": "application/octet-stream",
215
- "dmg": "application/octet-stream",
216
- "dms": "application/octet-stream",
217
- "doc": "application/msword",
218
- "dot": "application/msword",
219
- "dpx": "image/dpx",
220
- "drle": "image/dicom-rle",
221
- "dsc": "text/prs.lines.tag",
222
- "dssc": "application/dssc+der",
223
- "dtd": "application/xml-dtd",
224
- "dump": "application/octet-stream",
225
- "dwd": "application/atsc-dwd+xml",
226
- "ear": "application/java-archive",
227
- "ecma": "application/ecmascript",
228
- "elc": "application/octet-stream",
229
- "emf": "image/emf",
230
- "eml": "message/rfc822",
231
- "emma": "application/emma+xml",
232
- "emotionml": "application/emotionml+xml",
233
- "eps": "application/postscript",
234
- "epub": "application/epub+zip",
235
- "exe": "application/octet-stream",
236
- "exi": "application/exi",
237
- "exp": "application/express",
238
- "exr": "image/aces",
239
- "ez": "application/andrew-inset",
240
- "fdf": "application/fdf",
241
- "fdt": "application/fdt+xml",
242
- "fits": "image/fits",
243
- "g3": "image/g3fax",
244
- "gbr": "application/rpki-ghostbusters",
245
- "geojson": "application/geo+json",
246
- "gif": "image/gif",
247
- "glb": "model/gltf-binary",
248
- "gltf": "model/gltf+json",
249
- "gml": "application/gml+xml",
250
- "gpx": "application/gpx+xml",
251
- "gram": "application/srgs",
252
- "grxml": "application/srgs+xml",
253
- "gxf": "application/gxf",
254
- "gz": "application/gzip",
255
- "h261": "video/h261",
256
- "h263": "video/h263",
257
- "h264": "video/h264",
258
- "heic": "image/heic",
259
- "heics": "image/heic-sequence",
260
- "heif": "image/heif",
261
- "heifs": "image/heif-sequence",
262
- "hej2": "image/hej2k",
263
- "held": "application/atsc-held+xml",
264
- "hjson": "application/hjson",
265
- "hlp": "application/winhlp",
266
- "hqx": "application/mac-binhex40",
267
- "hsj2": "image/hsj2",
268
- "htm": "text/html",
269
- "html": "text/html",
270
- "ics": "text/calendar",
271
- "ief": "image/ief",
272
- "ifb": "text/calendar",
273
- "iges": "model/iges",
274
- "igs": "model/iges",
275
- "img": "application/octet-stream",
276
- "in": "text/plain",
277
- "ini": "text/plain",
278
- "ink": "application/inkml+xml",
279
- "inkml": "application/inkml+xml",
280
- "ipfix": "application/ipfix",
281
- "iso": "application/octet-stream",
282
- "its": "application/its+xml",
283
- "jade": "text/jade",
284
- "jar": "application/java-archive",
285
- "jhc": "image/jphc",
286
- "jls": "image/jls",
287
- "jp2": "image/jp2",
288
- "jpe": "image/jpeg",
289
- "jpeg": "image/jpeg",
290
- "jpf": "image/jpx",
291
- "jpg": "image/jpeg",
292
- "jpg2": "image/jp2",
293
- "jpgm": "image/jpm",
294
- "jpgv": "video/jpeg",
295
- "jph": "image/jph",
296
- "jpm": "image/jpm",
297
- "jpx": "image/jpx",
298
- "js": "text/javascript",
299
- "json": "application/json",
300
- "json5": "application/json5",
301
- "jsonld": "application/ld+json",
302
- "jsonml": "application/jsonml+json",
303
- "jsx": "text/jsx",
304
- "jt": "model/jt",
305
- "jxl": "image/jxl",
306
- "jxr": "image/jxr",
307
- "jxra": "image/jxra",
308
- "jxrs": "image/jxrs",
309
- "jxs": "image/jxs",
310
- "jxsc": "image/jxsc",
311
- "jxsi": "image/jxsi",
312
- "jxss": "image/jxss",
313
- "kar": "audio/midi",
314
- "ktx": "image/ktx",
315
- "ktx2": "image/ktx2",
316
- "less": "text/less",
317
- "lgr": "application/lgr+xml",
318
- "list": "text/plain",
319
- "litcoffee": "text/coffeescript",
320
- "log": "text/plain",
321
- "lostxml": "application/lost+xml",
322
- "lrf": "application/octet-stream",
323
- "m1v": "video/mpeg",
324
- "m21": "application/mp21",
325
- "m2a": "audio/mpeg",
326
- "m2t": "video/mp2t",
327
- "m2ts": "video/mp2t",
328
- "m2v": "video/mpeg",
329
- "m3a": "audio/mpeg",
330
- "m4a": "audio/mp4",
331
- "m4p": "application/mp4",
332
- "m4s": "video/iso.segment",
333
- "ma": "application/mathematica",
334
- "mads": "application/mads+xml",
335
- "maei": "application/mmt-aei+xml",
336
- "man": "text/troff",
337
- "manifest": "text/cache-manifest",
338
- "map": "application/json",
339
- "mar": "application/octet-stream",
340
- "markdown": "text/markdown",
341
- "mathml": "application/mathml+xml",
342
- "mb": "application/mathematica",
343
- "mbox": "application/mbox",
344
- "md": "text/markdown",
345
- "mdx": "text/mdx",
346
- "me": "text/troff",
347
- "mesh": "model/mesh",
348
- "meta4": "application/metalink4+xml",
349
- "metalink": "application/metalink+xml",
350
- "mets": "application/mets+xml",
351
- "mft": "application/rpki-manifest",
352
- "mid": "audio/midi",
353
- "midi": "audio/midi",
354
- "mime": "message/rfc822",
355
- "mj2": "video/mj2",
356
- "mjp2": "video/mj2",
357
- "mjs": "text/javascript",
358
- "mml": "text/mathml",
359
- "mods": "application/mods+xml",
360
- "mov": "video/quicktime",
361
- "mp2": "audio/mpeg",
362
- "mp21": "application/mp21",
363
- "mp2a": "audio/mpeg",
364
- "mp3": "audio/mpeg",
365
- "mp4": "video/mp4",
366
- "mp4a": "audio/mp4",
367
- "mp4s": "application/mp4",
368
- "mp4v": "video/mp4",
369
- "mpd": "application/dash+xml",
370
- "mpe": "video/mpeg",
371
- "mpeg": "video/mpeg",
372
- "mpf": "application/media-policy-dataset+xml",
373
- "mpg": "video/mpeg",
374
- "mpg4": "video/mp4",
375
- "mpga": "audio/mpeg",
376
- "mpp": "application/dash-patch+xml",
377
- "mrc": "application/marc",
378
- "mrcx": "application/marcxml+xml",
379
- "ms": "text/troff",
380
- "mscml": "application/mediaservercontrol+xml",
381
- "msh": "model/mesh",
382
- "msi": "application/octet-stream",
383
- "msix": "application/msix",
384
- "msixbundle": "application/msixbundle",
385
- "msm": "application/octet-stream",
386
- "msp": "application/octet-stream",
387
- "mtl": "model/mtl",
388
- "mts": "video/mp2t",
389
- "musd": "application/mmt-usd+xml",
390
- "mxf": "application/mxf",
391
- "mxmf": "audio/mobile-xmf",
392
- "mxml": "application/xv+xml",
393
- "n3": "text/n3",
394
- "nb": "application/mathematica",
395
- "nq": "application/n-quads",
396
- "nt": "application/n-triples",
397
- "obj": "model/obj",
398
- "oda": "application/oda",
399
- "oga": "audio/ogg",
400
- "ogg": "audio/ogg",
401
- "ogv": "video/ogg",
402
- "ogx": "application/ogg",
403
- "omdoc": "application/omdoc+xml",
404
- "onepkg": "application/onenote",
405
- "onetmp": "application/onenote",
406
- "onetoc": "application/onenote",
407
- "onetoc2": "application/onenote",
408
- "opf": "application/oebps-package+xml",
409
- "opus": "audio/ogg",
410
- "otf": "font/otf",
411
- "owl": "application/rdf+xml",
412
- "oxps": "application/oxps",
413
- "p10": "application/pkcs10",
414
- "p7c": "application/pkcs7-mime",
415
- "p7m": "application/pkcs7-mime",
416
- "p7s": "application/pkcs7-signature",
417
- "p8": "application/pkcs8",
418
- "pdf": "application/pdf",
419
- "pfr": "application/font-tdpfr",
420
- "pgp": "application/pgp-encrypted",
421
- "pkg": "application/octet-stream",
422
- "pki": "application/pkixcmp",
423
- "pkipath": "application/pkix-pkipath",
424
- "pls": "application/pls+xml",
425
- "png": "image/png",
426
- "prc": "model/prc",
427
- "prf": "application/pics-rules",
428
- "provx": "application/provenance+xml",
429
- "ps": "application/postscript",
430
- "pskcxml": "application/pskc+xml",
431
- "pti": "image/prs.pti",
432
- "qt": "video/quicktime",
433
- "raml": "application/raml+yaml",
434
- "rapd": "application/route-apd+xml",
435
- "rdf": "application/rdf+xml",
436
- "relo": "application/p2p-overlay+xml",
437
- "rif": "application/reginfo+xml",
438
- "rl": "application/resource-lists+xml",
439
- "rld": "application/resource-lists-diff+xml",
440
- "rmi": "audio/midi",
441
- "rnc": "application/relax-ng-compact-syntax",
442
- "rng": "application/xml",
443
- "roa": "application/rpki-roa",
444
- "roff": "text/troff",
445
- "rq": "application/sparql-query",
446
- "rs": "application/rls-services+xml",
447
- "rsat": "application/atsc-rsat+xml",
448
- "rsd": "application/rsd+xml",
449
- "rsheet": "application/urc-ressheet+xml",
450
- "rss": "application/rss+xml",
451
- "rtf": "text/rtf",
452
- "rtx": "text/richtext",
453
- "rusd": "application/route-usd+xml",
454
- "s3m": "audio/s3m",
455
- "sbml": "application/sbml+xml",
456
- "scq": "application/scvp-cv-request",
457
- "scs": "application/scvp-cv-response",
458
- "sdp": "application/sdp",
459
- "senmlx": "application/senml+xml",
460
- "sensmlx": "application/sensml+xml",
461
- "ser": "application/java-serialized-object",
462
- "setpay": "application/set-payment-initiation",
463
- "setreg": "application/set-registration-initiation",
464
- "sgi": "image/sgi",
465
- "sgm": "text/sgml",
466
- "sgml": "text/sgml",
467
- "shex": "text/shex",
468
- "shf": "application/shf+xml",
469
- "shtml": "text/html",
470
- "sieve": "application/sieve",
471
- "sig": "application/pgp-signature",
472
- "sil": "audio/silk",
473
- "silo": "model/mesh",
474
- "siv": "application/sieve",
475
- "slim": "text/slim",
476
- "slm": "text/slim",
477
- "sls": "application/route-s-tsid+xml",
478
- "smi": "application/smil+xml",
479
- "smil": "application/smil+xml",
480
- "snd": "audio/basic",
481
- "so": "application/octet-stream",
482
- "spdx": "text/spdx",
483
- "spp": "application/scvp-vp-response",
484
- "spq": "application/scvp-vp-request",
485
- "spx": "audio/ogg",
486
- "sql": "application/sql",
487
- "sru": "application/sru+xml",
488
- "srx": "application/sparql-results+xml",
489
- "ssdl": "application/ssdl+xml",
490
- "ssml": "application/ssml+xml",
491
- "stk": "application/hyperstudio",
492
- "stl": "model/stl",
493
- "stpx": "model/step+xml",
494
- "stpxz": "model/step-xml+zip",
495
- "stpz": "model/step+zip",
496
- "styl": "text/stylus",
497
- "stylus": "text/stylus",
498
- "svg": "image/svg+xml",
499
- "svgz": "image/svg+xml",
500
- "swidtag": "application/swid+xml",
501
- "t": "text/troff",
502
- "t38": "image/t38",
503
- "td": "application/urc-targetdesc+xml",
504
- "tei": "application/tei+xml",
505
- "teicorpus": "application/tei+xml",
506
- "text": "text/plain",
507
- "tfi": "application/thraud+xml",
508
- "tfx": "image/tiff-fx",
509
- "tif": "image/tiff",
510
- "tiff": "image/tiff",
511
- "toml": "application/toml",
512
- "tr": "text/troff",
513
- "trig": "application/trig",
514
- "ts": "video/mp2t",
515
- "tsd": "application/timestamped-data",
516
- "tsv": "text/tab-separated-values",
517
- "ttc": "font/collection",
518
- "ttf": "font/ttf",
519
- "ttl": "text/turtle",
520
- "ttml": "application/ttml+xml",
521
- "txt": "text/plain",
522
- "u3d": "model/u3d",
523
- "u8dsn": "message/global-delivery-status",
524
- "u8hdr": "message/global-headers",
525
- "u8mdn": "message/global-disposition-notification",
526
- "u8msg": "message/global",
527
- "ubj": "application/ubjson",
528
- "uri": "text/uri-list",
529
- "uris": "text/uri-list",
530
- "urls": "text/uri-list",
531
- "vcard": "text/vcard",
532
- "vrml": "model/vrml",
533
- "vtt": "text/vtt",
534
- "vxml": "application/voicexml+xml",
535
- "war": "application/java-archive",
536
- "wasm": "application/wasm",
537
- "wav": "audio/wav",
538
- "weba": "audio/webm",
539
- "webm": "video/webm",
540
- "webmanifest": "application/manifest+json",
541
- "webp": "image/webp",
542
- "wgsl": "text/wgsl",
543
- "wgt": "application/widget",
544
- "wif": "application/watcherinfo+xml",
545
- "wmf": "image/wmf",
546
- "woff": "font/woff",
547
- "woff2": "font/woff2",
548
- "wrl": "model/vrml",
549
- "wsdl": "application/wsdl+xml",
550
- "wspolicy": "application/wspolicy+xml",
551
- "x3d": "model/x3d+xml",
552
- "x3db": "model/x3d+fastinfoset",
553
- "x3dbz": "model/x3d+binary",
554
- "x3dv": "model/x3d-vrml",
555
- "x3dvz": "model/x3d+vrml",
556
- "x3dz": "model/x3d+xml",
557
- "xaml": "application/xaml+xml",
558
- "xav": "application/xcap-att+xml",
559
- "xca": "application/xcap-caps+xml",
560
- "xcs": "application/calendar+xml",
561
- "xdf": "application/xcap-diff+xml",
562
- "xdssc": "application/dssc+xml",
563
- "xel": "application/xcap-el+xml",
564
- "xenc": "application/xenc+xml",
565
- "xer": "application/patch-ops-error+xml",
566
- "xfdf": "application/xfdf",
567
- "xht": "application/xhtml+xml",
568
- "xhtml": "application/xhtml+xml",
569
- "xhvml": "application/xv+xml",
570
- "xlf": "application/xliff+xml",
571
- "xm": "audio/xm",
572
- "xml": "text/xml",
573
- "xns": "application/xcap-ns+xml",
574
- "xop": "application/xop+xml",
575
- "xpl": "application/xproc+xml",
576
- "xsd": "application/xml",
577
- "xsf": "application/prs.xsf+xml",
578
- "xsl": "application/xml",
579
- "xslt": "application/xml",
580
- "xspf": "application/xspf+xml",
581
- "xvm": "application/xv+xml",
582
- "xvml": "application/xv+xml",
583
- "yaml": "text/yaml",
584
- "yang": "application/yang",
585
- "yin": "application/yin+xml",
586
- "yml": "text/yaml",
587
- "zip": "application/zip"
137
+ dist: "application/octet-stream",
138
+ distz: "application/octet-stream",
139
+ dll: "application/octet-stream",
140
+ dmg: "application/octet-stream",
141
+ dms: "application/octet-stream",
142
+ doc: "application/msword",
143
+ dot: "application/msword",
144
+ dpx: "image/dpx",
145
+ drle: "image/dicom-rle",
146
+ dsc: "text/prs.lines.tag",
147
+ dssc: "application/dssc+der",
148
+ dtd: "application/xml-dtd",
149
+ dump: "application/octet-stream",
150
+ dwd: "application/atsc-dwd+xml",
151
+ ear: "application/java-archive",
152
+ ecma: "application/ecmascript",
153
+ elc: "application/octet-stream",
154
+ emf: "image/emf",
155
+ eml: "message/rfc822",
156
+ emma: "application/emma+xml",
157
+ emotionml: "application/emotionml+xml",
158
+ eps: "application/postscript",
159
+ epub: "application/epub+zip",
160
+ exe: "application/octet-stream",
161
+ exi: "application/exi",
162
+ exp: "application/express",
163
+ exr: "image/aces",
164
+ ez: "application/andrew-inset",
165
+ fdf: "application/fdf",
166
+ fdt: "application/fdt+xml",
167
+ fits: "image/fits",
168
+ g3: "image/g3fax",
169
+ gbr: "application/rpki-ghostbusters",
170
+ geojson: "application/geo+json",
171
+ gif: "image/gif",
172
+ glb: "model/gltf-binary",
173
+ gltf: "model/gltf+json",
174
+ gml: "application/gml+xml",
175
+ gpx: "application/gpx+xml",
176
+ gram: "application/srgs",
177
+ grxml: "application/srgs+xml",
178
+ gxf: "application/gxf",
179
+ gz: "application/gzip",
180
+ h261: "video/h261",
181
+ h263: "video/h263",
182
+ h264: "video/h264",
183
+ heic: "image/heic",
184
+ heics: "image/heic-sequence",
185
+ heif: "image/heif",
186
+ heifs: "image/heif-sequence",
187
+ hej2: "image/hej2k",
188
+ held: "application/atsc-held+xml",
189
+ hjson: "application/hjson",
190
+ hlp: "application/winhlp",
191
+ hqx: "application/mac-binhex40",
192
+ hsj2: "image/hsj2",
193
+ htm: "text/html",
194
+ html: "text/html",
195
+ ics: "text/calendar",
196
+ ief: "image/ief",
197
+ ifb: "text/calendar",
198
+ iges: "model/iges",
199
+ igs: "model/iges",
200
+ img: "application/octet-stream",
201
+ in: "text/plain",
202
+ ini: "text/plain",
203
+ ink: "application/inkml+xml",
204
+ inkml: "application/inkml+xml",
205
+ ipfix: "application/ipfix",
206
+ iso: "application/octet-stream",
207
+ its: "application/its+xml",
208
+ jade: "text/jade",
209
+ jar: "application/java-archive",
210
+ jhc: "image/jphc",
211
+ jls: "image/jls",
212
+ jp2: "image/jp2",
213
+ jpe: "image/jpeg",
214
+ jpeg: "image/jpeg",
215
+ jpf: "image/jpx",
216
+ jpg: "image/jpeg",
217
+ jpg2: "image/jp2",
218
+ jpgm: "image/jpm",
219
+ jpgv: "video/jpeg",
220
+ jph: "image/jph",
221
+ jpm: "image/jpm",
222
+ jpx: "image/jpx",
223
+ js: "text/javascript",
224
+ json: "application/json",
225
+ json5: "application/json5",
226
+ jsonld: "application/ld+json",
227
+ jsonml: "application/jsonml+json",
228
+ jsx: "text/jsx",
229
+ jt: "model/jt",
230
+ jxl: "image/jxl",
231
+ jxr: "image/jxr",
232
+ jxra: "image/jxra",
233
+ jxrs: "image/jxrs",
234
+ jxs: "image/jxs",
235
+ jxsc: "image/jxsc",
236
+ jxsi: "image/jxsi",
237
+ jxss: "image/jxss",
238
+ kar: "audio/midi",
239
+ ktx: "image/ktx",
240
+ ktx2: "image/ktx2",
241
+ less: "text/less",
242
+ lgr: "application/lgr+xml",
243
+ list: "text/plain",
244
+ litcoffee: "text/coffeescript",
245
+ log: "text/plain",
246
+ lostxml: "application/lost+xml",
247
+ lrf: "application/octet-stream",
248
+ m1v: "video/mpeg",
249
+ m21: "application/mp21",
250
+ m2a: "audio/mpeg",
251
+ m2t: "video/mp2t",
252
+ m2ts: "video/mp2t",
253
+ m2v: "video/mpeg",
254
+ m3a: "audio/mpeg",
255
+ m4a: "audio/mp4",
256
+ m4p: "application/mp4",
257
+ m4s: "video/iso.segment",
258
+ ma: "application/mathematica",
259
+ mads: "application/mads+xml",
260
+ maei: "application/mmt-aei+xml",
261
+ man: "text/troff",
262
+ manifest: "text/cache-manifest",
263
+ map: "application/json",
264
+ mar: "application/octet-stream",
265
+ markdown: "text/markdown",
266
+ mathml: "application/mathml+xml",
267
+ mb: "application/mathematica",
268
+ mbox: "application/mbox",
269
+ md: "text/markdown",
270
+ mdx: "text/mdx",
271
+ me: "text/troff",
272
+ mesh: "model/mesh",
273
+ meta4: "application/metalink4+xml",
274
+ metalink: "application/metalink+xml",
275
+ mets: "application/mets+xml",
276
+ mft: "application/rpki-manifest",
277
+ mid: "audio/midi",
278
+ midi: "audio/midi",
279
+ mime: "message/rfc822",
280
+ mj2: "video/mj2",
281
+ mjp2: "video/mj2",
282
+ mjs: "text/javascript",
283
+ mml: "text/mathml",
284
+ mods: "application/mods+xml",
285
+ mov: "video/quicktime",
286
+ mp2: "audio/mpeg",
287
+ mp21: "application/mp21",
288
+ mp2a: "audio/mpeg",
289
+ mp3: "audio/mpeg",
290
+ mp4: "video/mp4",
291
+ mp4a: "audio/mp4",
292
+ mp4s: "application/mp4",
293
+ mp4v: "video/mp4",
294
+ mpd: "application/dash+xml",
295
+ mpe: "video/mpeg",
296
+ mpeg: "video/mpeg",
297
+ mpf: "application/media-policy-dataset+xml",
298
+ mpg: "video/mpeg",
299
+ mpg4: "video/mp4",
300
+ mpga: "audio/mpeg",
301
+ mpp: "application/dash-patch+xml",
302
+ mrc: "application/marc",
303
+ mrcx: "application/marcxml+xml",
304
+ ms: "text/troff",
305
+ mscml: "application/mediaservercontrol+xml",
306
+ msh: "model/mesh",
307
+ msi: "application/octet-stream",
308
+ msix: "application/msix",
309
+ msixbundle: "application/msixbundle",
310
+ msm: "application/octet-stream",
311
+ msp: "application/octet-stream",
312
+ mtl: "model/mtl",
313
+ mts: "video/mp2t",
314
+ musd: "application/mmt-usd+xml",
315
+ mxf: "application/mxf",
316
+ mxmf: "audio/mobile-xmf",
317
+ mxml: "application/xv+xml",
318
+ n3: "text/n3",
319
+ nb: "application/mathematica",
320
+ nq: "application/n-quads",
321
+ nt: "application/n-triples",
322
+ obj: "model/obj",
323
+ oda: "application/oda",
324
+ oga: "audio/ogg",
325
+ ogg: "audio/ogg",
326
+ ogv: "video/ogg",
327
+ ogx: "application/ogg",
328
+ omdoc: "application/omdoc+xml",
329
+ onepkg: "application/onenote",
330
+ onetmp: "application/onenote",
331
+ onetoc: "application/onenote",
332
+ onetoc2: "application/onenote",
333
+ opf: "application/oebps-package+xml",
334
+ opus: "audio/ogg",
335
+ otf: "font/otf",
336
+ owl: "application/rdf+xml",
337
+ oxps: "application/oxps",
338
+ p10: "application/pkcs10",
339
+ p7c: "application/pkcs7-mime",
340
+ p7m: "application/pkcs7-mime",
341
+ p7s: "application/pkcs7-signature",
342
+ p8: "application/pkcs8",
343
+ pdf: "application/pdf",
344
+ pfr: "application/font-tdpfr",
345
+ pgp: "application/pgp-encrypted",
346
+ pkg: "application/octet-stream",
347
+ pki: "application/pkixcmp",
348
+ pkipath: "application/pkix-pkipath",
349
+ pls: "application/pls+xml",
350
+ png: "image/png",
351
+ prc: "model/prc",
352
+ prf: "application/pics-rules",
353
+ provx: "application/provenance+xml",
354
+ ps: "application/postscript",
355
+ pskcxml: "application/pskc+xml",
356
+ pti: "image/prs.pti",
357
+ qt: "video/quicktime",
358
+ raml: "application/raml+yaml",
359
+ rapd: "application/route-apd+xml",
360
+ rdf: "application/rdf+xml",
361
+ relo: "application/p2p-overlay+xml",
362
+ rif: "application/reginfo+xml",
363
+ rl: "application/resource-lists+xml",
364
+ rld: "application/resource-lists-diff+xml",
365
+ rmi: "audio/midi",
366
+ rnc: "application/relax-ng-compact-syntax",
367
+ rng: "application/xml",
368
+ roa: "application/rpki-roa",
369
+ roff: "text/troff",
370
+ rq: "application/sparql-query",
371
+ rs: "application/rls-services+xml",
372
+ rsat: "application/atsc-rsat+xml",
373
+ rsd: "application/rsd+xml",
374
+ rsheet: "application/urc-ressheet+xml",
375
+ rss: "application/rss+xml",
376
+ rtf: "text/rtf",
377
+ rtx: "text/richtext",
378
+ rusd: "application/route-usd+xml",
379
+ s3m: "audio/s3m",
380
+ sbml: "application/sbml+xml",
381
+ scq: "application/scvp-cv-request",
382
+ scs: "application/scvp-cv-response",
383
+ sdp: "application/sdp",
384
+ senmlx: "application/senml+xml",
385
+ sensmlx: "application/sensml+xml",
386
+ ser: "application/java-serialized-object",
387
+ setpay: "application/set-payment-initiation",
388
+ setreg: "application/set-registration-initiation",
389
+ sgi: "image/sgi",
390
+ sgm: "text/sgml",
391
+ sgml: "text/sgml",
392
+ shex: "text/shex",
393
+ shf: "application/shf+xml",
394
+ shtml: "text/html",
395
+ sieve: "application/sieve",
396
+ sig: "application/pgp-signature",
397
+ sil: "audio/silk",
398
+ silo: "model/mesh",
399
+ siv: "application/sieve",
400
+ slim: "text/slim",
401
+ slm: "text/slim",
402
+ sls: "application/route-s-tsid+xml",
403
+ smi: "application/smil+xml",
404
+ smil: "application/smil+xml",
405
+ snd: "audio/basic",
406
+ so: "application/octet-stream",
407
+ spdx: "text/spdx",
408
+ spp: "application/scvp-vp-response",
409
+ spq: "application/scvp-vp-request",
410
+ spx: "audio/ogg",
411
+ sql: "application/sql",
412
+ sru: "application/sru+xml",
413
+ srx: "application/sparql-results+xml",
414
+ ssdl: "application/ssdl+xml",
415
+ ssml: "application/ssml+xml",
416
+ stk: "application/hyperstudio",
417
+ stl: "model/stl",
418
+ stpx: "model/step+xml",
419
+ stpxz: "model/step-xml+zip",
420
+ stpz: "model/step+zip",
421
+ styl: "text/stylus",
422
+ stylus: "text/stylus",
423
+ svg: "image/svg+xml",
424
+ svgz: "image/svg+xml",
425
+ swidtag: "application/swid+xml",
426
+ t: "text/troff",
427
+ t38: "image/t38",
428
+ td: "application/urc-targetdesc+xml",
429
+ tei: "application/tei+xml",
430
+ teicorpus: "application/tei+xml",
431
+ text: "text/plain",
432
+ tfi: "application/thraud+xml",
433
+ tfx: "image/tiff-fx",
434
+ tif: "image/tiff",
435
+ tiff: "image/tiff",
436
+ toml: "application/toml",
437
+ tr: "text/troff",
438
+ trig: "application/trig",
439
+ ts: "video/mp2t",
440
+ tsd: "application/timestamped-data",
441
+ tsv: "text/tab-separated-values",
442
+ ttc: "font/collection",
443
+ ttf: "font/ttf",
444
+ ttl: "text/turtle",
445
+ ttml: "application/ttml+xml",
446
+ txt: "text/plain",
447
+ u3d: "model/u3d",
448
+ u8dsn: "message/global-delivery-status",
449
+ u8hdr: "message/global-headers",
450
+ u8mdn: "message/global-disposition-notification",
451
+ u8msg: "message/global",
452
+ ubj: "application/ubjson",
453
+ uri: "text/uri-list",
454
+ uris: "text/uri-list",
455
+ urls: "text/uri-list",
456
+ vcard: "text/vcard",
457
+ vrml: "model/vrml",
458
+ vtt: "text/vtt",
459
+ vxml: "application/voicexml+xml",
460
+ war: "application/java-archive",
461
+ wasm: "application/wasm",
462
+ wav: "audio/wav",
463
+ weba: "audio/webm",
464
+ webm: "video/webm",
465
+ webmanifest: "application/manifest+json",
466
+ webp: "image/webp",
467
+ wgsl: "text/wgsl",
468
+ wgt: "application/widget",
469
+ wif: "application/watcherinfo+xml",
470
+ wmf: "image/wmf",
471
+ woff: "font/woff",
472
+ woff2: "font/woff2",
473
+ wrl: "model/vrml",
474
+ wsdl: "application/wsdl+xml",
475
+ wspolicy: "application/wspolicy+xml",
476
+ x3d: "model/x3d+xml",
477
+ x3db: "model/x3d+fastinfoset",
478
+ x3dbz: "model/x3d+binary",
479
+ x3dv: "model/x3d-vrml",
480
+ x3dvz: "model/x3d+vrml",
481
+ x3dz: "model/x3d+xml",
482
+ xaml: "application/xaml+xml",
483
+ xav: "application/xcap-att+xml",
484
+ xca: "application/xcap-caps+xml",
485
+ xcs: "application/calendar+xml",
486
+ xdf: "application/xcap-diff+xml",
487
+ xdssc: "application/dssc+xml",
488
+ xel: "application/xcap-el+xml",
489
+ xenc: "application/xenc+xml",
490
+ xer: "application/patch-ops-error+xml",
491
+ xfdf: "application/xfdf",
492
+ xht: "application/xhtml+xml",
493
+ xhtml: "application/xhtml+xml",
494
+ xhvml: "application/xv+xml",
495
+ xlf: "application/xliff+xml",
496
+ xm: "audio/xm",
497
+ xml: "text/xml",
498
+ xns: "application/xcap-ns+xml",
499
+ xop: "application/xop+xml",
500
+ xpl: "application/xproc+xml",
501
+ xsd: "application/xml",
502
+ xsf: "application/prs.xsf+xml",
503
+ xsl: "application/xml",
504
+ xslt: "application/xml",
505
+ xspf: "application/xspf+xml",
506
+ xvm: "application/xv+xml",
507
+ xvml: "application/xv+xml",
508
+ yaml: "text/yaml",
509
+ yang: "application/yang",
510
+ yin: "application/yin+xml",
511
+ yml: "text/yaml",
512
+ zip: "application/zip"
588
513
  };
589
514
  function lookup(extn) {
590
- let tmp = ("" + extn).trim().toLowerCase();
591
- let idx = tmp.lastIndexOf(".");
592
- return mimes[!~idx ? tmp : tmp.substring(++idx)];
515
+ let tmp = ("" + extn).trim().toLowerCase(), idx = tmp.lastIndexOf(".");
516
+ return mimes[~idx ? tmp.substring(++idx) : tmp];
593
517
  }
594
- __name(lookup, "lookup");
595
518
  exports.mimes = mimes;
596
519
  exports.lookup = lookup;
597
520
  }
@@ -600,169 +523,96 @@ var require_mrmime = __commonJS({
600
523
  // ../../node_modules/sirv/build.js
601
524
  var require_build2 = __commonJS({
602
525
  "../../node_modules/sirv/build.js"(exports, module) {
603
- var fs = __require("fs");
604
- var { join: join2, normalize: normalize2, resolve: resolve2 } = __require("path");
605
- var { totalist } = require_sync();
606
- var { parse: parse2 } = require_build();
607
- var { lookup } = require_mrmime();
608
- var noop = /* @__PURE__ */ __name(() => {
609
- }, "noop");
526
+ var fs = __require("fs"), { join: join2, normalize: normalize2, resolve: resolve2 } = __require("path"), { totalist } = require_sync(), { parse: parse2 } = require_build(), { lookup } = require_mrmime(), noop = () => {
527
+ };
610
528
  function isMatch(uri, arr) {
611
- for (let i = 0; i < arr.length; i++) {
612
- if (arr[i].test(uri)) return true;
613
- }
529
+ for (let i = 0; i < arr.length; i++)
530
+ if (arr[i].test(uri)) return !0;
614
531
  }
615
- __name(isMatch, "isMatch");
616
532
  function toAssume(uri, extns) {
617
533
  let i = 0, x, len = uri.length - 1;
618
- if (uri.charCodeAt(len) === 47) {
619
- uri = uri.substring(0, len);
620
- }
534
+ uri.charCodeAt(len) === 47 && (uri = uri.substring(0, len));
621
535
  let arr = [], tmp = `${uri}/index`;
622
- for (; i < extns.length; i++) {
623
- x = extns[i] ? `.${extns[i]}` : "";
624
- if (uri) arr.push(uri + x);
625
- arr.push(tmp + x);
626
- }
536
+ for (; i < extns.length; i++)
537
+ x = extns[i] ? `.${extns[i]}` : "", uri && arr.push(uri + x), arr.push(tmp + x);
627
538
  return arr;
628
539
  }
629
- __name(toAssume, "toAssume");
630
540
  function viaCache(cache, uri, extns) {
631
541
  let i = 0, data, arr = toAssume(uri, extns);
632
- for (; i < arr.length; i++) {
542
+ for (; i < arr.length; i++)
633
543
  if (data = cache[arr[i]]) return data;
634
- }
635
544
  }
636
- __name(viaCache, "viaCache");
637
545
  function viaLocal(dir, isEtag, uri, extns) {
638
- let i = 0, arr = toAssume(uri, extns);
639
- let abs, stats, name, headers;
640
- for (; i < arr.length; i++) {
641
- abs = normalize2(join2(dir, name = arr[i]));
642
- if (abs.startsWith(dir) && fs.existsSync(abs)) {
643
- stats = fs.statSync(abs);
644
- if (stats.isDirectory()) continue;
645
- headers = toHeaders(name, stats, isEtag);
646
- headers["Cache-Control"] = isEtag ? "no-cache" : "no-store";
647
- return { abs, stats, headers };
546
+ let i = 0, arr = toAssume(uri, extns), abs, stats, name, headers;
547
+ for (; i < arr.length; i++)
548
+ if (abs = normalize2(join2(dir, name = arr[i])), abs.startsWith(dir) && fs.existsSync(abs)) {
549
+ if (stats = fs.statSync(abs), stats.isDirectory()) continue;
550
+ return headers = toHeaders(name, stats, isEtag), headers["Cache-Control"] = isEtag ? "no-cache" : "no-store", { abs, stats, headers };
648
551
  }
649
- }
650
552
  }
651
- __name(viaLocal, "viaLocal");
652
553
  function is404(req, res) {
653
554
  return res.statusCode = 404, res.end();
654
555
  }
655
- __name(is404, "is404");
656
556
  function send(req, res, file, stats, headers) {
657
557
  let code = 200, tmp, opts = {};
658
558
  headers = { ...headers };
659
- for (let key in headers) {
660
- tmp = res.getHeader(key);
661
- if (tmp) headers[key] = tmp;
662
- }
663
- if (tmp = res.getHeader("content-type")) {
664
- headers["Content-Type"] = tmp;
665
- }
666
- if (req.headers.range) {
559
+ for (let key in headers)
560
+ tmp = res.getHeader(key), tmp && (headers[key] = tmp);
561
+ if ((tmp = res.getHeader("content-type")) && (headers["Content-Type"] = tmp), req.headers.range) {
667
562
  code = 206;
668
- let [x, y] = req.headers.range.replace("bytes=", "").split("-");
669
- let end = opts.end = parseInt(y, 10) || stats.size - 1;
670
- let start2 = opts.start = parseInt(x, 10) || 0;
671
- if (end >= stats.size) {
672
- end = stats.size - 1;
673
- }
674
- if (start2 >= stats.size) {
675
- res.setHeader("Content-Range", `bytes */${stats.size}`);
676
- res.statusCode = 416;
677
- return res.end();
678
- }
679
- headers["Content-Range"] = `bytes ${start2}-${end}/${stats.size}`;
680
- headers["Content-Length"] = end - start2 + 1;
681
- headers["Accept-Ranges"] = "bytes";
563
+ let [x, y] = req.headers.range.replace("bytes=", "").split("-"), end = opts.end = parseInt(y, 10) || stats.size - 1, start2 = opts.start = parseInt(x, 10) || 0;
564
+ if (end >= stats.size && (end = stats.size - 1), start2 >= stats.size)
565
+ return res.setHeader("Content-Range", `bytes */${stats.size}`), res.statusCode = 416, res.end();
566
+ headers["Content-Range"] = `bytes ${start2}-${end}/${stats.size}`, headers["Content-Length"] = end - start2 + 1, headers["Accept-Ranges"] = "bytes";
682
567
  }
683
- res.writeHead(code, headers);
684
- fs.createReadStream(file, opts).pipe(res);
568
+ res.writeHead(code, headers), fs.createReadStream(file, opts).pipe(res);
685
569
  }
686
- __name(send, "send");
687
570
  var ENCODING = {
688
571
  ".br": "br",
689
572
  ".gz": "gzip"
690
573
  };
691
574
  function toHeaders(name, stats, isEtag) {
692
- let enc = ENCODING[name.slice(-3)];
693
- let ctype = lookup(name.slice(0, enc && -3)) || "";
694
- if (ctype === "text/html") ctype += ";charset=utf-8";
575
+ let enc = ENCODING[name.slice(-3)], ctype = lookup(name.slice(0, enc && -3)) || "";
576
+ ctype === "text/html" && (ctype += ";charset=utf-8");
695
577
  let headers = {
696
578
  "Content-Length": stats.size,
697
579
  "Content-Type": ctype,
698
580
  "Last-Modified": stats.mtime.toUTCString()
699
581
  };
700
- if (enc) headers["Content-Encoding"] = enc;
701
- if (isEtag) headers["ETag"] = `W/"${stats.size}-${stats.mtime.getTime()}"`;
702
- return headers;
582
+ return enc && (headers["Content-Encoding"] = enc), isEtag && (headers.ETag = `W/"${stats.size}-${stats.mtime.getTime()}"`), headers;
703
583
  }
704
- __name(toHeaders, "toHeaders");
705
584
  module.exports = function(dir, opts = {}) {
706
585
  dir = resolve2(dir || ".");
707
- let isNotFound = opts.onNoMatch || is404;
708
- let setHeaders = opts.setHeaders || noop;
709
- let extensions = opts.extensions || ["html", "htm"];
710
- let gzips = opts.gzip && extensions.map((x) => `${x}.gz`).concat("gz");
711
- let brots = opts.brotli && extensions.map((x) => `${x}.br`).concat("br");
712
- const FILES = {};
713
- let fallback = "/";
714
- let isEtag = !!opts.etag;
715
- let isSPA = !!opts.single;
716
- if (typeof opts.single === "string") {
586
+ let isNotFound = opts.onNoMatch || is404, setHeaders = opts.setHeaders || noop, extensions = opts.extensions || ["html", "htm"], gzips = opts.gzip && extensions.map((x) => `${x}.gz`).concat("gz"), brots = opts.brotli && extensions.map((x) => `${x}.br`).concat("br"), FILES = {}, fallback = "/", isEtag = !!opts.etag, isSPA = !!opts.single;
587
+ if (typeof opts.single == "string") {
717
588
  let idx = opts.single.lastIndexOf(".");
718
- fallback += !!~idx ? opts.single.substring(0, idx) : opts.single;
589
+ fallback += ~idx ? opts.single.substring(0, idx) : opts.single;
719
590
  }
720
591
  let ignores = [];
721
- if (opts.ignores !== false) {
722
- ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/);
723
- if (opts.dotfiles) ignores.push(/\/\.\w/);
724
- else ignores.push(/\/\.well-known/);
725
- [].concat(opts.ignores || []).forEach((x) => {
726
- ignores.push(new RegExp(x, "i"));
727
- });
728
- }
592
+ opts.ignores !== !1 && (ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/), opts.dotfiles ? ignores.push(/\/\.\w/) : ignores.push(/\/\.well-known/), [].concat(opts.ignores || []).forEach((x) => {
593
+ ignores.push(new RegExp(x, "i"));
594
+ }));
729
595
  let cc = opts.maxAge != null && `public,max-age=${opts.maxAge}`;
730
- if (cc && opts.immutable) cc += ",immutable";
731
- else if (cc && opts.maxAge === 0) cc += ",must-revalidate";
732
- if (!opts.dev) {
733
- totalist(dir, (name, abs, stats) => {
734
- if (/\.well-known[\\+\/]/.test(name)) {
735
- } else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
736
- let headers = toHeaders(name, stats, isEtag);
737
- if (cc) headers["Cache-Control"] = cc;
738
- FILES["/" + name.normalize().replace(/\\+/g, "/")] = { abs, stats, headers };
739
- });
740
- }
596
+ cc && opts.immutable ? cc += ",immutable" : cc && opts.maxAge === 0 && (cc += ",must-revalidate"), opts.dev || totalist(dir, (name, abs, stats) => {
597
+ if (!/\.well-known[\\+\/]/.test(name)) {
598
+ if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
599
+ }
600
+ let headers = toHeaders(name, stats, isEtag);
601
+ cc && (headers["Cache-Control"] = cc), FILES["/" + name.normalize().replace(/\\+/g, "/")] = { abs, stats, headers };
602
+ });
741
603
  let lookup2 = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES);
742
604
  return function(req, res, next) {
743
- let extns = [""];
744
- let pathname = parse2(req).pathname;
745
- let val = req.headers["accept-encoding"] || "";
746
- if (gzips && val.includes("gzip")) extns.unshift(...gzips);
747
- if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
748
- extns.push(...extensions);
749
- if (pathname.indexOf("%") !== -1) {
605
+ let extns = [""], pathname = parse2(req).pathname, val = req.headers["accept-encoding"] || "";
606
+ if (gzips && val.includes("gzip") && extns.unshift(...gzips), brots && /(br|brotli)/i.test(val) && extns.unshift(...brots), extns.push(...extensions), pathname.indexOf("%") !== -1)
750
607
  try {
751
608
  pathname = decodeURI(pathname);
752
- } catch (err) {
609
+ } catch {
753
610
  }
754
- }
755
611
  let data = lookup2(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup2(fallback, extns);
756
612
  if (!data) return next ? next() : isNotFound(req, res);
757
- if (isEtag && req.headers["if-none-match"] === data.headers["ETag"]) {
758
- res.writeHead(304);
759
- return res.end();
760
- }
761
- if (gzips || brots) {
762
- res.setHeader("Vary", "Accept-Encoding");
763
- }
764
- setHeaders(res, pathname, data.stats);
765
- send(req, res, data.abs, data.stats, data.headers);
613
+ if (isEtag && req.headers["if-none-match"] === data.headers.ETag)
614
+ return res.writeHead(304), res.end();
615
+ (gzips || brots) && res.setHeader("Vary", "Accept-Encoding"), setHeaders(res, pathname, data.stats), send(req, res, data.abs, data.stats, data.headers);
766
616
  };
767
617
  };
768
618
  }
@@ -783,147 +633,69 @@ import { checkWebpackVersion } from "@storybook/core-webpack";
783
633
  // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
784
634
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
785
635
  function normalizeWindowsPath(input = "") {
786
- if (!input) {
787
- return input;
788
- }
789
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
636
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
790
637
  }
791
- __name(normalizeWindowsPath, "normalizeWindowsPath");
792
- var _UNC_REGEX = /^[/\\]{2}/;
793
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
794
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
795
- var normalize = /* @__PURE__ */ __name(function(path2) {
796
- if (path2.length === 0) {
638
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
639
+ var normalize = function(path2) {
640
+ if (path2.length === 0)
797
641
  return ".";
798
- }
799
642
  path2 = normalizeWindowsPath(path2);
800
- const isUNCPath = path2.match(_UNC_REGEX);
801
- const isPathAbsolute = isAbsolute(path2);
802
- const trailingSeparator = path2[path2.length - 1] === "/";
803
- path2 = normalizeString(path2, !isPathAbsolute);
804
- if (path2.length === 0) {
805
- if (isPathAbsolute) {
806
- return "/";
807
- }
808
- return trailingSeparator ? "./" : ".";
809
- }
810
- if (trailingSeparator) {
811
- path2 += "/";
812
- }
813
- if (_DRIVE_LETTER_RE.test(path2)) {
814
- path2 += "/";
815
- }
816
- if (isUNCPath) {
817
- if (!isPathAbsolute) {
818
- return `//./${path2}`;
819
- }
820
- return `//${path2}`;
821
- }
822
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
823
- }, "normalize");
824
- var join = /* @__PURE__ */ __name(function(...arguments_) {
825
- if (arguments_.length === 0) {
643
+ let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path2), trailingSeparator = path2[path2.length - 1] === "/";
644
+ return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2);
645
+ }, join = function(...arguments_) {
646
+ if (arguments_.length === 0)
826
647
  return ".";
827
- }
828
648
  let joined;
829
- for (const argument of arguments_) {
830
- if (argument && argument.length > 0) {
831
- if (joined === void 0) {
832
- joined = argument;
833
- } else {
834
- joined += `/${argument}`;
835
- }
836
- }
837
- }
838
- if (joined === void 0) {
839
- return ".";
840
- }
841
- return normalize(joined.replace(/\/\/+/g, "/"));
842
- }, "join");
649
+ for (let argument of arguments_)
650
+ argument && argument.length > 0 && (joined === void 0 ? joined = argument : joined += `/${argument}`);
651
+ return joined === void 0 ? "." : normalize(joined.replace(/\/\/+/g, "/"));
652
+ };
843
653
  function normalizeString(path2, allowAboveRoot) {
844
- let res = "";
845
- let lastSegmentLength = 0;
846
- let lastSlash = -1;
847
- let dots = 0;
848
- let char = null;
654
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
849
655
  for (let index = 0; index <= path2.length; ++index) {
850
- if (index < path2.length) {
656
+ if (index < path2.length)
851
657
  char = path2[index];
852
- } else if (char === "/") {
853
- break;
854
- } else {
658
+ else {
659
+ if (char === "/")
660
+ break;
855
661
  char = "/";
856
662
  }
857
663
  if (char === "/") {
858
- if (lastSlash === index - 1 || dots === 1) ;
859
- else if (dots === 2) {
664
+ if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
860
665
  if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
861
666
  if (res.length > 2) {
862
- const lastSlashIndex = res.lastIndexOf("/");
863
- if (lastSlashIndex === -1) {
864
- res = "";
865
- lastSegmentLength = 0;
866
- } else {
867
- res = res.slice(0, lastSlashIndex);
868
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
869
- }
870
- lastSlash = index;
871
- dots = 0;
667
+ let lastSlashIndex = res.lastIndexOf("/");
668
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
872
669
  continue;
873
670
  } else if (res.length > 0) {
874
- res = "";
875
- lastSegmentLength = 0;
876
- lastSlash = index;
877
- dots = 0;
671
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
878
672
  continue;
879
673
  }
880
674
  }
881
- if (allowAboveRoot) {
882
- res += res.length > 0 ? "/.." : "..";
883
- lastSegmentLength = 2;
884
- }
885
- } else {
886
- if (res.length > 0) {
887
- res += `/${path2.slice(lastSlash + 1, index)}`;
888
- } else {
889
- res = path2.slice(lastSlash + 1, index);
890
- }
891
- lastSegmentLength = index - lastSlash - 1;
892
- }
893
- lastSlash = index;
894
- dots = 0;
895
- } else if (char === "." && dots !== -1) {
896
- ++dots;
897
- } else {
898
- dots = -1;
899
- }
675
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
676
+ } else
677
+ res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
678
+ lastSlash = index, dots = 0;
679
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
900
680
  }
901
681
  return res;
902
682
  }
903
- __name(normalizeString, "normalizeString");
904
- var isAbsolute = /* @__PURE__ */ __name(function(p) {
683
+ var isAbsolute = function(p) {
905
684
  return _IS_ABSOLUTE_RE.test(p);
906
- }, "isAbsolute");
907
- var _EXTNAME_RE = /.(\.[^./]+)$/;
908
- var extname = /* @__PURE__ */ __name(function(p) {
909
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
685
+ };
686
+ var _EXTNAME_RE = /.(\.[^./]+)$/, extname = function(p) {
687
+ let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
910
688
  return match && match[1] || "";
911
- }, "extname");
912
- var dirname = /* @__PURE__ */ __name(function(p) {
913
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
914
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
915
- segments[0] += "/";
916
- }
917
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
918
- }, "dirname");
919
- var basename = /* @__PURE__ */ __name(function(p, extension) {
920
- const lastSegment = normalizeWindowsPath(p).split("/").pop();
689
+ };
690
+ var dirname = function(p) {
691
+ let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
692
+ return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
693
+ };
694
+ var basename = function(p, extension) {
695
+ let lastSegment = normalizeWindowsPath(p).split("/").pop();
921
696
  return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
922
- }, "basename");
923
- var parse = /* @__PURE__ */ __name(function(p) {
924
- const root = normalizeWindowsPath(p).split("/").shift() || "/";
925
- const base = basename(p);
926
- const extension = extname(base);
697
+ }, parse = function(p) {
698
+ let root = normalizeWindowsPath(p).split("/").shift() || "/", base = basename(p), extension = extname(base);
927
699
  return {
928
700
  root,
929
701
  dir: dirname(p),
@@ -931,33 +703,20 @@ var parse = /* @__PURE__ */ __name(function(p) {
931
703
  ext: extension,
932
704
  name: base.slice(0, base.length - extension.length)
933
705
  };
934
- }, "parse");
706
+ };
935
707
 
936
708
  // src/index.ts
937
- var import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
938
- var import_sirv = __toESM(require_build2(), 1);
709
+ var import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1), import_sirv = __toESM(require_build2(), 1);
939
710
  import webpackModule from "webpack";
940
711
  import webpackDevMiddleware from "webpack-dev-middleware";
941
712
  import webpackHotMiddleware from "webpack-hot-middleware";
942
- var { DefinePlugin, IgnorePlugin, ProgressPlugin } = webpackModule;
943
- var WebpackDefinePlugin = DefinePlugin;
944
- var WebpackIgnorePlugin = IgnorePlugin;
945
- var printDuration = /* @__PURE__ */ __name((startTime) => (0, import_pretty_hrtime.default)(process.hrtime(startTime)).replace(" ms", " milliseconds").replace(" s", " seconds").replace(" min", " minutes"), "printDuration");
946
- var corePath = dirname(fileURLToPath(import.meta.resolve("storybook/package.json")));
947
- var compilation;
948
- var reject;
949
- var executor = {
950
- get: /* @__PURE__ */ __name(async (options) => {
951
- const version = await options.presets.apply("webpackVersion") || "5";
952
- const webpackInstance = (await options.presets.apply("webpackInstance"))?.default || webpackModule;
953
- checkWebpackVersion({ version }, "5", "builder-webpack5");
954
- return webpackInstance;
955
- }, "get")
956
- };
957
- var getConfig = /* @__PURE__ */ __name(async (options) => {
958
- const { presets } = options;
959
- const typescriptOptions = await presets.apply("typescript", {}, options);
960
- const frameworkOptions = await presets.apply("frameworkOptions");
713
+ var { DefinePlugin, IgnorePlugin, ProgressPlugin } = webpackModule, WebpackDefinePlugin = DefinePlugin, WebpackIgnorePlugin = IgnorePlugin, printDuration = (startTime) => (0, import_pretty_hrtime.default)(process.hrtime(startTime)).replace(" ms", " milliseconds").replace(" s", " seconds").replace(" min", " minutes"), corePath = dirname(fileURLToPath(import.meta.resolve("storybook/package.json"))), compilation, reject, executor = {
714
+ get: async (options) => {
715
+ let version = await options.presets.apply("webpackVersion") || "5", webpackInstance = (await options.presets.apply("webpackInstance"))?.default || webpackModule;
716
+ return checkWebpackVersion({ version }, "5", "builder-webpack5"), webpackInstance;
717
+ }
718
+ }, getConfig = async (options) => {
719
+ let { presets } = options, typescriptOptions = await presets.apply("typescript", {}, options), frameworkOptions = await presets.apply("frameworkOptions");
961
720
  return presets.apply(
962
721
  "webpack",
963
722
  {},
@@ -967,208 +726,147 @@ var getConfig = /* @__PURE__ */ __name(async (options) => {
967
726
  frameworkOptions
968
727
  }
969
728
  );
970
- }, "getConfig");
971
- var asyncIterator;
972
- var bail = /* @__PURE__ */ __name(async () => {
973
- if (asyncIterator) {
729
+ }, asyncIterator, bail = async () => {
730
+ if (asyncIterator)
974
731
  try {
975
732
  await asyncIterator.throw(new Error());
976
- } catch (e) {
733
+ } catch {
977
734
  }
978
- }
979
- if (reject) {
980
- reject();
981
- }
982
- return new Promise((res, rej) => {
983
- if (process && compilation) {
735
+ return reject && reject(), new Promise((res, rej) => {
736
+ if (process && compilation)
984
737
  try {
985
- compilation.close(() => res());
986
- logger.warn("Force closed preview build");
987
- } catch (err) {
988
- logger.warn("Unable to close preview build!");
989
- res();
738
+ compilation.close(() => res()), logger.warn("Force closed preview build");
739
+ } catch {
740
+ logger.warn("Unable to close preview build!"), res();
990
741
  }
991
- } else {
742
+ else
992
743
  res();
993
- }
994
744
  });
995
- }, "bail");
996
- var starter = /* @__PURE__ */ __name(async function* starterGeneratorFn({
745
+ }, starter = async function* ({
997
746
  startTime,
998
747
  options,
999
748
  router,
1000
749
  channel
1001
750
  }) {
1002
- const webpackInstance = await executor.get(options);
751
+ let webpackInstance = await executor.get(options);
1003
752
  yield;
1004
- const config = await getConfig(options);
1005
- if (config.stats === "none" || config.stats === "summary") {
753
+ let config = await getConfig(options);
754
+ if (config.stats === "none" || config.stats === "summary")
1006
755
  throw new WebpackMissingStatsError();
1007
- }
1008
756
  yield;
1009
- const compiler = webpackInstance(config);
1010
- if (!compiler) {
757
+ let compiler = webpackInstance(config);
758
+ if (!compiler)
1011
759
  throw new WebpackInvocationError({
1012
760
  // eslint-disable-next-line local-rules/no-uncategorized-errors
1013
- error: new Error(`Missing Webpack compiler at runtime!`)
761
+ error: new Error("Missing Webpack compiler at runtime!")
1014
762
  });
1015
- }
1016
763
  yield;
1017
- const modulesCount = await options.cache?.get("modulesCount", 1e3);
1018
- let totalModules;
1019
- let value = 0;
764
+ let modulesCount = await options.cache?.get("modulesCount", 1e3), totalModules, value = 0;
1020
765
  new ProgressPlugin({
1021
- handler: /* @__PURE__ */ __name((newValue, message, arg3) => {
766
+ handler: (newValue, message, arg3) => {
1022
767
  value = Math.max(newValue, value);
1023
- const progress = { value, message: message.charAt(0).toUpperCase() + message.slice(1) };
768
+ let progress = { value, message: message.charAt(0).toUpperCase() + message.slice(1) };
1024
769
  if (message === "building") {
1025
- const counts = arg3 && arg3.match(/entries (\d+)\/(\d+)/) || [];
1026
- const complete = parseInt(counts[1], 10);
1027
- const total = parseInt(counts[2], 10);
1028
- if (!Number.isNaN(complete) && !Number.isNaN(total)) {
1029
- progress.modules = { complete, total };
1030
- totalModules = total;
1031
- }
1032
- }
1033
- if (value === 1) {
1034
- if (options.cache) {
1035
- options.cache.set("modulesCount", totalModules);
1036
- }
1037
- if (!progress.message) {
1038
- progress.message = `Completed in ${printDuration(startTime)}.`;
1039
- }
770
+ let counts = arg3 && arg3.match(/entries (\d+)\/(\d+)/) || [], complete = parseInt(counts[1], 10), total = parseInt(counts[2], 10);
771
+ !Number.isNaN(complete) && !Number.isNaN(total) && (progress.modules = { complete, total }, totalModules = total);
1040
772
  }
1041
- channel.emit(PREVIEW_BUILDER_PROGRESS, progress);
1042
- }, "handler"),
773
+ value === 1 && (options.cache && options.cache.set("modulesCount", totalModules), progress.message || (progress.message = `Completed in ${printDuration(startTime)}.`)), channel.emit(PREVIEW_BUILDER_PROGRESS, progress);
774
+ },
1043
775
  modulesCount
1044
776
  }).apply(compiler);
1045
- const middlewareOptions = {
777
+ let middlewareOptions = {
1046
778
  publicPath: config.output?.publicPath,
1047
- writeToDisk: true,
779
+ writeToDisk: !0,
1048
780
  stats: "errors-only"
1049
781
  };
1050
782
  compilation = webpackDevMiddleware(compiler, middlewareOptions);
1051
- const previewResolvedDir = join(corePath, "dist/preview");
783
+ let previewResolvedDir = join(corePath, "dist/preview");
1052
784
  router.use(
1053
785
  "/sb-preview",
1054
786
  (0, import_sirv.default)(previewResolvedDir, {
1055
787
  maxAge: 3e5,
1056
- dev: true,
1057
- immutable: true
788
+ dev: !0,
789
+ immutable: !0
1058
790
  })
1059
- );
1060
- router.use(compilation);
1061
- router.use(webpackHotMiddleware(compiler, { log: false }));
1062
- const stats = await new Promise((res, rej) => {
1063
- compilation?.waitUntilValid(res);
1064
- reject = rej;
791
+ ), router.use(compilation), router.use(webpackHotMiddleware(compiler, { log: !1 }));
792
+ let stats = await new Promise((res, rej) => {
793
+ compilation?.waitUntilValid(res), reject = rej;
1065
794
  });
1066
- yield;
1067
- if (!stats) {
795
+ if (yield, !stats)
1068
796
  throw new WebpackMissingStatsError();
1069
- }
1070
- const { warnings, errors } = getWebpackStats({ config, stats });
1071
- if (warnings.length > 0) {
1072
- warnings?.forEach((e) => logger.warn(e.message));
1073
- }
1074
- if (errors.length > 0) {
797
+ let { warnings, errors } = getWebpackStats({ config, stats });
798
+ if (warnings.length > 0 && warnings?.forEach((e) => logger.warn(e.message)), errors.length > 0)
1075
799
  throw new WebpackCompilationError({ errors });
1076
- }
1077
800
  return {
1078
801
  bail,
1079
802
  stats,
1080
803
  totalTime: process.hrtime(startTime)
1081
804
  };
1082
- }, "starterGeneratorFn");
805
+ };
1083
806
  function getWebpackStats({ config, stats }) {
1084
- const statsOptions = typeof config.stats === "string" ? config.stats : {
807
+ let statsOptions = typeof config.stats == "string" ? config.stats : {
1085
808
  ...config.stats,
1086
- warnings: true,
1087
- errors: true
1088
- };
1089
- const { warnings = [], errors = [] } = stats?.toJson(statsOptions) || {};
809
+ warnings: !0,
810
+ errors: !0
811
+ }, { warnings = [], errors = [] } = stats?.toJson(statsOptions) || {};
1090
812
  return {
1091
813
  warnings,
1092
814
  errors
1093
815
  };
1094
816
  }
1095
- __name(getWebpackStats, "getWebpackStats");
1096
- var builder = /* @__PURE__ */ __name(async function* builderGeneratorFn({ startTime, options }) {
1097
- const webpackInstance = await executor.get(options);
817
+ var builder = async function* ({ startTime, options }) {
818
+ let webpackInstance = await executor.get(options);
1098
819
  yield;
1099
- const config = await getConfig(options);
1100
- if (config.stats === "none" || config.stats === "summary") {
820
+ let config = await getConfig(options);
821
+ if (config.stats === "none" || config.stats === "summary")
1101
822
  throw new WebpackMissingStatsError();
1102
- }
1103
823
  yield;
1104
- const compiler = webpackInstance(config);
1105
- if (!compiler) {
824
+ let compiler = webpackInstance(config);
825
+ if (!compiler)
1106
826
  throw new WebpackInvocationError({
1107
827
  // eslint-disable-next-line local-rules/no-uncategorized-errors
1108
- error: new Error(`Missing Webpack compiler at runtime!`)
828
+ error: new Error("Missing Webpack compiler at runtime!")
1109
829
  });
1110
- }
1111
- const webpackCompilation = new Promise((succeed, fail) => {
830
+ let webpackCompilation = new Promise((succeed, fail) => {
1112
831
  compiler.run((error, stats) => {
1113
832
  if (error) {
1114
833
  compiler.close(() => fail(new WebpackInvocationError({ error })));
1115
834
  return;
1116
835
  }
1117
- if (!stats) {
836
+ if (!stats)
1118
837
  throw new WebpackMissingStatsError();
1119
- }
1120
- const { warnings, errors } = getWebpackStats({ config, stats });
1121
- if (warnings.length > 0) {
1122
- warnings?.forEach((e) => logger.warn(e.message));
1123
- }
1124
- if (errors.length > 0) {
1125
- errors.forEach((e) => logger.error(e.message));
1126
- compiler.close(() => fail(new WebpackCompilationError({ errors })));
838
+ let { warnings, errors } = getWebpackStats({ config, stats });
839
+ if (warnings.length > 0 && warnings?.forEach((e) => logger.warn(e.message)), errors.length > 0) {
840
+ errors.forEach((e) => logger.error(e.message)), compiler.close(() => fail(new WebpackCompilationError({ errors })));
1127
841
  return;
1128
842
  }
1129
- compiler.close((closeErr) => {
1130
- if (closeErr) {
1131
- return fail(new WebpackInvocationError({ error: closeErr }));
1132
- }
1133
- return succeed(stats);
1134
- });
843
+ compiler.close((closeErr) => closeErr ? fail(new WebpackInvocationError({ error: closeErr })) : succeed(stats));
1135
844
  });
1136
- });
1137
- const previewResolvedDir = join(corePath, "dist/preview");
1138
- const previewDirTarget = join(options.outputDir || "", `sb-preview`);
1139
- const previewFiles = cp(previewResolvedDir, previewDirTarget, {
1140
- filter: /* @__PURE__ */ __name((src) => {
1141
- const { ext } = parse(src);
1142
- if (ext) {
1143
- return ext === ".js";
1144
- }
1145
- return true;
1146
- }, "filter"),
1147
- recursive: true
1148
- });
1149
- const [webpackCompilationOutput] = await Promise.all([webpackCompilation, previewFiles]);
845
+ }), previewResolvedDir = join(corePath, "dist/preview"), previewDirTarget = join(options.outputDir || "", "sb-preview"), previewFiles = cp(previewResolvedDir, previewDirTarget, {
846
+ filter: (src) => {
847
+ let { ext } = parse(src);
848
+ return ext ? ext === ".js" : !0;
849
+ },
850
+ recursive: !0
851
+ }), [webpackCompilationOutput] = await Promise.all([webpackCompilation, previewFiles]);
1150
852
  return webpackCompilationOutput;
1151
- }, "builderGeneratorFn");
1152
- var start = /* @__PURE__ */ __name(async (options) => {
853
+ }, start = async (options) => {
1153
854
  asyncIterator = starter(options);
1154
855
  let result;
1155
- do {
856
+ do
1156
857
  result = await asyncIterator.next();
1157
- } while (!result.done);
858
+ while (!result.done);
1158
859
  return result.value;
1159
- }, "start");
1160
- var build = /* @__PURE__ */ __name(async (options) => {
860
+ }, build = async (options) => {
1161
861
  asyncIterator = builder(options);
1162
862
  let result;
1163
- do {
863
+ do
1164
864
  result = await asyncIterator.next();
1165
- } while (!result.done);
865
+ while (!result.done);
1166
866
  return result.value;
1167
- }, "build");
1168
- var corePresets = [
867
+ }, corePresets = [
1169
868
  import.meta.resolve("@storybook/builder-webpack5/presets/preview-preset")
1170
- ];
1171
- var overridePresets = [
869
+ ], overridePresets = [
1172
870
  import.meta.resolve("@storybook/builder-webpack5/presets/custom-webpack-preset")
1173
871
  ];
1174
872
  export {