@tdacorp/hyle-sdk 0.17.0 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +261 -42
  2. package/dist/check-routes-bin.js +190 -53
  3. package/dist/{chunk-6VOHFFA5.js → chunk-7T5EEJHK.js} +2 -2
  4. package/dist/chunk-DUPT6XLB.js +57 -0
  5. package/dist/chunk-IW3TUD4G.js +841 -0
  6. package/dist/{chunk-MGSUQBDW.js → chunk-KU7LWK4E.js} +249 -24
  7. package/dist/{chunk-BUJFMR3M.js → chunk-QVYQM5R2.js} +15 -6
  8. package/dist/chunk-SFFBZFEN.js +178 -0
  9. package/dist/chunk-U74B7AUG.js +398 -0
  10. package/dist/chunk-ZIW6FDU2.js +1126 -0
  11. package/dist/client-BGjmEWhN.d.cts +207 -0
  12. package/dist/client-D0LTpr3Y.d.ts +207 -0
  13. package/dist/code-copy.cjs +74 -0
  14. package/dist/code-copy.d.cts +18 -0
  15. package/dist/code-copy.d.ts +18 -0
  16. package/dist/code-copy.js +50 -0
  17. package/dist/comments.cjs +738 -280
  18. package/dist/comments.d.cts +66 -3
  19. package/dist/comments.d.ts +66 -3
  20. package/dist/comments.js +419 -331
  21. package/dist/{diagram-viewer-FJPED4SN.js → diagram-viewer-XY3CG75U.js} +62 -21
  22. package/dist/docs-enhance.cjs +7 -4
  23. package/dist/docs-enhance.d.cts +5 -3
  24. package/dist/docs-enhance.d.ts +5 -3
  25. package/dist/docs-enhance.js +8 -5
  26. package/dist/{embed-DNTZ2UXv.d.ts → embed-CbtsbZs3.d.cts} +5 -3
  27. package/dist/{embed-BmdwA2G9.d.cts → embed-Cf_2ZR5x.d.ts} +5 -3
  28. package/dist/fragment-alias.cjs +51 -0
  29. package/dist/fragment-alias.d.cts +7 -0
  30. package/dist/fragment-alias.d.ts +7 -0
  31. package/dist/fragment-alias.js +27 -0
  32. package/dist/html.cjs +886 -0
  33. package/dist/html.d.cts +20 -0
  34. package/dist/html.d.ts +20 -0
  35. package/dist/html.js +45 -0
  36. package/dist/index.cjs +244 -24
  37. package/dist/index.d.cts +22 -68
  38. package/dist/index.d.ts +22 -68
  39. package/dist/index.js +12 -2
  40. package/dist/{labels-nmukKYgL.d.cts → labels-CrA-iqTN.d.cts} +9 -0
  41. package/dist/{labels-nmukKYgL.d.ts → labels-CrA-iqTN.d.ts} +9 -0
  42. package/dist/mermaid-diagram.cjs +441 -125
  43. package/dist/mermaid-diagram.d.cts +23 -7
  44. package/dist/mermaid-diagram.d.ts +23 -7
  45. package/dist/mermaid-diagram.js +213 -51
  46. package/dist/mermaid-image.cjs +137 -60
  47. package/dist/mermaid-image.d.cts +4 -3
  48. package/dist/mermaid-image.d.ts +4 -3
  49. package/dist/mermaid-image.js +27 -28
  50. package/dist/next.cjs +836 -304
  51. package/dist/next.d.cts +45 -20
  52. package/dist/next.d.ts +45 -20
  53. package/dist/next.js +151 -40
  54. package/dist/print-coordinator.cjs +157 -0
  55. package/dist/print-coordinator.d.cts +27 -0
  56. package/dist/print-coordinator.d.ts +27 -0
  57. package/dist/print-coordinator.js +83 -0
  58. package/dist/react.cjs +603 -240
  59. package/dist/react.d.cts +148 -30
  60. package/dist/react.d.ts +148 -30
  61. package/dist/react.js +26 -4
  62. package/dist/reactions.cjs +653 -0
  63. package/dist/reactions.d.cts +27 -0
  64. package/dist/reactions.d.ts +27 -0
  65. package/dist/reactions.js +364 -0
  66. package/dist/{resolve-euZ4-aC9.d.cts → resolve-BnIv7aB7.d.cts} +2 -2
  67. package/dist/{resolve-Ae7UFjsQ.d.ts → resolve-BysHtZ_i.d.ts} +2 -2
  68. package/dist/revalidation-callback-BQl77tQR.d.cts +75 -0
  69. package/dist/revalidation-callback-BQl77tQR.d.ts +75 -0
  70. package/dist/sanitize-BpY_AdZh.d.cts +23 -0
  71. package/dist/sanitize-BpY_AdZh.d.ts +23 -0
  72. package/dist/styles.css +100 -29
  73. package/dist/toc-spy.cjs +60 -0
  74. package/dist/toc-spy.d.cts +15 -0
  75. package/dist/toc-spy.d.ts +15 -0
  76. package/dist/toc-spy.js +36 -0
  77. package/dist/{types-Czt887Iv.d.cts → types-D09Z072G.d.cts} +57 -2
  78. package/dist/{types-Czt887Iv.d.ts → types-D09Z072G.d.ts} +57 -2
  79. package/dist/use-cache.cjs +89 -13
  80. package/dist/use-cache.d.cts +12 -5
  81. package/dist/use-cache.d.ts +12 -5
  82. package/dist/use-cache.js +8 -8
  83. package/dist/youtube-facade.cjs +50 -0
  84. package/dist/youtube-facade.d.cts +17 -0
  85. package/dist/youtube-facade.d.ts +17 -0
  86. package/dist/youtube-facade.js +26 -0
  87. package/package.json +16 -3
  88. package/dist/chunk-67IOIAVW.js +0 -35
  89. package/dist/chunk-DMK4XQLU.js +0 -1556
  90. package/dist/chunk-PJMJMP66.js +0 -63
  91. package/dist/revalidation-callback-D7Ms_Puz.d.cts +0 -42
  92. package/dist/revalidation-callback-D7Ms_Puz.d.ts +0 -42
package/dist/react.cjs CHANGED
@@ -26,17 +26,27 @@ __export(react_exports, {
26
26
  HastContent: () => HastContent,
27
27
  HastLimitError: () => HastLimitError,
28
28
  HyleArticleView: () => HyleArticleView,
29
+ HyleBody: () => HyleBody,
29
30
  HyleListView: () => HyleListView,
31
+ HyleReactions: () => import_reactions.HyleReactions,
32
+ HyleTheme: () => HyleTheme,
33
+ HyleToc: () => HyleToc,
30
34
  ListPage: () => ListPage,
31
35
  MermaidDiagram: () => import_mermaid_diagram2.MermaidDiagram,
32
36
  NotFound: () => NotFound,
33
37
  Redirecting: () => Redirecting,
34
38
  TrustedServerHtml: () => TrustedServerHtml,
35
39
  Unavailable: () => Unavailable,
40
+ VIEWER_LABELS_EN: () => VIEWER_LABELS_EN,
41
+ holdPrintUntil: () => import_print_coordinator.holdPrintUntil,
42
+ installPrintShortcut: () => import_print_coordinator.installPrintShortcut,
43
+ isClampedSource: () => isClampedSource,
44
+ isLargeDiagram: () => isLargeDiagram,
36
45
  isSafeUrl: () => isSafeUrl,
37
46
  sanitizeHast: () => sanitizeHast,
38
47
  scopeId: () => scopeId,
39
- stringsFor: () => stringsFor
48
+ stringsFor: () => stringsFor,
49
+ stripMermaidConfig: () => stripMermaidConfig
40
50
  });
41
51
  module.exports = __toCommonJS(react_exports);
42
52
 
@@ -48,12 +58,25 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
48
58
  // src/asset-path.ts
49
59
  var ASSET_ROUTE_PREFIX = "/api/hyle/assets";
50
60
  var UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
51
- var EXTENSIONS = "png|jpg|gif|webp|svg|pdf|mp4|webm|mp3|ogg";
61
+ var EXTENSIONS = "png|jpg|gif|webp|svg|pdf|mp4|webm|mp3|ogg|woff2";
52
62
  var ASSET_FILE = new RegExp(`^${UUID}(?:\\.(?:${EXTENSIONS}))?$`);
53
- var HYLE_ASSET_URL = new RegExp(`^/assets/(${UUID}(?:\\.(?:${EXTENSIONS}))?)$`, "i");
63
+ var THEME_FILE = /^theme-([0-9a-f]{16})-([0-9a-f]{64})\.css$/;
64
+ var THEME_FONT = new RegExp(`^/assets/${UUID}\\.woff2$`);
65
+ function themeStylesheetHref({ scope, hash }) {
66
+ const file = `theme-${scope}-${hash}.css`;
67
+ return THEME_FILE.test(file) ? `${ASSET_ROUTE_PREFIX}/${file}` : void 0;
68
+ }
69
+ function themeFontHrefs(preload) {
70
+ return preload.flatMap((src) => typeof src === "string" && THEME_FONT.test(src) ? [hostAssetSrc(src)] : []);
71
+ }
72
+ var PREVIEW_TOKEN_SOURCE = "hyle_pv_[A-Za-z0-9_-]{43}";
73
+ var PREVIEW_TOKEN = new RegExp(`^${PREVIEW_TOKEN_SOURCE}$`);
74
+ var PREVIEW_PARAM = "hyle_preview";
75
+ var PREVIEW_QUERY_SOURCE = `\\?${PREVIEW_PARAM}=${PREVIEW_TOKEN_SOURCE}`;
76
+ var HYLE_ASSET_URL = new RegExp(`^/assets/(${UUID}(?:\\.(?:${EXTENSIONS}))?)(${PREVIEW_QUERY_SOURCE})?$`, "i");
54
77
  function hostAssetSrc(src) {
55
- const file = HYLE_ASSET_URL.exec(src)?.[1];
56
- return file ? `${ASSET_ROUTE_PREFIX}/${file.toLowerCase()}` : src;
78
+ const [, file, query = ""] = HYLE_ASSET_URL.exec(src) ?? [];
79
+ return file ? `${ASSET_ROUTE_PREFIX}/${file.toLowerCase()}${query}` : src;
57
80
  }
58
81
  function hostAssetHtml(html) {
59
82
  return html.replace(new RegExp(`(\\ssrc=")(/assets/${UUID}(?:\\.(?:${EXTENSIONS}))?)(")`, "gi"), (_m, open, url, close) => `${open}${hostAssetSrc(url)}${close}`);
@@ -88,9 +111,16 @@ var SHAPES = {
88
111
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 1.8v3h3" })
89
112
  ] }),
90
113
  chev: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m6 3.5 4.5 4.5L6 12.5" }),
114
+ "chev-up": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3.5 10 4.5-4.5L12.5 10" }),
91
115
  "chev-down": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3.5 6 4.5 4.5L12.5 6" }),
92
116
  "chev-left": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 3.5 5.5 8 10 12.5" }),
93
117
  x: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m4 4 8 8M12 4l-8 8" }),
118
+ important: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 2.5h10a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H8l-3.5 2.8v-2.8H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1zM8 5v2.8M8 9.5v.1" }),
119
+ copy: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "5.5", y: "5.5", width: "8", height: "8", rx: "1.3" }),
121
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2" })
122
+ ] }),
123
+ check: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3 8.5 3.2 3L13 4.5" }),
94
124
  heart: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 13.5S2.2 10 2.2 6.1A3 3 0 0 1 8 5a3 3 0 0 1 5.8 1.1C13.8 10 8 13.5 8 13.5z" }),
95
125
  reply: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M6.5 3.5 2.5 7.5l4 4M2.5 7.5h6a5 5 0 0 1 5 5" }),
96
126
  clock: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
@@ -129,8 +159,15 @@ var isScalar = (v) => typeof v === "string" || typeof v === "number" || typeof v
129
159
  var matches = (re) => (v) => typeof v === "string" && re.test(v);
130
160
  var ID_PREFIX = "user-content-";
131
161
  var scopeId = (id) => id.startsWith(ID_PREFIX) ? id : ID_PREFIX + id;
132
- var ID_BODY = /^[\p{L}\p{N}_:.-]{1,180}$/u;
133
- var isIdValue = (v) => typeof v === "string" && ID_BODY.test(v.startsWith(ID_PREFIX) ? v.slice(ID_PREFIX.length) : v);
162
+ var ID_BODY = /^[\p{L}\p{M}\p{N}\p{Pc}:.-]{1,180}$/u;
163
+ function isIdValue(v) {
164
+ if (typeof v !== "string") return false;
165
+ try {
166
+ return ID_BODY.test(decodeURIComponent(v.startsWith(ID_PREFIX) ? v.slice(ID_PREFIX.length) : v));
167
+ } catch {
168
+ return false;
169
+ }
170
+ }
134
171
  var CLASS_TOKEN = /^[A-Za-z_][\w:-]*$/;
135
172
  var classTokens = (v) => {
136
173
  const tokens = Array.isArray(v) ? v : typeof v === "string" ? v.split(/\s+/) : [];
@@ -143,6 +180,7 @@ var isLength = matches(/^[\d.]+(em|px|%)?$/);
143
180
  var STYLE_PROPS = /* @__PURE__ */ new Set(["height", "vertical-align", "margin-left", "margin-right", "margin-top", "margin-bottom", "top", "width", "min-width", "border-bottom-width", "padding-left"]);
144
181
  var STYLE_LENGTH = /^(-?\d+(?:\.\d+)?)(em|px|%)?$/;
145
182
  var MAX_STYLE_MAGNITUDE = 100;
183
+ var MAX_MARGIN_MAGNITUDE = 20;
146
184
  function isKatexStyle(v, ctx2) {
147
185
  if (typeof v !== "string" || !ctx2.katex) return false;
148
186
  return v.split(";").filter((d) => d !== "").every((decl) => {
@@ -150,7 +188,8 @@ function isKatexStyle(v, ctx2) {
150
188
  if (extra.length > 0 || prop === void 0 || value === void 0) return false;
151
189
  if (prop === "position") return value === "relative";
152
190
  const m = STYLE_LENGTH.exec(value);
153
- return STYLE_PROPS.has(prop) && m !== null && Math.abs(Number(m[1])) <= MAX_STYLE_MAGNITUDE;
191
+ const max = prop.startsWith("margin-") ? MAX_MARGIN_MAGNITUDE : MAX_STYLE_MAGNITUDE;
192
+ return STYLE_PROPS.has(prop) && m !== null && Math.abs(Number(m[1])) <= max;
154
193
  });
155
194
  }
156
195
  function isSafeUrl(value, kind) {
@@ -177,12 +216,14 @@ var ENTITIES = { "&#x3c;": "<", "&#x26;": "&", "&lt;": "<", "&gt;": ">", "&amp;"
177
216
  function mermaidSource(srcDoc) {
178
217
  return MERMAID_SRCDOC.exec(srcDoc)?.[1]?.replace(/&(?:#x3c|#x26|#x27|lt|gt|amp|quot);/gi, (e) => ENTITIES[e.toLowerCase()]);
179
218
  }
180
- var RENDER_REF = /^(\/assets\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.svg) ([1-9]\d{0,5}) ([1-9]\d{0,5})$/;
219
+ var RENDER_REF = new RegExp(`^(/assets/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.svg(?:${PREVIEW_QUERY_SOURCE})?) ([1-9]\\d{0,5}) ([1-9]\\d{0,5})$`);
181
220
  var isRenderRef = matches(RENDER_REF);
182
221
  function diagramRender(value) {
183
222
  const m = typeof value === "string" ? RENDER_REF.exec(value) : null;
184
223
  return m ? { src: hostAssetSrc(m[1]), width: Number(m[2]), height: Number(m[3]) } : void 0;
185
224
  }
225
+ var YOUTUBE_WATCH = /^https:\/\/www\.youtube\.com\/watch\?v=([A-Za-z0-9_-]{11})$/;
226
+ var youtubeId = (href) => typeof href === "string" ? YOUTUBE_WATCH.exec(href)?.[1] : void 0;
186
227
  var heading = { id: isIdValue, className: isClass };
187
228
  var ATTRS = new Map(
188
229
  Object.entries({
@@ -198,6 +239,7 @@ var ATTRS = new Map(
198
239
  tbody: {},
199
240
  tr: {},
200
241
  ol: {},
242
+ kbd: {},
201
243
  ul: { className: isClass },
202
244
  li: { id: isIdValue, className: isClass },
203
245
  h1: heading,
@@ -206,8 +248,8 @@ var ATTRS = new Map(
206
248
  h4: heading,
207
249
  h5: heading,
208
250
  h6: heading,
209
- a: { href: isHref, id: isIdValue, ariaDescribedBy: isIdValue, ariaLabel: isString, dataFootnoteRef: isScalar, dataFootnoteBackref: isScalar, className: isClass },
210
- img: { src: isSrc, alt: isString, width: isPixels, height: isPixels },
251
+ a: { href: isHref, id: isIdValue, ariaDescribedBy: isIdValue, ariaLabel: isString, dataFootnoteRef: isScalar, dataFootnoteBackref: isScalar, dataEmbed: matches(/^youtube$/), className: isClass },
252
+ img: { src: isSrc, alt: isString, title: isString, width: isPixels, height: isPixels },
211
253
  table: {},
212
254
  th: { scope: matches(/^(row|col|rowgroup|colgroup)$/), align: isAlign },
213
255
  td: { align: isAlign },
@@ -230,8 +272,10 @@ function textOf(node, depth = 0) {
230
272
  if (node.type === "text") return typeof node.value === "string" ? node.value : "";
231
273
  return Array.isArray(node.children) ? node.children.map((c) => textOf(c, depth + 1)).join("") : "";
232
274
  }
275
+ var holdsEmbed = (node, depth = 0) => isObject(node) && depth <= MAX_DEPTH && (isObject(node.properties) && "dataEmbed" in node.properties || Array.isArray(node.children) && node.children.some((c) => holdsEmbed(c, depth + 1)));
276
+ var collapse = (text) => text.replace(/\s+/g, " ").trim();
233
277
  var CALLOUT_MARKER = /^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i;
234
- var CALLOUT_KIND = { note: "note", tip: "tip", important: "warning", warning: "warning", caution: "caution" };
278
+ var CALLOUT_KIND = { note: "note", tip: "tip", important: "important", warning: "warning", caution: "caution" };
235
279
  function toCallout(children) {
236
280
  const first = children.find((c) => c.type === "element");
237
281
  const lead = first?.tagName === "p" ? first.children[0] : void 0;
@@ -243,6 +287,21 @@ function toCallout(children) {
243
287
  const kind = CALLOUT_KIND[(marker[1] ?? "note").toLowerCase()] ?? "note";
244
288
  return { type: "element", tagName: "callout", properties: { kind }, children: [...body, ...children.slice(children.indexOf(first) + 1)] };
245
289
  }
290
+ var isBlank = (node) => node.type === "text" && node.value.trim() === "";
291
+ function soleElement(children) {
292
+ const [only, ...more] = children.filter((c) => !isBlank(c));
293
+ return more.length === 0 && only?.type === "element" ? only : void 0;
294
+ }
295
+ function toFigure(children) {
296
+ const only = soleElement(children);
297
+ const img = only?.tagName === "a" ? soleElement(only.children) : only;
298
+ if (!only || img?.tagName !== "img" || typeof img.properties.src !== "string") return void 0;
299
+ const { title, ...properties } = img.properties;
300
+ const bare = { ...img, properties };
301
+ const media = only === img ? bare : { ...only, children: [bare] };
302
+ const caption = typeof title === "string" && title.trim() ? [{ type: "element", tagName: "figcaption", properties: {}, children: [{ type: "text", value: title }] }] : [];
303
+ return { type: "element", tagName: "figure", properties: { dataSlotComponent: "Image" }, children: [media, ...caption] };
304
+ }
246
305
  function clean(node, depth, ctx2, budget) {
247
306
  if (!isObject(node) || depth > MAX_DEPTH) return [];
248
307
  if (++budget.nodes > MAX_NODES) throw new HastLimitError("content has too many nodes");
@@ -276,6 +335,11 @@ function clean(node, depth, ctx2, budget) {
276
335
  }
277
336
  for (const key of ["id", "ariaDescribedBy"]) if (typeof properties[key] === "string") properties[key] = scopeId(properties[key]);
278
337
  if (tag === "a" && typeof properties.href === "string" && properties.href.trim().startsWith("#")) properties.href = `#${scopeId(properties.href.trim().slice(1))}`;
338
+ if (tag === "a" && properties.dataEmbed !== void 0 && youtubeId(properties.href) === void 0) delete properties.dataEmbed;
339
+ if (tag === "p") {
340
+ const figure = toFigure(children);
341
+ if (figure) return [figure];
342
+ }
279
343
  if (tag === "blockquote") {
280
344
  const callout = toCallout(children);
281
345
  if (callout) return [callout];
@@ -287,9 +351,9 @@ function sanitizeHast(tree, title, description) {
287
351
  const raw = isObject(tree) && tree.type === "root" && Array.isArray(tree.children) ? tree.children : [];
288
352
  const elements = raw.filter((n) => isObject(n) && n.type === "element");
289
353
  const [first] = elements;
290
- const skip = title !== void 0 && isObject(first) && first.tagName === "h1" && textOf(first).trim() === title.trim() ? first : void 0;
354
+ const skip = title !== void 0 && isObject(first) && first.tagName === "h1" && collapse(textOf(first)) === collapse(title) ? first : void 0;
291
355
  const lead = elements[skip ? 1 : 0];
292
- const repeat = description && isObject(lead) && lead.tagName === "p" && textOf(lead).trim().startsWith(description.trim()) ? lead : void 0;
356
+ const repeat = description && isObject(lead) && lead.tagName === "p" && collapse(textOf(lead)) === collapse(description) && !holdsEmbed(lead) ? lead : void 0;
293
357
  const budget = { nodes: 0, text: 0 };
294
358
  return { type: "root", children: raw.filter((n) => n !== skip && n !== repeat).flatMap((n) => clean(n, 0, { katex: false }, budget)) };
295
359
  }
@@ -328,6 +392,7 @@ var COMMENT_LABELS_EN = {
328
392
  removed: "This comment was removed.",
329
393
  removedByModerator: "This comment was removed by a moderator.",
330
394
  removedByAuthor: "This comment was deleted by its author.",
395
+ unrenderable: "This comment cannot be displayed.",
331
396
  depthEnd: "Replies end at this depth",
332
397
  held: "Awaiting approval.",
333
398
  heldBanner: "Thanks, your comment is awaiting approval",
@@ -354,8 +419,39 @@ var COMMENT_LABELS_EN = {
354
419
  bannedBody: "Commenting is not available for your account on this site. You can still read every comment. If you think this is a mistake, contact the site team.",
355
420
  expired: "Your session ended. Sign in again to post. Your text is kept.",
356
421
  more: "Load more comments",
357
- truncated: "Showing the first 500 comments.",
358
- justNow: "just now"
422
+ truncated: "Only the first part of this discussion is shown.",
423
+ justNow: "just now",
424
+ react: "React",
425
+ reactions: "Reactions",
426
+ reactionLike: "Like",
427
+ reactionLove: "Love",
428
+ reactionInsightful: "Insightful",
429
+ reactionCelebrate: "Celebrate",
430
+ reactionSignIn: "Sign in to react, ",
431
+ reactionAddedLive: "{kind} reaction added",
432
+ reactionRemovedLive: "{kind} reaction removed",
433
+ reactionsLoading: "Loading reactions",
434
+ reactionsError: "Reactions could not be loaded",
435
+ votesOn: "Votes on the comment by {name}",
436
+ score: "Score {n}",
437
+ upvote: "Upvote",
438
+ downvote: "Downvote",
439
+ upvoteSignIn: "Sign in to upvote",
440
+ downvoteSignIn: "Sign in to downvote",
441
+ upvotedLive: "Upvoted. Score {n}",
442
+ downvotedLive: "Downvoted. Score {n}",
443
+ voteRemovedLive: "Vote removed. Score {n}",
444
+ voteRefused: "That vote was not accepted. You cannot vote on your own comment.",
445
+ slowDown: "Too many actions in a short time. Wait a moment and try again.",
446
+ sort: "Sort comments",
447
+ sortNewest: "Newest",
448
+ sortTop: "Top",
449
+ sortedNewestLive: "Showing newest comments first",
450
+ sortedTopLive: "Showing top comments first",
451
+ sortError: "The comments could not be sorted. Please try again.",
452
+ newerLater: "Newer comments appear after you load more.",
453
+ moreError: "More comments could not be loaded. Please try again.",
454
+ loadedLive: "{n} comments loaded"
359
455
  };
360
456
  var COMMENT_LABELS_FR = {
361
457
  heading: "Commentaires",
@@ -390,6 +486,7 @@ var COMMENT_LABELS_FR = {
390
486
  removed: "Ce commentaire a \xE9t\xE9 retir\xE9.",
391
487
  removedByModerator: "Ce commentaire a \xE9t\xE9 retir\xE9 par un mod\xE9rateur.",
392
488
  removedByAuthor: "Ce commentaire a \xE9t\xE9 supprim\xE9 par son auteur.",
489
+ unrenderable: "Ce commentaire ne peut pas \xEAtre affich\xE9.",
393
490
  depthEnd: "Les r\xE9ponses s'arr\xEAtent \xE0 ce niveau",
394
491
  held: "En attente d'approbation.",
395
492
  heldBanner: "Merci, votre commentaire est en attente d'approbation",
@@ -416,8 +513,39 @@ var COMMENT_LABELS_FR = {
416
513
  bannedBody: "Les commentaires ne sont pas disponibles pour votre compte sur ce site. Vous pouvez toujours tout lire. Si vous pensez \xE0 une erreur, contactez l'\xE9quipe du site.",
417
514
  expired: "Votre session a expir\xE9. Reconnectez-vous pour publier. Votre texte est conserv\xE9.",
418
515
  more: "Charger plus de commentaires",
419
- truncated: "Affichage des 500 premiers commentaires.",
420
- justNow: "\xE0 l'instant"
516
+ truncated: "Seul le d\xE9but de cette discussion est affich\xE9.",
517
+ justNow: "\xE0 l'instant",
518
+ react: "R\xE9agir",
519
+ reactions: "R\xE9actions",
520
+ reactionLike: "J'aime",
521
+ reactionLove: "J'adore",
522
+ reactionInsightful: "Instructif",
523
+ reactionCelebrate: "Bravo",
524
+ reactionSignIn: "Connectez-vous pour r\xE9agir, ",
525
+ reactionAddedLive: "R\xE9action {kind} ajout\xE9e",
526
+ reactionRemovedLive: "R\xE9action {kind} retir\xE9e",
527
+ reactionsLoading: "Chargement des r\xE9actions",
528
+ reactionsError: "Les r\xE9actions n'ont pas pu \xEAtre charg\xE9es",
529
+ votesOn: "Votes sur le commentaire de {name}",
530
+ score: "Score {n}",
531
+ upvote: "Voter pour",
532
+ downvote: "Voter contre",
533
+ upvoteSignIn: "Connectez-vous pour voter pour",
534
+ downvoteSignIn: "Connectez-vous pour voter contre",
535
+ upvotedLive: "Vote pour enregistr\xE9. Score {n}",
536
+ downvotedLive: "Vote contre enregistr\xE9. Score {n}",
537
+ voteRemovedLive: "Vote retir\xE9. Score {n}",
538
+ voteRefused: "Ce vote a \xE9t\xE9 refus\xE9. Vous ne pouvez pas voter pour votre propre commentaire.",
539
+ slowDown: "Trop d'actions en peu de temps. Patientez un instant et r\xE9essayez.",
540
+ sort: "Trier les commentaires",
541
+ sortNewest: "R\xE9cents",
542
+ sortTop: "Meilleurs",
543
+ sortedNewestLive: "Commentaires les plus r\xE9cents en premier",
544
+ sortedTopLive: "Meilleurs commentaires en premier",
545
+ sortError: "Les commentaires n'ont pas pu \xEAtre tri\xE9s. R\xE9essayez.",
546
+ newerLater: "Les commentaires plus r\xE9cents apparaissent apr\xE8s le chargement de la suite.",
547
+ moreError: "La suite des commentaires n'a pas pu \xEAtre charg\xE9e. R\xE9essayez.",
548
+ loadedLive: "{n} commentaires charg\xE9s"
421
549
  };
422
550
  var COMMENT_LABELS_ES = {
423
551
  heading: "Comentarios",
@@ -452,6 +580,7 @@ var COMMENT_LABELS_ES = {
452
580
  removed: "Este comentario fue eliminado.",
453
581
  removedByModerator: "Un moderador elimin\xF3 este comentario.",
454
582
  removedByAuthor: "Su autor elimin\xF3 este comentario.",
583
+ unrenderable: "Este comentario no se puede mostrar.",
455
584
  depthEnd: "Las respuestas terminan en este nivel",
456
585
  held: "Pendiente de aprobaci\xF3n.",
457
586
  heldBanner: "Gracias, tu comentario est\xE1 pendiente de aprobaci\xF3n",
@@ -478,8 +607,39 @@ var COMMENT_LABELS_ES = {
478
607
  bannedBody: "Los comentarios no est\xE1n disponibles para tu cuenta en este sitio. A\xFAn puedes leerlos todos. Si crees que es un error, contacta con el equipo del sitio.",
479
608
  expired: "Tu sesi\xF3n termin\xF3. Inicia sesi\xF3n de nuevo para publicar. Tu texto se conserva.",
480
609
  more: "Cargar m\xE1s comentarios",
481
- truncated: "Se muestran los primeros 500 comentarios.",
482
- justNow: "ahora mismo"
610
+ truncated: "Solo se muestra la primera parte de esta conversaci\xF3n.",
611
+ justNow: "ahora mismo",
612
+ react: "Reaccionar",
613
+ reactions: "Reacciones",
614
+ reactionLike: "Me gusta",
615
+ reactionLove: "Me encanta",
616
+ reactionInsightful: "Interesante",
617
+ reactionCelebrate: "Celebrar",
618
+ reactionSignIn: "Inicia sesi\xF3n para reaccionar, ",
619
+ reactionAddedLive: "Reacci\xF3n {kind} a\xF1adida",
620
+ reactionRemovedLive: "Reacci\xF3n {kind} eliminada",
621
+ reactionsLoading: "Cargando reacciones",
622
+ reactionsError: "No se pudieron cargar las reacciones",
623
+ votesOn: "Votos del comentario de {name}",
624
+ score: "Puntuaci\xF3n {n}",
625
+ upvote: "Votar a favor",
626
+ downvote: "Votar en contra",
627
+ upvoteSignIn: "Inicia sesi\xF3n para votar a favor",
628
+ downvoteSignIn: "Inicia sesi\xF3n para votar en contra",
629
+ upvotedLive: "Voto a favor registrado. Puntuaci\xF3n {n}",
630
+ downvotedLive: "Voto en contra registrado. Puntuaci\xF3n {n}",
631
+ voteRemovedLive: "Voto retirado. Puntuaci\xF3n {n}",
632
+ voteRefused: "No se acept\xF3 el voto. No puedes votar tu propio comentario.",
633
+ slowDown: "Demasiadas acciones en poco tiempo. Espera un momento e int\xE9ntalo de nuevo.",
634
+ sort: "Ordenar comentarios",
635
+ sortNewest: "Recientes",
636
+ sortTop: "Destacados",
637
+ sortedNewestLive: "Comentarios m\xE1s recientes primero",
638
+ sortedTopLive: "Comentarios destacados primero",
639
+ sortError: "No se pudieron ordenar los comentarios. Int\xE9ntalo de nuevo.",
640
+ newerLater: "Los comentarios m\xE1s recientes aparecen al cargar m\xE1s.",
641
+ moreError: "No se pudieron cargar m\xE1s comentarios. Int\xE9ntalo de nuevo.",
642
+ loadedLive: "{n} comentarios cargados"
483
643
  };
484
644
 
485
645
  // src/react/viewer/labels.ts
@@ -491,15 +651,15 @@ var VIEWER_LABELS_EN = {
491
651
  zoomIn: "Zoom in",
492
652
  zoomOut: "Zoom out",
493
653
  fit: "Fit to window",
494
- actual: "Actual size",
654
+ actual: "100%: actual size",
495
655
  search: "Find in diagram",
496
656
  searchPlaceholder: "Find",
497
657
  noMatch: "No match",
498
658
  matchOf: "{n} of {total}",
499
- copySource: "Copy diagram source",
500
- downloadSvg: "Download SVG",
501
- downloadPng: "Download PNG",
502
- copyImage: "Copy as image",
659
+ copySource: "MMD: copy diagram source",
660
+ downloadSvg: "SVG: download",
661
+ downloadPng: "PNG: download",
662
+ copyImage: "IMG: copy as image",
503
663
  pngScale: "PNG scale",
504
664
  fullscreen: "Fullscreen",
505
665
  exitFullscreen: "Exit fullscreen",
@@ -512,7 +672,16 @@ var VIEWER_LABELS_EN = {
512
672
  legendDownstream: "Downstream",
513
673
  outgoing: "outgoing",
514
674
  tracing: "{label}: {up} upstream, {down} downstream",
515
- map: "Overview map"
675
+ map: "Overview map",
676
+ largeTitle: "Large diagram, not drawn automatically",
677
+ largeBody: "Drawing a diagram this size can freeze this page for a few seconds, so it waits until you ask. Press Draw diagram: it takes a couple of seconds (a few more on a phone) and the page may pause while it works.",
678
+ drawLarge: "Draw diagram",
679
+ drawing: "Drawing\u2026",
680
+ drawingBody: "Drawing the diagram\u2026 this takes a couple of seconds.",
681
+ drawAgain: "Draw again",
682
+ showSource: "Show full source",
683
+ hideSource: "Show less",
684
+ printPreparing: "Preparing diagrams for print\u2026 Esc cancels between steps."
516
685
  };
517
686
  var VIEWER_LABELS_FR = {
518
687
  expand: "Agrandir le sch\xE9ma",
@@ -522,15 +691,15 @@ var VIEWER_LABELS_FR = {
522
691
  zoomIn: "Zoom avant",
523
692
  zoomOut: "Zoom arri\xE8re",
524
693
  fit: "Ajuster \xE0 la fen\xEAtre",
525
- actual: "Taille r\xE9elle",
694
+ actual: "100% : taille r\xE9elle",
526
695
  search: "Rechercher dans le sch\xE9ma",
527
696
  searchPlaceholder: "Rechercher",
528
697
  noMatch: "Aucun r\xE9sultat",
529
698
  matchOf: "{n} sur {total}",
530
- copySource: "Copier la source du sch\xE9ma",
531
- downloadSvg: "T\xE9l\xE9charger le SVG",
532
- downloadPng: "T\xE9l\xE9charger le PNG",
533
- copyImage: "Copier comme image",
699
+ copySource: "MMD : copier la source du sch\xE9ma",
700
+ downloadSvg: "SVG : t\xE9l\xE9charger",
701
+ downloadPng: "PNG : t\xE9l\xE9charger",
702
+ copyImage: "IMG : copier comme image",
534
703
  pngScale: "\xC9chelle du PNG",
535
704
  fullscreen: "Plein \xE9cran",
536
705
  exitFullscreen: "Quitter le plein \xE9cran",
@@ -543,7 +712,16 @@ var VIEWER_LABELS_FR = {
543
712
  legendDownstream: "En aval",
544
713
  outgoing: "sortants",
545
714
  tracing: "{label} : {up} en amont, {down} en aval",
546
- map: "Carte d'ensemble"
715
+ map: "Carte d'ensemble",
716
+ largeTitle: "Grand sch\xE9ma, non dessin\xE9 automatiquement",
717
+ largeBody: "Dessiner un sch\xE9ma de cette taille peut figer la page quelques secondes, il attend donc votre demande. Appuyez sur Dessiner le sch\xE9ma : cela prend quelques secondes (un peu plus sur un t\xE9l\xE9phone) et la page peut se figer pendant ce temps.",
718
+ drawLarge: "Dessiner le sch\xE9ma",
719
+ drawing: "Dessin en cours\u2026",
720
+ drawingBody: "Dessin du sch\xE9ma\u2026 cela prend quelques secondes.",
721
+ drawAgain: "Redessiner",
722
+ showSource: "Afficher toute la source",
723
+ hideSource: "R\xE9duire",
724
+ printPreparing: "Pr\xE9paration des sch\xE9mas pour l'impression\u2026 \xC9chap annule entre deux \xE9tapes."
547
725
  };
548
726
  var VIEWER_LABELS_ES = {
549
727
  expand: "Ampliar el diagrama",
@@ -553,15 +731,15 @@ var VIEWER_LABELS_ES = {
553
731
  zoomIn: "Acercar",
554
732
  zoomOut: "Alejar",
555
733
  fit: "Ajustar a la ventana",
556
- actual: "Tama\xF1o real",
734
+ actual: "100%: tama\xF1o real",
557
735
  search: "Buscar en el diagrama",
558
736
  searchPlaceholder: "Buscar",
559
737
  noMatch: "Sin resultados",
560
738
  matchOf: "{n} de {total}",
561
- copySource: "Copiar el c\xF3digo del diagrama",
562
- downloadSvg: "Descargar SVG",
563
- downloadPng: "Descargar PNG",
564
- copyImage: "Copiar como imagen",
739
+ copySource: "MMD: copiar el c\xF3digo del diagrama",
740
+ downloadSvg: "SVG: descargar",
741
+ downloadPng: "PNG: descargar",
742
+ copyImage: "IMG: copiar como imagen",
565
743
  pngScale: "Escala del PNG",
566
744
  fullscreen: "Pantalla completa",
567
745
  exitFullscreen: "Salir de pantalla completa",
@@ -574,7 +752,16 @@ var VIEWER_LABELS_ES = {
574
752
  legendDownstream: "Aguas abajo",
575
753
  outgoing: "salientes",
576
754
  tracing: "{label}: {up} aguas arriba, {down} aguas abajo",
577
- map: "Mapa general"
755
+ map: "Mapa general",
756
+ largeTitle: "Diagrama grande, no se dibuja autom\xE1ticamente",
757
+ largeBody: "Dibujar un diagrama de este tama\xF1o puede bloquear la p\xE1gina unos segundos, as\xED que espera a que lo pidas. Pulsa Dibujar el diagrama: tarda un par de segundos (algo m\xE1s en un tel\xE9fono) y la p\xE1gina puede detenerse mientras tanto.",
758
+ drawLarge: "Dibujar el diagrama",
759
+ drawing: "Dibujando\u2026",
760
+ drawingBody: "Dibujando el diagrama\u2026 tarda un par de segundos.",
761
+ drawAgain: "Dibujar de nuevo",
762
+ showSource: "Mostrar todo el c\xF3digo",
763
+ hideSource: "Mostrar menos",
764
+ printPreparing: "Preparando los diagramas para imprimir\u2026 Esc cancela entre pasos."
578
765
  };
579
766
 
580
767
  // src/react/strings.ts
@@ -593,6 +780,14 @@ var en = {
593
780
  warning: "Heads up",
594
781
  tip: "Tip",
595
782
  caution: "Caution",
783
+ important: "Important",
784
+ copyCode: "Copy code",
785
+ copied: "Copied",
786
+ copyBlocked: "Copy blocked",
787
+ done: "Done",
788
+ notDone: "Not done",
789
+ playVideo: "Play video",
790
+ videoFrame: "YouTube video",
596
791
  diagram: "Diagram",
597
792
  diagramError: "This diagram could not be rendered.",
598
793
  diagramLoading: "Loading the diagram",
@@ -645,6 +840,14 @@ var fr = {
645
840
  warning: "Attention",
646
841
  tip: "Astuce",
647
842
  caution: "Danger",
843
+ important: "Important",
844
+ copyCode: "Copier le code",
845
+ copied: "Copi\xE9",
846
+ copyBlocked: "Copie bloqu\xE9e",
847
+ done: "Termin\xE9",
848
+ notDone: "\xC0 faire",
849
+ playVideo: "Lire la vid\xE9o",
850
+ videoFrame: "Vid\xE9o YouTube",
648
851
  diagram: "Sch\xE9ma",
649
852
  diagramError: "Ce sch\xE9ma n'a pas pu \xEAtre affich\xE9.",
650
853
  diagramLoading: "Chargement du sch\xE9ma",
@@ -697,6 +900,14 @@ var es = {
697
900
  warning: "Atenci\xF3n",
698
901
  tip: "Consejo",
699
902
  caution: "Peligro",
903
+ important: "Importante",
904
+ copyCode: "Copiar el c\xF3digo",
905
+ copied: "Copiado",
906
+ copyBlocked: "Copia bloqueada",
907
+ done: "Hecho",
908
+ notDone: "Pendiente",
909
+ playVideo: "Reproducir el v\xEDdeo",
910
+ videoFrame: "V\xEDdeo de YouTube",
700
911
  diagram: "Diagrama",
701
912
  diagramError: "No se pudo mostrar este diagrama.",
702
913
  diagramLoading: "Cargando el diagrama",
@@ -754,14 +965,15 @@ function formatDate(iso, locale, options = { dateStyle: "medium" }) {
754
965
  }
755
966
 
756
967
  // src/react/content.tsx
968
+ var import_youtube_facade = require("./youtube-facade.cjs");
757
969
  var import_jsx_runtime3 = require("react/jsx-runtime");
758
970
  function plainText(node) {
759
971
  if (typeof node === "string" || typeof node === "number") return String(node);
760
972
  if (Array.isArray(node)) return node.map(plainText).join("");
761
973
  return (0, import_react.isValidElement)(node) ? plainText(node.props.children) : "";
762
974
  }
763
- var CALLOUT_ICON = { note: "info", tip: "check-circle", warning: "alert", caution: "x-circle" };
764
- function buildComponents(c, s) {
975
+ var CALLOUT_ICON = { note: "info", tip: "check-circle", important: "important", warning: "alert", caution: "x-circle" };
976
+ function buildComponents(c, s, { opensWithImage, interactive }) {
765
977
  const Link = c.Link ?? "a";
766
978
  const Img = c.Image ?? "img";
767
979
  const A = ({ href, children, ...rest }) => {
@@ -772,10 +984,11 @@ function buildComponents(c, s) {
772
984
  }
773
985
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: url, rel: "noopener noreferrer", ...rest, children });
774
986
  };
775
- let images = 0;
987
+ let eager = opensWithImage;
776
988
  const Image = (props) => {
777
989
  if (typeof props.src !== "string") return null;
778
- const first = images++ === 0;
990
+ const first = eager;
991
+ eager = false;
779
992
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Img, { loading: first ? "eager" : "lazy", ...first ? { fetchPriority: "high" } : {}, decoding: "async", ...props });
780
993
  };
781
994
  const Pre = ({ children, ...rest }) => {
@@ -784,13 +997,22 @@ function buildComponents(c, s) {
784
997
  const pre = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { tabIndex: 0, ...rest, children });
785
998
  if (c.CodeBlock) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(c.CodeBlock, { code: plainText(children), language, children: pre });
786
999
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("figure", { className: "hyle-codeblock", "data-slot-component": "CodeBlock", children: [
787
- language ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "lang", children: language }) }) : null,
1000
+ language || interactive ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
1001
+ language ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "lang", children: language }) : null,
1002
+ interactive ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1003
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", "aria-label": s.copyCode, children: [
1004
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { name: "copy" }),
1005
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { name: "check" })
1006
+ ] }),
1007
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "hyle-sr", role: "status" })
1008
+ ] }) : null
1009
+ ] }) : null,
788
1010
  pre
789
1011
  ] });
790
1012
  };
791
1013
  const Table = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "hyle-table", tabIndex: 0, role: "region", "aria-label": s.table, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("table", { ...rest, children }) });
792
1014
  const Callout = ({ kind, children }) => {
793
- const k = ["note", "tip", "warning", "caution"].includes(String(kind)) ? kind : "note";
1015
+ const k = Object.hasOwn(CALLOUT_ICON, String(kind)) ? kind : "note";
794
1016
  const title = s[k];
795
1017
  if (c.Callout) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(c.Callout, { kind: k, title, children });
796
1018
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("aside", { className: "hyle-callout", "data-kind": k, "data-slot-component": "Callout", role: "note", children: [
@@ -816,17 +1038,30 @@ function buildComponents(c, s) {
816
1038
  };
817
1039
  const Heading = (level) => function HyleHeading({ id, children, ...rest }) {
818
1040
  const Tag = `h${level}`;
1041
+ const anchored = typeof id === "string" && !String(rest.className ?? "").split(" ").includes("sr-only");
819
1042
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tag, { id, ...rest, children: [
820
- typeof id === "string" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { className: "hyle-anchor", href: `#${id}`, "aria-label": s.anchor, children: "#" }) : null,
1043
+ anchored ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { className: "hyle-anchor", href: `#${id}`, "aria-label": s.anchor }) : null,
821
1044
  children
822
1045
  ] });
823
1046
  };
824
- const defaults = { a: A, img: Image, pre: Pre, table: Table, callout: Callout, iframe: Frame, h2: Heading(2), h3: Heading(3), h4: Heading(4) };
1047
+ const Checkbox = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ...props, "aria-label": props.checked ? s.done : s.notDone });
1048
+ const Paragraph = ({ children, ...rest }) => {
1049
+ const [only, ...more] = import_react.Children.toArray(children).filter((n) => typeof n !== "string" || n.trim() !== "");
1050
+ if (more.length === 0 && (0, import_react.isValidElement)(only) && only.props["data-embed"] === "youtube") {
1051
+ const id = youtubeId(only.props.href);
1052
+ if (id) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_youtube_facade.YouTubeFacade, { videoId: id, playLabel: s.playVideo, frameTitle: s.videoFrame, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: only }) });
1053
+ }
1054
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { ...rest, children });
1055
+ };
1056
+ const defaults = { a: A, img: Image, pre: Pre, table: Table, input: Checkbox, callout: Callout, iframe: Frame, h2: Heading(2), h3: Heading(3), h4: Heading(4), ...interactive ? { p: Paragraph } : {} };
825
1057
  const overrides = ["a", "img", "code", "pre", "table", "blockquote", "h1", "h2", "h3", "h4", "h5", "h6"];
826
1058
  for (const key of overrides) if (c[key]) defaults[key] = c[key];
827
1059
  return defaults;
828
1060
  }
829
- function HastContent({ tree, title, description, components = {}, locale }) {
1061
+ function HastContent(props) {
1062
+ return renderHast(props, false);
1063
+ }
1064
+ function renderHast({ tree, title, description, components = {}, locale }, interactive) {
830
1065
  let root;
831
1066
  try {
832
1067
  root = sanitizeHast(tree, title, description);
@@ -838,11 +1073,13 @@ function HastContent({ tree, title, description, components = {}, locale }) {
838
1073
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: s.contentError })
839
1074
  ] });
840
1075
  }
1076
+ const lead = root.children.find((n) => n.type !== "text" || n.value.trim() !== "");
1077
+ const opensWithImage = lead?.type === "element" && lead.tagName === "figure";
841
1078
  return (0, import_hast_util_to_jsx_runtime.toJsxRuntime)(root, {
842
1079
  Fragment: import_react.Fragment,
843
1080
  jsx: import_jsx_runtime2.jsx,
844
1081
  jsxs: import_jsx_runtime2.jsxs,
845
- components: buildComponents(components, stringsFor(locale)),
1082
+ components: buildComponents(components, stringsFor(locale), { opensWithImage, interactive }),
846
1083
  elementAttributeNameCase: "react",
847
1084
  stylePropertyNameCase: "dom"
848
1085
  });
@@ -851,53 +1088,154 @@ function TrustedServerHtml({ html }) {
851
1088
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { dangerouslySetInnerHTML: { __html: hostAssetHtml(html) } });
852
1089
  }
853
1090
 
1091
+ // src/react/body.tsx
1092
+ var import_react2 = require("react");
1093
+ var import_code_copy = require("./code-copy.cjs");
1094
+ var import_fragment_alias = require("./fragment-alias.cjs");
1095
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1096
+ function ProseBody({ id, className, lang, ...content }) {
1097
+ const generated = (0, import_react2.useId)();
1098
+ const rootId = id ?? `hyle-body${generated}`;
1099
+ const s = stringsFor(content.locale);
1100
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1101
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { id: rootId, className, lang, children: renderHast(content, true) }),
1102
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_code_copy.CodeCopy, { rootId, copyLabel: s.copyCode, copiedLabel: s.copied, blockedLabel: s.copyBlocked }),
1103
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fragment_alias.FragmentAlias, {})
1104
+ ] });
1105
+ }
1106
+ function HyleBody(props) {
1107
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProseBody, { ...props, className: "hyle hyle-body hyle-prose" });
1108
+ }
1109
+
854
1110
  // src/react/index.ts
855
1111
  var import_mermaid_diagram2 = require("./mermaid-diagram.cjs");
856
1112
 
1113
+ // src/react/mermaid-config.ts
1114
+ var MAX_MERMAID_SOURCE = 1024 * 1024;
1115
+ var AUTO_RENDER_EDGES = 100;
1116
+ var AUTO_RENDER_CHARS = 6e3;
1117
+ var AUTO_RENDER_STATEMENTS = 250;
1118
+ var AUTO_RENDER_WORDS = 800;
1119
+ var AUTO_RENDER_GROUPS = 25;
1120
+ var CLAMP_LINES = 12;
1121
+ var isClampedSource = (source) => source.trimEnd().split("\n").length > CLAMP_LINES;
1122
+ var FRONTMATTER = /\s*-{3}[^\S\n]*\n[\s\S]*?\n[^\S\n]*-{3}[^\S\n]*(?:\n|$)/y;
1123
+ var DIRECTIVE = /%%\{(?:(?!\}%%)[\s\S])*(?:\}%%)?/g;
1124
+ var MAX_STRIP_ROUNDS = 16;
1125
+ function dropFrontmatter(text) {
1126
+ let end = 0;
1127
+ for (; ; ) {
1128
+ FRONTMATTER.lastIndex = end;
1129
+ const block = FRONTMATTER.exec(text);
1130
+ if (!block) return text.slice(end);
1131
+ end += block[0].length;
1132
+ }
1133
+ }
1134
+ function stripMermaidConfig(source) {
1135
+ let text = source.replace(/\r\n?/g, "\n");
1136
+ for (let round = 0; round < MAX_STRIP_ROUNDS; round++) {
1137
+ const next = dropFrontmatter(text).replace(DIRECTIVE, "");
1138
+ if (next === text) return text;
1139
+ text = next;
1140
+ }
1141
+ return "";
1142
+ }
1143
+ var EDGE_TOKEN = /-{2,}|={2,}|~{3}|\.{2,}|\.-|-[>x)]/;
1144
+ var ER_TOKEN = /-{2,}|={2,}|~{3}|\.{2,}|\.-|-[>x)]|-\.|to\b/i;
1145
+ var AMPERSAND = /\s&(?=\s)/g;
1146
+ var GROUP_OPENER = /^(?:subgraph\b|state\b.*\{)/;
1147
+ var BLOCK_OPENER = /\bblock\b(?!-)/g;
1148
+ var DEFAULT_LIMITS = { statements: AUTO_RENDER_STATEMENTS, words: AUTO_RENDER_WORDS, groups: AUTO_RENDER_GROUPS, edges: AUTO_RENDER_EDGES, blocks: Infinity, token: EDGE_TOKEN };
1149
+ var TYPE_LIMITS = {
1150
+ mindmap: { statements: 40 },
1151
+ kanban: { statements: 100 },
1152
+ block: { words: 100, blocks: 8 },
1153
+ erDiagram: { statements: 120, edges: 50, token: ER_TOKEN },
1154
+ "venn-beta": { statements: 180 },
1155
+ classDiagram: { statements: 70, edges: 30 },
1156
+ stateDiagram: { statements: 80 }
1157
+ };
1158
+ var COMMENT_LINE = /^[^\S\n\u2028\u2029]*%%[^\n]+\n?/gm;
1159
+ var statementsOf = (code) => code.split(/[\n;]/).map((s) => s.trim()).filter((s) => s && s !== "end");
1160
+ var edgeBound = (code, token) => {
1161
+ const amps = code.match(AMPERSAND)?.length ?? 0;
1162
+ return code.split(token).length - 1 + 2 * amps + Math.floor(amps ** 2 / 4);
1163
+ };
1164
+ function isLargeDiagram(source) {
1165
+ if (source.length > AUTO_RENDER_CHARS) return true;
1166
+ const code = stripMermaidConfig(source).replace(COMMENT_LINE, "");
1167
+ const statements = statementsOf(code);
1168
+ const first = statements.find((line) => !line.startsWith("%%")) ?? "";
1169
+ const type = Object.keys(TYPE_LIMITS).find((keyword) => first.startsWith(keyword));
1170
+ const limit = { ...DEFAULT_LIMITS, ...type ? TYPE_LIMITS[type] : void 0 };
1171
+ const words = statements.reduce((n, line) => n + line.split(/\s+/).length, 0);
1172
+ const groups = statements.filter((line) => GROUP_OPENER.test(line)).length;
1173
+ const blocks = code.match(BLOCK_OPENER)?.length ?? 0;
1174
+ return statements.length > limit.statements || words > limit.words || groups > limit.groups || blocks > limit.blocks || edgeBound(code, limit.token) > limit.edges;
1175
+ }
1176
+
1177
+ // src/react/index.ts
1178
+ var import_print_coordinator = require("./print-coordinator.cjs");
1179
+
857
1180
  // src/react/pages.tsx
858
1181
  var import_comments = require("./comments.cjs");
859
1182
 
1183
+ // src/react/theme.tsx
1184
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1185
+ function HyleTheme({ theme }) {
1186
+ const href = theme ? themeStylesheetHref(theme) : void 0;
1187
+ if (!href) return null;
1188
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1189
+ themeFontHrefs(Array.isArray(theme?.preload) ? theme.preload : []).map((font) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("link", { rel: "preload", as: "font", type: "font/woff2", href: font, crossOrigin: "anonymous" }, font)),
1190
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("link", { rel: "stylesheet", href, precedence: "hyle-theme" })
1191
+ ] });
1192
+ }
1193
+
860
1194
  // src/react/embed.tsx
861
- var import_jsx_runtime4 = require("react/jsx-runtime");
862
- function HyleListView({ items, layout = "list", title, headingLevel = 2, moreHref, olderHref, ...base }) {
1195
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1196
+ function HyleListView({ items, layout = "list", title, headingLevel = 2, moreHref, olderHref, theme, ...base }) {
863
1197
  const c = ctx(base, "en");
864
1198
  const { s, Link } = c;
865
1199
  const Row = base.slots?.["list.item"];
866
1200
  const Heading = `h${headingLevel}`;
867
1201
  const safe = items.filter((item) => item.canonical_path.startsWith("/"));
868
- if (safe.length === 0) return base.slots?.["list.empty"] ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hyle hyle-embed", "data-layout": layout, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "list.empty", slots: base.slots }) }) : null;
869
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle hyle-embed", "data-layout": layout, lang: c.locale, children: [
870
- title ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Heading, { className: "hyle-title", children: title }) : null,
871
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "hyle-items", children: safe.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
872
- item.published_at ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }) : null,
873
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
874
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "t", children: item.title }),
875
- item.description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: item.description }) : null
1202
+ if (safe.length === 0) return base.slots?.["list.empty"] ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle hyle-embed", "data-layout": layout, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "list.empty", slots: base.slots }) }) : null;
1203
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle hyle-embed", "data-layout": layout, lang: c.locale, children: [
1204
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HyleTheme, { theme }),
1205
+ title ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Heading, { className: "hyle-title", children: title }) : null,
1206
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "hyle-items", children: safe.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
1207
+ item.published_at ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }) : null,
1208
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1209
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "t", children: item.title }),
1210
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: item.description }) : null
876
1211
  ] })
877
1212
  ] }) }, item.canonical_path)) }),
878
- olderHref ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(OlderNav, { href: olderHref, c }) : null,
879
- moreHref ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { className: "hyle-more", href: moreHref, children: s.viewAll }) : null
1213
+ olderHref ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(OlderNav, { href: olderHref, c }) : null,
1214
+ moreHref ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { className: "hyle-more", href: moreHref, children: s.viewAll }) : null
880
1215
  ] });
881
1216
  }
882
1217
  function HyleArticleView({ article, headingLevel = 2, ...base }) {
883
1218
  const { publication: pub } = article;
884
1219
  const c = ctx(base, pub.locale);
885
1220
  const Heading = `h${headingLevel}`;
886
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hyle hyle-embed", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { lang: c.locale, children: [
887
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "hyle-head", children: [
888
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Heading, { className: "hyle-title", children: pub.title }),
889
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
890
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hyle-meta", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) }) }) })
891
- ] }),
892
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Body, { article, components: base.components, locale: c.locale }),
893
- pub.canonical_path.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("a", { className: "hyle-more", href: c.href(pub.canonical_path, pub.locale), rel: "bookmark", children: [
894
- c.s.readAtSource,
895
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "hyle-sr", children: [
896
- ": ",
897
- pub.title
898
- ] })
899
- ] }) : null
900
- ] }) });
1221
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle hyle-embed", children: [
1222
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HyleTheme, { theme: article.theme }),
1223
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("article", { lang: c.locale, children: [
1224
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "hyle-head", children: [
1225
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Heading, { className: "hyle-title", children: pub.title }),
1226
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1227
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hyle-meta", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) }) }) })
1228
+ ] }),
1229
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Body, { article, components: base.components, locale: c.locale }),
1230
+ pub.canonical_path.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("a", { className: "hyle-more", href: c.href(pub.canonical_path, pub.locale), rel: "bookmark", children: [
1231
+ c.s.readAtSource,
1232
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "hyle-sr", children: [
1233
+ ": ",
1234
+ pub.title
1235
+ ] })
1236
+ ] }) : null
1237
+ ] })
1238
+ ] });
901
1239
  }
902
1240
 
903
1241
  // src/react/seo.ts
@@ -1002,13 +1340,17 @@ function listJsonLd({ list, origin, href, path, locale, description, jsonLd, cur
1002
1340
  }
1003
1341
 
1004
1342
  // src/react/pages.tsx
1005
- var import_jsx_runtime5 = require("react/jsx-runtime");
1343
+ var import_toc_spy = require("./toc-spy.cjs");
1344
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1006
1345
  function Slot({ name, slots, tag: Tag = "div", className }) {
1007
1346
  const fill = slots?.[name];
1008
- return fill ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Tag, { "data-slot": name, className, children: fill }) : null;
1347
+ return fill ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tag, { "data-slot": name, className, children: fill }) : null;
1009
1348
  }
1010
- function Shell({ children }) {
1011
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle-page", children }) });
1349
+ function Shell({ children, theme }) {
1350
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1351
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HyleTheme, { theme }),
1352
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hyle", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hyle-page", children }) })
1353
+ ] });
1012
1354
  }
1013
1355
  function ctx(p, fallbackLocale) {
1014
1356
  const locale = p.locale ?? fallbackLocale;
@@ -1017,29 +1359,29 @@ function ctx(p, fallbackLocale) {
1017
1359
  function Pager({ prev, next, c }) {
1018
1360
  if (!prev && !next) return null;
1019
1361
  const { Link, s } = c;
1020
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("nav", { className: "hyle-pager", "aria-label": s.pager, children: [
1021
- prev ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Link, { href: c.href(prev.canonical_path), rel: "prev", children: [
1022
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "dir", children: [
1023
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev-left" }),
1362
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("nav", { className: "hyle-pager", "aria-label": s.pager, children: [
1363
+ prev ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Link, { href: c.href(prev.canonical_path), rel: "prev", children: [
1364
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "dir", children: [
1365
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev-left" }),
1024
1366
  s.prev
1025
1367
  ] }),
1026
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ttl", children: prev.title })
1027
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "none", "aria-hidden": "true" }),
1028
- next ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Link, { href: c.href(next.canonical_path), rel: "next", className: "next", children: [
1029
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "dir", children: [
1368
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ttl", children: prev.title })
1369
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "none", "aria-hidden": "true" }),
1370
+ next ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Link, { href: c.href(next.canonical_path), rel: "next", className: "next", children: [
1371
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "dir", children: [
1030
1372
  s.next,
1031
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev" })
1373
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev" })
1032
1374
  ] }),
1033
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ttl", children: next.title })
1375
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ttl", children: next.title })
1034
1376
  ] }) : null
1035
1377
  ] });
1036
1378
  }
1037
1379
  function OlderNav({ href, c }) {
1038
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("nav", { className: "hyle-pagination", "aria-label": c.s.pager, children: [
1039
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sp" }),
1040
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(c.Link, { className: "hyle-btn sm", href, rel: "next", children: [
1380
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("nav", { className: "hyle-pagination", "aria-label": c.s.pager, children: [
1381
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sp" }),
1382
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(c.Link, { className: "hyle-btn sm", href, rel: "next", children: [
1041
1383
  c.s.older,
1042
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev" })
1384
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev" })
1043
1385
  ] })
1044
1386
  ] });
1045
1387
  }
@@ -1050,54 +1392,64 @@ function TocList({ toc }) {
1050
1392
  if (entry.depth === 3 && last) last.subs.push(entry);
1051
1393
  else groups.push({ entry, subs: [] });
1052
1394
  }
1053
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { children: groups.map(({ entry, subs }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { children: [
1054
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: `#${scopeId(entry.id)}`, children: entry.text }),
1055
- subs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { children: subs.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: `#${scopeId(sub.id)}`, children: sub.text }) }, sub.id)) }) : null
1395
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: groups.map(({ entry, subs }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { children: [
1396
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: `#${scopeId(entry.id)}`, children: entry.text }),
1397
+ subs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: subs.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: `#${scopeId(sub.id)}`, children: sub.text }) }, sub.id)) }) : null
1056
1398
  ] }, entry.id)) });
1057
1399
  }
1058
- function Toc({ toc, c, aside }) {
1400
+ function Toc({ toc, c, aside, spy, className }) {
1059
1401
  const entries = toc.filter((t) => t.depth === 2 || t.depth === 3);
1060
1402
  if (entries.length === 0 && !aside) return { narrow: null, wide: null };
1061
1403
  const { s } = c;
1404
+ const classes = (own) => className ? `${className} ${own}` : own;
1062
1405
  return {
1063
- narrow: entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "hyle-toc-m", children: [
1064
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
1065
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "file" }),
1406
+ narrow: entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: classes("hyle-toc-m"), children: [
1407
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1408
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "file" }),
1066
1409
  s.toc,
1067
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1410
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1068
1411
  ] }),
1069
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "hyle-toc-list", "aria-label": s.toc, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TocList, { toc: entries }) })
1412
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-toc-list", "aria-label": s.toc, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TocList, { toc: entries }) })
1070
1413
  ] }),
1071
- wide: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { className: "hyle-toc-d", "aria-label": s.toc, children: [
1072
- entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1073
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "hyle-toc-title", children: s.toc }),
1074
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "hyle-toc-list", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TocList, { toc: entries }) })
1414
+ wide: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("aside", { className: classes("hyle-toc-d"), "aria-label": s.toc, children: [
1415
+ entries.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1416
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "hyle-toc-title", children: s.toc }),
1417
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-toc-list", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TocList, { toc: entries }) })
1075
1418
  ] }),
1076
- aside
1419
+ aside,
1420
+ spy && entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_toc_spy.TocSpy, { ids: entries.map((t) => scopeId(t.id)) }) : null
1077
1421
  ] })
1078
1422
  };
1079
1423
  }
1424
+ function HyleToc({ toc, variant, aside, locale }) {
1425
+ const both = Toc({ toc, c: { s: stringsFor(locale) }, aside, spy: true, className: "hyle hyle-toc-solo" });
1426
+ return variant === "rail" ? both.wide : both.narrow;
1427
+ }
1080
1428
  function Body({ article, components, locale }) {
1081
1429
  const { content, publication } = article;
1082
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hyle-body hyle-prose", lang: article.fallback ? void 0 : publication.locale, children: content.format === "hast" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HastContent, { tree: content.tree, title: publication.title, description: publication.description, components: components ?? {}, locale }) : content.format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TrustedServerHtml, { html: content.html }) : null });
1430
+ const lang = article.fallback ? void 0 : publication.locale;
1431
+ if (content.format === "hast") {
1432
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProseBody, { className: "hyle-body hyle-prose", lang, tree: content.tree, title: publication.title, description: publication.description, components: components ?? {}, locale });
1433
+ }
1434
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hyle-body hyle-prose", lang, children: content.format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TrustedServerHtml, { html: content.html }) : null });
1083
1435
  }
1084
1436
  function Languages({ alternates, current, c }) {
1085
1437
  if (alternates.length < 2) return null;
1086
1438
  const { Link, s } = c;
1087
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("nav", { className: "hyle-langs", "aria-label": s.languages, children: [
1088
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: s.readIn }),
1089
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { children: alternates.map((a) => {
1439
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("nav", { className: "hyle-langs", "aria-label": s.languages, children: [
1440
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: s.readIn }),
1441
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: alternates.map((a) => {
1090
1442
  const label = languageName(a.locale, a.locale);
1091
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: a.locale === current ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, "aria-current": "true", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, children: label }) }, a.locale);
1443
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: a.locale === current ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, "aria-current": "true", children: label }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: c.href(a.canonical_path, a.locale), hrefLang: a.locale, lang: a.locale, children: label }) }, a.locale);
1092
1444
  }) })
1093
1445
  ] });
1094
1446
  }
1095
1447
  function LdScript({ json }) {
1096
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
1448
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
1097
1449
  }
1098
1450
  function Crumbs({ items, c }) {
1099
1451
  const { Link } = c;
1100
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "hyle-crumbs", "aria-label": c.s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ol", { children: items.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { "aria-current": i === items.length - 1 ? "page" : void 0, children: i === items.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { href: crumbHref(c.href, b.canonical_path, c.locale), children: b.title }) }, b.canonical_path)) }) });
1452
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("nav", { className: "hyle-crumbs", "aria-label": c.s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ol", { children: items.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { "aria-current": i === items.length - 1 ? "page" : void 0, children: i === items.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: crumbHref(c.href, b.canonical_path, c.locale), children: b.title }) }, b.canonical_path)) }) });
1101
1453
  }
1102
1454
  function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth, imageHeight, related, ...base }) {
1103
1455
  const { publication: pub } = article;
@@ -1107,66 +1459,66 @@ function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth
1107
1459
  const author = articleAuthor(article, jsonLd)?.name;
1108
1460
  const modified = modifiedAt(pub);
1109
1461
  const words = wordCountOf(pub);
1110
- const toc = Toc({ toc: article.toc, c, aside: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "article.aside", slots: base.slots, className: "hyle-slot-wrap" }) });
1462
+ const toc = Toc({ toc: article.toc, c, spy: true, aside: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.aside", slots: base.slots, className: "hyle-slot-wrap" }) });
1111
1463
  const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
1112
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("article", { className: "hyle-article", "data-hyle-page": "article", lang: c.locale, children: [
1113
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "hyle-head", children: [
1114
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "article.before", slots: base.slots, className: "hyle-eyebrow" }),
1115
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Crumbs, { items: breadcrumbItems(article, jsonLd), c }),
1116
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: "hyle-title", children: pub.title }),
1117
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1118
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-meta", children: [
1119
- author ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
1120
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hyle-avatar", "aria-hidden": "true", children: author.slice(0, 2).toUpperCase() }),
1121
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
1122
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "hyle-sr", children: [
1464
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { theme: article.theme, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("article", { className: "hyle-article", "data-hyle-page": "article", lang: c.locale, children: [
1465
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { className: "hyle-head", children: [
1466
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.before", slots: base.slots, className: "hyle-eyebrow" }),
1467
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Crumbs, { items: breadcrumbItems(article, jsonLd), c }),
1468
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "hyle-title", children: pub.title }),
1469
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1470
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-meta", children: [
1471
+ author ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1472
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hyle-avatar", "aria-hidden": "true", children: author.slice(0, 2).toUpperCase() }),
1473
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1474
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "hyle-sr", children: [
1123
1475
  s.by,
1124
1476
  " "
1125
1477
  ] }),
1126
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "by", children: author })
1478
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "by", children: author })
1127
1479
  ] })
1128
1480
  ] }) : null,
1129
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
1130
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "calendar" }),
1131
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) })
1481
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1482
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "calendar" }),
1483
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: pub.published_at, title: pub.published_at, children: formatDate(pub.published_at, c.locale) })
1132
1484
  ] }),
1133
- modified ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
1134
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "calendar" }),
1485
+ modified ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1486
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "calendar" }),
1135
1487
  s.updated,
1136
1488
  " ",
1137
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: modified, title: modified, children: formatDate(modified, c.locale) })
1489
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: modified, title: modified, children: formatDate(modified, c.locale) })
1138
1490
  ] }) : null,
1139
- words ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
1140
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "clock" }),
1491
+ words ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1492
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "clock" }),
1141
1493
  s.readingTime.replace("{n}", String(readingMinutes(words)))
1142
1494
  ] }) : null,
1143
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
1144
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "globe" }),
1145
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { lang: pub.locale, children: languageName(pub.locale, c.locale) })
1495
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1496
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "globe" }),
1497
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { lang: pub.locale, children: languageName(pub.locale, c.locale) })
1146
1498
  ] }),
1147
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "article.meta", slots: base.slots, tag: "span" })
1499
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.meta", slots: base.slots, tag: "span" })
1148
1500
  ] }),
1149
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Languages, { alternates: article.alternates, current: pub.locale, c }),
1150
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1151
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "alert" }),
1152
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1153
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: notTranslated }),
1501
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Languages, { alternates: article.alternates, current: pub.locale, c }),
1502
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1503
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "alert" }),
1504
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1505
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: notTranslated }),
1154
1506
  " ",
1155
1507
  s.fallbackBody
1156
1508
  ] })
1157
1509
  ] }) : null
1158
1510
  ] }),
1159
1511
  toc.narrow,
1160
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Body, { article, components: base.components, locale: c.locale }),
1161
- engagement ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_comments.Comments, { path: pub.canonical_path, endpoint: engagement.endpoint ?? "/api/hyle/engage", signInHref: engagement.signInHref, locale: c.locale, labels: s.comments }) : null,
1162
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1163
- related ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1164
- related.items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HyleListView, { items: related.items, title: related.title ?? s.moreInSection, ...base, locale: c.locale }) : null,
1165
- article.children.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HyleListView, { items: article.children.map((child) => ({ ...child, description: null, published_at: "" })), title: s.subPages, ...base, locale: c.locale }) : null
1512
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Body, { article, components: base.components, locale: c.locale }),
1513
+ engagement ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_comments.Comments, { path: pub.canonical_path, endpoint: engagement.endpoint ?? "/api/hyle/engage", signInHref: engagement.signInHref, locale: c.locale, labels: s.comments }) : null,
1514
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1515
+ related ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1516
+ related.items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HyleListView, { items: related.items, title: related.title ?? s.moreInSection, ...base, locale: c.locale }) : null,
1517
+ article.children.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HyleListView, { items: article.children.map((child) => ({ ...child, description: null, published_at: "" })), title: s.subPages, ...base, locale: c.locale }) : null
1166
1518
  ] }) : null,
1167
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "article.after", slots: base.slots, className: "hyle-after" }),
1519
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "article.after", slots: base.slots, className: "hyle-after" }),
1168
1520
  toc.wide,
1169
- jsonLdOrigin ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LdScript, { json: articleJsonLd({ article, origin: jsonLdOrigin, href: c.href, jsonLd, imageUrl, imageWidth, imageHeight }) }) : null
1521
+ jsonLdOrigin ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LdScript, { json: articleJsonLd({ article, origin: jsonLdOrigin, href: c.href, jsonLd, imageUrl, imageWidth, imageHeight }) }) : null
1170
1522
  ] }) });
1171
1523
  }
1172
1524
  function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor, ...base }) {
@@ -1177,94 +1529,95 @@ function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor,
1177
1529
  for (const item of list.items) groups.set(item.published_at.slice(0, 7), [...groups.get(item.published_at.slice(0, 7)) ?? [], item]);
1178
1530
  const notTranslated = list.fallback ? s.fallbackTitle.replace("{language}", languageName(list.fallback.requested_locale, c.locale)) : void 0;
1179
1531
  const jsonLdOrigin = bareOrigin(origin);
1180
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-listpage", "data-hyle-page": "list", lang: c.locale, children: [
1181
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "hyle-head", children: [
1182
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: "hyle-title", children: list.section.title }),
1183
- description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "hyle-desc", children: description }) : null,
1184
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "list.header", slots: base.slots, className: "hyle-slot-wrap" }),
1185
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1186
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "alert" }),
1187
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1188
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: notTranslated }),
1532
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { theme: list.theme, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-listpage", "data-hyle-page": "list", lang: c.locale, children: [
1533
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { className: "hyle-head", children: [
1534
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "hyle-title", children: list.section.title }),
1535
+ description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "hyle-desc", children: description }) : null,
1536
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "list.header", slots: base.slots, className: "hyle-slot-wrap" }),
1537
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1538
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "alert" }),
1539
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1540
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: notTranslated }),
1189
1541
  " ",
1190
1542
  s.fallbackBody
1191
1543
  ] })
1192
1544
  ] }) : null
1193
1545
  ] }),
1194
- list.items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-empty", "data-slot-state": "empty", children: [
1195
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "file" }),
1196
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { children: s.emptyTitle }),
1197
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: s.emptyBody }),
1198
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "list.empty", slots: base.slots })
1199
- ] }) : [...groups].map(([month, items]) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { "aria-label": formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }), children: [
1200
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { className: "hyle-year", children: formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }) }),
1201
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: "hyle-items", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
1202
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }),
1203
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1204
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "t", children: item.title }),
1205
- item.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: item.description }) : null
1546
+ list.items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-empty", "data-slot-state": "empty", children: [
1547
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "file" }),
1548
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { children: s.emptyTitle }),
1549
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: s.emptyBody }),
1550
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "list.empty", slots: base.slots })
1551
+ ] }) : [...groups].map(([month, items]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { "aria-label": formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }), children: [
1552
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: "hyle-year", children: formatDate(`${month}-01`, c.locale, { month: "long", year: "numeric" }) }),
1553
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "hyle-items", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: Row ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Row, { item, href: c.href(item.canonical_path), locale: c.locale }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Link, { className: "hyle-item", href: c.href(item.canonical_path), children: [
1554
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("time", { dateTime: item.published_at, title: item.published_at, children: formatDate(item.published_at, c.locale) }),
1555
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1556
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "t", children: item.title }),
1557
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: item.description }) : null
1206
1558
  ] })
1207
1559
  ] }) }, item.canonical_path)) })
1208
1560
  ] }, month)),
1209
- olderHref ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OlderNav, { href: olderHref, c }) : null,
1210
- jsonLdOrigin && path ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LdScript, { json: listJsonLd({ list, origin: jsonLdOrigin, href: c.href, path, locale: c.locale, description, jsonLd, cursor }) }) : null
1561
+ olderHref ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(OlderNav, { href: olderHref, c }) : null,
1562
+ jsonLdOrigin && path ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LdScript, { json: listJsonLd({ list, origin: jsonLdOrigin, href: c.href, path, locale: c.locale, description, jsonLd, cursor }) }) : null
1211
1563
  ] }) });
1212
1564
  }
1213
1565
  function NotFound({ path, homeHref = "/", ...base }) {
1214
1566
  const c = ctx(base, "en");
1215
1567
  const { Link, s } = c;
1216
1568
  const body = base.slots?.["notfound.body"];
1217
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "hyle-state", "data-hyle-page": "not-found", lang: c.locale, children: [
1218
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "kind", children: s.nfKind }),
1219
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { children: s.nfTitle }),
1220
- body ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { "data-slot": "notfound.body", children: body }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: s.nfBody }),
1221
- path ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dl", { className: "hyle-addr", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1222
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dt", { children: s.path }),
1223
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dd", { children: path })
1569
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "hyle-state", "data-hyle-page": "not-found", lang: c.locale, children: [
1570
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kind", children: s.nfKind }),
1571
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { children: s.nfTitle }),
1572
+ body ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { "data-slot": "notfound.body", children: body }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: s.nfBody }),
1573
+ path ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dl", { className: "hyle-addr", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1574
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { children: s.path }),
1575
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { children: path })
1224
1576
  ] }) }) : null,
1225
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-actions", children: [
1226
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { className: "hyle-btn primary", href: crumbHref(c.href, homeHref, c.locale), children: s.home }),
1227
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "notfound.actions", slots: base.slots, tag: "span" })
1577
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hyle-actions", children: [
1578
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { className: "hyle-btn primary", href: crumbHref(c.href, homeHref, c.locale), children: s.home }),
1579
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { name: "notfound.actions", slots: base.slots, tag: "span" })
1228
1580
  ] })
1229
1581
  ] }) });
1230
1582
  }
1231
1583
  function Unavailable(base) {
1232
1584
  const c = ctx(base, "en");
1233
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "hyle-state", "data-hyle-page": "unavailable", lang: c.locale, role: "status", children: [
1234
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "kind", children: c.s.unKind }),
1235
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { children: c.s.unTitle }),
1236
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: c.s.unBody })
1585
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "hyle-state", "data-hyle-page": "unavailable", lang: c.locale, role: "status", children: [
1586
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kind", children: c.s.unKind }),
1587
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { children: c.s.unTitle }),
1588
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: c.s.unBody })
1237
1589
  ] }) });
1238
1590
  }
1239
1591
  function Redirecting({ from, to, ...base }) {
1240
1592
  const c = ctx(base, "en");
1241
1593
  const { Link, s } = c;
1242
1594
  const extra = base.slots?.["redirecting.body"];
1243
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "hyle-state", "data-hyle-page": "redirecting", role: "status", lang: c.locale, children: [
1244
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "kind", children: s.rdKind }),
1245
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { children: s.rdTitle }),
1246
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: s.rdBody }),
1247
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("dl", { className: "hyle-addr", children: [
1248
- from ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1249
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dt", { children: s.from }),
1250
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dd", { children: from })
1595
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "hyle-state", "data-hyle-page": "redirecting", role: "status", lang: c.locale, children: [
1596
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kind", children: s.rdKind }),
1597
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { children: s.rdTitle }),
1598
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: s.rdBody }),
1599
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("dl", { className: "hyle-addr", children: [
1600
+ from ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1601
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { children: s.from }),
1602
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { children: from })
1251
1603
  ] }) : null,
1252
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1253
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dt", { children: s.to }),
1254
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dd", { children: to })
1604
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1605
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { children: s.to }),
1606
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { children: to })
1255
1607
  ] })
1256
1608
  ] }),
1257
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fine", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { href: c.href(to), children: s.rdFallback }) }),
1258
- extra ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { "data-slot": "redirecting.body", className: "fine", children: extra }) : null
1609
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "fine", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { href: c.href(to), children: s.rdFallback }) }),
1610
+ extra ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { "data-slot": "redirecting.body", className: "fine", children: extra }) : null
1259
1611
  ] }) });
1260
1612
  }
1261
1613
 
1262
1614
  // src/react/index.ts
1263
1615
  var import_comments2 = require("./comments.cjs");
1616
+ var import_reactions = require("./reactions.cjs");
1264
1617
 
1265
1618
  // src/react/docs.tsx
1266
1619
  var import_docs_enhance = require("./docs-enhance.cjs");
1267
- var import_jsx_runtime6 = require("react/jsx-runtime");
1620
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1268
1621
  var ROOT_ID = "hyle-docs";
1269
1622
  var NAV_ID = "hyle-docs-nav";
1270
1623
  function navTreeOf(article) {
@@ -1288,15 +1641,15 @@ function pathTo(nodes, path) {
1288
1641
  }
1289
1642
  function Branch({ nodes, current, onPath, c }) {
1290
1643
  const { Link } = c;
1291
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: nodes.map((node) => {
1292
- const link = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Link, { href: c.href(node.canonical_path), ...node.canonical_path === current ? { "aria-current": "page" } : {}, children: node.title });
1293
- if (node.children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: link }, node.canonical_path);
1294
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { ...onPath.has(node.canonical_path) ? { open: true } : {}, children: [
1295
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
1296
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev" }),
1644
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { children: nodes.map((node) => {
1645
+ const link = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Link, { href: c.href(node.canonical_path), ...node.canonical_path === current ? { "aria-current": "page" } : {}, children: node.title });
1646
+ if (node.children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: link }, node.canonical_path);
1647
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { ...onPath.has(node.canonical_path) ? { open: true } : {}, children: [
1648
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
1649
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "chev" }),
1297
1650
  link
1298
1651
  ] }),
1299
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Branch, { nodes: node.children, current, onPath, c })
1652
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Branch, { nodes: node.children, current, onPath, c })
1300
1653
  ] }) }, node.canonical_path);
1301
1654
  }) });
1302
1655
  }
@@ -1310,47 +1663,47 @@ function DocsPage({ article, ...base }) {
1310
1663
  const siteName = article.breadcrumbs[0]?.title ?? "";
1311
1664
  const headingIds = article.toc.filter((t) => t.depth === 2 || t.depth === 3).map((t) => scopeId(t.id));
1312
1665
  const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
1313
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-docs", id: ROOT_ID, lang: c.locale, children: [
1314
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_docs_enhance.DocsEnhance, { headingIds, rootId: ROOT_ID }),
1315
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "hyle-nav-bar", popoverTarget: NAV_ID, children: [
1316
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "file" }),
1666
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Shell, { theme: article.theme, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-docs", id: ROOT_ID, lang: c.locale, children: [
1667
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_docs_enhance.DocsEnhance, { headingIds, rootId: ROOT_ID }),
1668
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "hyle-nav-bar", popoverTarget: NAV_ID, children: [
1669
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "file" }),
1317
1670
  s.menu,
1318
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "cur", children: pub.title }),
1319
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1671
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cur", children: pub.title }),
1672
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1320
1673
  ] }),
1321
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("aside", { className: "hyle-nav-d", id: NAV_ID, popover: "auto", "aria-label": s.docs, children: [
1322
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-side-head", children: [
1323
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: siteName }),
1324
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" }),
1325
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "hyle-nav-x", popoverTarget: NAV_ID, popoverTargetAction: "hide", "aria-label": s.closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "x" }) })
1674
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("aside", { className: "hyle-nav-d", id: NAV_ID, popover: "auto", "aria-label": s.docs, children: [
1675
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-side-head", children: [
1676
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: siteName }),
1677
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" }),
1678
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "hyle-nav-x", popoverTarget: NAV_ID, popoverTargetAction: "hide", "aria-label": s.closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "x" }) })
1326
1679
  ] }),
1327
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
1328
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Branch, { nodes: tree, current: pub.canonical_path, onPath, c }) }),
1329
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
1680
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
1681
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Branch, { nodes: tree, current: pub.canonical_path, onPath, c }) }),
1682
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
1330
1683
  ] }),
1331
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
1332
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1333
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "alert" }),
1334
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1335
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: notTranslated }),
1684
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
1685
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1686
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "alert" }),
1687
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
1688
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: notTranslated }),
1336
1689
  " ",
1337
1690
  s.fallbackBody
1338
1691
  ] })
1339
1692
  ] }) : null,
1340
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
1341
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "hyle-title", children: pub.title }),
1342
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1343
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "hyle-updated", children: [
1344
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "calendar" }),
1693
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
1694
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h1", { className: "hyle-title", children: pub.title }),
1695
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1696
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "hyle-updated", children: [
1697
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "calendar" }),
1345
1698
  s.updated,
1346
1699
  " ",
1347
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
1700
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
1348
1701
  ] }),
1349
1702
  toc.narrow,
1350
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Body, { article, components: base.components, locale: c.locale }),
1351
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1352
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" }),
1353
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hyle-docs-end", "aria-hidden": "true" })
1703
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Body, { article, components: base.components, locale: c.locale }),
1704
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1705
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" }),
1706
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hyle-docs-end", "aria-hidden": "true" })
1354
1707
  ] }),
1355
1708
  toc.wide
1356
1709
  ] }) });
@@ -1363,15 +1716,25 @@ function DocsPage({ article, ...base }) {
1363
1716
  HastContent,
1364
1717
  HastLimitError,
1365
1718
  HyleArticleView,
1719
+ HyleBody,
1366
1720
  HyleListView,
1721
+ HyleReactions,
1722
+ HyleTheme,
1723
+ HyleToc,
1367
1724
  ListPage,
1368
1725
  MermaidDiagram,
1369
1726
  NotFound,
1370
1727
  Redirecting,
1371
1728
  TrustedServerHtml,
1372
1729
  Unavailable,
1730
+ VIEWER_LABELS_EN,
1731
+ holdPrintUntil,
1732
+ installPrintShortcut,
1733
+ isClampedSource,
1734
+ isLargeDiagram,
1373
1735
  isSafeUrl,
1374
1736
  sanitizeHast,
1375
1737
  scopeId,
1376
- stringsFor
1738
+ stringsFor,
1739
+ stripMermaidConfig
1377
1740
  });