hyperbook 0.52.1 → 0.52.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.
@@ -75,12 +75,6 @@ figure {
75
75
  border-color: var(--color-spacer);
76
76
  }
77
77
 
78
- @media screen and (max-width: 600px) {
79
- .hyperbook-markdown table td {
80
- border-bottom-color: var(--color-spacer);
81
- }
82
- }
83
-
84
78
  .hyperbook-markdown figure.normal {
85
79
  text-align: center;
86
80
  margin-top: 10px;
@@ -154,11 +148,11 @@ figure {
154
148
  margin-bottom: 0;
155
149
  }
156
150
 
157
- .hyperbook-markdown li+li {
151
+ .hyperbook-markdown li + li {
158
152
  margin-top: 0.25em;
159
153
  }
160
154
 
161
- .hyperbook-markdown li>p {
155
+ .hyperbook-markdown li > p {
162
156
  margin-top: 16px;
163
157
  }
164
158
 
@@ -198,11 +192,11 @@ figure {
198
192
  }
199
193
 
200
194
  .hyperbook-markdown table {
201
- border-width: 1px;
202
- border-style: solid;
195
+ display: block;
203
196
  border-collapse: collapse;
204
- width: 100%;
205
- table-layout: fixed;
197
+ width: max-content;
198
+ max-width: 100%;
199
+ overflow: auto;
206
200
  }
207
201
 
208
202
  .hyperbook-markdown table caption {
@@ -224,58 +218,6 @@ figure {
224
218
  .hyperbook-markdown table th {
225
219
  font-size: 0.85em;
226
220
  letter-spacing: 0.1em;
227
- text-transform: uppercase;
228
- }
229
-
230
- @media screen and (max-width: 600px) {
231
- .hyperbook-markdown table {
232
- border: 0;
233
- }
234
-
235
- .hyperbook-markdown table caption {
236
- font-size: 1.3em;
237
- }
238
-
239
- .hyperbook-markdown table thead {
240
- border: none;
241
- clip: rect(0 0 0 0);
242
- height: 1px;
243
- margin: -1px;
244
- overflow: hidden;
245
- padding: 0;
246
- position: absolute;
247
- width: 1px;
248
- }
249
-
250
- .hyperbook-markdown table tr {
251
- border-bottom-width: 3px;
252
- display: block;
253
- margin-bottom: 0.625em;
254
- }
255
-
256
- .hyperbook-markdown table td {
257
- border-bottom-width: 1px;
258
- border-bottom-style: solid;
259
- display: block;
260
- font-size: 0.8em;
261
- text-align: right;
262
- }
263
-
264
- .hyperbook-markdown table td::before {
265
- /*
266
- * aria-label has no advantage, it won't be read inside a table
267
- content: attr(aria-label);
268
- */
269
- content: attr(data-label);
270
- float: left;
271
- font-weight: bold;
272
- text-transform: uppercase;
273
- margin-right: 8px;
274
- }
275
-
276
- .hyperbook-markdown table td:last-child {
277
- border-bottom: 0;
278
- }
279
221
  }
280
222
 
281
223
  .hyperbook-markdown h1,
@@ -363,10 +305,10 @@ figure {
363
305
  list-style-type: none;
364
306
  }
365
307
 
366
- .hyperbook-markdown #toc-toggle>.bar1,
367
- .hyperbook-markdown #toc-toggle>.bar2,
368
- .hyperbook-markdown #toc-toggle>.bar3,
369
- .hyperbook-markdown #toc-toggle>.bar4 {
308
+ .hyperbook-markdown #toc-toggle > .bar1,
309
+ .hyperbook-markdown #toc-toggle > .bar2,
310
+ .hyperbook-markdown #toc-toggle > .bar3,
311
+ .hyperbook-markdown #toc-toggle > .bar4 {
370
312
  background-color: var(--color-text);
371
313
  }
372
314
 
@@ -385,7 +327,7 @@ figure {
385
327
  margin-right: 16px;
386
328
  mask-repeat: no-repeat;
387
329
  cursor: pointer;
388
- mask-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1zZWFyY2giIGZpbGw9Im5vbmUiIGhlaWdodD0iMjQiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxsaW5lIHgxPSIyMSIgeDI9IjE2LjY1IiB5MT0iMjEiIHkyPSIxNi42NSIvPjwvc3ZnPg==')
330
+ mask-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1zZWFyY2giIGZpbGw9Im5vbmUiIGhlaWdodD0iMjQiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxsaW5lIHgxPSIyMSIgeDI9IjE2LjY1IiB5MT0iMjEiIHkyPSIxNi42NSIvPjwvc3ZnPg==");
389
331
  }
390
332
 
391
333
  #search-drawer {
@@ -410,7 +352,7 @@ figure {
410
352
  background-color: var(--color-text);
411
353
  width: 24px;
412
354
  height: 24px;
413
- mask-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1zZWFyY2giIGZpbGw9Im5vbmUiIGhlaWdodD0iMjQiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxsaW5lIHgxPSIyMSIgeDI9IjE2LjY1IiB5MT0iMjEiIHkyPSIxNi42NSIvPjwvc3ZnPg==');
355
+ mask-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1zZWFyY2giIGZpbGw9Im5vbmUiIGhlaWdodD0iMjQiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxsaW5lIHgxPSIyMSIgeDI9IjE2LjY1IiB5MT0iMjEiIHkyPSIxNi42NSIvPjwvc3ZnPg==");
414
356
  mask-repeat: no-repeat;
415
357
  }
416
358
 
@@ -428,7 +370,7 @@ figure {
428
370
  height: 24px;
429
371
  cursor: pointer;
430
372
  mask-repeat: no-repeat;
431
- mask-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1hcnJvdy1yaWdodCIgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48bGluZSB4MT0iNSIgeDI9IjE5IiB5MT0iMTIiIHkyPSIxMiIvPjxwb2x5bGluZSBwb2ludHM9IjEyIDUgMTkgMTIgMTIgMTkiLz48L3N2Zz4=')
373
+ mask-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1hcnJvdy1yaWdodCIgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48bGluZSB4MT0iNSIgeDI9IjE5IiB5MT0iMTIiIHkyPSIxMiIvPjxwb2x5bGluZSBwb2ludHM9IjEyIDUgMTkgMTIgMTIgMTkiLz48L3N2Zz4=");
432
374
  }
433
375
 
434
376
  #search-results {
@@ -489,16 +431,16 @@ figure {
489
431
  height: 100%;
490
432
  }
491
433
 
492
- .toc-drawer-content>nav {
434
+ .toc-drawer-content > nav {
493
435
  padding: 20px;
494
436
  flex: 1;
495
437
  }
496
438
 
497
- .toc-drawer-content>nav li a {
439
+ .toc-drawer-content > nav li a {
498
440
  display: block;
499
441
  }
500
442
 
501
- .toc-drawer-content>nav li a:hover {
443
+ .toc-drawer-content > nav li a:hover {
502
444
  text-decoration: underline;
503
445
  }
504
446
 
@@ -605,16 +547,16 @@ figure {
605
547
  opacity: 1;
606
548
  }
607
549
 
608
- .hyperbook-markdown #toc-toggle>.bar1,
609
- .hyperbook-markdown #toc-toggle>.bar3 {
550
+ .hyperbook-markdown #toc-toggle > .bar1,
551
+ .hyperbook-markdown #toc-toggle > .bar3 {
610
552
  width: 20px;
611
553
  height: 2px;
612
554
  margin: 2px 3px;
613
555
  transition: 0.4s;
614
556
  }
615
557
 
616
- .hyperbook-markdown #toc-toggle>.bar2,
617
- .hyperbook-markdown #toc-toggle>.bar4 {
558
+ .hyperbook-markdown #toc-toggle > .bar2,
559
+ .hyperbook-markdown #toc-toggle > .bar4 {
618
560
  width: 25px;
619
561
  height: 2px;
620
562
  margin: 2px 3px;
package/dist/index.js CHANGED
@@ -208,6 +208,6 @@ var i=r(39023).inherits;var o=r(23403).ZipArchiveOutputStream;var c=r(23403).Zip
208
208
 
209
209
  pako/dist/pako.esm.mjs:
210
210
  (*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
211
- */const hH=JSON.parse('{"name":"hyperbook","version":"0.52.1","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register && node postbuild.mjs"},"devDependencies":{"@hyperbook/fs":"workspace:*","@hyperbook/markdown":"workspace:*","@hyperbook/types":"workspace:*","@pnpm/exportable-manifest":"1000.0.6","@types/archiver":"6.0.3","@types/async-retry":"1.4.9","@types/cross-spawn":"6.0.6","@types/lunr":"^2.3.7","@types/prompts":"2.4.9","@types/tar":"6.1.13","@types/ws":"^8.5.14","@vercel/ncc":"0.38.3","archiver":"7.0.1","async-retry":"1.3.3","chalk":"5.4.1","chokidar":"4.0.3","commander":"12.1.0","cpy":"11.1.0","cross-spawn":"7.0.6","domutils":"^3.2.2","extract-zip":"^2.0.1","got":"12.6.0","htmlparser2":"^10.0.0","lunr":"^2.3.9","lunr-languages":"^1.14.0","mime":"^4.0.6","prompts":"2.4.2","rimraf":"6.0.1","tar":"7.4.3","update-check":"1.5.4","ws":"^8.18.0"}}');const bH="__hyperbook_assets";async function runBuildProject(t,a,r,i){const o=it.getName(t);if(t.type==="book"){console.log(`${N.cyan(`[${o}]`)} Building Book.`);await runBuild(t.src,a,t.basePath,o,r,i)}else{console.log(`${N.cyan(`[${o}]`)} Building Library.`);if(!r){r=t.src}await fr(K().join(r,".hyperbook","out"));for(const o of t.projects){await runBuildProject(o,a,r,i)}}}async function runBuild(t,a,r,i,o,c){console.log(`${N.blue(`[${i}]`)} Reading hyperbook.json.`);const l=await ot.getJson(t);if(!r&&(l===null||l===void 0?void 0:l.basePath)){r=l.basePath}if(r&&!r.startsWith("/")){r="/"+r}if(r&&r.endsWith("/")){r=r.slice(0,-1)}l.basePath=r;ct.clean(t);let u=undefined;if(a.type==="library"){u=await it.getLink(a,l.language)}if(u){if(!l.links){l.links=[u]}else{l.links.push(u)}}let d=K().join(t,".hyperbook","out");if(o){d=K().join(o,".hyperbook","out",r||"")}console.log(`${N.blue(`[${i}]`)} Cleaning output folder ${d}.`);await runArchive(t,d,i);const p={root:t,config:l,makeUrl:(t,a)=>{if(typeof t==="string"){if(t.includes("://")){return t}t=[t]}switch(a){case"glossary":return W.posix.join("/",r||"","glossary",...t);case"book":return W.posix.join(r||"",...t);case"public":return W.posix.join(r||"",...t);case"archive":return W.posix.join("/",r||"","archives",...t);case"assets":if(t.length===1&&t[0]==="/"){return`${W.posix.join("/",r||"",bH,...t)}`}else{return`${W.posix.join("/",r||"",bH,...t)}?version=${hH.version}`}}},project:a};const A=new Set([]);const g=await ot.getPagesAndSections(t);const h=ot.getPageList(g.sections,g.pages);const b=[];let y=await ct.listForFolder(t,"book");if(c){y=y.filter((t=>t.path.absolute.endsWith(c)))}let w=1;for(let t of y){const a=await ot.getNavigationForFile(h,t);const r={...a,...g};const o={...p,navigation:r};const c=await process2(t.markdown.content,o);b.push(...c.data.searchDocuments||[]);for(let t of Object.keys(c.data.directives||{})){A.add(t)}let u=K().join(d,t.path.directory);let k;if(t.name==="index"){k=K().posix.join(t.path.href||"","index.html")}else if(l.trailingSlash){u=K().join(u,t.name);k=K().posix.join(t.path.href||"","index.html")}else{k=t.path.href+".html"}const _=K().join(d,k);await makeDir(u,{recursive:true});if(t.markdown.data.permaid){const a=K().join(d,"@");await makeDir(a,{recursive:true});const r=K().join(a,t.markdown.data.permaid+".html");await J().writeFile(r,c.value)}await J().writeFile(_,c.value);if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Buildung book: [${w++}/${y.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");let k=await ct.listForFolder(t,"glossary");const _=K().join(d,"glossary");if(c){k=k.filter((t=>{var a;return(a=t.path.absolute)===null||a===void 0?void 0:a.endsWith(c)}))}w=1;for(let t of k){const a=await ot.getNavigationForFile(h,t);const r={...a,...g};const o={...p,navigation:r};const c=await process2(t.markdown.content,o);b.push(...c.data.searchDocuments||[]);for(let t of Object.keys(c.data.directives||{})){A.add(t)}let u=t.path.href+".html";let y=K().join(d,u);if(l.trailingSlash){u=K().posix.join(t.path.href||"","index.html");y=K().join(d,t.path.href||"","index.html");await makeDir(K().join(d,t.path.href||""),{recursive:true})}else{await makeDir(_,{recursive:true})}await J().writeFile(y,c.value);if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Buildung glossary: [${w++}/${k.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");const v=K().join(__dirname,"assets");const C=K().join(d,bH);await(0,Z.mkdir)(C,{recursive:true});let B=await ct.listForFolder(t,"public");w=1;for(let t of B){const a=K().join(d,t.path.directory);await makeDir(a,{recursive:true});if(t.path.href&&t.extension!==".h5p"){const a=K().join(d,t.path.href);await(0,Z.cp)(t.path.absolute,a)}else if(t.path.href&&t.extension===".h5p"){const a=K().join(d,t.path.href);await br()(t.path.absolute,{dir:a});const r=K().join(C,"directive-h5p","libraries");await makeDir(r,{recursive:true});const i=await J().readdir(a);const o=i.filter((t=>!["content","h5p.json"].includes(t)));for(const t of o){await(0,Z.cp)(K().join(a,t),K().join(r,t),{recursive:true,force:true});await fr(K().join(a,t))}}if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Copying public files: [${w++}/${B.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");w=1;for(let t of A){const a=K().join(v,`directive-${t}`);const r=K().join(C,`directive-${t}`);if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Copying directive assets: [${w++}/${A.size}]`);if(process.env.CI){process.stdout.write("\n")}try{await J().access(a);await(0,Z.mkdir)(r,{recursive:true});await(0,Z.cp)(a,r,{recursive:true})}catch(a){process.stdout.write("\n");process.stdout.write(`${N.red(`[${i}]`)} Failed copying directive assets: ${t}`);process.stdout.write("\n")}}process.stdout.write("\n");const x=await J().readdir(v);w=1;for(let t of x){const a=K().join(v,t);const r=K().join(C,t);if(!t.startsWith("directive-")){await(0,Z.cp)(a,r,{recursive:true,filter:t=>{if(t.includes("lunr-languages")){return l.language!==undefined&&l.language!=="en"&&(t.endsWith("lunr-languages")||t.endsWith(`lunr.${l.language}.min.js`)||t.endsWith(`lunr.stemmer.support.min.js`))}return true}})}if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Copying hyperbook assets: [${w++}/${x.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");if(l.search){const t={};console.log(`${N.blue(`[${i}]`)} Building search index`);let a=false;if(l.language&&l.language!=="en"){try{__nccwpck_require__(57297)(wr());__nccwpck_require__(73062)(`./lunr.${l.language}.js`)(wr());a=true}catch(t){console.log(`${N.yellow(`[${i}]`)} ${l.language} is no valid value for the lanuage key. See https://github.com/MihaiValentin/lunr-languages for possible values. Falling back to English.`)}}const r=wr()((function(){if(a){this.use(wr()[l.language])}this.ref("href");this.field("description");this.field("keywords");this.field("heading");this.field("content");this.metadataWhitelist=["position"];b.forEach((a=>{const r=p.makeUrl(a.href,"book");const i={...a,href:r};this.add(i);t[r]=i}))}));const o=`\nconst LUNR_INDEX = ${JSON.stringify(r)};\nconst SEARCH_DOCUMENTS = ${JSON.stringify(t)};\n`;await J().writeFile(K().join(d,bH,"search.js"),o)}const I=await J().readdir(K().join(__dirname,"locales")).then((t=>t.map((t=>t.split(".")[0]))));let Q="en";if(l.language&&I.includes(l.language)){Q=l.language}const D=await J().readFile(K().join(d,bH,"i18n.js"),"utf-8");const S=await J().readFile(K().join(__dirname,"locales",`${Q}.json`),"utf-8");await J().writeFile(K().join(d,bH,"i18n.js"),D.replace(/\/\/[\s]*LOCALES[\s\S]*?[\s]*\/\/[\s]*LOCALES/g,`\n // GENERATED\n const locales = ${S};\n`));console.log(`${N.green(`[${i}]`)} Build success: ${d}`)}var yH=__nccwpck_require__(24434);const wH={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"};const kH={root:".",fileFilter:t=>true,directoryFilter:t=>true,type:wH.FILE_TYPE,lstat:false,depth:2147483648,alwaysStat:false,highWaterMark:4096};Object.freeze(kH);const _H="READDIRP_RECURSIVE_ERROR";const vH=new Set(["ENOENT","EPERM","EACCES","ELOOP",_H]);const CH=[wH.DIR_TYPE,wH.EVERYTHING_TYPE,wH.FILE_DIR_TYPE,wH.FILE_TYPE];const BH=new Set([wH.DIR_TYPE,wH.EVERYTHING_TYPE,wH.FILE_DIR_TYPE]);const EH=new Set([wH.EVERYTHING_TYPE,wH.FILE_DIR_TYPE,wH.FILE_TYPE]);const isNormalFlowError=t=>vH.has(t.code);const xH=process.platform==="win32";const emptyFn=t=>true;const normalizeFilter=t=>{if(t===undefined)return emptyFn;if(typeof t==="function")return t;if(typeof t==="string"){const a=t.trim();return t=>t.basename===a}if(Array.isArray(t)){const a=t.map((t=>t.trim()));return t=>a.some((a=>t.basename===a))}return emptyFn};class ReaddirpStream extends Kt.Readable{constructor(t={}){super({objectMode:true,autoDestroy:true,highWaterMark:t.highWaterMark});const a={...kH,...t};const{root:r,type:i}=a;this._fileFilter=normalizeFilter(a.fileFilter);this._directoryFilter=normalizeFilter(a.directoryFilter);const o=a.lstat?Yt.lstat:Yt.stat;if(xH){this._stat=t=>o(t,{bigint:true})}else{this._stat=o}this._maxDepth=a.depth??kH.depth;this._wantsDir=i?BH.has(i):false;this._wantsFile=i?EH.has(i):false;this._wantsEverything=i===wH.EVERYTHING_TYPE;this._root=(0,ee.resolve)(r);this._isDirent=!a.alwaysStat;this._statsProp=this._isDirent?"dirent":"stats";this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};this.parents=[this._exploreDir(r,1)];this.reading=false;this.parent=undefined}async _read(t){if(this.reading)return;this.reading=true;try{while(!this.destroyed&&t>0){const a=this.parent;const r=a&&a.files;if(r&&r.length>0){const{path:i,depth:o}=a;const c=r.splice(0,t).map((t=>this._formatEntry(t,i)));const l=await Promise.all(c);for(const a of l){if(!a){t--;return}if(this.destroyed)return;const r=await this._getEntryType(a);if(r==="directory"&&this._directoryFilter(a)){if(o<=this._maxDepth){this.parents.push(this._exploreDir(a.fullPath,o+1))}if(this._wantsDir){this.push(a);t--}}else if((r==="file"||this._includeAsFile(a))&&this._fileFilter(a)){if(this._wantsFile){this.push(a);t--}}}}else{const t=this.parents.pop();if(!t){this.push(null);break}this.parent=await t;if(this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=false}}async _exploreDir(t,a){let r;try{r=await(0,Yt.readdir)(t,this._rdOptions)}catch(t){this._onError(t)}return{files:r,depth:a,path:t}}async _formatEntry(t,a){let r;const i=this._isDirent?t.name:t;try{const o=(0,ee.resolve)((0,ee.join)(a,i));r={path:(0,ee.relative)(this._root,o),fullPath:o,basename:i};r[this._statsProp]=this._isDirent?t:await this._stat(o)}catch(t){this._onError(t);return}return r}_onError(t){if(isNormalFlowError(t)&&!this.destroyed){this.emit("warn",t)}else{this.destroy(t)}}async _getEntryType(t){if(!t&&this._statsProp in t){return""}const a=t[this._statsProp];if(a.isFile())return"file";if(a.isDirectory())return"directory";if(a&&a.isSymbolicLink()){const a=t.fullPath;try{const t=await(0,Yt.realpath)(a);const r=await(0,Yt.lstat)(t);if(r.isFile()){return"file"}if(r.isDirectory()){const r=t.length;if(a.startsWith(t)&&a.substr(r,1)===ee.sep){const r=new Error(`Circular symlink detected: "${a}" points to "${t}"`);r.code=_H;return this._onError(r)}return"directory"}}catch(t){this._onError(t);return""}}}_includeAsFile(t){const a=t&&t[this._statsProp];return a&&this._wantsEverything&&!a.isDirectory()}}function readdirp(t,a={}){let r=a.entryType||a.type;if(r==="both")r=wH.FILE_DIR_TYPE;if(r)a.type=r;if(!t){throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)")}else if(typeof t!=="string"){throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)")}else if(r&&!CH.includes(r)){throw new Error(`readdirp: Invalid type passed. Use one of ${CH.join(", ")}`)}a.root=t;return new ReaddirpStream(a)}function readdirpPromise(t,a={}){return new Promise(((r,i)=>{const o=[];readdirp(t,a).on("data",(t=>o.push(t))).on("end",(()=>r(o))).on("error",(t=>i(t)))}))}const IH=null&&readdirp;const QH="data";const DH="end";const SH="close";const EMPTY_FN=()=>{};const IDENTITY_FN=t=>t;const FH=process.platform;const NH=FH==="win32";const LH=FH==="darwin";const TH=FH==="linux";const RH=FH==="freebsd";const MH=(0,Ea.type)()==="OS400";const jH={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"};const PH=jH;const OH="watch";const qH={lstat:Z.lstat,stat:Z.stat};const $H="listeners";const GH="errHandlers";const zH="rawEmitters";const HH=[$H,GH,zH];const UH=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]);const isBinaryPath=t=>UH.has(W.extname(t).slice(1).toLowerCase());const foreach=(t,a)=>{if(t instanceof Set){t.forEach(a)}else{a(t)}};const addAndConvert=(t,a,r)=>{let i=t[a];if(!(i instanceof Set)){t[a]=i=new Set([i])}i.add(r)};const clearItem=t=>a=>{const r=t[a];if(r instanceof Set){r.clear()}else{delete t[a]}};const delFromSet=(t,a,r)=>{const i=t[a];if(i instanceof Set){i.delete(r)}else if(i===r){delete t[a]}};const isEmptySet=t=>t instanceof Set?t.size===0:!t;const YH=new Map;function createFsWatchInstance(t,a,r,i,o){const handleEvent=(a,i)=>{r(t);o(a,i,{watchedPath:t});if(i&&t!==i){fsWatchBroadcast(W.resolve(t,i),$H,W.join(t,i))}};try{return(0,se.watch)(t,{persistent:a.persistent},handleEvent)}catch(t){i(t);return undefined}}const fsWatchBroadcast=(t,a,r,i,o)=>{const c=YH.get(t);if(!c)return;foreach(c[a],(t=>{t(r,i,o)}))};const setFsWatchListener=(t,a,r,i)=>{const{listener:o,errHandler:c,rawEmitter:l}=i;let u=YH.get(a);let d;if(!r.persistent){d=createFsWatchInstance(t,r,o,c,l);if(!d)return;return d.close.bind(d)}if(u){addAndConvert(u,$H,o);addAndConvert(u,GH,c);addAndConvert(u,zH,l)}else{d=createFsWatchInstance(t,r,fsWatchBroadcast.bind(null,a,$H),c,fsWatchBroadcast.bind(null,a,zH));if(!d)return;d.on(PH.ERROR,(async r=>{const i=fsWatchBroadcast.bind(null,a,GH);if(u)u.watcherUnusable=true;if(NH&&r.code==="EPERM"){try{const a=await(0,Z.open)(t,"r");await a.close();i(r)}catch(t){}}else{i(r)}}));u={listeners:o,errHandlers:c,rawEmitters:l,watcher:d};YH.set(a,u)}return()=>{delFromSet(u,$H,o);delFromSet(u,GH,c);delFromSet(u,zH,l);if(isEmptySet(u.listeners)){u.watcher.close();YH.delete(a);HH.forEach(clearItem(u));u.watcher=undefined;Object.freeze(u)}}};const WH=new Map;const setFsWatchFileListener=(t,a,r,i)=>{const{listener:o,rawEmitter:c}=i;let l=WH.get(a);const u=l&&l.options;if(u&&(u.persistent<r.persistent||u.interval>r.interval)){(0,se.unwatchFile)(a);l=undefined}if(l){addAndConvert(l,$H,o);addAndConvert(l,zH,c)}else{l={listeners:o,rawEmitters:c,options:r,watcher:(0,se.watchFile)(a,r,((r,i)=>{foreach(l.rawEmitters,(t=>{t(PH.CHANGE,a,{curr:r,prev:i})}));const o=r.mtimeMs;if(r.size!==i.size||o>i.mtimeMs||o===0){foreach(l.listeners,(a=>a(t,r)))}}))};WH.set(a,l)}return()=>{delFromSet(l,$H,o);delFromSet(l,zH,c);if(isEmptySet(l.listeners)){WH.delete(a);(0,se.unwatchFile)(a);l.options=l.watcher=undefined;Object.freeze(l)}}};class NodeFsHandler{constructor(t){this.fsw=t;this._boundHandleError=a=>t._handleError(a)}_watchWithNodeFs(t,a){const r=this.fsw.options;const i=W.dirname(t);const o=W.basename(t);const c=this.fsw._getWatchedDir(i);c.add(o);const l=W.resolve(t);const u={persistent:r.persistent};if(!a)a=EMPTY_FN;let d;if(r.usePolling){const i=r.interval!==r.binaryInterval;u.interval=i&&isBinaryPath(o)?r.binaryInterval:r.interval;d=setFsWatchFileListener(t,l,u,{listener:a,rawEmitter:this.fsw._emitRaw})}else{d=setFsWatchListener(t,l,u,{listener:a,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw})}return d}_handleFile(t,a,r){if(this.fsw.closed){return}const i=W.dirname(t);const o=W.basename(t);const c=this.fsw._getWatchedDir(i);let l=a;if(c.has(o))return;const listener=async(a,r)=>{if(!this.fsw._throttle(OH,t,5))return;if(!r||r.mtimeMs===0){try{const r=await(0,Z.stat)(t);if(this.fsw.closed)return;const i=r.atimeMs;const o=r.mtimeMs;if(!i||i<=o||o!==l.mtimeMs){this.fsw._emit(PH.CHANGE,t,r)}if((LH||TH||RH)&&l.ino!==r.ino){this.fsw._closeFile(a);l=r;const i=this._watchWithNodeFs(t,listener);if(i)this.fsw._addPathCloser(a,i)}else{l=r}}catch(t){this.fsw._remove(i,o)}}else if(c.has(o)){const a=r.atimeMs;const i=r.mtimeMs;if(!a||a<=i||i!==l.mtimeMs){this.fsw._emit(PH.CHANGE,t,r)}l=r}};const u=this._watchWithNodeFs(t,listener);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(PH.ADD,t,0))return;this.fsw._emit(PH.ADD,t,a)}return u}async _handleSymlink(t,a,r,i){if(this.fsw.closed){return}const o=t.fullPath;const c=this.fsw._getWatchedDir(a);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await(0,Z.realpath)(r)}catch(t){this.fsw._emitReady();return true}if(this.fsw.closed)return;if(c.has(i)){if(this.fsw._symlinkPaths.get(o)!==a){this.fsw._symlinkPaths.set(o,a);this.fsw._emit(PH.CHANGE,r,t.stats)}}else{c.add(i);this.fsw._symlinkPaths.set(o,a);this.fsw._emit(PH.ADD,r,t.stats)}this.fsw._emitReady();return true}if(this.fsw._symlinkPaths.has(o)){return true}this.fsw._symlinkPaths.set(o,true)}_handleRead(t,a,r,i,o,c,l){t=W.join(t,"");l=this.fsw._throttle("readdir",t,1e3);if(!l)return;const u=this.fsw._getWatchedDir(r.path);const d=new Set;let p=this.fsw._readdirp(t,{fileFilter:t=>r.filterPath(t),directoryFilter:t=>r.filterDir(t)});if(!p)return;p.on(QH,(async l=>{if(this.fsw.closed){p=undefined;return}const A=l.path;let g=W.join(t,A);d.add(A);if(l.stats.isSymbolicLink()&&await this._handleSymlink(l,t,g,A)){return}if(this.fsw.closed){p=undefined;return}if(A===i||!i&&!u.has(A)){this.fsw._incrReadyCount();g=W.join(o,W.relative(o,g));this._addToNodeFs(g,a,r,c+1)}})).on(PH.ERROR,this._boundHandleError);return new Promise(((a,A)=>{if(!p)return A();p.once(DH,(()=>{if(this.fsw.closed){p=undefined;return}const A=l?l.clear():false;a(undefined);u.getChildren().filter((a=>a!==t&&!d.has(a))).forEach((a=>{this.fsw._remove(t,a)}));p=undefined;if(A)this._handleRead(t,false,r,i,o,c,l)}))}))}async _handleDir(t,a,r,i,o,c,l){const u=this.fsw._getWatchedDir(W.dirname(t));const d=u.has(W.basename(t));if(!(r&&this.fsw.options.ignoreInitial)&&!o&&!d){this.fsw._emit(PH.ADD_DIR,t,a)}u.add(W.basename(t));this.fsw._getWatchedDir(t);let p;let A;const g=this.fsw.options.depth;if((g==null||i<=g)&&!this.fsw._symlinkPaths.has(l)){if(!o){await this._handleRead(t,r,c,o,t,i,p);if(this.fsw.closed)return}A=this._watchWithNodeFs(t,((a,r)=>{if(r&&r.mtimeMs===0)return;this._handleRead(a,false,c,o,t,i,p)}))}return A}async _addToNodeFs(t,a,r,i,o){const c=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed){c();return false}const l=this.fsw._getWatchHelpers(t);if(r){l.filterPath=t=>r.filterPath(t);l.filterDir=t=>r.filterDir(t)}try{const r=await qH[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,r)){c();return false}const u=this.fsw.options.followSymlinks;let d;if(r.isDirectory()){const c=W.resolve(t);const p=u?await(0,Z.realpath)(t):t;if(this.fsw.closed)return;d=await this._handleDir(l.watchPath,r,a,i,o,l,p);if(this.fsw.closed)return;if(c!==p&&p!==undefined){this.fsw._symlinkPaths.set(c,p)}}else if(r.isSymbolicLink()){const o=u?await(0,Z.realpath)(t):t;if(this.fsw.closed)return;const c=W.dirname(l.watchPath);this.fsw._getWatchedDir(c).add(l.watchPath);this.fsw._emit(PH.ADD,l.watchPath,r);d=await this._handleDir(c,r,a,i,t,l,o);if(this.fsw.closed)return;if(o!==undefined){this.fsw._symlinkPaths.set(W.resolve(t),o)}}else{d=this._handleFile(l.watchPath,r,a)}c();if(d)this.fsw._addPathCloser(t,d);return false}catch(a){if(this.fsw._handleError(a)){c();return t}}}}
211
+ */const hH=JSON.parse('{"name":"hyperbook","version":"0.52.2","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register && node postbuild.mjs"},"devDependencies":{"@hyperbook/fs":"workspace:*","@hyperbook/markdown":"workspace:*","@hyperbook/types":"workspace:*","@pnpm/exportable-manifest":"1000.0.6","@types/archiver":"6.0.3","@types/async-retry":"1.4.9","@types/cross-spawn":"6.0.6","@types/lunr":"^2.3.7","@types/prompts":"2.4.9","@types/tar":"6.1.13","@types/ws":"^8.5.14","@vercel/ncc":"0.38.3","archiver":"7.0.1","async-retry":"1.3.3","chalk":"5.4.1","chokidar":"4.0.3","commander":"12.1.0","cpy":"11.1.0","cross-spawn":"7.0.6","domutils":"^3.2.2","extract-zip":"^2.0.1","got":"12.6.0","htmlparser2":"^10.0.0","lunr":"^2.3.9","lunr-languages":"^1.14.0","mime":"^4.0.6","prompts":"2.4.2","rimraf":"6.0.1","tar":"7.4.3","update-check":"1.5.4","ws":"^8.18.0"}}');const bH="__hyperbook_assets";async function runBuildProject(t,a,r,i){const o=it.getName(t);if(t.type==="book"){console.log(`${N.cyan(`[${o}]`)} Building Book.`);await runBuild(t.src,a,t.basePath,o,r,i)}else{console.log(`${N.cyan(`[${o}]`)} Building Library.`);if(!r){r=t.src}await fr(K().join(r,".hyperbook","out"));for(const o of t.projects){await runBuildProject(o,a,r,i)}}}async function runBuild(t,a,r,i,o,c){console.log(`${N.blue(`[${i}]`)} Reading hyperbook.json.`);const l=await ot.getJson(t);if(!r&&(l===null||l===void 0?void 0:l.basePath)){r=l.basePath}if(r&&!r.startsWith("/")){r="/"+r}if(r&&r.endsWith("/")){r=r.slice(0,-1)}l.basePath=r;ct.clean(t);let u=undefined;if(a.type==="library"){u=await it.getLink(a,l.language)}if(u){if(!l.links){l.links=[u]}else{l.links.push(u)}}let d=K().join(t,".hyperbook","out");if(o){d=K().join(o,".hyperbook","out",r||"")}console.log(`${N.blue(`[${i}]`)} Cleaning output folder ${d}.`);await runArchive(t,d,i);const p={root:t,config:l,makeUrl:(t,a)=>{if(typeof t==="string"){if(t.includes("://")){return t}t=[t]}switch(a){case"glossary":return W.posix.join("/",r||"","glossary",...t);case"book":return W.posix.join(r||"",...t);case"public":return W.posix.join(r||"",...t);case"archive":return W.posix.join("/",r||"","archives",...t);case"assets":if(t.length===1&&t[0]==="/"){return`${W.posix.join("/",r||"",bH,...t)}`}else{return`${W.posix.join("/",r||"",bH,...t)}?version=${hH.version}`}}},project:a};const A=new Set([]);const g=await ot.getPagesAndSections(t);const h=ot.getPageList(g.sections,g.pages);const b=[];let y=await ct.listForFolder(t,"book");if(c){y=y.filter((t=>t.path.absolute.endsWith(c)))}let w=1;for(let t of y){const a=await ot.getNavigationForFile(h,t);const r={...a,...g};const o={...p,navigation:r};const c=await process2(t.markdown.content,o);b.push(...c.data.searchDocuments||[]);for(let t of Object.keys(c.data.directives||{})){A.add(t)}let u=K().join(d,t.path.directory);let k;if(t.name==="index"){k=K().posix.join(t.path.href||"","index.html")}else if(l.trailingSlash){u=K().join(u,t.name);k=K().posix.join(t.path.href||"","index.html")}else{k=t.path.href+".html"}const _=K().join(d,k);await makeDir(u,{recursive:true});if(t.markdown.data.permaid){const a=K().join(d,"@");await makeDir(a,{recursive:true});const r=K().join(a,t.markdown.data.permaid+".html");await J().writeFile(r,c.value)}await J().writeFile(_,c.value);if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Buildung book: [${w++}/${y.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");let k=await ct.listForFolder(t,"glossary");const _=K().join(d,"glossary");if(c){k=k.filter((t=>{var a;return(a=t.path.absolute)===null||a===void 0?void 0:a.endsWith(c)}))}w=1;for(let t of k){const a=await ot.getNavigationForFile(h,t);const r={...a,...g};const o={...p,navigation:r};const c=await process2(t.markdown.content,o);b.push(...c.data.searchDocuments||[]);for(let t of Object.keys(c.data.directives||{})){A.add(t)}let u=t.path.href+".html";let y=K().join(d,u);if(l.trailingSlash){u=K().posix.join(t.path.href||"","index.html");y=K().join(d,t.path.href||"","index.html");await makeDir(K().join(d,t.path.href||""),{recursive:true})}else{await makeDir(_,{recursive:true})}await J().writeFile(y,c.value);if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Buildung glossary: [${w++}/${k.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");const v=K().join(__dirname,"assets");const C=K().join(d,bH);await(0,Z.mkdir)(C,{recursive:true});let B=await ct.listForFolder(t,"public");w=1;for(let t of B){const a=K().join(d,t.path.directory);await makeDir(a,{recursive:true});if(t.path.href&&t.extension!==".h5p"){const a=K().join(d,t.path.href);await(0,Z.cp)(t.path.absolute,a)}else if(t.path.href&&t.extension===".h5p"){const a=K().join(d,t.path.href);await br()(t.path.absolute,{dir:a});const r=K().join(C,"directive-h5p","libraries");await makeDir(r,{recursive:true});const i=await J().readdir(a);const o=i.filter((t=>!["content","h5p.json"].includes(t)));for(const t of o){await(0,Z.cp)(K().join(a,t),K().join(r,t),{recursive:true,force:true});await fr(K().join(a,t))}}if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Copying public files: [${w++}/${B.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");w=1;for(let t of A){const a=K().join(v,`directive-${t}`);const r=K().join(C,`directive-${t}`);if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Copying directive assets: [${w++}/${A.size}]`);if(process.env.CI){process.stdout.write("\n")}try{await J().access(a);await(0,Z.mkdir)(r,{recursive:true});await(0,Z.cp)(a,r,{recursive:true})}catch(a){process.stdout.write("\n");process.stdout.write(`${N.red(`[${i}]`)} Failed copying directive assets: ${t}`);process.stdout.write("\n")}}process.stdout.write("\n");const x=await J().readdir(v);w=1;for(let t of x){const a=K().join(v,t);const r=K().join(C,t);if(!t.startsWith("directive-")){await(0,Z.cp)(a,r,{recursive:true,filter:t=>{if(t.includes("lunr-languages")){return l.language!==undefined&&l.language!=="en"&&(t.endsWith("lunr-languages")||t.endsWith(`lunr.${l.language}.min.js`)||t.endsWith(`lunr.stemmer.support.min.js`))}return true}})}if(!process.env.CI){X().clearLine(process.stdout,0);X().cursorTo(process.stdout,0)}process.stdout.write(`${N.blue(`[${i}]`)} Copying hyperbook assets: [${w++}/${x.length}]`);if(process.env.CI){process.stdout.write("\n")}}process.stdout.write("\n");if(l.search){const t={};console.log(`${N.blue(`[${i}]`)} Building search index`);let a=false;if(l.language&&l.language!=="en"){try{__nccwpck_require__(57297)(wr());__nccwpck_require__(73062)(`./lunr.${l.language}.js`)(wr());a=true}catch(t){console.log(`${N.yellow(`[${i}]`)} ${l.language} is no valid value for the lanuage key. See https://github.com/MihaiValentin/lunr-languages for possible values. Falling back to English.`)}}const r=wr()((function(){if(a){this.use(wr()[l.language])}this.ref("href");this.field("description");this.field("keywords");this.field("heading");this.field("content");this.metadataWhitelist=["position"];b.forEach((a=>{const r=p.makeUrl(a.href,"book");const i={...a,href:r};this.add(i);t[r]=i}))}));const o=`\nconst LUNR_INDEX = ${JSON.stringify(r)};\nconst SEARCH_DOCUMENTS = ${JSON.stringify(t)};\n`;await J().writeFile(K().join(d,bH,"search.js"),o)}const I=await J().readdir(K().join(__dirname,"locales")).then((t=>t.map((t=>t.split(".")[0]))));let Q="en";if(l.language&&I.includes(l.language)){Q=l.language}const D=await J().readFile(K().join(d,bH,"i18n.js"),"utf-8");const S=await J().readFile(K().join(__dirname,"locales",`${Q}.json`),"utf-8");await J().writeFile(K().join(d,bH,"i18n.js"),D.replace(/\/\/[\s]*LOCALES[\s\S]*?[\s]*\/\/[\s]*LOCALES/g,`\n // GENERATED\n const locales = ${S};\n`));console.log(`${N.green(`[${i}]`)} Build success: ${d}`)}var yH=__nccwpck_require__(24434);const wH={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"};const kH={root:".",fileFilter:t=>true,directoryFilter:t=>true,type:wH.FILE_TYPE,lstat:false,depth:2147483648,alwaysStat:false,highWaterMark:4096};Object.freeze(kH);const _H="READDIRP_RECURSIVE_ERROR";const vH=new Set(["ENOENT","EPERM","EACCES","ELOOP",_H]);const CH=[wH.DIR_TYPE,wH.EVERYTHING_TYPE,wH.FILE_DIR_TYPE,wH.FILE_TYPE];const BH=new Set([wH.DIR_TYPE,wH.EVERYTHING_TYPE,wH.FILE_DIR_TYPE]);const EH=new Set([wH.EVERYTHING_TYPE,wH.FILE_DIR_TYPE,wH.FILE_TYPE]);const isNormalFlowError=t=>vH.has(t.code);const xH=process.platform==="win32";const emptyFn=t=>true;const normalizeFilter=t=>{if(t===undefined)return emptyFn;if(typeof t==="function")return t;if(typeof t==="string"){const a=t.trim();return t=>t.basename===a}if(Array.isArray(t)){const a=t.map((t=>t.trim()));return t=>a.some((a=>t.basename===a))}return emptyFn};class ReaddirpStream extends Kt.Readable{constructor(t={}){super({objectMode:true,autoDestroy:true,highWaterMark:t.highWaterMark});const a={...kH,...t};const{root:r,type:i}=a;this._fileFilter=normalizeFilter(a.fileFilter);this._directoryFilter=normalizeFilter(a.directoryFilter);const o=a.lstat?Yt.lstat:Yt.stat;if(xH){this._stat=t=>o(t,{bigint:true})}else{this._stat=o}this._maxDepth=a.depth??kH.depth;this._wantsDir=i?BH.has(i):false;this._wantsFile=i?EH.has(i):false;this._wantsEverything=i===wH.EVERYTHING_TYPE;this._root=(0,ee.resolve)(r);this._isDirent=!a.alwaysStat;this._statsProp=this._isDirent?"dirent":"stats";this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};this.parents=[this._exploreDir(r,1)];this.reading=false;this.parent=undefined}async _read(t){if(this.reading)return;this.reading=true;try{while(!this.destroyed&&t>0){const a=this.parent;const r=a&&a.files;if(r&&r.length>0){const{path:i,depth:o}=a;const c=r.splice(0,t).map((t=>this._formatEntry(t,i)));const l=await Promise.all(c);for(const a of l){if(!a){t--;return}if(this.destroyed)return;const r=await this._getEntryType(a);if(r==="directory"&&this._directoryFilter(a)){if(o<=this._maxDepth){this.parents.push(this._exploreDir(a.fullPath,o+1))}if(this._wantsDir){this.push(a);t--}}else if((r==="file"||this._includeAsFile(a))&&this._fileFilter(a)){if(this._wantsFile){this.push(a);t--}}}}else{const t=this.parents.pop();if(!t){this.push(null);break}this.parent=await t;if(this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=false}}async _exploreDir(t,a){let r;try{r=await(0,Yt.readdir)(t,this._rdOptions)}catch(t){this._onError(t)}return{files:r,depth:a,path:t}}async _formatEntry(t,a){let r;const i=this._isDirent?t.name:t;try{const o=(0,ee.resolve)((0,ee.join)(a,i));r={path:(0,ee.relative)(this._root,o),fullPath:o,basename:i};r[this._statsProp]=this._isDirent?t:await this._stat(o)}catch(t){this._onError(t);return}return r}_onError(t){if(isNormalFlowError(t)&&!this.destroyed){this.emit("warn",t)}else{this.destroy(t)}}async _getEntryType(t){if(!t&&this._statsProp in t){return""}const a=t[this._statsProp];if(a.isFile())return"file";if(a.isDirectory())return"directory";if(a&&a.isSymbolicLink()){const a=t.fullPath;try{const t=await(0,Yt.realpath)(a);const r=await(0,Yt.lstat)(t);if(r.isFile()){return"file"}if(r.isDirectory()){const r=t.length;if(a.startsWith(t)&&a.substr(r,1)===ee.sep){const r=new Error(`Circular symlink detected: "${a}" points to "${t}"`);r.code=_H;return this._onError(r)}return"directory"}}catch(t){this._onError(t);return""}}}_includeAsFile(t){const a=t&&t[this._statsProp];return a&&this._wantsEverything&&!a.isDirectory()}}function readdirp(t,a={}){let r=a.entryType||a.type;if(r==="both")r=wH.FILE_DIR_TYPE;if(r)a.type=r;if(!t){throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)")}else if(typeof t!=="string"){throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)")}else if(r&&!CH.includes(r)){throw new Error(`readdirp: Invalid type passed. Use one of ${CH.join(", ")}`)}a.root=t;return new ReaddirpStream(a)}function readdirpPromise(t,a={}){return new Promise(((r,i)=>{const o=[];readdirp(t,a).on("data",(t=>o.push(t))).on("end",(()=>r(o))).on("error",(t=>i(t)))}))}const IH=null&&readdirp;const QH="data";const DH="end";const SH="close";const EMPTY_FN=()=>{};const IDENTITY_FN=t=>t;const FH=process.platform;const NH=FH==="win32";const LH=FH==="darwin";const TH=FH==="linux";const RH=FH==="freebsd";const MH=(0,Ea.type)()==="OS400";const jH={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"};const PH=jH;const OH="watch";const qH={lstat:Z.lstat,stat:Z.stat};const $H="listeners";const GH="errHandlers";const zH="rawEmitters";const HH=[$H,GH,zH];const UH=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]);const isBinaryPath=t=>UH.has(W.extname(t).slice(1).toLowerCase());const foreach=(t,a)=>{if(t instanceof Set){t.forEach(a)}else{a(t)}};const addAndConvert=(t,a,r)=>{let i=t[a];if(!(i instanceof Set)){t[a]=i=new Set([i])}i.add(r)};const clearItem=t=>a=>{const r=t[a];if(r instanceof Set){r.clear()}else{delete t[a]}};const delFromSet=(t,a,r)=>{const i=t[a];if(i instanceof Set){i.delete(r)}else if(i===r){delete t[a]}};const isEmptySet=t=>t instanceof Set?t.size===0:!t;const YH=new Map;function createFsWatchInstance(t,a,r,i,o){const handleEvent=(a,i)=>{r(t);o(a,i,{watchedPath:t});if(i&&t!==i){fsWatchBroadcast(W.resolve(t,i),$H,W.join(t,i))}};try{return(0,se.watch)(t,{persistent:a.persistent},handleEvent)}catch(t){i(t);return undefined}}const fsWatchBroadcast=(t,a,r,i,o)=>{const c=YH.get(t);if(!c)return;foreach(c[a],(t=>{t(r,i,o)}))};const setFsWatchListener=(t,a,r,i)=>{const{listener:o,errHandler:c,rawEmitter:l}=i;let u=YH.get(a);let d;if(!r.persistent){d=createFsWatchInstance(t,r,o,c,l);if(!d)return;return d.close.bind(d)}if(u){addAndConvert(u,$H,o);addAndConvert(u,GH,c);addAndConvert(u,zH,l)}else{d=createFsWatchInstance(t,r,fsWatchBroadcast.bind(null,a,$H),c,fsWatchBroadcast.bind(null,a,zH));if(!d)return;d.on(PH.ERROR,(async r=>{const i=fsWatchBroadcast.bind(null,a,GH);if(u)u.watcherUnusable=true;if(NH&&r.code==="EPERM"){try{const a=await(0,Z.open)(t,"r");await a.close();i(r)}catch(t){}}else{i(r)}}));u={listeners:o,errHandlers:c,rawEmitters:l,watcher:d};YH.set(a,u)}return()=>{delFromSet(u,$H,o);delFromSet(u,GH,c);delFromSet(u,zH,l);if(isEmptySet(u.listeners)){u.watcher.close();YH.delete(a);HH.forEach(clearItem(u));u.watcher=undefined;Object.freeze(u)}}};const WH=new Map;const setFsWatchFileListener=(t,a,r,i)=>{const{listener:o,rawEmitter:c}=i;let l=WH.get(a);const u=l&&l.options;if(u&&(u.persistent<r.persistent||u.interval>r.interval)){(0,se.unwatchFile)(a);l=undefined}if(l){addAndConvert(l,$H,o);addAndConvert(l,zH,c)}else{l={listeners:o,rawEmitters:c,options:r,watcher:(0,se.watchFile)(a,r,((r,i)=>{foreach(l.rawEmitters,(t=>{t(PH.CHANGE,a,{curr:r,prev:i})}));const o=r.mtimeMs;if(r.size!==i.size||o>i.mtimeMs||o===0){foreach(l.listeners,(a=>a(t,r)))}}))};WH.set(a,l)}return()=>{delFromSet(l,$H,o);delFromSet(l,zH,c);if(isEmptySet(l.listeners)){WH.delete(a);(0,se.unwatchFile)(a);l.options=l.watcher=undefined;Object.freeze(l)}}};class NodeFsHandler{constructor(t){this.fsw=t;this._boundHandleError=a=>t._handleError(a)}_watchWithNodeFs(t,a){const r=this.fsw.options;const i=W.dirname(t);const o=W.basename(t);const c=this.fsw._getWatchedDir(i);c.add(o);const l=W.resolve(t);const u={persistent:r.persistent};if(!a)a=EMPTY_FN;let d;if(r.usePolling){const i=r.interval!==r.binaryInterval;u.interval=i&&isBinaryPath(o)?r.binaryInterval:r.interval;d=setFsWatchFileListener(t,l,u,{listener:a,rawEmitter:this.fsw._emitRaw})}else{d=setFsWatchListener(t,l,u,{listener:a,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw})}return d}_handleFile(t,a,r){if(this.fsw.closed){return}const i=W.dirname(t);const o=W.basename(t);const c=this.fsw._getWatchedDir(i);let l=a;if(c.has(o))return;const listener=async(a,r)=>{if(!this.fsw._throttle(OH,t,5))return;if(!r||r.mtimeMs===0){try{const r=await(0,Z.stat)(t);if(this.fsw.closed)return;const i=r.atimeMs;const o=r.mtimeMs;if(!i||i<=o||o!==l.mtimeMs){this.fsw._emit(PH.CHANGE,t,r)}if((LH||TH||RH)&&l.ino!==r.ino){this.fsw._closeFile(a);l=r;const i=this._watchWithNodeFs(t,listener);if(i)this.fsw._addPathCloser(a,i)}else{l=r}}catch(t){this.fsw._remove(i,o)}}else if(c.has(o)){const a=r.atimeMs;const i=r.mtimeMs;if(!a||a<=i||i!==l.mtimeMs){this.fsw._emit(PH.CHANGE,t,r)}l=r}};const u=this._watchWithNodeFs(t,listener);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(PH.ADD,t,0))return;this.fsw._emit(PH.ADD,t,a)}return u}async _handleSymlink(t,a,r,i){if(this.fsw.closed){return}const o=t.fullPath;const c=this.fsw._getWatchedDir(a);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await(0,Z.realpath)(r)}catch(t){this.fsw._emitReady();return true}if(this.fsw.closed)return;if(c.has(i)){if(this.fsw._symlinkPaths.get(o)!==a){this.fsw._symlinkPaths.set(o,a);this.fsw._emit(PH.CHANGE,r,t.stats)}}else{c.add(i);this.fsw._symlinkPaths.set(o,a);this.fsw._emit(PH.ADD,r,t.stats)}this.fsw._emitReady();return true}if(this.fsw._symlinkPaths.has(o)){return true}this.fsw._symlinkPaths.set(o,true)}_handleRead(t,a,r,i,o,c,l){t=W.join(t,"");l=this.fsw._throttle("readdir",t,1e3);if(!l)return;const u=this.fsw._getWatchedDir(r.path);const d=new Set;let p=this.fsw._readdirp(t,{fileFilter:t=>r.filterPath(t),directoryFilter:t=>r.filterDir(t)});if(!p)return;p.on(QH,(async l=>{if(this.fsw.closed){p=undefined;return}const A=l.path;let g=W.join(t,A);d.add(A);if(l.stats.isSymbolicLink()&&await this._handleSymlink(l,t,g,A)){return}if(this.fsw.closed){p=undefined;return}if(A===i||!i&&!u.has(A)){this.fsw._incrReadyCount();g=W.join(o,W.relative(o,g));this._addToNodeFs(g,a,r,c+1)}})).on(PH.ERROR,this._boundHandleError);return new Promise(((a,A)=>{if(!p)return A();p.once(DH,(()=>{if(this.fsw.closed){p=undefined;return}const A=l?l.clear():false;a(undefined);u.getChildren().filter((a=>a!==t&&!d.has(a))).forEach((a=>{this.fsw._remove(t,a)}));p=undefined;if(A)this._handleRead(t,false,r,i,o,c,l)}))}))}async _handleDir(t,a,r,i,o,c,l){const u=this.fsw._getWatchedDir(W.dirname(t));const d=u.has(W.basename(t));if(!(r&&this.fsw.options.ignoreInitial)&&!o&&!d){this.fsw._emit(PH.ADD_DIR,t,a)}u.add(W.basename(t));this.fsw._getWatchedDir(t);let p;let A;const g=this.fsw.options.depth;if((g==null||i<=g)&&!this.fsw._symlinkPaths.has(l)){if(!o){await this._handleRead(t,r,c,o,t,i,p);if(this.fsw.closed)return}A=this._watchWithNodeFs(t,((a,r)=>{if(r&&r.mtimeMs===0)return;this._handleRead(a,false,c,o,t,i,p)}))}return A}async _addToNodeFs(t,a,r,i,o){const c=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed){c();return false}const l=this.fsw._getWatchHelpers(t);if(r){l.filterPath=t=>r.filterPath(t);l.filterDir=t=>r.filterDir(t)}try{const r=await qH[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,r)){c();return false}const u=this.fsw.options.followSymlinks;let d;if(r.isDirectory()){const c=W.resolve(t);const p=u?await(0,Z.realpath)(t):t;if(this.fsw.closed)return;d=await this._handleDir(l.watchPath,r,a,i,o,l,p);if(this.fsw.closed)return;if(c!==p&&p!==undefined){this.fsw._symlinkPaths.set(c,p)}}else if(r.isSymbolicLink()){const o=u?await(0,Z.realpath)(t):t;if(this.fsw.closed)return;const c=W.dirname(l.watchPath);this.fsw._getWatchedDir(c).add(l.watchPath);this.fsw._emit(PH.ADD,l.watchPath,r);d=await this._handleDir(c,r,a,i,t,l,o);if(this.fsw.closed)return;if(o!==undefined){this.fsw._symlinkPaths.set(W.resolve(t),o)}}else{d=this._handleFile(l.watchPath,r,a)}c();if(d)this.fsw._addPathCloser(t,d);return false}catch(a){if(this.fsw._handleError(a)){c();return t}}}}
212
212
  /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
213
213
  const KH="/";const ZH="//";const JH=".";const VH="..";const XH="string";const eU=/\\/g;const tU=/\/\//;const nU=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;const aU=/^\.[/\\]/;function arrify(t){return Array.isArray(t)?t:[t]}const isMatcherObject=t=>typeof t==="object"&&t!==null&&!(t instanceof RegExp);function createPattern(t){if(typeof t==="function")return t;if(typeof t==="string")return a=>t===a;if(t instanceof RegExp)return a=>t.test(a);if(typeof t==="object"&&t!==null){return a=>{if(t.path===a)return true;if(t.recursive){const r=W.relative(t.path,a);if(!r){return false}return!r.startsWith("..")&&!W.isAbsolute(r)}return false}}return()=>false}function normalizePath(t){if(typeof t!=="string")throw new Error("string expected");t=W.normalize(t);t=t.replace(/\\/g,"/");let a=false;if(t.startsWith("//"))a=true;const r=/\/\//;while(t.match(r))t=t.replace(r,"/");if(a)t="/"+t;return t}function matchPatterns(t,a,r){const i=normalizePath(a);for(let a=0;a<t.length;a++){const o=t[a];if(o(i,r)){return true}}return false}function anymatch(t,a){if(t==null){throw new TypeError("anymatch: specify first argument")}const r=arrify(t);const i=r.map((t=>createPattern(t)));if(a==null){return(t,a)=>matchPatterns(i,t,a)}return matchPatterns(i,a)}const unifyPaths=t=>{const a=arrify(t).flat();if(!a.every((t=>typeof t===XH))){throw new TypeError(`Non-string provided as watch path: ${a}`)}return a.map(normalizePathToUnix)};const toUnix=t=>{let a=t.replace(eU,KH);let r=false;if(a.startsWith(ZH)){r=true}while(a.match(tU)){a=a.replace(tU,KH)}if(r){a=KH+a}return a};const normalizePathToUnix=t=>toUnix(W.normalize(toUnix(t)));const normalizeIgnored=(t="")=>a=>{if(typeof a==="string"){return normalizePathToUnix(W.isAbsolute(a)?a:W.join(t,a))}else{return a}};const getAbsolutePath=(t,a)=>{if(W.isAbsolute(t)){return t}return W.join(a,t)};const rU=Object.freeze(new Set);class DirEntry{constructor(t,a){this.path=t;this._removeWatcher=a;this.items=new Set}add(t){const{items:a}=this;if(!a)return;if(t!==JH&&t!==VH)a.add(t)}async remove(t){const{items:a}=this;if(!a)return;a.delete(t);if(a.size>0)return;const r=this.path;try{await(0,Z.readdir)(r)}catch(t){if(this._removeWatcher){this._removeWatcher(W.dirname(r),W.basename(r))}}}has(t){const{items:a}=this;if(!a)return;return a.has(t)}getChildren(){const{items:t}=this;if(!t)return[];return[...t.values()]}dispose(){this.items.clear();this.path="";this._removeWatcher=EMPTY_FN;this.items=rU;Object.freeze(this)}}const iU="stat";const oU="lstat";class WatchHelper{constructor(t,a,r){this.fsw=r;const i=t;this.path=t=t.replace(aU,"");this.watchPath=i;this.fullWatchPath=W.resolve(i);this.dirParts=[];this.dirParts.forEach((t=>{if(t.length>1)t.pop()}));this.followSymlinks=a;this.statMethod=a?iU:oU}entryPath(t){return W.join(this.watchPath,W.relative(this.watchPath,t.fullPath))}filterPath(t){const{stats:a}=t;if(a&&a.isSymbolicLink())return this.filterDir(t);const r=this.entryPath(t);return this.fsw._isntIgnored(r,a)&&this.fsw._hasReadPermissions(a)}filterDir(t){return this.fsw._isntIgnored(this.entryPath(t),t.stats)}}class FSWatcher extends yH.EventEmitter{constructor(t={}){super();this.closed=false;this._closers=new Map;this._ignoredPaths=new Set;this._throttled=new Map;this._streams=new Set;this._symlinkPaths=new Map;this._watched=new Map;this._pendingWrites=new Map;this._pendingUnlinks=new Map;this._readyCount=0;this._readyEmitted=false;const a=t.awaitWriteFinish;const r={stabilityThreshold:2e3,pollInterval:100};const i={persistent:true,ignoreInitial:false,ignorePermissionErrors:false,interval:100,binaryInterval:300,followSymlinks:true,usePolling:false,atomic:true,...t,ignored:t.ignored?arrify(t.ignored):arrify([]),awaitWriteFinish:a===true?r:typeof a==="object"?{...r,...a}:false};if(MH)i.usePolling=true;if(i.atomic===undefined)i.atomic=!i.usePolling;const o=process.env.CHOKIDAR_USEPOLLING;if(o!==undefined){const t=o.toLowerCase();if(t==="false"||t==="0")i.usePolling=false;else if(t==="true"||t==="1")i.usePolling=true;else i.usePolling=!!t}const c=process.env.CHOKIDAR_INTERVAL;if(c)i.interval=Number.parseInt(c,10);let l=0;this._emitReady=()=>{l++;if(l>=this._readyCount){this._emitReady=EMPTY_FN;this._readyEmitted=true;process.nextTick((()=>this.emit(jH.READY)))}};this._emitRaw=(...t)=>this.emit(jH.RAW,...t);this._boundRemove=this._remove.bind(this);this.options=i;this._nodeFsHandler=new NodeFsHandler(this);Object.freeze(i)}_addIgnoredPath(t){if(isMatcherObject(t)){for(const a of this._ignoredPaths){if(isMatcherObject(a)&&a.path===t.path&&a.recursive===t.recursive){return}}}this._ignoredPaths.add(t)}_removeIgnoredPath(t){this._ignoredPaths.delete(t);if(typeof t==="string"){for(const a of this._ignoredPaths){if(isMatcherObject(a)&&a.path===t){this._ignoredPaths.delete(a)}}}}add(t,a,r){const{cwd:i}=this.options;this.closed=false;this._closePromise=undefined;let o=unifyPaths(t);if(i){o=o.map((t=>{const a=getAbsolutePath(t,i);return a}))}o.forEach((t=>{this._removeIgnoredPath(t)}));this._userIgnored=undefined;if(!this._readyCount)this._readyCount=0;this._readyCount+=o.length;Promise.all(o.map((async t=>{const i=await this._nodeFsHandler._addToNodeFs(t,!r,undefined,0,a);if(i)this._emitReady();return i}))).then((t=>{if(this.closed)return;t.forEach((t=>{if(t)this.add(W.dirname(t),W.basename(a||t))}))}));return this}unwatch(t){if(this.closed)return this;const a=unifyPaths(t);const{cwd:r}=this.options;a.forEach((t=>{if(!W.isAbsolute(t)&&!this._closers.has(t)){if(r)t=W.join(r,t);t=W.resolve(t)}this._closePath(t);this._addIgnoredPath(t);if(this._watched.has(t)){this._addIgnoredPath({path:t,recursive:true})}this._userIgnored=undefined}));return this}close(){if(this._closePromise){return this._closePromise}this.closed=true;this.removeAllListeners();const t=[];this._closers.forEach((a=>a.forEach((a=>{const r=a();if(r instanceof Promise)t.push(r)}))));this._streams.forEach((t=>t.destroy()));this._userIgnored=undefined;this._readyCount=0;this._readyEmitted=false;this._watched.forEach((t=>t.dispose()));this._closers.clear();this._watched.clear();this._streams.clear();this._symlinkPaths.clear();this._throttled.clear();this._closePromise=t.length?Promise.all(t).then((()=>undefined)):Promise.resolve();return this._closePromise}getWatched(){const t={};this._watched.forEach(((a,r)=>{const i=this.options.cwd?W.relative(this.options.cwd,r):r;const o=i||JH;t[o]=a.getChildren().sort()}));return t}emitWithAll(t,a){this.emit(t,...a);if(t!==jH.ERROR)this.emit(jH.ALL,t,...a)}async _emit(t,a,r){if(this.closed)return;const i=this.options;if(NH)a=W.normalize(a);if(i.cwd)a=W.relative(i.cwd,a);const o=[a];if(r!=null)o.push(r);const c=i.awaitWriteFinish;let l;if(c&&(l=this._pendingWrites.get(a))){l.lastChange=new Date;return this}if(i.atomic){if(t===jH.UNLINK){this._pendingUnlinks.set(a,[t,...o]);setTimeout((()=>{this._pendingUnlinks.forEach(((t,a)=>{this.emit(...t);this.emit(jH.ALL,...t);this._pendingUnlinks.delete(a)}))}),typeof i.atomic==="number"?i.atomic:100);return this}if(t===jH.ADD&&this._pendingUnlinks.has(a)){t=jH.CHANGE;this._pendingUnlinks.delete(a)}}if(c&&(t===jH.ADD||t===jH.CHANGE)&&this._readyEmitted){const awfEmit=(a,r)=>{if(a){t=jH.ERROR;o[0]=a;this.emitWithAll(t,o)}else if(r){if(o.length>1){o[1]=r}else{o.push(r)}this.emitWithAll(t,o)}};this._awaitWriteFinish(a,c.stabilityThreshold,t,awfEmit);return this}if(t===jH.CHANGE){const t=!this._throttle(jH.CHANGE,a,50);if(t)return this}if(i.alwaysStat&&r===undefined&&(t===jH.ADD||t===jH.ADD_DIR||t===jH.CHANGE)){const t=i.cwd?W.join(i.cwd,a):a;let r;try{r=await(0,Z.stat)(t)}catch(t){}if(!r||this.closed)return;o.push(r)}this.emitWithAll(t,o);return this}_handleError(t){const a=t&&t.code;if(t&&a!=="ENOENT"&&a!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||a!=="EPERM"&&a!=="EACCES")){this.emit(jH.ERROR,t)}return t||this.closed}_throttle(t,a,r){if(!this._throttled.has(t)){this._throttled.set(t,new Map)}const i=this._throttled.get(t);if(!i)throw new Error("invalid throttle");const o=i.get(a);if(o){o.count++;return false}let c;const clear=()=>{const t=i.get(a);const r=t?t.count:0;i.delete(a);clearTimeout(c);if(t)clearTimeout(t.timeoutObject);return r};c=setTimeout(clear,r);const l={timeoutObject:c,clear:clear,count:0};i.set(a,l);return l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,a,r,i){const o=this.options.awaitWriteFinish;if(typeof o!=="object")return;const c=o.pollInterval;let l;let u=t;if(this.options.cwd&&!W.isAbsolute(t)){u=W.join(this.options.cwd,t)}const d=new Date;const p=this._pendingWrites;function awaitWriteFinishFn(r){(0,se.stat)(u,((o,u)=>{if(o||!p.has(t)){if(o&&o.code!=="ENOENT")i(o);return}const d=Number(new Date);if(r&&u.size!==r.size){p.get(t).lastChange=d}const A=p.get(t);const g=d-A.lastChange;if(g>=a){p.delete(t);i(undefined,u)}else{l=setTimeout(awaitWriteFinishFn,c,u)}}))}if(!p.has(t)){p.set(t,{lastChange:d,cancelWait:()=>{p.delete(t);clearTimeout(l);return r}});l=setTimeout(awaitWriteFinishFn,c)}}_isIgnored(t,a){if(this.options.atomic&&nU.test(t))return true;if(!this._userIgnored){const{cwd:t}=this.options;const a=this.options.ignored;const r=(a||[]).map(normalizeIgnored(t));const i=[...this._ignoredPaths];const o=[...i.map(normalizeIgnored(t)),...r];this._userIgnored=anymatch(o,undefined)}return this._userIgnored(t,a)}_isntIgnored(t,a){return!this._isIgnored(t,a)}_getWatchHelpers(t){return new WatchHelper(t,this.options.followSymlinks,this)}_getWatchedDir(t){const a=W.resolve(t);if(!this._watched.has(a))this._watched.set(a,new DirEntry(a,this._boundRemove));return this._watched.get(a)}_hasReadPermissions(t){if(this.options.ignorePermissionErrors)return true;return Boolean(Number(t.mode)&256)}_remove(t,a,r){const i=W.join(t,a);const o=W.resolve(i);r=r!=null?r:this._watched.has(i)||this._watched.has(o);if(!this._throttle("remove",i,100))return;if(!r&&this._watched.size===1){this.add(t,a,true)}const c=this._getWatchedDir(i);const l=c.getChildren();l.forEach((t=>this._remove(i,t)));const u=this._getWatchedDir(t);const d=u.has(a);u.remove(a);if(this._symlinkPaths.has(o)){this._symlinkPaths.delete(o)}let p=i;if(this.options.cwd)p=W.relative(this.options.cwd,i);if(this.options.awaitWriteFinish&&this._pendingWrites.has(p)){const t=this._pendingWrites.get(p).cancelWait();if(t===jH.ADD)return}this._watched.delete(i);this._watched.delete(o);const A=r?jH.UNLINK_DIR:jH.UNLINK;if(d&&!this._isIgnored(i))this._emit(A,i);this._closePath(i)}_closePath(t){this._closeFile(t);const a=W.dirname(t);this._getWatchedDir(a).remove(W.basename(t))}_closeFile(t){const a=this._closers.get(t);if(!a)return;a.forEach((t=>t()));this._closers.delete(t)}_addPathCloser(t,a){if(!a)return;let r=this._closers.get(t);if(!r){r=[];this._closers.set(t,r)}r.push(a)}_readdirp(t,a){if(this.closed)return;const r={type:jH.ALL,alwaysStat:true,lstat:true,...a,depth:0};let i=readdirp(t,r);this._streams.add(i);i.once(SH,(()=>{i=undefined}));i.once(DH,(()=>{if(i){this._streams.delete(i);i=undefined}}));return i}}function watch(t,a={}){const r=new FSWatcher(a);r.add(t);return r}const sU={watch:watch,FSWatcher:FSWatcher};var cU=__nccwpck_require__(58611);var lU=__nccwpck_require__.n(cU);const uU={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(uU);const dU=uU;const pU={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(pU);const AU=pU;var mU=undefined&&undefined.__classPrivateFieldGet||function(t,a,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof a==="function"?t!==a||!i:!a.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:a.get(t)};var gU,fU,hU;class Mime{constructor(...t){gU.set(this,new Map);fU.set(this,new Map);hU.set(this,new Map);for(const a of t){this.define(a)}}define(t,a=false){for(let[r,i]of Object.entries(t)){r=r.toLowerCase();i=i.map((t=>t.toLowerCase()));if(!mU(this,hU,"f").has(r)){mU(this,hU,"f").set(r,new Set)}const t=mU(this,hU,"f").get(r);let o=true;for(let c of i){const i=c.startsWith("*");c=i?c.slice(1):c;t?.add(c);if(o){mU(this,fU,"f").set(r,c)}o=false;if(i)continue;const l=mU(this,gU,"f").get(c);if(l&&l!=r&&!a){throw new Error(`"${r} -> ${c}" conflicts with "${l} -> ${c}". Pass \`force=true\` to override this definition.`)}mU(this,gU,"f").set(c,r)}}return this}getType(t){if(typeof t!=="string")return null;const a=t.replace(/^.*[/\\]/,"").toLowerCase();const r=a.replace(/^.*\./,"").toLowerCase();const i=a.length<t.length;const o=r.length<a.length-1;if(!o&&i)return null;return mU(this,gU,"f").get(r)??null}getExtension(t){if(typeof t!=="string")return null;t=t?.split?.(";")[0];return(t&&mU(this,fU,"f").get(t.trim().toLowerCase()))??null}getAllExtensions(t){if(typeof t!=="string")return null;return mU(this,hU,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")};Object.freeze(this);for(const t of mU(this,hU,"f").values()){Object.freeze(t)}return this}_getTestState(){return{types:mU(this,gU,"f"),extensions:mU(this,fU,"f")}}}gU=new WeakMap,fU=new WeakMap,hU=new WeakMap;const bU=Mime;const yU=new bU(AU,dU)._freeze();var wU=__nccwpck_require__(59243);var kU=__nccwpck_require__(32890);var _U=__nccwpck_require__(38958);var vU=__nccwpck_require__(45200);var CU=__nccwpck_require__(51838);const BU=null&&WebSocket;async function runDev({port:t=8080}){const a=process.cwd();const r=await it.get(a);const i=K().join(r.src,".hyperbook","out");const o=lU().createServer((async(a,o)=>{if(a.method!=="GET"){const t=`Forbidden Method: ${a.method}`;o.writeHead(403,{"Content-Type":"plain/text","Content-Length":Buffer.byteLength(t)});return o.end(t)}if(a.url==="/__hyperbook_dev.js"){const a=`\nconst socket = new WebSocket("ws://localhost:${t}");\nsocket.addEventListener("message", (event) => {\n if (event.data === "RELOAD") {\n window.location.reload();\n }\n});\n`;o.writeHead(200,{"Content-Length":a.length,"Content-Type":"application/javascript"});return o.end(a)}if(!a.url)return;const c=new URL(a.url,`http://${a.headers.host}`);let l=c.pathname;const u=r.basePath||"";l=l.slice(u.length);if(l.endsWith("/")){l+="index.html"}try{let t=K().join(i,l);let a;a=await ce().promises.readFile(t).catch((async()=>{t=K().join(i,l+".html");return await ce().promises.readFile(t)})).catch((async()=>{t=K().join(i,l,"index.html");return await ce().promises.readFile(t)}));if(t.endsWith(".html")){a=Buffer.from(a.toString().replace(/(<\/body>)(?![\s\S]*\1)/,'<script src="/__hyperbook_dev.js"><\/script></body>'))}o.writeHead(200,{"Content-Type":yU.getType(t),"Content-Length":Buffer.byteLength(a)});return o.end(a)}catch(t){const a=`Cannot GET resource: ${l}`;o.writeHead(404,{"Content-Type":"plain/text","Content-Length":Buffer.byteLength(a)});return o.end(a)}}));const c=new CU({server:o});c.on("reload",(()=>{c.clients.forEach((t=>{t.send("RELOAD")}))}));let l=false;const rebuild=t=>async a=>{if(!l){console.log(`${N.yellow(`[Rebuilding ${t}]`)}: ${a}.`);l=true;try{const t=await it.get(process.cwd());await runBuildProject(t,t);console.log(`${N.yellow(`[Reloading]`)}: Website`);c.emit("reload")}catch(t){if(t instanceof Error){console.error(`${N.red(`[Error]`)}: ${t.message}.`)}else{console.error(`${N.red(`[Error]`)}: ${t}.`)}}l=false}};await rebuild("(Initialize)")("");o.listen(t,(()=>{console.log(`${N.yellow(`[DEV-SERVER]`)} is running at http://localhost:${t}`)}));sU.watch(".",{ignoreInitial:true,cwd:a,usePolling:true,interval:600,ignored:[i,K().join("archives","*.zip")]}).on("add",rebuild("(Added)")).on("change",rebuild("(Changed)")).on("unlink",rebuild("(Deleted)"))}const EU=require("child_process");function getPkgManager(){try{const t=process.env.npm_config_user_agent;if(t){if(t.startsWith("yarn")){return"yarn"}else if(t.startsWith("pnpm")){return"pnpm"}}try{(0,EU.execSync)("yarn --version",{stdio:"ignore"});return"yarn"}catch{(0,EU.execSync)("pnpm --version",{stdio:"ignore"});return"pnpm"}}catch{return"npm"}}async function pMap(t,a,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=true,signal:o}={}){return new Promise(((c,l)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof a!=="function"){throw new TypeError("Mapper function is required")}if(!(Number.isSafeInteger(r)&&r>=1||r===Number.POSITIVE_INFINITY)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`)}const u=[];const d=[];const p=new Map;let A=false;let g=false;let h=false;let b=0;let y=0;const w=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const signalListener=()=>{reject(o.reason)};const cleanup=()=>{o?.removeEventListener("abort",signalListener)};const resolve=t=>{c(t);cleanup()};const reject=t=>{A=true;g=true;l(t);cleanup()};if(o){if(o.aborted){reject(o.reason)}o.addEventListener("abort",signalListener,{once:true})}const next=async()=>{if(g){return}const t=await w.next();const r=y;y++;if(t.done){h=true;if(b===0&&!g){if(!i&&d.length>0){reject(new AggregateError(d));return}g=true;if(p.size===0){resolve(u);return}const t=[];for(const[a,r]of u.entries()){if(p.get(a)===xU){continue}t.push(r)}resolve(t)}return}b++;(async()=>{try{const i=await t.value;if(g){return}const o=await a(i,r);if(o===xU){p.set(r,o)}u[r]=o;b--;await next()}catch(t){if(i){reject(t)}else{d.push(t);b--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<r;t++){try{await next()}catch(t){reject(t);break}if(h||A){break}}})()}))}function p_map_pMapIterable(t,a,{concurrency:r=Number.POSITIVE_INFINITY,backpressure:i=r}={}){if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof a!=="function"){throw new TypeError("Mapper function is required")}if(!(Number.isSafeInteger(r)&&r>=1||r===Number.POSITIVE_INFINITY)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`)}if(!(Number.isSafeInteger(i)&&i>=r||i===Number.POSITIVE_INFINITY)){throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${r}) and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}return{async*[Symbol.asyncIterator](){const o=t[Symbol.asyncIterator]===undefined?t[Symbol.iterator]():t[Symbol.asyncIterator]();const c=[];let l=0;let u=false;let d=0;function trySpawn(){if(u||!(l<r&&c.length<i)){return}const t=(async()=>{const{done:r,value:i}=await o.next();if(r){return{done:true}}l++;trySpawn();try{const r=await a(await i,d++);l--;if(r===xU){const a=c.indexOf(t);if(a>0){c.splice(a,1)}}trySpawn();return{done:false,value:r}}catch(t){u=true;return{error:t}}})();c.push(t)}trySpawn();while(c.length>0){const{error:t,done:a,value:r}=await c[0];c.shift();if(t){throw t}if(a){return}trySpawn();if(r===xU){continue}yield r}}}}const xU=Symbol("skip");class TimeoutError extends Error{constructor(t){super(t);this.name="TimeoutError"}}class AbortError extends Error{constructor(t){super();this.name="AbortError";this.message=t}}const getDOMException=t=>globalThis.DOMException===undefined?new AbortError(t):new DOMException(t);const getAbortedReason=t=>{const a=t.reason===undefined?getDOMException("This operation was aborted."):t.reason;return a instanceof Error?a:getDOMException(a)};function pTimeout(t,a){const{milliseconds:r,fallback:i,message:o,customTimers:c={setTimeout:setTimeout,clearTimeout:clearTimeout}}=a;let l;let u;const d=new Promise(((d,p)=>{if(typeof r!=="number"||Math.sign(r)!==1){throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``)}if(a.signal){const{signal:t}=a;if(t.aborted){p(getAbortedReason(t))}u=()=>{p(getAbortedReason(t))};t.addEventListener("abort",u,{once:true})}if(r===Number.POSITIVE_INFINITY){t.then(d,p);return}const A=new TimeoutError;l=c.setTimeout.call(undefined,(()=>{if(i){try{d(i())}catch(t){p(t)}return}if(typeof t.cancel==="function"){t.cancel()}if(o===false){d()}else if(o instanceof Error){p(o)}else{A.message=o??`Promise timed out after ${r} milliseconds`;p(A)}}),r);(async()=>{try{d(await t)}catch(t){p(t)}})()}));const p=d.finally((()=>{p.clear();if(u&&a.signal){a.signal.removeEventListener("abort",u)}}));p.clear=()=>{c.clearTimeout.call(undefined,l);l=undefined};return p}const normalizeEmitter=t=>{const a=t.addEventListener||t.on||t.addListener;const r=t.removeEventListener||t.off||t.removeListener;if(!a||!r){throw new TypeError("Emitter is not compatible")}return{addListener:a.bind(t),removeListener:r.bind(t)}};function pEventMultiple(t,a,r){let i;const o=new Promise(((o,c)=>{r={rejectionEvents:["error"],multiArgs:false,resolveImmediately:false,...r};if(!(r.count>=0&&(r.count===Number.POSITIVE_INFINITY||Number.isInteger(r.count)))){throw new TypeError("The `count` option should be at least 0 or more")}r.signal?.throwIfAborted();const l=[a].flat();const u=[];const{addListener:d,removeListener:p}=normalizeEmitter(t);const onItem=(...t)=>{const a=r.multiArgs?t:t[0];if(r.filter&&!r.filter(a)){return}u.push(a);if(r.count===u.length){i();o(u)}};const rejectHandler=t=>{i();c(t)};i=()=>{for(const t of l){p(t,onItem)}for(const t of r.rejectionEvents){p(t,rejectHandler)}};for(const t of l){d(t,onItem)}for(const t of r.rejectionEvents){d(t,rejectHandler)}if(r.signal){r.signal.addEventListener("abort",(()=>{rejectHandler(r.signal.reason)}),{once:true})}if(r.resolveImmediately){o(u)}}));o.cancel=i;if(typeof r.timeout==="number"){const t=pTimeout(o,{milliseconds:r.timeout});t.cancel=i;return t}return o}function pEvent(t,a,r){if(typeof r==="function"){r={filter:r}}r={...r,count:1,resolveImmediately:false};const i=pEventMultiple(t,a,r);const o=i.then((t=>t[0]));o.cancel=i.cancel;return o}function pEventIterator(t,a,r){if(typeof r==="function"){r={filter:r}}const i=[a].flat();r={rejectionEvents:["error"],resolutionEvents:[],limit:Number.POSITIVE_INFINITY,multiArgs:false,...r};const{limit:o}=r;const c=o>=0&&(o===Number.POSITIVE_INFINITY||Number.isInteger(o));if(!c){throw new TypeError("The `limit` option should be a non-negative integer or Infinity")}r.signal?.throwIfAborted();if(o===0){return{[Symbol.asyncIterator](){return this},async next(){return{done:true,value:undefined}}}}const{addListener:l,removeListener:u}=normalizeEmitter(t);let d=false;let p;let A=false;const g=[];const h=[];let b=0;let y=false;const valueHandler=(...t)=>{b++;y=b===o;const a=r.multiArgs?t:t[0];if(g.length>0){const{resolve:t}=g.shift();t({done:false,value:a});if(y){cancel()}return}h.push(a);if(y){cancel()}};const cancel=()=>{d=true;for(const t of i){u(t,valueHandler)}for(const t of r.rejectionEvents){u(t,rejectHandler)}for(const t of r.resolutionEvents){u(t,resolveHandler)}while(g.length>0){const{resolve:t}=g.shift();t({done:true,value:undefined})}};const rejectHandler=(...t)=>{p=r.multiArgs?t:t[0];if(g.length>0){const{reject:t}=g.shift();t(p)}else{A=true}cancel()};const resolveHandler=(...t)=>{const a=r.multiArgs?t:t[0];if(r.filter&&!r.filter(a)){cancel();return}if(g.length>0){const{resolve:t}=g.shift();t({done:true,value:a})}else{h.push(a)}cancel()};for(const t of i){l(t,valueHandler)}for(const t of r.rejectionEvents){l(t,rejectHandler)}for(const t of r.resolutionEvents){l(t,resolveHandler)}if(r.signal){r.signal.addEventListener("abort",(()=>{rejectHandler(r.signal.reason)}),{once:true})}return{[Symbol.asyncIterator](){return this},async next(){if(h.length>0){const t=h.shift();return{done:d&&h.length===0&&!y,value:t}}if(A){A=false;throw p}if(d){return{done:true,value:undefined}}return new Promise(((t,a)=>{g.push({resolve:t,reject:a})}))},async return(t){cancel();return{done:d,value:t}}}}class copy_file_error_CopyFileError extends Error{constructor(t,{cause:a}={}){super(t,{cause:a});Object.assign(this,a);this.name="CopyFileError"}}const IU=require("node:util");var QU=__nccwpck_require__(75219);const DU=(0,IU.promisify)(QU.stat);const SU=(0,IU.promisify)(QU.lstat);const FU=(0,IU.promisify)(QU.utimes);const NU=(0,IU.promisify)(QU.chmod);const LU=(0,IU.promisify)(QU.mkdir);const TU=QU.closeSync.bind(QU);const RU=QU.createWriteStream.bind(QU);async function createReadStream(t,a){const r=QU.createReadStream(t,a);try{await pEvent(r,["readable","end"])}catch(a){throw new copy_file_error_CopyFileError(`Cannot read from \`${t}\`: ${a.message}`,{cause:a})}return r}const fs_stat=t=>DU(t).catch((a=>{throw new CopyFileError(`Cannot stat path \`${t}\`: ${a.message}`,{cause:a})}));const fs_lstat=t=>SU(t).catch((a=>{throw new copy_file_error_CopyFileError(`lstat \`${t}\` failed: ${a.message}`,{cause:a})}));const utimes=(t,a,r)=>FU(t,a,r).catch((a=>{throw new copy_file_error_CopyFileError(`utimes \`${t}\` failed: ${a.message}`,{cause:a})}));const fs_chmod=(t,a)=>NU(t,a).catch((a=>{throw new copy_file_error_CopyFileError(`chmod \`${t}\` failed: ${a.message}`,{cause:a})}));const statSync=t=>{try{return fs.statSync(t)}catch(a){throw new CopyFileError(`stat \`${t}\` failed: ${a.message}`,{cause:a})}};const lstatSync=t=>{try{return fs.statSync(t)}catch(a){throw new CopyFileError(`stat \`${t}\` failed: ${a.message}`,{cause:a})}};const utimesSync=(t,a,r)=>{try{return fs.utimesSync(t,a,r)}catch(a){throw new CopyFileError(`utimes \`${t}\` failed: ${a.message}`,{cause:a})}};const makeDirectory=(t,a)=>LU(t,{...a,recursive:true}).catch((a=>{throw new copy_file_error_CopyFileError(`Cannot create directory \`${t}\`: ${a.message}`,{cause:a})}));const makeDirectorySync=(t,a)=>{try{fs.mkdirSync(t,{...a,recursive:true})}catch(a){throw new CopyFileError(`Cannot create directory \`${t}\`: ${a.message}`,{cause:a})}};const copyFileSync=(t,a,r)=>{try{fs.copyFileSync(t,a,r)}catch(r){throw new CopyFileError(`Cannot copy from \`${t}\` to \`${a}\`: ${r.message}`,{cause:r})}};const resolvePath=(t,a,r)=>({sourcePath:ee.resolve(t,a),destinationPath:ee.resolve(t,r)});const checkSourceIsFile=(t,a)=>{if(!t.isFile()){throw Object.assign(new copy_file_error_CopyFileError(`EISDIR: illegal operation on a directory '${a}'`),{errno:-21,code:"EISDIR",source:a})}};async function copyFile(t,a,r={}){if(!t||!a){throw new copy_file_error_CopyFileError("`source` and `destination` required")}if(r.cwd){({sourcePath:t,destinationPath:a}=resolvePath(r.cwd,t,a))}r={overwrite:true,...r};const i=await fs_lstat(t);const{size:o}=i;checkSourceIsFile(i,t);await makeDirectory(ee.dirname(a),{mode:r.directoryMode});if(typeof r.onProgress==="function"){const i=await createReadStream(t);const c=RU(a,{flags:r.overwrite?"w":"wx"});const emitProgress=i=>{r.onProgress({sourcePath:ee.resolve(t),destinationPath:ee.resolve(a),size:o,writtenBytes:i,percent:i===o?1:i/o})};i.on("data",(()=>{emitProgress(c.bytesWritten)}));let l;i.once("error",(a=>{l=new copy_file_error_CopyFileError(`Cannot read from \`${t}\`: ${a.message}`,{cause:a})}));let u=false;try{const t=pEvent(c,"close");i.pipe(c);await t;emitProgress(o);u=true}catch(t){throw new copy_file_error_CopyFileError(`Cannot write to \`${a}\`: ${t.message}`,{cause:t})}if(l){throw l}if(u){const r=await fs_lstat(t);return Promise.all([utimes(a,r.atime,r.mtime),fs_chmod(a,r.mode)])}}else{const o=r.overwrite?te.constants.COPYFILE_FICLONE:te.constants.COPYFILE_FICLONE|te.constants.COPYFILE_EXCL;try{await Yt.copyFile(t,a,o);await Promise.all([Yt.utimes(a,i.atime,i.mtime),Yt.chmod(a,i.mode)])}catch(t){throw new copy_file_error_CopyFileError(t.message,{cause:t})}}}function copy_file_copyFileSync(t,a,r={}){if(!t||!a){throw new CopyFileError("`source` and `destination` required")}if(r.cwd){({sourcePath:t,destinationPath:a}=resolvePath(r.cwd,t,a))}r={overwrite:true,...r};const i=fs.lstatSync(t);checkSourceIsFile(i,t);fs.makeDirectorySync(path.dirname(a),{mode:r.directoryMode});const o=r.overwrite?fsConstants.COPYFILE_FICLONE:fsConstants.COPYFILE_FICLONE|fsConstants.COPYFILE_EXCL;try{realFS.copyFileSync(t,a,o)}catch(t){throw new CopyFileError(t.message,{cause:t})}fs.utimesSync(a,i.atime,i.mtime);fs.chmod(a,i.mode)}async function pFilter(t,a,r){const i=await pMap(t,((t,r)=>Promise.all([a(t,r),t])),r);return i.filter((t=>Boolean(t[0]))).map((t=>t[1]))}function pFilterIterable(t,a,r){const i=pMapIterable(t,((t,r)=>Promise.all([a(t,r),t])),r);return{async*[Symbol.asyncIterator](){for await(const[t,a]of i){if(t){yield a}}}}}const MU=require("node:stream/promises");function mergeStreams(t){if(!Array.isArray(t)){throw new TypeError(`Expected an array, got \`${typeof t}\`.`)}for(const a of t){validateStream(a)}const a=t.some((({readableObjectMode:t})=>t));const r=getHighWaterMark(t,a);const i=new MergedStream({objectMode:a,writableHighWaterMark:r,readableHighWaterMark:r});for(const a of t){i.add(a)}if(t.length===0){endStream(i)}return i}const getHighWaterMark=(t,a)=>{if(t.length===0){return 16384}const r=t.filter((({readableObjectMode:t})=>t===a)).map((({readableHighWaterMark:t})=>t));return Math.max(...r)};class MergedStream extends Kt.PassThrough{#At=new Set([]);#mt=new Set([]);#gt=new Set([]);#ft;add(t){validateStream(t);if(this.#At.has(t)){return}this.#At.add(t);this.#ft??=onMergedStreamFinished(this,this.#At);endWhenStreamsDone({passThroughStream:this,stream:t,streams:this.#At,ended:this.#mt,aborted:this.#gt,onFinished:this.#ft});t.pipe(this,{end:false})}remove(t){validateStream(t);if(!this.#At.has(t)){return false}t.unpipe(this);return true}}const onMergedStreamFinished=async(t,a)=>{updateMaxListeners(t,PU);const r=new AbortController;try{await Promise.race([onMergedStreamEnd(t,r),onInputStreamsUnpipe(t,a,r)])}finally{r.abort();updateMaxListeners(t,-PU)}};const onMergedStreamEnd=async(t,{signal:a})=>{await(0,MU.finished)(t,{signal:a,cleanup:true})};const onInputStreamsUnpipe=async(t,a,{signal:r})=>{for await(const[i]of(0,Wt.on)(t,"unpipe",{signal:r})){if(a.has(i)){i.emit(jU)}}};const validateStream=t=>{if(typeof t?.pipe!=="function"){throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)}};const endWhenStreamsDone=async({passThroughStream:t,stream:a,streams:r,ended:i,aborted:o,onFinished:c})=>{updateMaxListeners(t,OU);const l=new AbortController;try{await Promise.race([afterMergedStreamFinished(c,a),onInputStreamEnd({passThroughStream:t,stream:a,streams:r,ended:i,aborted:o,controller:l}),onInputStreamUnpipe({stream:a,streams:r,ended:i,aborted:o,controller:l})])}finally{l.abort();updateMaxListeners(t,-OU)}if(r.size===i.size+o.size){if(i.size===0&&o.size>0){abortStream(t)}else{endStream(t)}}};const isAbortError=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE";const afterMergedStreamFinished=async(t,a)=>{try{await t;abortStream(a)}catch(t){if(isAbortError(t)){abortStream(a)}else{errorStream(a,t)}}};const onInputStreamEnd=async({passThroughStream:t,stream:a,streams:r,ended:i,aborted:o,controller:{signal:c}})=>{try{await(0,MU.finished)(a,{signal:c,cleanup:true,readable:true,writable:false});if(r.has(a)){i.add(a)}}catch(i){if(c.aborted||!r.has(a)){return}if(isAbortError(i)){o.add(a)}else{errorStream(t,i)}}};const onInputStreamUnpipe=async({stream:t,streams:a,ended:r,aborted:i,controller:{signal:o}})=>{await(0,Wt.once)(t,jU,{signal:o});a.delete(t);r.delete(t);i.delete(t)};const jU=Symbol("unpipe");const endStream=t=>{if(t.writable){t.end()}};const abortStream=t=>{if(t.readable||t.writable){t.destroy()}};const errorStream=(t,a)=>{if(!t.destroyed){t.once("error",noop);t.destroy(a)}};const noop=()=>{};const updateMaxListeners=(t,a)=>{const r=t.getMaxListeners();if(r!==0&&r!==Number.POSITIVE_INFINITY){t.setMaxListeners(r+a)}};const PU=2;const OU=1;var qU=__nccwpck_require__(38588);async function isType(t,a,r){if(typeof r!=="string"){throw new TypeError(`Expected a string, got ${typeof r}`)}try{const i=await se.promises[t](r);return i[a]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}function isTypeSync(t,a,r){if(typeof r!=="string"){throw new TypeError(`Expected a string, got ${typeof r}`)}try{return se[t](r)[a]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}const $U=isType.bind(null,"stat","isFile");const GU=isType.bind(null,"stat","isDirectory");const zU=isType.bind(null,"lstat","isSymbolicLink");const HU=isTypeSync.bind(null,"statSync","isFile");const UU=isTypeSync.bind(null,"statSync","isDirectory");const YU=isTypeSync.bind(null,"lstatSync","isSymbolicLink");var WU=__nccwpck_require__(71982);function slash(t){const a=t.startsWith("\\\\?\\");if(a){return t}return t.replace(/\\/g,"/")}const isNegativePattern=t=>t[0]==="!";const KU=["**/node_modules","**/flow-typed","**/coverage","**/.git"];const ZU={absolute:true,dot:true};const JU="**/.gitignore";const applyBaseToPattern=(t,a)=>isNegativePattern(t)?"!"+ee.posix.join(a,t.slice(1)):ee.posix.join(a,t);const parseIgnoreFile=(t,a)=>{const r=slash(ee.relative(a,ee.dirname(t.filePath)));return t.content.split(/\r?\n/).filter((t=>t&&!t.startsWith("#"))).map((t=>applyBaseToPattern(t,r)))};const toRelativePath=(t,a)=>{a=slash(a);if(ee.isAbsolute(t)){if(slash(t).startsWith(a)){return ee.relative(a,t)}throw new Error(`Path ${t} is not in cwd ${a}`)}return t};const getIsIgnoredPredicate=(t,a)=>{const r=t.flatMap((t=>parseIgnoreFile(t,a)));const i=WU().add(r);return t=>{t=node_toPath(t);t=toRelativePath(t,a);return t?i.ignores(slash(t)):false}};const normalizeOptions=(t={})=>({cwd:node_toPath(t.cwd)??d.cwd(),suppressErrors:Boolean(t.suppressErrors),deep:typeof t.deep==="number"?t.deep:Number.POSITIVE_INFINITY,ignore:[...t.ignore??[],...KU]});const isIgnoredByIgnoreFiles=async(t,a)=>{const{cwd:r,suppressErrors:i,deep:o,ignore:c}=normalizeOptions(a);const l=await qU(t,{cwd:r,suppressErrors:i,deep:o,ignore:c,...ZU});const u=await Promise.all(l.map((async t=>({filePath:t,content:await Yt.readFile(t,"utf8")}))));return getIsIgnoredPredicate(u,r)};const isIgnoredByIgnoreFilesSync=(t,a)=>{const{cwd:r,suppressErrors:i,deep:o,ignore:c}=normalizeOptions(a);const l=qU.sync(t,{cwd:r,suppressErrors:i,deep:o,ignore:c,...ZU});const u=l.map((t=>({filePath:t,content:te.readFileSync(t,"utf8")})));return getIsIgnoredPredicate(u,r)};const isGitIgnored=t=>isIgnoredByIgnoreFiles(JU,t);const isGitIgnoredSync=t=>isIgnoredByIgnoreFilesSync(JU,t);const assertPatternsInput=t=>{if(t.some((t=>typeof t!=="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const normalizePathForDirectoryGlob=(t,a)=>{const r=isNegativePattern(t)?t.slice(1):t;return ee.isAbsolute(r)?r:ee.join(a,r)};const getDirectoryGlob=({directoryPath:t,files:a,extensions:r})=>{const i=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return a?a.map((a=>ee.posix.join(t,`**/${ee.extname(a)?a:`${a}${i}`}`))):[ee.posix.join(t,`**${i?`/*${i}`:""}`)]};const directoryToGlob=async(t,{cwd:a=d.cwd(),files:r,extensions:i}={})=>{const o=await Promise.all(t.map((async t=>await GU(normalizePathForDirectoryGlob(t,a))?getDirectoryGlob({directoryPath:t,files:r,extensions:i}):t)));return o.flat()};const directoryToGlobSync=(t,{cwd:a=d.cwd(),files:r,extensions:i}={})=>t.flatMap((t=>UU(normalizePathForDirectoryGlob(t,a))?getDirectoryGlob({directoryPath:t,files:r,extensions:i}):t));const toPatternsArray=t=>{t=[...new Set([t].flat())];assertPatternsInput(t);return t};const checkCwdOption=t=>{if(!t){return}let a;try{a=te.statSync(t)}catch{return}if(!a.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const globby_normalizeOptions=(t={})=>{t={...t,ignore:t.ignore??[],expandDirectories:t.expandDirectories??true,cwd:node_toPath(t.cwd)};checkCwdOption(t.cwd);return t};const normalizeArguments=t=>async(a,r)=>t(toPatternsArray(a),globby_normalizeOptions(r));const normalizeArgumentsSync=t=>(a,r)=>t(toPatternsArray(a),globby_normalizeOptions(r));const getIgnoreFilesPatterns=t=>{const{ignoreFiles:a,gitignore:r}=t;const i=a?toPatternsArray(a):[];if(r){i.push(JU)}return i};const getFilter=async t=>{const a=getIgnoreFilesPatterns(t);return createFilterFunction(a.length>0&&await isIgnoredByIgnoreFiles(a,t))};const getFilterSync=t=>{const a=getIgnoreFilesPatterns(t);return createFilterFunction(a.length>0&&isIgnoredByIgnoreFilesSync(a,t))};const createFilterFunction=t=>{const a=new Set;return r=>{const i=ee.normalize(r.path??r);if(a.has(i)||t&&t(i)){return false}a.add(i);return true}};const unionFastGlobResults=(t,a)=>t.flat().filter((t=>a(t)));const convertNegativePatterns=(t,a)=>{const r=[];while(t.length>0){const i=t.findIndex((t=>isNegativePattern(t)));if(i===-1){r.push({patterns:t,options:a});break}const o=t[i].slice(1);for(const t of r){t.options.ignore.push(o)}if(i!==0){r.push({patterns:t.slice(0,i),options:{...a,ignore:[...a.ignore,o]}})}t=t.slice(i+1)}return r};const normalizeExpandDirectoriesOption=(t,a)=>({...a?{cwd:a}:{},...Array.isArray(t)?{files:t}:t});const generateTasks=async(t,a)=>{const r=convertNegativePatterns(t,a);const{cwd:i,expandDirectories:o}=a;if(!o){return r}const c=normalizeExpandDirectoriesOption(o,i);return Promise.all(r.map((async t=>{let{patterns:a,options:r}=t;[a,r.ignore]=await Promise.all([directoryToGlob(a,c),directoryToGlob(r.ignore,{cwd:i})]);return{patterns:a,options:r}})))};const generateTasksSync=(t,a)=>{const r=convertNegativePatterns(t,a);const{cwd:i,expandDirectories:o}=a;if(!o){return r}const c=normalizeExpandDirectoriesOption(o,i);return r.map((t=>{let{patterns:a,options:r}=t;a=directoryToGlobSync(a,c);r.ignore=directoryToGlobSync(r.ignore,{cwd:i});return{patterns:a,options:r}}))};const VU=normalizeArguments((async(t,a)=>{const[r,i]=await Promise.all([generateTasks(t,a),getFilter(a)]);const o=await Promise.all(r.map((t=>qU(t.patterns,t.options))));return unionFastGlobResults(o,i)}));const XU=normalizeArgumentsSync(((t,a)=>{const r=generateTasksSync(t,a);const i=getFilterSync(a);const o=r.map((t=>qU.sync(t.patterns,t.options)));return unionFastGlobResults(o,i)}));const eY=normalizeArgumentsSync(((t,a)=>{const r=generateTasksSync(t,a);const i=getFilterSync(a);const o=r.map((t=>qU.stream(t.patterns,t.options)));const c=mergeStreams(o).filter((t=>i(t)));return c}));const tY=normalizeArgumentsSync(((t,a)=>t.some((t=>qU.isDynamicPattern(t,a)))));const nY=normalizeArguments(generateTasks);const aY=normalizeArgumentsSync(generateTasksSync);const{convertPathToPattern:rY}=qU;var iY=__nccwpck_require__(36970);class CpyError extends Error{constructor(t,{cause:a}={}){super(t,{cause:a});Object.assign(this,a);this.name="CpyError"}}const oY=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^[Dd]esktop\\.ini$","@eaDir$"];const sY=new RegExp(oY.join("|"));function isJunk(t){return sY.test(t)}function isNotJunk(t){return!isJunk(t)}class GlobPattern{constructor(t,a,r){this.path=t;this.originalPath=t;this.destination=a;this.options=r;this.isDirectory=false;if(!tY(t)&&te.existsSync(t)&&te.lstatSync(t).isDirectory()){this.path=[t,"**"].join("/");this.isDirectory=true}}get name(){return ee.basename(this.originalPath)}get normalizedPath(){const t=this.originalPath.split("/");const a=t.findIndex((t=>t?tY(t):false));const r=t.slice(0,a).join("/");if(r){return ee.isAbsolute(r)?r:ee.join(this.options.cwd,r)}return this.destination}hasMagic(){return tY(this.options.flat?this.path:this.originalPath)}getMatches(){let t=XU(this.path,{...this.options,dot:true,absolute:true,onlyFiles:true});if(this.options.ignoreJunk){t=t.filter((t=>isNotJunk(ee.basename(t))))}return t}}const cY={ignoreJunk:true,flat:false,cwd:d.cwd()};class Entry{constructor(t,a,r){this.path=t.split("/").join(ee.sep);this.relativePath=a.split("/").join(ee.sep);this.pattern=r;Object.freeze(this)}get name(){return ee.basename(this.path)}get nameWithoutExtension(){return ee.basename(this.path,ee.extname(this.path))}get extension(){return ee.extname(this.path).slice(1)}}const expandPatternsWithBraceExpansion=t=>t.flatMap((t=>iY.braces(t,{expand:true,nodupes:true})));const preprocessDestinationPath=({entry:t,destination:a,options:r})=>{if(t.pattern.hasMagic()){if(r.flat){if(ee.isAbsolute(a)){return ee.join(a,t.name)}return ee.join(r.cwd,a,t.name)}return ee.join(a,ee.relative(t.pattern.normalizedPath,t.path))}if(ee.isAbsolute(a)){return ee.join(a,t.name)}if(t.pattern.isDirectory&&ee.relative(r.cwd,t.path).startsWith("..")){return ee.join(r.cwd,a,ee.basename(t.pattern.originalPath),ee.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&t.path===t.relativePath){return ee.join(r.cwd,a,ee.basename(t.pattern.originalPath),ee.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&r.flat){return ee.join(r.cwd,a,ee.basename(t.pattern.originalPath))}return ee.join(r.cwd,a,ee.relative(r.cwd,t.path))};const renameFile=(t,a)=>{const r=ee.dirname(t);if(typeof a==="string"){return ee.join(r,a)}if(typeof a==="function"){const i=ee.basename(t);return ee.join(r,a(i))}return t};function cpy(t,a,{concurrency:r=p.availableParallelism(),...i}={}){const o=new Map;const c=new Wt;i={...cY,...i};const l=(async()=>{let l=[];let u=0;let d=0;let p=expandPatternsWithBraceExpansion([t??[]].flat()).map((t=>t.replaceAll("\\","/")));const A=p.filter((t=>!t.startsWith("!")));const g=p.filter((t=>t.startsWith("!")));if(A.length===0||!a){throw new CpyError("`source` and `destination` required")}p=p.map((t=>new GlobPattern(t,a,{...i,ignore:g})));for(const t of p){let a=[];try{a=t.getMatches()}catch(a){throw new CpyError(`Cannot glob \`${t.originalPath}\`: ${a.message}`,{cause:a})}if(a.length===0&&!tY(t.originalPath)&&!tY(g)){throw new CpyError(`Cannot copy \`${t.originalPath}\`: the file doesn't exist`)}l=[...l,...a.map((a=>new Entry(a,ee.relative(i.cwd,a),t)))]}if(i.filter!==undefined){l=await pFilter(l,i.filter,{concurrency:1024})}if(l.length===0){c.emit("progress",{totalFiles:0,percent:1,completedFiles:0,completedSize:0})}const fileProgressHandler=t=>{const a=o.get(t.sourcePath)||{writtenBytes:0,percent:0};if(a.writtenBytes!==t.writtenBytes||a.percent!==t.percent){d-=a.writtenBytes;d+=t.writtenBytes;if(t.percent===1&&a.percent!==1){u++}o.set(t.sourcePath,{writtenBytes:t.writtenBytes,percent:t.percent});c.emit("progress",{totalFiles:l.length,percent:u/l.length,completedFiles:u,completedSize:d,sourcePath:t.sourcePath,destinationPath:t.destinationPath})}};return pMap(l,(async t=>{const r=renameFile(preprocessDestinationPath({entry:t,destination:a,options:i}),i.rename);try{await copyFile(t.path,r,{...i,onProgress:fileProgressHandler})}catch(a){throw new CpyError(`Cannot copy from \`${t.relativePath}\` to \`${r}\`: ${a.message}`,{cause:a})}return r}),{concurrency:r})})();l.on=(...t)=>{c.on(...t);return l};return l}var lY=__nccwpck_require__(63792);var uY=__nccwpck_require__.n(lY);function isFolderEmpty(t,a){const r=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const i=ce().readdirSync(t).filter((t=>!r.includes(t))).filter((t=>!/\.iml$/.test(t)));if(i.length>0){console.log(`The directory ${N.green(a)} contains files that could conflict:`);console.log();for(const a of i){try{const r=ce().lstatSync(K().join(t,a));if(r.isDirectory()){console.log(` ${N.blue(a)}/`)}else{console.log(` ${a}`)}}catch{console.log(` ${a}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}async function isWriteable(t){try{await ce().promises.access(t,(ce().constants||ce()).W_OK);return true}catch(t){return false}}function isInGitRepository(){try{(0,EU.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,EU.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let a=false;try{(0,EU.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,EU.execSync)("git init",{stdio:"ignore"});a=true;(0,EU.execSync)("git checkout -b main",{stdio:"ignore"});(0,EU.execSync)("git add -A",{stdio:"ignore"});(0,EU.execSync)('git commit -m "Initial commit from Hyperbook"',{stdio:"ignore"});return true}catch(r){if(a){try{mr(K().join(t,".git"))}catch(t){}}return false}}async function runNew({programName:t,bookPath:a}){if(typeof a==="string"){a=a.trim()}if(!a){const t=await uY()({type:"text",name:"path",message:"What is your book named?",initial:"my-book"});if(typeof t.path==="string"){a=t.path.trim()}}if(!a){console.log();console.log("Please specify the book directory:");console.log(` ${N.cyan(t)} ${N.green("<book-directory>")}`);console.log();console.log("For example:");console.log(` ${N.cyan(t)} ${N.green("my-new-book")}`);console.log();console.log(`Run ${N.cyan(`${t} --help`)} to see all options.`);process.exit(1)}const r=K().resolve(a);if(!await isWriteable(K().dirname(r))){console.error("The book path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const i=K().basename(r);await makeDir(r);if(!isFolderEmpty(r,i)){process.exit(1)}const o=process.cwd();console.log(`Creating a new hyperbook in ${N.green(r)}.`);console.log();process.chdir(r);const{description:c}=await uY()({type:"text",name:"description",message:"What is your book about?",initial:""});const{author:l}=await uY()({type:"text",name:"author",message:"Who is the author of the book?",initial:""});const{authorUrl:u}=await uY()({type:"text",name:"authorUrl",message:"What is the link to the authors homepage?",initial:""});let{license:d}=await uY()({type:"select",name:"license",message:"Pick a license for your book!",choices:[{title:"Creative Commons Zero (CC0)",value:"cc0"},{title:"Creative Commons Attribution (CC BY)",value:"cc-by"},{title:"Creative Commons Attribution-ShareAlike (CC BY-SA)",value:"cc-by-sa"},{title:"Creative Commons Attribution-NoDerivs (CC BY-ND)",value:"cc-by-nd"},{title:"Creative Commons Attribution-NonCommercial (CC BY-NC)",value:"cc-by-nc"},{title:"Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)",value:"cc-by-nc-sa"},{title:"Creative Commons Attribution-NonCommercial-NoDervis (CC BY-NC-ND)",value:"cc-by-nc-nd"},{title:"Custom",value:"custom"}]});if(d==="custom"){const t=await uY()({type:"text",name:"license",message:"Which custom license you want to use?"});d=t.license}const{language:p}=await uY()({type:"text",name:"language",message:"In which language is your book written? Provide a short code, e.g.: en or de",initial:"en"});const A={name:i,version:"0.0.0",description:c,license:d,author:{name:l,url:u},language:p};ce().writeFileSync(K().join(r,"hyperbook.json"),JSON.stringify(A,null,2)+xa().EOL);console.log();const g=__nccwpck_require__.ab+"templates";await cpy("default/**",r,{cwd:__nccwpck_require__.ab+"templates",rename:t=>{switch(t){case"gitignore":{return".".concat(t)}case"README-template.md":{return"README.md"}default:{return t}}}});if(tryGitInit(r)){console.log("Initialized a git repository.");console.log()}let h;if(K().join(o,i)===a){h=i}else{h=a}console.log(`${N.green("Success!")} Created ${i} at ${a}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(N.cyan(` hyperbook dev`));console.log(" Starts the development server.");console.log();console.log(N.cyan(` hyperbook build`));console.log(" Builds the book for production.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(N.cyan(" cd"),h);console.log(` ${N.cyan(`hyperbook dev`)}`);console.log()}const dY=new $;dY.name(hH.name).version(hH.version).hook("preAction",(async()=>{await notifyUpdate()}));dY.command("new").description("create a new hyperbook").arguments("<book-directory>").usage(`${N.green("<book-directory>")}`).action((async t=>{await runNew({programName:dY.name(),bookPath:t}).catch((()=>process.exit(1)))}));dY.command("setup").action((async()=>{console.log(`${N.yellow("hyperbook setup is deprecated.")}`)}));dY.command("dev").description("start the development server for a hyperbook").option("-p --port <number>","set a specific port").action((async(t,a)=>{await runDev({port:a.port})}));dY.command("build").description("build a hyperbook").action((async()=>{const t=await it.get(process.cwd()).catch((t=>{console.error(t);process.exit(1)}));let a=it.getName(t);console.log(`${N.blue(`[${a}]`)} Building Project: ${t.src}.`);await runBuildProject(t,t).catch((t=>{console.error(t);process.exit(1)}))}));dY.parseAsync(process.argv);const pY=Y()(hH).catch((()=>null));async function notifyUpdate(){try{const t=await pY;if(t===null||t===void 0?void 0:t.latest){const t=getPkgManager();console.log();console.log(N.yellow.bold("A new version of `hyperbook` is available!"));console.log("You can update by running: "+N.cyan(t==="yarn"?"yarn global add hyperbook":`${t} install --global hyperbook`));console.log()}process.exit()}catch{}}})();module.exports=__webpack_exports__})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperbook",
3
- "version": "0.52.1",
3
+ "version": "0.52.2",
4
4
  "author": "Mike Barkmin",
5
5
  "homepage": "https://github.com/openpatch/hyperbook#readme",
6
6
  "license": "MIT",
@@ -53,8 +53,8 @@
53
53
  "tar": "7.4.3",
54
54
  "update-check": "1.5.4",
55
55
  "ws": "^8.18.0",
56
- "@hyperbook/markdown": "0.28.1",
57
56
  "@hyperbook/fs": "0.17.3",
57
+ "@hyperbook/markdown": "0.28.2",
58
58
  "@hyperbook/types": "0.14.0"
59
59
  },
60
60
  "scripts": {