@nimtech/nimpress 2.5.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,26 @@
1
- import { readdir as Ht, readFile as ie, writeFile as pe, copyFile as ln, cp as pn, mkdir as Ue } from "node:fs/promises";
2
- import { existsSync as de, readFileSync as Oe, statSync as ht, readdirSync as Le, createReadStream as Oo } from "node:fs";
3
- import { createRequire as Mn } from "node:module";
4
- import { request as Do } from "node:http";
5
- import { execFileSync as Mo } from "node:child_process";
6
- import { resolve as G, dirname as Y, join as q, basename as Ce, relative as je, extname as zt, isAbsolute as ke, sep as xe } from "node:path";
7
- import { createHash as Tn } from "node:crypto";
8
- import gt from "gray-matter";
9
- import Nn from "markdown-it";
10
- import un from "markdown-it-anchor";
11
- import To from "markdown-it-attrs";
12
- import No from "markdown-it-container";
13
- import In from "markdown-it-deflist";
14
- import Io from "markdown-it-footnote";
15
- import Fo from "markdown-it-task-lists";
1
+ import { readdir as Ut, readFile as ie, writeFile as pe, copyFile as mn, cp as fn, mkdir as Ue } from "node:fs/promises";
2
+ import { existsSync as fe, readFileSync as Oe, statSync as gt, readdirSync as Le, createReadStream as Mo } from "node:fs";
3
+ import { createRequire as In } from "node:module";
4
+ import { request as No } from "node:http";
5
+ import { execFileSync as Io } from "node:child_process";
6
+ import { resolve as G, dirname as Y, join as q, basename as Ce, relative as je, extname as Jt, isAbsolute as ke, sep as xe } from "node:path";
7
+ import { createHash as Fn } from "node:crypto";
8
+ import _t from "gray-matter";
9
+ import Rn from "markdown-it";
10
+ import dn from "markdown-it-anchor";
11
+ import Fo from "markdown-it-attrs";
12
+ import Ro from "markdown-it-container";
13
+ import Bn from "markdown-it-deflist";
14
+ import Bo from "markdown-it-footnote";
15
+ import Wo from "markdown-it-task-lists";
16
16
  import { z as m } from "zod";
17
- import { parse as Fn, stringify as Ro } from "yaml";
18
- import { createHighlighter as Bo } from "shiki";
19
- import { fileURLToPath as Wo, pathToFileURL as mn } from "node:url";
20
- import { exporter as Lo } from "@dbml/core";
21
- import { n as Ho, r as Qe, e as _t, b as It, p as Rn, c as qt, d as Ut, g as yt, h as zo, k as Jt, o as qo, s as Uo, l as Jo, q as Go, t as Vo, j as we, m as Xo, a as Yo } from "./typeMembers-CNvE92EX.js";
22
- import { svelte as Ko } from "@sveltejs/vite-plugin-svelte";
23
- import Zo from "@tailwindcss/vite";
24
- import { loadConfigFromFile as Qo } from "vite";
25
- const fn = {
17
+ import { parse as Wn, stringify as Lo } from "yaml";
18
+ import { createHighlighter as Ho } from "shiki";
19
+ import { fileURLToPath as zo, pathToFileURL as hn } from "node:url";
20
+ import { exporter as qo } from "@dbml/core";
21
+ import { n as Uo, r as Qe, e as yt, b as Bt, p as Ln, c as Gt, d as Vt, g as bt, h as Jo, k as Xt, o as Go, s as Vo, l as Xo, q as Yo, t as Ko, j as we, m as Zo, a as Qo } from "./typeMembers-CNvE92EX.js";
22
+ import { loadConfigFromFile as es } from "vite";
23
+ const gn = {
26
24
  out: "dist",
27
25
  cache: "node_modules/.nimpress",
28
26
  export: ".nimpress",
@@ -38,39 +36,79 @@ const fn = {
38
36
  contentDir: "docs",
39
37
  assetsDir: "assets",
40
38
  assetUrlBase: "/assets",
41
- paths: fn,
39
+ paths: gn,
42
40
  exclude: [],
43
41
  defaultFrontmatter: {},
44
42
  defaultFrontmatterExclude: [],
45
43
  banner: {},
44
+ theme: "stock",
45
+ themes: [],
46
+ components: {},
46
47
  css: [],
47
48
  vite: {},
48
49
  pageTypes: {},
49
50
  modules: {
50
51
  dir: "modules",
51
- route: `/${fn.modules}`,
52
+ route: `/${gn.modules}`,
52
53
  systems: {}
53
54
  }
54
- }, es = m.object({
55
+ }, ft = ["stock", "glass"], ts = [
56
+ "Header",
57
+ "Announce",
58
+ "Footer",
59
+ "Sidebar",
60
+ "SidebarNode",
61
+ "Breadcrumbs",
62
+ "RightToc",
63
+ "BackToTop",
64
+ "SearchModal",
65
+ "AccountMenu",
66
+ "ThemeMenu",
67
+ "Feedback",
68
+ "SubscribeDialog",
69
+ "CodeBlock",
70
+ "CodeGroup",
71
+ "Tabs",
72
+ "Actions",
73
+ "Feature",
74
+ "Lightbox",
75
+ "MermaidBlock",
76
+ "MathBlock",
77
+ "DBMLBlock",
78
+ "ComponentEmbed",
79
+ "Card",
80
+ "CardGroup",
81
+ "Operation",
82
+ "Schema",
83
+ "ParamRow",
84
+ "MethodBadge",
85
+ "CodeExamples",
86
+ "TryPanel",
87
+ "TryDialog"
88
+ ];
89
+ function wt(e) {
90
+ return ft.includes(e) ? e : e.replace(/^.*\//, "").replace(/\.css$/, "");
91
+ }
92
+ const ns = m.object({
55
93
  primary: m.string().optional(),
56
94
  primaryHover: m.string().optional()
57
- }).passthrough(), ts = m.object({
95
+ }).passthrough(), os = m.object({
58
96
  title: m.string(),
59
97
  url: m.string().optional(),
60
98
  description: m.string().optional(),
61
99
  ogImage: m.string().optional(),
62
100
  twitterSite: m.string().optional(),
63
101
  locale: m.string().optional()
64
- }).passthrough(), ns = m.object({
102
+ }).passthrough(), ss = m.object({
65
103
  text: m.string(),
66
104
  link: m.string(),
67
105
  gate: m.string().optional()
68
- }), os = m.object({
106
+ }), rs = m.object({
69
107
  title: m.string().optional(),
70
108
  tagline: m.string().optional(),
71
109
  company: m.string().optional(),
72
110
  version: m.string().optional()
73
- }).passthrough(), ss = m.object({
111
+ }).passthrough(), as = m.object({
74
112
  name: m.string(),
75
113
  framework: m.enum(["vue", "svelte"]),
76
114
  source: m.string().optional(),
@@ -81,11 +119,11 @@ const fn = {
81
119
  harness: m.string().optional(),
82
120
  port: m.number().optional(),
83
121
  visibility: m.enum(["visible", "dev-only"]).optional()
84
- }), rs = m.object({
122
+ }), is = m.object({
85
123
  title: m.string().optional(),
86
124
  logo: m.string().optional(),
87
125
  github: m.string().optional(),
88
- brand: es.optional(),
126
+ brand: ns.optional(),
89
127
  footer: m.object({
90
128
  text: m.string().optional(),
91
129
  copyright: m.string().optional(),
@@ -115,7 +153,7 @@ const fn = {
115
153
  icons: m.string().optional(),
116
154
  math: m.boolean().optional(),
117
155
  tags: m.object({ icons: m.record(m.string()).optional(), map: m.record(m.string()).optional() }).optional(),
118
- navRoutes: m.array(ns).optional(),
156
+ navRoutes: m.array(ss).optional(),
119
157
  auth: m.object({
120
158
  issuer: m.string(),
121
159
  clientId: m.string(),
@@ -169,7 +207,7 @@ const fn = {
169
207
  expires: m.string().optional()
170
208
  }).passthrough().optional()
171
209
  }).passthrough().optional(),
172
- site: ts.optional(),
210
+ site: os.optional(),
173
211
  base: m.string().optional(),
174
212
  contentDir: m.string().optional(),
175
213
  assetsDir: m.string().optional(),
@@ -184,47 +222,50 @@ const fn = {
184
222
  exclude: m.array(m.string()).optional(),
185
223
  defaultFrontmatter: m.record(m.unknown()).optional(),
186
224
  defaultFrontmatterExclude: m.array(m.string()).optional(),
187
- banner: m.union([os, m.literal(!1)]).optional(),
225
+ banner: m.union([rs, m.literal(!1)]).optional(),
226
+ theme: m.string().optional(),
227
+ themes: m.array(m.string()).optional(),
228
+ components: m.record(m.enum(ts), m.string()).optional(),
188
229
  css: m.union([m.string(), m.array(m.string())]).optional(),
189
230
  vite: m.record(m.unknown()).optional(),
190
231
  pageTypes: m.record(m.string()).optional(),
191
- modules: m.array(ss).optional()
232
+ modules: m.array(as).optional()
192
233
  }).passthrough();
193
- function dn(e, t) {
194
- const n = rs.safeParse(e);
234
+ function _n(e, t) {
235
+ const n = is.safeParse(e);
195
236
  return n.success ? n.data : (console.warn(`[nimpress] invalid config in ${t}: ${n.error.message}`), {});
196
237
  }
197
- const as = ["nimpress.config.ts", "nimpress.config.js", "nimpress.config.mjs", "nimpress.config.json"];
198
- function hn(e) {
238
+ const cs = ["nimpress.config.ts", "nimpress.config.js", "nimpress.config.mjs", "nimpress.config.json"];
239
+ function yn(e) {
199
240
  return typeof e == "object" && e !== null && !Array.isArray(e);
200
241
  }
201
- function Ft(e, t) {
242
+ function Wt(e, t) {
202
243
  if (!t) return e;
203
244
  const n = { ...e };
204
245
  for (const [o, s] of Object.entries(t)) {
205
246
  if (s === void 0) continue;
206
247
  const r = n[o];
207
- hn(r) && hn(s) ? n[o] = Ft(r, s) : n[o] = s;
248
+ yn(r) && yn(s) ? n[o] = Wt(r, s) : n[o] = s;
208
249
  }
209
250
  return n;
210
251
  }
211
- async function is(e) {
212
- for (const t of as) {
252
+ async function ls(e) {
253
+ for (const t of cs) {
213
254
  const n = G(e, t);
214
- if (!de(n)) continue;
255
+ if (!fe(n)) continue;
215
256
  if (t.endsWith(".json")) {
216
257
  const r = JSON.parse(Oe(n, "utf-8"));
217
- return { config: dn(r, n), file: n };
258
+ return { config: _n(r, n), file: n };
218
259
  }
219
- const s = (await Qo({ command: "serve", mode: "development" }, n, e))?.config ?? {};
220
- return { config: dn(s, n), file: n };
260
+ const s = (await es({ command: "serve", mode: "development" }, n, e))?.config ?? {};
261
+ return { config: _n(s, n), file: n };
221
262
  }
222
263
  return null;
223
264
  }
224
- async function cs(e, t) {
225
- const n = await is(e), o = n?.config ? { ...n.config, modules: void 0 } : void 0, s = t ? { ...t, modules: void 0 } : void 0;
226
- let r = Ft(Ye, o);
227
- r = Ft(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base = Ho(r.base);
265
+ async function ps(e, t) {
266
+ const n = await ls(e), o = n?.config ? { ...n.config, modules: void 0 } : void 0, s = t ? { ...t, modules: void 0 } : void 0;
267
+ let r = Wt(Ye, o);
268
+ r = Wt(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base = Uo(r.base);
228
269
  const i = t?.modules ?? n?.config?.modules;
229
270
  return r.modules = {
230
271
  dir: Ye.modules.dir,
@@ -232,12 +273,14 @@ async function cs(e, t) {
232
273
  systems: i ? Object.fromEntries(i.map((c) => [c.name, c])) : {}
233
274
  }, { resolved: r, configFile: n?.file ?? null };
234
275
  }
235
- function ls(e) {
276
+ function us(e) {
236
277
  return {
237
278
  title: e.title,
238
279
  logo: e.logo,
239
280
  github: e.github,
240
281
  brand: e.brand,
282
+ theme: wt(e.theme),
283
+ themes: vt(e).map(wt),
241
284
  base: e.base,
242
285
  contentRoot: e.contentDir,
243
286
  navRoutes: e.navRoutes,
@@ -255,7 +298,10 @@ function ls(e) {
255
298
  guardedBase: `/${e.paths.guarded}`
256
299
  };
257
300
  }
258
- function ps(e) {
301
+ function vt(e) {
302
+ return Array.from(/* @__PURE__ */ new Set([...e.themes, e.theme]));
303
+ }
304
+ function ms(e) {
259
305
  function t(o, s) {
260
306
  const r = o.pos, i = o.src.charCodeAt(r);
261
307
  if (s || i !== 61)
@@ -314,8 +360,8 @@ function ps(e) {
314
360
  r[s] && r[s].delimiters && n(o, r[s].delimiters);
315
361
  });
316
362
  }
317
- const us = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
318
- function ms(e, t) {
363
+ const fs = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
364
+ function ds(e, t) {
319
365
  const n = e.posMax, o = e.pos;
320
366
  if (e.src.charCodeAt(o) !== 126 || t || o + 2 >= n)
321
367
  return !1;
@@ -337,15 +383,15 @@ function ms(e, t) {
337
383
  const i = e.push("sub_open", "sub", 1);
338
384
  i.markup = "~";
339
385
  const c = e.push("text", "", 0);
340
- c.content = r.replace(us, "$1");
386
+ c.content = r.replace(fs, "$1");
341
387
  const u = e.push("sub_close", "sub", -1);
342
388
  return u.markup = "~", e.pos = e.posMax + 1, e.posMax = n, !0;
343
389
  }
344
- function fs(e) {
345
- e.inline.ruler.after("emphasis", "sub", ms);
390
+ function hs(e) {
391
+ e.inline.ruler.after("emphasis", "sub", ds);
346
392
  }
347
- const ds = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
348
- function hs(e, t) {
393
+ const gs = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
394
+ function _s(e, t) {
349
395
  const n = e.posMax, o = e.pos;
350
396
  if (e.src.charCodeAt(o) !== 94 || t || o + 2 >= n)
351
397
  return !1;
@@ -367,68 +413,68 @@ function hs(e, t) {
367
413
  const i = e.push("sup_open", "sup", 1);
368
414
  i.markup = "^";
369
415
  const c = e.push("text", "", 0);
370
- c.content = r.replace(ds, "$1");
416
+ c.content = r.replace(gs, "$1");
371
417
  const u = e.push("sup_close", "sup", -1);
372
418
  return u.markup = "^", e.pos = e.posMax + 1, e.posMax = n, !0;
373
419
  }
374
- function gs(e) {
375
- e.inline.ruler.after("emphasis", "sup", hs);
420
+ function ys(e) {
421
+ e.inline.ruler.after("emphasis", "sup", _s);
376
422
  }
377
- function _s(e, t) {
423
+ function bs(e, t) {
378
424
  return e[t].content;
379
425
  }
380
- function ys(e, t, n, o, s) {
426
+ function ws(e, t, n, o, s) {
381
427
  const r = e.utils.arrayReplaceAt, i = e.utils.lib.ucmicro, c = new RegExp([i.Z.source, i.P.source, i.Cc.source].join("|"));
382
428
  function u(h, g, w) {
383
- let j = 0;
384
- const P = [];
385
- if (h.replace(s, function(M, d, v) {
386
- let O;
387
- if (Object.prototype.hasOwnProperty.call(n, M)) {
388
- if (O = n[M], d > 0 && !c.test(v[d - 1]) || d + M.length < v.length && !c.test(v[d + M.length]))
429
+ let P = 0;
430
+ const A = [];
431
+ if (h.replace(s, function(T, d, v) {
432
+ let D;
433
+ if (Object.prototype.hasOwnProperty.call(n, T)) {
434
+ if (D = n[T], d > 0 && !c.test(v[d - 1]) || d + T.length < v.length && !c.test(v[d + T.length]))
389
435
  return;
390
436
  } else
391
- O = M.slice(1, -1);
392
- if (d > j) {
437
+ D = T.slice(1, -1);
438
+ if (d > P) {
393
439
  const x = new w("text", "", 0);
394
- x.content = h.slice(j, d), P.push(x);
440
+ x.content = h.slice(P, d), A.push(x);
395
441
  }
396
442
  const R = new w("emoji", "", 0);
397
- R.markup = O, R.content = t[O], P.push(R), j = d + M.length;
398
- }), j < h.length) {
399
- const M = new w("text", "", 0);
400
- M.content = h.slice(j), P.push(M);
443
+ R.markup = D, R.content = t[D], A.push(R), P = d + T.length;
444
+ }), P < h.length) {
445
+ const T = new w("text", "", 0);
446
+ T.content = h.slice(P), A.push(T);
401
447
  }
402
- return P;
448
+ return A;
403
449
  }
404
450
  return function(g) {
405
451
  let w;
406
- const j = g.tokens;
407
- let P = 0;
408
- for (let M = 0, d = j.length; M < d; M++) {
409
- if (j[M].type !== "inline")
452
+ const P = g.tokens;
453
+ let A = 0;
454
+ for (let T = 0, d = P.length; T < d; T++) {
455
+ if (P[T].type !== "inline")
410
456
  continue;
411
- let v = j[M].children;
412
- for (let O = v.length - 1; O >= 0; O--)
413
- w = v[O], (w.type === "link_open" || w.type === "link_close") && w.info === "auto" && (P -= w.nesting), w.type === "text" && P === 0 && o.test(w.content) && (j[M].children = v = r(
457
+ let v = P[T].children;
458
+ for (let D = v.length - 1; D >= 0; D--)
459
+ w = v[D], (w.type === "link_open" || w.type === "link_close") && w.info === "auto" && (A -= w.nesting), w.type === "text" && A === 0 && o.test(w.content) && (P[T].children = v = r(
414
460
  v,
415
- O,
461
+ D,
416
462
  u(w.content, w.level, g.Token)
417
463
  ));
418
464
  }
419
465
  };
420
466
  }
421
- function bs(e) {
467
+ function vs(e) {
422
468
  return e.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
423
469
  }
424
- function ws(e) {
470
+ function ks(e) {
425
471
  let t = e.defs;
426
472
  e.enabled.length && (t = Object.keys(t).reduce((c, u) => (e.enabled.indexOf(u) >= 0 && (c[u] = t[u]), c), {}));
427
473
  const n = Object.keys(e.shortcuts).reduce((c, u) => t[u] ? Array.isArray(e.shortcuts[u]) ? (e.shortcuts[u].forEach((h) => {
428
474
  c[h] = u;
429
475
  }), c) : (c[e.shortcuts[u]] = u, c) : c, {}), o = Object.keys(t);
430
476
  let s;
431
- o.length === 0 ? s = "^$" : s = o.map((c) => `:${c}:`).concat(Object.keys(n)).sort().reverse().map((c) => bs(c)).join("|");
477
+ o.length === 0 ? s = "^$" : s = o.map((c) => `:${c}:`).concat(Object.keys(n)).sort().reverse().map((c) => vs(c)).join("|");
432
478
  const r = RegExp(s), i = RegExp(s, "g");
433
479
  return {
434
480
  defs: t,
@@ -437,19 +483,19 @@ function ws(e) {
437
483
  replaceRE: i
438
484
  };
439
485
  }
440
- function vs(e, t) {
441
- const o = ws(Object.assign({}, {
486
+ function $s(e, t) {
487
+ const o = ks(Object.assign({}, {
442
488
  defs: {},
443
489
  shortcuts: {},
444
490
  enabled: []
445
491
  }, t || {}));
446
- e.renderer.rules.emoji = _s, e.core.ruler.after(
492
+ e.renderer.rules.emoji = bs, e.core.ruler.after(
447
493
  "linkify",
448
494
  "emoji",
449
- ys(e, o.defs, o.shortcuts, o.scanRE, o.replaceRE)
495
+ ws(e, o.defs, o.shortcuts, o.scanRE, o.replaceRE)
450
496
  );
451
497
  }
452
- const ks = {
498
+ const xs = {
453
499
  angry: [">:(", ">:-("],
454
500
  blush: [':")', ':-")'],
455
501
  broken_heart: ["</3", "<\\3"],
@@ -477,7 +523,7 @@ const ks = {
477
523
  sweat_smile: [",:)", ",:-)"],
478
524
  unamused: [":s", ":-S", ":z", ":-Z", ":$", ":-$"],
479
525
  wink: [";)", ";-)"]
480
- }, $s = {
526
+ }, Ss = {
481
527
  100: "💯",
482
528
  1234: "🔢",
483
529
  grinning: "😀",
@@ -2382,15 +2428,15 @@ const ks = {
2382
2428
  scotland: "🏴󠁧󠁢󠁳󠁣󠁴󠁿",
2383
2429
  wales: "🏴󠁧󠁢󠁷󠁬󠁳󠁿"
2384
2430
  };
2385
- function xs(e, t) {
2431
+ function js(e, t) {
2386
2432
  const o = Object.assign({}, {
2387
- defs: $s,
2388
- shortcuts: ks,
2433
+ defs: Ss,
2434
+ shortcuts: xs,
2389
2435
  enabled: []
2390
2436
  }, t || {});
2391
- vs(e, o);
2437
+ $s(e, o);
2392
2438
  }
2393
- const ce = "\x1B[0m", bt = "\x1B[1m", ft = "\x1B[2m", Bn = "\x1B[38;2;204;120;92m", Ae = "\x1B[38;2;229;174;156m", Te = "\x1B[38;2;160;160;170m", at = [
2439
+ const ce = "\x1B[0m", kt = "\x1B[1m", dt = "\x1B[2m", Hn = "\x1B[38;2;204;120;92m", Ae = "\x1B[38;2;229;174;156m", Me = "\x1B[38;2;160;160;170m", at = [
2394
2440
  " ███╗ ██╗ ██╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗ ███████╗ ███████╗",
2395
2441
  " ████╗ ██║ ██║ ████╗ ████║ ██╔══██╗ ██╔══██╗ ██╔════╝ ██╔════╝ ██╔════╝",
2396
2442
  " ██╔██╗ ██║ ██║ ██╔████╔██║ ██████╔╝ ██████╔╝ █████╗ ███████╗ ███████╗",
@@ -2398,19 +2444,19 @@ const ce = "\x1B[0m", bt = "\x1B[1m", ft = "\x1B[2m", Bn = "\x1B[38;2;204;120;92
2398
2444
  " ██║ ╚████║ ██║ ██║ ╚═╝ ██║ ██║ ██║ ██║ ███████╗ ███████║ ███████║",
2399
2445
  " ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝ ╚══════╝"
2400
2446
  ], Ve = 60;
2401
- function Ss(e, t) {
2447
+ function Ps(e, t) {
2402
2448
  const n = e.replace(/\x1b\[[0-9;]*m/g, ""), o = Math.max(0, t - n.length);
2403
2449
  return e + " ".repeat(o);
2404
2450
  }
2405
- function js(e) {
2451
+ function As(e) {
2406
2452
  const t = "╔" + "═".repeat(Ve + 2) + "╗", n = "╠" + "═".repeat(Ve + 2) + "╣", o = "╚" + "═".repeat(Ve + 2) + "╝", s = [t];
2407
2453
  for (let r = 0; r < e.length; r++)
2408
- s.push("║ " + Ss(e[r], Ve) + " ║"), r < e.length - 1 && s.push(n);
2454
+ s.push("║ " + Ps(e[r], Ve) + " ║"), r < e.length - 1 && s.push(n);
2409
2455
  return s.push(o), s;
2410
2456
  }
2411
- function Ps() {
2457
+ function Es() {
2412
2458
  try {
2413
- const e = Y(Wo(import.meta.url)), t = [
2459
+ const e = Y(zo(import.meta.url)), t = [
2414
2460
  G(e, "package.json"),
2415
2461
  G(e, "..", "package.json"),
2416
2462
  G(e, "..", "..", "package.json")
@@ -2425,23 +2471,23 @@ function Ps() {
2425
2471
  }
2426
2472
  return "";
2427
2473
  }
2428
- function As(e = {}) {
2429
- const t = e.title ?? "Nimpress", n = e.tagline ?? "Docs framework on Svelte", o = e.company ?? `Samna® ${(/* @__PURE__ */ new Date()).getFullYear()}`, s = e.version ?? "dev", r = e.localUrl ?? "http://localhost:5173/", i = e.networkUrl ?? "use --host to expose", c = typeof e.duration == "number" ? `ready in ${e.duration} ms` : "ready", u = e.nimpressVersion ?? Ps(), h = [];
2474
+ function Cs(e = {}) {
2475
+ const t = e.title ?? "Nimpress", n = e.tagline ?? "Docs framework on Svelte", o = e.company ?? `Samna® ${(/* @__PURE__ */ new Date()).getFullYear()}`, s = e.version ?? "dev", r = e.localUrl ?? "http://localhost:5173/", i = e.networkUrl ?? "use --host to expose", c = typeof e.duration == "number" ? `ready in ${e.duration} ms` : "ready", u = e.nimpressVersion ?? Es(), h = [];
2430
2476
  h.push("");
2431
- for (const v of at) h.push(Bn + v + ce);
2477
+ for (const v of at) h.push(Hn + v + ce);
2432
2478
  h.push("");
2433
2479
  const g = [
2434
- `${bt}${t}${ce}${Te} · ${o}${ce}`,
2435
- `${Te}${n}${ce}`,
2480
+ `${kt}${t}${ce}${Me} · ${o}${ce}`,
2481
+ `${Me}${n}${ce}`,
2436
2482
  `${Ae}Version${ce} ${s} ${Ae}${c}${ce}`
2437
2483
  ];
2438
- u && g.push(`${Ae}Nimpress${ce} ${u}`), g.push(`${Ae}➜${ce} Local ${bt}${r}${ce}`), g.push(`${Ae}➜${ce} Network ${ft}${i}${ce}`);
2439
- const w = js(g), j = at[0].length, P = at[0].length - at[0].trimStart().length, M = Ve + 4, d = " ".repeat(Math.max(0, Math.floor((j + P - M) / 2)));
2484
+ u && g.push(`${Ae}Nimpress${ce} ${u}`), g.push(`${Ae}➜${ce} Local ${kt}${r}${ce}`), g.push(`${Ae}➜${ce} Network ${dt}${i}${ce}`);
2485
+ const w = As(g), P = at[0].length, A = at[0].length - at[0].trimStart().length, T = Ve + 4, d = " ".repeat(Math.max(0, Math.floor((P + A - T) / 2)));
2440
2486
  for (const v of w) h.push(d + v);
2441
2487
  return h.push(""), h.join(`
2442
2488
  `);
2443
2489
  }
2444
- function Es() {
2490
+ function Os() {
2445
2491
  try {
2446
2492
  const e = Oe(G(process.cwd(), "package.json"), "utf-8"), t = JSON.parse(e);
2447
2493
  return { name: t.name, version: t.version };
@@ -2449,10 +2495,10 @@ function Es() {
2449
2495
  return {};
2450
2496
  }
2451
2497
  }
2452
- const Cs = 27, Os = 14, Ds = 16, Ms = 20, Ts = 17, Ns = 14, Wn = 110, Is = 60, Fs = 120, Ke = 40, Rs = 200, Bs = 420, Ws = 24, Ls = 7.6, Hs = 6.6, Ln = 7.4, zs = 5.4, qs = 5.8, Us = 6.2, Js = 34, Gs = 48, gn = 8, Vs = 260, Xs = 18, Ys = 6.2, Ks = 30, _n = 24, yn = 24;
2453
- class Gt extends Error {
2498
+ const Ds = 27, Ts = 14, Ms = 16, Ns = 20, Is = 17, Fs = 14, zn = 110, Rs = 60, Bs = 120, Ke = 40, Ws = 200, Ls = 420, Hs = 24, zs = 7.6, qs = 6.6, qn = 7.4, Us = 5.4, Js = 5.8, Gs = 6.2, Vs = 34, Xs = 48, bn = 8, Ys = 260, Ks = 18, Zs = 6.2, Qs = 30, wn = 24, vn = 24;
2499
+ class Yt extends Error {
2454
2500
  }
2455
- function Zs(e) {
2501
+ function er(e) {
2456
2502
  const t = e?.diags;
2457
2503
  return Array.isArray(t) && t.length ? t.map((n) => {
2458
2504
  const o = n.location, s = o?.start?.line, r = o?.start?.column;
@@ -2460,68 +2506,68 @@ function Zs(e) {
2460
2506
  }).join(`
2461
2507
  `) : e instanceof Error ? e.message : String(e);
2462
2508
  }
2463
- function Qs(e) {
2509
+ function tr(e) {
2464
2510
  try {
2465
- return JSON.parse(Lo.export(e, "json"));
2511
+ return JSON.parse(qo.export(e, "json"));
2466
2512
  } catch (t) {
2467
- throw new Gt(Zs(t));
2513
+ throw new Yt(er(t));
2468
2514
  }
2469
2515
  }
2470
- function er(e) {
2516
+ function nr(e) {
2471
2517
  return (e.type?.type_name ?? "").trim();
2472
2518
  }
2473
- function tr(e) {
2519
+ function or(e) {
2474
2520
  const t = e.dbdefault;
2475
2521
  return !t || t.value === void 0 || t.value === null ? "" : String(t.value);
2476
2522
  }
2477
- const nr = /\[([^\]]+)\]\(([^)\s]+)\)/;
2478
- function or(e) {
2479
- const t = String(e ?? "").trim(), n = nr.exec(t);
2523
+ const sr = /\[([^\]]+)\]\(([^)\s]+)\)/;
2524
+ function rr(e) {
2525
+ const t = String(e ?? "").trim(), n = sr.exec(t);
2480
2526
  return n ? {
2481
2527
  note: t.replace(n[0], "").replace(/\s{2,}/g, " ").trim(),
2482
2528
  label: n[1].trim(),
2483
2529
  href: n[2].trim()
2484
2530
  } : { note: t, label: "", href: "" };
2485
2531
  }
2486
- function dt(e, t, n) {
2532
+ function ht(e, t, n) {
2487
2533
  if (!e) return 0;
2488
2534
  const o = Math.max(1, Math.floor(n / t));
2489
2535
  return e.split(`
2490
2536
  `).reduce((s, r) => s + Math.max(1, Math.ceil(r.trim().length / o)), 0);
2491
2537
  }
2492
- function jt(e) {
2538
+ function Et(e) {
2493
2539
  return e.reduce((t, n) => Math.max(t, n.length), 0);
2494
2540
  }
2495
- function sr(e, t) {
2496
- const n = jt(t.map((u) => u.name)) * Ls, o = jt(t.map((u) => u.type)) * Hs, s = jt(t.map((u) => u.linkLabel)) * Us, r = t.some((u) => u.pk || u.fk) ? Js : 0, i = Math.round(n + o + s + r + Gs), c = Math.round(e.length * Ln + 32);
2497
- return Math.min(Bs, Math.max(Rs, i, c));
2541
+ function ar(e, t) {
2542
+ const n = Et(t.map((u) => u.name)) * zs, o = Et(t.map((u) => u.type)) * qs, s = Et(t.map((u) => u.linkLabel)) * Gs, r = t.some((u) => u.pk || u.fk) ? Vs : 0, i = Math.round(n + o + s + r + Xs), c = Math.round(e.length * qn + 32);
2543
+ return Math.min(Ls, Math.max(Ws, i, c));
2498
2544
  }
2499
- function rr(e) {
2500
- const t = e.width - Ws, n = Math.max(1, dt(e.name, Ln, t)), o = dt(e.note, zs, t), s = Ms + n * Ts + o * Ns, r = Math.max(e.columns.length, 1) * Cs, i = e.indexes.reduce(
2501
- (u, h) => u + dt(`${h.unique ? "unique" : "index"} ${h.columns.join(", ")}`, qs, t),
2545
+ function ir(e) {
2546
+ const t = e.width - Hs, n = Math.max(1, ht(e.name, qn, t)), o = ht(e.note, Us, t), s = Ns + n * Is + o * Fs, r = Math.max(e.columns.length, 1) * Ds, i = e.indexes.reduce(
2547
+ (u, h) => u + ht(`${h.unique ? "unique" : "index"} ${h.columns.join(", ")}`, Js, t),
2502
2548
  0
2503
- ), c = e.indexes.length ? Ds + i * Os : 0;
2549
+ ), c = e.indexes.length ? Ms + i * Ts : 0;
2504
2550
  return Math.round(s + r + c + 2);
2505
2551
  }
2506
- function ar(e) {
2507
- const t = e.width - _n, n = dt(e.body, Ys, t), o = e.title ? Ks : 0;
2508
- return Math.round(_n + o + Math.max(1, n) * Xs);
2552
+ function cr(e) {
2553
+ const t = e.width - wn, n = ht(e.body, Zs, t), o = e.title ? Qs : 0;
2554
+ return Math.round(wn + o + Math.max(1, n) * Ks);
2509
2555
  }
2510
- function ir(e, t, n) {
2556
+ function lr(e, t, n) {
2511
2557
  return e.x < t.x + t.width + n && t.x < e.x + e.width + n && e.y < t.y + t.height + n && t.y < e.y + e.height + n;
2512
2558
  }
2513
- function cr(e, t) {
2559
+ function pr(e, t) {
2514
2560
  const n = [...e].sort((o, s) => o.y - s.y || o.x - s.x);
2515
2561
  for (let o = 1; o < n.length; o++) {
2516
2562
  let s = !0, r = 0;
2517
2563
  for (; s && r < n.length; ) {
2518
2564
  s = !1, r += 1;
2519
2565
  for (let i = 0; i < o; i++)
2520
- ir(n[o], n[i], t) && (n[o].y = n[i].y + n[i].height + t, s = !0);
2566
+ lr(n[o], n[i], t) && (n[o].y = n[i].y + n[i].height + t, s = !0);
2521
2567
  }
2522
2568
  }
2523
2569
  }
2524
- function lr(e, t) {
2570
+ function ur(e, t) {
2525
2571
  const n = /* @__PURE__ */ new Map();
2526
2572
  for (const c of e) n.set(c.id, /* @__PURE__ */ new Set());
2527
2573
  for (const [c, u] of t)
@@ -2535,17 +2581,17 @@ function lr(e, t) {
2535
2581
  for (s.add(c.id); h.length; ) {
2536
2582
  const g = h.shift(), w = o.get(g);
2537
2583
  w && u.push(w);
2538
- const j = [...n.get(g) ?? []].sort(
2539
- (P, M) => (n.get(M)?.size ?? 0) - (n.get(P)?.size ?? 0)
2584
+ const P = [...n.get(g) ?? []].sort(
2585
+ (A, T) => (n.get(T)?.size ?? 0) - (n.get(A)?.size ?? 0)
2540
2586
  );
2541
- for (const P of j)
2542
- s.has(P) || (s.add(P), h.push(P));
2587
+ for (const A of P)
2588
+ s.has(A) || (s.add(A), h.push(A));
2543
2589
  }
2544
2590
  r.push(u);
2545
2591
  }
2546
2592
  return r;
2547
2593
  }
2548
- function pr(e, t) {
2594
+ function mr(e, t) {
2549
2595
  const n = new Set(e.map((h) => h.id)), o = /* @__PURE__ */ new Map();
2550
2596
  for (const h of e) o.set(h.id, /* @__PURE__ */ new Set());
2551
2597
  for (const [h, g] of t)
@@ -2566,62 +2612,62 @@ function pr(e, t) {
2566
2612
  const u = [];
2567
2613
  for (const h of [...c.keys()].sort((g, w) => g - w)) {
2568
2614
  const g = c.get(h) ?? [];
2569
- for (let w = 0; w < g.length; w += gn)
2570
- u.push(g.slice(w, w + gn));
2615
+ for (let w = 0; w < g.length; w += bn)
2616
+ u.push(g.slice(w, w + bn));
2571
2617
  }
2572
2618
  return u;
2573
2619
  }
2574
- function ur(e, t) {
2620
+ function fr(e, t) {
2575
2621
  const n = [];
2576
2622
  let o = Ke;
2577
- for (const s of lr(e, t)) {
2623
+ for (const s of ur(e, t)) {
2578
2624
  let r = Ke, i = o;
2579
- for (const c of pr(s, t)) {
2625
+ for (const c of mr(s, t)) {
2580
2626
  const u = Math.max(...c.map((g) => g.width));
2581
2627
  let h = o;
2582
2628
  for (const g of c)
2583
- g.x = r + Math.round((u - g.width) / 2), g.y = h, h += g.height + Is, i = Math.max(i, g.y + g.height), n.push(g);
2584
- r += u + Wn;
2629
+ g.x = r + Math.round((u - g.width) / 2), g.y = h, h += g.height + Rs, i = Math.max(i, g.y + g.height), n.push(g);
2630
+ r += u + zn;
2585
2631
  }
2586
- o = i + Fs;
2632
+ o = i + Bs;
2587
2633
  }
2588
2634
  return n;
2589
2635
  }
2590
- function mr(e) {
2591
- const t = Qs(e), n = Object.values(t.database)[0], o = /* @__PURE__ */ new Map(), s = [];
2592
- for (const x of Object.values(t.schemas).sort((A, I) => A.id - I.id))
2593
- for (const A of x.tableIds)
2594
- s.push(A), o.set(A, x.name);
2636
+ function dr(e) {
2637
+ const t = tr(e), n = Object.values(t.database)[0], o = /* @__PURE__ */ new Map(), s = [];
2638
+ for (const x of Object.values(t.schemas).sort((E, I) => E.id - I.id))
2639
+ for (const E of x.tableIds)
2640
+ s.push(E), o.set(E, x.name);
2595
2641
  const r = /* @__PURE__ */ new Set();
2596
2642
  for (const x of Object.values(t.indexes)) {
2597
2643
  if (!x.pk) continue;
2598
- const A = t.tables[String(x.tableId)];
2599
- if (A)
2644
+ const E = t.tables[String(x.tableId)];
2645
+ if (E)
2600
2646
  for (const I of x.columnIds) {
2601
2647
  const H = t.indexColumns[String(I)];
2602
2648
  if (!H || H.type !== "column") continue;
2603
- const K = A.fieldIds.map((re) => t.fields[String(re)]).find((re) => re && re.name === H.value);
2649
+ const K = E.fieldIds.map((re) => t.fields[String(re)]).find((re) => re && re.name === H.value);
2604
2650
  K && r.add(K.id);
2605
2651
  }
2606
2652
  }
2607
2653
  const i = [], c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
2608
2654
  for (const x of s) {
2609
- const A = t.tables[String(x)];
2610
- if (!A) continue;
2611
- const I = o.get(x) ?? "public", H = I === "public" ? A.name : `${I}.${A.name}`, K = `table-${x}`, re = [];
2612
- A.fieldIds.forEach((ge) => {
2655
+ const E = t.tables[String(x)];
2656
+ if (!E) continue;
2657
+ const I = o.get(x) ?? "public", H = I === "public" ? E.name : `${I}.${E.name}`, K = `table-${x}`, re = [];
2658
+ E.fieldIds.forEach((ge) => {
2613
2659
  const oe = t.fields[String(ge)];
2614
2660
  if (!oe) return;
2615
- const fe = !!oe.pk || r.has(oe.id), be = or(oe.note ?? "");
2661
+ const de = !!oe.pk || r.has(oe.id), be = rr(oe.note ?? "");
2616
2662
  h.set(oe.id, re.length), g.set(oe.id, K), re.push({
2617
2663
  name: oe.name,
2618
- type: er(oe),
2664
+ type: nr(oe),
2619
2665
  note: be.note,
2620
- default: tr(oe),
2621
- pk: fe,
2666
+ default: or(oe),
2667
+ pk: de,
2622
2668
  fk: !1,
2623
2669
  unique: !!oe.unique,
2624
- notNull: fe || !!oe.not_null,
2670
+ notNull: de || !!oe.not_null,
2625
2671
  increment: !!oe.increment,
2626
2672
  link: be.href,
2627
2673
  linkLabel: be.label,
@@ -2629,48 +2675,48 @@ function mr(e) {
2629
2675
  });
2630
2676
  });
2631
2677
  const he = [];
2632
- for (const ge of A.indexIds) {
2678
+ for (const ge of E.indexIds) {
2633
2679
  const oe = t.indexes[String(ge)];
2634
2680
  if (!oe || oe.pk) continue;
2635
- const fe = oe.columnIds.map((be) => t.indexColumns[String(be)]).filter((be) => be && be.type === "column").map((be) => be.value);
2636
- fe.length && he.push({
2637
- name: oe.name ?? `${A.name}_index_${oe.id}`,
2638
- columns: fe,
2681
+ const de = oe.columnIds.map((be) => t.indexColumns[String(be)]).filter((be) => be && be.type === "column").map((be) => be.value);
2682
+ de.length && he.push({
2683
+ name: oe.name ?? `${E.name}_index_${oe.id}`,
2684
+ columns: de,
2639
2685
  unique: !!oe.unique
2640
2686
  });
2641
2687
  }
2642
2688
  const te = {
2643
2689
  id: K,
2644
2690
  name: H,
2645
- note: A.note ?? "",
2646
- color: A.headerColor ?? "",
2691
+ note: E.note ?? "",
2692
+ color: E.headerColor ?? "",
2647
2693
  columns: re,
2648
2694
  indexes: he,
2649
2695
  x: 0,
2650
2696
  y: 0,
2651
- width: sr(H, re),
2697
+ width: ar(H, re),
2652
2698
  height: 0
2653
2699
  };
2654
- te.height = rr(te), i.push(te), c.set(K, te), u.set(A.name, K), u.set(H, K);
2700
+ te.height = ir(te), i.push(te), c.set(K, te), u.set(E.name, K), u.set(H, K);
2655
2701
  }
2656
2702
  for (const x of i)
2657
- for (const A of x.columns) {
2658
- if (!A.link) continue;
2659
- const I = A.link.replace(/^#/, ""), H = u.get(I) ?? u.get(A.link);
2660
- !H || H === x.id || (A.target = H, A.link = "");
2703
+ for (const E of x.columns) {
2704
+ if (!E.link) continue;
2705
+ const I = E.link.replace(/^#/, ""), H = u.get(I) ?? u.get(E.link);
2706
+ !H || H === x.id || (E.target = H, E.link = "");
2661
2707
  }
2662
2708
  const w = [];
2663
- for (const x of Object.values(t.refs).sort((A, I) => A.id - I.id)) {
2664
- const A = x.endpointIds.map((oe) => t.endpoints[String(oe)]).filter(Boolean);
2665
- if (A.length !== 2) continue;
2666
- const I = A[1].relation === "1" ? 1 : A[0].relation === "1" ? 0 : 1, H = A[I], K = A[I === 0 ? 1 : 0], re = H.fieldIds[0], he = K.fieldIds[0];
2709
+ for (const x of Object.values(t.refs).sort((E, I) => E.id - I.id)) {
2710
+ const E = x.endpointIds.map((oe) => t.endpoints[String(oe)]).filter(Boolean);
2711
+ if (E.length !== 2) continue;
2712
+ const I = E[1].relation === "1" ? 1 : E[0].relation === "1" ? 0 : 1, H = E[I], K = E[I === 0 ? 1 : 0], re = H.fieldIds[0], he = K.fieldIds[0];
2667
2713
  if (re === void 0 || he === void 0) continue;
2668
2714
  const te = g.get(re) ?? u.get(H.tableName), ge = g.get(he) ?? u.get(K.tableName);
2669
2715
  if (!(!te || !ge)) {
2670
2716
  for (const oe of K.fieldIds) {
2671
- const fe = c.get(g.get(oe) ?? ""), be = h.get(oe);
2672
- if (!fe || be === void 0) continue;
2673
- const Fe = fe.columns[be];
2717
+ const de = c.get(g.get(oe) ?? ""), be = h.get(oe);
2718
+ if (!de || be === void 0) continue;
2719
+ const Fe = de.columns[be];
2674
2720
  Fe.fk = !0, !Fe.target && !Fe.link && (Fe.target = te);
2675
2721
  }
2676
2722
  w.push({
@@ -2683,35 +2729,35 @@ function mr(e) {
2683
2729
  });
2684
2730
  }
2685
2731
  }
2686
- const j = ur(
2732
+ const P = fr(
2687
2733
  i,
2688
2734
  w.map((x) => [x.parent, x.child])
2689
- ), P = j.length ? j : i, M = [], d = P.reduce((x, A) => Math.max(x, A.x + A.width), Ke);
2735
+ ), A = P.length ? P : i, T = [], d = A.reduce((x, E) => Math.max(x, E.x + E.width), Ke);
2690
2736
  let v = Ke;
2691
- const O = d + Ke + Wn;
2692
- for (const x of Object.values(t.notes).sort((A, I) => A.id - I.id)) {
2693
- const A = String(x.content ?? "").trim();
2694
- if (!A) continue;
2737
+ const D = d + Ke + zn;
2738
+ for (const x of Object.values(t.notes).sort((E, I) => E.id - I.id)) {
2739
+ const E = String(x.content ?? "").trim();
2740
+ if (!E) continue;
2695
2741
  const I = {
2696
2742
  id: `note-${x.id}`,
2697
2743
  title: x.name ?? "",
2698
- body: A,
2699
- x: O,
2744
+ body: E,
2745
+ x: D,
2700
2746
  y: v,
2701
- width: Vs,
2747
+ width: Ys,
2702
2748
  height: 0
2703
2749
  };
2704
- I.height = ar(I), M.push(I), v += I.height + yn;
2750
+ I.height = cr(I), T.push(I), v += I.height + vn;
2705
2751
  }
2706
- cr([...P, ...M], yn);
2752
+ pr([...A, ...T], vn);
2707
2753
  const R = [];
2708
2754
  for (const x of w) {
2709
- const A = c.get(x.parent), I = c.get(x.child);
2710
- if (!A || !I) continue;
2711
- const H = A.x + A.width / 2 <= I.x + I.width / 2 ? "r" : "l", K = H === "r" ? "l" : "r";
2755
+ const E = c.get(x.parent), I = c.get(x.child);
2756
+ if (!E || !I) continue;
2757
+ const H = E.x + E.width / 2 <= I.x + I.width / 2 ? "r" : "l", K = H === "r" ? "l" : "r";
2712
2758
  R.push({
2713
2759
  id: x.id,
2714
- source: A.id,
2760
+ source: E.id,
2715
2761
  sourceHandle: `${H}-${x.parentColumn}`,
2716
2762
  target: I.id,
2717
2763
  targetHandle: `${K}-${x.childColumn}`,
@@ -2720,15 +2766,15 @@ function mr(e) {
2720
2766
  }
2721
2767
  return {
2722
2768
  database: n?.name ?? "",
2723
- tables: P,
2769
+ tables: A,
2724
2770
  edges: R,
2725
- notes: M
2771
+ notes: T
2726
2772
  };
2727
2773
  }
2728
- function Hn(e) {
2729
- return JSON.stringify(mr(e));
2774
+ function Un(e) {
2775
+ return JSON.stringify(dr(e));
2730
2776
  }
2731
- function fr(e, t, n = "") {
2777
+ function hr(e, t, n = "") {
2732
2778
  const o = e.match(/<script[^>]*\bsetup\b[^>]*>([\s\S]*?)<\/script>/)?.[1] ?? "", s = e.match(/<template>([\s\S]*)<\/template>/)?.[1] ?? "", r = `${o}
2733
2779
  ${n}`;
2734
2780
  let i = null;
@@ -2737,19 +2783,19 @@ ${n}`;
2737
2783
  i = Qe(o, c.index + c[0].length);
2738
2784
  else {
2739
2785
  const d = o.match(/defineProps<\s*([A-Za-z_$][\w$]*)\s*>/);
2740
- d && (i = _t(r, d[1]));
2786
+ d && (i = yt(r, d[1]));
2741
2787
  }
2742
2788
  const u = /* @__PURE__ */ new Map(), h = o.match(/(?:const|let)\s*\{([\s\S]*?)\}\s*=\s*(?:withDefaults\s*\(\s*)?defineProps/);
2743
2789
  if (h)
2744
- for (const d of It(h[1])) {
2790
+ for (const d of Bt(h[1])) {
2745
2791
  const v = d.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
2746
- v && u.set(v[1], Rn(v[2]));
2792
+ v && u.set(v[1], Ln(v[2]));
2747
2793
  }
2748
2794
  const g = [];
2749
2795
  if (i)
2750
- for (const d of qt(i)) {
2751
- const v = Ut(
2752
- yt(d.name, d.type, d.optional, r, d.description),
2796
+ for (const d of Gt(i)) {
2797
+ const v = Vt(
2798
+ bt(d.name, d.type, d.optional, r, d.description),
2753
2799
  d
2754
2800
  );
2755
2801
  u.has(d.name) && (v.default = u.get(d.name)), g.push(v);
@@ -2757,47 +2803,47 @@ ${n}`;
2757
2803
  for (const d of o.matchAll(/\bdefineModel(?:<([^>]*)>)?\(\s*(?:['"]([\w-]+)['"])?/g)) {
2758
2804
  const v = d[2] ?? "modelValue";
2759
2805
  if (g.some((x) => x.name === v)) continue;
2760
- const O = yt(v, d[1]?.trim() || "string", !0, r);
2761
- O.bindable = !0;
2806
+ const D = bt(v, d[1]?.trim() || "string", !0, r);
2807
+ D.bindable = !0;
2762
2808
  const R = o.slice(0, d.index).match(/\/\*\*((?:[^*]|\*(?!\/))*)\*\/\s*(?:const|let)\s+[\w$]+\s*=\s*$/);
2763
2809
  if (R) {
2764
- const x = zo(R[1].replace(/^\s*\*\s?/gm, "").trim());
2765
- x.description && (O.description = x.description), x.mock && !O.mock && (O.mock = x.mock);
2810
+ const x = Jo(R[1].replace(/^\s*\*\s?/gm, "").trim());
2811
+ x.description && (D.description = x.description), x.mock && !D.mock && (D.mock = x.mock);
2766
2812
  }
2767
- g.push(O);
2813
+ g.push(D);
2768
2814
  }
2769
- const w = [], j = /* @__PURE__ */ new Set();
2815
+ const w = [], P = /* @__PURE__ */ new Set();
2770
2816
  for (const d of s.matchAll(/<slot\b([^>]*)>/g)) {
2771
2817
  const v = d[1].match(/(?:^|[^:\w-])name=["']([^"']+)["']/)?.[1];
2772
2818
  if (!v && /(?:^|\s)(?::|v-bind:)name=/.test(d[1])) continue;
2773
- const O = v ?? "default";
2774
- j.has(O) || (j.add(O), w.push({ name: O, kind: "slot", type: "slot" }));
2819
+ const D = v ?? "default";
2820
+ P.has(D) || (P.add(D), w.push({ name: D, kind: "slot", type: "slot" }));
2775
2821
  }
2776
- const P = [], M = o.indexOf("defineEmits");
2777
- if (M >= 0) {
2778
- const d = o.slice(M), v = d.search(/[<(]/);
2822
+ const A = [], T = o.indexOf("defineEmits");
2823
+ if (T >= 0) {
2824
+ const d = o.slice(T), v = d.search(/[<(]/);
2779
2825
  if (v >= 0) {
2780
- const O = d[v], R = O === "<" ? ">" : ")", x = Qe(d, v + 1, O, R), A = /* @__PURE__ */ new Set();
2781
- for (const I of x.matchAll(/['"]([\w:.-]+)['"]\s*:\s*\[/g)) A.add(I[1]);
2782
- for (const I of x.matchAll(/\(\s*\w+\s*:\s*['"]([\w:.-]+)['"]/g)) A.add(I[1]);
2783
- for (const I of x.matchAll(/[,\[]\s*['"]([\w:.-]+)['"]\s*[,\]]/g)) A.add(I[1]);
2784
- for (const I of x.matchAll(/(?:^|[\n;{,])\s*([A-Za-z_$][\w$]*)\s*:\s*\[/g)) A.add(I[1]);
2785
- P.push(...A);
2826
+ const D = d[v], R = D === "<" ? ">" : ")", x = Qe(d, v + 1, D, R), E = /* @__PURE__ */ new Set();
2827
+ for (const I of x.matchAll(/['"]([\w:.-]+)['"]\s*:\s*\[/g)) E.add(I[1]);
2828
+ for (const I of x.matchAll(/\(\s*\w+\s*:\s*['"]([\w:.-]+)['"]/g)) E.add(I[1]);
2829
+ for (const I of x.matchAll(/[,\[]\s*['"]([\w:.-]+)['"]\s*[,\]]/g)) E.add(I[1]);
2830
+ for (const I of x.matchAll(/(?:^|[\n;{,])\s*([A-Za-z_$][\w$]*)\s*:\s*\[/g)) E.add(I[1]);
2831
+ A.push(...E);
2786
2832
  }
2787
2833
  }
2788
2834
  for (const d of g)
2789
- (d.bindable || P.includes(`update:${d.name}`)) && (d.bindable = !0, P.includes(`update:${d.name}`) || P.push(`update:${d.name}`));
2790
- return { component: t, props: g, slots: w, emits: P };
2835
+ (d.bindable || A.includes(`update:${d.name}`)) && (d.bindable = !0, A.includes(`update:${d.name}`) || A.push(`update:${d.name}`));
2836
+ return { component: t, props: g, slots: w, emits: A };
2791
2837
  }
2792
- function dr(e, t, n = "") {
2838
+ function gr(e, t, n = "") {
2793
2839
  const o = e.match(/<script[^>]*>([\s\S]*?)<\/script>/)?.[1] ?? "", s = `${o}
2794
2840
  ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$props\(\)/), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
2795
2841
  if (r)
2796
- for (const P of It(r[1])) {
2797
- const M = P.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
2798
- if (!M) continue;
2799
- const d = M[2].trim().match(/^\$bindable\(([\s\S]*)\)$/);
2800
- d && c.add(M[1]), i.set(M[1], Rn(d ? d[1] : M[2]));
2842
+ for (const A of Bt(r[1])) {
2843
+ const T = A.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
2844
+ if (!T) continue;
2845
+ const d = T[2].trim().match(/^\$bindable\(([\s\S]*)\)$/);
2846
+ d && c.add(T[1]), i.set(T[1], Ln(d ? d[1] : T[2]));
2801
2847
  }
2802
2848
  let u = null;
2803
2849
  const h = r?.[2]?.trim();
@@ -2805,38 +2851,38 @@ ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$pr
2805
2851
  if (h.startsWith("{"))
2806
2852
  u = Qe(h, 1);
2807
2853
  else {
2808
- const P = h.match(/^([A-Za-z_$][\w$]*)/);
2809
- P && (u = _t(s, P[1]));
2854
+ const A = h.match(/^([A-Za-z_$][\w$]*)/);
2855
+ A && (u = yt(s, A[1]));
2810
2856
  }
2811
- const g = [], w = [], j = [];
2857
+ const g = [], w = [], P = [];
2812
2858
  if (u)
2813
- for (const P of qt(u)) {
2814
- if (/\bSnippet\b/.test(P.type)) {
2815
- w.push({ name: P.name, kind: "slot", type: P.type, required: !P.optional });
2859
+ for (const A of Gt(u)) {
2860
+ if (/\bSnippet\b/.test(A.type)) {
2861
+ w.push({ name: A.name, kind: "slot", type: A.type, required: !A.optional });
2816
2862
  continue;
2817
2863
  }
2818
- if (/^on[A-Z]/.test(P.name) && /=>/.test(P.type)) {
2819
- j.push(P.name);
2864
+ if (/^on[A-Z]/.test(A.name) && /=>/.test(A.type)) {
2865
+ P.push(A.name);
2820
2866
  continue;
2821
2867
  }
2822
- const M = Ut(
2823
- yt(P.name, P.type, P.optional, s, P.description),
2824
- P
2868
+ const T = Vt(
2869
+ bt(A.name, A.type, A.optional, s, A.description),
2870
+ A
2825
2871
  );
2826
- i.has(P.name) && (M.default = i.get(P.name)), c.has(P.name) && (M.bindable = !0), g.push(M);
2872
+ i.has(A.name) && (T.default = i.get(A.name)), c.has(A.name) && (T.bindable = !0), g.push(T);
2827
2873
  }
2828
2874
  else if (r) {
2829
- for (const P of It(r[1])) {
2830
- const M = P.match(/^([A-Za-z_$][\w$]*)/)?.[1];
2831
- if (!M || M === "children") continue;
2832
- const d = { name: M, kind: "json", type: "unknown" };
2833
- i.has(M) && (d.default = i.get(M)), c.has(M) && (d.bindable = !0), g.push(d);
2875
+ for (const A of Bt(r[1])) {
2876
+ const T = A.match(/^([A-Za-z_$][\w$]*)/)?.[1];
2877
+ if (!T || T === "children") continue;
2878
+ const d = { name: T, kind: "json", type: "unknown" };
2879
+ i.has(T) && (d.default = i.get(T)), c.has(T) && (d.bindable = !0), g.push(d);
2834
2880
  }
2835
2881
  /\bchildren\b/.test(r[1]) && w.push({ name: "children", kind: "slot", type: "Snippet" });
2836
2882
  }
2837
- return { component: t, props: g, slots: w, emits: j };
2883
+ return { component: t, props: g, slots: w, emits: P };
2838
2884
  }
2839
- function zn(e, t = []) {
2885
+ function Jn(e, t = []) {
2840
2886
  let n;
2841
2887
  try {
2842
2888
  n = Le(e, { withFileTypes: !0 });
@@ -2847,20 +2893,20 @@ function zn(e, t = []) {
2847
2893
  const s = q(e, o.name);
2848
2894
  if (o.isDirectory()) {
2849
2895
  if (o.name === "node_modules") continue;
2850
- zn(s, t);
2896
+ Jn(s, t);
2851
2897
  } else o.isFile() && o.name.endsWith(".d.ts") && t.push(s);
2852
2898
  }
2853
2899
  return t;
2854
2900
  }
2855
- function hr(e, t, n) {
2901
+ function _r(e, t, n) {
2856
2902
  const o = q(e, "node_modules", t);
2857
- if (!de(o) || !ht(o).isDirectory()) return null;
2903
+ if (!fe(o) || !gt(o).isDirectory()) return null;
2858
2904
  const s = [
2859
2905
  `${n}.vue.d.ts`,
2860
2906
  `${n}.svelte.d.ts`,
2861
2907
  `${n}.d.ts`,
2862
2908
  `${n.toLowerCase()}/index.d.ts`
2863
- ], r = zn(o);
2909
+ ], r = Jn(o);
2864
2910
  for (const i of s) {
2865
2911
  const c = r.find((u) => u.endsWith(`/${i}`));
2866
2912
  if (c) return c;
@@ -2868,10 +2914,10 @@ function hr(e, t, n) {
2868
2914
  return null;
2869
2915
  }
2870
2916
  function fi(e, t) {
2871
- const n = _t(e, `${t}Props`) ?? _t(e, "Props");
2917
+ const n = yt(e, `${t}Props`) ?? yt(e, "Props");
2872
2918
  if (!n) return;
2873
2919
  const o = [], s = [], r = [];
2874
- for (const i of qt(n)) {
2920
+ for (const i of Gt(n)) {
2875
2921
  if (/\bSnippet\b/.test(i.type)) {
2876
2922
  s.push({ name: i.name, kind: "slot", type: i.type, required: !i.optional });
2877
2923
  continue;
@@ -2880,11 +2926,11 @@ function fi(e, t) {
2880
2926
  r.push(i.name);
2881
2927
  continue;
2882
2928
  }
2883
- o.push(Ut(yt(i.name, i.type, i.optional, e, i.description), i));
2929
+ o.push(Vt(bt(i.name, i.type, i.optional, e, i.description), i));
2884
2930
  }
2885
2931
  return { component: t, props: o, slots: s, emits: r };
2886
2932
  }
2887
- function Pt(e, t) {
2933
+ function Ct(e, t) {
2888
2934
  const n = e.search(new RegExp(`\\b${t}\\s*:`));
2889
2935
  if (n < 0) return;
2890
2936
  const o = e.indexOf("{", n);
@@ -2896,7 +2942,7 @@ function Pt(e, t) {
2896
2942
  return;
2897
2943
  }
2898
2944
  }
2899
- function At(e, t) {
2945
+ function Ot(e, t) {
2900
2946
  const n = e.search(new RegExp(`\\b${t}\\s*:`));
2901
2947
  if (n < 0) return e;
2902
2948
  const o = e.indexOf("{", n);
@@ -2904,8 +2950,8 @@ function At(e, t) {
2904
2950
  const s = Qe(e, o + 1);
2905
2951
  return e.slice(0, n) + e.slice(o + 1 + s.length + 1);
2906
2952
  }
2907
- function gr(e, t) {
2908
- const n = e.match(/^\s*\/\/\s*story:\s*(.+)$/m)?.[1]?.trim(), o = At(At(e, "props"), "slots"), s = Pt(o, "sidebar"), r = At(o, "sidebar"), i = r.match(/\bname\s*:\s*['"]([^'"]+)['"]/)?.[1], c = r.match(/\bdescription\s*:\s*['"]([^'"]+)['"]/)?.[1], u = Pt(e, "props"), h = Pt(e, "slots");
2953
+ function yr(e, t) {
2954
+ const n = e.match(/^\s*\/\/\s*story:\s*(.+)$/m)?.[1]?.trim(), o = Ot(Ot(e, "props"), "slots"), s = Ct(o, "sidebar"), r = Ot(o, "sidebar"), i = r.match(/\bname\s*:\s*['"]([^'"]+)['"]/)?.[1], c = r.match(/\bdescription\s*:\s*['"]([^'"]+)['"]/)?.[1], u = Ct(e, "props"), h = Ct(e, "slots");
2909
2955
  return {
2910
2956
  name: n ?? i ?? Ce(t).replace(/\.story\.tsx?$/, "").replace(/_/g, " "),
2911
2957
  file: t,
@@ -2915,10 +2961,10 @@ function gr(e, t) {
2915
2961
  sidebar: s
2916
2962
  };
2917
2963
  }
2918
- async function _r(e) {
2964
+ async function br(e) {
2919
2965
  let t;
2920
2966
  try {
2921
- t = await Ht(e, { withFileTypes: !0 });
2967
+ t = await Ut(e, { withFileTypes: !0 });
2922
2968
  } catch {
2923
2969
  return [];
2924
2970
  }
@@ -2931,16 +2977,16 @@ async function _r(e) {
2931
2977
  } catch {
2932
2978
  continue;
2933
2979
  }
2934
- n.push(gr(s, o.name));
2980
+ n.push(yr(s, o.name));
2935
2981
  }
2936
2982
  return n.sort((o, s) => o.name.localeCompare(s.name)), n;
2937
2983
  }
2938
- function wt(e, t, n, o, s) {
2984
+ function $t(e, t, n, o, s) {
2939
2985
  const r = t.systems[n];
2940
2986
  if (!r?.source) return null;
2941
2987
  const i = G(e, r.source), c = r.framework === "vue" ? ".vue" : ".svelte", u = s ? [G(i, s)] : [q(i, o, o + c), q(i, o + c)];
2942
2988
  for (const h of u) {
2943
- if (!s && !h.startsWith(i) || !de(h)) continue;
2989
+ if (!s && !h.startsWith(i) || !fe(h)) continue;
2944
2990
  const g = Y(h);
2945
2991
  return {
2946
2992
  systemConfig: r,
@@ -2951,10 +2997,10 @@ function wt(e, t, n, o, s) {
2951
2997
  }
2952
2998
  return null;
2953
2999
  }
2954
- async function qn(e, t = []) {
3000
+ async function Gn(e, t = []) {
2955
3001
  let n;
2956
3002
  try {
2957
- n = await Ht(e, { withFileTypes: !0 });
3003
+ n = await Ut(e, { withFileTypes: !0 });
2958
3004
  } catch {
2959
3005
  return t;
2960
3006
  }
@@ -2962,13 +3008,13 @@ async function qn(e, t = []) {
2962
3008
  const s = q(e, o.name);
2963
3009
  if (o.isDirectory()) {
2964
3010
  if (o.name.startsWith(".") || o.name === "node_modules") continue;
2965
- await qn(s, t);
3011
+ await Gn(s, t);
2966
3012
  } else o.isFile() && o.name.endsWith(".md") && t.push(s);
2967
3013
  }
2968
3014
  return t;
2969
3015
  }
2970
- async function Vt(e, t) {
2971
- const n = G(e, t), o = await qn(n), s = [];
3016
+ async function Kt(e, t) {
3017
+ const n = G(e, t), o = await Gn(n), s = [];
2972
3018
  for (const r of o) {
2973
3019
  let i;
2974
3020
  try {
@@ -2976,7 +3022,7 @@ async function Vt(e, t) {
2976
3022
  } catch {
2977
3023
  continue;
2978
3024
  }
2979
- const { data: c } = gt(i);
3025
+ const { data: c } = _t(i);
2980
3026
  if (c?.type !== "component") continue;
2981
3027
  const u = c.data ?? {}, h = String(u.system ?? ""), g = String(u.component ?? "");
2982
3028
  !h || !g || s.push({
@@ -2992,32 +3038,32 @@ async function Vt(e, t) {
2992
3038
  }
2993
3039
  function nt(e) {
2994
3040
  const t = q(e, "schema.yml");
2995
- if (de(t)) return { path: t, form: "yml" };
3041
+ if (fe(t)) return { path: t, form: "yml" };
2996
3042
  const n = q(e, "schema.json");
2997
- return de(n) ? { path: n, form: "json" } : null;
3043
+ return fe(n) ? { path: n, form: "json" } : null;
2998
3044
  }
2999
3045
  function ot(e, t) {
3000
- return t === "yml" ? Fn(e) : JSON.parse(e);
3046
+ return t === "yml" ? Wn(e) : JSON.parse(e);
3001
3047
  }
3002
3048
  function et(e, t) {
3003
- return t === "yml" ? Ro(e) : JSON.stringify(e, null, 2) + `
3049
+ return t === "yml" ? Lo(e) : JSON.stringify(e, null, 2) + `
3004
3050
  `;
3005
3051
  }
3006
- async function Xt(e, t, n) {
3052
+ async function Zt(e, t, n) {
3007
3053
  try {
3008
- return await Or(Y(e), e, t, n);
3054
+ return await Tr(Y(e), e, t, n);
3009
3055
  } catch (o) {
3010
3056
  console.warn(`nimpress modules: schema parse failed for ${n}: ${String(o)}`);
3011
3057
  return;
3012
3058
  }
3013
3059
  }
3014
- const yr = ["description", "default", "enum", "mock", "format", "minimum", "maximum", "title"], br = ["type", "tsType", "bindable"];
3060
+ const wr = ["description", "default", "enum", "mock", "format", "minimum", "maximum", "title"], vr = ["type", "tsType", "bindable"];
3015
3061
  function Ze(e, t) {
3016
3062
  const n = { ...e }, o = n, s = t;
3017
- for (const r of br)
3063
+ for (const r of vr)
3018
3064
  s[r] !== void 0 && (o[r] = s[r]);
3019
3065
  t.type !== void 0 && t.tsType === void 0 && delete n.tsType, t.required !== void 0 && (n.required = t.required);
3020
- for (const r of yr)
3066
+ for (const r of wr)
3021
3067
  o[r] === void 0 && s[r] !== void 0 && (o[r] = s[r]);
3022
3068
  if (t.properties) {
3023
3069
  const r = {};
@@ -3031,7 +3077,7 @@ function Ze(e, t) {
3031
3077
  }
3032
3078
  return t.items && (n.items = e.items ? Ze(e.items, t.items) : t.items), t.additionalProperties && (n.additionalProperties = e.additionalProperties ? Ze(e.additionalProperties, t.additionalProperties) : t.additionalProperties), n;
3033
3079
  }
3034
- function Yt(e, t) {
3080
+ function Qt(e, t) {
3035
3081
  const n = t, o = { added: [], missing: [] }, s = {};
3036
3082
  for (const [u, h] of Object.entries(n.properties ?? {})) {
3037
3083
  const g = e.properties?.[u];
@@ -3051,24 +3097,24 @@ function Yt(e, t) {
3051
3097
  i.includes(u) || (i.push(u), o.missing.push(`emit ${u}`));
3052
3098
  return { merged: { ...e, ...t, properties: s, slots: r, emits: i }, report: o };
3053
3099
  }
3054
- const Xe = [], bn = /* @__PURE__ */ new Set();
3055
- function wr(e) {
3100
+ const Xe = [], kn = /* @__PURE__ */ new Set();
3101
+ function kr(e) {
3056
3102
  return `${e.component}|${e.kind}|${e.path}`;
3057
3103
  }
3058
- function wn(e) {
3104
+ function $n(e) {
3059
3105
  for (const t of e) {
3060
- const n = wr(t);
3061
- bn.has(n) || (bn.add(n), Xe.push(t));
3106
+ const n = kr(t);
3107
+ kn.has(n) || (kn.add(n), Xe.push(t));
3062
3108
  }
3063
3109
  }
3064
- const vr = {
3110
+ const $r = {
3065
3111
  opaque: "author opaque members in the schema with enum or properties, or type them in the source",
3066
3112
  undocumented: "describe them in the schema or above the type member in the source",
3067
3113
  orphan: "remove the schema member or restore it in the source"
3068
3114
  };
3069
- function kr(e) {
3115
+ function xr(e) {
3070
3116
  const t = e.match(/^type (.+) is opaque$/);
3071
- return t ? `${Te}type${ce} ${t[1]} ${Te}is opaque${ce}` : `${Te}${e}${ce}`;
3117
+ return t ? `${Me}type${ce} ${t[1]} ${Me}is opaque${ce}` : `${Me}${e}${ce}`;
3072
3118
  }
3073
3119
  function Je(e = process.cwd()) {
3074
3120
  if (!Xe.length) return;
@@ -3080,23 +3126,23 @@ function Je(e = process.cwd()) {
3080
3126
  const n = Xe.length;
3081
3127
  Xe.length = 0;
3082
3128
  const o = n === 1 ? "schema warning" : "schema warnings", s = t.size === 1 ? "component" : "components", r = [""];
3083
- r.push(` ${Ae}${bt}nimpress modules${ce} ${Te}${n} ${o} in ${t.size} ${s}${ce}`), r.push("");
3129
+ r.push(` ${Ae}${kt}nimpress modules${ce} ${Me}${n} ${o} in ${t.size} ${s}${ce}`), r.push("");
3084
3130
  for (const [i, c] of t) {
3085
3131
  const u = c.find((w) => w.sourceFile)?.sourceFile;
3086
- r.push(` ${Bn}${bt}${i}${ce}${u ? ` ${ft}${je(e, u)}${ce}` : ""}`);
3132
+ r.push(` ${Hn}${kt}${i}${ce}${u ? ` ${dt}${je(e, u)}${ce}` : ""}`);
3087
3133
  const h = Math.max(...c.map((w) => (w.line ? `L${w.line}` : "·").length)), g = Math.max(...c.map((w) => (w.path || "(component)").length));
3088
3134
  for (const w of c) {
3089
- const j = (w.line ? `L${w.line}` : "·").padStart(h), P = (w.path || "(component)").padEnd(g);
3090
- r.push(` ${Te}${j}${ce} ${Ae}${P}${ce} ${kr(w.detail)}`);
3135
+ const P = (w.line ? `L${w.line}` : "·").padStart(h), A = (w.path || "(component)").padEnd(g);
3136
+ r.push(` ${Me}${P}${ce} ${Ae}${A}${ce} ${xr(w.detail)}`);
3091
3137
  }
3092
- for (const w of new Set(c.map((j) => j.kind)))
3093
- r.push(` ${Ae}→${ce} ${ft}${vr[w]}${ce}`);
3094
- r.push(` ${Ae}→${ce} ${ft}then run${ce} nimpress modules update ${i}`), r.push("");
3138
+ for (const w of new Set(c.map((P) => P.kind)))
3139
+ r.push(` ${Ae}→${ce} ${dt}${$r[w]}${ce}`);
3140
+ r.push(` ${Ae}→${ce} ${dt}then run${ce} nimpress modules update ${i}`), r.push("");
3095
3141
  }
3096
3142
  console.warn(r.join(`
3097
3143
  `));
3098
3144
  }
3099
- function vn(e, t) {
3145
+ function xn(e, t) {
3100
3146
  if (!e) return;
3101
3147
  const n = t.split(".").filter((i) => i && i !== "[]").pop();
3102
3148
  if (!n) return;
@@ -3108,54 +3154,54 @@ function vn(e, t) {
3108
3154
  for (let i = 0; i < o.length; i++)
3109
3155
  if (r.test(o[i])) return i + 1;
3110
3156
  }
3111
- function kn(e, t, n = {}) {
3112
- const o = [], s = Jt(e, t);
3157
+ function Sn(e, t, n = {}) {
3158
+ const o = [], s = Xt(e, t);
3113
3159
  for (const r of s.props.filter((i) => !i.description))
3114
- o.push({ component: e, sourceFile: n.sourceFile, line: vn(n.sourceText, r.name), path: r.name, detail: "has no description", kind: "undocumented" });
3115
- for (const r of qo(s.props))
3116
- o.push({ component: e, sourceFile: n.sourceFile, line: vn(n.sourceText, r.path), path: r.path, detail: `type ${r.type} is opaque`, kind: "opaque" });
3160
+ o.push({ component: e, sourceFile: n.sourceFile, line: xn(n.sourceText, r.name), path: r.name, detail: "has no description", kind: "undocumented" });
3161
+ for (const r of Go(s.props))
3162
+ o.push({ component: e, sourceFile: n.sourceFile, line: xn(n.sourceText, r.path), path: r.path, detail: `type ${r.type} is opaque`, kind: "opaque" });
3117
3163
  for (const r of n.report?.missing ?? [])
3118
3164
  o.push({ component: e, sourceFile: n.sourceFile, path: r, detail: "has no counterpart in the component source", kind: "orphan" });
3119
3165
  return o;
3120
3166
  }
3121
- async function Kt(e, t, n, o) {
3167
+ async function en(e, t, n, o) {
3122
3168
  if (!n) return;
3123
- const s = Uo(t, n.props, n.slots, n.emits), r = o ? await ie(o, "utf-8").catch(() => {
3169
+ const s = Vo(t, n.props, n.slots, n.emits), r = o ? await ie(o, "utf-8").catch(() => {
3124
3170
  }) : void 0, i = nt(e);
3125
3171
  if (!i) {
3126
- const j = q(e, "schema.json");
3127
- await pe(j, et(s, "json")), console.log(`nimpress modules: ${t} schema seeded at ${j} — the file is yours to author from here`), wn(kn(t, s, { sourceFile: o, sourceText: r }));
3172
+ const P = q(e, "schema.json");
3173
+ await pe(P, et(s, "json")), console.log(`nimpress modules: ${t} schema seeded at ${P} — the file is yours to author from here`), $n(Sn(t, s, { sourceFile: o, sourceText: r }));
3128
3174
  return;
3129
3175
  }
3130
3176
  const c = await ie(i.path, "utf-8");
3131
3177
  let u;
3132
3178
  try {
3133
3179
  u = ot(c, i.form);
3134
- } catch (j) {
3135
- console.warn(`nimpress modules: ${t} ${Ce(i.path)} failed to parse, left untouched: ${String(j)}`);
3180
+ } catch (P) {
3181
+ console.warn(`nimpress modules: ${t} ${Ce(i.path)} failed to parse, left untouched: ${String(P)}`);
3136
3182
  return;
3137
3183
  }
3138
- const { merged: h, report: g } = Yt(u, s), w = et(h, i.form);
3184
+ const { merged: h, report: g } = Qt(u, s), w = et(h, i.form);
3139
3185
  if (w !== c) {
3140
3186
  await pe(i.path, w);
3141
- const j = g.added.length ? `, added ${g.added.join(", ")}` : "";
3142
- console.log(`nimpress modules: ${t} schema upserted at ${i.path}${j}`);
3187
+ const P = g.added.length ? `, added ${g.added.join(", ")}` : "";
3188
+ console.log(`nimpress modules: ${t} schema upserted at ${i.path}${P}`);
3143
3189
  }
3144
- wn(kn(t, h, { sourceFile: o, sourceText: r, report: g }));
3190
+ $n(Sn(t, h, { sourceFile: o, sourceText: r, report: g }));
3145
3191
  }
3146
- const $n = /* @__PURE__ */ new Map();
3147
- async function $r(e, t, n, o) {
3192
+ const jn = /* @__PURE__ */ new Map();
3193
+ async function Sr(e, t, n, o) {
3148
3194
  let s;
3149
3195
  try {
3150
3196
  s = await ie(n, "utf-8");
3151
3197
  } catch {
3152
3198
  return;
3153
3199
  }
3154
- const r = Tn("sha1").update(s).digest("hex");
3155
- if ($n.get(n) === r) return;
3156
- $n.set(n, r);
3157
- const i = await Xt(n, o, t);
3158
- i && await Kt(e, t, i, n);
3200
+ const r = Fn("sha1").update(s).digest("hex");
3201
+ if (jn.get(n) === r) return;
3202
+ jn.set(n, r);
3203
+ const i = await Zt(n, o, t);
3204
+ i && await en(e, t, i, n);
3159
3205
  }
3160
3206
  async function di(e, t) {
3161
3207
  const n = nt(e);
@@ -3163,14 +3209,14 @@ async function di(e, t) {
3163
3209
  await pe(q(e, "schema.json"), et(t, "json"));
3164
3210
  return;
3165
3211
  }
3166
- const o = await ie(n.path, "utf-8"), s = ot(o, n.form), { merged: r } = Yt(t, s);
3212
+ const o = await ie(n.path, "utf-8"), s = ot(o, n.form), { merged: r } = Qt(t, s);
3167
3213
  await pe(n.path, et(r, n.form));
3168
3214
  }
3169
- function Rt(e) {
3170
- const t = zt(e);
3215
+ function Lt(e) {
3216
+ const t = Jt(e);
3171
3217
  return t === ".vue" ? "vue" : t === ".svelte" ? "svelte" : null;
3172
3218
  }
3173
- function xr(e, t, n) {
3219
+ function jr(e, t, n) {
3174
3220
  for (const [o, s] of Object.entries(t.modules.systems)) {
3175
3221
  if (!s.source) continue;
3176
3222
  const r = G(e, s.source);
@@ -3178,24 +3224,24 @@ function xr(e, t, n) {
3178
3224
  }
3179
3225
  return null;
3180
3226
  }
3181
- function Sr(e, t, n) {
3227
+ function Pr(e, t, n) {
3182
3228
  return e.find((o) => o.system === t && o.component === n);
3183
3229
  }
3184
- async function jr(e, t, n) {
3185
- const o = await Vt(e, t.contentDir), s = G(e, n);
3186
- if ((n.includes("/") || n.includes("\\")) && de(s)) {
3187
- const h = Rt(s);
3230
+ async function Ar(e, t, n) {
3231
+ const o = await Kt(e, t.contentDir), s = G(e, n);
3232
+ if ((n.includes("/") || n.includes("\\")) && fe(s)) {
3233
+ const h = Lt(s);
3188
3234
  if (!h)
3189
3235
  throw new Error(`[nimpress] modules: ${n} is not a .vue or .svelte component file`);
3190
- const g = Ce(s, zt(s)), w = xr(e, t, s);
3236
+ const g = Ce(s, Jt(s)), w = jr(e, t, s);
3191
3237
  if (!w)
3192
3238
  throw new Error(`[nimpress] modules: ${n} sits under no configured system source`);
3193
- const j = Sr(o, w, g);
3194
- if (!j)
3239
+ const P = Pr(o, w, g);
3240
+ if (!P)
3195
3241
  throw new Error(
3196
3242
  `[nimpress] modules: no component page found for ${w}/${g}, run nimpress modules create ${w} ${g} first`
3197
3243
  );
3198
- return { system: w, component: g, framework: h, componentFile: s, pageDir: Y(j.pageFile) };
3244
+ return { system: w, component: g, framework: h, componentFile: s, pageDir: Y(P.pageFile) };
3199
3245
  }
3200
3246
  const r = o.filter((h) => h.component === n);
3201
3247
  if (!r.length)
@@ -3204,12 +3250,12 @@ async function jr(e, t, n) {
3204
3250
  const h = r.map((g) => `${g.system}/${g.component}`).join(", ");
3205
3251
  throw new Error(`[nimpress] modules: ${n} is ambiguous across ${h}, pass the component file path`);
3206
3252
  }
3207
- const i = r[0], c = wt(e, t.modules, i.system, i.component, i.file);
3253
+ const i = r[0], c = $t(e, t.modules, i.system, i.component, i.file);
3208
3254
  if (!c)
3209
3255
  throw new Error(
3210
3256
  `[nimpress] modules: no source file found for ${i.system}/${i.component}, the schema upsert needs the component source`
3211
3257
  );
3212
- const u = Rt(c.componentFile) ?? c.systemConfig.framework;
3258
+ const u = Lt(c.componentFile) ?? c.systemConfig.framework;
3213
3259
  return {
3214
3260
  system: i.system,
3215
3261
  component: i.component,
@@ -3218,32 +3264,32 @@ async function jr(e, t, n) {
3218
3264
  pageDir: Y(i.pageFile)
3219
3265
  };
3220
3266
  }
3221
- async function Pr(e, t, n) {
3222
- const o = await jr(e, t, n), s = await Xt(o.componentFile, o.framework, o.component);
3267
+ async function Er(e, t, n) {
3268
+ const o = await Ar(e, t, n), s = await Zt(o.componentFile, o.framework, o.component);
3223
3269
  if (!s)
3224
3270
  throw new Error(`[nimpress] modules: schema parse produced nothing for ${o.component}`);
3225
- await Kt(o.pageDir, o.component, s);
3271
+ await en(o.pageDir, o.component, s);
3226
3272
  const r = nt(o.pageDir);
3227
3273
  return je(e, r?.path ?? q(o.pageDir, "schema.json"));
3228
3274
  }
3229
3275
  async function hi(e, t, n = {}) {
3230
3276
  if (n.ref)
3231
- return await Pr(e, t, n.ref), 1;
3232
- const o = await Vt(e, t.contentDir);
3277
+ return await Er(e, t, n.ref), 1;
3278
+ const o = await Kt(e, t.contentDir);
3233
3279
  let s = 0;
3234
3280
  for (const r of o) {
3235
3281
  if (n.system && r.system !== n.system) continue;
3236
- const i = wt(e, t.modules, r.system, r.component, r.file);
3282
+ const i = $t(e, t.modules, r.system, r.component, r.file);
3237
3283
  if (!i) {
3238
3284
  console.warn(`nimpress modules: no source for ${r.system}/${r.component}, skipped`);
3239
3285
  continue;
3240
3286
  }
3241
- const c = Rt(i.componentFile) ?? i.systemConfig.framework, u = await Xt(i.componentFile, c, r.component);
3242
- u && (await Kt(Y(r.pageFile), r.component, u), s++);
3287
+ const c = Lt(i.componentFile) ?? i.systemConfig.framework, u = await Zt(i.componentFile, c, r.component);
3288
+ u && (await en(Y(r.pageFile), r.component, u), s++);
3243
3289
  }
3244
3290
  return s;
3245
3291
  }
3246
- function Ar(e) {
3292
+ function Cr(e) {
3247
3293
  let t = e;
3248
3294
  for (let n = 0; n < 8; n++) {
3249
3295
  if (t.endsWith("/src")) return t;
@@ -3253,123 +3299,123 @@ function Ar(e) {
3253
3299
  }
3254
3300
  return null;
3255
3301
  }
3256
- function xn(e, t) {
3302
+ function Pn(e, t) {
3257
3303
  return !e.endsWith(".vue") && !e.endsWith(".svelte") ? t : [...t.matchAll(/<script[^>]*>([\s\S]*?)<\/script>/g)].map((n) => n[1]).join(`
3258
3304
  `);
3259
3305
  }
3260
- async function Er(e, t, n) {
3261
- const o = Ar(e), s = /* @__PURE__ */ new Set([G(t)]), r = [{ file: t, text: n, depth: 0 }];
3306
+ async function Or(e, t, n) {
3307
+ const o = Cr(e), s = /* @__PURE__ */ new Set([G(t)]), r = [{ file: t, text: n, depth: 0 }];
3262
3308
  let i = "";
3263
3309
  for (; r.length; ) {
3264
3310
  const c = r.shift();
3265
3311
  if (!c || c.depth >= 3) continue;
3266
- const u = xn(c.file, c.text);
3312
+ const u = Pn(c.file, c.text);
3267
3313
  for (const h of u.matchAll(/from\s+['"]([^'"]+)['"]/g)) {
3268
3314
  const g = h[1];
3269
3315
  let w = null;
3270
3316
  if (g.startsWith(".") ? w = G(Y(c.file), g) : g.startsWith("@/") && o && (w = G(o, g.slice(2))), !w || !ke(w)) continue;
3271
- const P = [w, `${w}.ts`, `${w}.vue`, q(w, "index.ts")].find((v) => Cr(v));
3272
- if (!P) continue;
3273
- const M = G(P);
3274
- if (s.has(M) || s.size > 50) continue;
3275
- s.add(M);
3276
- const d = await ie(P, "utf-8");
3277
- i += xn(P, d) + `
3278
- `, r.push({ file: P, text: d, depth: c.depth + 1 });
3317
+ const A = [w, `${w}.ts`, `${w}.vue`, q(w, "index.ts")].find((v) => Dr(v));
3318
+ if (!A) continue;
3319
+ const T = G(A);
3320
+ if (s.has(T) || s.size > 50) continue;
3321
+ s.add(T);
3322
+ const d = await ie(A, "utf-8");
3323
+ i += Pn(A, d) + `
3324
+ `, r.push({ file: A, text: d, depth: c.depth + 1 });
3279
3325
  }
3280
3326
  }
3281
3327
  return i;
3282
3328
  }
3283
- function Cr(e) {
3329
+ function Dr(e) {
3284
3330
  try {
3285
- return ht(e).isFile();
3331
+ return gt(e).isFile();
3286
3332
  } catch {
3287
3333
  return !1;
3288
3334
  }
3289
3335
  }
3290
- async function Or(e, t, n, o) {
3336
+ async function Tr(e, t, n, o) {
3291
3337
  const s = await ie(t, "utf-8");
3292
3338
  let r = "";
3293
3339
  for (const c of Le(e))
3294
3340
  c.endsWith(".ts") && (c.endsWith(".stories.ts") || c.endsWith(".story.ts") || (r += await ie(q(e, c), "utf-8"), r += `
3295
3341
  `));
3296
- r += await Er(e, t, s);
3297
- const i = n === "vue" ? fr(s, o, r) : dr(s, o, r);
3342
+ r += await Or(e, t, s);
3343
+ const i = n === "vue" ? hr(s, o, r) : gr(s, o, r);
3298
3344
  for (const c of i.props) {
3299
3345
  if (!c.format) {
3300
- const u = Jo(c);
3346
+ const u = Xo(c);
3301
3347
  u && (c.format = u);
3302
3348
  }
3303
- c.mock || (c.mock = Go(c.name, Vo(c)));
3349
+ c.mock || (c.mock = Yo(c.name, Ko(c)));
3304
3350
  }
3305
3351
  return i;
3306
3352
  }
3307
- async function Dr(e) {
3308
- const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), u = typeof s.file == "string" ? s.file : void 0, h = await _r(Y(o)), g = wt(t, n, i, c, u), w = [];
3353
+ async function Mr(e) {
3354
+ const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), u = typeof s.file == "string" ? s.file : void 0, h = await br(Y(o)), g = $t(t, n, i, c, u), w = [];
3309
3355
  if (r && g) {
3310
3356
  const x = g.componentFile.endsWith(".svelte") ? "svelte" : "vue";
3311
3357
  try {
3312
- await $r(Y(o), c, g.componentFile, x);
3313
- } catch (A) {
3314
- console.warn(`nimpress modules: ${i}/${c} schema upsert failed: ${String(A)}`);
3358
+ await Sr(Y(o), c, g.componentFile, x);
3359
+ } catch (E) {
3360
+ console.warn(`nimpress modules: ${i}/${c} schema upsert failed: ${String(E)}`);
3315
3361
  }
3316
3362
  }
3317
- let j;
3318
- const P = nt(Y(o));
3319
- if (P) {
3320
- w.push(P.path);
3363
+ let P;
3364
+ const A = nt(Y(o));
3365
+ if (A) {
3366
+ w.push(A.path);
3321
3367
  try {
3322
- j = ot(await ie(P.path, "utf-8"), P.form);
3368
+ P = ot(await ie(A.path, "utf-8"), A.form);
3323
3369
  } catch (x) {
3324
- console.warn(`nimpress modules: ${i}/${c} ${P.form} schema failed to parse: ${String(x)}`);
3370
+ console.warn(`nimpress modules: ${i}/${c} ${A.form} schema failed to parse: ${String(x)}`);
3325
3371
  }
3326
3372
  } else
3327
3373
  console.warn(
3328
3374
  `nimpress modules: ${i}/${c} has no schema file, controls stay empty, run nimpress modules update ${c}`
3329
3375
  );
3330
- let M, d;
3376
+ let T, d;
3331
3377
  if (g)
3332
- w.push(g.componentFile), d = je(t, g.claudeMdPath), de(g.claudeMdPath) && (M = await ie(g.claudeMdPath, "utf-8"), w.push(g.claudeMdPath));
3378
+ w.push(g.componentFile), d = je(t, g.claudeMdPath), fe(g.claudeMdPath) && (T = await ie(g.claudeMdPath, "utf-8"), w.push(g.claudeMdPath));
3333
3379
  else {
3334
3380
  const x = typeof s.package == "string" ? s.package : n.systems[i]?.package;
3335
3381
  if (x) {
3336
- const A = hr(t, x, c);
3337
- if (A) {
3338
- const I = A.replace(/[^/]+$/, "CLAUDE.md");
3339
- de(I) && (M = await ie(I, "utf-8"));
3382
+ const E = _r(t, x, c);
3383
+ if (E) {
3384
+ const I = E.replace(/[^/]+$/, "CLAUDE.md");
3385
+ fe(I) && (T = await ie(I, "utf-8"));
3340
3386
  }
3341
3387
  }
3342
3388
  }
3343
3389
  const v = s.schema && typeof s.schema == "object" && !Array.isArray(s.schema) ? s.schema : void 0;
3344
- v && (j = j ? Yt(v, j).merged : v);
3345
- const O = j ? Jt(c, j) : void 0, R = n.route.replace(/\/$/, "");
3390
+ v && (P = P ? Qt(v, P).merged : v);
3391
+ const D = P ? Xt(c, P) : void 0, R = n.route.replace(/\/$/, "");
3346
3392
  return {
3347
3393
  data: {
3348
3394
  system: i,
3349
3395
  component: c,
3350
3396
  package: typeof s.package == "string" ? s.package : void 0,
3351
3397
  version: typeof s.version == "string" ? s.version : void 0,
3352
- claudeMd: M,
3398
+ claudeMd: T,
3353
3399
  claudeMdPath: d,
3354
3400
  editable: r && !!g,
3355
3401
  harnessPath: `${R}/${encodeURIComponent(i)}/${encodeURIComponent(c)}/`,
3356
- schema: O,
3357
- schemaPath: P ? je(t, P.path) : void 0,
3402
+ schema: D,
3403
+ schemaPath: A ? je(t, A.path) : void 0,
3358
3404
  stories: h
3359
3405
  },
3360
3406
  watchFiles: w
3361
3407
  };
3362
3408
  }
3363
- function Un(e, t) {
3409
+ function Vn(e, t) {
3364
3410
  return G(e, t.paths.out);
3365
3411
  }
3366
- function Jn(e, t, ...n) {
3412
+ function Xn(e, t, ...n) {
3367
3413
  return G(e, t.paths.cache, ...n);
3368
3414
  }
3369
3415
  function gi(e, t) {
3370
3416
  return q(e, t.paths.guarded);
3371
3417
  }
3372
- function Mr(e) {
3418
+ function Nr(e) {
3373
3419
  const t = /* @__PURE__ */ new Map();
3374
3420
  for (const c of Object.values(e))
3375
3421
  c.type === "chunk" && t.set(c.fileName, c);
@@ -3392,12 +3438,12 @@ function Mr(e) {
3392
3438
  n.get(c) || i(c);
3393
3439
  return s;
3394
3440
  }
3395
- function Gn() {
3441
+ function Yn() {
3396
3442
  return {
3397
3443
  name: "nimpress:chunk-cycle-guard",
3398
3444
  apply: "build",
3399
3445
  generateBundle(e, t) {
3400
- const n = Mr(t);
3446
+ const n = Nr(t);
3401
3447
  if (!n.length) return;
3402
3448
  const o = n.map((s) => {
3403
3449
  const r = s.chunks.join(" -> "), i = s.modules.map((c) => ` ${c}`).join(`
@@ -3414,50 +3460,50 @@ A module shared across chunks statically imports a component that got its own ch
3414
3460
  }
3415
3461
  };
3416
3462
  }
3417
- function Zt(e, t) {
3463
+ function tn(e, t) {
3418
3464
  if (!t) return e;
3419
3465
  const n = { ...e };
3420
3466
  for (const [o, s] of Object.entries(t)) {
3421
3467
  if (s === void 0) continue;
3422
3468
  const r = n[o], i = (c) => typeof c == "object" && c !== null && !Array.isArray(c);
3423
- i(r) && i(s) ? n[o] = Zt(r, s) : n[o] = s;
3469
+ i(r) && i(s) ? n[o] = tn(r, s) : n[o] = s;
3424
3470
  }
3425
3471
  return n;
3426
3472
  }
3427
- function _i(e) {
3428
- const { cwd: t, command: n, resolved: o, htmlInput: s } = e, r = {
3473
+ async function _i(e) {
3474
+ const { cwd: t, command: n, resolved: o, htmlInput: s } = e, { svelte: r } = await import("@sveltejs/vite-plugin-svelte"), { default: i } = await import("@tailwindcss/vite"), c = {
3429
3475
  root: t,
3430
3476
  base: o.base,
3431
3477
  configFile: !1,
3432
3478
  publicDir: !1,
3433
3479
  appType: "custom",
3434
3480
  plugins: [
3435
- Ko({ compilerOptions: { runes: !0, dev: n === "serve" } }),
3436
- Zo(),
3437
- Ha({ ...o, modules: Object.values(o.modules.systems) }),
3438
- Gn()
3481
+ r({ compilerOptions: { runes: !0, dev: n === "serve" } }),
3482
+ i(),
3483
+ qa({ ...o, modules: Object.values(o.modules.systems) }),
3484
+ Yn()
3439
3485
  ],
3440
- cacheDir: Jn(t, o, "site"),
3486
+ cacheDir: Xn(t, o, "site"),
3441
3487
  build: {
3442
- outDir: Un(t, o),
3488
+ outDir: Vn(t, o),
3443
3489
  emptyOutDir: !0,
3444
3490
  target: "es2022",
3445
3491
  ...s ? { rollupOptions: { input: s } } : {}
3446
3492
  }
3447
3493
  };
3448
- return Zt(r, o.vite);
3494
+ return tn(c, o.vite);
3449
3495
  }
3450
- const Tr = 6161, Bt = "virtual:nimpress-harness/";
3451
- function Wt(e, t) {
3496
+ const Ir = 6161, Ht = "virtual:nimpress-harness/";
3497
+ function zt(e, t) {
3452
3498
  const n = e.systems[t]?.port;
3453
3499
  if (n) return n;
3454
3500
  const o = Object.keys(e.systems).sort();
3455
- return Tr + Math.max(0, o.indexOf(t));
3501
+ return Ir + Math.max(0, o.indexOf(t));
3456
3502
  }
3457
- function Vn(e, t) {
3458
- return `${Bt}${e}/${t}/entry`;
3503
+ function Kn(e, t) {
3504
+ return `${Ht}${e}/${t}/entry`;
3459
3505
  }
3460
- function Xn() {
3506
+ function Zn() {
3461
3507
  return `const params = new URLSearchParams(location.search)
3462
3508
  function parseParam(name) {
3463
3509
  const raw = params.get(name)
@@ -3629,7 +3675,7 @@ window.addEventListener('dblclick', (event) => {
3629
3675
  applyPan()
3630
3676
  })`;
3631
3677
  }
3632
- function Yn(e) {
3678
+ function Qn(e) {
3633
3679
  const t = e.named ? `mod[${JSON.stringify(e.component)}]` : "mod.default ?? mod";
3634
3680
  return `let ComponentRef = null
3635
3681
  async function ensureComponent() {
@@ -3640,7 +3686,7 @@ async function ensureComponent() {
3640
3686
  return ComponentRef
3641
3687
  }`;
3642
3688
  }
3643
- function Kn(e) {
3689
+ function eo(e) {
3644
3690
  return `const storyLoaders = {
3645
3691
  ${(e.storyFiles ?? []).map((n) => ` ${JSON.stringify(n.base)}: () => import(${JSON.stringify(n.path)})`).join(`,
3646
3692
  `)}
@@ -3648,21 +3694,21 @@ ${(e.storyFiles ?? []).map((n) => ` ${JSON.stringify(n.base)}: () => import(${J
3648
3694
  const activeLoader = storyLoaders[params.get('story') ?? '']
3649
3695
  const activeStoryDef = activeLoader ? (await activeLoader()).default : null`;
3650
3696
  }
3651
- function Zn(e) {
3697
+ function to(e) {
3652
3698
  return e ? `import harnessSetup from ${JSON.stringify(e)}` : "const harnessSetup = null";
3653
3699
  }
3654
- function Nr(e, t, n, o, s) {
3700
+ function Fr(e, t, n, o, s) {
3655
3701
  const r = t.map((c) => `import ${JSON.stringify(c)}`).join(`
3656
3702
  `), i = o ? `import HarnessOverride from ${JSON.stringify(o)}` : "const HarnessOverride = null";
3657
3703
  return `import { createApp, h } from 'vue'
3658
3704
  import { DefaultHarness, ComponentStory, createHarnessContext, HARNESS_KEY } from '@nimtech/nimpress/harness/vue'
3659
3705
  ${r}
3660
- ${Zn(n)}
3706
+ ${to(n)}
3661
3707
  ${i}
3662
3708
 
3663
- ${Xn()}
3664
- ${Kn(e)}
3665
- ${Yn(e)}
3709
+ ${Zn()}
3710
+ ${eo(e)}
3711
+ ${Qn(e)}
3666
3712
 
3667
3713
  const setupDef = typeof harnessSetup === 'function' ? await harnessSetup() : harnessSetup
3668
3714
  const Overlay = setupDef ? (setupDef.companion ?? null) : null
@@ -3745,18 +3791,18 @@ try {
3745
3791
  parent.postMessage({ type: 'nimpress:ready' }, '*')
3746
3792
  `;
3747
3793
  }
3748
- function Ir(e, t, n, o, s) {
3794
+ function Rr(e, t, n, o, s) {
3749
3795
  const r = t.map((c) => `import ${JSON.stringify(c)}`).join(`
3750
3796
  `), i = o ? `import HarnessOverride from ${JSON.stringify(o)}` : "const HarnessOverride = null";
3751
3797
  return `import { mount, createRawSnippet } from 'svelte'
3752
3798
  import { DefaultHarness, HarnessRoot, createHarnessContext } from '@nimtech/nimpress/harness/svelte'
3753
3799
  ${r}
3754
- ${Zn(n)}
3800
+ ${to(n)}
3755
3801
  ${i}
3756
3802
 
3757
- ${Xn()}
3758
- ${Kn(e)}
3759
- ${Yn(e)}
3803
+ ${Zn()}
3804
+ ${eo(e)}
3805
+ ${Qn(e)}
3760
3806
 
3761
3807
  if (typeof harnessSetup === 'function') await harnessSetup()
3762
3808
 
@@ -3812,27 +3858,27 @@ try {
3812
3858
  parent.postMessage({ type: 'nimpress:ready' }, '*')
3813
3859
  `;
3814
3860
  }
3815
- function Fr(e) {
3816
- if (!e.schemaFile || !de(e.schemaFile)) return {};
3861
+ function Br(e) {
3862
+ if (!e.schemaFile || !fe(e.schemaFile)) return {};
3817
3863
  let t;
3818
3864
  try {
3819
3865
  t = ot(Oe(e.schemaFile, "utf-8"), e.schemaFile.endsWith(".yml") ? "yml" : "json");
3820
3866
  } catch {
3821
3867
  return {};
3822
3868
  }
3823
- const n = Jt(e.component, t), o = {};
3869
+ const n = Xt(e.component, t), o = {};
3824
3870
  for (const s of n.props) {
3825
3871
  if (!s.required) continue;
3826
- const r = s.default !== void 0 ? s.default : Xo(s, 0);
3872
+ const r = s.default !== void 0 ? s.default : Zo(s, 0);
3827
3873
  r !== void 0 && (o[s.name] = r);
3828
3874
  }
3829
3875
  return o;
3830
3876
  }
3831
- function Rr(e, t, n, o, s) {
3832
- const r = Fr(t);
3833
- return e === "vue" ? Nr(t, n, o, s, r) : Ir(t, n, o, s, r);
3877
+ function Wr(e, t, n, o, s) {
3878
+ const r = Br(t);
3879
+ return e === "vue" ? Fr(t, n, o, s, r) : Rr(t, n, o, s, r);
3834
3880
  }
3835
- function Sn(e, t, n) {
3881
+ function An(e, t, n) {
3836
3882
  const o = n.map((s) => ` <link rel="stylesheet" href="${s}" />`).join(`
3837
3883
  `);
3838
3884
  return `<!doctype html>
@@ -3860,33 +3906,33 @@ ${o ? o + `
3860
3906
  </html>
3861
3907
  `;
3862
3908
  }
3863
- async function Br(e, t) {
3909
+ async function Lr(e, t) {
3864
3910
  if (t === "svelte") {
3865
3911
  const { svelte: c } = await import("@sveltejs/vite-plugin-svelte");
3866
3912
  return c();
3867
3913
  }
3868
- const n = Mn(q(e, "package.json"));
3914
+ const n = In(q(e, "package.json"));
3869
3915
  let o;
3870
3916
  try {
3871
3917
  o = n.resolve("@vitejs/plugin-vue");
3872
3918
  } catch {
3873
3919
  throw new Error("[nimpress] modules system with framework vue requires @vitejs/plugin-vue installed in the consumer");
3874
3920
  }
3875
- const s = await import(mn(o).href), i = [(s.default ?? s)()];
3921
+ const s = await import(hn(o).href), i = [(s.default ?? s)()];
3876
3922
  try {
3877
- const c = n.resolve("@vitejs/plugin-vue-jsx"), u = await import(mn(c).href), h = u.default ?? u;
3923
+ const c = n.resolve("@vitejs/plugin-vue-jsx"), u = await import(hn(c).href), h = u.default ?? u;
3878
3924
  i.push(h());
3879
3925
  } catch {
3880
3926
  }
3881
3927
  return i;
3882
3928
  }
3883
- function Wr(e, t, n, o) {
3929
+ function Hr(e, t, n, o) {
3884
3930
  const s = t.systems[n];
3885
3931
  if (!s) return [];
3886
3932
  const r = [];
3887
3933
  for (const i of o) {
3888
3934
  if (i.system !== n) continue;
3889
- const c = Lr(i.pageFile), u = nt(Y(i.pageFile))?.path ?? q(Y(i.pageFile), "schema.json"), h = s.source ? wt(e, t, n, i.component, i.file) : null;
3935
+ const c = zr(i.pageFile), u = nt(Y(i.pageFile))?.path ?? q(Y(i.pageFile), "schema.json"), h = s.source ? $t(e, t, n, i.component, i.file) : null;
3890
3936
  if (h) {
3891
3937
  r.push({ component: i.component, importSpec: h.componentFile, storyFiles: c, schemaFile: u });
3892
3938
  continue;
@@ -3900,7 +3946,7 @@ function Wr(e, t, n, o) {
3900
3946
  }
3901
3947
  return r;
3902
3948
  }
3903
- function Lr(e) {
3949
+ function zr(e) {
3904
3950
  const t = Y(e);
3905
3951
  let n;
3906
3952
  try {
@@ -3913,78 +3959,78 @@ function Lr(e) {
3913
3959
  path: q(t, o)
3914
3960
  }));
3915
3961
  }
3916
- function Hr(e, t) {
3962
+ function qr(e, t) {
3917
3963
  if (t.setup)
3918
3964
  return t.setup.startsWith(".") || ke(t.setup) ? G(e, t.setup) : t.setup;
3919
3965
  }
3920
- function zr(e, t) {
3966
+ function Ur(e, t) {
3921
3967
  if (t.harness)
3922
3968
  return t.harness.startsWith(".") || ke(t.harness) ? G(e, t.harness) : t.harness;
3923
3969
  }
3924
- function qr(e, t, n, o, s) {
3970
+ function Jr(e, t, n, o, s) {
3925
3971
  const r = (t.css ?? []).map(
3926
- (j) => j.startsWith(".") || ke(j) ? G(e, j) : j
3927
- ), i = Hr(e, t), c = zr(e, t), u = new Map(o.map((j) => [j.component, j])), h = "\0" + Bt, g = (j) => {
3928
- if (!j.startsWith(h)) return null;
3929
- const P = j.slice(h.length).split("/");
3930
- return P[0] === n && P[1] ? P[1] : null;
3931
- }, w = (j) => Rr(t.framework, j, r, i, c);
3972
+ (P) => P.startsWith(".") || ke(P) ? G(e, P) : P
3973
+ ), i = qr(e, t), c = Ur(e, t), u = new Map(o.map((P) => [P.component, P])), h = "\0" + Ht, g = (P) => {
3974
+ if (!P.startsWith(h)) return null;
3975
+ const A = P.slice(h.length).split("/");
3976
+ return A[0] === n && A[1] ? A[1] : null;
3977
+ }, w = (P) => Wr(t.framework, P, r, i, c);
3932
3978
  return {
3933
3979
  name: "nimpress:harness",
3934
- resolveId(j) {
3935
- return j.startsWith(h) ? j : j.startsWith(Bt) ? "\0" + j : null;
3980
+ resolveId(P) {
3981
+ return P.startsWith(h) ? P : P.startsWith(Ht) ? "\0" + P : null;
3936
3982
  },
3937
- load(j) {
3938
- const P = g(j);
3939
- if (!P) return null;
3940
- const M = u.get(P);
3941
- return M ? w(M) : null;
3983
+ load(P) {
3984
+ const A = g(P);
3985
+ if (!A) return null;
3986
+ const T = u.get(A);
3987
+ return T ? w(T) : null;
3942
3988
  },
3943
- configureServer(j) {
3944
- j.middlewares.use(async (P, M, d) => {
3945
- const v = P.url;
3989
+ configureServer(P) {
3990
+ P.middlewares.use(async (A, T, d) => {
3991
+ const v = A.url;
3946
3992
  if (!v) return d();
3947
- const O = v.split("?")[0];
3948
- if (!O.startsWith(s)) return d();
3949
- const R = O.slice(s.length).split("/").filter(Boolean), x = R[0];
3993
+ const D = v.split("?")[0];
3994
+ if (!D.startsWith(s)) return d();
3995
+ const R = D.slice(s.length).split("/").filter(Boolean), x = R[0];
3950
3996
  if (!x || !u.has(x)) return d();
3951
- const A = R.slice(1).join("/");
3952
- if (A === "" || A === "index.html") {
3997
+ const E = R.slice(1).join("/");
3998
+ if (E === "" || E === "index.html") {
3953
3999
  const I = ` <script type="module" src="${s}@vite/client"><\/script>
3954
- </head>`, H = Sn(x, "./entry.js", []).replace(" </head>", I);
3955
- M.statusCode = 200, M.setHeader("Content-Type", "text/html"), M.end(H);
4000
+ </head>`, H = An(x, "./entry.js", []).replace(" </head>", I);
4001
+ T.statusCode = 200, T.setHeader("Content-Type", "text/html"), T.end(H);
3956
4002
  return;
3957
4003
  }
3958
- if (A === "entry.js") {
3959
- const I = await j.transformRequest(Vn(n, x));
4004
+ if (E === "entry.js") {
4005
+ const I = await P.transformRequest(Kn(n, x));
3960
4006
  if (!I) return d();
3961
- M.statusCode = 200, M.setHeader("Content-Type", "application/javascript"), M.end(I.code);
4007
+ T.statusCode = 200, T.setHeader("Content-Type", "application/javascript"), T.end(I.code);
3962
4008
  return;
3963
4009
  }
3964
4010
  return d();
3965
4011
  });
3966
4012
  },
3967
- generateBundle(j, P) {
3968
- const M = (d, v, O) => {
4013
+ generateBundle(P, A) {
4014
+ const T = (d, v, D) => {
3969
4015
  if (v.has(d)) return;
3970
4016
  v.add(d);
3971
- const R = P[d];
4017
+ const R = A[d];
3972
4018
  if (!R || R.type !== "chunk") return;
3973
4019
  const x = R.viteMetadata;
3974
- for (const A of x?.importedCss ?? []) O.add(A);
3975
- for (const A of R.imports) M(A, v, O);
4020
+ for (const E of x?.importedCss ?? []) D.add(E);
4021
+ for (const E of R.imports) T(E, v, D);
3976
4022
  };
3977
- for (const d of Object.values(P)) {
4023
+ for (const d of Object.values(A)) {
3978
4024
  if (d.type !== "chunk" || !d.isEntry) continue;
3979
4025
  const v = u.get(d.name);
3980
4026
  if (!v) continue;
3981
- const O = /* @__PURE__ */ new Set();
3982
- M(d.fileName, /* @__PURE__ */ new Set(), O);
3983
- const R = [...O].map((x) => s + x);
4027
+ const D = /* @__PURE__ */ new Set();
4028
+ T(d.fileName, /* @__PURE__ */ new Set(), D);
4029
+ const R = [...D].map((x) => s + x);
3984
4030
  this.emitFile({
3985
4031
  type: "asset",
3986
4032
  fileName: `${v.component}/index.html`,
3987
- source: Sn(v.component, s + d.fileName, R)
4033
+ source: An(v.component, s + d.fileName, R)
3988
4034
  });
3989
4035
  }
3990
4036
  }
@@ -3993,50 +4039,51 @@ function qr(e, t, n, o, s) {
3993
4039
  async function yi(e, t, n, o) {
3994
4040
  const s = t.modules, r = s.systems[n];
3995
4041
  if (!r) throw new Error(`[nimpress] unknown module system: ${n}`);
3996
- const i = await Vt(e, t.contentDir), c = Wr(e, s, n, i);
4042
+ const i = await Kt(e, t.contentDir), c = Hr(e, s, n, i);
3997
4043
  c.length || console.warn(`[nimpress] modules: no component pages found for system ${n}`);
3998
- const u = await Br(e, r.framework), h = r.source ? G(e, r.source) : e, g = s.route.replace(/\/$/, ""), w = `${g}/${n}/`, j = o === "build" ? we(t.base, w) : w, P = c.filter((d) => ke(d.importSpec)).map((d) => d.importSpec).concat(c.flatMap((d) => (d.storyFiles ?? []).map((v) => v.path))), M = {
4044
+ const u = await Lr(e, r.framework), h = r.source ? G(e, r.source) : e, g = s.route.replace(/\/$/, ""), w = `${g}/${n}/`, P = o === "build" ? we(t.base, w) : w, A = c.filter((d) => ke(d.importSpec)).map((d) => d.importSpec).concat(c.flatMap((d) => (d.storyFiles ?? []).map((v) => v.path))), T = {
3999
4045
  root: e,
4000
4046
  configFile: !1,
4001
4047
  publicDir: !1,
4002
4048
  appType: "mpa",
4003
- cacheDir: Jn(e, t, "modules", n),
4004
- plugins: [qr(e, r, n, c, j), u, Gn()],
4049
+ cacheDir: Xn(e, t, "modules", n),
4050
+ plugins: [Jr(e, r, n, c, P), u, Yn()],
4005
4051
  resolve: r.framework === "vue" ? { alias: { vue: "vue/dist/vue.esm-bundler.js" } } : void 0,
4006
4052
  optimizeDeps: {
4007
- entries: P,
4053
+ entries: A,
4008
4054
  include: r.framework === "vue" ? ["vue"] : [],
4009
4055
  exclude: ["@nimtech/nimpress/harness/vue", "@nimtech/nimpress/harness/svelte"]
4010
4056
  },
4011
4057
  server: {
4012
4058
  host: "127.0.0.1",
4013
- port: Wt(s, n),
4059
+ port: zt(s, n),
4014
4060
  strictPort: !0,
4015
4061
  fs: { allow: [e, h] },
4016
4062
  hmr: {
4017
4063
  host: "127.0.0.1",
4018
- clientPort: Wt(s, n)
4064
+ clientPort: zt(s, n)
4019
4065
  }
4020
4066
  },
4021
4067
  build: {
4022
- outDir: q(Un(e, t), g.replace(/^\//, ""), n),
4068
+ outDir: q(Vn(e, t), g.replace(/^\//, ""), n),
4023
4069
  emptyOutDir: !0,
4024
4070
  target: "es2022",
4025
4071
  rollupOptions: {
4026
- input: Object.fromEntries(c.map((d) => [d.component, Vn(n, d.component)]))
4072
+ input: Object.fromEntries(c.map((d) => [d.component, Kn(n, d.component)]))
4027
4073
  }
4028
4074
  },
4029
- base: j
4075
+ base: P
4030
4076
  };
4031
- return Zt(M, t.vite);
4077
+ return tn(T, t.vite);
4032
4078
  }
4033
- function Ur(e, t = "virtual:nimpress/main") {
4079
+ function Gr(e, t = "virtual:nimpress/main") {
4080
+ const n = e.logo ? `
4081
+ <link rel="icon" href="${e.logo}" />` : "", o = JSON.stringify(vt(e).map(wt)), s = JSON.stringify(wt(e.theme));
4034
4082
  return `<!doctype html>
4035
4083
  <html lang="en">
4036
4084
  <head>
4037
4085
  <meta charset="UTF-8" />
4038
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />${e.logo ? `
4039
- <link rel="icon" href="${e.logo}" />` : ""}
4086
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />${n}
4040
4087
  <title>${e.title}</title>
4041
4088
  <script>
4042
4089
  try {
@@ -4046,6 +4093,9 @@ function Ur(e, t = "virtual:nimpress/main") {
4046
4093
  ? v
4047
4094
  : (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
4048
4095
  if (mode === 'dark') document.documentElement.classList.add('dark')
4096
+ const names = ${o}
4097
+ const chosen = localStorage.getItem('nimpress-site-theme')
4098
+ document.documentElement.dataset.npTheme = names.includes(chosen) ? chosen : ${s}
4049
4099
  } catch {}
4050
4100
  <\/script>
4051
4101
  </head>
@@ -4056,17 +4106,17 @@ function Ur(e, t = "virtual:nimpress/main") {
4056
4106
  </html>
4057
4107
  `;
4058
4108
  }
4059
- const it = "virtual:nimpress/manifest", ct = "virtual:nimpress/search", lt = "virtual:nimpress/pages", pt = "virtual:nimpress/bodies", Et = "virtual:nimpress/config", Ct = "virtual:nimpress/main", Ge = "virtual:nimpress/page-component/", We = "virtual:nimpress/page-body/", Ot = 20, Jr = "https://github.com/nimling/nimpress";
4109
+ const it = "virtual:nimpress/manifest", ct = "virtual:nimpress/search", lt = "virtual:nimpress/pages", pt = "virtual:nimpress/bodies", Dt = "virtual:nimpress/config", Tt = "virtual:nimpress/main", Ge = "virtual:nimpress/page-component/", We = "virtual:nimpress/page-body/", Mt = 20, Vr = "https://github.com/nimling/nimpress";
4060
4110
  function ye(e) {
4061
4111
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
4062
4112
  }
4063
- function Gr(e) {
4113
+ function Xr(e) {
4064
4114
  return `<![CDATA[${e.replace(/\]\]>/g, "]]]]><![CDATA[>")}]]>`;
4065
4115
  }
4066
- function jn(e) {
4116
+ function En(e) {
4067
4117
  return e === 0 ? "rss.xml" : `rss-${e + 1}.xml`;
4068
4118
  }
4069
- const Dt = [
4119
+ const Nt = [
4070
4120
  "Google-Extended",
4071
4121
  "Applebot-Extended",
4072
4122
  "OAI-SearchBot",
@@ -4104,15 +4154,15 @@ const Dt = [
4104
4154
  "DotBot",
4105
4155
  "MJ12bot"
4106
4156
  ];
4107
- function Vr(e) {
4157
+ function Yr(e) {
4108
4158
  return `<script type="application/ld+json">${(typeof e == "string" ? e : JSON.stringify(e)).replace(/</g, "\\u003c")}<\/script>`;
4109
4159
  }
4110
- const Mt = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidden" || e.visibility === "dev-only", ut = (e) => e.visibility === "dev-only", Xr = {
4160
+ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidden" || e.visibility === "dev-only", ut = (e) => e.visibility === "dev-only", Kr = {
4111
4161
  milestone: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" x2="4" y1="22" y2="15"/></svg>',
4112
4162
  epic: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>',
4113
4163
  feature: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/></svg>',
4114
4164
  bug: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>'
4115
- }, Yr = m.object({
4165
+ }, Zr = m.object({
4116
4166
  title: m.string().optional(),
4117
4167
  description: m.string().optional(),
4118
4168
  type: m.string().optional(),
@@ -4121,7 +4171,7 @@ const Mt = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4121
4171
  url: m.string().optional(),
4122
4172
  siteName: m.string().optional(),
4123
4173
  locale: m.string().optional()
4124
- }).passthrough(), Kr = m.object({
4174
+ }).passthrough(), Qr = m.object({
4125
4175
  card: m.string().optional(),
4126
4176
  site: m.string().optional(),
4127
4177
  creator: m.string().optional(),
@@ -4129,7 +4179,7 @@ const Mt = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4129
4179
  description: m.string().optional(),
4130
4180
  image: m.string().optional(),
4131
4181
  imageAlt: m.string().optional()
4132
- }).passthrough(), Zr = m.object({
4182
+ }).passthrough(), ea = m.object({
4133
4183
  override: m.boolean().optional(),
4134
4184
  ai: m.boolean().optional(),
4135
4185
  description: m.string().optional(),
@@ -4138,10 +4188,10 @@ const Mt = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4138
4188
  keywords: m.union([m.string(), m.array(m.string())]).optional(),
4139
4189
  author: m.string().optional(),
4140
4190
  themeColor: m.string().optional(),
4141
- og: Yr.optional(),
4142
- twitter: Kr.optional(),
4191
+ og: Zr.optional(),
4192
+ twitter: Qr.optional(),
4143
4193
  jsonLd: m.unknown().optional()
4144
- }).passthrough(), Qn = m.object({
4194
+ }).passthrough(), no = m.object({
4145
4195
  title: m.string().optional(),
4146
4196
  slug: m.string().optional(),
4147
4197
  type: m.string().optional(),
@@ -4171,15 +4221,15 @@ const Mt = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4171
4221
  subscribe: m.boolean().optional(),
4172
4222
  feedback: m.boolean().optional(),
4173
4223
  styles: m.array(m.string()).optional(),
4174
- meta: Zr.optional(),
4224
+ meta: ea.optional(),
4175
4225
  data: m.record(m.unknown()).optional()
4176
- }).passthrough(), eo = /* @__PURE__ */ new Set(["doc", "openapi", "changelog", "hero", "fullpage", "404", "section", "tags", "glossary", "team", "pricing", "roadmap", "dbml", "milestone", "epic", "feature", "bug", "component"]), Ne = /* @__PURE__ */ new Map();
4177
- function Qr(e, t) {
4226
+ }).passthrough(), oo = /* @__PURE__ */ new Set(["doc", "openapi", "changelog", "hero", "fullpage", "404", "section", "tags", "glossary", "team", "pricing", "roadmap", "dbml", "milestone", "epic", "feature", "bug", "component"]), Ne = /* @__PURE__ */ new Map();
4227
+ function ta(e, t) {
4178
4228
  Ne.clear();
4179
4229
  for (const [n, o] of Object.entries(t)) {
4180
4230
  const s = G(e, o), r = s.replace(/\.svelte$/, ".schema.json");
4181
4231
  let i;
4182
- if (r !== s && de(r))
4232
+ if (r !== s && fe(r))
4183
4233
  try {
4184
4234
  i = JSON.parse(Oe(r, "utf-8"));
4185
4235
  } catch {
@@ -4188,30 +4238,30 @@ function Qr(e, t) {
4188
4238
  Ne.set(n, { file: o, schema: i });
4189
4239
  }
4190
4240
  }
4191
- function ea(e) {
4241
+ function na(e) {
4192
4242
  return Array.isArray(e) ? "array" : e === null ? "null" : typeof e;
4193
4243
  }
4194
- function ta(e, t) {
4244
+ function oa(e, t) {
4195
4245
  const n = Ne.get(e)?.schema;
4196
4246
  if (!n) return [];
4197
4247
  const o = [];
4198
4248
  for (const s of n.required ?? [])
4199
4249
  t[s] === void 0 && o.push(`type ${e} requires data.${s}`);
4200
4250
  for (const [s, r] of Object.entries(n.properties ?? {}))
4201
- t[s] !== void 0 && r.type && ea(t[s]) !== r.type && o.push(`type ${e} expects data.${s} to be ${r.type}`);
4251
+ t[s] !== void 0 && r.type && na(t[s]) !== r.type && o.push(`type ${e} expects data.${s} to be ${r.type}`);
4202
4252
  return o;
4203
4253
  }
4204
- function to(e, t = "x") {
4254
+ function so(e, t = "x") {
4205
4255
  const n = [], s = (typeof e == "object" && e !== null ? Object.keys(e) : []).find((h) => h.toLowerCase() === "notoc");
4206
4256
  s && n.push(`${s}: write hide: [toc], the hide list carries every element a page drops`);
4207
- const r = Qn.safeParse(e);
4257
+ const r = no.safeParse(e);
4208
4258
  if (!r.success) {
4209
4259
  for (const h of r.error.errors)
4210
4260
  n.push(`${h.path.join(".") || "frontmatter"}: ${h.message}`);
4211
4261
  return n;
4212
4262
  }
4213
4263
  const i = r.data;
4214
- i.type && !eo.has(i.type) && !Ne.has(i.type) && n.push(`type: ${i.type} is not a page type; add it under pageTypes in the config`);
4264
+ i.type && !oo.has(i.type) && !Ne.has(i.type) && n.push(`type: ${i.type} is not a page type; add it under pageTypes in the config`);
4215
4265
  const c = i.data ?? {};
4216
4266
  if (i.link)
4217
4267
  return !i.title && !i.sidebar?.name && n.push("a link page needs a title or a sidebar.name for its label"), /^[a-z][a-z0-9+.-]*:\/\/|^mailto:|^tel:/i.test(i.link) || n.push("link: must be an absolute url"), t.trim() !== "" && n.push("a link page carries no body, the entry opens link instead of a page"), n;
@@ -4222,7 +4272,7 @@ function to(e, t = "x") {
4222
4272
  const h = c.title === void 0 ? "" : String(c.title);
4223
4273
  h.trim() || n.push("changelog requires data.title"), h.length > 48 && n.push("changelog data.title exceeds 48 characters"), h.includes(",") && n.push("changelog data.title must not contain a comma"), c.description !== void 0 && String(c.description).length > 160 && n.push("changelog data.description exceeds 160 characters");
4224
4274
  }
4225
- if ((i.type === "milestone" || i.type === "epic" || i.type === "feature" || i.type === "bug") && (i.description || n.push(`type ${i.type} requires a description`), (c.date === void 0 || Number.isNaN(new Date(String(c.date)).getTime())) && n.push(`type ${i.type} requires a valid data.date`)), i.type && Ne.has(i.type) && n.push(...ta(i.type, c)), i.type === "team") {
4275
+ if ((i.type === "milestone" || i.type === "epic" || i.type === "feature" || i.type === "bug") && (i.description || n.push(`type ${i.type} requires a description`), (c.date === void 0 || Number.isNaN(new Date(String(c.date)).getTime())) && n.push(`type ${i.type} requires a valid data.date`)), i.type && Ne.has(i.type) && n.push(...oa(i.type, c)), i.type === "team") {
4226
4276
  const h = Array.isArray(c.members) ? c.members : [];
4227
4277
  h.length === 0 && n.push("type team requires data.members with at least one member"), h.forEach((g, w) => {
4228
4278
  (typeof g?.name != "string" || !g.name.trim()) && n.push(`type team member ${w + 1} needs a name`);
@@ -4236,7 +4286,7 @@ function to(e, t = "x") {
4236
4286
  }
4237
4287
  return i.type === "component" && ((c.system === void 0 || String(c.system).trim() === "") && n.push("type component requires data.system"), (c.component === void 0 || String(c.component).trim() === "") && n.push("type component requires data.component")), n;
4238
4288
  }
4239
- function na(e, t) {
4289
+ function sa(e, t) {
4240
4290
  const n = (u) => {
4241
4291
  const h = String(u ?? "").replace(/^v/i, "").replace(/\+.*$/, ""), g = h.indexOf("-");
4242
4292
  return {
@@ -4245,15 +4295,15 @@ function na(e, t) {
4245
4295
  };
4246
4296
  }, o = (u, h) => {
4247
4297
  const g = u.match(/\d+|\D+/g) ?? [], w = h.match(/\d+|\D+/g) ?? [];
4248
- for (let j = 0; j < Math.max(g.length, w.length); j++) {
4249
- const P = g[j], M = w[j];
4250
- if (P === void 0) return -1;
4251
- if (M === void 0) return 1;
4252
- if (/^\d+$/.test(P) && /^\d+$/.test(M)) {
4253
- const d = parseInt(P, 10) - parseInt(M, 10);
4298
+ for (let P = 0; P < Math.max(g.length, w.length); P++) {
4299
+ const A = g[P], T = w[P];
4300
+ if (A === void 0) return -1;
4301
+ if (T === void 0) return 1;
4302
+ if (/^\d+$/.test(A) && /^\d+$/.test(T)) {
4303
+ const d = parseInt(A, 10) - parseInt(T, 10);
4254
4304
  if (d !== 0) return d;
4255
- } else if (P !== M)
4256
- return P < M ? -1 : 1;
4305
+ } else if (A !== T)
4306
+ return A < T ? -1 : 1;
4257
4307
  }
4258
4308
  return 0;
4259
4309
  }, s = n(e), r = n(t);
@@ -4274,12 +4324,12 @@ function na(e, t) {
4274
4324
  }
4275
4325
  return 0;
4276
4326
  }
4277
- function oa(e, t) {
4327
+ function ra(e, t) {
4278
4328
  const n = je(e, t).split(xe).join("/");
4279
4329
  if (!(!n || n.startsWith("..") || ke(n)))
4280
4330
  return `/${n}`;
4281
4331
  }
4282
- function sa(e, t) {
4332
+ function aa(e, t) {
4283
4333
  const n = je(e, t).split(xe).join("/");
4284
4334
  if (n.startsWith("..") || ke(n))
4285
4335
  throw new Error(
@@ -4290,22 +4340,22 @@ Check the working directory you run vite from and the contentDir option.`
4290
4340
  );
4291
4341
  return n.replace(/\.md$/, "").replace(/\/index$/, "").replace(/^index$/, "");
4292
4342
  }
4293
- function ra(e) {
4343
+ function ia(e) {
4294
4344
  const t = e.lastIndexOf("/");
4295
4345
  return t >= 0 ? e.slice(0, t) : "";
4296
4346
  }
4297
- function aa(e) {
4347
+ function ca(e) {
4298
4348
  return e ? "/" + e : "/";
4299
4349
  }
4300
- function Pn(e) {
4350
+ function Cn(e) {
4301
4351
  if (!e) return "/";
4302
4352
  let t = e.startsWith("/") ? e : "/" + e;
4303
4353
  return t.length > 1 && t.endsWith("/") && (t = t.slice(0, -1)), t;
4304
4354
  }
4305
- async function Qt(e, t = []) {
4355
+ async function nn(e, t = []) {
4306
4356
  let n;
4307
4357
  try {
4308
- n = await Ht(e, { withFileTypes: !0 });
4358
+ n = await Ut(e, { withFileTypes: !0 });
4309
4359
  } catch {
4310
4360
  return t;
4311
4361
  }
@@ -4313,7 +4363,7 @@ async function Qt(e, t = []) {
4313
4363
  const s = q(e, o.name);
4314
4364
  if (o.isDirectory()) {
4315
4365
  if (o.name.startsWith(".") || o.name === "node_modules") continue;
4316
- await Qt(s, t);
4366
+ await nn(s, t);
4317
4367
  } else o.isFile() && o.name.endsWith(".md") && t.push(s);
4318
4368
  }
4319
4369
  return t;
@@ -4321,10 +4371,10 @@ async function Qt(e, t = []) {
4321
4371
  function Ie(e) {
4322
4372
  return e.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
4323
4373
  }
4324
- function Tt(e) {
4374
+ function Ft(e) {
4325
4375
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
4326
4376
  }
4327
- const An = {
4377
+ const On = {
4328
4378
  ctrl: "Ctrl",
4329
4379
  control: "Ctrl",
4330
4380
  alt: "Alt",
@@ -4357,11 +4407,11 @@ const An = {
4357
4407
  plus: "+",
4358
4408
  minus: "−"
4359
4409
  };
4360
- function ia(e) {
4410
+ function la(e) {
4361
4411
  const t = e.trim().toLowerCase();
4362
- return An[t] ? An[t] : t.length === 1 ? t.toUpperCase() : t.charAt(0).toUpperCase() + t.slice(1);
4412
+ return On[t] ? On[t] : t.length === 1 ? t.toUpperCase() : t.charAt(0).toUpperCase() + t.slice(1);
4363
4413
  }
4364
- const ca = (e, t) => {
4414
+ const pa = (e, t) => {
4365
4415
  const n = e.src, o = e.pos;
4366
4416
  if (n.charCodeAt(o) !== 94 || n.charCodeAt(o + 1) !== 94) return !1;
4367
4417
  const s = n.indexOf("^^", o + 2);
@@ -4374,7 +4424,7 @@ const ca = (e, t) => {
4374
4424
  i.content = r, e.push("ins_close", "ins", -1);
4375
4425
  }
4376
4426
  return e.pos = s + 2, !0;
4377
- }, la = (e, t) => {
4427
+ }, ua = (e, t) => {
4378
4428
  const n = e.src, o = e.pos;
4379
4429
  if (n.charCodeAt(o) !== 43 || n.charCodeAt(o + 1) !== 43) return !1;
4380
4430
  const s = n.indexOf("++", o + 2);
@@ -4385,34 +4435,34 @@ const ca = (e, t) => {
4385
4435
  if (i.length === 0) return !1;
4386
4436
  if (!t) {
4387
4437
  const c = e.push("html_inline", "", 0);
4388
- c.content = `<span class="np-keys">${i.map((u) => `<kbd class="np-key">${e.md.utils.escapeHtml(ia(u))}</kbd>`).join('<span class="np-key-join">+</span>')}</span>`;
4438
+ c.content = `<span class="np-keys">${i.map((u) => `<kbd class="np-key">${e.md.utils.escapeHtml(la(u))}</kbd>`).join('<span class="np-key-join">+</span>')}</span>`;
4389
4439
  }
4390
4440
  return e.pos = s + 2, !0;
4391
- }, pa = (e) => {
4441
+ }, ma = (e) => {
4392
4442
  const t = e.tokens;
4393
4443
  for (let n = 0; n + 2 < t.length; n++) {
4394
4444
  if (t[n].type !== "paragraph_open" || t[n + 1].type !== "inline" || t[n + 2].type !== "paragraph_close") continue;
4395
4445
  const s = (t[n + 1].children ?? []).filter((r) => !(r.type === "text" && r.content.trim() === ""));
4396
4446
  s.length !== 1 || s[0].type !== "image" || !s[0].attrGet("title") || (s[0].meta = { ...s[0].meta ?? {}, figure: !0 }, t[n].tag = "figure", t[n + 2].tag = "figure", t[n].attrJoin("class", "np-figure"));
4397
4447
  }
4398
- }, ua = /^:([a-z0-9]+(?:-[a-z0-9]+)*):/, ma = Mn(import.meta.url);
4399
- function fa() {
4448
+ }, fa = /^:([a-z0-9]+(?:-[a-z0-9]+)*):/, da = In(import.meta.url);
4449
+ function ha() {
4400
4450
  try {
4401
- return Y(ma.resolve("lucide-static/icons/a-arrow-down.svg"));
4451
+ return Y(da.resolve("lucide-static/icons/a-arrow-down.svg"));
4402
4452
  } catch {
4403
4453
  return G(process.cwd(), "node_modules", "lucide-static", "icons");
4404
4454
  }
4405
4455
  }
4406
- const En = /* @__PURE__ */ new Map();
4407
- function no(e, t) {
4408
- const n = `${t ?? ""}:${e}`, o = En.get(n);
4456
+ const Dn = /* @__PURE__ */ new Map();
4457
+ function ro(e, t) {
4458
+ const n = `${t ?? ""}:${e}`, o = Dn.get(n);
4409
4459
  if (o !== void 0) return o;
4410
4460
  let s = null;
4411
- e.startsWith("lucide-") ? s = q(fa(), `${e.slice(7)}.svg`) : t && (s = G(process.cwd(), t, `${e}.svg`));
4461
+ e.startsWith("lucide-") ? s = q(ha(), `${e.slice(7)}.svg`) : t && (s = G(process.cwd(), t, `${e}.svg`));
4412
4462
  let r = null;
4413
- return s && de(s) && (r = Oe(s, "utf8").replace(/<\?xml[^>]*>/g, "").replace(/<!--[\s\S]*?-->/g, "").replace(/\s+(width|height)="[^"]*"/g, "").replace(/<svg/, '<svg aria-hidden="true" focusable="false"').trim()), En.set(n, r), r;
4463
+ return s && fe(s) && (r = Oe(s, "utf8").replace(/<\?xml[^>]*>/g, "").replace(/<!--[\s\S]*?-->/g, "").replace(/\s+(width|height)="[^"]*"/g, "").replace(/<svg/, '<svg aria-hidden="true" focusable="false"').trim()), Dn.set(n, r), r;
4414
4464
  }
4415
- function da(e) {
4465
+ function ga(e) {
4416
4466
  const t = [], n = [];
4417
4467
  for (const o of e.trim().split(/\s+/).filter(Boolean))
4418
4468
  if (o.startsWith(".")) n.push(o.slice(1));
@@ -4423,29 +4473,29 @@ function da(e) {
4423
4473
  }
4424
4474
  return n.length && t.push(["class", n.join(" ")]), t;
4425
4475
  }
4426
- function ha(e) {
4476
+ function _a(e) {
4427
4477
  return (t, n) => {
4428
4478
  if (t.src.charCodeAt(t.pos) !== 58) return !1;
4429
- const o = ua.exec(t.src.slice(t.pos));
4479
+ const o = fa.exec(t.src.slice(t.pos));
4430
4480
  if (!o) return !1;
4431
- const s = o[1], r = no(s, e);
4481
+ const s = o[1], r = ro(s, e);
4432
4482
  if (!r)
4433
4483
  return s.startsWith("lucide-") && console.warn(`[nimpress] icon :${s}: is not a lucide icon; the shortcode stays as text`), !1;
4434
4484
  let i = t.pos + o[0].length, c = [];
4435
4485
  const u = t.src.slice(i), h = /^\{([^}\n]*)\}/.exec(u);
4436
- if (h && (c = da(h[1]), i += h[0].length), !n) {
4486
+ if (h && (c = ga(h[1]), i += h[0].length), !n) {
4437
4487
  const g = t.push("np_icon", "span", 0);
4438
4488
  g.content = r, g.attrSet("data-icon", s), g.attrJoin("class", "np-icon");
4439
- for (const [w, j] of c)
4440
- w === "class" ? g.attrJoin("class", j) : g.attrSet(w, j);
4489
+ for (const [w, P] of c)
4490
+ w === "class" ? g.attrJoin("class", P) : g.attrSet(w, P);
4441
4491
  }
4442
4492
  return t.pos = i, !0;
4443
4493
  };
4444
4494
  }
4445
- function Cn(e) {
4495
+ function Tn(e) {
4446
4496
  return Buffer.from(e, "utf-8").toString("base64");
4447
4497
  }
4448
- const ga = (e, t, n, o) => {
4498
+ const ya = (e, t, n, o) => {
4449
4499
  const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
4450
4500
  if (e.src.slice(s, s + 2) !== "$$") return !1;
4451
4501
  const i = e.src.slice(s + 2, r);
@@ -4459,23 +4509,23 @@ const ga = (e, t, n, o) => {
4459
4509
  i.trim() && u.push(i);
4460
4510
  let h = !1;
4461
4511
  for (; c < n; c++) {
4462
- const w = e.bMarks[c] + e.tShift[c], j = e.eMarks[c], P = e.src.slice(w, j);
4463
- if (P.trim() === "$$") {
4512
+ const w = e.bMarks[c] + e.tShift[c], P = e.eMarks[c], A = e.src.slice(w, P);
4513
+ if (A.trim() === "$$") {
4464
4514
  h = !0;
4465
4515
  break;
4466
4516
  }
4467
- if (P.trim().endsWith("$$")) {
4468
- u.push(P.trim().slice(0, -2)), h = !0;
4517
+ if (A.trim().endsWith("$$")) {
4518
+ u.push(A.trim().slice(0, -2)), h = !0;
4469
4519
  break;
4470
4520
  }
4471
- u.push(P);
4521
+ u.push(A);
4472
4522
  }
4473
4523
  if (!h) return !1;
4474
4524
  if (o) return !0;
4475
4525
  const g = e.push("np_math_block", "div", 0);
4476
4526
  return g.content = u.join(`
4477
4527
  `).trim(), g.map = [t, c + 1], e.line = c + 1, !0;
4478
- }, _a = (e, t) => {
4528
+ }, ba = (e, t) => {
4479
4529
  const n = e.src, o = e.pos;
4480
4530
  if (n.charCodeAt(o) !== 36 || n.charCodeAt(o + 1) === 36 || o > 0 && n.charCodeAt(o - 1) === 92) return !1;
4481
4531
  const s = n.charCodeAt(o + 1);
@@ -4500,76 +4550,76 @@ const ga = (e, t, n, o) => {
4500
4550
  u.content = i;
4501
4551
  }
4502
4552
  return e.pos = r + 1, !0;
4503
- }, ya = /^\*\[([^\]\n]+)\]:[ \t]*(.+?)[ \t]*$/, ba = (e, t, n, o) => {
4553
+ }, wa = /^\*\[([^\]\n]+)\]:[ \t]*(.+?)[ \t]*$/, va = (e, t, n, o) => {
4504
4554
  const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
4505
4555
  if (e.src.charCodeAt(s) !== 42 || e.src.charCodeAt(s + 1) !== 91) return !1;
4506
- const i = ya.exec(e.src.slice(s, r));
4556
+ const i = wa.exec(e.src.slice(s, r));
4507
4557
  if (!i) return !1;
4508
4558
  if (o) return !0;
4509
4559
  const c = e.env;
4510
4560
  return c.abbr = { ...c.abbr ?? {}, [i[1].trim()]: i[2].trim() }, e.line = t + 1, !0;
4511
4561
  };
4512
- function wa(e) {
4562
+ function ka(e) {
4513
4563
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4514
4564
  }
4515
- function va(e) {
4565
+ function $a(e) {
4516
4566
  return (t) => {
4517
4567
  const n = t.env, o = /* @__PURE__ */ new Map();
4518
4568
  if (!n.glossaryPage) for (const u of e) o.set(u.term, u.description);
4519
4569
  for (const [u, h] of Object.entries(n.abbr ?? {})) o.set(u, h);
4520
4570
  if (o.size === 0) return;
4521
- const s = Array.from(o.entries()).sort((u, h) => h[0].length - u[0].length), r = new Map(s.map(([u]) => [u.toLowerCase(), u])), i = new RegExp(`(^|[^\\p{L}\\p{N}_])(${s.map(([u]) => wa(u)).join("|")})(?![\\p{L}\\p{N}_])`, "iu"), c = t.tokens;
4571
+ const s = Array.from(o.entries()).sort((u, h) => h[0].length - u[0].length), r = new Map(s.map(([u]) => [u.toLowerCase(), u])), i = new RegExp(`(^|[^\\p{L}\\p{N}_])(${s.map(([u]) => ka(u)).join("|")})(?![\\p{L}\\p{N}_])`, "iu"), c = t.tokens;
4522
4572
  for (let u = 0; u < c.length; u++) {
4523
4573
  const h = c[u];
4524
4574
  if (h.type !== "inline" || !h.children || c[u - 1]?.type === "heading_open") continue;
4525
4575
  const g = /* @__PURE__ */ new Set();
4526
4576
  let w = 0;
4527
- const j = [];
4528
- for (const P of h.children) {
4529
- if (P.type === "link_open" && (w += 1), P.type === "link_close" && (w -= 1), P.type !== "text" || w > 0) {
4530
- j.push(P);
4577
+ const P = [];
4578
+ for (const A of h.children) {
4579
+ if (A.type === "link_open" && (w += 1), A.type === "link_close" && (w -= 1), A.type !== "text" || w > 0) {
4580
+ P.push(A);
4531
4581
  continue;
4532
4582
  }
4533
- let M = P.content;
4534
- for (; M.length; ) {
4535
- const d = i.exec(M);
4583
+ let T = A.content;
4584
+ for (; T.length; ) {
4585
+ const d = i.exec(T);
4536
4586
  if (!d) break;
4537
- const v = d[2], O = r.get(v.toLowerCase()) ?? v;
4538
- if (O === O.toUpperCase() && O.length > 1 && v !== O) {
4587
+ const v = d[2], D = r.get(v.toLowerCase()) ?? v;
4588
+ if (D === D.toUpperCase() && D.length > 1 && v !== D) {
4539
4589
  const H = new t.Token("text", "", 0);
4540
- H.content = M.slice(0, d.index + d[1].length + v.length), j.push(H), M = M.slice(d.index + d[1].length + v.length);
4590
+ H.content = T.slice(0, d.index + d[1].length + v.length), P.push(H), T = T.slice(d.index + d[1].length + v.length);
4541
4591
  continue;
4542
4592
  }
4543
4593
  const x = d.index + d[1].length;
4544
- if (g.has(O)) {
4594
+ if (g.has(D)) {
4545
4595
  const H = new t.Token("text", "", 0);
4546
- H.content = M.slice(0, x + v.length), j.push(H), M = M.slice(x + v.length);
4596
+ H.content = T.slice(0, x + v.length), P.push(H), T = T.slice(x + v.length);
4547
4597
  continue;
4548
4598
  }
4549
- if (g.add(O), x > 0) {
4599
+ if (g.add(D), x > 0) {
4550
4600
  const H = new t.Token("text", "", 0);
4551
- H.content = M.slice(0, x), j.push(H);
4601
+ H.content = T.slice(0, x), P.push(H);
4552
4602
  }
4553
- const A = new t.Token("abbr_open", "abbr", 1);
4554
- A.attrSet("class", "np-abbr np-tip"), A.attrSet("aria-label", o.get(O) ?? ""), j.push(A);
4603
+ const E = new t.Token("abbr_open", "abbr", 1);
4604
+ E.attrSet("class", "np-abbr np-tip"), E.attrSet("aria-label", o.get(D) ?? ""), P.push(E);
4555
4605
  const I = new t.Token("text", "", 0);
4556
- I.content = v, j.push(I), j.push(new t.Token("abbr_close", "abbr", -1)), M = M.slice(x + v.length);
4606
+ I.content = v, P.push(I), P.push(new t.Token("abbr_close", "abbr", -1)), T = T.slice(x + v.length);
4557
4607
  }
4558
- if (M.length) {
4608
+ if (T.length) {
4559
4609
  const d = new t.Token("text", "", 0);
4560
- d.content = M, j.push(d);
4610
+ d.content = T, P.push(d);
4561
4611
  }
4562
4612
  }
4563
- h.children = j;
4613
+ h.children = P;
4564
4614
  }
4565
4615
  };
4566
4616
  }
4567
- const ka = (e) => {
4617
+ const xa = (e) => {
4568
4618
  if (!e.env.glossaryPage) return;
4569
4619
  const n = e.tokens;
4570
4620
  for (let o = 0; o + 1 < n.length; o++)
4571
4621
  n[o].type !== "dt_open" || n[o + 1].type !== "inline" || (n[o].attrSet("id", `term-${Ie(n[o + 1].content)}`), n[o].attrJoin("class", "np-glossary-term"));
4572
- }, $a = (e) => {
4622
+ }, Sa = (e) => {
4573
4623
  const t = e.tokens, n = /* @__PURE__ */ new Map();
4574
4624
  for (let o = 0; o < t.length; o++) {
4575
4625
  if (t[o].type !== "footnote_open") continue;
@@ -4586,7 +4636,7 @@ const ka = (e) => {
4586
4636
  r && (s.meta = { ...s.meta, tip: r });
4587
4637
  }
4588
4638
  };
4589
- function xa(e, t) {
4639
+ function ja(e, t) {
4590
4640
  const n = e.parse(t, {}), o = [];
4591
4641
  let s = "";
4592
4642
  for (let r = 0; r + 1 < n.length; r++) {
@@ -4604,20 +4654,20 @@ function xa(e, t) {
4604
4654
  return o;
4605
4655
  }
4606
4656
  const bi = ["prose", "page", "callout", "code", "code-group", "tabs", "cards", "card", "features", "feature", "actions", "action", "hero", "fullpage", "section", "tags", "tag", "footer", "announce", "feedback", "header", "sidebar", "toc", "crumbs", "search", "mermaid", "dbml", "op", "changelog", "roadmap", "team", "pricing", "glossary", "notfound", "math", "icon", "figure", "keys", "lightbox", "abbr", "img", "page-actions"];
4607
- function On(e, t) {
4657
+ function Mn(e, t) {
4608
4658
  return `@scope (.np-${e}) {
4609
4659
  ${t}
4610
4660
  }`;
4611
4661
  }
4612
- function Sa(e, t) {
4662
+ function Pa(e, t) {
4613
4663
  const n = new RegExp(`^${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\.([a-z0-9-]+)\\.css$`).exec(e);
4614
4664
  return n ? n[1] : null;
4615
4665
  }
4616
- const ja = new Set("a an the and or but if then else of to in on at by for with from as is are was were be been being it its this that these those there here which who whom what when where why how not no yes you your we our they their he she his her them us me my i so do does did done can could should would will shall may might must into over under again more most some any each every all both few own same than too very just also only such other another one two three first last new use used using page pages file files field fields set sets value values see".split(" "));
4617
- function Nt(e) {
4618
- return e.toLowerCase().replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/[^\p{L}\p{N}\s-]/gu, " ").split(/\s+/).map((t) => t.replace(/^-+|-+$/g, "")).filter((t) => t.length > 2 && !ja.has(t) && !/^\d+$/.test(t));
4666
+ const Aa = new Set("a an the and or but if then else of to in on at by for with from as is are was were be been being it its this that these those there here which who whom what when where why how not no yes you your we our they their he she his her them us me my i so do does did done can could should would will shall may might must into over under again more most some any each every all both few own same than too very just also only such other another one two three first last new use used using page pages file files field fields set sets value values see".split(" "));
4667
+ function Rt(e) {
4668
+ return e.toLowerCase().replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/[^\p{L}\p{N}\s-]/gu, " ").split(/\s+/).map((t) => t.replace(/^-+|-+$/g, "")).filter((t) => t.length > 2 && !Aa.has(t) && !/^\d+$/.test(t));
4619
4669
  }
4620
- function Pa(e) {
4670
+ function Ea(e) {
4621
4671
  const t = e.replace(/```[\s\S]*?```/g, "").replace(/^:{3,}.*$/gm, "").replace(/^\s*[#>|-].*$/gm, "").split(/\n\s*\n/).map((s) => s.replace(/\s+/g, " ").trim()).find((s) => s.length > 40 && !s.startsWith("!") && !s.startsWith("<"));
4622
4672
  if (!t) return "";
4623
4673
  const n = t.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/[*_`~^=]+/g, "");
@@ -4625,12 +4675,12 @@ function Pa(e) {
4625
4675
  const o = n.slice(0, 157);
4626
4676
  return `${o.slice(0, Math.max(o.lastIndexOf(" "), 100))}…`;
4627
4677
  }
4628
- function Aa(e) {
4678
+ function Ca(e) {
4629
4679
  const t = /* @__PURE__ */ new Map(), n = e.map((r) => {
4630
4680
  const i = /* @__PURE__ */ new Map(), c = (u, h) => {
4631
4681
  for (const g of u) i.set(g, (i.get(g) ?? 0) + h);
4632
4682
  };
4633
- c(Nt(r.title), 6), c(Nt(r.headings.join(" ")), 3), c(r.tags.map((u) => u.toLowerCase()), 8), c(Nt(r.body), 1);
4683
+ c(Rt(r.title), 6), c(Rt(r.headings.join(" ")), 3), c(r.tags.map((u) => u.toLowerCase()), 8), c(Rt(r.body), 1);
4634
4684
  for (const u of i.keys()) t.set(u, (t.get(u) ?? 0) + 1);
4635
4685
  return { source: r, counts: i };
4636
4686
  }), o = Math.max(e.length, 1), s = /* @__PURE__ */ new Map();
@@ -4641,90 +4691,90 @@ function Aa(e) {
4641
4691
  if (u.length >= 8) break;
4642
4692
  u.some((g) => g.toLowerCase() === h.word) || u.push(h.word);
4643
4693
  }
4644
- s.set(r.slug, { keywords: u, description: Pa(r.body) });
4694
+ s.set(r.slug, { keywords: u, description: Ea(r.body) });
4645
4695
  }
4646
4696
  return s;
4647
4697
  }
4648
- function Ea(e, t, n) {
4698
+ function Oa(e, t, n) {
4649
4699
  return n === !1 || t === !1 && n !== !0 ? `${e}, noai, noimageai` : e;
4650
4700
  }
4651
- function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4652
- const s = new Nn({
4701
+ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4702
+ const s = new Rn({
4653
4703
  html: !0,
4654
4704
  linkify: !0,
4655
4705
  typographer: !1,
4656
- highlight(d, v, O) {
4706
+ highlight(d, v, D) {
4657
4707
  const R = {
4658
4708
  curl: "bash",
4659
4709
  sh: "bash",
4660
4710
  zsh: "bash",
4661
4711
  console: "bash",
4662
4712
  hurl: "http"
4663
- }, A = ((O ? O.match(/\[([^\]]+)\]/) : null)?.[1].trim() || v || "text").trim(), I = R[v] ?? v, H = I && e.getLoadedLanguages().includes(I) ? I : "text", K = Oa(O ?? ""), re = Da(A, K), he = oo.test(d) ? { includeExplanation: "scopeName" } : {};
4713
+ }, E = ((D ? D.match(/\[([^\]]+)\]/) : null)?.[1].trim() || v || "text").trim(), I = R[v] ?? v, H = I && e.getLoadedLanguages().includes(I) ? I : "text", K = Ta(D ?? ""), re = Ma(E, K), he = ao.test(d) ? { includeExplanation: "scopeName" } : {};
4664
4714
  try {
4665
4715
  return e.codeToHtml(d, {
4666
4716
  ...he,
4667
4717
  lang: H,
4668
4718
  theme: "github-dark",
4669
- transformers: [Na(re, K)]
4719
+ transformers: [Fa(re, K)]
4670
4720
  });
4671
4721
  } catch {
4672
4722
  return `<pre ${Object.entries(re).map(([ge, oe]) => `${ge}="${s.utils.escapeHtml(oe)}"`).join(" ")}><code>${s.utils.escapeHtml(d)}</code></pre>`;
4673
4723
  }
4674
4724
  }
4675
- }), r = (d, v, O, R, x) => x.renderToken(d, v, O), i = s.renderer.rules.fence ?? r;
4676
- s.renderer.rules.fence = (d, v, O, R, x) => {
4677
- const A = i(d, v, O, R, x);
4678
- if (!A.includes("np-code-annotation")) return A;
4725
+ }), r = (d, v, D, R, x) => x.renderToken(d, v, D), i = s.renderer.rules.fence ?? r;
4726
+ s.renderer.rules.fence = (d, v, D, R, x) => {
4727
+ const E = i(d, v, D, R, x);
4728
+ if (!E.includes("np-code-annotation")) return E;
4679
4729
  const I = d[v + 1];
4680
- if (!I || I.type !== "ordered_list_open") return A;
4730
+ if (!I || I.type !== "ordered_list_open") return E;
4681
4731
  let H = v + 2;
4682
4732
  for (; H < d.length && !(d[H].type === "ordered_list_close" && d[H].level === I.level); ) H += 1;
4683
- if (H >= d.length) return A;
4733
+ if (H >= d.length) return E;
4684
4734
  const K = {};
4685
4735
  let re = Number(I.attrGet("start") ?? 1);
4686
4736
  for (let te = v + 2; te < H; te++) {
4687
4737
  if (d[te].type !== "list_item_open" || d[te].level !== I.level + 1) continue;
4688
4738
  let ge = te + 1;
4689
4739
  for (; ge < H && !(d[ge].type === "list_item_close" && d[ge].level === d[te].level); ) ge += 1;
4690
- K[String(re)] = x.render(d.slice(te + 1, ge), O, R).trim(), re += 1, te = ge;
4740
+ K[String(re)] = x.render(d.slice(te + 1, ge), D, R).trim(), re += 1, te = ge;
4691
4741
  }
4692
4742
  for (let te = v + 1; te <= H; te++) d[te].type = "np_annotation_list";
4693
4743
  const he = Buffer.from(JSON.stringify(K), "utf-8").toString("base64");
4694
- return A.replace("<pre ", `<pre data-annotations="${he}" `);
4744
+ return E.replace("<pre ", `<pre data-annotations="${he}" `);
4695
4745
  }, s.renderer.rules.np_annotation_list = () => "";
4696
4746
  const c = s.renderer.rules.link_open ?? r;
4697
- s.renderer.rules.link_open = (d, v, O, R, x) => {
4698
- const A = d[v].attrGet("href");
4699
- A && d[v].attrSet("href", we(n, A));
4747
+ s.renderer.rules.link_open = (d, v, D, R, x) => {
4748
+ const E = d[v].attrGet("href");
4749
+ E && d[v].attrSet("href", we(n, E));
4700
4750
  const I = d[v].attrGet("title");
4701
- return I && (d[v].attrs = (d[v].attrs ?? []).filter(([H]) => H !== "title"), d[v].attrJoin("class", "np-tip"), d[v].attrSet("aria-label", I)), c(d, v, O, R, x);
4751
+ return I && (d[v].attrs = (d[v].attrs ?? []).filter(([H]) => H !== "title"), d[v].attrJoin("class", "np-tip"), d[v].attrSet("aria-label", I)), c(d, v, D, R, x);
4702
4752
  };
4703
4753
  const u = s.renderer.rules.image ?? r;
4704
- s.renderer.rules.image = (d, v, O, R, x) => {
4705
- const A = d[v], I = A.attrGet("src");
4754
+ s.renderer.rules.image = (d, v, D, R, x) => {
4755
+ const E = d[v], I = E.attrGet("src");
4706
4756
  if (I) {
4707
4757
  const te = /#only-(light|dark)$/.exec(I);
4708
- te ? (A.attrSet("src", we(n, I.slice(0, -te[0].length))), A.attrJoin("class", `np-img-${te[1]}`)) : A.attrSet("src", we(n, I));
4758
+ te ? (E.attrSet("src", we(n, I.slice(0, -te[0].length))), E.attrJoin("class", `np-img-${te[1]}`)) : E.attrSet("src", we(n, I));
4709
4759
  }
4710
- const H = A.attrGet("align");
4711
- (H === "left" || H === "right") && (A.attrs = (A.attrs ?? []).filter(([te]) => te !== "align"), A.attrJoin("class", `np-img-${H}`));
4760
+ const H = E.attrGet("align");
4761
+ (H === "left" || H === "right") && (E.attrs = (E.attrs ?? []).filter(([te]) => te !== "align"), E.attrJoin("class", `np-img-${H}`));
4712
4762
  const K = R;
4713
- K.imageCount = (K.imageCount ?? 0) + 1, K.imageCount > 1 && !A.attrGet("loading") && A.attrSet("loading", "lazy");
4714
- const re = u(d, v, O, R, x), he = A.meta?.figure ? A.attrGet("title") : null;
4763
+ K.imageCount = (K.imageCount ?? 0) + 1, K.imageCount > 1 && !E.attrGet("loading") && E.attrSet("loading", "lazy");
4764
+ const re = u(d, v, D, R, x), he = E.meta?.figure ? E.attrGet("title") : null;
4715
4765
  return he ? `${re}<figcaption class="np-figcaption">${s.utils.escapeHtml(he)}</figcaption>` : re;
4716
- }, s.use(un, {
4766
+ }, s.use(dn, {
4717
4767
  slugify: Ie,
4718
- permalink: un.permalink.headerLink({ safariReaderFix: !0 })
4719
- }), s.use(To), s.use(In), s.use(Io), s.use(Fo, { enabled: !0 }), s.use(ps), s.inline.ruler.before("emphasis", "np_ins", ca), s.renderer.rules.s_open = () => "<del>", s.renderer.rules.s_close = () => "</del>", s.use(fs), s.use(gs), s.inline.ruler.before("emphasis", "np_keys", la), s.core.ruler.push("np_figures", pa), s.block.ruler.before("reference", "np_abbr_definition", ba, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.core.ruler.after("inline", "np_abbr", va(o.glossary ?? [])), s.core.ruler.push("np_glossary_anchors", ka), s.core.ruler.after("footnote_tail", "np_footnote_tips", $a);
4768
+ permalink: dn.permalink.headerLink({ safariReaderFix: !0 })
4769
+ }), s.use(Fo), s.use(Bn), s.use(Bo), s.use(Wo, { enabled: !0 }), s.use(ms), s.inline.ruler.before("emphasis", "np_ins", pa), s.renderer.rules.s_open = () => "<del>", s.renderer.rules.s_close = () => "</del>", s.use(hs), s.use(ys), s.inline.ruler.before("emphasis", "np_keys", ua), s.core.ruler.push("np_figures", ma), s.block.ruler.before("reference", "np_abbr_definition", va, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.core.ruler.after("inline", "np_abbr", $a(o.glossary ?? [])), s.core.ruler.push("np_glossary_anchors", xa), s.core.ruler.after("footnote_tail", "np_footnote_tips", Sa);
4720
4770
  const h = s.renderer.rules.footnote_ref ?? r;
4721
- s.renderer.rules.footnote_ref = (d, v, O, R, x) => {
4722
- const A = String(d[v].meta?.tip ?? ""), I = h(d, v, O, R, x);
4723
- return A ? I.replace('<sup class="footnote-ref">', `<sup class="footnote-ref np-tip" aria-label="${s.utils.escapeHtml(A)}">`) : I;
4724
- }, s.inline.ruler.before("emphasis", "np_icon", ha(o.icons)), s.use(xs), s.renderer.rules.np_icon = (d, v, O, R, x) => `<span${x.renderAttrs(d[v])}>${d[v].content}</span>`, o.math !== !1 && (s.block.ruler.before("fence", "np_math_block", ga, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.inline.ruler.before("emphasis", "np_math_inline", _a), s.renderer.rules.np_math_block = (d, v) => `<div class="np-math np-math-display" data-math="${Cn(d[v].content)}"></div>
4725
- `, s.renderer.rules.np_math_inline = (d, v) => `<span class="np-math" data-math="${Cn(d[v].content)}"></span>`);
4771
+ s.renderer.rules.footnote_ref = (d, v, D, R, x) => {
4772
+ const E = String(d[v].meta?.tip ?? ""), I = h(d, v, D, R, x);
4773
+ return E ? I.replace('<sup class="footnote-ref">', `<sup class="footnote-ref np-tip" aria-label="${s.utils.escapeHtml(E)}">`) : I;
4774
+ }, s.inline.ruler.before("emphasis", "np_icon", _a(o.icons)), s.use(js), s.renderer.rules.np_icon = (d, v, D, R, x) => `<span${x.renderAttrs(d[v])}>${d[v].content}</span>`, o.math !== !1 && (s.block.ruler.before("fence", "np_math_block", ya, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.inline.ruler.before("emphasis", "np_math_inline", ba), s.renderer.rules.np_math_block = (d, v) => `<div class="np-math np-math-display" data-math="${Tn(d[v].content)}"></div>
4775
+ `, s.renderer.rules.np_math_inline = (d, v) => `<span class="np-math" data-math="${Tn(d[v].content)}"></span>`);
4726
4776
  const g = (d, v) => {
4727
- s.use(No, d, v);
4777
+ s.use(Ro, d, v);
4728
4778
  }, w = [
4729
4779
  "tip",
4730
4780
  "note",
@@ -4739,19 +4789,19 @@ function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4739
4789
  "bug",
4740
4790
  "example",
4741
4791
  "quote"
4742
- ], j = (d) => d[0].toUpperCase() + d.slice(1), P = (d, v) => {
4743
- const O = d.trim().slice(v.length).trim(), R = O.indexOf("{"), x = R >= 0 ? Ee(O.slice(R), d) : {}, A = (R >= 0 ? O.slice(0, R) : O).trim();
4792
+ ], P = (d) => d[0].toUpperCase() + d.slice(1), A = (d, v) => {
4793
+ const D = d.trim().slice(v.length).trim(), R = D.indexOf("{"), x = R >= 0 ? Ee(D.slice(R), d) : {}, E = (R >= 0 ? D.slice(0, R) : D).trim();
4744
4794
  return {
4745
- title: A === '""' ? "" : A || j(v),
4795
+ title: E === '""' ? "" : E || P(v),
4746
4796
  collapsible: x.collapsible === !0,
4747
4797
  open: x.open === !0,
4748
4798
  inline: x.inline === "start" || x.inline === "end" ? x.inline : ""
4749
4799
  };
4750
- }, M = (d, v, O) => {
4800
+ }, T = (d, v, D) => {
4751
4801
  let R = 0;
4752
4802
  for (let x = v - 1; x >= 0; x--)
4753
- if (d[x].type === `container_${O}_close`) R++;
4754
- else if (d[x].type === `container_${O}_open`) {
4803
+ if (d[x].type === `container_${D}_close`) R++;
4804
+ else if (d[x].type === `container_${D}_open`) {
4755
4805
  if (R === 0) return d[x];
4756
4806
  R--;
4757
4807
  }
@@ -4759,12 +4809,12 @@ function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4759
4809
  };
4760
4810
  for (const d of w)
4761
4811
  g(d, {
4762
- render(v, O) {
4763
- if (v[O].nesting !== 1)
4764
- return P(M(v, O, d).info, d).collapsible ? "</div></details>" : "</div></div>";
4765
- const { title: R, collapsible: x, open: A, inline: I } = P(v[O].info, d), H = `np-callout np-callout-${d}${x ? " np-callout-collapsible" : ""}${I ? ` np-callout-inline np-callout-inline-${I}` : ""}`;
4812
+ render(v, D) {
4813
+ if (v[D].nesting !== 1)
4814
+ return A(T(v, D, d).info, d).collapsible ? "</div></details>" : "</div></div>";
4815
+ const { title: R, collapsible: x, open: E, inline: I } = A(v[D].info, d), H = `np-callout np-callout-${d}${x ? " np-callout-collapsible" : ""}${I ? ` np-callout-inline np-callout-inline-${I}` : ""}`;
4766
4816
  if (x)
4767
- return `<details class="${H}"${A ? " open" : ""}><summary class="np-callout-title">${s.utils.escapeHtml(R || j(d))}</summary><div class="np-callout-body">`;
4817
+ return `<details class="${H}"${E ? " open" : ""}><summary class="np-callout-title">${s.utils.escapeHtml(R || P(d))}</summary><div class="np-callout-body">`;
4768
4818
  const K = R ? `<div class="np-callout-title">${s.utils.escapeHtml(R)}</div>` : "";
4769
4819
  return `<div class="${H}"><div class="np-callout-body">${K}`;
4770
4820
  }
@@ -4779,7 +4829,7 @@ function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4779
4829
  },
4780
4830
  render(d, v) {
4781
4831
  if (d[v].nesting === 1) {
4782
- const O = d[v].info.trim().match(/^details\s*(.*)$/), R = O && O[1] || "Details";
4832
+ const D = d[v].info.trim().match(/^details\s*(.*)$/), R = D && D[1] || "Details";
4783
4833
  return `<details class="np-details"><summary class="np-details-summary">${s.utils.escapeHtml(R)}</summary><div class="np-details-body">
4784
4834
  `;
4785
4835
  }
@@ -4793,38 +4843,38 @@ function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4793
4843
  }), g("tabs", {
4794
4844
  render(d, v) {
4795
4845
  if (d[v].nesting === 1) {
4796
- const O = d[v].info.trim().slice(4).trim();
4797
- return `<div class="np-tabs"${(O ? Ee(O, d[v].info) : {}).linked === !0 ? ' data-linked="true"' : ""}>`;
4846
+ const D = d[v].info.trim().slice(4).trim();
4847
+ return `<div class="np-tabs"${(D ? Ee(D, d[v].info) : {}).linked === !0 ? ' data-linked="true"' : ""}>`;
4798
4848
  }
4799
4849
  return "</div>";
4800
4850
  }
4801
4851
  }), s.core.ruler.before("inline", "nimpress_tabs", (d) => {
4802
- const v = d.tokens, O = [], R = (x) => {
4803
- const A = new d.Token("html_block", "", 0);
4804
- return A.content = x, A.block = !0, A;
4852
+ const v = d.tokens, D = [], R = (x) => {
4853
+ const E = new d.Token("html_block", "", 0);
4854
+ return E.content = x, E.block = !0, E;
4805
4855
  };
4806
4856
  for (let x = 0; x < v.length; x++) {
4807
- const A = v[x];
4808
- if (A.type === "container_tabs_open") {
4809
- O.push(!1);
4857
+ const E = v[x];
4858
+ if (E.type === "container_tabs_open") {
4859
+ D.push(!1);
4810
4860
  continue;
4811
4861
  }
4812
- if (A.type === "container_tabs_close") {
4813
- O.pop() && v.splice(x++, 0, R("</div>"));
4862
+ if (E.type === "container_tabs_close") {
4863
+ D.pop() && v.splice(x++, 0, R("</div>"));
4814
4864
  continue;
4815
4865
  }
4816
- if (O.length === 0 || A.type !== "paragraph_open") continue;
4866
+ if (D.length === 0 || E.type !== "paragraph_open") continue;
4817
4867
  const I = v[x + 1], H = I?.type === "inline" ? I.content.match(/^::tab[ \t]+(.+?)[ \t]*(?:\n([\s\S]*))?$/) : null;
4818
4868
  if (!H) continue;
4819
- const K = H[1], re = O[O.length - 1] ? "</div>" : "", he = R(
4869
+ const K = H[1], re = D[D.length - 1] ? "</div>" : "", he = R(
4820
4870
  `${re}<div class="np-tabs-panel" data-label="${s.utils.escapeHtml(K)}" data-id="tab-${Ie(K)}">`
4821
4871
  );
4822
- O[O.length - 1] = !0, H[2] === void 0 ? v.splice(x, 3, he) : (I.content = H[2], v.splice(x, 0, he), x++);
4872
+ D[D.length - 1] = !0, H[2] === void 0 ? v.splice(x, 3, he) : (I.content = H[2], v.splice(x, 0, he), x++);
4823
4873
  }
4824
4874
  }), g("actions", {
4825
4875
  render(d, v) {
4826
4876
  if (d[v].nesting === 1) {
4827
- const O = d[v].info.trim().slice(7).trim(), R = O ? Ee(O, d[v].info) : {}, x = typeof R?.align == "string" ? R.align : "start";
4877
+ const D = d[v].info.trim().slice(7).trim(), R = D ? Ee(D, d[v].info) : {}, x = typeof R?.align == "string" ? R.align : "start";
4828
4878
  return `<div class="np-actions" data-align="${s.utils.escapeHtml(x)}">`;
4829
4879
  }
4830
4880
  return "</div>";
@@ -4832,7 +4882,7 @@ function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4832
4882
  }), g("features", {
4833
4883
  render(d, v) {
4834
4884
  if (d[v].nesting === 1) {
4835
- const O = d[v].info.trim().slice(8).trim(), R = O ? Ee(O, d[v].info) : {}, x = typeof R?.columns == "number" ? R.columns : 0;
4885
+ const D = d[v].info.trim().slice(8).trim(), R = D ? Ee(D, d[v].info) : {}, x = typeof R?.columns == "number" ? R.columns : 0;
4836
4886
  return `<div class="np-features"${x > 0 ? ` data-columns="${x}"` : ""}>`;
4837
4887
  }
4838
4888
  return "</div>";
@@ -4840,7 +4890,7 @@ function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4840
4890
  }), g("feature", {
4841
4891
  render(d, v) {
4842
4892
  if (d[v].nesting === 1) {
4843
- const O = d[v].info.trim().slice(7).trim(), R = O ? Ee(O, d[v].info) : {};
4893
+ const D = d[v].info.trim().slice(7).trim(), R = D ? Ee(D, d[v].info) : {};
4844
4894
  return `<div class="np-feature" data-config="${tt(JSON.stringify(R))}"><div class="np-feature-body">`;
4845
4895
  }
4846
4896
  return "</div></div>";
@@ -4848,15 +4898,15 @@ function Dn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4848
4898
  }), g("component", {
4849
4899
  render(d, v) {
4850
4900
  if (d[v].nesting === 1) {
4851
- const O = d[v].info.trim().slice(9).trim(), R = O.startsWith("{") ? Ee(O, d[v].info) : O ? { component: O } : {};
4901
+ const D = d[v].info.trim().slice(9).trim(), R = D.startsWith("{") ? Ee(D, d[v].info) : D ? { component: D } : {};
4852
4902
  return `<div class="np-component-embed" data-embed="${tt(JSON.stringify({ ...t, ...R }))}"><div class="np-component-embed-body">`;
4853
4903
  }
4854
4904
  return "</div></div>";
4855
4905
  }
4856
4906
  }), s;
4857
4907
  }
4858
- const oo = /\((\d+)\)(!?)[ \t]*$/m;
4859
- function Ca(e) {
4908
+ const ao = /\((\d+)\)(!?)[ \t]*$/m;
4909
+ function Da(e) {
4860
4910
  const t = /* @__PURE__ */ new Set(), n = Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : typeof e == "number" ? [e] : [];
4861
4911
  for (const o of n) {
4862
4912
  const s = String(o).trim(), r = /^(\d+)(?:-(\d+))?$/.exec(s);
@@ -4866,33 +4916,33 @@ function Ca(e) {
4866
4916
  }
4867
4917
  return t;
4868
4918
  }
4869
- function Oa(e) {
4919
+ function Ta(e) {
4870
4920
  const t = e.indexOf("{"), n = t >= 0 ? Ee(e.slice(t), e) : {}, o = typeof n.start == "number" && Number.isInteger(n.start) ? n.start : 1;
4871
4921
  return {
4872
4922
  title: typeof n.title == "string" ? n.title.trim() : "",
4873
4923
  lines: n.lines === !0 || typeof n.start == "number",
4874
4924
  start: o,
4875
- highlight: Ca(n.highlight)
4925
+ highlight: Da(n.highlight)
4876
4926
  };
4877
4927
  }
4878
- function Da(e, t) {
4928
+ function Ma(e, t) {
4879
4929
  const n = { "data-lang": e };
4880
4930
  return t.title && (n["data-title"] = t.title), t.lines && (n["data-lines"] = "true", n["data-start"] = String(t.start)), n;
4881
4931
  }
4882
- function Ma(e) {
4932
+ function Na(e) {
4883
4933
  const t = e.explanation ?? [];
4884
4934
  return t.length > 0 && t.every(
4885
4935
  (n) => n.scopes.some((o) => /(^|\.)comment(\.|$)/.test(o.scopeName)) && !n.scopes.some((o) => o.scopeName.startsWith("markup.fenced_code") || o.scopeName.startsWith("markup.raw"))
4886
4936
  );
4887
4937
  }
4888
- function Ta(e) {
4938
+ function Ia(e) {
4889
4939
  let t = e.length;
4890
- for (; t > 0 && Ma(e[t - 1]); ) t -= 1;
4940
+ for (; t > 0 && Na(e[t - 1]); ) t -= 1;
4891
4941
  if (t === e.length) return e;
4892
4942
  const n = e.slice(t).flatMap(
4893
- (w) => (w.explanation ?? []).map((j) => ({
4894
- text: j.content,
4895
- punctuation: j.scopes.some((P) => P.scopeName.startsWith("punctuation.definition.comment")),
4943
+ (w) => (w.explanation ?? []).map((P) => ({
4944
+ text: P.content,
4945
+ punctuation: P.scopes.some((A) => A.scopeName.startsWith("punctuation.definition.comment")),
4896
4946
  color: w.color,
4897
4947
  fontStyle: w.fontStyle
4898
4948
  }))
@@ -4900,7 +4950,7 @@ function Ta(e) {
4900
4950
  let o = n.length - 1;
4901
4951
  for (; o >= 0 && (n[o].punctuation || !n[o].text.trim()); ) o -= 1;
4902
4952
  if (o < 0) return e;
4903
- const s = oo.exec(n[o].text);
4953
+ const s = ao.exec(n[o].text);
4904
4954
  if (!s) return e;
4905
4955
  const r = s[2] === "!";
4906
4956
  n[o].text = n[o].text.slice(0, s.index);
@@ -4916,13 +4966,14 @@ function Ta(e) {
4916
4966
  });
4917
4967
  return [...e.slice(0, t), ...u.map(g), i, ...h.map(g)];
4918
4968
  }
4919
- function Na(e, t) {
4969
+ function Fa(e, t) {
4920
4970
  return {
4921
4971
  name: "nimpress:code-fence",
4922
4972
  tokens(n) {
4923
- return n.map(Ta);
4973
+ return n.map(Ia);
4924
4974
  },
4925
4975
  pre(n) {
4976
+ n.properties.style = String(n.properties.style ?? "").replace(/background-color:[^;]*;?/, "");
4926
4977
  for (const [o, s] of Object.entries(e)) n.properties[o] = s;
4927
4978
  },
4928
4979
  code(n) {
@@ -4944,16 +4995,16 @@ function Ee(e, t) {
4944
4995
  function tt(e) {
4945
4996
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
4946
4997
  }
4947
- function Ia(e) {
4998
+ function Ra(e) {
4948
4999
  return `<div class="np-mermaid" data-graph="${Buffer.from(e, "utf-8").toString("base64")}"></div>`;
4949
5000
  }
4950
- function Fa(e, t, n) {
5001
+ function Ba(e, t, n) {
4951
5002
  const o = t.startsWith("{") ? Ee(t, t) : {};
4952
5003
  let s = "", r = "";
4953
5004
  try {
4954
- s = Hn(e);
5005
+ s = Un(e);
4955
5006
  } catch (h) {
4956
- r = h instanceof Gt ? h.message : String(h), console.warn(`[nimpress] invalid dbml in ${n}:
5007
+ r = h instanceof Yt ? h.message : String(h), console.warn(`[nimpress] invalid dbml in ${n}:
4957
5008
  ${r}`);
4958
5009
  }
4959
5010
  const i = Buffer.from(s, "utf-8").toString("base64"), c = typeof o.height == "string" ? o.height : "";
@@ -4963,7 +5014,7 @@ ${r}`);
4963
5014
  c ? `data-height="${tt(c)}"` : ""
4964
5015
  ].filter(Boolean).join(" ")}></div>`;
4965
5016
  }
4966
- function Ra(e, t) {
5017
+ function Wa(e, t) {
4967
5018
  const n = e.split(`
4968
5019
  `), o = [];
4969
5020
  let s = 0;
@@ -4976,15 +5027,15 @@ function Ra(e, t) {
4976
5027
  const [, i, c, u] = r, h = new RegExp(`^\\s*\\${c[0]}{${c.length},}\\s*$`);
4977
5028
  let g = s + 1;
4978
5029
  for (; g < n.length && !h.test(n[g]); ) g += 1;
4979
- const w = u.trim(), j = w.split(/\s+/)[0].toLowerCase(), P = n.slice(s + 1, g).join(`
5030
+ const w = u.trim(), P = w.split(/\s+/)[0].toLowerCase(), A = n.slice(s + 1, g).join(`
4980
5031
  `);
4981
- j === "mermaid" ? o.push(`${i}${Ia(P && `${P}
4982
- `)}`) : j === "dbml" ? o.push(`${i}${Fa(P, w.slice(j.length).trim(), t)}`) : o.push(...n.slice(s, Math.min(g + 1, n.length))), s = g + 1;
5032
+ P === "mermaid" ? o.push(`${i}${Ra(A && `${A}
5033
+ `)}`) : P === "dbml" ? o.push(`${i}${Ba(A, w.slice(P.length).trim(), t)}`) : o.push(...n.slice(s, Math.min(g + 1, n.length))), s = g + 1;
4983
5034
  }
4984
5035
  return o.join(`
4985
5036
  `);
4986
5037
  }
4987
- function Ba(e) {
5038
+ function La(e) {
4988
5039
  if (!e) return "";
4989
5040
  const t = [], n = (s) => {
4990
5041
  if (s)
@@ -4995,20 +5046,20 @@ function Ba(e) {
4995
5046
  const o = t.join("").trim();
4996
5047
  return o || (e.content ?? "").trim();
4997
5048
  }
4998
- function Wa(e, t) {
5049
+ function Ha(e, t) {
4999
5050
  const n = e.parse(t, {}), o = [];
5000
5051
  let s = 0;
5001
5052
  const r = /* @__PURE__ */ new Map();
5002
5053
  for (let i = 0; i < n.length; i++) {
5003
5054
  const c = n[i];
5004
5055
  if (c.type === "heading_open") {
5005
- const u = parseInt(c.tag.slice(1)), h = n[i + 1], g = Ba(h) || `heading-${s++}`;
5056
+ const u = parseInt(c.tag.slice(1)), h = n[i + 1], g = La(h) || `heading-${s++}`;
5006
5057
  let w = Ie(g);
5007
5058
  w || (w = `heading-${s++}`);
5008
- const j = r.get(w);
5009
- if (j !== void 0) {
5010
- const P = j + 1;
5011
- r.set(w, P), w = `${w}-${P}`;
5059
+ const P = r.get(w);
5060
+ if (P !== void 0) {
5061
+ const A = P + 1;
5062
+ r.set(w, A), w = `${w}-${A}`;
5012
5063
  } else
5013
5064
  r.set(w, 0);
5014
5065
  o.push({ level: u, text: g, slug: w });
@@ -5016,30 +5067,30 @@ function Wa(e, t) {
5016
5067
  }
5017
5068
  return o;
5018
5069
  }
5019
- function La(e) {
5070
+ function za(e) {
5020
5071
  return e.frontmatter.slug ?? e.frontmatter.title;
5021
5072
  }
5022
5073
  function mt(e) {
5023
5074
  return e ? e.replace(/[-_]/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()) : "";
5024
5075
  }
5025
- function Lt(e) {
5076
+ function qt(e) {
5026
5077
  e.sort((t, n) => {
5027
5078
  const o = t.order ?? Number.MAX_SAFE_INTEGER, s = n.order ?? Number.MAX_SAFE_INTEGER;
5028
5079
  return o !== s ? o - s : t.text.localeCompare(n.text);
5029
5080
  });
5030
5081
  for (const t of e)
5031
- t.items && Lt(t.items);
5082
+ t.items && qt(t.items);
5032
5083
  }
5033
- function Ha(e) {
5084
+ function qa(e) {
5034
5085
  let t = Ye, n = G(process.cwd(), Ye.contentDir), o = G(process.cwd(), Ye.assetsDir), s = /* @__PURE__ */ new Map(), r = null, i = G(process.cwd(), "dist"), c = !1, u = null;
5035
5086
  const h = /* @__PURE__ */ new Map();
5036
5087
  let g = [], w = "";
5037
- const j = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
5088
+ const P = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
5038
5089
  function v(a) {
5039
- return Tn("sha1").update(a).digest("hex");
5090
+ return Fn("sha1").update(a).digest("hex");
5040
5091
  }
5041
- async function O() {
5042
- return r || (r = await Bo({
5092
+ async function D() {
5093
+ return r || (r = await Ho({
5043
5094
  themes: ["github-dark"],
5044
5095
  langs: [
5045
5096
  "ts",
@@ -5066,60 +5117,60 @@ function Ha(e) {
5066
5117
  }), r);
5067
5118
  }
5068
5119
  function R(a, l) {
5069
- return /\.ya?ml$/i.test(l) ? Fn(a) : JSON.parse(a);
5120
+ return /\.ya?ml$/i.test(l) ? Wn(a) : JSON.parse(a);
5070
5121
  }
5071
5122
  async function x(a, l) {
5072
5123
  try {
5073
5124
  const p = ke(l) ? l : G(Y(a), l), b = await ie(p, "utf-8"), k = R(b, p);
5074
- return await A(k, Y(p)), k;
5125
+ return await E(k, Y(p)), k;
5075
5126
  } catch (p) {
5076
5127
  return console.warn(`[nimpress] failed to load spec ${l} for ${a}:`, p), null;
5077
5128
  }
5078
5129
  }
5079
- async function A(a, l) {
5130
+ async function E(a, l) {
5080
5131
  if (!a || typeof a != "object") return;
5081
5132
  a.components || (a.components = {}), a.components.schemas || (a.components.schemas = {});
5082
5133
  const p = a.components.schemas, b = /* @__PURE__ */ new Map(), k = async (_) => {
5083
- const E = await ie(_, "utf-8");
5084
- return R(E, _);
5134
+ const C = await ie(_, "utf-8");
5135
+ return R(C, _);
5085
5136
  }, y = async (_) => {
5086
5137
  if (b.has(_)) return b.get(_);
5087
5138
  const $ = (_.split("/").pop() ?? "").replace(/\.json$/, "");
5088
5139
  b.set(_, $);
5089
- const D = await k(_);
5090
- return await f(D, Y(_)), p[$] = D, $;
5091
- }, f = async (_, E) => {
5140
+ const S = await k(_);
5141
+ return await f(S, Y(_)), p[$] = S, $;
5142
+ }, f = async (_, C) => {
5092
5143
  if (!_ || typeof _ != "object") return;
5093
5144
  if (Array.isArray(_)) {
5094
- for (const D of _) await f(D, E);
5145
+ for (const S of _) await f(S, C);
5095
5146
  return;
5096
5147
  }
5097
5148
  const $ = _.$ref;
5098
5149
  if (typeof $ == "string" && !$.startsWith("#")) {
5099
- const D = ke($) ? $ : G(E, $), U = Y(D).split("/").pop() ?? "";
5150
+ const S = ke($) ? $ : G(C, $), U = Y(S).split("/").pop() ?? "";
5100
5151
  if (U === "schemas") {
5101
- const S = await y(D);
5102
- _.$ref = `#/components/schemas/${S}`;
5152
+ const j = await y(S);
5153
+ _.$ref = `#/components/schemas/${j}`;
5103
5154
  return;
5104
5155
  }
5105
5156
  if (U === "operations") {
5106
- const S = await k(D);
5107
- await f(S, Y(D)), delete _.$ref;
5108
- for (const C of Object.keys(S)) _[C] = S[C];
5157
+ const j = await k(S);
5158
+ await f(j, Y(S)), delete _.$ref;
5159
+ for (const O of Object.keys(j)) _[O] = j[O];
5109
5160
  return;
5110
5161
  }
5111
5162
  return;
5112
5163
  }
5113
- for (const D of Object.keys(_))
5114
- await f(_[D], E);
5164
+ for (const S of Object.keys(_))
5165
+ await f(_[S], C);
5115
5166
  };
5116
5167
  for (const _ of Object.keys(p)) {
5117
- const E = p[_];
5118
- if (E && typeof E == "object" && typeof E.$ref == "string" && !E.$ref.startsWith("#")) {
5119
- const $ = ke(E.$ref) ? E.$ref : G(l, E.$ref);
5168
+ const C = p[_];
5169
+ if (C && typeof C == "object" && typeof C.$ref == "string" && !C.$ref.startsWith("#")) {
5170
+ const $ = ke(C.$ref) ? C.$ref : G(l, C.$ref);
5120
5171
  b.set($, _);
5121
- const D = await k($);
5122
- await f(D, Y($)), p[_] = D;
5172
+ const S = await k($);
5173
+ await f(S, Y($)), p[_] = S;
5123
5174
  }
5124
5175
  }
5125
5176
  for (const _ of Object.keys(a))
@@ -5150,15 +5201,15 @@ function Ha(e) {
5150
5201
  }
5151
5202
  function re(a, l) {
5152
5203
  if (!a) return null;
5153
- const p = a, b = p.info ?? {}, k = p.components?.securitySchemes ?? {}, y = ["get", "post", "put", "patch", "delete", "head", "options"], f = (S) => H(S, p)?.example, _ = /* @__PURE__ */ new Map(), E = p.paths ?? {};
5154
- for (const [S, C] of Object.entries(E)) {
5155
- const F = H(C, p);
5204
+ const p = a, b = p.info ?? {}, k = p.components?.securitySchemes ?? {}, y = ["get", "post", "put", "patch", "delete", "head", "options"], f = (j) => H(j, p)?.example, _ = /* @__PURE__ */ new Map(), C = p.paths ?? {};
5205
+ for (const [j, O] of Object.entries(C)) {
5206
+ const F = H(O, p);
5156
5207
  if (!F || typeof F != "object") continue;
5157
- const B = (F.parameters ?? []).map((T) => H(T, p));
5158
- for (const T of y) {
5159
- const W = F[T];
5208
+ const B = (F.parameters ?? []).map((M) => H(M, p));
5209
+ for (const M of y) {
5210
+ const W = F[M];
5160
5211
  if (!W) continue;
5161
- const L = W.operationId ?? `${T}-${S.replace(/[^a-z0-9]+/gi, "-")}`, J = W.tags?.[0] ?? "default", Z = (W.parameters ?? []).map((_e) => H(_e, p)), ee = [...B, ...Z], N = /* @__PURE__ */ new Set(), z = [];
5212
+ const L = W.operationId ?? `${M}-${j.replace(/[^a-z0-9]+/gi, "-")}`, J = W.tags?.[0] ?? "default", Z = (W.parameters ?? []).map((_e) => H(_e, p)), ee = [...B, ...Z], N = /* @__PURE__ */ new Set(), z = [];
5162
5213
  for (const _e of ee) {
5163
5214
  const ae = _e;
5164
5215
  if (!ae || typeof ae != "object" || !ae.name || !ae.in) continue;
@@ -5182,8 +5233,8 @@ function Ha(e) {
5182
5233
  }
5183
5234
  const me = {
5184
5235
  id: L,
5185
- method: T.toUpperCase(),
5186
- path: S,
5236
+ method: M.toUpperCase(),
5237
+ path: j,
5187
5238
  tag: J,
5188
5239
  summary: W.summary ?? L,
5189
5240
  summary_html: K(l, W.summary),
@@ -5201,10 +5252,10 @@ function Ha(e) {
5201
5252
  _.has(J) || _.set(J, []), _.get(J).push(me);
5202
5253
  }
5203
5254
  }
5204
- const $ = [..._.entries()].map(([S, C]) => ({ name: S, operations: C })).sort((S, C) => S.name.localeCompare(C.name)), D = p.components?.schemas ?? {}, U = {};
5205
- for (const [S, C] of Object.entries(D)) {
5206
- const F = K(l, C?.description);
5207
- U[S] = F ? { ...C, description_html: F } : C;
5255
+ const $ = [..._.entries()].map(([j, O]) => ({ name: j, operations: O })).sort((j, O) => j.name.localeCompare(O.name)), S = p.components?.schemas ?? {}, U = {};
5256
+ for (const [j, O] of Object.entries(S)) {
5257
+ const F = K(l, O?.description);
5258
+ U[j] = F ? { ...O, description_html: F } : O;
5208
5259
  }
5209
5260
  return {
5210
5261
  title: b.title ?? "API",
@@ -5218,9 +5269,9 @@ function Ha(e) {
5218
5269
  };
5219
5270
  }
5220
5271
  async function he(a) {
5221
- const l = await ie(a, "utf-8"), { data: p, content: b } = gt(l);
5272
+ const l = await ie(a, "utf-8"), { data: p, content: b } = _t(l);
5222
5273
  typeof p.type == "number" && (p.type = String(p.type));
5223
- const k = to(p, b);
5274
+ const k = so(p, b);
5224
5275
  if (k.length) {
5225
5276
  const X = `${a}
5226
5277
  ${k.join(`
@@ -5228,39 +5279,39 @@ function Ha(e) {
5228
5279
  if (c) throw new Error(`[nimpress] invalid frontmatter in ${X}`);
5229
5280
  console.warn(`[nimpress] invalid frontmatter in ${X}`);
5230
5281
  }
5231
- const y = Qn.safeParse(p), f = y.success ? y.data : { title: a }, _ = sa(n, a), E = f.type ?? "doc", $ = Pn(f.path ?? aa(_)), D = typeof f.link == "string" && f.link.trim() !== "" ? f.link.trim() : void 0, U = !!D || p.type === void 0 && b.trim() === "", S = t.defaultFrontmatter ?? {};
5282
+ const y = no.safeParse(p), f = y.success ? y.data : { title: a }, _ = aa(n, a), C = f.type ?? "doc", $ = Cn(f.path ?? ca(_)), S = typeof f.link == "string" && f.link.trim() !== "" ? f.link.trim() : void 0, U = !!S || p.type === void 0 && b.trim() === "", j = t.defaultFrontmatter ?? {};
5232
5283
  if (!(t.defaultFrontmatterExclude ?? []).some((X) => {
5233
5284
  const le = X.startsWith("/") ? X : "/" + X;
5234
5285
  return $ === le || $.startsWith(le + "/");
5235
5286
  }))
5236
- for (const [X, le] of Object.entries(S)) {
5237
- const Me = X;
5238
- Me === "hide" ? f.hide = Array.from(/* @__PURE__ */ new Set([...le ?? [], ...f.hide ?? []])) : (f[Me] === void 0 || f[Me] === null || f[Me] === "") && (f[Me] = le);
5287
+ for (const [X, le] of Object.entries(j)) {
5288
+ const Te = X;
5289
+ Te === "hide" ? f.hide = Array.from(/* @__PURE__ */ new Set([...le ?? [], ...f.hide ?? []])) : (f[Te] === void 0 || f[Te] === null || f[Te] === "") && (f[Te] = le);
5239
5290
  }
5240
- const B = await O(), T = Dn(B, be(), t.base, { math: t.math, icons: t.icons, glossary: g }), W = Ra(b, a), L = Wa(T, W), J = T.render(W, { glossaryPage: E === "glossary" });
5241
- if (E === "team" || E === "pricing") {
5291
+ const B = await D(), M = Nn(B, be(), t.base, { math: t.math, icons: t.icons, glossary: g }), W = Wa(b, a), L = Ha(M, W), J = M.render(W, { glossaryPage: C === "glossary" });
5292
+ if (C === "team" || C === "pricing") {
5242
5293
  const X = { ...f.data ?? {} };
5243
- Array.isArray(X.members) && (X.members = X.members.map((le) => ({ ...le, bioHtml: typeof le.bio == "string" ? T.renderInline(le.bio) : "" }))), Array.isArray(X.tiers) && (X.tiers = X.tiers.map((le) => ({ ...le, benefitsHtml: Array.isArray(le.benefits) ? le.benefits.map((Me) => T.renderInline(String(Me))) : [] }))), typeof X.footnote == "string" && (X.footnoteHtml = T.renderInline(X.footnote)), f.data = X;
5294
+ Array.isArray(X.members) && (X.members = X.members.map((le) => ({ ...le, bioHtml: typeof le.bio == "string" ? M.renderInline(le.bio) : "" }))), Array.isArray(X.tiers) && (X.tiers = X.tiers.map((le) => ({ ...le, benefitsHtml: Array.isArray(le.benefits) ? le.benefits.map((Te) => M.renderInline(String(Te))) : [] }))), typeof X.footnote == "string" && (X.footnoteHtml = M.renderInline(X.footnote)), f.data = X;
5244
5295
  }
5245
5296
  let Z, ee, N, z;
5246
- if (E === "openapi")
5297
+ if (C === "openapi")
5247
5298
  if (!f.spec)
5248
5299
  console.warn(`[nimpress] page ${a} has type openapi but no spec field`);
5249
5300
  else {
5250
- z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N = oa(n, z);
5301
+ z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N = ra(n, z);
5251
5302
  const X = await x(a, f.spec);
5252
- Z = X ? re(X, T) ?? void 0 : void 0;
5303
+ Z = X ? re(X, M) ?? void 0 : void 0;
5253
5304
  }
5254
5305
  let V, se, ne, Q;
5255
- if (E === "dbml")
5306
+ if (C === "dbml")
5256
5307
  if (!f.spec)
5257
5308
  console.warn(`[nimpress] page ${a} has type dbml but no spec field`);
5258
5309
  else {
5259
5310
  z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ne = Ce(z);
5260
5311
  try {
5261
- se = await ie(z, "utf-8"), V = Hn(se);
5312
+ se = await ie(z, "utf-8"), V = Un(se);
5262
5313
  } catch (X) {
5263
- Q = X instanceof Gt ? X.message : String(X);
5314
+ Q = X instanceof Yt ? X.message : String(X);
5264
5315
  const le = `${a} -> ${f.spec}
5265
5316
  ${Q}`;
5266
5317
  if (c) throw new Error(`[nimpress] invalid dbml in ${le}`);
@@ -5269,8 +5320,8 @@ function Ha(e) {
5269
5320
  }
5270
5321
  te(a, z);
5271
5322
  let ue, me = [];
5272
- if (E === "component") {
5273
- const X = await Dr({
5323
+ if (C === "component") {
5324
+ const X = await Mr({
5274
5325
  cwd: process.cwd(),
5275
5326
  modules: t.modules,
5276
5327
  pageFile: a,
@@ -5283,24 +5334,24 @@ function Ha(e) {
5283
5334
  const _e = a.replace(/\.md$/, ".css");
5284
5335
  let ae;
5285
5336
  const $e = [];
5286
- _e !== a && de(_e) && $e.push(await ie(_e, "utf-8"));
5337
+ _e !== a && fe(_e) && $e.push(await ie(_e, "utf-8"));
5287
5338
  const Be = Ce(a, ".md");
5288
5339
  for (const X of Le(Y(a)).sort()) {
5289
- const le = Sa(X, Be);
5290
- le && $e.push(On(le, await ie(q(Y(a), X), "utf-8")));
5340
+ const le = Pa(X, Be);
5341
+ le && $e.push(Mn(le, await ie(q(Y(a), X), "utf-8")));
5291
5342
  }
5292
5343
  for (const X of f.styles ?? []) {
5293
5344
  const le = G(Y(a), X);
5294
- de(le) ? $e.push(await ie(le, "utf-8")) : console.warn(`[nimpress] ${a}: styles entry ${X} does not resolve`);
5345
+ fe(le) ? $e.push(await ie(le, "utf-8")) : console.warn(`[nimpress] ${a}: styles entry ${X} does not resolve`);
5295
5346
  }
5296
5347
  return $e.length && (ae = $e.join(`
5297
5348
  `)), {
5298
5349
  slug: _,
5299
5350
  filePath: a,
5300
5351
  effectivePath: $,
5301
- type: E,
5352
+ type: C,
5302
5353
  sidebarOnly: U,
5303
- linkTo: D,
5354
+ linkTo: S,
5304
5355
  frontmatter: f,
5305
5356
  html: J,
5306
5357
  headings: L,
@@ -5317,15 +5368,15 @@ function Ha(e) {
5317
5368
  };
5318
5369
  }
5319
5370
  function te(a, l) {
5320
- for (const [p, b] of j)
5321
- b === a && j.delete(p);
5322
- l && (j.set(l, a), u && !P.has(l) && (u.watcher.add(l), P.add(l)));
5371
+ for (const [p, b] of P)
5372
+ b === a && P.delete(p);
5373
+ l && (P.set(l, a), u && !A.has(l) && (u.watcher.add(l), A.add(l)));
5323
5374
  }
5324
5375
  function ge(a, l) {
5325
- for (const [p, b] of M)
5326
- b === a && M.delete(p);
5376
+ for (const [p, b] of T)
5377
+ b === a && T.delete(p);
5327
5378
  for (const p of l)
5328
- M.set(p, a), u && !d.has(p) && (u.watcher.add(p), d.add(p));
5379
+ T.set(p, a), u && !d.has(p) && (u.watcher.add(p), d.add(p));
5329
5380
  }
5330
5381
  async function oe(a) {
5331
5382
  let l;
@@ -5339,7 +5390,7 @@ function Ha(e) {
5339
5390
  const k = await he(a);
5340
5391
  return k ? (h.set(a, { hash: p, processed: k }), k) : (h.delete(a), null);
5341
5392
  }
5342
- function fe(a) {
5393
+ function de(a) {
5343
5394
  h.delete(a);
5344
5395
  }
5345
5396
  function be() {
@@ -5358,87 +5409,87 @@ function Ha(e) {
5358
5409
  return !1;
5359
5410
  }
5360
5411
  async function He() {
5361
- const a = await Qt(n), l = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
5412
+ const a = await nn(n), l = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
5362
5413
  let f, _;
5363
- const E = [], $ = [];
5364
- let D = [];
5365
- for (const S of a) {
5366
- if (!S.endsWith(".md")) continue;
5367
- let C = "";
5414
+ const C = [], $ = [];
5415
+ let S = [];
5416
+ for (const j of a) {
5417
+ if (!j.endsWith(".md")) continue;
5418
+ let O = "";
5368
5419
  try {
5369
- C = await ie(S, "utf-8");
5420
+ O = await ie(j, "utf-8");
5370
5421
  } catch {
5371
5422
  continue;
5372
5423
  }
5373
- const { data: F, content: B } = gt(C);
5374
- String(F.type) === "glossary" && ($.push(S), D = xa(new Nn().use(In), B));
5424
+ const { data: F, content: B } = _t(O);
5425
+ String(F.type) === "glossary" && ($.push(j), S = ja(new Rn().use(Bn), B));
5375
5426
  }
5376
5427
  if ($.length > 1) throw new Error(`[nimpress] one type glossary page per site: ${$.join(" and ")}`);
5377
- g = D, w = JSON.stringify(D);
5428
+ g = S, w = JSON.stringify(S);
5378
5429
  const U = new Set(a);
5379
- for (const S of [...h.keys()])
5380
- U.has(S) || h.delete(S);
5381
- for (const S of a) {
5382
- let C = null;
5430
+ for (const j of [...h.keys()])
5431
+ U.has(j) || h.delete(j);
5432
+ for (const j of a) {
5433
+ let O = null;
5383
5434
  try {
5384
- C = await oe(S);
5435
+ O = await oe(j);
5385
5436
  } catch (B) {
5386
- console.warn(`[nimpress] failed to process ${S}:`, B);
5437
+ console.warn(`[nimpress] failed to process ${j}:`, B);
5387
5438
  continue;
5388
5439
  }
5389
- if (!C || Fe(C.slug)) continue;
5390
- if (E.push(C), C.type === "changelog") {
5391
- const T = `${ra(C.slug)}\0${C.frontmatter.title}`, W = b.get(T) ?? [];
5392
- W.push(C), b.set(T, W);
5440
+ if (!O || Fe(O.slug)) continue;
5441
+ if (C.push(O), O.type === "changelog") {
5442
+ const M = `${ia(O.slug)}\0${O.frontmatter.title}`, W = b.get(M) ?? [];
5443
+ W.push(O), b.set(M, W);
5393
5444
  continue;
5394
5445
  }
5395
- if (C.type === "roadmap") {
5396
- const B = String(C.filePath);
5397
- k.set(B, [C]);
5446
+ if (O.type === "roadmap") {
5447
+ const B = String(O.filePath);
5448
+ k.set(B, [O]);
5398
5449
  }
5399
- if (C.type === "section" && !C.filePath.endsWith(`${xe}index.md`))
5400
- throw new Error(`[nimpress] type section belongs on a folder index.md: ${C.filePath}`);
5401
- if (C.type === "glossary" && !C.html.includes("<dl"))
5402
- throw new Error(`[nimpress] type glossary needs a definition list body: ${C.filePath}`);
5403
- if (C.type === "tags") {
5404
- if (_ && _ !== C.filePath)
5405
- throw new Error(`[nimpress] one type tags page per site: ${_} and ${C.filePath}`);
5406
- _ = C.filePath;
5450
+ if (O.type === "section" && !O.filePath.endsWith(`${xe}index.md`))
5451
+ throw new Error(`[nimpress] type section belongs on a folder index.md: ${O.filePath}`);
5452
+ if (O.type === "glossary" && !O.html.includes("<dl"))
5453
+ throw new Error(`[nimpress] type glossary needs a definition list body: ${O.filePath}`);
5454
+ if (O.type === "tags") {
5455
+ if (_ && _ !== O.filePath)
5456
+ throw new Error(`[nimpress] one type tags page per site: ${_} and ${O.filePath}`);
5457
+ _ = O.filePath;
5407
5458
  }
5408
- if (C.type === "404") {
5409
- if (f && f !== C.filePath)
5410
- throw new Error(`[nimpress] one type 404 page per site: ${f} and ${C.filePath}`);
5411
- f = C.filePath;
5459
+ if (O.type === "404") {
5460
+ if (f && f !== O.filePath)
5461
+ throw new Error(`[nimpress] one type 404 page per site: ${f} and ${O.filePath}`);
5462
+ f = O.filePath;
5412
5463
  }
5413
- if (C.type === "component") {
5414
- const B = Y(C.filePath), T = y.get(B);
5415
- if (T)
5464
+ if (O.type === "component") {
5465
+ const B = Y(O.filePath), M = y.get(B);
5466
+ if (M)
5416
5467
  throw new Error(
5417
- `[nimpress] one type component page per folder: ${B} holds ${T} and ${C.filePath}`
5468
+ `[nimpress] one type component page per folder: ${B} holds ${M} and ${O.filePath}`
5418
5469
  );
5419
- y.set(B, C.filePath);
5470
+ y.set(B, O.filePath);
5420
5471
  }
5421
- const F = p.get(C.effectivePath);
5472
+ const F = p.get(O.effectivePath);
5422
5473
  if (F)
5423
5474
  throw new Error(
5424
- `[nimpress] duplicate path ${C.effectivePath}: ${F} and ${C.filePath}`
5475
+ `[nimpress] duplicate path ${O.effectivePath}: ${F} and ${O.filePath}`
5425
5476
  );
5426
- p.set(C.effectivePath, C.filePath), l.set(C.slug, C);
5477
+ p.set(O.effectivePath, O.filePath), l.set(O.slug, O);
5427
5478
  }
5428
- vt.clear();
5429
- for (const [S, C] of b) {
5430
- const F = S.split("\0", 1)[0], B = Pn(F ? "/" + F : "/");
5479
+ xt.clear();
5480
+ for (const [j, O] of b) {
5481
+ const F = j.split("\0", 1)[0], B = Cn(F ? "/" + F : "/");
5431
5482
  if (p.has(B))
5432
5483
  throw new Error(
5433
5484
  `[nimpress] path ${B} is occupied by both a changelog collection and a regular page`
5434
5485
  );
5435
- const T = C.filter((N) => !(c && Se(N.frontmatter)));
5436
- if (T.length === 0) continue;
5437
- T.sort((N, z) => {
5486
+ const M = O.filter((N) => !(c && Se(N.frontmatter)));
5487
+ if (M.length === 0) continue;
5488
+ M.sort((N, z) => {
5438
5489
  const V = String(N.frontmatter.data?.version ?? ""), se = String(z.frontmatter.data?.version ?? "");
5439
- return na(se, V);
5490
+ return sa(se, V);
5440
5491
  });
5441
- const W = T[0], L = `__changelog__${(F || "root").replace(/\//g, "__")}`, J = T.map((N) => {
5492
+ const W = M[0], L = `__changelog__${(F || "root").replace(/\//g, "__")}`, J = M.map((N) => {
5442
5493
  const z = N.frontmatter.data, V = String(z?.version ?? ""), se = String(z?.title ?? ""), ne = z?.description !== void 0 ? String(z.description) : void 0, Q = z?.release_date;
5443
5494
  let ue;
5444
5495
  if (Q != null && String(Q).trim() !== "") {
@@ -5450,7 +5501,7 @@ function Ha(e) {
5450
5501
  ue = ae.toISOString();
5451
5502
  }
5452
5503
  const me = V ? `v${V}` : "unreleased";
5453
- return vt.set(`${L}#${me}`, N.rawText), {
5504
+ return xt.set(`${L}#${me}`, N.rawText), {
5454
5505
  version: V,
5455
5506
  slug: me,
5456
5507
  title: se,
@@ -5474,43 +5525,43 @@ function Ha(e) {
5474
5525
  ...W.frontmatter,
5475
5526
  path: B,
5476
5527
  type: "changelog",
5477
- rss: T.some((N) => N.frontmatter.rss === !0) ? !0 : void 0,
5478
- subscribe: T.some((N) => N.frontmatter.subscribe === !0) ? !0 : void 0
5528
+ rss: M.some((N) => N.frontmatter.rss === !0) ? !0 : void 0,
5529
+ subscribe: M.some((N) => N.frontmatter.subscribe === !0) ? !0 : void 0
5479
5530
  },
5480
5531
  html: "",
5481
5532
  headings: Z,
5482
- rawText: T.map((N) => N.rawText).join(`
5533
+ rawText: M.map((N) => N.rawText).join(`
5483
5534
 
5484
5535
  `),
5485
5536
  changelogEntries: J
5486
5537
  };
5487
5538
  p.set(B, ee.filePath), l.set(ee.slug, ee);
5488
5539
  }
5489
- if (_o(k, E), ro(l), so(l), t.seo?.auto) {
5490
- const S = Aa(E.map((C) => ({
5491
- slug: C.slug,
5492
- title: C.frontmatter.title,
5493
- headings: C.headings.map((F) => F.text),
5494
- tags: Re(C.frontmatter.tags),
5495
- body: C.rawText
5540
+ if (wo(k, C), co(l), io(l), t.seo?.auto) {
5541
+ const j = Ca(C.map((O) => ({
5542
+ slug: O.slug,
5543
+ title: O.frontmatter.title,
5544
+ headings: O.headings.map((F) => F.text),
5545
+ tags: Re(O.frontmatter.tags),
5546
+ body: O.rawText
5496
5547
  })));
5497
- for (const C of E) {
5498
- const F = S.get(C.slug);
5548
+ for (const O of C) {
5549
+ const F = j.get(O.slug);
5499
5550
  if (!F) continue;
5500
- const B = C.frontmatter.meta ?? {}, T = B.override === !0, W = T && B.keywords ? B.keywords : F.keywords.length ? F.keywords : B.keywords, L = T && B.description ? B.description : F.description || B.description;
5501
- C.frontmatter.meta = { ...B, ...W ? { keywords: W } : {}, ...L ? { description: L } : {} };
5551
+ const B = O.frontmatter.meta ?? {}, M = B.override === !0, W = M && B.keywords ? B.keywords : F.keywords.length ? F.keywords : B.keywords, L = M && B.description ? B.description : F.description || B.description;
5552
+ O.frontmatter.meta = { ...B, ...W ? { keywords: W } : {}, ...L ? { description: L } : {} };
5502
5553
  }
5503
5554
  }
5504
5555
  s = l;
5505
5556
  }
5506
- const ze = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Map();
5507
- let kt = JSON.stringify({ pages: [] }, null, 2) + `
5557
+ const ze = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Map();
5558
+ let St = JSON.stringify({ pages: [] }, null, 2) + `
5508
5559
  `;
5509
- function so(a) {
5560
+ function io(a) {
5510
5561
  const l = [];
5511
5562
  for (const p of a.values()) {
5512
- if (p.frontmatter.subscribe !== !0 || Mt(p.frontmatter)) continue;
5513
- const b = p.effectivePath === "/" ? "" : p.effectivePath, y = `${ve(p) ? `/${t.paths.guarded}/${st(p)}` : ""}${b}/${jn(0)}`;
5563
+ if (p.frontmatter.subscribe !== !0 || It(p.frontmatter)) continue;
5564
+ const b = p.effectivePath === "/" ? "" : p.effectivePath, y = `${ve(p) ? `/${t.paths.guarded}/${st(p)}` : ""}${b}/${En(0)}`;
5514
5565
  if (!ze.has(y)) continue;
5515
5566
  const f = {
5516
5567
  path: p.effectivePath,
@@ -5524,13 +5575,13 @@ function Ha(e) {
5524
5575
  date: _.releaseDate,
5525
5576
  title: _.title,
5526
5577
  description: _.description,
5527
- body: vt.get(`${p.slug}#${_.slug}`) ?? ""
5578
+ body: xt.get(`${p.slug}#${_.slug}`) ?? ""
5528
5579
  }))), l.push(f);
5529
5580
  }
5530
- l.sort((p, b) => p.path.localeCompare(b.path)), kt = JSON.stringify({ pages: l }, null, 2) + `
5581
+ l.sort((p, b) => p.path.localeCompare(b.path)), St = JSON.stringify({ pages: l }, null, 2) + `
5531
5582
  `;
5532
5583
  }
5533
- function ro(a) {
5584
+ function co(a) {
5534
5585
  ze.clear();
5535
5586
  const l = t.site?.url?.replace(/\/$/, "");
5536
5587
  for (const p of a.values()) {
@@ -5541,13 +5592,13 @@ function Ha(e) {
5541
5592
  }
5542
5593
  const b = (p.changelogEntries ?? []).filter((L) => !L.hidden);
5543
5594
  if (b.length === 0) continue;
5544
- const k = p.effectivePath === "/" ? "" : p.effectivePath, y = `${l}${we(t.base, k || "/")}`, f = ve(p) ? `/${t.paths.guarded}/${st(p)}` : "", _ = (L) => `${f}${k}/${jn(L)}`, E = b.map((L) => L.releaseDate ? new Date(L.releaseDate).getTime() : Number.NaN).filter((L) => !Number.isNaN(L)).sort((L, J) => J - L), $ = [];
5545
- for (let L = 0; L + 1 < E.length; L++) $.push(E[L] - E[L + 1]);
5546
- const D = $.length ? Math.round($.reduce((L, J) => L + J, 0) / $.length / 1e3) : void 0, U = D ? Math.min(43200, Math.max(60, Math.round(D / 60))) : 1440, S = D ? D <= 172800 ? "daily" : D <= 1209600 ? "weekly" : D <= 5184e3 ? "monthly" : "yearly" : "weekly", C = E.length ? new Date(E[0]).toUTCString() : void 0, F = ye(p.frontmatter.title), B = ye(
5595
+ const k = p.effectivePath === "/" ? "" : p.effectivePath, y = `${l}${we(t.base, k || "/")}`, f = ve(p) ? `/${t.paths.guarded}/${st(p)}` : "", _ = (L) => `${f}${k}/${En(L)}`, C = b.map((L) => L.releaseDate ? new Date(L.releaseDate).getTime() : Number.NaN).filter((L) => !Number.isNaN(L)).sort((L, J) => J - L), $ = [];
5596
+ for (let L = 0; L + 1 < C.length; L++) $.push(C[L] - C[L + 1]);
5597
+ const S = $.length ? Math.round($.reduce((L, J) => L + J, 0) / $.length / 1e3) : void 0, U = S ? Math.min(43200, Math.max(60, Math.round(S / 60))) : 1440, j = S ? S <= 172800 ? "daily" : S <= 1209600 ? "weekly" : S <= 5184e3 ? "monthly" : "yearly" : "weekly", O = C.length ? new Date(C[0]).toUTCString() : void 0, F = ye(p.frontmatter.title), B = ye(
5547
5598
  p.frontmatter.description ?? t.site?.description ?? p.frontmatter.title
5548
- ), T = t.site?.locale?.replace("_", "-").toLowerCase(), W = Math.max(1, Math.ceil(b.length / Ot));
5599
+ ), M = t.site?.locale?.replace("_", "-").toLowerCase(), W = Math.max(1, Math.ceil(b.length / Mt));
5549
5600
  for (let L = 0; L < W; L++) {
5550
- const J = b.slice(L * Ot, (L + 1) * Ot), Z = [
5601
+ const J = b.slice(L * Mt, (L + 1) * Mt), Z = [
5551
5602
  `<atom:link href="${ye(`${l}${we(t.base, _(L))}`)}" rel="self" type="application/rss+xml"/>`
5552
5603
  ];
5553
5604
  L > 0 && Z.push(
@@ -5563,7 +5614,7 @@ function Ha(e) {
5563
5614
  `<link>${ye(se)}</link>`,
5564
5615
  `<guid isPermaLink="true">${ye(se)}</guid>`
5565
5616
  ];
5566
- return V.releaseDate && ne.push(`<pubDate>${new Date(V.releaseDate).toUTCString()}</pubDate>`), V.description && ne.push(`<description>${ye(V.description)}</description>`), V.html && ne.push(`<content:encoded>${Gr(V.html)}</content:encoded>`), ` <item>
5617
+ return V.releaseDate && ne.push(`<pubDate>${new Date(V.releaseDate).toUTCString()}</pubDate>`), V.description && ne.push(`<description>${ye(V.description)}</description>`), V.html && ne.push(`<content:encoded>${Xr(V.html)}</content:encoded>`), ` <item>
5567
5618
  ${ne.join(`
5568
5619
  `)}
5569
5620
  </item>`;
@@ -5573,10 +5624,10 @@ function Ha(e) {
5573
5624
  `<description>${B}</description>`,
5574
5625
  ...Z
5575
5626
  ];
5576
- T && N.push(`<language>${ye(T)}</language>`), C && N.push(`<lastBuildDate>${C}</lastBuildDate>`), N.push(`<ttl>${U}</ttl>`), N.push(`<sy:updatePeriod>${S}</sy:updatePeriod>`), N.push("<sy:updateFrequency>1</sy:updateFrequency>"), D !== void 0 && N.push(`<nimpress:releaseCadence>${D}</nimpress:releaseCadence>`), N.push(`<nimpress:latestVersion>${ye(b[0].version)}</nimpress:latestVersion>`), N.push(`<nimpress:releaseCount>${b.length}</nimpress:releaseCount>`), L > 0 && N.push("<fh:archive/>");
5627
+ M && N.push(`<language>${ye(M)}</language>`), O && N.push(`<lastBuildDate>${O}</lastBuildDate>`), N.push(`<ttl>${U}</ttl>`), N.push(`<sy:updatePeriod>${j}</sy:updatePeriod>`), N.push("<sy:updateFrequency>1</sy:updateFrequency>"), S !== void 0 && N.push(`<nimpress:releaseCadence>${S}</nimpress:releaseCadence>`), N.push(`<nimpress:latestVersion>${ye(b[0].version)}</nimpress:latestVersion>`), N.push(`<nimpress:releaseCount>${b.length}</nimpress:releaseCount>`), L > 0 && N.push("<fh:archive/>");
5577
5628
  const z = [
5578
5629
  '<?xml version="1.0" encoding="UTF-8"?>',
5579
- `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:nimpress="${Jr}">`,
5630
+ `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:nimpress="${Vr}">`,
5580
5631
  " <channel>",
5581
5632
  ` ${N.join(`
5582
5633
  `)}`,
@@ -5590,11 +5641,11 @@ function Ha(e) {
5590
5641
  }
5591
5642
  }
5592
5643
  }
5593
- const $t = /* @__PURE__ */ new Map();
5644
+ const jt = /* @__PURE__ */ new Map();
5594
5645
  function ve(a) {
5595
5646
  return a.frontmatter.gate !== void 0;
5596
5647
  }
5597
- function ao(a) {
5648
+ function lo(a) {
5598
5649
  const l = Y(a.filePath);
5599
5650
  let p = [];
5600
5651
  try {
@@ -5606,12 +5657,12 @@ function Ha(e) {
5606
5657
  }
5607
5658
  function st(a) {
5608
5659
  const l = t.auth?.guard;
5609
- return typeof l == "function" ? l(a.frontmatter, je(process.cwd(), a.filePath), ao(a)) : a.frontmatter.gate ?? "default";
5660
+ return typeof l == "function" ? l(a.frontmatter, je(process.cwd(), a.filePath), lo(a)) : a.frontmatter.gate ?? "default";
5610
5661
  }
5611
- function io() {
5662
+ function po() {
5612
5663
  const a = [];
5613
5664
  for (const l of s.values())
5614
- l.sidebarOnly || Mt(l.frontmatter) || ve(l) || a.push(l);
5665
+ l.sidebarOnly || It(l.frontmatter) || ve(l) || a.push(l);
5615
5666
  return a;
5616
5667
  }
5617
5668
  function Pe(a) {
@@ -5619,11 +5670,11 @@ function Ha(e) {
5619
5670
  if (l)
5620
5671
  return l + we(t.base, a.startsWith("/") ? a : "/" + a);
5621
5672
  }
5622
- function en(a) {
5623
- if ($t.has(a)) return $t.get(a);
5673
+ function on(a) {
5674
+ if (jt.has(a)) return jt.get(a);
5624
5675
  let l;
5625
5676
  try {
5626
- l = Mo("git", ["log", "-1", "--format=%cI", "--", a], {
5677
+ l = Io("git", ["log", "-1", "--format=%cI", "--", a], {
5627
5678
  cwd: process.cwd(),
5628
5679
  encoding: "utf-8",
5629
5680
  stdio: ["ignore", "pipe", "ignore"]
@@ -5631,25 +5682,25 @@ function Ha(e) {
5631
5682
  } catch {
5632
5683
  l = void 0;
5633
5684
  }
5634
- return $t.set(a, l), l;
5685
+ return jt.set(a, l), l;
5635
5686
  }
5636
- function co(a) {
5687
+ function uo(a) {
5637
5688
  return a === "changelog" || a === "roadmap" ? "CollectionPage" : a === "openapi" ? "APIReference" : a === "hero" || a === "fullpage" || a === "404" ? "WebPage" : a === "section" || a === "tags" ? "CollectionPage" : a === "glossary" ? "DefinedTermSet" : a === "team" ? "AboutPage" : "TechArticle";
5638
5689
  }
5639
- function lo(a) {
5640
- const l = t.meta ?? {}, p = t.site, b = a.frontmatter, k = b.meta ?? {}, y = k.og ?? {}, f = k.twitter ?? {}, _ = b.title, E = p?.title && p.title !== _ ? `${_} · ${p.title}` : _, $ = k.description ?? b.description ?? p?.description, D = k.canonical ?? Pe(a.effectivePath), U = (() => {
5690
+ function mo(a) {
5691
+ const l = t.meta ?? {}, p = t.site, b = a.frontmatter, k = b.meta ?? {}, y = k.og ?? {}, f = k.twitter ?? {}, _ = b.title, C = p?.title && p.title !== _ ? `${_} · ${p.title}` : _, $ = k.description ?? b.description ?? p?.description, S = k.canonical ?? Pe(a.effectivePath), U = (() => {
5641
5692
  if (k.keywords) return Array.isArray(k.keywords) ? k.keywords : [k.keywords];
5642
5693
  const ne = Re(b.tags);
5643
5694
  return ne.length ? ne : l.keywords ?? [];
5644
- })(), S = Ea(k.robots ?? "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1", t.seo?.ai?.index, k.ai), C = y.title ?? _, F = y.description ?? $, B = y.image ?? p?.ogImage, T = B ? Pe(B) ?? B : void 0, W = y.type ?? (b.type === "hero" || b.type === "fullpage" || a.effectivePath === "/" ? "website" : "article"), L = l.og?.width ?? 1200, J = l.og?.height ?? 600, Z = f.card ?? (T ? "summary_large_image" : "summary"), ee = f.site ?? p?.twitterSite, N = tt, z = [];
5645
- if (z.push(`<title>${N(E)}</title>`), $ && z.push(`<meta name="description" content="${N($)}">`), U.length && z.push(`<meta name="keywords" content="${N(U.join(", "))}">`), z.push(`<meta name="robots" content="${N(S)}">`), z.push(`<meta name="googlebot" content="${N(S)}">`), D) {
5646
- z.push(`<link rel="canonical" href="${N(D)}">`);
5695
+ })(), j = Oa(k.robots ?? "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1", t.seo?.ai?.index, k.ai), O = y.title ?? _, F = y.description ?? $, B = y.image ?? p?.ogImage, M = B ? Pe(B) ?? B : void 0, W = y.type ?? (b.type === "hero" || b.type === "fullpage" || a.effectivePath === "/" ? "website" : "article"), L = l.og?.width ?? 1200, J = l.og?.height ?? 600, Z = f.card ?? (M ? "summary_large_image" : "summary"), ee = f.site ?? p?.twitterSite, N = tt, z = [];
5696
+ if (z.push(`<title>${N(C)}</title>`), $ && z.push(`<meta name="description" content="${N($)}">`), U.length && z.push(`<meta name="keywords" content="${N(U.join(", "))}">`), z.push(`<meta name="robots" content="${N(j)}">`), z.push(`<meta name="googlebot" content="${N(j)}">`), S) {
5697
+ z.push(`<link rel="canonical" href="${N(S)}">`);
5647
5698
  const ne = l.localeAlternates ?? [];
5648
5699
  for (const Q of ne)
5649
- z.push(`<link rel="alternate" hreflang="${N(Q)}" href="${N(D)}">`);
5650
- ne.length && z.push(`<link rel="alternate" hreflang="x-default" href="${N(D)}">`);
5700
+ z.push(`<link rel="alternate" hreflang="${N(Q)}" href="${N(S)}">`);
5701
+ ne.length && z.push(`<link rel="alternate" hreflang="x-default" href="${N(S)}">`);
5651
5702
  }
5652
- if (z.push(`<meta property="og:title" content="${N(C)}">`), F && z.push(`<meta property="og:description" content="${N(F)}">`), z.push(`<meta property="og:type" content="${N(W)}">`), D && z.push(`<meta property="og:url" content="${N(D)}">`), T && (z.push(`<meta property="og:image" content="${N(T)}">`), z.push(`<meta property="og:image:width" content="${L}">`), z.push(`<meta property="og:image:height" content="${J}">`), y.imageAlt && z.push(`<meta property="og:image:alt" content="${N(y.imageAlt)}">`)), p?.title && z.push(`<meta property="og:site_name" content="${N(p.title)}">`), p?.locale && z.push(`<meta property="og:locale" content="${N(p.locale)}">`), z.push(`<meta name="twitter:card" content="${N(Z)}">`), ee && z.push(`<meta name="twitter:site" content="${N(ee)}">`), z.push(`<meta name="twitter:title" content="${N(f.title ?? C)}">`), (f.description ?? F) && z.push(`<meta name="twitter:description" content="${N(f.description ?? F ?? "")}">`), (f.image ?? T) && z.push(`<meta name="twitter:image" content="${N(f.image ?? T ?? "")}">`), $ && z.push(`<meta name="dc.description" content="${N($)}">`), z.push(`<meta name="dc.title" content="${N(E)}">`), p?.locale && z.push(`<meta name="dc.language" content="${N(p.locale)}">`), b.type === "changelog" && (b.rss === !0 || b.subscribe === !0)) {
5703
+ if (z.push(`<meta property="og:title" content="${N(O)}">`), F && z.push(`<meta property="og:description" content="${N(F)}">`), z.push(`<meta property="og:type" content="${N(W)}">`), S && z.push(`<meta property="og:url" content="${N(S)}">`), M && (z.push(`<meta property="og:image" content="${N(M)}">`), z.push(`<meta property="og:image:width" content="${L}">`), z.push(`<meta property="og:image:height" content="${J}">`), y.imageAlt && z.push(`<meta property="og:image:alt" content="${N(y.imageAlt)}">`)), p?.title && z.push(`<meta property="og:site_name" content="${N(p.title)}">`), p?.locale && z.push(`<meta property="og:locale" content="${N(p.locale)}">`), z.push(`<meta name="twitter:card" content="${N(Z)}">`), ee && z.push(`<meta name="twitter:site" content="${N(ee)}">`), z.push(`<meta name="twitter:title" content="${N(f.title ?? O)}">`), (f.description ?? F) && z.push(`<meta name="twitter:description" content="${N(f.description ?? F ?? "")}">`), (f.image ?? M) && z.push(`<meta name="twitter:image" content="${N(f.image ?? M ?? "")}">`), $ && z.push(`<meta name="dc.description" content="${N($)}">`), z.push(`<meta name="dc.title" content="${N(C)}">`), p?.locale && z.push(`<meta name="dc.language" content="${N(p.locale)}">`), b.type === "changelog" && (b.rss === !0 || b.subscribe === !0)) {
5653
5704
  const ne = a.effectivePath === "/" ? "/rss.xml" : `${a.effectivePath}/rss.xml`, Q = Pe(ne) ?? ne;
5654
5705
  z.push(`<link rel="alternate" type="application/rss+xml" title="${N(_)}" href="${N(Q)}">`);
5655
5706
  }
@@ -5661,7 +5712,7 @@ function Ha(e) {
5661
5712
  name: p.title,
5662
5713
  url: `${V}${we(t.base, "/")}`,
5663
5714
  description: p.description
5664
- }), D && a.effectivePath !== "/") {
5715
+ }), S && a.effectivePath !== "/") {
5665
5716
  const ne = [
5666
5717
  { name: p?.title ?? "Home", item: V ? `${V}${we(t.base, "/")}` : void 0 }
5667
5718
  ], Q = a.effectivePath.split("/").filter(Boolean);
@@ -5684,28 +5735,28 @@ function Ha(e) {
5684
5735
  }
5685
5736
  se.push({
5686
5737
  "@context": "https://schema.org",
5687
- "@type": co(a.type),
5688
- name: E,
5738
+ "@type": uo(a.type),
5739
+ name: C,
5689
5740
  headline: _,
5690
5741
  description: $,
5691
- url: D,
5742
+ url: S,
5692
5743
  isPartOf: V ? `${V}${we(t.base, "/")}#website` : void 0,
5693
- dateModified: en(a.filePath)
5744
+ dateModified: on(a.filePath)
5694
5745
  }), k.jsonLd && se.push(k.jsonLd);
5695
- for (const ne of se) z.push(Vr(ne));
5746
+ for (const ne of se) z.push(Yr(ne));
5696
5747
  return `
5697
5748
  ${z.join(`
5698
5749
  `)}
5699
5750
  `;
5700
5751
  }
5701
- function po() {
5752
+ function fo() {
5702
5753
  const a = t.meta ?? {};
5703
5754
  if (a.robots?.custom) return a.robots.custom;
5704
- const l = /* @__PURE__ */ new Set([...a.robots?.block ?? [], ...t.seo?.ai?.index === !1 ? Dt : []]), p = ["User-agent: *", "Allow: /", ""];
5705
- for (const k of Dt)
5755
+ const l = /* @__PURE__ */ new Set([...a.robots?.block ?? [], ...t.seo?.ai?.index === !1 ? Nt : []]), p = ["User-agent: *", "Allow: /", ""];
5756
+ for (const k of Nt)
5706
5757
  p.push(`User-agent: ${k}`), p.push(l.has(k) ? "Disallow: /" : "Allow: /"), p.push("");
5707
5758
  for (const k of l)
5708
- Dt.includes(k) || (p.push(`User-agent: ${k}`), p.push("Disallow: /"), p.push(""));
5759
+ Nt.includes(k) || (p.push(`User-agent: ${k}`), p.push("Disallow: /"), p.push(""));
5709
5760
  a.robots?.append && p.push(a.robots.append, "");
5710
5761
  const b = Pe("/sitemap.xml");
5711
5762
  return b && p.push(`Sitemap: ${b}`), p.join(`
@@ -5714,7 +5765,7 @@ function Ha(e) {
5714
5765
  `).trim() + `
5715
5766
  `;
5716
5767
  }
5717
- function uo(a) {
5768
+ function ho(a) {
5718
5769
  const l = t.site?.url?.replace(/\/$/, "");
5719
5770
  if (!l) return;
5720
5771
  const p = t.meta?.localeAlternates ?? [];
@@ -5722,12 +5773,12 @@ function Ha(e) {
5722
5773
  '<?xml version="1.0" encoding="UTF-8"?>',
5723
5774
  '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">',
5724
5775
  a.map((k) => {
5725
- const y = `${l}${we(t.base, k.effectivePath === "/" ? "/" : k.effectivePath)}`, f = k.effectivePath.split("/").filter(Boolean).length, _ = f === 0 ? "1.0" : f === 1 ? "0.8" : "0.6", E = f === 0 ? "weekly" : "monthly", $ = en(k.filePath), D = [` <loc>${ye(y)}</loc>`];
5726
- $ && D.push(` <lastmod>${ye($)}</lastmod>`), D.push(` <changefreq>${E}</changefreq>`), D.push(` <priority>${_}</priority>`);
5776
+ const y = `${l}${we(t.base, k.effectivePath === "/" ? "/" : k.effectivePath)}`, f = k.effectivePath.split("/").filter(Boolean).length, _ = f === 0 ? "1.0" : f === 1 ? "0.8" : "0.6", C = f === 0 ? "weekly" : "monthly", $ = on(k.filePath), S = [` <loc>${ye(y)}</loc>`];
5777
+ $ && S.push(` <lastmod>${ye($)}</lastmod>`), S.push(` <changefreq>${C}</changefreq>`), S.push(` <priority>${_}</priority>`);
5727
5778
  for (const U of p)
5728
- D.push(` <xhtml:link rel="alternate" hreflang="${ye(U)}" href="${ye(y)}"/>`);
5779
+ S.push(` <xhtml:link rel="alternate" hreflang="${ye(U)}" href="${ye(y)}"/>`);
5729
5780
  return ` <url>
5730
- ${D.join(`
5781
+ ${S.join(`
5731
5782
  `)}
5732
5783
  </url>`;
5733
5784
  }).join(`
@@ -5737,41 +5788,41 @@ ${D.join(`
5737
5788
  ].join(`
5738
5789
  `);
5739
5790
  }
5740
- function mo(a) {
5791
+ function go(a) {
5741
5792
  const l = t.meta ?? {}, p = t.site, b = [`# ${p?.title ?? t.title}`, ""], k = l.llms?.summary ?? p?.description;
5742
5793
  k && b.push(`> ${k}`, "");
5743
5794
  const y = /* @__PURE__ */ new Map(), f = [];
5744
5795
  for (const U of a) {
5745
- const S = U.effectivePath.split("/").filter(Boolean);
5746
- if (S.length === 0) {
5796
+ const j = U.effectivePath.split("/").filter(Boolean);
5797
+ if (j.length === 0) {
5747
5798
  f.push(U);
5748
5799
  continue;
5749
5800
  }
5750
- const C = S[0], F = y.get(C) ?? [];
5751
- F.push(U), y.set(C, F);
5801
+ const O = j[0], F = y.get(O) ?? [];
5802
+ F.push(U), y.set(O, F);
5752
5803
  }
5753
5804
  const _ = (U) => {
5754
- const S = Pe(U.effectivePath) ?? U.effectivePath;
5755
- return U.frontmatter.description ? `- [${U.frontmatter.title}](${S}): ${U.frontmatter.description}` : `- [${U.frontmatter.title}](${S})`;
5805
+ const j = Pe(U.effectivePath) ?? U.effectivePath;
5806
+ return U.frontmatter.description ? `- [${U.frontmatter.title}](${j}): ${U.frontmatter.description}` : `- [${U.frontmatter.title}](${j})`;
5756
5807
  };
5757
5808
  for (const U of f) b.push(_(U));
5758
5809
  f.length && b.push("");
5759
- for (const [U, S] of [...y.entries()].sort((C, F) => C[0].localeCompare(F[0]))) {
5760
- const C = S.find((F) => F.effectivePath === `/${U}`);
5761
- b.push(`## ${C?.frontmatter.title ?? mt(U)}`, ""), S.sort((F, B) => F.effectivePath.localeCompare(B.effectivePath));
5762
- for (const F of S) b.push(_(F));
5810
+ for (const [U, j] of [...y.entries()].sort((O, F) => O[0].localeCompare(F[0]))) {
5811
+ const O = j.find((F) => F.effectivePath === `/${U}`);
5812
+ b.push(`## ${O?.frontmatter.title ?? mt(U)}`, ""), j.sort((F, B) => F.effectivePath.localeCompare(B.effectivePath));
5813
+ for (const F of j) b.push(_(F));
5763
5814
  b.push("");
5764
5815
  }
5765
- const E = new Set(t.meta?.keywords ?? []);
5766
- for (const U of a) for (const S of Re(U.frontmatter.tags)) E.add(S);
5767
- E.size && b.push("## Keywords", "", [...E].join(", "), "");
5768
- const $ = Pe("/sitemap.xml"), D = Pe("/robots.txt");
5769
- return ($ || D) && (b.push("## Optional", ""), $ && b.push(`- [Sitemap](${$})`), D && b.push(`- [Robots](${D})`), b.push("")), l.llms?.append && b.push(l.llms.append, ""), b.join(`
5816
+ const C = new Set(t.meta?.keywords ?? []);
5817
+ for (const U of a) for (const j of Re(U.frontmatter.tags)) C.add(j);
5818
+ C.size && b.push("## Keywords", "", [...C].join(", "), "");
5819
+ const $ = Pe("/sitemap.xml"), S = Pe("/robots.txt");
5820
+ return ($ || S) && (b.push("## Optional", ""), $ && b.push(`- [Sitemap](${$})`), S && b.push(`- [Robots](${S})`), b.push("")), l.llms?.append && b.push(l.llms.append, ""), b.join(`
5770
5821
  `).replace(/\n{3,}/g, `
5771
5822
 
5772
5823
  `);
5773
5824
  }
5774
- function fo(a) {
5825
+ function _o(a) {
5775
5826
  const p = [`# ${t.site?.title ?? t.title}`, ""];
5776
5827
  for (const b of a) {
5777
5828
  p.push(`## ${b.frontmatter.title}`, "");
@@ -5783,15 +5834,15 @@ ${D.join(`
5783
5834
 
5784
5835
  `);
5785
5836
  }
5786
- async function ho() {
5787
- const a = t.meta ?? {}, l = io().sort((f, _) => f.effectivePath.localeCompare(_.effectivePath)), p = q(i, "index.html"), b = await ie(p, "utf-8");
5837
+ async function yo() {
5838
+ const a = t.meta ?? {}, l = po().sort((f, _) => f.effectivePath.localeCompare(_.effectivePath)), p = q(i, "index.html"), b = await ie(p, "utf-8");
5788
5839
  for (const f of l) {
5789
- const _ = lo(f), E = b.replace("</head>", `${_}</head>`), $ = f.effectivePath === "/" ? p : q(i, f.effectivePath.replace(/^\//, ""), "index.html");
5790
- await Ue(Y($), { recursive: !0 }), await pe($, E);
5840
+ const _ = mo(f), C = b.replace("</head>", `${_}</head>`), $ = f.effectivePath === "/" ? p : q(i, f.effectivePath.replace(/^\//, ""), "index.html");
5841
+ await Ue(Y($), { recursive: !0 }), await pe($, C);
5791
5842
  }
5792
- await pe(q(i, "robots.txt"), po());
5793
- const k = l.filter((f) => f.type !== "404"), y = uo(k);
5794
- if (y && await pe(q(i, "sitemap.xml"), y), await pe(q(i, "llms.txt"), mo(k)), a.llms?.full && await pe(q(i, "llms-full.txt"), fo(k)), a.webmanifest && await pe(q(i, "site.webmanifest"), JSON.stringify(a.webmanifest, null, 2) + `
5843
+ await pe(q(i, "robots.txt"), fo());
5844
+ const k = l.filter((f) => f.type !== "404"), y = ho(k);
5845
+ if (y && await pe(q(i, "sitemap.xml"), y), await pe(q(i, "llms.txt"), go(k)), a.llms?.full && await pe(q(i, "llms-full.txt"), _o(k)), a.webmanifest && await pe(q(i, "site.webmanifest"), JSON.stringify(a.webmanifest, null, 2) + `
5795
5846
  `), a.humans && await pe(q(i, "humans.txt"), a.humans.trim() + `
5796
5847
  `), a.security) {
5797
5848
  const f = a.security, _ = [];
@@ -5800,13 +5851,13 @@ ${D.join(`
5800
5851
  `));
5801
5852
  }
5802
5853
  }
5803
- async function go() {
5804
- const a = [...s.values()].filter((f) => !Mt(f.frontmatter) && ve(f)), l = {}, p = /* @__PURE__ */ new Map();
5854
+ async function bo() {
5855
+ const a = [...s.values()].filter((f) => !It(f.frontmatter) && ve(f)), l = {}, p = /* @__PURE__ */ new Map();
5805
5856
  for (const f of a) {
5806
5857
  const _ = st(f);
5807
5858
  l[f.effectivePath] = { gate: f.frontmatter.gate, bundle: _ };
5808
- const E = p.get(_) ?? [];
5809
- E.push(f), p.set(_, E);
5859
+ const C = p.get(_) ?? [];
5860
+ C.push(f), p.set(_, C);
5810
5861
  }
5811
5862
  const b = `/${t.paths.guarded}/`;
5812
5863
  if (await pe(
@@ -5816,39 +5867,39 @@ ${D.join(`
5816
5867
  ), a.length === 0) return;
5817
5868
  const k = q(i, t.paths.guarded), y = {};
5818
5869
  for (const [f, _] of p) {
5819
- const E = q(k, f);
5820
- await Ue(q(E, "body"), { recursive: !0 });
5821
- const $ = {}, D = _.map((S) => ({
5822
- slug: S.slug,
5823
- path: S.effectivePath,
5824
- type: S.type,
5825
- frontmatter: S.frontmatter,
5870
+ const C = q(k, f);
5871
+ await Ue(q(C, "body"), { recursive: !0 });
5872
+ const $ = {}, S = _.map((j) => ({
5873
+ slug: j.slug,
5874
+ path: j.effectivePath,
5875
+ type: j.type,
5876
+ frontmatter: j.frontmatter,
5826
5877
  bundle: f
5827
5878
  })), U = [`${f}/manifest.json`, `${f}/search.json`];
5828
- for (const S of _) {
5829
- S.pageCss && ($[S.effectivePath] = [$[S.effectivePath], S.pageCss].filter(Boolean).join(`
5879
+ for (const j of _) {
5880
+ j.pageCss && ($[j.effectivePath] = [$[j.effectivePath], j.pageCss].filter(Boolean).join(`
5830
5881
  `));
5831
- const C = {
5832
- html: S.html,
5833
- headings: S.headings,
5834
- openApiSpec: S.openApiSpec,
5835
- openApiFile: S.openApiFile,
5836
- openApiUrl: S.openApiUrl,
5837
- changelogEntries: S.changelogEntries,
5838
- roadmapEntries: S.roadmapEntries,
5839
- componentData: S.componentData,
5840
- dbmlSchema: S.dbmlSchema,
5841
- dbmlSource: S.dbmlSource,
5842
- dbmlFile: S.dbmlFile,
5843
- dbmlError: S.dbmlError
5844
- }, F = q(E, "body", `${De(S.slug)}.json`);
5845
- await Ue(Y(F), { recursive: !0 }), await pe(F, JSON.stringify(C)), U.push(`${f}/body/${De(S.slug)}.json`);
5882
+ const O = {
5883
+ html: j.html,
5884
+ headings: j.headings,
5885
+ openApiSpec: j.openApiSpec,
5886
+ openApiFile: j.openApiFile,
5887
+ openApiUrl: j.openApiUrl,
5888
+ changelogEntries: j.changelogEntries,
5889
+ roadmapEntries: j.roadmapEntries,
5890
+ componentData: j.componentData,
5891
+ dbmlSchema: j.dbmlSchema,
5892
+ dbmlSource: j.dbmlSource,
5893
+ dbmlFile: j.dbmlFile,
5894
+ dbmlError: j.dbmlError
5895
+ }, F = q(C, "body", `${De(j.slug)}.json`);
5896
+ await Ue(Y(F), { recursive: !0 }), await pe(F, JSON.stringify(O)), U.push(`${f}/body/${De(j.slug)}.json`);
5846
5897
  }
5847
5898
  await pe(
5848
- q(E, "manifest.json"),
5849
- JSON.stringify({ shells: D, styles: $, sidebar: on(!0) })
5850
- ), await pe(q(E, "search.json"), JSON.stringify(rn(!0, _))), y[f] = {
5851
- pages: Object.fromEntries(_.map((S) => [S.effectivePath, S.frontmatter.gate ?? ""])),
5899
+ q(C, "manifest.json"),
5900
+ JSON.stringify({ shells: S, styles: $, sidebar: an(!0) })
5901
+ ), await pe(q(C, "search.json"), JSON.stringify(ln(!0, _))), y[f] = {
5902
+ pages: Object.fromEntries(_.map((j) => [j.effectivePath, j.frontmatter.gate ?? ""])),
5852
5903
  files: U
5853
5904
  };
5854
5905
  }
@@ -5858,40 +5909,40 @@ ${D.join(`
5858
5909
  `
5859
5910
  );
5860
5911
  }
5861
- function _o(a, l) {
5912
+ function wo(a, l) {
5862
5913
  if (a.size === 0) return;
5863
- const p = l.filter((k) => yo(k.type)), b = /* @__PURE__ */ new Map();
5914
+ const p = l.filter((k) => vo(k.type)), b = /* @__PURE__ */ new Map();
5864
5915
  for (const k of p) b.set(k.filePath, k);
5865
5916
  for (const [, k] of a) {
5866
- const y = k[0], f = Y(y.filePath), _ = y.frontmatter.data, E = _?.issues ?? _?.entries, $ = [];
5867
- if (typeof E == "string") $.push(E);
5868
- else if (Array.isArray(E))
5869
- for (const T of E) typeof T == "string" && $.push(T);
5870
- const D = $.length ? $.map((T) => G(f, T)) : [f], U = p.filter((T) => {
5871
- for (const W of D)
5872
- if (T.filePath !== W && (T.filePath.startsWith(W + "/") || T.filePath.startsWith(W + "\\")))
5917
+ const y = k[0], f = Y(y.filePath), _ = y.frontmatter.data, C = _?.issues ?? _?.entries, $ = [];
5918
+ if (typeof C == "string") $.push(C);
5919
+ else if (Array.isArray(C))
5920
+ for (const M of C) typeof M == "string" && $.push(M);
5921
+ const S = $.length ? $.map((M) => G(f, M)) : [f], U = p.filter((M) => {
5922
+ for (const W of S)
5923
+ if (M.filePath !== W && (M.filePath.startsWith(W + "/") || M.filePath.startsWith(W + "\\")))
5873
5924
  return !0;
5874
5925
  return !1;
5875
- }), S = _?.changelog, C = [];
5876
- if (typeof S == "string")
5877
- C.push(G(f, S));
5878
- else if (Array.isArray(S))
5879
- for (const T of S) typeof T == "string" && C.push(G(f, T));
5926
+ }), j = _?.changelog, O = [];
5927
+ if (typeof j == "string")
5928
+ O.push(G(f, j));
5929
+ else if (Array.isArray(j))
5930
+ for (const M of j) typeof M == "string" && O.push(G(f, M));
5880
5931
  const F = /* @__PURE__ */ new Map();
5881
- for (const T of l) {
5882
- if (T.type !== "changelog" || C.length && !C.some(
5883
- (me) => T.filePath === me || T.filePath.startsWith(me + "/") || T.filePath.startsWith(me + "\\")
5932
+ for (const M of l) {
5933
+ if (M.type !== "changelog" || O.length && !O.some(
5934
+ (me) => M.filePath === me || M.filePath.startsWith(me + "/") || M.filePath.startsWith(me + "\\")
5884
5935
  ))
5885
5936
  continue;
5886
- const W = T.frontmatter.data, L = W?.issue;
5937
+ const W = M.frontmatter.data, L = W?.issue;
5887
5938
  if (!L) continue;
5888
5939
  const J = String(L).trim();
5889
5940
  if (!J) continue;
5890
- const Z = tn(T.filePath, J);
5941
+ const Z = sn(M.filePath, J);
5891
5942
  if (!Z) continue;
5892
5943
  const ee = b.get(Z);
5893
5944
  if (!ee) continue;
5894
- const N = String(W?.version ?? ""), z = nn(W?.release_date), V = W?.status;
5945
+ const N = String(W?.version ?? ""), z = rn(W?.release_date), V = W?.status;
5895
5946
  let se, ne = !1;
5896
5947
  if (typeof V == "string") {
5897
5948
  const ue = V.trim().toLowerCase();
@@ -5905,60 +5956,60 @@ ${D.join(`
5905
5956
  const Q = F.get(ee.filePath) ?? [];
5906
5957
  Q.push({
5907
5958
  version: N,
5908
- title: String(W?.title ?? T.frontmatter.title),
5959
+ title: String(W?.title ?? M.frontmatter.title),
5909
5960
  description: W?.description !== void 0 ? String(W.description) : void 0,
5910
5961
  releaseDate: z,
5911
5962
  progress: se,
5912
5963
  completes: ne,
5913
- path: T.effectivePath,
5964
+ path: M.effectivePath,
5914
5965
  slug: N ? `v${N}` : "unreleased",
5915
- entrySlug: `${T.effectivePath}#${N ? `v${N}` : "unreleased"}`
5966
+ entrySlug: `${M.effectivePath}#${N ? `v${N}` : "unreleased"}`
5916
5967
  }), F.set(ee.filePath, Q);
5917
5968
  }
5918
- const B = U.map((T) => {
5919
- const W = T.frontmatter.data, L = T.type, J = nn(W?.date ?? W?.target_date);
5969
+ const B = U.map((M) => {
5970
+ const W = M.frontmatter.data, L = M.type, J = rn(W?.date ?? W?.target_date);
5920
5971
  let Z;
5921
5972
  const ee = W?.parent;
5922
5973
  if (typeof ee == "string" && ee.trim()) {
5923
- const Q = tn(T.filePath, ee.trim());
5974
+ const Q = sn(M.filePath, ee.trim());
5924
5975
  Q && b.has(Q) && (Z = b.get(Q).effectivePath);
5925
5976
  }
5926
- const N = (F.get(T.filePath) ?? []).slice().sort(
5977
+ const N = (F.get(M.filePath) ?? []).slice().sort(
5927
5978
  (Q, ue) => (Q.releaseDate ?? "").localeCompare(ue.releaseDate ?? "")
5928
5979
  ), z = N.some((Q) => Q.completes), V = String(W?.status ?? "").toLowerCase(), se = V === "shipped" || V === "in_progress" || V === "planned" ? V : z ? "shipped" : N.length ? "in_progress" : "planned", ne = N.reduce((Q, ue) => typeof ue.progress == "number" ? Math.max(Q ?? 0, ue.progress) : Q, void 0);
5929
5980
  return {
5930
5981
  kind: L,
5931
- slug: T.slug,
5932
- filePath: T.filePath,
5933
- href: T.effectivePath,
5934
- title: T.frontmatter.title,
5935
- description: T.frontmatter.description,
5982
+ slug: M.slug,
5983
+ filePath: M.filePath,
5984
+ href: M.effectivePath,
5985
+ title: M.frontmatter.title,
5986
+ description: M.frontmatter.description,
5936
5987
  targetDate: J,
5937
5988
  parent: Z,
5938
5989
  progress: ne,
5939
5990
  status: se,
5940
- hidden: ut(T.frontmatter),
5941
- html: T.html,
5942
- headings: T.headings,
5943
- data: T.frontmatter.data,
5991
+ hidden: ut(M.frontmatter),
5992
+ html: M.html,
5993
+ headings: M.headings,
5994
+ data: M.frontmatter.data,
5944
5995
  changelog: N
5945
5996
  };
5946
5997
  });
5947
- B.sort((T, W) => (T.targetDate ?? "").localeCompare(W.targetDate ?? "")), y.roadmapEntries = B, y.headings = B.map((T) => ({
5998
+ B.sort((M, W) => (M.targetDate ?? "").localeCompare(W.targetDate ?? "")), y.roadmapEntries = B, y.headings = B.map((M) => ({
5948
5999
  level: 2,
5949
- text: T.title,
5950
- slug: T.slug
6000
+ text: M.title,
6001
+ slug: M.slug
5951
6002
  }));
5952
6003
  }
5953
6004
  }
5954
- function yo(a) {
6005
+ function vo(a) {
5955
6006
  return a === "milestone" || a === "epic" || a === "feature" || a === "bug";
5956
6007
  }
5957
- function tn(a, l) {
6008
+ function sn(a, l) {
5958
6009
  const p = Y(a), b = l.replace(/\\/g, "/").trim(), k = b.endsWith(".md") ? b : `${b}.md`;
5959
6010
  return G(p, k);
5960
6011
  }
5961
- function nn(a) {
6012
+ function rn(a) {
5962
6013
  if (a == null) return;
5963
6014
  if (a instanceof Date) return a.toISOString();
5964
6015
  const l = String(a).trim();
@@ -5970,7 +6021,7 @@ ${D.join(`
5970
6021
  function qe(a, l) {
5971
6022
  const p = a ? /^:([a-z0-9]+(?:-[a-z0-9]+)*):$/.exec(a.trim()) : null;
5972
6023
  if (p) {
5973
- const y = no(p[1], t.icons);
6024
+ const y = ro(p[1], t.icons);
5974
6025
  return y || console.warn(`[nimpress] icon ${a} referenced from ${l} is not a known shortcode`), y ?? void 0;
5975
6026
  }
5976
6027
  if (!a || !/\.svg$/i.test(a.trim())) return a;
@@ -5982,45 +6033,45 @@ ${D.join(`
5982
6033
  return;
5983
6034
  }
5984
6035
  }
5985
- function on(a = !1) {
6036
+ function an(a = !1) {
5986
6037
  const l = { children: /* @__PURE__ */ new Map() }, p = /* @__PURE__ */ new Map();
5987
6038
  for (const y of s.values()) {
5988
6039
  if (c && (Se(y.frontmatter) || !a && ve(y)) || y.type === "404" && !y.frontmatter.sidebar?.name) continue;
5989
6040
  const f = y.frontmatter.sidebar;
5990
6041
  if (y.effectivePath === "/" && !f?.name) continue;
5991
- const _ = y.effectivePath === "/" ? [f.path ?? f.name] : y.effectivePath.split("/").filter(Boolean), E = y.filePath.endsWith(`${xe}index.md`);
5992
- if (f?.name && E) {
5993
- const S = "/" + _.join("/");
5994
- p.set(S, {
6042
+ const _ = y.effectivePath === "/" ? [f.path ?? f.name] : y.effectivePath.split("/").filter(Boolean), C = y.filePath.endsWith(`${xe}index.md`);
6043
+ if (f?.name && C) {
6044
+ const j = "/" + _.join("/");
6045
+ p.set(j, {
5995
6046
  label: f.name,
5996
- icon: qe(f.icon, y.filePath) ?? p.get(S)?.icon,
5997
- style: f.style ?? p.get(S)?.style
6047
+ icon: qe(f.icon, y.filePath) ?? p.get(j)?.icon,
6048
+ style: f.style ?? p.get(j)?.style
5998
6049
  });
5999
6050
  }
6000
6051
  if (y.sidebarOnly && !y.linkTo) continue;
6001
- const $ = E ? void 0 : f?.path ?? f?.name;
6052
+ const $ = C ? void 0 : f?.path ?? f?.name;
6002
6053
  $ && _[_.length - 2] !== $ && (_.length >= 3 ? _.splice(_.length - 2, 1, $) : _.splice(_.length - 1, 0, $));
6003
- let D = l, U = "";
6004
- for (const S of _) {
6005
- U = U + "/" + S;
6006
- let C = D.children.get(S);
6007
- C || (C = { segment: S, fullPath: U, children: /* @__PURE__ */ new Map() }, D.children.set(S, C)), D = C;
6054
+ let S = l, U = "";
6055
+ for (const j of _) {
6056
+ U = U + "/" + j;
6057
+ let O = S.children.get(j);
6058
+ O || (O = { segment: j, fullPath: U, children: /* @__PURE__ */ new Map() }, S.children.set(j, O)), S = O;
6008
6059
  }
6009
- if (D.page = y, !E && f?.name) {
6010
- const S = "/" + _.slice(0, -1).join("/");
6011
- p.set(S, {
6060
+ if (S.page = y, !C && f?.name) {
6061
+ const j = "/" + _.slice(0, -1).join("/");
6062
+ p.set(j, {
6012
6063
  label: f.name,
6013
- icon: qe(f.icon, y.filePath) ?? p.get(S)?.icon,
6014
- style: f.style ?? p.get(S)?.style
6064
+ icon: qe(f.icon, y.filePath) ?? p.get(j)?.icon,
6065
+ style: f.style ?? p.get(j)?.style
6015
6066
  });
6016
6067
  }
6017
6068
  }
6018
6069
  function b(y) {
6019
6070
  const f = [];
6020
6071
  for (const $ of y.children.values()) f.push(b($));
6021
- if (Lt(f), y.page) {
6072
+ if (qt(f), y.page) {
6022
6073
  const $ = {
6023
- text: La(y.page),
6074
+ text: za(y.page),
6024
6075
  link: y.page.linkTo ?? y.page.effectivePath,
6025
6076
  external: y.page.linkTo ? !0 : void 0,
6026
6077
  slug: y.page.slug,
@@ -6029,107 +6080,107 @@ ${D.join(`
6029
6080
  collapsed: y.page.frontmatter.collapsed,
6030
6081
  hidden: ut(y.page.frontmatter),
6031
6082
  status: y.page.frontmatter.status
6032
- }, D = p.get(y.fullPath);
6033
- D?.label && ($.text = D.label), D?.icon && !$.icon && ($.icon = D.icon), D?.style && ($.style = D.style);
6083
+ }, S = p.get(y.fullPath);
6084
+ S?.label && ($.text = S.label), S?.icon && !$.icon && ($.icon = S.icon), S?.style && ($.style = S.style);
6034
6085
  const U = y.page.openApiSpec;
6035
6086
  if (y.page.type === "openapi" && U?.tags?.length) {
6036
- const S = U.tags.map((C) => ({
6037
- text: C.name,
6038
- link: `${y.page.effectivePath}#tag/${C.name}`,
6039
- slug: `${y.page.slug}__tag__${C.name}`
6087
+ const j = U.tags.map((O) => ({
6088
+ text: O.name,
6089
+ link: `${y.page.effectivePath}#tag/${O.name}`,
6090
+ slug: `${y.page.slug}__tag__${O.name}`
6040
6091
  }));
6041
- $.items = [...S, ...f];
6092
+ $.items = [...j, ...f];
6042
6093
  } else if (y.page.type === "changelog" && y.page.changelogEntries?.length) {
6043
- const S = y.page.changelogEntries.map((C, F) => ({
6044
- text: C.version ? `v${C.version}` : C.title || "unreleased",
6045
- link: `${y.page.effectivePath}#${C.slug}`,
6046
- slug: `${y.page.slug}__${C.slug}`,
6047
- hidden: C.hidden,
6094
+ const j = y.page.changelogEntries.map((O, F) => ({
6095
+ text: O.version ? `v${O.version}` : O.title || "unreleased",
6096
+ link: `${y.page.effectivePath}#${O.slug}`,
6097
+ slug: `${y.page.slug}__${O.slug}`,
6098
+ hidden: O.hidden,
6048
6099
  order: F
6049
6100
  }));
6050
- $.items = f.length ? [...S, ...f] : S;
6101
+ $.items = f.length ? [...j, ...f] : j;
6051
6102
  } else if (y.page.type === "roadmap" && y.page.roadmapEntries?.length) {
6052
- const S = y.page.roadmapEntries.slice().sort(
6103
+ const j = y.page.roadmapEntries.slice().sort(
6053
6104
  (J, Z) => (J.targetDate ?? "").localeCompare(Z.targetDate ?? "")
6054
- ), C = new Map(S.map((J) => [J.href, J])), F = /* @__PURE__ */ new Map(), B = [];
6055
- for (const J of S)
6056
- if (J.parent && C.has(J.parent)) {
6105
+ ), O = new Map(j.map((J) => [J.href, J])), F = /* @__PURE__ */ new Map(), B = [];
6106
+ for (const J of j)
6107
+ if (J.parent && O.has(J.parent)) {
6057
6108
  const Z = F.get(J.parent) ?? [];
6058
6109
  Z.push(J), F.set(J.parent, Z);
6059
6110
  } else
6060
6111
  B.push(J);
6061
- const T = (J, Z) => {
6112
+ const M = (J, Z) => {
6062
6113
  const ee = F.get(J.href) ?? [], N = {
6063
6114
  text: J.title,
6064
6115
  link: J.href,
6065
6116
  slug: J.slug,
6066
- icon: Xr[J.kind],
6117
+ icon: Kr[J.kind],
6067
6118
  hidden: J.hidden,
6068
6119
  order: Z
6069
6120
  };
6070
- return ee.length && (N.items = ee.map((z, V) => T(z, V))), N;
6071
- }, W = B.map((J, Z) => T(J, Z)), L = f.filter((J) => !J.slug || !S.some((Z) => Z.slug === J.slug));
6121
+ return ee.length && (N.items = ee.map((z, V) => M(z, V))), N;
6122
+ }, W = B.map((J, Z) => M(J, Z)), L = f.filter((J) => !J.slug || !j.some((Z) => Z.slug === J.slug));
6072
6123
  $.items = L.length ? [...W, ...L] : W;
6073
6124
  } else if (y.page.type === "component") {
6074
- const S = {
6125
+ const j = {
6075
6126
  text: "Overview",
6076
6127
  link: y.page.effectivePath,
6077
6128
  slug: `${y.page.slug}__doc`,
6078
6129
  order: -1
6079
- }, C = (y.page.componentData?.stories ?? []).map((F, B) => ({
6130
+ }, O = (y.page.componentData?.stories ?? []).map((F, B) => ({
6080
6131
  text: F.sidebar?.name ?? F.name,
6081
- link: `${y.page.effectivePath}/${Tt(F.name)}`,
6082
- slug: `${y.page.slug}__story__${Tt(F.name)}`,
6132
+ link: `${y.page.effectivePath}/${Ft(F.name)}`,
6133
+ slug: `${y.page.slug}__story__${Ft(F.name)}`,
6083
6134
  icon: qe(F.sidebar?.icon, y.page.filePath),
6084
6135
  style: F.sidebar?.style,
6085
6136
  order: B
6086
6137
  }));
6087
- $.text = mt(y.segment), $.items = [S, ...C, ...f], $.collapsed = !0;
6138
+ $.text = mt(y.segment), $.items = [j, ...O, ...f], $.collapsed = !0;
6088
6139
  } else f.length && ($.items = f);
6089
- return $.collapsed !== !1 && $.items?.some((S) => S.collapsed === !1) && ($.collapsed = !1), $;
6140
+ return $.collapsed !== !1 && $.items?.some((j) => j.collapsed === !1) && ($.collapsed = !1), $;
6090
6141
  }
6091
- const _ = p.get(y.fullPath), E = {
6142
+ const _ = p.get(y.fullPath), C = {
6092
6143
  text: _?.label ?? mt(y.segment),
6093
6144
  slug: y.fullPath.replace(/^\//, "")
6094
6145
  };
6095
- if (_?.icon && (E.icon = _.icon), _?.style && (E.style = _.style), f.length) {
6096
- E.items = f;
6146
+ if (_?.icon && (C.icon = _.icon), _?.style && (C.style = _.style), f.length) {
6147
+ C.items = f;
6097
6148
  let $ = Number.MAX_SAFE_INTEGER;
6098
- for (const D of f)
6099
- D.order !== void 0 && D.order < $ && ($ = D.order);
6100
- $ !== Number.MAX_SAFE_INTEGER && (E.order = $);
6149
+ for (const S of f)
6150
+ S.order !== void 0 && S.order < $ && ($ = S.order);
6151
+ $ !== Number.MAX_SAFE_INTEGER && (C.order = $);
6101
6152
  }
6102
- return E.items?.some(($) => $.collapsed === !1) && (E.collapsed = !1), E;
6153
+ return C.items?.some(($) => $.collapsed === !1) && (C.collapsed = !1), C;
6103
6154
  }
6104
6155
  const k = [];
6105
6156
  for (const y of l.children.values()) k.push(b(y));
6106
- return Lt(k), k;
6157
+ return qt(k), k;
6107
6158
  }
6108
- function bo(a) {
6159
+ function ko(a) {
6109
6160
  return `tag-${Ie(a)}`;
6110
6161
  }
6111
- function wo(a) {
6162
+ function $o(a) {
6112
6163
  const l = t.tags?.icons;
6113
6164
  if (!l) return;
6114
6165
  const p = l[t.tags?.map?.[a] ?? a] ?? l.default;
6115
6166
  return p ? qe(p, G(process.cwd(), "nimpress.config.json")) : void 0;
6116
6167
  }
6117
- function sn() {
6168
+ function cn() {
6118
6169
  const a = /* @__PURE__ */ new Map();
6119
6170
  for (const l of s.values())
6120
6171
  if (!(l.sidebarOnly || l.type === "404" || l.type === "tags") && !(c && (Se(l.frontmatter) || ve(l))))
6121
6172
  for (const p of Re(l.frontmatter.tags)) {
6122
- const b = a.get(p) ?? { name: p, slug: bo(p), icon: wo(p), pages: [] };
6173
+ const b = a.get(p) ?? { name: p, slug: ko(p), icon: $o(p), pages: [] };
6123
6174
  b.pages.push({ slug: l.slug, title: l.frontmatter.title, path: l.effectivePath, description: l.frontmatter.description }), a.set(p, b);
6124
6175
  }
6125
6176
  return Array.from(a.values()).sort((l, p) => l.name.localeCompare(p.name)).map((l) => ({ ...l, pages: l.pages.sort((p, b) => p.title.localeCompare(b.title)) }));
6126
6177
  }
6127
- function vo() {
6178
+ function xo() {
6128
6179
  const a = q(n, "styles");
6129
- return de(a) ? Le(a).filter((l) => l.endsWith(".css")).sort().map((l) => On(l.replace(/\.css$/, ""), Oe(q(a, l), "utf-8"))).join(`
6180
+ return fe(a) ? Le(a).filter((l) => l.endsWith(".css")).sort().map((l) => Mn(l.replace(/\.css$/, ""), Oe(q(a, l), "utf-8"))).join(`
6130
6181
  `) : "";
6131
6182
  }
6132
- function ko() {
6183
+ function So() {
6133
6184
  const a = {}, l = {};
6134
6185
  for (const [k, y] of s) {
6135
6186
  if (c && (Se(y.frontmatter) || ve(y)) || y.sidebarOnly) continue;
@@ -6151,27 +6202,27 @@ ${D.join(`
6151
6202
  };
6152
6203
  if (a[k] = f, l[y.effectivePath] = k, y.type === "component")
6153
6204
  for (const _ of y.componentData?.stories ?? [])
6154
- l[`${y.effectivePath}/${Tt(_.name)}`] = k;
6205
+ l[`${y.effectivePath}/${Ft(_.name)}`] = k;
6155
6206
  }
6156
- const p = {}, b = vo();
6207
+ const p = {}, b = xo();
6157
6208
  b && (p["/"] = b);
6158
6209
  for (const k of s.values())
6159
6210
  k.sidebarOnly || c && (Se(k.frontmatter) || ve(k)) || k.pageCss && (p[k.effectivePath] = [p[k.effectivePath], k.pageCss].filter(Boolean).join(`
6160
6211
  `));
6161
- return { pages: a, byPath: l, sidebar: on(), styles: p, tags: sn(), glossary: g };
6212
+ return { pages: a, byPath: l, sidebar: an(), styles: p, tags: cn(), glossary: g };
6162
6213
  }
6163
- function rn(a = !1, l) {
6214
+ function ln(a = !1, l) {
6164
6215
  const p = [], b = l ? l.map((k) => [k.slug, k]) : s;
6165
6216
  for (const [k, y] of b) {
6166
6217
  if (y.sidebarOnly || y.type === "404") continue;
6167
6218
  if (a) {
6168
6219
  if (Se(y.frontmatter) || !ve(y)) continue;
6169
6220
  } else if (c && (Se(y.frontmatter) || ve(y))) continue;
6170
- const f = y.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), _ = y.type === "openapi" ? $o(y.openApiSpec) : "", E = y.type === "roadmap" ? xo(y.roadmapEntries ?? []) : "", $ = y.componentData ? [
6221
+ const f = y.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), _ = y.type === "openapi" ? jo(y.openApiSpec) : "", C = y.type === "roadmap" ? Po(y.roadmapEntries ?? []) : "", $ = y.componentData ? [
6171
6222
  y.componentData.component,
6172
6223
  y.componentData.system,
6173
- ...(y.componentData.stories ?? []).flatMap((S) => [S.name, S.file])
6174
- ].filter(Boolean).join(" ") : "", D = y.dbmlSource ? y.dbmlSource.replace(/[{}\[\]'"`,]/g, " ") : "", U = [f, _, E, $, D].filter(Boolean).join(`
6224
+ ...(y.componentData.stories ?? []).flatMap((j) => [j.name, j.file])
6225
+ ].filter(Boolean).join(" ") : "", S = y.dbmlSource ? y.dbmlSource.replace(/[{}\[\]'"`,]/g, " ") : "", U = [f, _, C, $, S].filter(Boolean).join(`
6175
6226
  `);
6176
6227
  p.push({
6177
6228
  slug: k,
@@ -6180,7 +6231,7 @@ ${D.join(`
6180
6231
  description: y.frontmatter.description,
6181
6232
  body: U,
6182
6233
  gate: y.frontmatter.gate,
6183
- headings: y.headings.map((S) => S.text),
6234
+ headings: y.headings.map((j) => j.text),
6184
6235
  tags: [
6185
6236
  ...Re(y.frontmatter.tags),
6186
6237
  ...y.componentData ? [y.componentData.component] : []
@@ -6189,34 +6240,34 @@ ${D.join(`
6189
6240
  }
6190
6241
  return p;
6191
6242
  }
6192
- function an(a) {
6243
+ function pn(a) {
6193
6244
  return a ? a.replace(/<[^>]+>/g, " ").replace(/&[a-z]+;/gi, " ") : "";
6194
6245
  }
6195
- function $o(a) {
6246
+ function jo(a) {
6196
6247
  if (!a || typeof a != "object") return "";
6197
6248
  const l = a, p = [], b = /* @__PURE__ */ new WeakSet(), k = 12, y = (f, _) => {
6198
6249
  if (f == null || _ > k) return;
6199
- const E = typeof f;
6200
- if (E === "string") {
6250
+ const C = typeof f;
6251
+ if (C === "string") {
6201
6252
  const $ = f.trim();
6202
6253
  $ && p.push($);
6203
6254
  return;
6204
6255
  }
6205
- if (E === "number" || E === "boolean") {
6256
+ if (C === "number" || C === "boolean") {
6206
6257
  p.push(String(f));
6207
6258
  return;
6208
6259
  }
6209
- if (E === "object" && !b.has(f)) {
6260
+ if (C === "object" && !b.has(f)) {
6210
6261
  if (b.add(f), Array.isArray(f)) {
6211
6262
  for (const $ of f) y($, _ + 1);
6212
6263
  return;
6213
6264
  }
6214
- for (const [$, D] of Object.entries(f)) {
6265
+ for (const [$, S] of Object.entries(f)) {
6215
6266
  if ($ === "description_html" || $ === "summary_html" || $ === "requestBodyHtml") {
6216
- typeof D == "string" && p.push(an(D));
6267
+ typeof S == "string" && p.push(pn(S));
6217
6268
  continue;
6218
6269
  }
6219
- p.push($), y(D, _ + 1);
6270
+ p.push($), y(S, _ + 1);
6220
6271
  }
6221
6272
  }
6222
6273
  };
@@ -6228,8 +6279,8 @@ ${D.join(`
6228
6279
  for (const f of l.tags ?? []) {
6229
6280
  f.name && p.push(f.name), f.description && p.push(f.description);
6230
6281
  for (const _ of f.operations ?? []) {
6231
- const E = _;
6232
- E.method && p.push(E.method.toLowerCase(), E.method.toUpperCase()), y(_, 0);
6282
+ const C = _;
6283
+ C.method && p.push(C.method.toLowerCase(), C.method.toUpperCase()), y(_, 0);
6233
6284
  }
6234
6285
  }
6235
6286
  for (const [f, _] of Object.entries(l.schemas ?? {}))
@@ -6237,10 +6288,10 @@ ${D.join(`
6237
6288
  return p.join(`
6238
6289
  `);
6239
6290
  }
6240
- function xo(a) {
6291
+ function Po(a) {
6241
6292
  const l = [];
6242
6293
  for (const p of a) {
6243
- l.push(p.slug, p.kind, p.title), p.description && l.push(p.description), p.targetDate && l.push(p.targetDate), p.html && l.push(an(p.html));
6294
+ l.push(p.slug, p.kind, p.title), p.description && l.push(p.description), p.targetDate && l.push(p.targetDate), p.html && l.push(pn(p.html));
6244
6295
  for (const b of p.changelog)
6245
6296
  l.push(b.version, b.title), b.description && l.push(b.description), b.releaseDate && l.push(b.releaseDate);
6246
6297
  }
@@ -6259,7 +6310,7 @@ ${D.join(`
6259
6310
  function De(a) {
6260
6311
  return a === "" ? "__root__" : a;
6261
6312
  }
6262
- function cn(a) {
6313
+ function un(a) {
6263
6314
  return a === "__root__" ? "" : a;
6264
6315
  }
6265
6316
  function rt(a) {
@@ -6268,13 +6319,13 @@ ${D.join(`
6268
6319
  p && a.moduleGraph.invalidateModule(p);
6269
6320
  }
6270
6321
  }
6271
- function xt(a) {
6322
+ function Pt(a) {
6272
6323
  for (const l of s.keys()) {
6273
6324
  const p = We + De(l) + ".js", b = Ge + De(l) + ".svelte", k = a.moduleGraph.getModuleById(p), y = a.moduleGraph.getModuleById(b);
6274
6325
  k && a.moduleGraph.invalidateModule(k), y && a.moduleGraph.invalidateModule(y);
6275
6326
  }
6276
6327
  }
6277
- function So() {
6328
+ function Ao() {
6278
6329
  const a = [];
6279
6330
  for (const [l, p] of s) {
6280
6331
  if (p.sidebarOnly || c && (Se(p.frontmatter) || ve(p))) continue;
@@ -6288,7 +6339,7 @@ ${a.join(`,
6288
6339
  export default pages
6289
6340
  `;
6290
6341
  }
6291
- function jo() {
6342
+ function Eo() {
6292
6343
  const a = [];
6293
6344
  for (const [l, p] of s) {
6294
6345
  if (p.sidebarOnly || c && (Se(p.frontmatter) || ve(p))) continue;
@@ -6302,8 +6353,8 @@ ${a.join(`,
6302
6353
  export default bodies
6303
6354
  `;
6304
6355
  }
6305
- function Po(a) {
6306
- if (a.type === "tags") return [...a.headings, ...sn().map((l) => ({ level: 2, text: l.name, slug: l.slug }))];
6356
+ function Co(a) {
6357
+ if (a.type === "tags") return [...a.headings, ...cn().map((l) => ({ level: 2, text: l.name, slug: l.slug }))];
6307
6358
  if (a.type === "glossary") return [...a.headings, ...g.map((l) => ({ level: 2, text: l.term, slug: l.slug }))];
6308
6359
  if (a.type === "team") {
6309
6360
  const l = a.frontmatter.data?.members ?? [];
@@ -6311,12 +6362,12 @@ export default bodies
6311
6362
  }
6312
6363
  return a.headings;
6313
6364
  }
6314
- function Ao(a) {
6365
+ function Oo(a) {
6315
6366
  const l = s.get(a);
6316
6367
  if (!l) return null;
6317
6368
  const p = {
6318
6369
  html: l.html,
6319
- headings: Po(l),
6370
+ headings: Co(l),
6320
6371
  openApiSpec: l.openApiSpec,
6321
6372
  openApiFile: l.openApiFile,
6322
6373
  openApiUrl: l.openApiUrl,
@@ -6331,13 +6382,13 @@ export default bodies
6331
6382
  return `export default ${JSON.stringify(p)}
6332
6383
  `;
6333
6384
  }
6334
- function St(a) {
6385
+ function At(a) {
6335
6386
  return `Custom_${a.replace(/[^a-zA-Z0-9]/g, "_")}`;
6336
6387
  }
6337
- function Eo(a) {
6388
+ function Do(a) {
6338
6389
  return a.startsWith("/") ? a : "/" + a.replace(/^\.\//, "");
6339
6390
  }
6340
- function Co(a) {
6391
+ function To(a) {
6341
6392
  const l = s.get(a);
6342
6393
  if (!l) return null;
6343
6394
  const p = {
@@ -6345,8 +6396,8 @@ export default bodies
6345
6396
  path: l.effectivePath,
6346
6397
  type: l.type,
6347
6398
  frontmatter: l.frontmatter
6348
- }, b = `${We}${De(a)}.js`, k = JSON.stringify(p).replace(/<\/script>/g, "<\\/script>"), y = Array.from(Ne.entries()), f = y.map(([$, D]) => ` import ${St($)} from ${JSON.stringify(Eo(D.file))}`).join(`
6349
- `), _ = ($, D) => Ne.has($) ? St($) : D, E = [
6399
+ }, b = `${We}${De(a)}.js`, k = JSON.stringify(p).replace(/<\/script>/g, "<\\/script>"), y = Array.from(Ne.entries()), f = y.map(([$, S]) => ` import ${At($)} from ${JSON.stringify(Do(S.file))}`).join(`
6400
+ `), _ = ($, S) => Ne.has($) ? At($) : S, C = [
6350
6401
  ["team", "TeamPage"],
6351
6402
  ["pricing", "PricingPage"],
6352
6403
  ["glossary", "GlossaryPage"],
@@ -6357,10 +6408,10 @@ export default bodies
6357
6408
  ["roadmap", "RoadmapPage"],
6358
6409
  ["component", "ComponentPage"],
6359
6410
  ["dbml", "DbmlPage"]
6360
- ].map(([$, D]) => ` {:else if shell.type === ${JSON.stringify($)}}
6361
- <${_($, D)} page={{ ...shell, ...mod.default }} />`).concat(
6362
- y.filter(([$]) => !eo.has($)).map(([$]) => ` {:else if shell.type === ${JSON.stringify($)}}
6363
- <${St($)} page={{ ...shell, ...mod.default }} />`)
6411
+ ].map(([$, S]) => ` {:else if shell.type === ${JSON.stringify($)}}
6412
+ <${_($, S)} page={{ ...shell, ...mod.default }} />`).concat(
6413
+ y.filter(([$]) => !oo.has($)).map(([$]) => ` {:else if shell.type === ${JSON.stringify($)}}
6414
+ <${At($)} page={{ ...shell, ...mod.default }} />`)
6364
6415
  ).join(`
6365
6416
  `);
6366
6417
  return `<script lang="ts">
@@ -6398,7 +6449,7 @@ ${f}
6398
6449
  {:then mod}
6399
6450
  {#if shell.type === 'openapi' && mod.default.openApiSpec}
6400
6451
  <OpenApiRoot spec={mod.default.openApiSpec} specFile={mod.default.openApiFile} specUrl={mod.default.openApiUrl} title={shell.frontmatter.title} frontmatter={shell.frontmatter} />
6401
- ${E}
6452
+ ${C}
6402
6453
  {:else}
6403
6454
  <${_("doc", "Page")} page={{ ...shell, ...mod.default }} />
6404
6455
  {/if}
@@ -6411,7 +6462,10 @@ ${E}
6411
6462
  return {
6412
6463
  name: "@nimtech/nimpress:markdown",
6413
6464
  async config() {
6414
- return t = (await cs(process.cwd(), e)).resolved, n = G(process.cwd(), t.contentDir), Qr(process.cwd(), t.pageTypes ?? {}), o = G(process.cwd(), t.assetsDir), {};
6465
+ t = (await ps(process.cwd(), e)).resolved, n = G(process.cwd(), t.contentDir), ta(process.cwd(), t.pageTypes ?? {});
6466
+ for (const l of vt(t))
6467
+ ft.includes(l) || fe(G(process.cwd(), l)) || console.warn(`[nimpress] theme ${l} is neither a built in theme, ${ft.join(" or ")}, nor a stylesheet`);
6468
+ return o = G(process.cwd(), t.assetsDir), {};
6415
6469
  },
6416
6470
  configResolved(a) {
6417
6471
  c = a.command === "build", i = G(a.root, a.build.outDir);
@@ -6422,73 +6476,73 @@ ${E}
6422
6476
  async closeBundle(a) {
6423
6477
  if (!c || a) return;
6424
6478
  const l = q(i, "index.html"), p = q(i, "404.html");
6425
- if (await ln(l, p), await pe(q(i, ".nojekyll"), ""), de(n) && await pn(n, i, {
6479
+ if (await mn(l, p), await pe(q(i, ".nojekyll"), ""), fe(n) && await fn(n, i, {
6426
6480
  recursive: !0,
6427
6481
  filter: (k) => {
6428
6482
  try {
6429
- return ht(k).isDirectory() || !(k.endsWith(".md") || k.endsWith(".css"));
6483
+ return gt(k).isDirectory() || !(k.endsWith(".md") || k.endsWith(".css"));
6430
6484
  } catch {
6431
6485
  return !1;
6432
6486
  }
6433
6487
  }
6434
- }), de(o)) {
6488
+ }), fe(o)) {
6435
6489
  const k = q(i, t.assetUrlBase.replace(/^\//, ""));
6436
- await pn(o, k, { recursive: !0 });
6490
+ await fn(o, k, { recursive: !0 });
6437
6491
  }
6438
6492
  for (const [k, y] of ze) {
6439
6493
  const f = q(i, k.replace(/^\//, ""));
6440
6494
  await Ue(Y(f), { recursive: !0 }), await pe(f, y);
6441
6495
  }
6442
- await pe(q(i, "subscribe.map.json"), kt), await ho();
6496
+ await pe(q(i, "subscribe.map.json"), St), await yo();
6443
6497
  const b = Array.from(s.values()).find((k) => k.type === "404" && !Se(k.frontmatter) && !ve(k));
6444
- b && await ln(q(i, b.effectivePath.replace(/^\//, ""), "index.html"), q(i, "404.html")), await go();
6498
+ b && await mn(q(i, b.effectivePath.replace(/^\//, ""), "index.html"), q(i, "404.html")), await bo();
6445
6499
  },
6446
6500
  configureServer(a) {
6447
6501
  u = a, a.watcher.add(n), a.watcher.add(o);
6448
- for (const f of P) a.watcher.add(f);
6502
+ for (const f of A) a.watcher.add(f);
6449
6503
  for (const f of d) a.watcher.add(f);
6450
6504
  const l = async (f) => {
6451
6505
  if (!(!f.startsWith(n) || !(f.endsWith(".md") || f.endsWith(".css") || f.match(/\.story\.tsx?$/)))) {
6452
- f.endsWith(".css") && fe(f.replace(/(\.[a-z0-9-]+)?\.css$/, ".md")), f.match(/\.story\.tsx?$/) && fe(q(Y(f), "index.md"));
6506
+ f.endsWith(".css") && de(f.replace(/(\.[a-z0-9-]+)?\.css$/, ".md")), f.match(/\.story\.tsx?$/) && de(q(Y(f), "index.md"));
6453
6507
  try {
6454
6508
  await He();
6455
- } catch (E) {
6456
- a.config.logger.error(String(E));
6509
+ } catch (C) {
6510
+ a.config.logger.error(String(C));
6457
6511
  return;
6458
6512
  }
6459
- rt(a), xt(a), Je(), a.ws.send({ type: "full-reload" });
6513
+ rt(a), Pt(a), Je(), a.ws.send({ type: "full-reload" });
6460
6514
  }
6461
6515
  }, p = async (f) => {
6462
6516
  if (f.startsWith(n) && (f.endsWith(".md") || f.endsWith(".css") || f.match(/\.story\.tsx?$/))) {
6463
- f.match(/\.story\.tsx?$/) ? fe(q(Y(f), "index.md")) : fe(f.endsWith(".css") ? f.replace(/(\.[a-z0-9-]+)?\.css$/, ".md") : f);
6517
+ f.match(/\.story\.tsx?$/) ? de(q(Y(f), "index.md")) : de(f.endsWith(".css") ? f.replace(/(\.[a-z0-9-]+)?\.css$/, ".md") : f);
6464
6518
  try {
6465
6519
  await He();
6466
- } catch (E) {
6467
- a.config.logger.error(String(E));
6520
+ } catch (C) {
6521
+ a.config.logger.error(String(C));
6468
6522
  return;
6469
6523
  }
6470
- rt(a), xt(a), Je(), a.ws.send({ type: "full-reload" });
6524
+ rt(a), Pt(a), Je(), a.ws.send({ type: "full-reload" });
6471
6525
  return;
6472
6526
  }
6473
- if (j.has(f)) {
6474
- const E = j.get(f);
6475
- fe(E);
6527
+ if (P.has(f)) {
6528
+ const C = P.get(f);
6529
+ de(C);
6476
6530
  }
6477
- M.has(f) && fe(M.get(f));
6531
+ T.has(f) && de(T.get(f));
6478
6532
  };
6479
6533
  if (a.watcher.on("add", l), a.watcher.on("unlink", p), t.banner !== !1) {
6480
- const f = Es(), _ = t.banner, E = Date.now();
6534
+ const f = Os(), _ = t.banner, C = Date.now();
6481
6535
  a.printUrls = function() {
6482
- const $ = a.resolvedUrls, D = $?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, U = $?.network?.[0] ?? "use --host to expose", S = As({
6536
+ const $ = a.resolvedUrls, S = $?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, U = $?.network?.[0] ?? "use --host to expose", j = Cs({
6483
6537
  title: _.title ?? t.title ?? f.name ?? "Nimpress",
6484
6538
  tagline: _.tagline,
6485
6539
  company: _.company,
6486
6540
  version: _.version ?? f.version,
6487
- localUrl: D,
6541
+ localUrl: S,
6488
6542
  networkUrl: U,
6489
- duration: Date.now() - E
6543
+ duration: Date.now() - C
6490
6544
  });
6491
- process.stdout.write("\x1Bc"), process.stdout.write(S + `
6545
+ process.stdout.write("\x1Bc"), process.stdout.write(j + `
6492
6546
  `), Je();
6493
6547
  };
6494
6548
  }
@@ -6508,36 +6562,36 @@ ${E}
6508
6562
  ".woff": "font/woff",
6509
6563
  ".woff2": "font/woff2",
6510
6564
  ".mp4": "video/mp4"
6511
- }, k = t.assetUrlBase, y = (f, _, E) => {
6565
+ }, k = t.assetUrlBase, y = (f, _, C) => {
6512
6566
  if (!_ || _.endsWith(".md")) return !1;
6513
6567
  const $ = q(f, decodeURIComponent(_));
6514
- return !$.startsWith(f) || !de($) || !ht($).isFile() ? !1 : (E.setHeader("Content-Type", b[zt($).toLowerCase()] ?? "application/octet-stream"), Oo($).pipe(E), !0);
6568
+ return !$.startsWith(f) || !fe($) || !gt($).isFile() ? !1 : (C.setHeader("Content-Type", b[Jt($).toLowerCase()] ?? "application/octet-stream"), Mo($).pipe(C), !0);
6515
6569
  };
6516
- return a.middlewares.use((f, _, E) => {
6517
- const $ = (f.url ?? "").split("?")[0], D = Yo(t.base, $);
6518
- if (D.startsWith("/@") || D.startsWith("/node_modules/")) return E();
6519
- if (D === "/__nimpress/claude-md" && f.method === "PUT") {
6570
+ return a.middlewares.use((f, _, C) => {
6571
+ const $ = (f.url ?? "").split("?")[0], S = Qo(t.base, $);
6572
+ if (S.startsWith("/@") || S.startsWith("/node_modules/")) return C();
6573
+ if (S === "/__nimpress/claude-md" && f.method === "PUT") {
6520
6574
  const F = [];
6521
6575
  f.on("data", (B) => F.push(B)), f.on("end", async () => {
6522
6576
  try {
6523
- const B = JSON.parse(Buffer.concat(F).toString("utf-8")), T = String(B.path ?? ""), W = String(B.content ?? ""), L = G(process.cwd(), T);
6524
- if (!Object.values(t.modules.systems).filter((ee) => ee.source).map((ee) => G(process.cwd(), ee.source)).some((ee) => L.startsWith(ee + xe)) || !L.endsWith(`${xe}CLAUDE.md`) || !de(Y(L))) {
6577
+ const B = JSON.parse(Buffer.concat(F).toString("utf-8")), M = String(B.path ?? ""), W = String(B.content ?? ""), L = G(process.cwd(), M);
6578
+ if (!Object.values(t.modules.systems).filter((ee) => ee.source).map((ee) => G(process.cwd(), ee.source)).some((ee) => L.startsWith(ee + xe)) || !L.endsWith(`${xe}CLAUDE.md`) || !fe(Y(L))) {
6525
6579
  _.statusCode = 403, _.end("invalid claude-md target");
6526
6580
  return;
6527
6581
  }
6528
- await pe(L, W), fe(M.get(L) ?? ""), _.statusCode = 204, _.end();
6582
+ await pe(L, W), de(T.get(L) ?? ""), _.statusCode = 204, _.end();
6529
6583
  } catch (B) {
6530
6584
  _.statusCode = 400, _.end(String(B));
6531
6585
  }
6532
6586
  });
6533
6587
  return;
6534
6588
  }
6535
- if (D === "/__nimpress/schema-defaults" && f.method === "PUT") {
6589
+ if (S === "/__nimpress/schema-defaults" && f.method === "PUT") {
6536
6590
  const F = [];
6537
6591
  f.on("data", (B) => F.push(B)), f.on("end", async () => {
6538
6592
  try {
6539
- const B = JSON.parse(Buffer.concat(F).toString("utf-8")), T = String(B.path ?? ""), W = G(process.cwd(), T), L = W.endsWith(`${xe}schema.json`) || W.endsWith(`${xe}schema.yml`);
6540
- if (!W.startsWith(n + xe) || !L || !de(W)) {
6593
+ const B = JSON.parse(Buffer.concat(F).toString("utf-8")), M = String(B.path ?? ""), W = G(process.cwd(), M), L = W.endsWith(`${xe}schema.json`) || W.endsWith(`${xe}schema.yml`);
6594
+ if (!W.startsWith(n + xe) || !L || !fe(W)) {
6541
6595
  _.statusCode = 403, _.end("invalid schema target");
6542
6596
  return;
6543
6597
  }
@@ -6546,34 +6600,34 @@ ${E}
6546
6600
  const z = Z.properties?.[ee];
6547
6601
  z && (z.default = N);
6548
6602
  }
6549
- await pe(W, et(Z, J)), fe(M.get(W) ?? ""), _.statusCode = 204, _.end();
6603
+ await pe(W, et(Z, J)), de(T.get(W) ?? ""), _.statusCode = 204, _.end();
6550
6604
  } catch (B) {
6551
6605
  _.statusCode = 400, _.end(String(B));
6552
6606
  }
6553
6607
  });
6554
6608
  return;
6555
6609
  }
6556
- const U = ze.get(D);
6610
+ const U = ze.get(S);
6557
6611
  if (U !== void 0) {
6558
6612
  _.setHeader("Content-Type", "application/rss+xml; charset=utf-8"), _.end(U);
6559
6613
  return;
6560
6614
  }
6561
- if (D === "/subscribe.map.json") {
6562
- _.setHeader("Content-Type", "application/json; charset=utf-8"), _.end(kt);
6615
+ if (S === "/subscribe.map.json") {
6616
+ _.setHeader("Content-Type", "application/json; charset=utf-8"), _.end(St);
6563
6617
  return;
6564
6618
  }
6565
- const S = t.modules.route.replace(/\/$/, "");
6566
- if (D === S || D.startsWith(S + "/")) {
6567
- const F = D.slice(S.length).replace(/^\/+/, ""), B = decodeURIComponent(F.split("/")[0] ?? "");
6619
+ const j = t.modules.route.replace(/\/$/, "");
6620
+ if (S === j || S.startsWith(j + "/")) {
6621
+ const F = S.slice(j.length).replace(/^\/+/, ""), B = decodeURIComponent(F.split("/")[0] ?? "");
6568
6622
  if (!t.modules.systems[B]) {
6569
6623
  _.statusCode = 404, _.end(`unknown module system: ${B}`);
6570
6624
  return;
6571
6625
  }
6572
- const W = Do(
6626
+ const W = No(
6573
6627
  {
6574
6628
  host: "127.0.0.1",
6575
- port: Wt(t.modules, B),
6576
- path: `${D}${(f.url ?? "").includes("?") ? `?${(f.url ?? "").split("?").slice(1).join("?")}` : ""}`,
6629
+ port: zt(t.modules, B),
6630
+ path: `${S}${(f.url ?? "").includes("?") ? `?${(f.url ?? "").split("?").slice(1).join("?")}` : ""}`,
6577
6631
  method: f.method,
6578
6632
  headers: f.headers
6579
6633
  },
@@ -6588,57 +6642,57 @@ ${E}
6588
6642
  }), f.pipe(W);
6589
6643
  return;
6590
6644
  }
6591
- if (k === "/" || D === k || D.startsWith(k + "/")) {
6592
- const F = k === "/" ? D : D.slice(k.length);
6645
+ if (k === "/" || S === k || S.startsWith(k + "/")) {
6646
+ const F = k === "/" ? S : S.slice(k.length);
6593
6647
  if (y(o, F.replace(/^\/+/, ""), _)) return;
6594
6648
  }
6595
- y(n, D.replace(/^\/+/, ""), _) || E();
6649
+ y(n, S.replace(/^\/+/, ""), _) || C();
6596
6650
  }), () => {
6597
- a.middlewares.use(async (f, _, E) => {
6598
- if (f.method !== "GET" && f.method !== "HEAD" || !(f.headers.accept ?? "").includes("text/html")) return E();
6651
+ a.middlewares.use(async (f, _, C) => {
6652
+ if (f.method !== "GET" && f.method !== "HEAD" || !(f.headers.accept ?? "").includes("text/html")) return C();
6599
6653
  try {
6600
6654
  const $ = await a.transformIndexHtml(
6601
6655
  f.url ?? "/",
6602
- Ur(t, "/@id/__x00__virtual:nimpress/main")
6656
+ Gr(t, "/@id/__x00__virtual:nimpress/main")
6603
6657
  );
6604
6658
  _.statusCode = 200, _.setHeader("Content-Type", "text/html"), _.end($);
6605
6659
  } catch ($) {
6606
- E($);
6660
+ C($);
6607
6661
  }
6608
6662
  });
6609
6663
  };
6610
6664
  },
6611
6665
  async handleHotUpdate(a) {
6612
- const l = a.file, p = l.endsWith(".md") && l.startsWith(n), b = l.endsWith(".css") && l.startsWith(n), k = l.match(/\.story\.tsx?$/) && l.startsWith(n), y = j.get(l), f = M.get(l);
6666
+ const l = a.file, p = l.endsWith(".md") && l.startsWith(n), b = l.endsWith(".css") && l.startsWith(n), k = l.match(/\.story\.tsx?$/) && l.startsWith(n), y = P.get(l), f = T.get(l);
6613
6667
  if (b) {
6614
- fe(l.replace(/(\.[a-z0-9-]+)?\.css$/, ".md"));
6668
+ de(l.replace(/(\.[a-z0-9-]+)?\.css$/, ".md"));
6615
6669
  try {
6616
6670
  await He();
6617
- } catch (E) {
6618
- a.server.config.logger.error(String(E));
6671
+ } catch (C) {
6672
+ a.server.config.logger.error(String(C));
6619
6673
  return;
6620
6674
  }
6621
6675
  return rt(a.server), a.server.ws.send({ type: "full-reload" }), [];
6622
6676
  }
6623
6677
  if (!p && !k && !y && !f) return;
6624
6678
  const _ = p ? l : k ? q(Y(l), "index.md") : y ?? f;
6625
- fe(_);
6679
+ de(_);
6626
6680
  try {
6627
6681
  await He();
6628
- } catch (E) {
6629
- a.server.config.logger.error(String(E));
6682
+ } catch (C) {
6683
+ a.server.config.logger.error(String(C));
6630
6684
  return;
6631
6685
  }
6632
- return rt(a.server), xt(a.server), Je(), a.server.ws.send({ type: "full-reload" }), [];
6686
+ return rt(a.server), Pt(a.server), Je(), a.server.ws.send({ type: "full-reload" }), [];
6633
6687
  },
6634
6688
  resolveId(a) {
6635
- return a === it ? "\0" + it : a === ct ? "\0" + ct : a === lt ? "\0" + lt : a === pt ? "\0" + pt : a === Et ? "\0" + Et : a === Ct ? "\0" + Ct : a.startsWith(Ge) && a.endsWith(".svelte") || a.startsWith(We) && a.endsWith(".js") ? a : null;
6689
+ return a === it ? "\0" + it : a === ct ? "\0" + ct : a === lt ? "\0" + lt : a === pt ? "\0" + pt : a === Dt ? "\0" + Dt : a === Tt ? "\0" + Tt : a.startsWith(Ge) && a.endsWith(".svelte") || a.startsWith(We) && a.endsWith(".js") ? a : null;
6636
6690
  },
6637
6691
  async load(a) {
6638
6692
  if (a === "\0" + it)
6639
- return `export default ${JSON.stringify(ko())}`;
6640
- if (a === "\0" + Et) {
6641
- const l = ls(t), p = l.announce || l.feedback ? Dn(await O(), be(), t.base, { math: t.math, icons: t.icons }) : null;
6693
+ return `export default ${JSON.stringify(So())}`;
6694
+ if (a === "\0" + Dt) {
6695
+ const l = us(t), p = l.announce || l.feedback ? Nn(await D(), be(), t.base, { math: t.math, icons: t.icons }) : null;
6642
6696
  if (l.feedback && p && (l.feedback = {
6643
6697
  ...l.feedback,
6644
6698
  ratings: l.feedback.ratings.map((b) => ({ ...b, html: p.renderInline(b.note) }))
@@ -6651,36 +6705,38 @@ ${E}
6651
6705
  }
6652
6706
  return `export default ${JSON.stringify(l)}`;
6653
6707
  }
6654
- if (a === "\0" + Ct) {
6655
- const l = t.css.map((y) => `import ${JSON.stringify(y.startsWith("/") ? y : "/" + y)}`).join(`
6656
- `), p = t.client ? t.client.startsWith("/") ? t.client : "/" + t.client.replace(/^\.\//, "") : null, b = p ? `import { authFunctions, subscribeFunctions, feedbackFunctions } from ${JSON.stringify(p)}` : "";
6708
+ if (a === "\0" + Tt) {
6709
+ const l = (S) => S.startsWith("/") ? S : "/" + S.replace(/^\.\//, ""), b = [...vt(t).filter((S) => S !== "stock").map((S) => ft.includes(S) ? `@nimtech/nimpress/themes/${S}.css` : l(S)), ...t.css.map(l)].map((S) => `import ${JSON.stringify(S)}`).join(`
6710
+ `), k = Object.entries(t.components), y = k.map(([S, U]) => `import Nimpress${S} from ${JSON.stringify(l(U))}`).join(`
6711
+ `), f = k.length ? `, components: { ${k.map(([S]) => `${S}: Nimpress${S}`).join(", ")} }` : "", _ = t.client ? l(t.client) : null, C = _ ? `import { authFunctions, subscribeFunctions, feedbackFunctions } from ${JSON.stringify(_)}` : "";
6657
6712
  return `import '@nimtech/nimpress/app.css'
6658
- ${l}
6713
+ ${b}
6659
6714
  import { createNimpressApp } from '@nimtech/nimpress'
6660
6715
  import config from 'virtual:nimpress/config'
6661
6716
  import manifest from 'virtual:nimpress/manifest'
6662
6717
  import searchIndex from 'virtual:nimpress/search'
6663
6718
  import pages from 'virtual:nimpress/pages'
6664
- ${b}
6665
- const app = createNimpressApp({ ...config, manifest, searchIndex, pageLoader: pages${p ? ", authFunctions, subscribeFunctions, feedbackFunctions" : ""} })
6719
+ ${C}
6720
+ ${y}
6721
+ const app = createNimpressApp({ ...config, manifest, searchIndex, pageLoader: pages${f}${_ ? ", authFunctions, subscribeFunctions, feedbackFunctions" : ""} })
6666
6722
  const target = document.getElementById('app')
6667
6723
  if (!target) throw new Error('Mount target #app missing')
6668
6724
  app.mount(target)
6669
6725
  `;
6670
6726
  }
6671
6727
  if (a === "\0" + ct)
6672
- return `export default ${JSON.stringify(rn())}`;
6728
+ return `export default ${JSON.stringify(ln())}`;
6673
6729
  if (a === "\0" + lt)
6674
- return So();
6730
+ return Ao();
6675
6731
  if (a === "\0" + pt)
6676
- return jo();
6732
+ return Eo();
6677
6733
  if (a.startsWith(Ge) && a.endsWith(".svelte")) {
6678
6734
  const l = a.slice(Ge.length, -7);
6679
- return Co(cn(l));
6735
+ return To(un(l));
6680
6736
  }
6681
6737
  if (a.startsWith(We) && a.endsWith(".js")) {
6682
6738
  const l = a.slice(We.length, -3);
6683
- return Ao(cn(l));
6739
+ return Oo(un(l));
6684
6740
  }
6685
6741
  return null;
6686
6742
  }
@@ -6690,7 +6746,7 @@ function wi(e) {
6690
6746
  return e;
6691
6747
  }
6692
6748
  async function vi(e, t) {
6693
- const n = G(e, t), o = await Qt(n), s = [];
6749
+ const n = G(e, t), o = await nn(n), s = [];
6694
6750
  for (const r of o) {
6695
6751
  let i;
6696
6752
  try {
@@ -6698,46 +6754,46 @@ async function vi(e, t) {
6698
6754
  } catch {
6699
6755
  continue;
6700
6756
  }
6701
- const { data: c, content: u } = gt(i);
6757
+ const { data: c, content: u } = _t(i);
6702
6758
  typeof c.type == "number" && (c.type = String(c.type));
6703
- for (const h of to(c, u))
6759
+ for (const h of so(c, u))
6704
6760
  s.push(`${je(n, r).split(xe).join("/")}: ${h}`);
6705
6761
  }
6706
6762
  return s;
6707
6763
  }
6708
6764
  export {
6709
- Ea as A,
6710
- cs as B,
6765
+ Oa as A,
6766
+ ps as B,
6711
6767
  bi as C,
6712
- na as D,
6713
- Ha as E,
6768
+ sa as D,
6769
+ qa as E,
6714
6770
  wi as F,
6715
- On as G,
6716
- Pa as H,
6717
- _r as a,
6718
- Xt as b,
6719
- Vt as c,
6771
+ Mn as G,
6772
+ Ea as H,
6773
+ br as a,
6774
+ Zt as b,
6775
+ Kt as c,
6720
6776
  Ye as d,
6721
- wn as e,
6722
- kn as f,
6777
+ $n as e,
6778
+ Sn as f,
6723
6779
  Je as g,
6724
6780
  _i as h,
6725
- Ur as i,
6781
+ Gr as i,
6726
6782
  yi as j,
6727
- Wt as k,
6728
- Qr as l,
6783
+ zt as k,
6784
+ ta as l,
6729
6785
  vi as m,
6730
- Sa as n,
6731
- Jn as o,
6786
+ Pa as n,
6787
+ Xn as o,
6732
6788
  ot as p,
6733
6789
  gi as q,
6734
- wt as r,
6790
+ $t as r,
6735
6791
  nt as s,
6736
6792
  di as t,
6737
- hr as u,
6793
+ _r as u,
6738
6794
  fi as v,
6739
- Kt as w,
6795
+ en as w,
6740
6796
  hi as x,
6741
- Pr as y,
6742
- Aa as z
6797
+ Er as y,
6798
+ Ca as z
6743
6799
  };