@olwiba/dx 0.0.18 → 0.0.19

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.
@@ -3,6 +3,11 @@ import { A as AsciiFontName } from './fonts-DdHWzA4X.js';
3
3
  interface GenerateAsciiGifOptions {
4
4
  text: string;
5
5
  accent?: string;
6
+ accents?: Array<{
7
+ text: string;
8
+ color: string;
9
+ sparkle?: boolean;
10
+ }>;
6
11
  font?: AsciiFontName | string;
7
12
  outputPath: string;
8
13
  color?: string;
package/dist/ascii-gif.js CHANGED
@@ -1318,6 +1318,23 @@ async function generateAsciiGif(options) {
1318
1318
  const layout = composeAsciiText(font, options.text);
1319
1319
  const bounds = getLayoutBounds(layout);
1320
1320
  const accentColumns = getAsciiAccentColumns(font, options.text, options.accent ?? "");
1321
+ let colAccentMap;
1322
+ let accentColorList;
1323
+ let sparklingAccents;
1324
+ if (options.accents && options.accents.length > 0) {
1325
+ colAccentMap = /* @__PURE__ */ new Map();
1326
+ sparklingAccents = /* @__PURE__ */ new Set();
1327
+ for (let i = 0; i < options.accents.length; i++) {
1328
+ const cols = getAsciiAccentColumns(font, options.text, options.accents[i].text);
1329
+ for (const col of cols) colAccentMap.set(col, i);
1330
+ if (options.accents[i].sparkle) sparklingAccents.add(i);
1331
+ }
1332
+ accentColorList = options.accents.map((a) => a.color);
1333
+ } else {
1334
+ colAccentMap = new Map([...accentColumns].map((col) => [col, 0]));
1335
+ accentColorList = [options.accentColor ?? options.color ?? "#38bdf8"];
1336
+ sparklingAccents = /* @__PURE__ */ new Set();
1337
+ }
1321
1338
  const width = Math.ceil(bounds.cols * ASCII_CHAR_WIDTH * scale) + padding * 2;
1322
1339
  const height = bounds.rows * ASCII_CHAR_HEIGHT * scale + padding * 2;
1323
1340
  const frameCount = Math.max(1, Math.round(fps * duration));
@@ -1360,11 +1377,11 @@ async function generateAsciiGif(options) {
1360
1377
  writeFileSync(options.outputPath, bytes2);
1361
1378
  return;
1362
1379
  }
1363
- const palette = createPalette({
1380
+ const palette = createMultiAccentPalette({
1364
1381
  backgroundColor: options.backgroundColor ?? "#0a0a0a",
1365
1382
  blendColor: options.blendColor ?? options.backgroundColor ?? "#0a0a0a",
1366
1383
  color: options.color ?? "#e5e5e5",
1367
- accentColor: options.accentColor ?? options.color ?? "#38bdf8",
1384
+ accentColors: accentColorList,
1368
1385
  levels,
1369
1386
  transparent: options.transparent ?? false
1370
1387
  });
@@ -1372,7 +1389,8 @@ async function generateAsciiGif(options) {
1372
1389
  frames.push(
1373
1390
  renderIndexedAsciiFrame({
1374
1391
  layout,
1375
- accentColumns,
1392
+ colAccentMap,
1393
+ sparklingAccents,
1376
1394
  phase: frame / frameCount,
1377
1395
  width,
1378
1396
  height,
@@ -1399,9 +1417,11 @@ function renderIndexedAsciiFrame(options) {
1399
1417
  const charWidth = Math.round(ASCII_CHAR_WIDTH * options.scale);
1400
1418
  const charHeight = Math.round(ASCII_CHAR_HEIGHT * options.scale);
1401
1419
  for (const cell of options.layout.cells) {
1402
- const intensity = getAsciiCellIntensity(cell, { phase: options.phase });
1420
+ const accentIdx = options.colAccentMap.get(cell.col);
1421
+ const isGlitter = accentIdx !== void 0 && options.sparklingAccents.has(accentIdx) && cell.ch === "\u2588";
1422
+ const intensity = isGlitter ? getGlitterIntensity(cell, options.phase * Math.PI * 2) : getAsciiCellIntensity(cell, { phase: options.phase });
1403
1423
  const level = Math.max(0, Math.min(options.levels - 1, Math.round(intensity * (options.levels - 1))));
1404
- const offset = options.accentColumns.has(cell.col) ? 1 + options.levels : 1;
1424
+ const offset = accentIdx !== void 0 ? 1 + (accentIdx + 1) * options.levels : 1;
1405
1425
  const colorIndex = offset + level;
1406
1426
  const x0 = options.padding + Math.round((cell.col - options.bounds.minCol) * ASCII_CHAR_WIDTH * options.scale);
1407
1427
  const y0 = options.padding + (cell.row - options.bounds.minRow) * charHeight;
@@ -1439,6 +1459,13 @@ function renderIndexedAsciiFrameWithRowColors(options) {
1439
1459
  }
1440
1460
  return pixels;
1441
1461
  }
1462
+ function getGlitterIntensity(cell, loop) {
1463
+ const seed = (cell.col * 7.13 + cell.row * 13.37) % (Math.PI * 2);
1464
+ const glitter = (Math.sin(loop * 3.5 + seed) + 1) / 2;
1465
+ const flow = Math.sin(cell.col * 0.08 + loop) * 0.055 + Math.sin(cell.row * 0.22 - loop * 0.75) * 0.04;
1466
+ const sparkBoost = Math.pow(glitter, 3) * 0.42;
1467
+ return Math.max(0.55, Math.min(1, 0.68 + flow + sparkBoost));
1468
+ }
1442
1469
  function createRowColorPalette(options) {
1443
1470
  const bg = parseColor(options.backgroundColor);
1444
1471
  const blend = parseColor(options.blendColor);
@@ -1479,21 +1506,23 @@ function resolveFont(font) {
1479
1506
  if (font in asciiFonts) return asciiFonts[font];
1480
1507
  return readFileSync(font, "utf-8");
1481
1508
  }
1482
- function createPalette(options) {
1509
+ function createMultiAccentPalette(options) {
1483
1510
  const bg = parseColor(options.backgroundColor);
1484
1511
  const blend = parseColor(options.blendColor);
1485
1512
  const base = parseColor(options.color);
1486
- const accent = parseColor(options.accentColor);
1487
1513
  const table = [bg.r, bg.g, bg.b];
1488
1514
  for (let level = 0; level < options.levels; level++) {
1489
1515
  const alpha = level / (options.levels - 1);
1490
1516
  const mixed = mix(blend, base, alpha);
1491
1517
  table.push(mixed.r, mixed.g, mixed.b);
1492
1518
  }
1493
- for (let level = 0; level < options.levels; level++) {
1494
- const alpha = level / (options.levels - 1);
1495
- const mixed = mix(blend, accent, alpha);
1496
- table.push(mixed.r, mixed.g, mixed.b);
1519
+ for (const accentHex of options.accentColors) {
1520
+ const accent = parseColor(accentHex);
1521
+ for (let level = 0; level < options.levels; level++) {
1522
+ const alpha = level / (options.levels - 1);
1523
+ const mixed = mix(blend, accent, alpha);
1524
+ table.push(mixed.r, mixed.g, mixed.b);
1525
+ }
1497
1526
  }
1498
1527
  while (table.length < 256 * 3) table.push(0, 0, 0);
1499
1528
  return { table: Uint8Array.from(table.slice(0, 256 * 3)) };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ascii/compose.ts","../src/ascii/figlet.ts","../src/ascii/render.ts","../src/ascii/fonts/dosrebel-data.ts","../src/ascii/fonts.ts","../src/ascii-gif.ts"],"names":["bytes"],"mappings":";;;;;;AAcO,SAAS,gBAAA,CAAiB,MAAkB,IAAA,EAA+B;AAChF,EAAA,MAAM,aAAwD,EAAC;AAE/D,EAAA,KAAA,MAAW,MAAM,IAAA,EAAM;AACrB,IAAA,MAAM,IAAA,GAAO,EAAA,CAAG,UAAA,CAAW,CAAC,CAAA;AAC5B,IAAA,MAAM,KAAA,GAAQ,KAAK,KAAA,CAAM,GAAA,CAAI,IAAI,CAAA,IAAK,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,EAAE,CAAA;AACvD,IAAA,IAAI,CAAC,KAAA,EAAO;AAEZ,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,GAAA,CAAI,GAAG,KAAA,CAAM,IAAI,CAAC,IAAA,KAAS,IAAA,CAAK,MAAM,CAAC,CAAA;AAC1D,IAAA,UAAA,CAAW,IAAA,CAAK;AAAA,MACd,KAAA,EAAO,MAAM,GAAA,CAAI,CAAC,SAAS,IAAA,CAAK,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,MAC7C;AAAA,KACD,CAAA;AAAA,EACH;AAEA,EAAA,MAAM,IAAA,GAAO,WAAW,MAAA,CAAO,CAAC,KAAK,KAAA,KAAU,GAAA,GAAM,KAAA,CAAM,KAAA,EAAO,CAAC,CAAA;AACnE,EAAA,MAAM,OAAO,IAAA,CAAK,MAAA;AAClB,EAAA,MAAM,QAAqB,EAAC;AAC5B,EAAA,IAAI,OAAA,GAAU,CAAA;AAEd,EAAA,KAAA,MAAW,SAAS,UAAA,EAAY;AAC9B,IAAA,KAAA,IAAS,GAAA,GAAM,CAAA,EAAG,GAAA,GAAM,IAAA,EAAM,GAAA,EAAA,EAAO;AACnC,MAAA,MAAM,IAAA,GAAO,KAAA,CAAM,KAAA,CA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AA,EAAK;AACxD,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,KAAA,CAAM,MAAA,EAAQ,SAAS,GAAG,CAAA;AAC7C,IAAA,KAAA,CAAM,IAAA,CAAK,MAAM,MAAM,CAAA;AACvB,IAAA,SAAA,CAAU,OAAO,KAAK,CAAA;AAAA,EACxB;AACA,EAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AACd;AAEA,SAAS,UAAA,CAAW,OAAiB,KAAA,EAAe;AAClD,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,KAAA,CAAM,MAAA,EAAQ,CAAA,EAAA,EAAK,KAAA,CAAM,IAAA,CAAK,KAAA,CAAM,UAAA,CAAW,CAAC,CAAC,CAAA;AACvE;AAEA,SAAS,QAAA,CAAS,OAAiB,KAAA,EAAe;AAChD,EAAA,KAAA,CAAM,IAAA,CAAK,KAAA,GAAQ,GAAA,EAAO,KAAA,IAAS,IAAK,GAAI,CAAA;AAC9C;AAEA,SAAS,SAAA,CAAU,OAAiB,MAAA,EAAoB;AACtD,EAAA,KAAA,MAAW,KAAA,IAAS,MAAA,EAAQ,KAAA,CAAM,IAAA,CAAK,KAAK,CAAA;AAC9C","file":"ascii-gif.js","sourcesContent":["import type { FigletFont } from \"./figlet\"\n\nexport interface AsciiCell {\n ch: \"█\" | \"░\"\n col: number\n row: number\n}\n\nexport interface AsciiTextLayout {\n cells: AsciiCell[]\n cols: number\n rows: number\n}\n\nexport function composeAsciiText(font: FigletFont, text: string): AsciiTextLayout {\n const charBlocks: Array<{ lines: string[]; width: number }> = []\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) continue\n\n const width = Math.max(...glyph.map((line) => line.length))\n charBlocks.push({\n lines: glyph.map((line) => line.padEnd(width)),\n width,\n })\n }\n\n const cols = charBlocks.reduce((sum, block) => sum + block.width, 0)\n const rows = font.height\n const cells: AsciiCell[] = []\n let offsetX = 0\n\n for (const block of charBlocks) {\n for (let row = 0; row < rows; row++) {\n const line = block.lines[row] ?? \"\"\n for (let col = 0; col < line.length; col++) {\n const ch = line[col]\n if (ch === \"█\" || ch === \"░\") {\n cells.push({ ch, col: offsetX + col, row })\n }\n }\n }\n offsetX += block.width\n }\n\n return { cells, cols, rows }\n}\n\nexport function getAsciiAccentColumns(\n font: FigletFont,\n text: string,\n accent: string,\n): Set<number> {\n if (!accent) return new Set<number>()\n\n const columns = new Set<number>()\n const accentRanges: Array<{ start: number; end: number }> = []\n let searchFrom = 0\n while (true) {\n const idx = text.indexOf(accent, searchFrom)\n if (idx === -1) break\n accentRanges.push({ start: idx, end: idx + accent.length })\n searchFrom = idx + 1\n }\n if (accentRanges.length === 0) return columns\n\n let offsetX = 0\n let charIndex = 0\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) { charIndex++; continue }\n\n const width = Math.max(...glyph.map((line) => line.length))\n if (accentRanges.some((r) => charIndex >= r.start && charIndex < r.end)) {\n for (let col = 0; col < width; col++) columns.add(offsetX + col)\n }\n offsetX += width\n charIndex++\n }\n\n return columns\n}\n","export interface FigletFont {\n height: number\n baseline: number\n hardblank: string\n chars: Map<number, string[]>\n}\n\nexport function parseFigletFont(raw: string): FigletFont {\n const lines = raw.split(\"\\n\")\n\n if (lines[0]?.charCodeAt(0) === 0xfeff) {\n lines[0] = lines[0].slice(1)\n }\n\n const header = lines[0]\n if (!header?.startsWith(\"flf2a\")) {\n throw new Error(\"Invalid FIGlet font: missing flf2a header\")\n }\n\n const hardblank = header[5] ?? \"$\"\n const parts = header.slice(6).trim().split(/\\s+/)\n const height = Number.parseInt(parts[0] ?? \"\", 10)\n const baseline = Number.parseInt(parts[1] ?? \"\", 10)\n const commentLines = Number.parseInt(parts[4] ?? \"\", 10)\n\n if (!Number.isFinite(height) || height <= 0) {\n throw new Error(\"Invalid FIGlet font: missing character height\")\n }\n\n const dataStart = 1 + (Number.isFinite(commentLines) ? commentLines : 0)\n const chars = new Map<number, string[]>()\n let lineIndex = dataStart\n let ascii = 32\n\n while (lineIndex + height <= lines.length && ascii <= 126) {\n const charLines: string[] = []\n for (let row = 0; row < height; row++) {\n const line = (lines[lineIndex + row] ?? \"\")\n .replace(/@+$/, \"\")\n .replaceAll(hardblank, \" \")\n charLines.push(line)\n }\n\n chars.set(ascii, charLines)\n lineIndex += height\n ascii++\n }\n\n return { height, baseline, hardblank, chars }\n}\n","import type { AsciiCell, AsciiTextLayout } from \"./compose\"\n\nexport const ASCII_CHAR_WIDTH = 7.5\nexport const ASCII_CHAR_HEIGHT = 15\n\nexport interface AsciiWave {\n cx: number\n cy: number\n t: number\n}\n\nexport interface AsciiPointer {\n x: number\n y: number\n active: boolean\n}\n\nexport interface AsciiFrameState {\n time?: number\n phase?: number\n pointer?: AsciiPointer\n waves?: AsciiWave[]\n}\n\nexport interface AsciiRenderOptions extends AsciiFrameState {\n accentColumns?: ReadonlySet<number>\n color: string\n accentColor?: string\n charWidth?: number\n charHeight?: number\n}\n\nexport interface AsciiFrameContext {\n clearRect(x: number, y: number, width: number, height: number): void\n fillRect(x: number, y: number, width: number, height: number): void\n globalAlpha: number\n fillStyle: string\n}\n\nexport function getAsciiCanvasSize(\n layout: AsciiTextLayout,\n charWidth = ASCII_CHAR_WIDTH,\n charHeight = ASCII_CHAR_HEIGHT,\n) {\n return {\n width: Math.ceil(layout.cols * charWidth),\n height: layout.rows * charHeight,\n }\n}\n\nexport function getAsciiCellIntensity(cell: AsciiCell, options: AsciiFrameState): number {\n const time = options.time ?? 0\n const loop = options.phase == null ? null : options.phase * Math.PI * 2\n\n if (cell.ch === \"░\") {\n const drift =\n loop == null\n ? Math.sin(time * 0.3 + cell.col * 0.1) * 0.03\n : Math.sin(loop + cell.col * 0.1) * 0.03\n return 0.15 + drift\n }\n\n if (loop != null) {\n return getLoopIntensity(cell, loop)\n }\n\n const noise = getLiveNoise(cell, time)\n\n const seed = cell.col * 7.13 + cell.row * 13.37\n const flickerPhase = Math.sin(seed) * 1000\n const flickerWave = Math.sin(time * 0.8 + flickerPhase)\n const flicker = flickerWave > 0.97 ? 0.15 : 0\n\n let intensity = 0.7 + noise + flicker\n const charWidth = ASCII_CHAR_WIDTH\n const charHeight = ASCII_CHAR_HEIGHT\n\n if (options.pointer?.active) {\n const mdx = cell.col * charWidth + charWidth / 2 - options.pointer.x\n const mdy = cell.row * charHeight + charHeight / 2 - options.pointer.y\n const mDist = Math.sqrt(mdx * mdx + mdy * mdy)\n const radius = 80\n if (mDist < radius) {\n const falloff = 1 - mDist / radius\n const ripple = Math.sin(mDist * 0.08 - time * 4) * 0.12 * falloff * falloff\n intensity = Math.min(1, intensity + falloff * 0.2 + ripple)\n }\n }\n\n const px = cell.col * charWidth + charWidth / 2\n const py = cell.row * charHeight + charHeight / 2\n for (const wave of options.waves ?? []) {\n const wdx = px - wave.cx\n const wdy = py - wave.cy\n const dist = Math.sqrt(wdx * wdx + wdy * wdy)\n const age = time - wave.t\n const waveRadius = age * 200\n const delta = dist - waveRadius\n const fade = Math.exp(-age * 1.5)\n const ring = Math.exp(-delta * delta * 0.002) * fade\n intensity = Math.min(1, intensity + ring * 0.5 * Math.sin(delta * 0.06 + 1.5))\n }\n\n return Math.max(0.5, Math.min(1, intensity))\n}\n\nexport function renderAsciiFrameToContext(\n ctx: AsciiFrameContext,\n layout: AsciiTextLayout,\n options: AsciiRenderOptions,\n) {\n const charWidth = options.charWidth ?? ASCII_CHAR_WIDTH\n const charHeight = options.charHeight ?? ASCII_CHAR_HEIGHT\n const { width, height } = getAsciiCanvasSize(layout, charWidth, charHeight)\n const accentColor = options.accentColor ?? options.color\n\n ctx.clearRect(0, 0, width, height)\n\n for (const cell of layout.cells) {\n const isAccent = options.accentColumns?.has(cell.col) ?? false\n ctx.globalAlpha = getAsciiCellIntensity(cell, options)\n ctx.fillStyle = isAccent ? accentColor : options.color\n ctx.fillRect(cell.col * charWidth, cell.row * charHeight, charWidth, charHeight)\n }\n\n ctx.globalAlpha = 1\n}\n\nfunction getLiveNoise(cell: AsciiCell, time: number): number {\n const nx = cell.col * 0.18 + time * 0.9\n const ny = cell.row * 0.3 + time * 0.55\n return (\n Math.sin(nx) * 0.12 +\n Math.sin(ny * 1.4 + nx * 0.6) * 0.1 +\n Math.sin(nx * 0.4 - ny * 0.8 + time * 1.6) * 0.08 +\n Math.sin((cell.col + cell.row) * 0.15 + time * 0.4) * 0.07\n )\n}\n\nfunction getLoopIntensity(cell: AsciiCell, loop: number): number {\n const flow =\n Math.sin(cell.col * 0.08 + loop) * 0.055 +\n Math.sin(cell.row * 0.22 - loop * 0.75) * 0.04\n const shimmer = (Math.sin(cell.col * 0.16 + cell.row * 0.08 - loop * 2) + 1) / 2\n const highlight = Math.pow(shimmer, 4) * 0.22\n const intensity = 0.68 + flow + highlight\n\n return Math.max(0.55, Math.min(1, intensity))\n}\n","// @generated from dosrebel.flf. Do not edit by hand.\nexport const dosrebelFont: string = \"flf2a$ 11 8 35 -1 15\\nRebel by Valerie Mates (popcorn@cyberspace.org), based on a font by Ron Bliss\\n(who sometimes goes by the name \\\"rebel\\\" because his initials are REB).\\nNOTE: THIS FONT ONLY WORKS IN MS-DOS.\\nMay 27, 1994\\n\\nExplanation of first line:\\nflf2 - \\\"magic number\\\" for file identification\\na - should always be `a', for now\\n$ - the \\\"hardblank\\\" -- prints as a blank, but can't be smushed\\n11 - height of a character\\n8 - height of a character, not including descenders\\n35 - max line length (excluding comment lines) + a fudge factor\\n-1 - default smushmode for this font (like \\\"-m 15\\\" on command line)\\n15 - number of comment lines\\n\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n ███@\\n░░░ @\\n @\\n @\\n @@\\n ██ ██@\\n░██░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ████████████@\\n░░░███░░███░ @\\n ████████████@\\n░░░███░░███░ @\\n ░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n ██████ @\\n ███░░░ @\\n ░░█████ @\\n ░░░░███ @\\n ██████ @\\n ░░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n ███ ███@\\n ░░░ ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ ███ @\\n░░░ ░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███ @\\n ░░██████ @\\n ██████ @\\n░███░░███ @\\n░███ ░░███ @\\n░░█████░███@\\n ░░░░░ ░░░ @\\n @\\n @\\n @@\\n ██@\\n ███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███@\\n ███ @\\n ███ @\\n░███ @\\n░███ @\\n░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███@\\n ░███@\\n ░███@\\n ███ @\\n ██░ @\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n ███ ░███ ███@\\n░░░█████████░ @\\n ░░░█████░ @\\n █████████ @\\n ███░░███░░███@\\n░░░ ░███ ░░░ @\\n ░░░ @\\n @\\n @\\n @@\\n @\\n ███ @\\n ░███ @\\n ███████████@\\n░░░░░███░░░ @\\n ░███ @\\n ░░░ @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n @\\n @\\n @\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n █████ @\\n ███░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░█████░ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ███████ @\\n ███░░░░ @\\n ███ █@\\n░██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ██████░ @\\n ░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████ @\\n░░███ ░░███ @\\n ░███ ░███ █@\\n ░███████████@\\n ░░░░░░░███░█@\\n ░███░ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░░░█@\\n░███ ░ @\\n░█████████ @\\n░░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░░░ @\\n░█████████ @\\n░███░░░░███@\\n░███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░███@\\n░░░ ███ @\\n ███ @\\n ███ @\\n ███ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░███@\\n░░█████████@\\n ░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n ██@\\n ░░ @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░███@\\n░░░ ░███@\\n ███████ @\\n ░███░░░ @\\n ░░░ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░░ @\\n░███ ██████ @\\n░███░███░███@\\n░███░███░███@\\n░███░░░ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ███████████ @\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ @\\n░░███ ███@\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████ @\\n░░███░░░░███ @\\n ░███ ░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███ ███ @\\n ██████████ @\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░░███░░░░░█@\\n ░███ █ ░ @\\n ░██████ @\\n ░███░░█ @\\n ░███ ░ █@\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░░███░░░░░░█@\\n ░███ █ ░ @\\n ░███████ @\\n ░███░░░█ @\\n ░███ ░ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ █████@\\n░░███ ░░███ @\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ ████@\\n░░███ ███░ @\\n ░███ ███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░░███ @\\n █████ ░░████@\\n░░░░░ ░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████ ██████@\\n░░██████ ██████ @\\n ░███░█████░███ @\\n ░███░░███ ░███ @\\n ░███ ░░░ ░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ██████ █████@\\n░░██████ ░░███ @\\n ░███░███ ░███ @\\n ░███░░███░███ @\\n ░███ ░░██████ @\\n ░███ ░░█████ @\\n █████ ░░█████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░███████░ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ██░███@\\n░░███ ░░████ @\\n ░░░██████░██@\\n ░░░░░░ ░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███ @\\n ░███ ░███ @\\n ░██████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n░███ ░░░ @\\n░░█████████ @\\n ░░░░░░░░███@\\n ███ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░███░░░█@\\n░ ░███ ░ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░░█████░ @\\n ░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████ ███ █████@\\n░░███ ░███ ░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n ░░███ █████ ███ @\\n ░░░█████░█████░ @\\n ░░███ ░░███ @\\n ░░░ ░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ███░███ @\\n ███ ░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░░░░███ @\\n░ ███░ @\\n ███ @\\n ███ @\\n ████ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░███░ @\\n░███ @\\n░███ @\\n░███ @\\n░███ @\\n░█████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n █████@\\n░░░███@\\n ░███@\\n ░███@\\n ░███@\\n ░███@\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n ████ @\\n ██░░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n░███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ████████ @\\n░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░░░ @\\n░███ ███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ███████ @\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███████ @\\n░███░░░ @\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███@\\n ░███ ░░░ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ███████@\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████@\\n ░░░░░███@\\n ███ ░███@\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███ █████@\\n ░███░░███ @\\n ░██████░ @\\n ░███░░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████████ @\\n░░███░░███░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n █████░███ █████@\\n░░░░░ ░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███████ @\\n ░███░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @@\\n @\\n @\\n ████████@\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░███████ @\\n ░░░░░███ @\\n ░███ @\\n █████@\\n ░░░░░ @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ @\\n ███░░ @\\n░░█████ @\\n ░░░░███@\\n ██████ @\\n░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n ░░███ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n ░███ ███@\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ███ █████@\\n░░███ ░███░░███ @\\n ░███ ░███ ░███ @\\n ░░███████████ @\\n ░░████░████ @\\n ░░░░ ░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░░░█████░ @\\n ███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░███ @\\n ███ ░███ @\\n ░░██████ @\\n ░░░░░░ @@\\n @\\n @\\n █████████@\\n ░█░░░░███ @\\n ░ ███░ @\\n ███░ █@\\n █████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░ @\\n @\\n @\\n @@\\n @\\n ███ ███@\\n ███░███░ @\\n░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n ███████ @\\n ███░░░███ @\\n ░█████████ @\\n ░███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░█████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ████ ██████ @\\n░░░░ ░░░░░░ @\\n @\\n @\\n @@\\n\"\n\n","import { dosrebelFont } from \"./fonts/dosrebel-data\"\n\nexport { dosrebelFont }\n\nexport const asciiFonts = {\n dosrebel: dosrebelFont,\n} as const\n\nexport type AsciiFontName = keyof typeof asciiFonts\n\nexport function getAsciiFont(name: AsciiFontName): string {\n return asciiFonts[name]\n}\n","import { mkdirSync, readFileSync, writeFileSync } from \"node:fs\"\nimport path from \"node:path\"\nimport {\n ASCII_CHAR_HEIGHT,\n ASCII_CHAR_WIDTH,\n asciiFonts,\n composeAsciiText,\n getAsciiAccentColumns,\n getAsciiCellIntensity,\n parseFigletFont,\n type AsciiFontName,\n type AsciiTextLayout,\n} from \"./ascii/index\"\n\ninterface RGB {\n r: number\n g: number\n b: number\n}\n\nexport interface GenerateAsciiGifOptions {\n text: string\n accent?: string\n font?: AsciiFontName | string\n outputPath: string\n color?: string\n accentColor?: string\n rowColors?: string[]\n backgroundColor?: string\n blendColor?: string\n fps?: number\n duration?: number\n scale?: number\n levels?: number\n padding?: number\n transparent?: boolean\n}\n\nexport async function generateAsciiGif(options: GenerateAsciiGifOptions): Promise<void> {\n const fps = options.fps ?? 24\n const duration = options.duration ?? 2.4\n const scale = options.scale ?? 2\n const levels = Math.max(2, Math.min(48, options.levels ?? 32))\n const padding = Math.max(0, Math.round(options.padding ?? 16))\n const fontRaw = resolveFont(options.font ?? \"dosrebel\")\n const font = parseFigletFont(fontRaw)\n const layout = composeAsciiText(font, options.text)\n const bounds = getLayoutBounds(layout)\n const accentColumns = getAsciiAccentColumns(font, options.text, options.accent ?? \"\")\n const width = Math.ceil(bounds.cols * ASCII_CHAR_WIDTH * scale) + padding * 2\n const height = bounds.rows * ASCII_CHAR_HEIGHT * scale + padding * 2\n const frameCount = Math.max(1, Math.round(fps * duration))\n const delay = Math.max(1, Math.round(100 / fps))\n const frames: Uint8Array[] = []\n\n // Row-colors path — one palette set per unique row color, applied by cell.row\n if (options.rowColors && options.rowColors.length > 0) {\n const uniqueRowColors = [...new Set(options.rowColors)]\n const rowPalette = createRowColorPalette({\n backgroundColor: options.backgroundColor ?? \"#0a0a0a\",\n blendColor: options.blendColor ?? options.backgroundColor ?? \"#0a0a0a\",\n rowColors: uniqueRowColors,\n levels,\n transparent: options.transparent ?? false,\n })\n for (let frame = 0; frame < frameCount; frame++) {\n frames.push(\n renderIndexedAsciiFrameWithRowColors({\n layout,\n phase: frame / frameCount,\n width,\n height,\n scale,\n levels,\n bounds,\n padding,\n rowColorsInput: options.rowColors,\n uniqueRowColors,\n }),\n )\n }\n const bytes = encodeGif({\n width,\n height,\n delay,\n palette: rowPalette.table,\n frames,\n transparent: options.transparent ?? false,\n })\n mkdirSync(path.dirname(options.outputPath), { recursive: true })\n writeFileSync(options.outputPath, bytes)\n return\n }\n\n const palette = createPalette({\n backgroundColor: options.backgroundColor ?? \"#0a0a0a\",\n blendColor: options.blendColor ?? options.backgroundColor ?? \"#0a0a0a\",\n color: options.color ?? \"#e5e5e5\",\n accentColor: options.accentColor ?? options.color ?? \"#38bdf8\",\n levels,\n transparent: options.transparent ?? false,\n })\n\n for (let frame = 0; frame < frameCount; frame++) {\n frames.push(\n renderIndexedAsciiFrame({\n layout,\n accentColumns,\n phase: frame / frameCount,\n width,\n height,\n scale,\n levels,\n bounds,\n padding,\n }),\n )\n }\n\n const bytes = encodeGif({\n width,\n height,\n delay,\n palette: palette.table,\n frames,\n transparent: options.transparent ?? false,\n })\n\n mkdirSync(path.dirname(options.outputPath), { recursive: true })\n writeFileSync(options.outputPath, bytes)\n}\n\ninterface RenderIndexedFrameOptions {\n layout: AsciiTextLayout\n accentColumns: ReadonlySet<number>\n phase: number\n width: number\n height: number\n scale: number\n levels: number\n bounds: LayoutBounds\n padding: number\n}\n\ninterface LayoutBounds {\n minCol: number\n minRow: number\n cols: number\n rows: number\n}\n\nfunction renderIndexedAsciiFrame(options: RenderIndexedFrameOptions): Uint8Array {\n const pixels = new Uint8Array(options.width * options.height)\n const charWidth = Math.round(ASCII_CHAR_WIDTH * options.scale)\n const charHeight = Math.round(ASCII_CHAR_HEIGHT * options.scale)\n\n for (const cell of options.layout.cells) {\n const intensity = getAsciiCellIntensity(cell, { phase: options.phase })\n const level = Math.max(0, Math.min(options.levels - 1, Math.round(intensity * (options.levels - 1))))\n const offset = options.accentColumns.has(cell.col) ? 1 + options.levels : 1\n const colorIndex = offset + level\n const x0 = options.padding + Math.round((cell.col - options.bounds.minCol) * ASCII_CHAR_WIDTH * options.scale)\n const y0 = options.padding + (cell.row - options.bounds.minRow) * charHeight\n const x1 = Math.min(options.width, x0 + charWidth)\n const y1 = Math.min(options.height, y0 + charHeight)\n\n for (let y = y0; y < y1; y++) {\n const row = y * options.width\n for (let x = x0; x < x1; x++) {\n pixels[row + x] = colorIndex\n }\n }\n }\n\n return pixels\n}\n\ninterface RenderWithRowColorsOptions {\n layout: AsciiTextLayout\n phase: number\n width: number\n height: number\n scale: number\n levels: number\n bounds: LayoutBounds\n padding: number\n rowColorsInput: string[]\n uniqueRowColors: string[]\n}\n\nfunction renderIndexedAsciiFrameWithRowColors(options: RenderWithRowColorsOptions): Uint8Array {\n const pixels = new Uint8Array(options.width * options.height)\n const charWidth = Math.round(ASCII_CHAR_WIDTH * options.scale)\n const charHeight = Math.round(ASCII_CHAR_HEIGHT * options.scale)\n\n for (const cell of options.layout.cells) {\n const intensity = getAsciiCellIntensity(cell, { phase: options.phase })\n const level = Math.max(0, Math.min(options.levels - 1, Math.round(intensity * (options.levels - 1))))\n const rowColor = options.rowColorsInput[cell.row % options.rowColorsInput.length] ?? options.rowColorsInput[0]!\n const colorSetIndex = Math.max(0, options.uniqueRowColors.indexOf(rowColor))\n const colorIndex = 1 + colorSetIndex * options.levels + level\n const x0 = options.padding + Math.round((cell.col - options.bounds.minCol) * ASCII_CHAR_WIDTH * options.scale)\n const y0 = options.padding + (cell.row - options.bounds.minRow) * charHeight\n const x1 = Math.min(options.width, x0 + charWidth)\n const y1 = Math.min(options.height, y0 + charHeight)\n for (let y = y0; y < y1; y++) {\n const row = y * options.width\n for (let x = x0; x < x1; x++) {\n pixels[row + x] = colorIndex\n }\n }\n }\n\n return pixels\n}\n\nfunction createRowColorPalette(options: {\n backgroundColor: string\n blendColor: string\n rowColors: string[]\n levels: number\n transparent: boolean\n}) {\n const bg = parseColor(options.backgroundColor)\n const blend = parseColor(options.blendColor)\n const table: number[] = [bg.r, bg.g, bg.b]\n\n for (const colorHex of options.rowColors) {\n const color = parseColor(colorHex)\n for (let level = 0; level < options.levels; level++) {\n const alpha = level / (options.levels - 1)\n const mixed = mix(blend, color, alpha)\n table.push(mixed.r, mixed.g, mixed.b)\n }\n }\n\n while (table.length < 256 * 3) table.push(0, 0, 0)\n return { table: Uint8Array.from(table.slice(0, 256 * 3)) }\n}\n\nfunction getLayoutBounds(layout: AsciiTextLayout): LayoutBounds {\n if (layout.cells.length === 0) {\n return { minCol: 0, minRow: 0, cols: Math.max(1, layout.cols), rows: Math.max(1, layout.rows) }\n }\n\n let minCol = Number.POSITIVE_INFINITY\n let maxCol = Number.NEGATIVE_INFINITY\n let minRow = Number.POSITIVE_INFINITY\n let maxRow = Number.NEGATIVE_INFINITY\n\n for (const cell of layout.cells) {\n minCol = Math.min(minCol, cell.col)\n maxCol = Math.max(maxCol, cell.col)\n minRow = Math.min(minRow, cell.row)\n maxRow = Math.max(maxRow, cell.row)\n }\n\n return {\n minCol,\n minRow,\n cols: maxCol - minCol + 1,\n rows: maxRow - minRow + 1,\n }\n}\n\nfunction resolveFont(font: AsciiFontName | string): string {\n if (font in asciiFonts) return asciiFonts[font as AsciiFontName]\n return readFileSync(font, \"utf-8\")\n}\n\nfunction createPalette(options: {\n backgroundColor: string\n blendColor: string\n color: string\n accentColor: string\n levels: number\n transparent: boolean\n}) {\n const bg = parseColor(options.backgroundColor)\n const blend = parseColor(options.blendColor)\n const base = parseColor(options.color)\n const accent = parseColor(options.accentColor)\n const table: number[] = [bg.r, bg.g, bg.b]\n\n for (let level = 0; level < options.levels; level++) {\n const alpha = level / (options.levels - 1)\n const mixed = mix(blend, base, alpha)\n table.push(mixed.r, mixed.g, mixed.b)\n }\n\n for (let level = 0; level < options.levels; level++) {\n const alpha = level / (options.levels - 1)\n const mixed = mix(blend, accent, alpha)\n table.push(mixed.r, mixed.g, mixed.b)\n }\n\n while (table.length < 256 * 3) table.push(0, 0, 0)\n return { table: Uint8Array.from(table.slice(0, 256 * 3)) }\n}\n\nfunction parseColor(input: string): RGB {\n const color = input.trim()\n const shortHex = /^#([0-9a-f]{3})$/i.exec(color)\n if (shortHex) {\n const [r, g, b] = shortHex[1].split(\"\").map((part) => Number.parseInt(part + part, 16))\n return { r, g, b }\n }\n\n const longHex = /^#([0-9a-f]{6})$/i.exec(color)\n if (longHex) {\n const value = longHex[1]\n return {\n r: Number.parseInt(value.slice(0, 2), 16),\n g: Number.parseInt(value.slice(2, 4), 16),\n b: Number.parseInt(value.slice(4, 6), 16),\n }\n }\n\n const rgb = /^rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/i.exec(color)\n if (rgb) {\n return {\n r: clampByte(Number.parseInt(rgb[1], 10)),\n g: clampByte(Number.parseInt(rgb[2], 10)),\n b: clampByte(Number.parseInt(rgb[3], 10)),\n }\n }\n\n throw new Error(`Unsupported color \"${input}\". Use #rgb, #rrggbb, or rgb(r,g,b).`)\n}\n\nfunction mix(a: RGB, b: RGB, amount: number): RGB {\n return {\n r: clampByte(a.r + (b.r - a.r) * amount),\n g: clampByte(a.g + (b.g - a.g) * amount),\n b: clampByte(a.b + (b.b - a.b) * amount),\n }\n}\n\nfunction clampByte(value: number): number {\n return Math.max(0, Math.min(255, Math.round(value)))\n}\n\ninterface EncodeGifOptions {\n width: number\n height: number\n delay: number\n palette: Uint8Array\n frames: Uint8Array[]\n transparent: boolean\n}\n\nfunction encodeGif(options: EncodeGifOptions): Uint8Array {\n const bytes: number[] = []\n writeAscii(bytes, \"GIF89a\")\n writeU16(bytes, options.width)\n writeU16(bytes, options.height)\n bytes.push(0xf7, 0, 0)\n pushBytes(bytes, options.palette)\n bytes.push(0x21, 0xff, 0x0b)\n writeAscii(bytes, \"NETSCAPE2.0\")\n bytes.push(0x03, 0x01)\n writeU16(bytes, 0)\n bytes.push(0)\n\n for (const frame of options.frames) {\n bytes.push(0x21, 0xf9, 0x04, options.transparent ? 0x05 : 0x04)\n writeU16(bytes, options.delay)\n bytes.push(0, 0)\n bytes.push(0x2c)\n writeU16(bytes, 0)\n writeU16(bytes, 0)\n writeU16(bytes, options.width)\n writeU16(bytes, options.height)\n bytes.push(0)\n bytes.push(8)\n writeSubBlocks(bytes, lzwEncode(frame, 8))\n }\n\n bytes.push(0x3b)\n return Uint8Array.from(bytes)\n}\n\nfunction lzwEncode(indices: Uint8Array, minCodeSize: number): Uint8Array {\n const clearCode = 1 << minCodeSize\n const endCode = clearCode + 1\n let codeSize = minCodeSize + 1\n const output: number[] = []\n const writeCode = createBitWriter(output)\n\n writeCode(clearCode, codeSize)\n\n let codesSinceClear = 0\n for (const index of indices) {\n if (codesSinceClear >= 240) {\n writeCode(clearCode, codeSize)\n codeSize = minCodeSize + 1\n codesSinceClear = 0\n }\n writeCode(index, codeSize)\n codesSinceClear++\n }\n\n writeCode(endCode, codeSize)\n writeCode(-1, 0)\n\n return Uint8Array.from(output)\n}\n\nfunction createBitWriter(output: number[]) {\n let buffer = 0\n let bitCount = 0\n\n return (code: number, size: number) => {\n if (code < 0) {\n if (bitCount > 0) output.push(buffer & 0xff)\n buffer = 0\n bitCount = 0\n return\n }\n\n buffer |= code << bitCount\n bitCount += size\n\n while (bitCount >= 8) {\n output.push(buffer & 0xff)\n buffer >>= 8\n bitCount -= 8\n }\n }\n}\n\nfunction writeSubBlocks(bytes: number[], data: Uint8Array) {\n for (let offset = 0; offset < data.length; offset += 255) {\n const chunk = data.slice(offset, offset + 255)\n bytes.push(chunk.length)\n pushBytes(bytes, chunk)\n }\n bytes.push(0)\n}\n\nfunction writeAscii(bytes: number[], value: string) {\n for (let i = 0; i < value.length; i++) bytes.push(value.charCodeAt(i))\n}\n\nfunction writeU16(bytes: number[], value: number) {\n bytes.push(value & 0xff, (value >> 8) & 0xff)\n}\n\nfunction pushBytes(bytes: number[], values: Uint8Array) {\n for (const value of values) bytes.push(value)\n}\n"]}
1
+ {"version":3,"sources":["../src/ascii/compose.ts","../src/ascii/figlet.ts","../src/ascii/render.ts","../src/ascii/fonts/dosrebel-data.ts","../src/ascii/fonts.ts","../src/ascii-gif.ts"],"names":["bytes"],"mappings":";;;;;;AAcO,SAAS,gBAAA,CAAiB,MAAkB,IAAA,EAA+B;AAChF,EAAA,MAAM,aAAwD,EAAC;AAE/D,EAAA,KAAA,MAAW,MAAM,IAAA,EAAM;AACrB,IAAA,MAAM,IAAA,GAAO,EAAA,CAAG,UAAA,CAAW,CAAC,CAAA;AAC5B,IAAA,MAAM,KAAA,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import type { FigletFont } from \"./figlet\"\n\nexport interface AsciiCell {\n ch: \"█\" | \"░\"\n col: number\n row: number\n}\n\nexport interface AsciiTextLayout {\n cells: AsciiCell[]\n cols: number\n rows: number\n}\n\nexport function composeAsciiText(font: FigletFont, text: string): AsciiTextLayout {\n const charBlocks: Array<{ lines: string[]; width: number }> = []\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) continue\n\n const width = Math.max(...glyph.map((line) => line.length))\n charBlocks.push({\n lines: glyph.map((line) => line.padEnd(width)),\n width,\n })\n }\n\n const cols = charBlocks.reduce((sum, block) => sum + block.width, 0)\n const rows = font.height\n const cells: AsciiCell[] = []\n let offsetX = 0\n\n for (const block of charBlocks) {\n for (let row = 0; row < rows; row++) {\n const line = block.lines[row] ?? \"\"\n for (let col = 0; col < line.length; col++) {\n const ch = line[col]\n if (ch === \"█\" || ch === \"░\") {\n cells.push({ ch, col: offsetX + col, row })\n }\n }\n }\n offsetX += block.width\n }\n\n return { cells, cols, rows }\n}\n\nexport function getAsciiAccentColumns(\n font: FigletFont,\n text: string,\n accent: string,\n): Set<number> {\n if (!accent) return new Set<number>()\n\n const columns = new Set<number>()\n const accentRanges: Array<{ start: number; end: number }> = []\n let searchFrom = 0\n while (true) {\n const idx = text.indexOf(accent, searchFrom)\n if (idx === -1) break\n accentRanges.push({ start: idx, end: idx + accent.length })\n searchFrom = idx + 1\n }\n if (accentRanges.length === 0) return columns\n\n let offsetX = 0\n let charIndex = 0\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) { charIndex++; continue }\n\n const width = Math.max(...glyph.map((line) => line.length))\n if (accentRanges.some((r) => charIndex >= r.start && charIndex < r.end)) {\n for (let col = 0; col < width; col++) columns.add(offsetX + col)\n }\n offsetX += width\n charIndex++\n }\n\n return columns\n}\n","export interface FigletFont {\n height: number\n baseline: number\n hardblank: string\n chars: Map<number, string[]>\n}\n\nexport function parseFigletFont(raw: string): FigletFont {\n const lines = raw.split(\"\\n\")\n\n if (lines[0]?.charCodeAt(0) === 0xfeff) {\n lines[0] = lines[0].slice(1)\n }\n\n const header = lines[0]\n if (!header?.startsWith(\"flf2a\")) {\n throw new Error(\"Invalid FIGlet font: missing flf2a header\")\n }\n\n const hardblank = header[5] ?? \"$\"\n const parts = header.slice(6).trim().split(/\\s+/)\n const height = Number.parseInt(parts[0] ?? \"\", 10)\n const baseline = Number.parseInt(parts[1] ?? \"\", 10)\n const commentLines = Number.parseInt(parts[4] ?? \"\", 10)\n\n if (!Number.isFinite(height) || height <= 0) {\n throw new Error(\"Invalid FIGlet font: missing character height\")\n }\n\n const dataStart = 1 + (Number.isFinite(commentLines) ? commentLines : 0)\n const chars = new Map<number, string[]>()\n let lineIndex = dataStart\n let ascii = 32\n\n while (lineIndex + height <= lines.length && ascii <= 126) {\n const charLines: string[] = []\n for (let row = 0; row < height; row++) {\n const line = (lines[lineIndex + row] ?? \"\")\n .replace(/@+$/, \"\")\n .replaceAll(hardblank, \" \")\n charLines.push(line)\n }\n\n chars.set(ascii, charLines)\n lineIndex += height\n ascii++\n }\n\n return { height, baseline, hardblank, chars }\n}\n","import type { AsciiCell, AsciiTextLayout } from \"./compose\"\n\nexport const ASCII_CHAR_WIDTH = 7.5\nexport const ASCII_CHAR_HEIGHT = 15\n\nexport interface AsciiWave {\n cx: number\n cy: number\n t: number\n}\n\nexport interface AsciiPointer {\n x: number\n y: number\n active: boolean\n}\n\nexport interface AsciiFrameState {\n time?: number\n phase?: number\n pointer?: AsciiPointer\n waves?: AsciiWave[]\n}\n\nexport interface AsciiRenderOptions extends AsciiFrameState {\n accentColumns?: ReadonlySet<number>\n color: string\n accentColor?: string\n charWidth?: number\n charHeight?: number\n}\n\nexport interface AsciiFrameContext {\n clearRect(x: number, y: number, width: number, height: number): void\n fillRect(x: number, y: number, width: number, height: number): void\n globalAlpha: number\n fillStyle: string\n}\n\nexport function getAsciiCanvasSize(\n layout: AsciiTextLayout,\n charWidth = ASCII_CHAR_WIDTH,\n charHeight = ASCII_CHAR_HEIGHT,\n) {\n return {\n width: Math.ceil(layout.cols * charWidth),\n height: layout.rows * charHeight,\n }\n}\n\nexport function getAsciiCellIntensity(cell: AsciiCell, options: AsciiFrameState): number {\n const time = options.time ?? 0\n const loop = options.phase == null ? null : options.phase * Math.PI * 2\n\n if (cell.ch === \"░\") {\n const drift =\n loop == null\n ? Math.sin(time * 0.3 + cell.col * 0.1) * 0.03\n : Math.sin(loop + cell.col * 0.1) * 0.03\n return 0.15 + drift\n }\n\n if (loop != null) {\n return getLoopIntensity(cell, loop)\n }\n\n const noise = getLiveNoise(cell, time)\n\n const seed = cell.col * 7.13 + cell.row * 13.37\n const flickerPhase = Math.sin(seed) * 1000\n const flickerWave = Math.sin(time * 0.8 + flickerPhase)\n const flicker = flickerWave > 0.97 ? 0.15 : 0\n\n let intensity = 0.7 + noise + flicker\n const charWidth = ASCII_CHAR_WIDTH\n const charHeight = ASCII_CHAR_HEIGHT\n\n if (options.pointer?.active) {\n const mdx = cell.col * charWidth + charWidth / 2 - options.pointer.x\n const mdy = cell.row * charHeight + charHeight / 2 - options.pointer.y\n const mDist = Math.sqrt(mdx * mdx + mdy * mdy)\n const radius = 80\n if (mDist < radius) {\n const falloff = 1 - mDist / radius\n const ripple = Math.sin(mDist * 0.08 - time * 4) * 0.12 * falloff * falloff\n intensity = Math.min(1, intensity + falloff * 0.2 + ripple)\n }\n }\n\n const px = cell.col * charWidth + charWidth / 2\n const py = cell.row * charHeight + charHeight / 2\n for (const wave of options.waves ?? []) {\n const wdx = px - wave.cx\n const wdy = py - wave.cy\n const dist = Math.sqrt(wdx * wdx + wdy * wdy)\n const age = time - wave.t\n const waveRadius = age * 200\n const delta = dist - waveRadius\n const fade = Math.exp(-age * 1.5)\n const ring = Math.exp(-delta * delta * 0.002) * fade\n intensity = Math.min(1, intensity + ring * 0.5 * Math.sin(delta * 0.06 + 1.5))\n }\n\n return Math.max(0.5, Math.min(1, intensity))\n}\n\nexport function renderAsciiFrameToContext(\n ctx: AsciiFrameContext,\n layout: AsciiTextLayout,\n options: AsciiRenderOptions,\n) {\n const charWidth = options.charWidth ?? ASCII_CHAR_WIDTH\n const charHeight = options.charHeight ?? ASCII_CHAR_HEIGHT\n const { width, height } = getAsciiCanvasSize(layout, charWidth, charHeight)\n const accentColor = options.accentColor ?? options.color\n\n ctx.clearRect(0, 0, width, height)\n\n for (const cell of layout.cells) {\n const isAccent = options.accentColumns?.has(cell.col) ?? false\n ctx.globalAlpha = getAsciiCellIntensity(cell, options)\n ctx.fillStyle = isAccent ? accentColor : options.color\n ctx.fillRect(cell.col * charWidth, cell.row * charHeight, charWidth, charHeight)\n }\n\n ctx.globalAlpha = 1\n}\n\nfunction getLiveNoise(cell: AsciiCell, time: number): number {\n const nx = cell.col * 0.18 + time * 0.9\n const ny = cell.row * 0.3 + time * 0.55\n return (\n Math.sin(nx) * 0.12 +\n Math.sin(ny * 1.4 + nx * 0.6) * 0.1 +\n Math.sin(nx * 0.4 - ny * 0.8 + time * 1.6) * 0.08 +\n Math.sin((cell.col + cell.row) * 0.15 + time * 0.4) * 0.07\n )\n}\n\nfunction getLoopIntensity(cell: AsciiCell, loop: number): number {\n const flow =\n Math.sin(cell.col * 0.08 + loop) * 0.055 +\n Math.sin(cell.row * 0.22 - loop * 0.75) * 0.04\n const shimmer = (Math.sin(cell.col * 0.16 + cell.row * 0.08 - loop * 2) + 1) / 2\n const highlight = Math.pow(shimmer, 4) * 0.22\n const intensity = 0.68 + flow + highlight\n\n return Math.max(0.55, Math.min(1, intensity))\n}\n","// @generated from dosrebel.flf. Do not edit by hand.\nexport const dosrebelFont: string = \"flf2a$ 11 8 35 -1 15\\nRebel by Valerie Mates (popcorn@cyberspace.org), based on a font by Ron Bliss\\n(who sometimes goes by the name \\\"rebel\\\" because his initials are REB).\\nNOTE: THIS FONT ONLY WORKS IN MS-DOS.\\nMay 27, 1994\\n\\nExplanation of first line:\\nflf2 - \\\"magic number\\\" for file identification\\na - should always be `a', for now\\n$ - the \\\"hardblank\\\" -- prints as a blank, but can't be smushed\\n11 - height of a character\\n8 - height of a character, not including descenders\\n35 - max line length (excluding comment lines) + a fudge factor\\n-1 - default smushmode for this font (like \\\"-m 15\\\" on command line)\\n15 - number of comment lines\\n\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n ███@\\n░░░ @\\n @\\n @\\n @@\\n ██ ██@\\n░██░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ████████████@\\n░░░███░░███░ @\\n ████████████@\\n░░░███░░███░ @\\n ░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n ██████ @\\n ███░░░ @\\n ░░█████ @\\n ░░░░███ @\\n ██████ @\\n ░░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n ███ ███@\\n ░░░ ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ ███ @\\n░░░ ░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███ @\\n ░░██████ @\\n ██████ @\\n░███░░███ @\\n░███ ░░███ @\\n░░█████░███@\\n ░░░░░ ░░░ @\\n @\\n @\\n @@\\n ██@\\n ███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███@\\n ███ @\\n ███ @\\n░███ @\\n░███ @\\n░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███@\\n ░███@\\n ░███@\\n ███ @\\n ██░ @\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n ███ ░███ ███@\\n░░░█████████░ @\\n ░░░█████░ @\\n █████████ @\\n ███░░███░░███@\\n░░░ ░███ ░░░ @\\n ░░░ @\\n @\\n @\\n @@\\n @\\n ███ @\\n ░███ @\\n ███████████@\\n░░░░░███░░░ @\\n ░███ @\\n ░░░ @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n @\\n @\\n @\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n █████ @\\n ███░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░█████░ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ███████ @\\n ███░░░░ @\\n ███ █@\\n░██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ██████░ @\\n ░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████ @\\n░░███ ░░███ @\\n ░███ ░███ █@\\n ░███████████@\\n ░░░░░░░███░█@\\n ░███░ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░░░█@\\n░███ ░ @\\n░█████████ @\\n░░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░░░ @\\n░█████████ @\\n░███░░░░███@\\n░███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░███@\\n░░░ ███ @\\n ███ @\\n ███ @\\n ███ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░███@\\n░░█████████@\\n ░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n ██@\\n ░░ @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░███@\\n░░░ ░███@\\n ███████ @\\n ░███░░░ @\\n ░░░ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░░ @\\n░███ ██████ @\\n░███░███░███@\\n░███░███░███@\\n░███░░░ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ███████████ @\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ @\\n░░███ ███@\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████ @\\n░░███░░░░███ @\\n ░███ ░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███ ███ @\\n ██████████ @\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░░███░░░░░█@\\n ░███ █ ░ @\\n ░██████ @\\n ░███░░█ @\\n ░███ ░ █@\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░░███░░░░░░█@\\n ░███ █ ░ @\\n ░███████ @\\n ░███░░░█ @\\n ░███ ░ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ █████@\\n░░███ ░░███ @\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ ████@\\n░░███ ███░ @\\n ░███ ███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░░███ @\\n █████ ░░████@\\n░░░░░ ░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████ ██████@\\n░░██████ ██████ @\\n ░███░█████░███ @\\n ░███░░███ ░███ @\\n ░███ ░░░ ░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ██████ █████@\\n░░██████ ░░███ @\\n ░███░███ ░███ @\\n ░███░░███░███ @\\n ░███ ░░██████ @\\n ░███ ░░█████ @\\n █████ ░░█████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░███████░ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ██░███@\\n░░███ ░░████ @\\n ░░░██████░██@\\n ░░░░░░ ░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███ @\\n ░███ ░███ @\\n ░██████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n░███ ░░░ @\\n░░█████████ @\\n ░░░░░░░░███@\\n ███ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░███░░░█@\\n░ ░███ ░ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░░█████░ @\\n ░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████ ███ █████@\\n░░███ ░███ ░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n ░░███ █████ ███ @\\n ░░░█████░█████░ @\\n ░░███ ░░███ @\\n ░░░ ░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ███░███ @\\n ███ ░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░░░░███ @\\n░ ███░ @\\n ███ @\\n ███ @\\n ████ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░███░ @\\n░███ @\\n░███ @\\n░███ @\\n░███ @\\n░█████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n █████@\\n░░░███@\\n ░███@\\n ░███@\\n ░███@\\n ░███@\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n ████ @\\n ██░░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n░███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ████████ @\\n░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░░░ @\\n░███ ███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ███████ @\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███████ @\\n░███░░░ @\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███@\\n ░███ ░░░ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ███████@\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████@\\n ░░░░░███@\\n ███ ░███@\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███ █████@\\n ░███░░███ @\\n ░██████░ @\\n ░███░░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████████ @\\n░░███░░███░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n █████░███ █████@\\n░░░░░ ░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███████ @\\n ░███░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @@\\n @\\n @\\n ████████@\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░███████ @\\n ░░░░░███ @\\n ░███ @\\n █████@\\n ░░░░░ @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ @\\n ███░░ @\\n░░█████ @\\n ░░░░███@\\n ██████ @\\n░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n ░░███ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n ░███ ███@\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ███ █████@\\n░░███ ░███░░███ @\\n ░███ ░███ ░███ @\\n ░░███████████ @\\n ░░████░████ @\\n ░░░░ ░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░░░█████░ @\\n ███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░███ @\\n ███ ░███ @\\n ░░██████ @\\n ░░░░░░ @@\\n @\\n @\\n █████████@\\n ░█░░░░███ @\\n ░ ███░ @\\n ███░ █@\\n █████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░ @\\n @\\n @\\n @@\\n @\\n ███ ███@\\n ███░███░ @\\n░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n ███████ @\\n ███░░░███ @\\n ░█████████ @\\n ░███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░█████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ████ ██████ @\\n░░░░ ░░░░░░ @\\n @\\n @\\n @@\\n\"\n\n","import { dosrebelFont } from \"./fonts/dosrebel-data\"\n\nexport { dosrebelFont }\n\nexport const asciiFonts = {\n dosrebel: dosrebelFont,\n} as const\n\nexport type AsciiFontName = keyof typeof asciiFonts\n\nexport function getAsciiFont(name: AsciiFontName): string {\n return asciiFonts[name]\n}\n","import { mkdirSync, readFileSync, writeFileSync } from \"node:fs\"\nimport path from \"node:path\"\nimport {\n ASCII_CHAR_HEIGHT,\n ASCII_CHAR_WIDTH,\n asciiFonts,\n composeAsciiText,\n getAsciiAccentColumns,\n getAsciiCellIntensity,\n parseFigletFont,\n type AsciiCell,\n type AsciiFontName,\n type AsciiTextLayout,\n} from \"./ascii/index\"\n\ninterface RGB {\n r: number\n g: number\n b: number\n}\n\nexport interface GenerateAsciiGifOptions {\n text: string\n accent?: string\n accents?: Array<{ text: string; color: string; sparkle?: boolean }>\n font?: AsciiFontName | string\n outputPath: string\n color?: string\n accentColor?: string\n rowColors?: string[]\n backgroundColor?: string\n blendColor?: string\n fps?: number\n duration?: number\n scale?: number\n levels?: number\n padding?: number\n transparent?: boolean\n}\n\nexport async function generateAsciiGif(options: GenerateAsciiGifOptions): Promise<void> {\n const fps = options.fps ?? 24\n const duration = options.duration ?? 2.4\n const scale = options.scale ?? 2\n const levels = Math.max(2, Math.min(48, options.levels ?? 32))\n const padding = Math.max(0, Math.round(options.padding ?? 16))\n const fontRaw = resolveFont(options.font ?? \"dosrebel\")\n const font = parseFigletFont(fontRaw)\n const layout = composeAsciiText(font, options.text)\n const bounds = getLayoutBounds(layout)\n const accentColumns = getAsciiAccentColumns(font, options.text, options.accent ?? \"\")\n // Build colAccentMap: col → accent index (0-based). Multi-accent overrides single.\n let colAccentMap: Map<number, number>\n let accentColorList: string[]\n let sparklingAccents: Set<number>\n if (options.accents && options.accents.length > 0) {\n colAccentMap = new Map()\n sparklingAccents = new Set()\n for (let i = 0; i < options.accents.length; i++) {\n const cols = getAsciiAccentColumns(font, options.text, options.accents[i].text)\n for (const col of cols) colAccentMap.set(col, i)\n if (options.accents[i].sparkle) sparklingAccents.add(i)\n }\n accentColorList = options.accents.map((a) => a.color)\n } else {\n colAccentMap = new Map([...accentColumns].map((col) => [col, 0]))\n accentColorList = [options.accentColor ?? options.color ?? \"#38bdf8\"]\n sparklingAccents = new Set()\n }\n const width = Math.ceil(bounds.cols * ASCII_CHAR_WIDTH * scale) + padding * 2\n const height = bounds.rows * ASCII_CHAR_HEIGHT * scale + padding * 2\n const frameCount = Math.max(1, Math.round(fps * duration))\n const delay = Math.max(1, Math.round(100 / fps))\n const frames: Uint8Array[] = []\n\n // Row-colors path — one palette set per unique row color, applied by cell.row\n if (options.rowColors && options.rowColors.length > 0) {\n const uniqueRowColors = [...new Set(options.rowColors)]\n const rowPalette = createRowColorPalette({\n backgroundColor: options.backgroundColor ?? \"#0a0a0a\",\n blendColor: options.blendColor ?? options.backgroundColor ?? \"#0a0a0a\",\n rowColors: uniqueRowColors,\n levels,\n transparent: options.transparent ?? false,\n })\n for (let frame = 0; frame < frameCount; frame++) {\n frames.push(\n renderIndexedAsciiFrameWithRowColors({\n layout,\n phase: frame / frameCount,\n width,\n height,\n scale,\n levels,\n bounds,\n padding,\n rowColorsInput: options.rowColors,\n uniqueRowColors,\n }),\n )\n }\n const bytes = encodeGif({\n width,\n height,\n delay,\n palette: rowPalette.table,\n frames,\n transparent: options.transparent ?? false,\n })\n mkdirSync(path.dirname(options.outputPath), { recursive: true })\n writeFileSync(options.outputPath, bytes)\n return\n }\n\n const palette = createMultiAccentPalette({\n backgroundColor: options.backgroundColor ?? \"#0a0a0a\",\n blendColor: options.blendColor ?? options.backgroundColor ?? \"#0a0a0a\",\n color: options.color ?? \"#e5e5e5\",\n accentColors: accentColorList,\n levels,\n transparent: options.transparent ?? false,\n })\n\n for (let frame = 0; frame < frameCount; frame++) {\n frames.push(\n renderIndexedAsciiFrame({\n layout,\n colAccentMap,\n sparklingAccents,\n phase: frame / frameCount,\n width,\n height,\n scale,\n levels,\n bounds,\n padding,\n }),\n )\n }\n\n const bytes = encodeGif({\n width,\n height,\n delay,\n palette: palette.table,\n frames,\n transparent: options.transparent ?? false,\n })\n\n mkdirSync(path.dirname(options.outputPath), { recursive: true })\n writeFileSync(options.outputPath, bytes)\n}\n\ninterface RenderIndexedFrameOptions {\n layout: AsciiTextLayout\n colAccentMap: ReadonlyMap<number, number>\n sparklingAccents: ReadonlySet<number>\n phase: number\n width: number\n height: number\n scale: number\n levels: number\n bounds: LayoutBounds\n padding: number\n}\n\ninterface LayoutBounds {\n minCol: number\n minRow: number\n cols: number\n rows: number\n}\n\nfunction renderIndexedAsciiFrame(options: RenderIndexedFrameOptions): Uint8Array {\n const pixels = new Uint8Array(options.width * options.height)\n const charWidth = Math.round(ASCII_CHAR_WIDTH * options.scale)\n const charHeight = Math.round(ASCII_CHAR_HEIGHT * options.scale)\n\n for (const cell of options.layout.cells) {\n const accentIdx = options.colAccentMap.get(cell.col)\n const isGlitter = accentIdx !== undefined && options.sparklingAccents.has(accentIdx) && cell.ch === \"█\"\n const intensity = isGlitter\n ? getGlitterIntensity(cell, options.phase * Math.PI * 2)\n : getAsciiCellIntensity(cell, { phase: options.phase })\n const level = Math.max(0, Math.min(options.levels - 1, Math.round(intensity * (options.levels - 1))))\n const offset = accentIdx !== undefined ? 1 + (accentIdx + 1) * options.levels : 1\n const colorIndex = offset + level\n const x0 = options.padding + Math.round((cell.col - options.bounds.minCol) * ASCII_CHAR_WIDTH * options.scale)\n const y0 = options.padding + (cell.row - options.bounds.minRow) * charHeight\n const x1 = Math.min(options.width, x0 + charWidth)\n const y1 = Math.min(options.height, y0 + charHeight)\n\n for (let y = y0; y < y1; y++) {\n const row = y * options.width\n for (let x = x0; x < x1; x++) {\n pixels[row + x] = colorIndex\n }\n }\n }\n\n return pixels\n}\n\ninterface RenderWithRowColorsOptions {\n layout: AsciiTextLayout\n phase: number\n width: number\n height: number\n scale: number\n levels: number\n bounds: LayoutBounds\n padding: number\n rowColorsInput: string[]\n uniqueRowColors: string[]\n}\n\nfunction renderIndexedAsciiFrameWithRowColors(options: RenderWithRowColorsOptions): Uint8Array {\n const pixels = new Uint8Array(options.width * options.height)\n const charWidth = Math.round(ASCII_CHAR_WIDTH * options.scale)\n const charHeight = Math.round(ASCII_CHAR_HEIGHT * options.scale)\n\n for (const cell of options.layout.cells) {\n const intensity = getAsciiCellIntensity(cell, { phase: options.phase })\n const level = Math.max(0, Math.min(options.levels - 1, Math.round(intensity * (options.levels - 1))))\n const rowColor = options.rowColorsInput[cell.row % options.rowColorsInput.length] ?? options.rowColorsInput[0]!\n const colorSetIndex = Math.max(0, options.uniqueRowColors.indexOf(rowColor))\n const colorIndex = 1 + colorSetIndex * options.levels + level\n const x0 = options.padding + Math.round((cell.col - options.bounds.minCol) * ASCII_CHAR_WIDTH * options.scale)\n const y0 = options.padding + (cell.row - options.bounds.minRow) * charHeight\n const x1 = Math.min(options.width, x0 + charWidth)\n const y1 = Math.min(options.height, y0 + charHeight)\n for (let y = y0; y < y1; y++) {\n const row = y * options.width\n for (let x = x0; x < x1; x++) {\n pixels[row + x] = colorIndex\n }\n }\n }\n\n return pixels\n}\n\nfunction getGlitterIntensity(cell: AsciiCell, loop: number): number {\n const seed = (cell.col * 7.13 + cell.row * 13.37) % (Math.PI * 2)\n const glitter = (Math.sin(loop * 3.5 + seed) + 1) / 2\n const flow = Math.sin(cell.col * 0.08 + loop) * 0.055 + Math.sin(cell.row * 0.22 - loop * 0.75) * 0.04\n const sparkBoost = Math.pow(glitter, 3) * 0.42\n return Math.max(0.55, Math.min(1, 0.68 + flow + sparkBoost))\n}\n\nfunction createRowColorPalette(options: {\n backgroundColor: string\n blendColor: string\n rowColors: string[]\n levels: number\n transparent: boolean\n}) {\n const bg = parseColor(options.backgroundColor)\n const blend = parseColor(options.blendColor)\n const table: number[] = [bg.r, bg.g, bg.b]\n\n for (const colorHex of options.rowColors) {\n const color = parseColor(colorHex)\n for (let level = 0; level < options.levels; level++) {\n const alpha = level / (options.levels - 1)\n const mixed = mix(blend, color, alpha)\n table.push(mixed.r, mixed.g, mixed.b)\n }\n }\n\n while (table.length < 256 * 3) table.push(0, 0, 0)\n return { table: Uint8Array.from(table.slice(0, 256 * 3)) }\n}\n\nfunction getLayoutBounds(layout: AsciiTextLayout): LayoutBounds {\n if (layout.cells.length === 0) {\n return { minCol: 0, minRow: 0, cols: Math.max(1, layout.cols), rows: Math.max(1, layout.rows) }\n }\n\n let minCol = Number.POSITIVE_INFINITY\n let maxCol = Number.NEGATIVE_INFINITY\n let minRow = Number.POSITIVE_INFINITY\n let maxRow = Number.NEGATIVE_INFINITY\n\n for (const cell of layout.cells) {\n minCol = Math.min(minCol, cell.col)\n maxCol = Math.max(maxCol, cell.col)\n minRow = Math.min(minRow, cell.row)\n maxRow = Math.max(maxRow, cell.row)\n }\n\n return {\n minCol,\n minRow,\n cols: maxCol - minCol + 1,\n rows: maxRow - minRow + 1,\n }\n}\n\nfunction resolveFont(font: AsciiFontName | string): string {\n if (font in asciiFonts) return asciiFonts[font as AsciiFontName]\n return readFileSync(font, \"utf-8\")\n}\n\n\n\nfunction createMultiAccentPalette(options: {\n backgroundColor: string\n blendColor: string\n color: string\n accentColors: string[]\n levels: number\n transparent: boolean\n}) {\n const bg = parseColor(options.backgroundColor)\n const blend = parseColor(options.blendColor)\n const base = parseColor(options.color)\n const table: number[] = [bg.r, bg.g, bg.b]\n\n // Text ramp (indices 1..levels)\n for (let level = 0; level < options.levels; level++) {\n const alpha = level / (options.levels - 1)\n const mixed = mix(blend, base, alpha)\n table.push(mixed.r, mixed.g, mixed.b)\n }\n\n // One ramp per accent color (indices 1+levels, 1+2*levels, ...)\n for (const accentHex of options.accentColors) {\n const accent = parseColor(accentHex)\n for (let level = 0; level < options.levels; level++) {\n const alpha = level / (options.levels - 1)\n const mixed = mix(blend, accent, alpha)\n table.push(mixed.r, mixed.g, mixed.b)\n }\n }\n\n while (table.length < 256 * 3) table.push(0, 0, 0)\n return { table: Uint8Array.from(table.slice(0, 256 * 3)) }\n}\n\nfunction parseColor(input: string): RGB {\n const color = input.trim()\n const shortHex = /^#([0-9a-f]{3})$/i.exec(color)\n if (shortHex) {\n const [r, g, b] = shortHex[1].split(\"\").map((part) => Number.parseInt(part + part, 16))\n return { r, g, b }\n }\n\n const longHex = /^#([0-9a-f]{6})$/i.exec(color)\n if (longHex) {\n const value = longHex[1]\n return {\n r: Number.parseInt(value.slice(0, 2), 16),\n g: Number.parseInt(value.slice(2, 4), 16),\n b: Number.parseInt(value.slice(4, 6), 16),\n }\n }\n\n const rgb = /^rgb\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)$/i.exec(color)\n if (rgb) {\n return {\n r: clampByte(Number.parseInt(rgb[1], 10)),\n g: clampByte(Number.parseInt(rgb[2], 10)),\n b: clampByte(Number.parseInt(rgb[3], 10)),\n }\n }\n\n throw new Error(`Unsupported color \"${input}\". Use #rgb, #rrggbb, or rgb(r,g,b).`)\n}\n\nfunction mix(a: RGB, b: RGB, amount: number): RGB {\n return {\n r: clampByte(a.r + (b.r - a.r) * amount),\n g: clampByte(a.g + (b.g - a.g) * amount),\n b: clampByte(a.b + (b.b - a.b) * amount),\n }\n}\n\nfunction clampByte(value: number): number {\n return Math.max(0, Math.min(255, Math.round(value)))\n}\n\ninterface EncodeGifOptions {\n width: number\n height: number\n delay: number\n palette: Uint8Array\n frames: Uint8Array[]\n transparent: boolean\n}\n\nfunction encodeGif(options: EncodeGifOptions): Uint8Array {\n const bytes: number[] = []\n writeAscii(bytes, \"GIF89a\")\n writeU16(bytes, options.width)\n writeU16(bytes, options.height)\n bytes.push(0xf7, 0, 0)\n pushBytes(bytes, options.palette)\n bytes.push(0x21, 0xff, 0x0b)\n writeAscii(bytes, \"NETSCAPE2.0\")\n bytes.push(0x03, 0x01)\n writeU16(bytes, 0)\n bytes.push(0)\n\n for (const frame of options.frames) {\n bytes.push(0x21, 0xf9, 0x04, options.transparent ? 0x05 : 0x04)\n writeU16(bytes, options.delay)\n bytes.push(0, 0)\n bytes.push(0x2c)\n writeU16(bytes, 0)\n writeU16(bytes, 0)\n writeU16(bytes, options.width)\n writeU16(bytes, options.height)\n bytes.push(0)\n bytes.push(8)\n writeSubBlocks(bytes, lzwEncode(frame, 8))\n }\n\n bytes.push(0x3b)\n return Uint8Array.from(bytes)\n}\n\nfunction lzwEncode(indices: Uint8Array, minCodeSize: number): Uint8Array {\n const clearCode = 1 << minCodeSize\n const endCode = clearCode + 1\n let codeSize = minCodeSize + 1\n const output: number[] = []\n const writeCode = createBitWriter(output)\n\n writeCode(clearCode, codeSize)\n\n let codesSinceClear = 0\n for (const index of indices) {\n if (codesSinceClear >= 240) {\n writeCode(clearCode, codeSize)\n codeSize = minCodeSize + 1\n codesSinceClear = 0\n }\n writeCode(index, codeSize)\n codesSinceClear++\n }\n\n writeCode(endCode, codeSize)\n writeCode(-1, 0)\n\n return Uint8Array.from(output)\n}\n\nfunction createBitWriter(output: number[]) {\n let buffer = 0\n let bitCount = 0\n\n return (code: number, size: number) => {\n if (code < 0) {\n if (bitCount > 0) output.push(buffer & 0xff)\n buffer = 0\n bitCount = 0\n return\n }\n\n buffer |= code << bitCount\n bitCount += size\n\n while (bitCount >= 8) {\n output.push(buffer & 0xff)\n buffer >>= 8\n bitCount -= 8\n }\n }\n}\n\nfunction writeSubBlocks(bytes: number[], data: Uint8Array) {\n for (let offset = 0; offset < data.length; offset += 255) {\n const chunk = data.slice(offset, offset + 255)\n bytes.push(chunk.length)\n pushBytes(bytes, chunk)\n }\n bytes.push(0)\n}\n\nfunction writeAscii(bytes: number[], value: string) {\n for (let i = 0; i < value.length; i++) bytes.push(value.charCodeAt(i))\n}\n\nfunction writeU16(bytes: number[], value: number) {\n bytes.push(value & 0xff, (value >> 8) & 0xff)\n}\n\nfunction pushBytes(bytes: number[], values: Uint8Array) {\n for (const value of values) bytes.push(value)\n}\n"]}
package/dist/cli.js CHANGED
@@ -1368,6 +1368,23 @@ async function generateAsciiGif(options) {
1368
1368
  const layout = composeAsciiText(font, options.text);
1369
1369
  const bounds = getLayoutBounds(layout);
1370
1370
  const accentColumns = getAsciiAccentColumns(font, options.text, options.accent ?? "");
1371
+ let colAccentMap;
1372
+ let accentColorList;
1373
+ let sparklingAccents;
1374
+ if (options.accents && options.accents.length > 0) {
1375
+ colAccentMap = /* @__PURE__ */ new Map();
1376
+ sparklingAccents = /* @__PURE__ */ new Set();
1377
+ for (let i = 0; i < options.accents.length; i++) {
1378
+ const cols = getAsciiAccentColumns(font, options.text, options.accents[i].text);
1379
+ for (const col of cols) colAccentMap.set(col, i);
1380
+ if (options.accents[i].sparkle) sparklingAccents.add(i);
1381
+ }
1382
+ accentColorList = options.accents.map((a) => a.color);
1383
+ } else {
1384
+ colAccentMap = new Map([...accentColumns].map((col) => [col, 0]));
1385
+ accentColorList = [options.accentColor ?? options.color ?? "#38bdf8"];
1386
+ sparklingAccents = /* @__PURE__ */ new Set();
1387
+ }
1371
1388
  const width = Math.ceil(bounds.cols * ASCII_CHAR_WIDTH * scale) + padding * 2;
1372
1389
  const height = bounds.rows * ASCII_CHAR_HEIGHT * scale + padding * 2;
1373
1390
  const frameCount = Math.max(1, Math.round(fps * duration));
@@ -1410,11 +1427,11 @@ async function generateAsciiGif(options) {
1410
1427
  writeFileSync(options.outputPath, bytes2);
1411
1428
  return;
1412
1429
  }
1413
- const palette = createPalette({
1430
+ const palette = createMultiAccentPalette({
1414
1431
  backgroundColor: options.backgroundColor ?? "#0a0a0a",
1415
1432
  blendColor: options.blendColor ?? options.backgroundColor ?? "#0a0a0a",
1416
1433
  color: options.color ?? "#e5e5e5",
1417
- accentColor: options.accentColor ?? options.color ?? "#38bdf8",
1434
+ accentColors: accentColorList,
1418
1435
  levels,
1419
1436
  transparent: options.transparent ?? false
1420
1437
  });
@@ -1422,7 +1439,8 @@ async function generateAsciiGif(options) {
1422
1439
  frames.push(
1423
1440
  renderIndexedAsciiFrame({
1424
1441
  layout,
1425
- accentColumns,
1442
+ colAccentMap,
1443
+ sparklingAccents,
1426
1444
  phase: frame / frameCount,
1427
1445
  width,
1428
1446
  height,
@@ -1449,9 +1467,11 @@ function renderIndexedAsciiFrame(options) {
1449
1467
  const charWidth = Math.round(ASCII_CHAR_WIDTH * options.scale);
1450
1468
  const charHeight = Math.round(ASCII_CHAR_HEIGHT * options.scale);
1451
1469
  for (const cell of options.layout.cells) {
1452
- const intensity = getAsciiCellIntensity(cell, { phase: options.phase });
1470
+ const accentIdx = options.colAccentMap.get(cell.col);
1471
+ const isGlitter = accentIdx !== void 0 && options.sparklingAccents.has(accentIdx) && cell.ch === "\u2588";
1472
+ const intensity = isGlitter ? getGlitterIntensity(cell, options.phase * Math.PI * 2) : getAsciiCellIntensity(cell, { phase: options.phase });
1453
1473
  const level = Math.max(0, Math.min(options.levels - 1, Math.round(intensity * (options.levels - 1))));
1454
- const offset = options.accentColumns.has(cell.col) ? 1 + options.levels : 1;
1474
+ const offset = accentIdx !== void 0 ? 1 + (accentIdx + 1) * options.levels : 1;
1455
1475
  const colorIndex = offset + level;
1456
1476
  const x0 = options.padding + Math.round((cell.col - options.bounds.minCol) * ASCII_CHAR_WIDTH * options.scale);
1457
1477
  const y0 = options.padding + (cell.row - options.bounds.minRow) * charHeight;
@@ -1489,6 +1509,13 @@ function renderIndexedAsciiFrameWithRowColors(options) {
1489
1509
  }
1490
1510
  return pixels;
1491
1511
  }
1512
+ function getGlitterIntensity(cell, loop) {
1513
+ const seed = (cell.col * 7.13 + cell.row * 13.37) % (Math.PI * 2);
1514
+ const glitter = (Math.sin(loop * 3.5 + seed) + 1) / 2;
1515
+ const flow = Math.sin(cell.col * 0.08 + loop) * 0.055 + Math.sin(cell.row * 0.22 - loop * 0.75) * 0.04;
1516
+ const sparkBoost = Math.pow(glitter, 3) * 0.42;
1517
+ return Math.max(0.55, Math.min(1, 0.68 + flow + sparkBoost));
1518
+ }
1492
1519
  function createRowColorPalette(options) {
1493
1520
  const bg = parseColor(options.backgroundColor);
1494
1521
  const blend = parseColor(options.blendColor);
@@ -1529,21 +1556,23 @@ function resolveFont(font) {
1529
1556
  if (font in asciiFonts) return asciiFonts[font];
1530
1557
  return readFileSync(font, "utf-8");
1531
1558
  }
1532
- function createPalette(options) {
1559
+ function createMultiAccentPalette(options) {
1533
1560
  const bg = parseColor(options.backgroundColor);
1534
1561
  const blend = parseColor(options.blendColor);
1535
1562
  const base = parseColor(options.color);
1536
- const accent = parseColor(options.accentColor);
1537
1563
  const table = [bg.r, bg.g, bg.b];
1538
1564
  for (let level = 0; level < options.levels; level++) {
1539
1565
  const alpha = level / (options.levels - 1);
1540
1566
  const mixed = mix(blend, base, alpha);
1541
1567
  table.push(mixed.r, mixed.g, mixed.b);
1542
1568
  }
1543
- for (let level = 0; level < options.levels; level++) {
1544
- const alpha = level / (options.levels - 1);
1545
- const mixed = mix(blend, accent, alpha);
1546
- table.push(mixed.r, mixed.g, mixed.b);
1569
+ for (const accentHex of options.accentColors) {
1570
+ const accent = parseColor(accentHex);
1571
+ for (let level = 0; level < options.levels; level++) {
1572
+ const alpha = level / (options.levels - 1);
1573
+ const mixed = mix(blend, accent, alpha);
1574
+ table.push(mixed.r, mixed.g, mixed.b);
1575
+ }
1547
1576
  }
1548
1577
  while (table.length < 256 * 3) table.push(0, 0, 0);
1549
1578
  return { table: Uint8Array.from(table.slice(0, 256 * 3)) };
package/dist/index.d.ts CHANGED
@@ -19,10 +19,23 @@ type DevPlugin = {
19
19
  apply: "serve";
20
20
  configureServer: (server: unknown) => void;
21
21
  };
22
+ declare function hexToAnsi24(hex: string): string | null;
22
23
  declare function printBanner(input: string | BannerSegment[] | BannerOptions): Promise<void>;
23
24
  declare function createTsupBannerHook(project: string | BannerOptions | LegacyBannerOptions): () => Promise<void>;
24
25
  declare function createDevBannerPlugin(project: string | BannerOptions | LegacyBannerOptions): DevPlugin;
25
26
 
27
+ /**
28
+ * Probe for the first free port from `start` up. Vite's own auto-increment
29
+ * doesn't kick in reliably under the TanStack Start plugin, so dev servers
30
+ * resolve the port themselves before passing it to `server.port`.
31
+ */
32
+ declare function findFreePort(start: number, attempts?: number): Promise<number>;
33
+ /**
34
+ * Resolve the dev server port for a preferred base port, logging when the
35
+ * preferred port is taken and a fallback is used.
36
+ */
37
+ declare function resolveDevPort(preferred: number, attempts?: number): Promise<number>;
38
+
26
39
  type ProjectBrandAccent = {
27
40
  hex: string;
28
41
  lightOklch?: string;
@@ -49,4 +62,4 @@ declare function createProjectDevBannerPlugin(project: ProjectConfig): {
49
62
  };
50
63
  declare function createProjectTsupBannerHook(project: ProjectConfig): () => Promise<void>;
51
64
 
52
- export { type BannerSegment, type ProjectBannerSegment, type ProjectBrandAccent, type ProjectConfig, createDevBannerPlugin, createProjectDevBannerPlugin, createProjectTsupBannerHook, createTsupBannerHook, printBanner };
65
+ export { type BannerSegment, type ProjectBannerSegment, type ProjectBrandAccent, type ProjectConfig, createDevBannerPlugin, createProjectDevBannerPlugin, createProjectTsupBannerHook, createTsupBannerHook, findFreePort, hexToAnsi24, printBanner, resolveDevPort };
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { createServer } from 'net';
2
+
1
3
  var __defProp = Object.defineProperty;
2
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
5
  var __esm = (fn, res) => function __init() {
@@ -1428,6 +1430,23 @@ function createDevBannerPlugin(project) {
1428
1430
  }
1429
1431
  };
1430
1432
  }
1433
+ async function findFreePort(start, attempts = 20) {
1434
+ for (let port = start; port < start + attempts; port++) {
1435
+ const free = await new Promise((resolve) => {
1436
+ const probe = createServer().once("error", () => resolve(false)).once("listening", () => probe.close(() => resolve(true)));
1437
+ probe.listen(port);
1438
+ });
1439
+ if (free) return port;
1440
+ }
1441
+ throw new Error(`No free port found in range ${start}-${start + attempts - 1}`);
1442
+ }
1443
+ async function resolveDevPort(preferred, attempts = 20) {
1444
+ const port = await findFreePort(preferred, attempts);
1445
+ if (port !== preferred) {
1446
+ console.log(`Port ${preferred} is in use \u2014 dev server will use ${port} instead.`);
1447
+ }
1448
+ return port;
1449
+ }
1431
1450
 
1432
1451
  // src/project-brand.ts
1433
1452
  function resolveProjectBannerSegments(segments, accentHex) {
@@ -1449,6 +1468,6 @@ function createProjectTsupBannerHook(project) {
1449
1468
  return createTsupBannerHook(getProjectBanner(project));
1450
1469
  }
1451
1470
 
1452
- export { createDevBannerPlugin, createProjectDevBannerPlugin, createProjectTsupBannerHook, createTsupBannerHook, printBanner };
1471
+ export { createDevBannerPlugin, createProjectDevBannerPlugin, createProjectTsupBannerHook, createTsupBannerHook, findFreePort, hexToAnsi24, printBanner, resolveDevPort };
1453
1472
  //# sourceMappingURL=index.js.map
1454
1473
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ascii/compose.ts","../src/ascii/fonts/dosrebel-data.ts","../src/ascii/fonts.ts","../src/ascii/figlet.ts","../src/dos-rebel-font.ts","../src/dev-banner.ts","../src/project-brand.ts"],"names":["segments","renderDosRebel"],"mappings":";;;;;;;;;;;AAcO,SAAS,gBAAA,CAAiB,MAAkB,IAAA,EAA+B;AAChF,EAAA,MAAM,aAAwD,EAAC;AAE/D,EAAA,KAAA,MAAW,MAAM,IAAA,EAAM;AACrB,IAAA,MAAM,IAAA,GAAO,EAAA,CAAG,UAAA,CAAW,CAAC,CAAA;AAC5B,IAAA,MAAM,KAAA,GAAQ,KAAK,KAAA,CAAM,GAAA,CAAI,IAAI,CAAA,IAAK,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,EAAE,CAAA;AACvD,IAAA,IAAI,CAAC,KAAA,EAAO;AAEZ,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,GAAA,CAAI,GAAG,KAAA,CAAM,IAAI,CAAC,IAAA,KAAS,IAAA,CAAK,MAAM,CAAC,CAAA;AAC1D,IAAA,UAAA,CAAW,IAAA,CAAK;AAAA,MACd,KAAA,EAAO,MAAM,GAAA,CAAI,CAAC,SAAS,IAAA,CAAK,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,MAC7C;AAAA,KACD,CAAA;AAAA,EACH;AAEA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AAA,GAC5B,4BAAA,CAA6B,OAAA,CAAQ,MAAA,CAAO,eAAA,EAAiB,OAAA,CAAQ,WAAA,CAAY,GAAG,CAAA,GACpF;AAAA,GACN;AACF;AAEO,SAAS,6BAA6B,OAAA,EAAwB;AACnE,EAAA,OAAO,qBAAA,CAAsB,gBAAA,CAAiB,OAAO,CAAC,CAAA;AACxD;AAEO,SAAS,4BAA4B,OAAA,EAAwB;AAClE,EAAA,OAAO,oBAAA,CAAqB,gBAAA,CAAiB,OAAO,CAAC,CAAA;AACvD","file":"index.js","sourcesContent":["import type { FigletFont } from \"./figlet\"\n\nexport interface AsciiCell {\n ch: \"█\" | \"░\"\n col: number\n row: number\n}\n\nexport interface AsciiTextLayout {\n cells: AsciiCell[]\n cols: number\n rows: number\n}\n\nexport function composeAsciiText(font: FigletFont, text: string): AsciiTextLayout {\n const charBlocks: Array<{ lines: string[]; width: number }> = []\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) continue\n\n const width = Math.max(...glyph.map((line) => line.length))\n charBlocks.push({\n lines: glyph.map((line) => line.padEnd(width)),\n width,\n })\n }\n\n const cols = charBlocks.reduce((sum, block) => sum + block.width, 0)\n const rows = font.height\n const cells: AsciiCell[] = []\n let offsetX = 0\n\n for (const block of charBlocks) {\n for (let row = 0; row < rows; row++) {\n const line = block.lines[row] ?? \"\"\n for (let col = 0; col < line.length; col++) {\n const ch = line[col]\n if (ch === \"█\" || ch === \"░\") {\n cells.push({ ch, col: offsetX + col, row })\n }\n }\n }\n offsetX += block.width\n }\n\n return { cells, cols, rows }\n}\n\nexport function getAsciiAccentColumns(\n font: FigletFont,\n text: string,\n accent: string,\n): Set<number> {\n if (!accent) return new Set<number>()\n\n const columns = new Set<number>()\n const accentRanges: Array<{ start: number; end: number }> = []\n let searchFrom = 0\n while (true) {\n const idx = text.indexOf(accent, searchFrom)\n if (idx === -1) break\n accentRanges.push({ start: idx, end: idx + accent.length })\n searchFrom = idx + 1\n }\n if (accentRanges.length === 0) return columns\n\n let offsetX = 0\n let charIndex = 0\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) { charIndex++; continue }\n\n const width = Math.max(...glyph.map((line) => line.length))\n if (accentRanges.some((r) => charIndex >= r.start && charIndex < r.end)) {\n for (let col = 0; col < width; col++) columns.add(offsetX + col)\n }\n offsetX += width\n charIndex++\n }\n\n return columns\n}\n","// @generated from dosrebel.flf. Do not edit by hand.\nexport const dosrebelFont: string = \"flf2a$ 11 8 35 -1 15\\nRebel by Valerie Mates (popcorn@cyberspace.org), based on a font by Ron Bliss\\n(who sometimes goes by the name \\\"rebel\\\" because his initials are REB).\\nNOTE: THIS FONT ONLY WORKS IN MS-DOS.\\nMay 27, 1994\\n\\nExplanation of first line:\\nflf2 - \\\"magic number\\\" for file identification\\na - should always be `a', for now\\n$ - the \\\"hardblank\\\" -- prints as a blank, but can't be smushed\\n11 - height of a character\\n8 - height of a character, not including descenders\\n35 - max line length (excluding comment lines) + a fudge factor\\n-1 - default smushmode for this font (like \\\"-m 15\\\" on command line)\\n15 - number of comment lines\\n\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n ███@\\n░░░ @\\n @\\n @\\n @@\\n ██ ██@\\n░██░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ████████████@\\n░░░███░░███░ @\\n ████████████@\\n░░░███░░███░ @\\n ░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n ██████ @\\n ███░░░ @\\n ░░█████ @\\n ░░░░███ @\\n ██████ @\\n ░░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n ███ ███@\\n ░░░ ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ ███ @\\n░░░ ░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███ @\\n ░░██████ @\\n ██████ @\\n░███░░███ @\\n░███ ░░███ @\\n░░█████░███@\\n ░░░░░ ░░░ @\\n @\\n @\\n @@\\n ██@\\n ███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███@\\n ███ @\\n ███ @\\n░███ @\\n░███ @\\n░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███@\\n ░███@\\n ░███@\\n ███ @\\n ██░ @\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n ███ ░███ ███@\\n░░░█████████░ @\\n ░░░█████░ @\\n █████████ @\\n ███░░███░░███@\\n░░░ ░███ ░░░ @\\n ░░░ @\\n @\\n @\\n @@\\n @\\n ███ @\\n ░███ @\\n ███████████@\\n░░░░░███░░░ @\\n ░███ @\\n ░░░ @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n @\\n @\\n @\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n █████ @\\n ███░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░█████░ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ███████ @\\n ███░░░░ @\\n ███ █@\\n░██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ██████░ @\\n ░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████ @\\n░░███ ░░███ @\\n ░███ ░███ █@\\n ░███████████@\\n ░░░░░░░███░█@\\n ░███░ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░░░█@\\n░███ ░ @\\n░█████████ @\\n░░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░░░ @\\n░█████████ @\\n░███░░░░███@\\n░███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░███@\\n░░░ ███ @\\n ███ @\\n ███ @\\n ███ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░███@\\n░░█████████@\\n ░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n ██@\\n ░░ @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░███@\\n░░░ ░███@\\n ███████ @\\n ░███░░░ @\\n ░░░ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░░ @\\n░███ ██████ @\\n░███░███░███@\\n░███░███░███@\\n░███░░░ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ███████████ @\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ @\\n░░███ ███@\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████ @\\n░░███░░░░███ @\\n ░███ ░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███ ███ @\\n ██████████ @\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░░███░░░░░█@\\n ░███ █ ░ @\\n ░██████ @\\n ░███░░█ @\\n ░███ ░ █@\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░░███░░░░░░█@\\n ░███ █ ░ @\\n ░███████ @\\n ░███░░░█ @\\n ░███ ░ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ █████@\\n░░███ ░░███ @\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ ████@\\n░░███ ███░ @\\n ░███ ███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░░███ @\\n █████ ░░████@\\n░░░░░ ░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████ ██████@\\n░░██████ ██████ @\\n ░███░█████░███ @\\n ░███░░███ ░███ @\\n ░███ ░░░ ░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ██████ █████@\\n░░██████ ░░███ @\\n ░███░███ ░███ @\\n ░███░░███░███ @\\n ░███ ░░██████ @\\n ░███ ░░█████ @\\n █████ ░░█████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░███████░ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ██░███@\\n░░███ ░░████ @\\n ░░░██████░██@\\n ░░░░░░ ░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███ @\\n ░███ ░███ @\\n ░██████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n░███ ░░░ @\\n░░█████████ @\\n ░░░░░░░░███@\\n ███ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░███░░░█@\\n░ ░███ ░ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░░█████░ @\\n ░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████ ███ █████@\\n░░███ ░███ ░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n ░░███ █████ ███ @\\n ░░░█████░█████░ @\\n ░░███ ░░███ @\\n ░░░ ░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ███░███ @\\n ███ ░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░░░░███ @\\n░ ███░ @\\n ███ @\\n ███ @\\n ████ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░███░ @\\n░███ @\\n░███ @\\n░███ @\\n░███ @\\n░█████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n █████@\\n░░░███@\\n ░███@\\n ░███@\\n ░███@\\n ░███@\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n ████ @\\n ██░░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n░███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ████████ @\\n░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░░░ @\\n░███ ███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ███████ @\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███████ @\\n░███░░░ @\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███@\\n ░███ ░░░ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ███████@\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████@\\n ░░░░░███@\\n ███ ░███@\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███ █████@\\n ░███░░███ @\\n ░██████░ @\\n ░███░░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████████ @\\n░░███░░███░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n █████░███ █████@\\n░░░░░ ░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███████ @\\n ░███░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @@\\n @\\n @\\n ████████@\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░███████ @\\n ░░░░░███ @\\n ░███ @\\n █████@\\n ░░░░░ @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ @\\n ███░░ @\\n░░█████ @\\n ░░░░███@\\n ██████ @\\n░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n ░░███ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n ░███ ███@\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ███ █████@\\n░░███ ░███░░███ @\\n ░███ ░███ ░███ @\\n ░░███████████ @\\n ░░████░████ @\\n ░░░░ ░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░░░█████░ @\\n ███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░███ @\\n ███ ░███ @\\n ░░██████ @\\n ░░░░░░ @@\\n @\\n @\\n █████████@\\n ░█░░░░███ @\\n ░ ███░ @\\n ███░ █@\\n █████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░ @\\n @\\n @\\n @@\\n @\\n ███ ███@\\n ███░███░ @\\n░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n ███████ @\\n ███░░░███ @\\n ░█████████ @\\n ░███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░█████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ████ ██████ @\\n░░░░ ░░░░░░ @\\n @\\n @\\n @@\\n\"\n\n","import { dosrebelFont } from \"./fonts/dosrebel-data\"\n\nexport { dosrebelFont }\n\nexport const asciiFonts = {\n dosrebel: dosrebelFont,\n} as const\n\nexport type AsciiFontName = keyof typeof asciiFonts\n\nexport function getAsciiFont(name: AsciiFontName): string {\n return asciiFonts[name]\n}\n","export interface FigletFont {\n height: number\n baseline: number\n hardblank: string\n chars: Map<number, string[]>\n}\n\nexport function parseFigletFont(raw: string): FigletFont {\n const lines = raw.split(\"\\n\")\n\n if (lines[0]?.charCodeAt(0) === 0xfeff) {\n lines[0] = lines[0].slice(1)\n }\n\n const header = lines[0]\n if (!header?.startsWith(\"flf2a\")) {\n throw new Error(\"Invalid FIGlet font: missing flf2a header\")\n }\n\n const hardblank = header[5] ?? \"$\"\n const parts = header.slice(6).trim().split(/\\s+/)\n const height = Number.parseInt(parts[0] ?? \"\", 10)\n const baseline = Number.parseInt(parts[1] ?? \"\", 10)\n const commentLines = Number.parseInt(parts[4] ?? \"\", 10)\n\n if (!Number.isFinite(height) || height <= 0) {\n throw new Error(\"Invalid FIGlet font: missing character height\")\n }\n\n const dataStart = 1 + (Number.isFinite(commentLines) ? commentLines : 0)\n const chars = new Map<number, string[]>()\n let lineIndex = dataStart\n let ascii = 32\n\n while (lineIndex + height <= lines.length && ascii <= 126) {\n const charLines: string[] = []\n for (let row = 0; row < height; row++) {\n const line = (lines[lineIndex + row] ?? \"\")\n .replace(/@+$/, \"\")\n .replaceAll(hardblank, \" \")\n charLines.push(line)\n }\n\n chars.set(ascii, charLines)\n lineIndex += height\n ascii++\n }\n\n return { height, baseline, hardblank, chars }\n}\n","import { composeAsciiText } from \"./ascii/compose\"\nimport { dosrebelFont } from \"./ascii/fonts\"\nimport { parseFigletFont } from \"./ascii/figlet\"\n\nlet renderCache = new Map<string, string[]>()\n\nexport async function renderDosRebel(text: string): Promise<string[]> {\n const cached = renderCache.get(text)\n if (cached) return cached\n\n const font = parseFigletFont(dosrebelFont)\n const layout = composeAsciiText(font, text)\n const output = Array.from({ length: layout.rows }, () => \"\")\n const cellByPosition = new Map(layout.cells.map((cell) => [`${cell.row}:${cell.col}`, cell.ch]))\n\n for (let row = 0; row < layout.rows; row++) {\n let line = \"\"\n for (let col = 0; col < layout.cols; col++) {\n line += cellByPosition.get(`${row}:${col}`) ?? \" \"\n }\n output[row] = line.replace(/\\s+$/g, \"\")\n }\n\n renderCache.set(text, output)\n return output\n}\n","const RESET = \"\\x1b[0m\"\nconst DEFAULT_HEX = \"#22D3EE\"\nconst WHITE_HEX = \"#ffffff\"\n\nexport type BannerSegment = {\n text: string\n colorHex?: string\n}\n\ntype BannerOptions = {\n segments: BannerSegment[]\n compactSegments?: BannerSegment[]\n rowColors?: string[]\n rowShadeColor?: string\n}\n\ntype LegacyBannerOptions = {\n baseText: string\n suffix?: string\n colorHex?: string\n baseColorHex?: string\n}\n\ntype DevPlugin = {\n name: string\n apply: \"serve\"\n configureServer: (server: unknown) => void\n}\n\n\nfunction hexToAnsi24(hex: string) {\n const normalized = hex.trim().replace(/^#/, \"\")\n if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {\n return null\n }\n const r = parseInt(normalized.slice(0, 2), 16)\n const g = parseInt(normalized.slice(2, 4), 16)\n const b = parseInt(normalized.slice(4, 6), 16)\n return `\\x1b[38;2;${r};${g};${b}m`\n}\n\nfunction visibleLen(value: string) {\n return value.length\n}\n\nfunction normalizeSegments(\n input: string | BannerOptions | LegacyBannerOptions\n): { segments: BannerSegment[]; compactSegments?: BannerSegment[]; rowColors?: string[]; rowShadeColor?: string } {\n if (typeof input === \"string\") {\n return { segments: [{ text: input, colorHex: WHITE_HEX }] }\n }\n\n if (\"segments\" in input) {\n const normalize = (segments: BannerSegment[]) =>\n segments\n .filter((segment) => segment.text.trim().length > 0)\n .map((segment) => ({\n text: segment.text,\n colorHex: segment.colorHex ?? WHITE_HEX,\n }))\n const segments = normalize(input.segments)\n const compactSegments =\n input.compactSegments && input.compactSegments.length > 0\n ? normalize(input.compactSegments)\n : undefined\n return { segments, compactSegments, rowColors: input.rowColors, rowShadeColor: input.rowShadeColor }\n }\n\n const suffix = input.suffix ?? \"\"\n if (!suffix) {\n return {\n segments: [{ text: input.baseText, colorHex: input.colorHex ?? DEFAULT_HEX }],\n }\n }\n\n return {\n segments: [\n { text: input.baseText, colorHex: input.baseColorHex ?? WHITE_HEX },\n { text: suffix, colorHex: input.colorHex ?? DEFAULT_HEX },\n ],\n }\n}\n\nasync function renderSegmentedFiglet(segments: BannerSegment[]) {\n const { renderDosRebel } = await import(\"./dos-rebel-font\")\n const cumulativeTexts: string[] = []\n let textSoFar = \"\"\n for (const segment of segments) {\n textSoFar += segment.text\n cumulativeTexts.push(textSoFar)\n }\n\n const renderedByBoundary = await Promise.all(\n cumulativeTexts.map((text) => renderDosRebel(text))\n )\n const lines = renderedByBoundary[renderedByBoundary.length - 1] ?? []\n const boundaryLines = renderedByBoundary.slice(0, -1)\n const ansiBySegment = segments.map(\n (segment) => hexToAnsi24(segment.colorHex ?? WHITE_HEX) ?? \"\\x1b[97m\"\n )\n const widestLine = lines.reduce((max, line) => Math.max(max, visibleLen(line)), 0)\n\n return { lines, boundaryLines, ansiBySegment, widestLine }\n}\n\nfunction printRowColoredFiglet(lines: string[], rowColors: string[], rowShadeColor?: string) {\n for (let i = 0; i < lines.length; i++) {\n const hex = rowColors[i % rowColors.length] ?? WHITE_HEX\n const fgAnsi = hexToAnsi24(hex) ?? \"\\x1b[97m\"\n const shadeAnsi = rowShadeColor ? (hexToAnsi24(rowShadeColor) ?? fgAnsi) : fgAnsi\n const line = lines[i] ?? \"\"\n let out = \"\"\n for (const char of line) {\n if (char === \" \") {\n out += `${RESET} `\n } else if (char === \"░\") {\n out += `${shadeAnsi}${char}`\n } else {\n out += `${fgAnsi}${char}`\n }\n }\n process.stdout.write(`${out}${RESET}\\n`)\n }\n}\n\nfunction printColoredFiglet(\n lines: string[],\n boundaryLines: string[][],\n ansiBySegment: string[]\n) {\n for (let i = 0; i < lines.length; i++) {\n const full = lines[i] ?? \"\"\n let cursor = 0\n let out = \"\"\n\n for (let segmentIndex = 0; segmentIndex < ansiBySegment.length; segmentIndex += 1) {\n const boundaryLine =\n segmentIndex < boundaryLines.length ? boundaryLines[segmentIndex]?.[i] ?? \"\" : full\n const end = Math.min(boundaryLine.length, full.length)\n const chunk = full.slice(cursor, end)\n out += `${ansiBySegment[segmentIndex]}${chunk}`\n cursor = end\n }\n\n process.stdout.write(`${out}${RESET}\\n`)\n }\n}\n\nexport async function printBanner(input: string | BannerSegment[] | BannerOptions) {\n const normalized = Array.isArray(input)\n ? { segments: input, compactSegments: undefined, rowColors: undefined }\n : normalizeSegments(input)\n const segments = normalized.segments\n const compactSegments = normalized.compactSegments\n const rowColors = normalized.rowColors\n const rowShadeColor = normalized.rowShadeColor\n if (!segments.length) return\n\n process.stdout.write(`${RESET}\\n`)\n const terminalColumns = process.stdout.columns ?? 0\n const primary = await renderSegmentedFiglet(segments)\n\n if (terminalColumns === 0 || primary.widestLine <= terminalColumns) {\n if (rowColors && rowColors.length > 0) {\n printRowColoredFiglet(primary.lines, rowColors, rowShadeColor)\n } else {\n printColoredFiglet(primary.lines, primary.boundaryLines, primary.ansiBySegment)\n }\n return\n }\n\n if (compactSegments && compactSegments.length > 0) {\n const compactFiglet = await renderSegmentedFiglet(compactSegments)\n if (compactFiglet.widestLine <= terminalColumns) {\n printColoredFiglet(\n compactFiglet.lines,\n compactFiglet.boundaryLines,\n compactFiglet.ansiBySegment\n )\n return\n }\n }\n\n let plain = \"\"\n for (let i = 0; i < segments.length; i++) {\n const text = segments[i]?.text ?? \"\"\n if (!text) continue\n plain += `${primary.ansiBySegment[i]}${text}`\n }\n process.stdout.write(`${plain}${RESET}\\n`)\n}\n\nexport function createTsupBannerHook(\n project: string | BannerOptions | LegacyBannerOptions\n): () => Promise<void> {\n let shown = false\n const normalized = normalizeSegments(project)\n return async () => {\n if (shown) return\n shown = true\n await printBanner(normalized)\n }\n}\n\nexport function createDevBannerPlugin(\n project: string | BannerOptions | LegacyBannerOptions\n): DevPlugin {\n let shown = false\n const { segments, compactSegments, rowColors, rowShadeColor } = normalizeSegments(project)\n const bannerText = segments.map((segment) => segment.text).join(\"\")\n return {\n name: `olwiba-dev-banner-${bannerText.toLowerCase()}`,\n apply: \"serve\",\n configureServer(_server: unknown) {\n if (shown) return\n shown = true\n void printBanner({ segments, compactSegments, rowColors, rowShadeColor })\n },\n }\n}\n","import {\n createDevBannerPlugin,\n createTsupBannerHook,\n type BannerSegment,\n} from \"./dev-banner\"\n\nexport type ProjectBrandAccent = {\n hex: string\n lightOklch?: string\n darkOklch?: string\n}\n\nexport type ProjectBannerSegment = {\n text: string\n accent?: boolean\n colorHex?: string\n}\n\nexport type ProjectConfig = {\n id: string\n label: string\n brandAccent: ProjectBrandAccent\n banner: {\n segments: readonly ProjectBannerSegment[]\n compactSegments?: readonly ProjectBannerSegment[]\n }\n}\n\nfunction resolveProjectBannerSegments(\n segments: readonly ProjectBannerSegment[],\n accentHex: string\n): BannerSegment[] {\n return segments.map((segment) => ({\n text: segment.text,\n colorHex: segment.accent ? accentHex : segment.colorHex,\n }))\n}\n\nfunction getProjectBanner(project: ProjectConfig) {\n return {\n segments: resolveProjectBannerSegments(project.banner.segments, project.brandAccent.hex),\n compactSegments: project.banner.compactSegments\n ? resolveProjectBannerSegments(project.banner.compactSegments, project.brandAccent.hex)\n : undefined,\n }\n}\n\nexport function createProjectDevBannerPlugin(project: ProjectConfig) {\n return createDevBannerPlugin(getProjectBanner(project))\n}\n\nexport function createProjectTsupBannerHook(project: ProjectConfig) {\n return createTsupBannerHook(getProjectBanner(project))\n}\n"]}
1
+ {"version":3,"sources":["../src/ascii/compose.ts","../src/ascii/fonts/dosrebel-data.ts","../src/ascii/fonts.ts","../src/ascii/figlet.ts","../src/dos-rebel-font.ts","../src/dev-banner.ts","../src/find-free-port.ts","../src/project-brand.ts"],"names":["segments","renderDosRebel"],"mappings":";;;;;;;;;;;;;AAcO,SAAS,gBAAA,CAAiB,MAAkB,IAAA,EAA+B;AAChF,EAAA,MAAM,aAAwD,EAAC;AAE/D,EAAA,KAAA,MAAW,MAAM,IAAA,EAAM;AACrB,IAAA,MAAM,IAAA,GAAO,EAAA,CAAG,UAAA,CAAW,CAAC,CAAA;AAC5B,IAAA,MAAM,KAAA,GAAQ,KAAK,KAAA,CAAM,GAAA,CAAI,IAAI,CAAA,IAAK,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,EAAE,CAAA;AACvD,IAAA,IAAI,CAAC,KAAA,EAAO;AAEZ,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,GAAA,CAAI,GAAG,KAAA,CAAM,IAAI,CAAC,IAAA,KAAS,IAAA,CAAK,MAAM,CAAC,CAAA;AAC1D,IAAA,UAAA,CAAW,IAAA,CAAK;AAAA,MACd,KAAA,EAAO,MAAM,GAAA,CAAI,CAAC,SAAS,IAAA,CAAK,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,MAC7C;AAAA,KACD,CAAA;AAAA,EACH;AAEA,EAAA,MAAM,IAAA,GAAO,WAAW,MAAA,CAAO,CAAC,KAAK,KAAA,KAAU,GAAA,GAAM,KAAA,CAAM,KAAA,EAAO,CAAC,CAAA;AACnE,EAAA,MAAM,O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iCell {\n ch: \"█\" | \"░\"\n col: number\n row: number\n}\n\nexport interface AsciiTextLayout {\n cells: AsciiCell[]\n cols: number\n rows: number\n}\n\nexport function composeAsciiText(font: FigletFont, text: string): AsciiTextLayout {\n const charBlocks: Array<{ lines: string[]; width: number }> = []\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) continue\n\n const width = Math.max(...glyph.map((line) => line.length))\n charBlocks.push({\n lines: glyph.map((line) => line.padEnd(width)),\n width,\n })\n }\n\n const cols = charBlocks.reduce((sum, block) => sum + block.width, 0)\n const rows = font.height\n const cells: AsciiCell[] = []\n let offsetX = 0\n\n for (const block of charBlocks) {\n for (let row = 0; row < rows; row++) {\n const line = block.lines[row] ?? \"\"\n for (let col = 0; col < line.length; col++) {\n const ch = line[col]\n if (ch === \"█\" || ch === \"░\") {\n cells.push({ ch, col: offsetX + col, row })\n }\n }\n }\n offsetX += block.width\n }\n\n return { cells, cols, rows }\n}\n\nexport function getAsciiAccentColumns(\n font: FigletFont,\n text: string,\n accent: string,\n): Set<number> {\n if (!accent) return new Set<number>()\n\n const columns = new Set<number>()\n const accentRanges: Array<{ start: number; end: number }> = []\n let searchFrom = 0\n while (true) {\n const idx = text.indexOf(accent, searchFrom)\n if (idx === -1) break\n accentRanges.push({ start: idx, end: idx + accent.length })\n searchFrom = idx + 1\n }\n if (accentRanges.length === 0) return columns\n\n let offsetX = 0\n let charIndex = 0\n\n for (const ch of text) {\n const code = ch.charCodeAt(0)\n const glyph = font.chars.get(code) ?? font.chars.get(32)\n if (!glyph) { charIndex++; continue }\n\n const width = Math.max(...glyph.map((line) => line.length))\n if (accentRanges.some((r) => charIndex >= r.start && charIndex < r.end)) {\n for (let col = 0; col < width; col++) columns.add(offsetX + col)\n }\n offsetX += width\n charIndex++\n }\n\n return columns\n}\n","// @generated from dosrebel.flf. Do not edit by hand.\nexport const dosrebelFont: string = \"flf2a$ 11 8 35 -1 15\\nRebel by Valerie Mates (popcorn@cyberspace.org), based on a font by Ron Bliss\\n(who sometimes goes by the name \\\"rebel\\\" because his initials are REB).\\nNOTE: THIS FONT ONLY WORKS IN MS-DOS.\\nMay 27, 1994\\n\\nExplanation of first line:\\nflf2 - \\\"magic number\\\" for file identification\\na - should always be `a', for now\\n$ - the \\\"hardblank\\\" -- prints as a blank, but can't be smushed\\n11 - height of a character\\n8 - height of a character, not including descenders\\n35 - max line length (excluding comment lines) + a fudge factor\\n-1 - default smushmode for this font (like \\\"-m 15\\\" on command line)\\n15 - number of comment lines\\n\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@\\n$$$@@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n ███@\\n░░░ @\\n @\\n @\\n @@\\n ██ ██@\\n░██░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ████████████@\\n░░░███░░███░ @\\n ████████████@\\n░░░███░░███░ @\\n ░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n ██████ @\\n ███░░░ @\\n ░░█████ @\\n ░░░░███ @\\n ██████ @\\n ░░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n ███ ███@\\n ░░░ ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ ███ @\\n░░░ ░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███ @\\n ░░██████ @\\n ██████ @\\n░███░░███ @\\n░███ ░░███ @\\n░░█████░███@\\n ░░░░░ ░░░ @\\n @\\n @\\n @@\\n ██@\\n ███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███@\\n ███ @\\n ███ @\\n░███ @\\n░███ @\\n░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███@\\n ░███@\\n ░███@\\n ███ @\\n ██░ @\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n ███ ░███ ███@\\n░░░█████████░ @\\n ░░░█████░ @\\n █████████ @\\n ███░░███░░███@\\n░░░ ░███ ░░░ @\\n ░░░ @\\n @\\n @\\n @@\\n @\\n ███ @\\n ░███ @\\n ███████████@\\n░░░░░███░░░ @\\n ░███ @\\n ░░░ @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n @\\n @\\n @\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n █████ @\\n ███░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░█████░ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ███████ @\\n ███░░░░ @\\n ███ █@\\n░██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░░░ ░███@\\n ██████░ @\\n ░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████ @\\n░░███ ░░███ @\\n ░███ ░███ █@\\n ░███████████@\\n ░░░░░░░███░█@\\n ░███░ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░░░█@\\n░███ ░ @\\n░█████████ @\\n░░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░░░ @\\n░█████████ @\\n░███░░░░███@\\n░███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░███░░░░███@\\n░░░ ███ @\\n ███ @\\n ███ @\\n ███ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ███░░░░███ @\\n░███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ████████ @\\n ███░░░░███@\\n░███ ░███@\\n░░█████████@\\n ░░░░░░░███@\\n ███ ░███@\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n ██@\\n░░ @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n ██@\\n ░░ @\\n ██@\\n ██ @\\n░░ @\\n @\\n @@\\n ███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @\\n @\\n @@\\n ███ @\\n░░░███ @\\n ░░░███ @\\n ░░░███@\\n ███░ @\\n ███░ @\\n ███░ @\\n░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░███@\\n░░░ ░███@\\n ███████ @\\n ░███░░░ @\\n ░░░ @\\n ███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░░ @\\n░███ ██████ @\\n░███░███░███@\\n░███░███░███@\\n░███░░░ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ███████████ @\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ @\\n░░███ ███@\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████ @\\n░░███░░░░███ @\\n ░███ ░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███ ███ @\\n ██████████ @\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████████@\\n░░███░░░░░█@\\n ░███ █ ░ @\\n ░██████ @\\n ░███░░█ @\\n ░███ ░ █@\\n ██████████@\\n░░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░░███░░░░░░█@\\n ░███ █ ░ @\\n ░███████ @\\n ░███░░░█ @\\n ░███ ░ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ███ ░░░ @\\n░███ @\\n░███ █████@\\n░░███ ░░███ @\\n ░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ ████@\\n░░███ ███░ @\\n ░███ ███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░░███ @\\n █████ ░░████@\\n░░░░░ ░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n ██████ ██████@\\n░░██████ ██████ @\\n ░███░█████░███ @\\n ░███░░███ ░███ @\\n ░███ ░░░ ░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ██████ █████@\\n░░██████ ░░███ @\\n ░███░███ ░███ @\\n ░███░░███░███ @\\n ░███ ░░██████ @\\n ░███ ░░█████ @\\n █████ ░░█████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███████ @\\n ███░░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███ ███ @\\n ░░░███████░ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░░░███ @\\n ███ ░░███@\\n░███ ░███@\\n░███ ██░███@\\n░░███ ░░████ @\\n ░░░██████░██@\\n ░░░░░░ ░░ @\\n @\\n @\\n @@\\n ███████████ @\\n░░███░░░░░███ @\\n ░███ ░███ @\\n ░██████████ @\\n ░███░░░░░███ @\\n ░███ ░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n░███ ░░░ @\\n░░█████████ @\\n ░░░░░░░░███@\\n ███ ░███@\\n░░█████████ @\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░███░░░█@\\n░ ░███ ░ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████ @\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░░█████░ @\\n ░░███ @\\n ░░░ @\\n @\\n @\\n @@\\n █████ ███ █████@\\n░░███ ░███ ░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n ░░███ █████ ███ @\\n ░░░█████░█████░ @\\n ░░███ ░░███ @\\n ░░░ ░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ███░███ @\\n ███ ░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n █████ █████@\\n░░███ ░░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░███ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n ███████████@\\n░█░░░░░░███ @\\n░ ███░ @\\n ███ @\\n ███ @\\n ████ █@\\n ███████████@\\n░░░░░░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n░███░ @\\n░███ @\\n░███ @\\n░███ @\\n░███ @\\n░█████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n █████@\\n░░░███@\\n ░███@\\n ░███@\\n ░███@\\n ░███@\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n ████ @\\n ██░░██@\\n░░ ░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n @\\n @\\n @\\n @\\n █████████@\\n░░░░░░░░░ @\\n @\\n @\\n @@\\n ██ @\\n░███@\\n░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ████████ @\\n░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░░░ @\\n░███ ███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n █████@\\n ░░███ @\\n ███████ @\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███████ @\\n░███░░░ @\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n ██████ @\\n ███░░███@\\n ░███ ░░░ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n █████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ███████@\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████@\\n ░░░░░███@\\n ███ ░███@\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███████ @\\n ░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n ███ @\\n ░░░ @\\n █████@\\n ░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ███ ░███ @\\n░░██████ @\\n ░░░░░░ @@\\n █████ @\\n░░███ @\\n ░███ █████@\\n ░███░░███ @\\n ░██████░ @\\n ░███░░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ████ @\\n░░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n ░███ @\\n █████@\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████████████ @\\n░░███░░███░░███ @\\n ░███ ░███ ░███ @\\n ░███ ░███ ░███ @\\n █████░███ █████@\\n░░░░░ ░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ████ █████@\\n░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ██████ @\\n ███░░███@\\n░███ ░███@\\n░███ ░███@\\n░░██████ @\\n ░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░███@\\n ░███ ░███@\\n ░███████ @\\n ░███░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @@\\n @\\n @\\n ████████@\\n ███░░███ @\\n░███ ░███ @\\n░███ ░███ @\\n░░███████ @\\n ░░░░░███ @\\n ░███ @\\n █████@\\n ░░░░░ @@\\n @\\n @\\n ████████ @\\n░░███░░███@\\n ░███ ░░░ @\\n ░███ @\\n █████ @\\n░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ @\\n ███░░ @\\n░░█████ @\\n ░░░░███@\\n ██████ @\\n░░░░░░ @\\n @\\n @\\n @@\\n █████ @\\n ░░███ @\\n ███████ @\\n░░░███░ @\\n ░███ @\\n ░███ ███@\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░░███ ███ @\\n ░░█████ @\\n ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ███ █████@\\n░░███ ░███░░███ @\\n ░███ ░███ ░███ @\\n ░░███████████ @\\n ░░████░████ @\\n ░░░░ ░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ █████@\\n░░███ ░░███ @\\n ░░░█████░ @\\n ███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n @\\n @\\n █████ ████@\\n░░███ ░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░███ @\\n ███ ░███ @\\n ░░██████ @\\n ░░░░░░ @@\\n @\\n @\\n █████████@\\n ░█░░░░███ @\\n ░ ███░ @\\n ███░ █@\\n █████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n ███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ░░░ @\\n @\\n @\\n @@\\n ███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░███@\\n░░░ @\\n @\\n @\\n @@\\n ███ @\\n░░░██ @\\n ░░██ @\\n ░░███@\\n ██░ @\\n ██ @\\n ███ @\\n░░░ @\\n @\\n @\\n @@\\n @\\n ███ ███@\\n ███░███░ @\\n░░░ ░░░ @\\n @\\n @\\n @\\n @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n ███████ @\\n ███░░░███ @\\n ░█████████ @\\n ░███░░░███ @\\n █████ █████@\\n░░░░░ ░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ██████ @\\n ░░░░░███ @\\n ███████ @\\n ███░░███ @\\n░░████████@\\n ░░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n░░░ ░░░ @\\n ███████ @\\n ███░░░███@\\n░███ ░███@\\n░███ ░███@\\n░░███████ @\\n ░░░░░░░ @\\n @\\n @\\n @@\\n ███ ███ @\\n ░░░ ░░░ @\\n █████ █████@\\n░░███ ░░███ @\\n ░███ ░███ @\\n ░███ ░███ @\\n ░░█████████@\\n ░░░░░░░░░ @\\n @\\n @\\n @@\\n █████████ @\\n ███░░░░░███@\\n ░███ ░███@\\n ░██████████ @\\n ░███░░░░░███@\\n ░███ ░███@\\n ████ ██████ @\\n░░░░ ░░░░░░ @\\n @\\n @\\n @@\\n\"\n\n","import { dosrebelFont } from \"./fonts/dosrebel-data\"\n\nexport { dosrebelFont }\n\nexport const asciiFonts = {\n dosrebel: dosrebelFont,\n} as const\n\nexport type AsciiFontName = keyof typeof asciiFonts\n\nexport function getAsciiFont(name: AsciiFontName): string {\n return asciiFonts[name]\n}\n","export interface FigletFont {\n height: number\n baseline: number\n hardblank: string\n chars: Map<number, string[]>\n}\n\nexport function parseFigletFont(raw: string): FigletFont {\n const lines = raw.split(\"\\n\")\n\n if (lines[0]?.charCodeAt(0) === 0xfeff) {\n lines[0] = lines[0].slice(1)\n }\n\n const header = lines[0]\n if (!header?.startsWith(\"flf2a\")) {\n throw new Error(\"Invalid FIGlet font: missing flf2a header\")\n }\n\n const hardblank = header[5] ?? \"$\"\n const parts = header.slice(6).trim().split(/\\s+/)\n const height = Number.parseInt(parts[0] ?? \"\", 10)\n const baseline = Number.parseInt(parts[1] ?? \"\", 10)\n const commentLines = Number.parseInt(parts[4] ?? \"\", 10)\n\n if (!Number.isFinite(height) || height <= 0) {\n throw new Error(\"Invalid FIGlet font: missing character height\")\n }\n\n const dataStart = 1 + (Number.isFinite(commentLines) ? commentLines : 0)\n const chars = new Map<number, string[]>()\n let lineIndex = dataStart\n let ascii = 32\n\n while (lineIndex + height <= lines.length && ascii <= 126) {\n const charLines: string[] = []\n for (let row = 0; row < height; row++) {\n const line = (lines[lineIndex + row] ?? \"\")\n .replace(/@+$/, \"\")\n .replaceAll(hardblank, \" \")\n charLines.push(line)\n }\n\n chars.set(ascii, charLines)\n lineIndex += height\n ascii++\n }\n\n return { height, baseline, hardblank, chars }\n}\n","import { composeAsciiText } from \"./ascii/compose\"\nimport { dosrebelFont } from \"./ascii/fonts\"\nimport { parseFigletFont } from \"./ascii/figlet\"\n\nlet renderCache = new Map<string, string[]>()\n\nexport async function renderDosRebel(text: string): Promise<string[]> {\n const cached = renderCache.get(text)\n if (cached) return cached\n\n const font = parseFigletFont(dosrebelFont)\n const layout = composeAsciiText(font, text)\n const output = Array.from({ length: layout.rows }, () => \"\")\n const cellByPosition = new Map(layout.cells.map((cell) => [`${cell.row}:${cell.col}`, cell.ch]))\n\n for (let row = 0; row < layout.rows; row++) {\n let line = \"\"\n for (let col = 0; col < layout.cols; col++) {\n line += cellByPosition.get(`${row}:${col}`) ?? \" \"\n }\n output[row] = line.replace(/\\s+$/g, \"\")\n }\n\n renderCache.set(text, output)\n return output\n}\n","const RESET = \"\\x1b[0m\"\nconst DEFAULT_HEX = \"#22D3EE\"\nconst WHITE_HEX = \"#ffffff\"\n\nexport type BannerSegment = {\n text: string\n colorHex?: string\n}\n\ntype BannerOptions = {\n segments: BannerSegment[]\n compactSegments?: BannerSegment[]\n rowColors?: string[]\n rowShadeColor?: string\n}\n\ntype LegacyBannerOptions = {\n baseText: string\n suffix?: string\n colorHex?: string\n baseColorHex?: string\n}\n\ntype DevPlugin = {\n name: string\n apply: \"serve\"\n configureServer: (server: unknown) => void\n}\n\n\nexport function hexToAnsi24(hex: string) {\n const normalized = hex.trim().replace(/^#/, \"\")\n if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {\n return null\n }\n const r = parseInt(normalized.slice(0, 2), 16)\n const g = parseInt(normalized.slice(2, 4), 16)\n const b = parseInt(normalized.slice(4, 6), 16)\n return `\\x1b[38;2;${r};${g};${b}m`\n}\n\nfunction visibleLen(value: string) {\n return value.length\n}\n\nfunction normalizeSegments(\n input: string | BannerOptions | LegacyBannerOptions\n): { segments: BannerSegment[]; compactSegments?: BannerSegment[]; rowColors?: string[]; rowShadeColor?: string } {\n if (typeof input === \"string\") {\n return { segments: [{ text: input, colorHex: WHITE_HEX }] }\n }\n\n if (\"segments\" in input) {\n const normalize = (segments: BannerSegment[]) =>\n segments\n .filter((segment) => segment.text.trim().length > 0)\n .map((segment) => ({\n text: segment.text,\n colorHex: segment.colorHex ?? WHITE_HEX,\n }))\n const segments = normalize(input.segments)\n const compactSegments =\n input.compactSegments && input.compactSegments.length > 0\n ? normalize(input.compactSegments)\n : undefined\n return { segments, compactSegments, rowColors: input.rowColors, rowShadeColor: input.rowShadeColor }\n }\n\n const suffix = input.suffix ?? \"\"\n if (!suffix) {\n return {\n segments: [{ text: input.baseText, colorHex: input.colorHex ?? DEFAULT_HEX }],\n }\n }\n\n return {\n segments: [\n { text: input.baseText, colorHex: input.baseColorHex ?? WHITE_HEX },\n { text: suffix, colorHex: input.colorHex ?? DEFAULT_HEX },\n ],\n }\n}\n\nasync function renderSegmentedFiglet(segments: BannerSegment[]) {\n const { renderDosRebel } = await import(\"./dos-rebel-font\")\n const cumulativeTexts: string[] = []\n let textSoFar = \"\"\n for (const segment of segments) {\n textSoFar += segment.text\n cumulativeTexts.push(textSoFar)\n }\n\n const renderedByBoundary = await Promise.all(\n cumulativeTexts.map((text) => renderDosRebel(text))\n )\n const lines = renderedByBoundary[renderedByBoundary.length - 1] ?? []\n const boundaryLines = renderedByBoundary.slice(0, -1)\n const ansiBySegment = segments.map(\n (segment) => hexToAnsi24(segment.colorHex ?? WHITE_HEX) ?? \"\\x1b[97m\"\n )\n const widestLine = lines.reduce((max, line) => Math.max(max, visibleLen(line)), 0)\n\n return { lines, boundaryLines, ansiBySegment, widestLine }\n}\n\nfunction printRowColoredFiglet(lines: string[], rowColors: string[], rowShadeColor?: string) {\n for (let i = 0; i < lines.length; i++) {\n const hex = rowColors[i % rowColors.length] ?? WHITE_HEX\n const fgAnsi = hexToAnsi24(hex) ?? \"\\x1b[97m\"\n const shadeAnsi = rowShadeColor ? (hexToAnsi24(rowShadeColor) ?? fgAnsi) : fgAnsi\n const line = lines[i] ?? \"\"\n let out = \"\"\n for (const char of line) {\n if (char === \" \") {\n out += `${RESET} `\n } else if (char === \"░\") {\n out += `${shadeAnsi}${char}`\n } else {\n out += `${fgAnsi}${char}`\n }\n }\n process.stdout.write(`${out}${RESET}\\n`)\n }\n}\n\nfunction printColoredFiglet(\n lines: string[],\n boundaryLines: string[][],\n ansiBySegment: string[]\n) {\n for (let i = 0; i < lines.length; i++) {\n const full = lines[i] ?? \"\"\n let cursor = 0\n let out = \"\"\n\n for (let segmentIndex = 0; segmentIndex < ansiBySegment.length; segmentIndex += 1) {\n const boundaryLine =\n segmentIndex < boundaryLines.length ? boundaryLines[segmentIndex]?.[i] ?? \"\" : full\n const end = Math.min(boundaryLine.length, full.length)\n const chunk = full.slice(cursor, end)\n out += `${ansiBySegment[segmentIndex]}${chunk}`\n cursor = end\n }\n\n process.stdout.write(`${out}${RESET}\\n`)\n }\n}\n\nexport async function printBanner(input: string | BannerSegment[] | BannerOptions) {\n const normalized = Array.isArray(input)\n ? { segments: input, compactSegments: undefined, rowColors: undefined }\n : normalizeSegments(input)\n const segments = normalized.segments\n const compactSegments = normalized.compactSegments\n const rowColors = normalized.rowColors\n const rowShadeColor = normalized.rowShadeColor\n if (!segments.length) return\n\n process.stdout.write(`${RESET}\\n`)\n const terminalColumns = process.stdout.columns ?? 0\n const primary = await renderSegmentedFiglet(segments)\n\n if (terminalColumns === 0 || primary.widestLine <= terminalColumns) {\n if (rowColors && rowColors.length > 0) {\n printRowColoredFiglet(primary.lines, rowColors, rowShadeColor)\n } else {\n printColoredFiglet(primary.lines, primary.boundaryLines, primary.ansiBySegment)\n }\n return\n }\n\n if (compactSegments && compactSegments.length > 0) {\n const compactFiglet = await renderSegmentedFiglet(compactSegments)\n if (compactFiglet.widestLine <= terminalColumns) {\n printColoredFiglet(\n compactFiglet.lines,\n compactFiglet.boundaryLines,\n compactFiglet.ansiBySegment\n )\n return\n }\n }\n\n let plain = \"\"\n for (let i = 0; i < segments.length; i++) {\n const text = segments[i]?.text ?? \"\"\n if (!text) continue\n plain += `${primary.ansiBySegment[i]}${text}`\n }\n process.stdout.write(`${plain}${RESET}\\n`)\n}\n\nexport function createTsupBannerHook(\n project: string | BannerOptions | LegacyBannerOptions\n): () => Promise<void> {\n let shown = false\n const normalized = normalizeSegments(project)\n return async () => {\n if (shown) return\n shown = true\n await printBanner(normalized)\n }\n}\n\nexport function createDevBannerPlugin(\n project: string | BannerOptions | LegacyBannerOptions\n): DevPlugin {\n let shown = false\n const { segments, compactSegments, rowColors, rowShadeColor } = normalizeSegments(project)\n const bannerText = segments.map((segment) => segment.text).join(\"\")\n return {\n name: `olwiba-dev-banner-${bannerText.toLowerCase()}`,\n apply: \"serve\",\n configureServer(_server: unknown) {\n if (shown) return\n shown = true\n void printBanner({ segments, compactSegments, rowColors, rowShadeColor })\n },\n }\n}\n","import { createServer } from \"node:net\"\n\n/**\n * Probe for the first free port from `start` up. Vite's own auto-increment\n * doesn't kick in reliably under the TanStack Start plugin, so dev servers\n * resolve the port themselves before passing it to `server.port`.\n */\nexport async function findFreePort(start: number, attempts = 20): Promise<number> {\n for (let port = start; port < start + attempts; port++) {\n const free = await new Promise<boolean>((resolve) => {\n const probe = createServer()\n .once(\"error\", () => resolve(false))\n .once(\"listening\", () => probe.close(() => resolve(true)))\n probe.listen(port)\n })\n if (free) return port\n }\n throw new Error(`No free port found in range ${start}-${start + attempts - 1}`)\n}\n\n/**\n * Resolve the dev server port for a preferred base port, logging when the\n * preferred port is taken and a fallback is used.\n */\nexport async function resolveDevPort(preferred: number, attempts = 20): Promise<number> {\n const port = await findFreePort(preferred, attempts)\n if (port !== preferred) {\n console.log(`Port ${preferred} is in use — dev server will use ${port} instead.`)\n }\n return port\n}\n","import {\n createDevBannerPlugin,\n createTsupBannerHook,\n type BannerSegment,\n} from \"./dev-banner\"\n\nexport type ProjectBrandAccent = {\n hex: string\n lightOklch?: string\n darkOklch?: string\n}\n\nexport type ProjectBannerSegment = {\n text: string\n accent?: boolean\n colorHex?: string\n}\n\nexport type ProjectConfig = {\n id: string\n label: string\n brandAccent: ProjectBrandAccent\n banner: {\n segments: readonly ProjectBannerSegment[]\n compactSegments?: readonly ProjectBannerSegment[]\n }\n}\n\nfunction resolveProjectBannerSegments(\n segments: readonly ProjectBannerSegment[],\n accentHex: string\n): BannerSegment[] {\n return segments.map((segment) => ({\n text: segment.text,\n colorHex: segment.accent ? accentHex : segment.colorHex,\n }))\n}\n\nfunction getProjectBanner(project: ProjectConfig) {\n return {\n segments: resolveProjectBannerSegments(project.banner.segments, project.brandAccent.hex),\n compactSegments: project.banner.compactSegments\n ? resolveProjectBannerSegments(project.banner.compactSegments, project.brandAccent.hex)\n : undefined,\n }\n}\n\nexport function createProjectDevBannerPlugin(project: ProjectConfig) {\n return createDevBannerPlugin(getProjectBanner(project))\n}\n\nexport function createProjectTsupBannerHook(project: ProjectConfig) {\n return createTsupBannerHook(getProjectBanner(project))\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olwiba/dx",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -59,13 +59,13 @@
59
59
  "typescript": "^5.7.2"
60
60
  },
61
61
  "peerDependencies": {
62
- "eslint": ">=9.0.0",
63
- "puppeteer-core": ">=22.0.0",
64
62
  "@typescript-eslint/eslint-plugin": ">=8.0.0",
65
63
  "@typescript-eslint/parser": ">=8.0.0",
64
+ "eslint": ">=9.0.0",
66
65
  "eslint-plugin-react-hooks": ">=5.0.0",
67
- "sharp": ">=0.32.0",
68
- "lucide-static": ">=0.400.0"
66
+ "lucide-static": ">=0.400.0",
67
+ "puppeteer-core": ">=22.0.0",
68
+ "sharp": ">=0.32.0"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "@typescript-eslint/eslint-plugin": {