@shiinasaku/github-card 2.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.js ADDED
@@ -0,0 +1,1209 @@
1
+ // src/utils/themes.ts
2
+ var themes = {
3
+ default: {
4
+ bg: "fill-white",
5
+ title: "fill-blue-600",
6
+ text: "fill-slate-700",
7
+ icon: "fill-blue-500",
8
+ border: "stroke-slate-200"
9
+ },
10
+ dark: {
11
+ bg: "fill-zinc-900",
12
+ title: "fill-white",
13
+ text: "fill-zinc-400",
14
+ icon: "fill-emerald-400",
15
+ border: "stroke-zinc-800"
16
+ },
17
+ radical: {
18
+ bg: "fill-slate-900",
19
+ title: "fill-pink-500",
20
+ text: "fill-cyan-300",
21
+ icon: "fill-yellow-400",
22
+ border: "stroke-slate-800"
23
+ },
24
+ merko: {
25
+ bg: "fill-neutral-950",
26
+ title: "fill-lime-400",
27
+ text: "fill-emerald-400",
28
+ icon: "fill-lime-300",
29
+ border: "stroke-neutral-800"
30
+ },
31
+ gruvbox: {
32
+ bg: "fill-stone-800",
33
+ title: "fill-amber-400",
34
+ text: "fill-stone-300",
35
+ icon: "fill-orange-500",
36
+ border: "stroke-stone-700"
37
+ },
38
+ tokyonight: {
39
+ bg: "fill-slate-900",
40
+ title: "fill-blue-400",
41
+ text: "fill-teal-400",
42
+ icon: "fill-fuchsia-400",
43
+ border: "stroke-slate-800"
44
+ },
45
+ onedark: {
46
+ bg: "fill-slate-800",
47
+ title: "fill-amber-300",
48
+ text: "fill-slate-400",
49
+ icon: "fill-green-400",
50
+ border: "stroke-slate-700"
51
+ },
52
+ cobalt: {
53
+ bg: "fill-sky-950",
54
+ title: "fill-fuchsia-400",
55
+ text: "fill-emerald-300",
56
+ icon: "fill-blue-500",
57
+ border: "stroke-sky-900"
58
+ },
59
+ synthwave: {
60
+ bg: "fill-purple-950",
61
+ title: "fill-slate-200",
62
+ text: "fill-pink-500",
63
+ icon: "fill-orange-400",
64
+ border: "stroke-purple-900"
65
+ },
66
+ highcontrast: {
67
+ bg: "fill-black",
68
+ title: "fill-yellow-300",
69
+ text: "fill-white",
70
+ icon: "fill-cyan-400",
71
+ border: "stroke-zinc-800"
72
+ },
73
+ dracula: {
74
+ bg: "fill-slate-900",
75
+ title: "fill-pink-400",
76
+ text: "fill-slate-100",
77
+ icon: "fill-purple-400",
78
+ border: "stroke-slate-700"
79
+ },
80
+ monokai: {
81
+ bg: "fill-zinc-900",
82
+ title: "fill-pink-500",
83
+ text: "fill-zinc-100",
84
+ icon: "fill-lime-400",
85
+ border: "stroke-zinc-800"
86
+ },
87
+ nord: {
88
+ bg: "fill-slate-800",
89
+ title: "fill-cyan-400",
90
+ text: "fill-slate-300",
91
+ icon: "fill-blue-400",
92
+ border: "stroke-slate-700"
93
+ },
94
+ github_dark: {
95
+ bg: "fill-slate-900",
96
+ title: "fill-blue-400",
97
+ text: "fill-slate-300",
98
+ icon: "fill-blue-500",
99
+ border: "stroke-slate-800"
100
+ },
101
+ pearl: {
102
+ bg: "fill-slate-50",
103
+ title: "fill-slate-900",
104
+ text: "fill-slate-600",
105
+ icon: "fill-blue-600",
106
+ border: "stroke-slate-200"
107
+ },
108
+ slate: {
109
+ bg: "fill-slate-950",
110
+ title: "fill-slate-200",
111
+ text: "fill-slate-400",
112
+ icon: "fill-sky-400",
113
+ border: "stroke-slate-800"
114
+ },
115
+ forest: {
116
+ bg: "fill-emerald-950",
117
+ title: "fill-emerald-200",
118
+ text: "fill-emerald-400",
119
+ icon: "fill-emerald-500",
120
+ border: "stroke-emerald-900"
121
+ },
122
+ rose: {
123
+ bg: "fill-rose-950",
124
+ title: "fill-rose-200",
125
+ text: "fill-rose-300",
126
+ icon: "fill-rose-400",
127
+ border: "stroke-rose-900"
128
+ },
129
+ sand: {
130
+ bg: "fill-orange-50",
131
+ title: "fill-amber-900",
132
+ text: "fill-amber-700",
133
+ icon: "fill-amber-600",
134
+ border: "stroke-orange-200"
135
+ },
136
+ shiina: {
137
+ title: "fill-pink-400",
138
+ text: "fill-slate-100",
139
+ icon: "fill-sky-400",
140
+ bg: "#0B0C10",
141
+ border: "stroke-slate-800"
142
+ },
143
+ aurora: {
144
+ title: "fill-emerald-300",
145
+ text: "fill-slate-100",
146
+ icon: "fill-teal-400",
147
+ bg: "#020617",
148
+ border: "stroke-emerald-900"
149
+ },
150
+ oled: {
151
+ title: "fill-rose-400",
152
+ text: "fill-zinc-400",
153
+ icon: "fill-indigo-400",
154
+ bg: "#000000",
155
+ border: "stroke-zinc-900"
156
+ }
157
+ };
158
+ function resolveColors(opts) {
159
+ const base = opts.theme && themes[opts.theme] || themes.default;
160
+ return {
161
+ bg: opts.bg_color || base.bg,
162
+ title: opts.title_color || base.title,
163
+ text: opts.text_color || base.text,
164
+ icon: opts.icon_color || base.icon,
165
+ border: opts.border_color || base.border
166
+ };
167
+ }
168
+ // src/utils/format.ts
169
+ function kFormat(num) {
170
+ const trim = (v) => v.toFixed(1).replace(/\.0$/, "");
171
+ if (num >= 999950)
172
+ return trim(num / 1e6) + "M";
173
+ if (num >= 999.95)
174
+ return trim(num / 1000) + "k";
175
+ return String(Math.round(num));
176
+ }
177
+ function escapeXml(str) {
178
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
179
+ }
180
+ function wrapText(input, maxLen, maxLines) {
181
+ const words = input.split(/\s+/).filter(Boolean);
182
+ const lines = [];
183
+ let current = "";
184
+ for (const word of words) {
185
+ const next = current ? `${current} ${word}` : word;
186
+ if (next.length <= maxLen) {
187
+ current = next;
188
+ continue;
189
+ }
190
+ if (current)
191
+ lines.push(current);
192
+ if (lines.length === maxLines)
193
+ break;
194
+ current = word.length > maxLen ? word.slice(0, maxLen) : word;
195
+ }
196
+ if (current && lines.length < maxLines)
197
+ lines.push(current);
198
+ const consumed = lines.join(" ").length;
199
+ if (lines.length > 0 && consumed < input.trim().length) {
200
+ const last = lines[lines.length - 1];
201
+ lines[lines.length - 1] = (last.length >= maxLen ? last.slice(0, Math.max(0, maxLen - 1)) : last) + "…";
202
+ }
203
+ return lines;
204
+ }
205
+ // src/utils/languages.ts
206
+ var langColors = {
207
+ "1C Enterprise": "#814CCC",
208
+ "2-Dimensional Array": "#38761D",
209
+ "4D": "#004289",
210
+ ABAP: "#E8274B",
211
+ "ABAP CDS": "#555e25",
212
+ "AGS Script": "#B9D9FF",
213
+ AIDL: "#34EB6B",
214
+ AL: "#3AA2B5",
215
+ AMPL: "#E6EFBB",
216
+ ANTLR: "#9DC3FF",
217
+ "API Blueprint": "#2ACCA8",
218
+ APL: "#5A8164",
219
+ "ASP.NET": "#9400ff",
220
+ ATS: "#1ac620",
221
+ ActionScript: "#882B0F",
222
+ Ada: "#02f88c",
223
+ "Adblock Filter List": "#800000",
224
+ "Adobe Font Metrics": "#fa0f00",
225
+ Agda: "#315665",
226
+ Aiken: "#640ff8",
227
+ Alloy: "#64C800",
228
+ "Alpine Abuild": "#0D597F",
229
+ "Altium Designer": "#A89663",
230
+ AngelScript: "#C7D7DC",
231
+ "Answer Set Programming": "#A9CC29",
232
+ "Ant Build System": "#A9157E",
233
+ Antlers: "#ff269e",
234
+ ApacheConf: "#d12127",
235
+ Apex: "#1797c0",
236
+ "Apollo Guidance Computer": "#0B3D91",
237
+ AppleScript: "#101F1F",
238
+ Arc: "#aa2afe",
239
+ ArkTS: "#0080ff",
240
+ AsciiDoc: "#73a0c5",
241
+ AspectJ: "#a957b0",
242
+ Assembly: "#6E4C13",
243
+ Astro: "#ff5a03",
244
+ Asymptote: "#ff0000",
245
+ Augeas: "#9CC134",
246
+ AutoHotkey: "#6594b9",
247
+ AutoIt: "#1C3552",
248
+ "Avro IDL": "#0040FF",
249
+ Awk: "#c30e9b",
250
+ B4X: "#00e4ff",
251
+ BASIC: "#ff0000",
252
+ BQN: "#2b7067",
253
+ Ballerina: "#FF5000",
254
+ Batchfile: "#C1F12E",
255
+ Beef: "#a52f4e",
256
+ Berry: "#15A13C",
257
+ BibTeX: "#778899",
258
+ Bicep: "#519aba",
259
+ Bikeshed: "#5562ac",
260
+ Bison: "#6A463F",
261
+ BitBake: "#00bce4",
262
+ Blade: "#f7523f",
263
+ BlitzBasic: "#00FFAE",
264
+ BlitzMax: "#cd6400",
265
+ Bluespec: "#12223c",
266
+ "Bluespec BH": "#12223c",
267
+ Boo: "#d4bec1",
268
+ Boogie: "#c80fa0",
269
+ Brainfuck: "#2F2530",
270
+ BrighterScript: "#66AABB",
271
+ Brightscript: "#662D91",
272
+ Browserslist: "#ffd539",
273
+ Bru: "#F4AA41",
274
+ BuildStream: "#006bff",
275
+ C: "#555555",
276
+ "C#": "#178600",
277
+ "C++": "#f34b7d",
278
+ C3: "#2563eb",
279
+ "CAP CDS": "#0092d1",
280
+ CLIPS: "#00A300",
281
+ CMake: "#DA3434",
282
+ COLLADA: "#F1A42B",
283
+ CSON: "#244776",
284
+ CSS: "#663399",
285
+ CSV: "#237346",
286
+ CUE: "#5886E1",
287
+ CWeb: "#00007a",
288
+ "Cabal Config": "#483465",
289
+ Caddyfile: "#22b638",
290
+ Cadence: "#00ef8b",
291
+ Cairo: "#ff4a48",
292
+ "Cairo Zero": "#ff4a48",
293
+ CameLIGO: "#3be133",
294
+ Cangjie: "#00868B",
295
+ "Cap'n Proto": "#c42727",
296
+ Carbon: "#222222",
297
+ Ceylon: "#dfa535",
298
+ Chapel: "#8dc63f",
299
+ ChucK: "#3f8000",
300
+ Circom: "#707575",
301
+ Cirru: "#ccccff",
302
+ Clarion: "#db901e",
303
+ Clarity: "#5546ff",
304
+ "Classic ASP": "#6a40fd",
305
+ Clean: "#3F85AF",
306
+ Click: "#E4E6F3",
307
+ Clojure: "#db5855",
308
+ "Closure Templates": "#0d948f",
309
+ "Cloud Firestore Security Rules": "#FFA000",
310
+ Clue: "#0009b5",
311
+ CodeQL: "#140f46",
312
+ CoffeeScript: "#244776",
313
+ ColdFusion: "#ed2cd6",
314
+ "ColdFusion CFC": "#ed2cd6",
315
+ "Common Lisp": "#3fb68b",
316
+ "Common Workflow Language": "#B5314C",
317
+ "Component Pascal": "#B0CE4E",
318
+ Cooklang: "#E15A29",
319
+ Crystal: "#000100",
320
+ Csound: "#1a1a1a",
321
+ "Csound Document": "#1a1a1a",
322
+ "Csound Score": "#1a1a1a",
323
+ Cuda: "#3A4E3A",
324
+ Curry: "#531242",
325
+ Cylc: "#00b3fd",
326
+ Cypher: "#34c0eb",
327
+ Cython: "#fedf5b",
328
+ D: "#ba595e",
329
+ D2: "#526ee8",
330
+ DM: "#447265",
331
+ Dafny: "#FFEC25",
332
+ "Darcs Patch": "#8eff23",
333
+ Dart: "#00B4AB",
334
+ Daslang: "#d3d3d3",
335
+ DataWeave: "#003a52",
336
+ "Debian Package Control File": "#D70751",
337
+ DenizenScript: "#FBEE96",
338
+ Dhall: "#dfafff",
339
+ "DirectX 3D File": "#aace60",
340
+ Dockerfile: "#384d54",
341
+ Dogescript: "#cca760",
342
+ Dotenv: "#e5d559",
343
+ Dune: "#89421e",
344
+ Dylan: "#6c616e",
345
+ E: "#ccce35",
346
+ ECL: "#8a1267",
347
+ ECLiPSe: "#001d9d",
348
+ EJS: "#a91e50",
349
+ EQ: "#a78649",
350
+ Earthly: "#2af0ff",
351
+ Easybuild: "#069406",
352
+ "Ecere Projects": "#913960",
353
+ Ecmarkup: "#eb8131",
354
+ Edge: "#0dffe0",
355
+ EdgeQL: "#31A7FF",
356
+ EditorConfig: "#fff1f2",
357
+ Eiffel: "#4d6977",
358
+ Elixir: "#6e4a7e",
359
+ Elm: "#60B5CC",
360
+ Elvish: "#55BB55",
361
+ "Elvish Transcript": "#55BB55",
362
+ "Emacs Lisp": "#c065db",
363
+ EmberScript: "#FFF4F3",
364
+ Erlang: "#B83998",
365
+ Euphoria: "#FF790B",
366
+ "F#": "#b845fc",
367
+ "F*": "#572e30",
368
+ "FIGlet Font": "#FFDDBB",
369
+ FIRRTL: "#2f632f",
370
+ FLUX: "#88ccff",
371
+ Factor: "#636746",
372
+ Fancy: "#7b9db4",
373
+ Fantom: "#14253c",
374
+ Faust: "#c37240",
375
+ Fennel: "#fff3d7",
376
+ "Filebench WML": "#F6B900",
377
+ Flix: "#d44a45",
378
+ Fluent: "#ffcc33",
379
+ Forth: "#341708",
380
+ Fortran: "#4d41b1",
381
+ "Fortran Free Form": "#4d41b1",
382
+ FreeBASIC: "#141AC9",
383
+ FreeMarker: "#0050b2",
384
+ Frege: "#00cafe",
385
+ Futhark: "#5f021f",
386
+ "G-code": "#D08CF2",
387
+ GAML: "#FFC766",
388
+ GAMS: "#f49a22",
389
+ GAP: "#0000cc",
390
+ "GCC Machine Description": "#FFCFAB",
391
+ GDScript: "#355570",
392
+ GDShader: "#478CBF",
393
+ GEDCOM: "#003058",
394
+ GLSL: "#5686a5",
395
+ GSC: "#FF6800",
396
+ "Game Maker Language": "#71b417",
397
+ "Gemfile.lock": "#701516",
398
+ Gemini: "#ff6900",
399
+ "Genero 4gl": "#63408e",
400
+ "Genero per": "#d8df39",
401
+ Genie: "#fb855d",
402
+ Genshi: "#951531",
403
+ "Gentoo Ebuild": "#9400ff",
404
+ "Gentoo Eclass": "#9400ff",
405
+ "Gerber Image": "#d20b00",
406
+ Gherkin: "#5B2063",
407
+ "Git Attributes": "#F44D27",
408
+ "Git Commit": "#F44D27",
409
+ "Git Config": "#F44D27",
410
+ "Git Revision List": "#F44D27",
411
+ Gleam: "#ffaff3",
412
+ "Glimmer JS": "#F5835F",
413
+ "Glimmer TS": "#3178c6",
414
+ Glyph: "#c1ac7f",
415
+ Gnuplot: "#f0a9f0",
416
+ Go: "#00ADD8",
417
+ "Go Checksums": "#00ADD8",
418
+ "Go Module": "#00ADD8",
419
+ "Go Workspace": "#00ADD8",
420
+ "Godot Resource": "#355570",
421
+ Golo: "#88562A",
422
+ Gosu: "#82937f",
423
+ Grace: "#615f8b",
424
+ Gradle: "#02303a",
425
+ "Gradle Kotlin DSL": "#02303a",
426
+ "Grammatical Framework": "#ff0000",
427
+ GraphQL: "#e10098",
428
+ "Graphviz (DOT)": "#2596be",
429
+ Groovy: "#4298b8",
430
+ "Groovy Server Pages": "#4298b8",
431
+ HAProxy: "#106da9",
432
+ HCL: "#844FBA",
433
+ HIP: "#4F3A4F",
434
+ HLSL: "#aace60",
435
+ HOCON: "#9ff8ee",
436
+ HTML: "#e34c26",
437
+ "HTML+ECR": "#2e1052",
438
+ "HTML+EEX": "#6e4a7e",
439
+ "HTML+ERB": "#701516",
440
+ "HTML+PHP": "#4f5d95",
441
+ "HTML+Razor": "#512be4",
442
+ HTTP: "#005C9C",
443
+ HXML: "#f68712",
444
+ Hack: "#878787",
445
+ Haml: "#ece2a9",
446
+ Handlebars: "#f7931e",
447
+ Harbour: "#0e60e3",
448
+ Hare: "#9d7424",
449
+ Haskell: "#5e5086",
450
+ Haxe: "#df7900",
451
+ HiveQL: "#dce200",
452
+ HolyC: "#ffefaf",
453
+ "Hosts File": "#308888",
454
+ Hurl: "#FF0288",
455
+ Hy: "#7790B2",
456
+ IDL: "#a3522f",
457
+ "IGOR Pro": "#0000cc",
458
+ INI: "#d1dbe0",
459
+ ISPC: "#2D68B1",
460
+ Idris: "#b30000",
461
+ "Ignore List": "#000000",
462
+ "ImageJ Macro": "#99AAFF",
463
+ Imba: "#16cec6",
464
+ "Inno Setup": "#264b99",
465
+ Io: "#a9188d",
466
+ Ioke: "#078193",
467
+ Isabelle: "#FEFE00",
468
+ "Isabelle ROOT": "#FEFE00",
469
+ J: "#9EEDFF",
470
+ "JAR Manifest": "#b07219",
471
+ JCL: "#d90e09",
472
+ JFlex: "#DBCA00",
473
+ JSON: "#292929",
474
+ "JSON with Comments": "#292929",
475
+ JSON5: "#267CB9",
476
+ JSONLD: "#0c479c",
477
+ JSONiq: "#40d47e",
478
+ Jai: "#ab8b4b",
479
+ Janet: "#0886a5",
480
+ Jasmin: "#d03600",
481
+ Java: "#b07219",
482
+ "Java Properties": "#2A6277",
483
+ "Java Server Pages": "#2A6277",
484
+ "Java Template Engine": "#2A6277",
485
+ JavaScript: "#f1e05a",
486
+ "JavaScript+ERB": "#f1e05a",
487
+ "Jest Snapshot": "#15c213",
488
+ "JetBrains MPS": "#21D789",
489
+ Jinja: "#a52a22",
490
+ Jison: "#56b3cb",
491
+ "Jison Lex": "#56b3cb",
492
+ Jolie: "#843179",
493
+ Jsonnet: "#0064bd",
494
+ Julia: "#a270ba",
495
+ "Julia REPL": "#a270ba",
496
+ "Jupyter Notebook": "#DA5B0B",
497
+ Just: "#384d54",
498
+ KDL: "#ffb3b3",
499
+ KRL: "#28430A",
500
+ "Kaitai Struct": "#773b37",
501
+ KakouneScript: "#6f8042",
502
+ KerboScript: "#41adf0",
503
+ "KiCad Layout": "#2f4aab",
504
+ "KiCad Legacy Layout": "#2f4aab",
505
+ "KiCad Schematic": "#2f4aab",
506
+ "KoLmafia ASH": "#B9D9B9",
507
+ Koka: "#215166",
508
+ Kotlin: "#A97BFF",
509
+ LFE: "#4C3023",
510
+ LLVM: "#185619",
511
+ LOLCODE: "#cc9900",
512
+ LSL: "#3d9970",
513
+ LabVIEW: "#fede06",
514
+ Lark: "#2980B9",
515
+ Lasso: "#999999",
516
+ Latte: "#f2a542",
517
+ Leo: "#C4FFC2",
518
+ Less: "#1d365d",
519
+ Lex: "#DBCA00",
520
+ LigoLANG: "#0e74ff",
521
+ LilyPond: "#9ccc7c",
522
+ Liquid: "#67b8de",
523
+ "Literate Agda": "#315665",
524
+ "Literate CoffeeScript": "#244776",
525
+ "Literate Haskell": "#5e5086",
526
+ "LiveCode Script": "#0c5ba5",
527
+ LiveScript: "#499886",
528
+ Logtalk: "#295b9a",
529
+ LookML: "#652B81",
530
+ Lua: "#000080",
531
+ Luau: "#00A2FF",
532
+ M3U: "#179C7D",
533
+ MATLAB: "#e16737",
534
+ MAXScript: "#00a6a6",
535
+ MDX: "#fcb32c",
536
+ MLIR: "#5EC8DB",
537
+ MQL4: "#62A8D6",
538
+ MQL5: "#4A76B8",
539
+ MTML: "#b7e1f4",
540
+ Macaulay2: "#d8ffff",
541
+ Makefile: "#427819",
542
+ Mako: "#7e858d",
543
+ Markdown: "#083fa1",
544
+ Marko: "#42bff2",
545
+ Mask: "#f97732",
546
+ Max: "#c4a79c",
547
+ Mercury: "#ff2b2b",
548
+ Mermaid: "#ff3670",
549
+ Meson: "#007800",
550
+ Metal: "#8f14e9",
551
+ MiniYAML: "#ff1111",
552
+ MiniZinc: "#06a9e6",
553
+ Mint: "#02b046",
554
+ Mirah: "#c7a938",
555
+ Modelica: "#de1d31",
556
+ "Modula-2": "#10253f",
557
+ "Modula-3": "#223388",
558
+ Mojo: "#ff4c1f",
559
+ "Monkey C": "#8D6747",
560
+ MoonBit: "#b92381",
561
+ MoonScript: "#ff4585",
562
+ Motoko: "#fbb03b",
563
+ "Motorola 68K Assembly": "#005daa",
564
+ Move: "#4a137a",
565
+ Mustache: "#724b3b",
566
+ NCL: "#28431f",
567
+ NMODL: "#00356B",
568
+ "NPM Config": "#cb3837",
569
+ NWScript: "#111522",
570
+ Nasal: "#1d2c4e",
571
+ Nearley: "#990000",
572
+ Nemerle: "#3d3c6e",
573
+ NetLinx: "#0aa0ff",
574
+ "NetLinx+ERB": "#747faa",
575
+ NetLogo: "#ff6375",
576
+ NewLisp: "#87AED7",
577
+ Nextflow: "#3ac486",
578
+ Nginx: "#009639",
579
+ Nickel: "#E0C3FC",
580
+ Nim: "#ffc200",
581
+ Nit: "#009917",
582
+ Nix: "#7e7eff",
583
+ Noir: "#2f1f49",
584
+ Nu: "#c9df40",
585
+ NumPy: "#9C8AF9",
586
+ Nunjucks: "#3d8137",
587
+ Nushell: "#4E9906",
588
+ "OASv2-json": "#85ea2d",
589
+ "OASv2-yaml": "#85ea2d",
590
+ "OASv3-json": "#85ea2d",
591
+ "OASv3-yaml": "#85ea2d",
592
+ OCaml: "#ef7a08",
593
+ "OMNeT++ MSG": "#a0e0a0",
594
+ "OMNeT++ NED": "#08607c",
595
+ ObjectScript: "#424893",
596
+ "Objective-C": "#438eff",
597
+ "Objective-C++": "#6866fb",
598
+ "Objective-J": "#ff0c5a",
599
+ Odin: "#60AFFE",
600
+ Omgrofl: "#cabbff",
601
+ Opal: "#f7ede0",
602
+ "Open Policy Agent": "#7d9199",
603
+ "OpenAPI Specification v2": "#85ea2d",
604
+ "OpenAPI Specification v3": "#85ea2d",
605
+ OpenCL: "#ed2e2d",
606
+ "OpenEdge ABL": "#5ce600",
607
+ OpenQASM: "#AA70FF",
608
+ OpenSCAD: "#e5cd45",
609
+ "Option List": "#476732",
610
+ Org: "#77aa99",
611
+ OverpassQL: "#cce2aa",
612
+ Oxygene: "#cdd0e3",
613
+ Oz: "#fab738",
614
+ P4: "#7055b5",
615
+ PDDL: "#0d00ff",
616
+ "PEG.js": "#234d6b",
617
+ PHP: "#4F5D95",
618
+ PLSQL: "#dad8d8",
619
+ PLpgSQL: "#336790",
620
+ "POV-Ray SDL": "#6bac65",
621
+ Pact: "#F7A8B8",
622
+ Pan: "#cc0000",
623
+ Papyrus: "#6600cc",
624
+ Parrot: "#f3ca0a",
625
+ Pascal: "#E3F171",
626
+ Pawn: "#dbb284",
627
+ Pep8: "#C76F5B",
628
+ Perl: "#0298c3",
629
+ PicoLisp: "#6067af",
630
+ PigLatin: "#fcd7de",
631
+ Pike: "#005390",
632
+ "Pip Requirements": "#FFD343",
633
+ Pkl: "#6b9543",
634
+ PlantUML: "#fbbd16",
635
+ PogoScript: "#d80074",
636
+ Polar: "#ae81ff",
637
+ Portugol: "#f8bd00",
638
+ PostCSS: "#dc3a0c",
639
+ PostScript: "#da291c",
640
+ PowerBuilder: "#8f0f8d",
641
+ PowerShell: "#012456",
642
+ Praat: "#c8506d",
643
+ Prisma: "#0c344b",
644
+ Processing: "#0096D8",
645
+ Procfile: "#3B2F63",
646
+ Prolog: "#74283c",
647
+ Promela: "#de0000",
648
+ "Propeller Spin": "#7fa2a7",
649
+ Pug: "#a86454",
650
+ Puppet: "#302B6D",
651
+ PureBasic: "#5a6986",
652
+ PureScript: "#1D222D",
653
+ Pyret: "#ee1e10",
654
+ Python: "#3572A5",
655
+ "Python console": "#3572A5",
656
+ "Python traceback": "#3572A5",
657
+ "Q#": "#fed659",
658
+ QML: "#44a51c",
659
+ "Qt Script": "#00b841",
660
+ Quake: "#882233",
661
+ QuakeC: "#975777",
662
+ QuickBASIC: "#008080",
663
+ R: "#198CE7",
664
+ RAML: "#77d9fb",
665
+ RBS: "#701516",
666
+ RDoc: "#701516",
667
+ REXX: "#d90e09",
668
+ RMarkdown: "#198ce7",
669
+ RON: "#a62c00",
670
+ "ROS Interface": "#22314e",
671
+ RPGLE: "#2BDE21",
672
+ RUNOFF: "#665a4e",
673
+ Racket: "#3c5caa",
674
+ Ragel: "#9d5200",
675
+ Raku: "#0000fb",
676
+ Rascal: "#fffaa0",
677
+ ReScript: "#ed5051",
678
+ Reason: "#ff5847",
679
+ ReasonLIGO: "#ff5847",
680
+ Rebol: "#358a5b",
681
+ "Record Jar": "#0673ba",
682
+ Red: "#f50000",
683
+ "Regular Expression": "#009a00",
684
+ "Ren'Py": "#ff7f7f",
685
+ Rez: "#FFDAB3",
686
+ Ring: "#2D54CB",
687
+ Riot: "#A71E49",
688
+ RobotFramework: "#00c0b5",
689
+ Roc: "#7c38f5",
690
+ "Rocq Prover": "#d0b68c",
691
+ Roff: "#ecdebe",
692
+ "Roff Manpage": "#ecdebe",
693
+ Rouge: "#cc0088",
694
+ "RouterOS Script": "#DE3941",
695
+ Ruby: "#701516",
696
+ Rust: "#dea584",
697
+ SAS: "#B34936",
698
+ SCSS: "#c6538c",
699
+ SPARQL: "#0C4597",
700
+ SQF: "#3F3F3F",
701
+ SQL: "#e38c00",
702
+ SQLPL: "#e38c00",
703
+ "SRecode Template": "#348a34",
704
+ STL: "#373b5e",
705
+ SVG: "#ff9900",
706
+ Sail: "#259dd5",
707
+ SaltStack: "#646464",
708
+ Sass: "#a53b70",
709
+ Scala: "#c22d40",
710
+ Scaml: "#bd181a",
711
+ Scenic: "#fdc700",
712
+ Scheme: "#1e4aec",
713
+ Scilab: "#ca0f21",
714
+ Self: "#0579aa",
715
+ ShaderLab: "#222c37",
716
+ Shell: "#89e051",
717
+ "ShellCheck Config": "#cecfcb",
718
+ Shen: "#120F14",
719
+ "Simple File Verification": "#C9BFED",
720
+ Singularity: "#64E6AD",
721
+ Slang: "#1fbec9",
722
+ Slash: "#007eff",
723
+ Slice: "#003fa2",
724
+ Slim: "#2b2b2b",
725
+ Slint: "#2379F4",
726
+ SmPL: "#c94949",
727
+ Smalltalk: "#596706",
728
+ Smarty: "#f0c040",
729
+ Smithy: "#c44536",
730
+ Snakemake: "#419179",
731
+ Solidity: "#AA6746",
732
+ SourcePawn: "#f69e1d",
733
+ Squirrel: "#800000",
734
+ Stan: "#b2011d",
735
+ "Standard ML": "#dc566d",
736
+ Starlark: "#76d275",
737
+ Stata: "#1a5f91",
738
+ StringTemplate: "#3fb34f",
739
+ Stylus: "#ff6347",
740
+ "SubRip Text": "#9e0101",
741
+ SugarSS: "#2fcc9f",
742
+ SuperCollider: "#46390b",
743
+ "Survex data": "#ffcc99",
744
+ Svelte: "#ff3e00",
745
+ Sway: "#00F58C",
746
+ Sweave: "#198ce7",
747
+ Swift: "#F05138",
748
+ SystemVerilog: "#DAE1C2",
749
+ "TI Program": "#A0AA87",
750
+ "TL-Verilog": "#C40023",
751
+ TLA: "#4b0079",
752
+ TOML: "#9c4221",
753
+ TSQL: "#e38c00",
754
+ TSV: "#237346",
755
+ TSX: "#3178c6",
756
+ TXL: "#0178b8",
757
+ Tact: "#48b5ff",
758
+ Talon: "#333333",
759
+ Tcl: "#e4cc98",
760
+ TeX: "#3D6117",
761
+ Teal: "#00B1BC",
762
+ Terra: "#00004c",
763
+ "Terraform Template": "#7b42bb",
764
+ TextGrid: "#c8506d",
765
+ "TextMate Properties": "#df66e4",
766
+ Textile: "#ffe7ac",
767
+ Thrift: "#D12127",
768
+ Toit: "#c2c9fb",
769
+ "Tor Config": "#59316b",
770
+ "Tree-sitter Query": "#8ea64c",
771
+ Turing: "#cf142b",
772
+ Twig: "#c1d026",
773
+ TypeScript: "#3178c6",
774
+ TypeSpec: "#4A3665",
775
+ Typst: "#239dad",
776
+ "Unified Parallel C": "#4e3617",
777
+ "Unity3D Asset": "#222c37",
778
+ Uno: "#9933cc",
779
+ UnrealScript: "#a54c4d",
780
+ "Untyped Plutus Core": "#36adbd",
781
+ UrWeb: "#ccccee",
782
+ V: "#4f87c4",
783
+ VBA: "#867db1",
784
+ VBScript: "#15dcdc",
785
+ VCL: "#148AA8",
786
+ VHDL: "#adb2cb",
787
+ Vala: "#a56de2",
788
+ "Valve Data Format": "#f26025",
789
+ "Velocity Template Language": "#507cff",
790
+ Vento: "#ff0080",
791
+ Verilog: "#b2b7f8",
792
+ "Vim Help File": "#199f4b",
793
+ "Vim Script": "#199f4b",
794
+ "Vim Snippet": "#199f4b",
795
+ "Visual Basic .NET": "#945db7",
796
+ "Visual Basic 6.0": "#2c6353",
797
+ Volt: "#1F1F1F",
798
+ Vue: "#41b883",
799
+ Vyper: "#9F4CF2",
800
+ WDL: "#42f1f4",
801
+ WGSL: "#1a5e9a",
802
+ "Web Ontology Language": "#5b70bd",
803
+ WebAssembly: "#04133b",
804
+ "WebAssembly Interface Type": "#6250e7",
805
+ Whiley: "#d5c397",
806
+ Wikitext: "#fc5757",
807
+ "Windows Registry Entries": "#52d5ff",
808
+ "Witcher Script": "#ff0000",
809
+ "Wolfram Language": "#dd1100",
810
+ Wollok: "#a23738",
811
+ "World of Warcraft Addon Data": "#f7e43f",
812
+ Wren: "#383838",
813
+ X10: "#4B6BEF",
814
+ XC: "#99DA07",
815
+ XML: "#0060ac",
816
+ "XML Property List": "#0060ac",
817
+ XQuery: "#5232e7",
818
+ XSLT: "#EB8CEB",
819
+ Xmake: "#22a079",
820
+ Xojo: "#81bd41",
821
+ Xonsh: "#285EEF",
822
+ Xtend: "#24255d",
823
+ YAML: "#cb171e",
824
+ YARA: "#220000",
825
+ YASnippet: "#32AB90",
826
+ Yacc: "#4B6C4B",
827
+ Yul: "#794932",
828
+ ZAP: "#0d665e",
829
+ ZIL: "#dc75e5",
830
+ ZenScript: "#00BCD1",
831
+ Zephir: "#118f9e",
832
+ Zig: "#ec915c",
833
+ Zimpl: "#d67711",
834
+ Zmodel: "#ff7100",
835
+ crontab: "#ead7ac",
836
+ eC: "#913960",
837
+ fish: "#4aae47",
838
+ hoon: "#00b171",
839
+ iCalendar: "#ec564c",
840
+ jq: "#c7254e",
841
+ kvlang: "#1da6e0",
842
+ "mIRC Script": "#3d57c3",
843
+ mcfunction: "#E22837",
844
+ mdsvex: "#5f9ea0",
845
+ mupad: "#244963",
846
+ nanorc: "#2d004d",
847
+ nesC: "#94B0C7",
848
+ ooc: "#b0b77e",
849
+ q: "#0040cd",
850
+ reStructuredText: "#141414",
851
+ sed: "#64b970",
852
+ templ: "#66D0DD",
853
+ vCard: "#ee2647",
854
+ wisp: "#7582D1",
855
+ xBase: "#403a40",
856
+ default: "#ccc"
857
+ };
858
+ function getLangColor(lang) {
859
+ return langColors[lang] || langColors.default;
860
+ }
861
+ // src/utils/icons.ts
862
+ var icons = {
863
+ star: `<path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"/>`,
864
+ commit: `<path fill-rule="evenodd" d="M10.5 7.75a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm1.43.75a4.002 4.002 0 01-7.86 0H.75a.75.75 0 110-1.5h3.32a4.001 4.001 0 017.86 0h3.32a.75.75 0 110 1.5h-3.32z"/>`,
865
+ pr: `<path fill-rule="evenodd" d="M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"/>`,
866
+ issue: `<path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm9 3a1 1 0 11-2 0 1 1 0 012 0zm-.25-6.25a.75.75 0 00-1.5 0v3.5a.75.75 0 001.5 0v-3.5z"/>`,
867
+ repo: `<path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path>`,
868
+ x: `<path d="M4 4l11.733 16h4.267l-11.733 -16l-4.267 0" /><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" />`
869
+ };
870
+ function icon(name, color, size = 16) {
871
+ const path = icons[name];
872
+ if (!path)
873
+ return "";
874
+ const viewBox = name === "x" ? "0 0 24 24" : "0 0 16 16";
875
+ const colorStr = color.startsWith("#") ? color : `#${color}`;
876
+ const fill = name === "x" ? `stroke="${colorStr}" stroke-width="2" fill="none"` : `fill="${colorStr}"`;
877
+ return `<svg width="${size}" height="${size}" viewBox="${viewBox}" ${fill} role="img">${path}</svg>`;
878
+ }
879
+ // src/utils/font.ts
880
+ var FONT_FAMILY = 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
881
+ var FONT_FACE = "";
882
+ // src/utils/colors.ts
883
+ var twColors = {
884
+ transparent: "transparent",
885
+ current: "currentColor",
886
+ white: "#ffffff",
887
+ black: "#000000",
888
+ "slate-50": "#f8fafc",
889
+ "slate-100": "#f1f5f9",
890
+ "slate-200": "#e2e8f0",
891
+ "slate-300": "#cbd5e1",
892
+ "slate-400": "#94a3b8",
893
+ "slate-500": "#64748b",
894
+ "slate-600": "#475569",
895
+ "slate-700": "#334155",
896
+ "slate-800": "#1e293b",
897
+ "slate-900": "#0f172a",
898
+ "slate-950": "#020617",
899
+ "neutral-800": "#262626",
900
+ "neutral-950": "#0a0a0a",
901
+ "zinc-100": "#f4f4f5",
902
+ "zinc-400": "#a1a1aa",
903
+ "zinc-800": "#27272a",
904
+ "zinc-900": "#18181b",
905
+ "stone-300": "#d6d3d1",
906
+ "stone-700": "#44403c",
907
+ "stone-800": "#292524",
908
+ "rose-200": "#fecdd3",
909
+ "rose-300": "#fda4af",
910
+ "rose-400": "#fb7185",
911
+ "rose-900": "#881337",
912
+ "rose-950": "#4c0519",
913
+ "pink-400": "#f472b6",
914
+ "pink-500": "#ec4899",
915
+ "fuchsia-400": "#e879f9",
916
+ "purple-400": "#c084fc",
917
+ "purple-900": "#581c87",
918
+ "purple-950": "#3b0764",
919
+ "indigo-300": "#a5b4fc",
920
+ "indigo-400": "#818cf8",
921
+ "indigo-500": "#6366f1",
922
+ "indigo-900": "#312e81",
923
+ "violet-300": "#c4b5fd",
924
+ "violet-400": "#a78bfa",
925
+ "blue-300": "#93c5fd",
926
+ "blue-400": "#60a5fa",
927
+ "blue-500": "#3b82f6",
928
+ "blue-600": "#2563eb",
929
+ "sky-400": "#38bdf8",
930
+ "sky-900": "#0c4a6e",
931
+ "sky-950": "#082f49",
932
+ "cyan-300": "#67e8f9",
933
+ "cyan-400": "#22d3ee",
934
+ "teal-400": "#2dd4bf",
935
+ "emerald-200": "#a7f3d0",
936
+ "emerald-300": "#6ee7b7",
937
+ "emerald-400": "#34d399",
938
+ "emerald-500": "#10b981",
939
+ "emerald-900": "#064e3b",
940
+ "emerald-950": "#022c22",
941
+ "green-400": "#4ade80",
942
+ "lime-300": "#bef264",
943
+ "lime-400": "#a3e635",
944
+ "yellow-300": "#fde047",
945
+ "yellow-400": "#facc15",
946
+ "amber-300": "#fcd34d",
947
+ "amber-400": "#fbbf24",
948
+ "amber-600": "#d97706",
949
+ "amber-700": "#b45309",
950
+ "amber-900": "#78350f",
951
+ "orange-50": "#fff7ed",
952
+ "orange-200": "#fed7aa",
953
+ "orange-400": "#fb923c",
954
+ "orange-500": "#f97316"
955
+ };
956
+ function resolveTw(token, property) {
957
+ const value = token.trim();
958
+ const hex = value.startsWith("#") ? value.slice(1) : value;
959
+ if (/^(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{4}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(hex)) {
960
+ return `${property}="#${hex}"`;
961
+ }
962
+ const colorName = value.replace(/^fill-/, "").replace(/^stroke-/, "");
963
+ return `${property}="${twColors[colorName] ?? value}"`;
964
+ }
965
+ // src/card.ts
966
+ var STAT_DEFS = [
967
+ { key: "stars", iconName: "star", label: "Stars" },
968
+ { key: "commits", iconName: "commit", label: "Commits" },
969
+ { key: "issues", iconName: "issue", label: "Issues" },
970
+ { key: "repos", iconName: "repo", label: "Repos" },
971
+ { key: "prs", iconName: "pr", label: "PRs" }
972
+ ];
973
+ function raw(token) {
974
+ const m = resolveTw(token, "fill").match(/fill="([^"]+)"/);
975
+ return m?.[1] ?? token;
976
+ }
977
+ function clamp(s, n) {
978
+ return s.length <= n ? s : s.slice(0, n - 1).trimEnd() + "…";
979
+ }
980
+ function buildLanguageSegments(langs, totalSize, contentW) {
981
+ const minSegmentW = 6;
982
+ const visible = [];
983
+ let tinySize = 0;
984
+ for (const lang of langs) {
985
+ const segmentW = lang.size / totalSize * contentW;
986
+ if (segmentW < minSegmentW) {
987
+ tinySize += lang.size;
988
+ continue;
989
+ }
990
+ visible.push(lang);
991
+ }
992
+ if (tinySize > 0) {
993
+ visible.push({ name: "Other", color: "#6b7280", size: tinySize });
994
+ }
995
+ return visible.length > 0 ? visible : langs;
996
+ }
997
+ function renderCard(user, stats, langs, opts = {}) {
998
+ const hidden = new Set((opts.hide ?? []).map((k) => k.toLowerCase()));
999
+ const c = resolveColors(opts);
1000
+ const compact = opts.compact ?? false;
1001
+ const animate = opts.animate ?? false;
1002
+ const hideBorder = opts.hide_border ?? false;
1003
+ const hideLangs = new Set((opts.hide_langs ?? []).map((k) => k.toLowerCase().trim()));
1004
+ const showLangs = new Set((opts.show_langs ?? []).map((k) => k.toLowerCase().trim()));
1005
+ const bgColor = raw(c.bg);
1006
+ const titleColor = raw(c.title);
1007
+ const textColor = raw(c.text);
1008
+ const iconColor = raw(c.icon);
1009
+ const borderColor = raw(c.border);
1010
+ const fontFamily = FONT_FAMILY.replace(/"/g, "&apos;");
1011
+ const displayName = user.name || user.login;
1012
+ const nameEsc = escapeXml(clamp(displayName, 28));
1013
+ const loginEsc = escapeXml(clamp(user.login, 24));
1014
+ const pronouns = !compact && user.pronouns ? escapeXml(clamp(user.pronouns, 16)) : "";
1015
+ const bioRaw = !compact && user.bio ? user.bio : "";
1016
+ const bioLines = bioRaw ? wrapText(bioRaw, 44, 2) : [];
1017
+ const twitter = !compact && user.twitter ? escapeXml(clamp(user.twitter, 22)) : "";
1018
+ const avatar = (user.avatarUrl || "").replace(/&/g, "&amp;");
1019
+ const visible = STAT_DEFS.filter((d) => !hidden.has(d.key));
1020
+ const activeLangsList = langs.filter((l) => {
1021
+ const name = l.name.toLowerCase().trim();
1022
+ if (showLangs.size > 0 && !showLangs.has(name))
1023
+ return false;
1024
+ if (hideLangs.has(name))
1025
+ return false;
1026
+ return true;
1027
+ });
1028
+ const PX = 25;
1029
+ const PY = 25;
1030
+ const avatarSize = 64;
1031
+ const avatarR = avatarSize / 2;
1032
+ const metaLen = user.login.length + (pronouns ? pronouns.length + 3 : 0);
1033
+ const maxBioLen = bioLines.length ? Math.max(...bioLines.map((l) => l.length)) : 0;
1034
+ const profileTextW = Math.max(displayName.length * 11, metaLen * 7.5, maxBioLen * 6.5, twitter.length * 7 + 20);
1035
+ const profileW = PX + avatarSize + 16 + profileTextW + PX;
1036
+ const statsW = visible.length > 0 ? visible.length * 85 + PX * 2 : 0;
1037
+ const langsW = activeLangsList.length > 0 ? 300 : 0;
1038
+ const W = Math.round(Math.min(540, Math.max(340, profileW, statsW, langsW)));
1039
+ const contentW = W - PX * 2;
1040
+ const infoX = PX + avatarSize + 14;
1041
+ const nameY = PY + 22;
1042
+ const loginY = nameY + 18;
1043
+ const bioStartY = loginY + 16;
1044
+ const twitterY = bioStartY + bioLines.length * 14 + (bioLines.length ? 4 : 0);
1045
+ let profileH = loginY + 10 - PY;
1046
+ if (bioLines.length)
1047
+ profileH = bioStartY + bioLines.length * 14 - PY;
1048
+ if (twitter)
1049
+ profileH = twitterY + 10 - PY;
1050
+ profileH = Math.max(profileH, avatarSize + 4);
1051
+ const statsY = PY + profileH + 14;
1052
+ const statW = visible.length > 0 ? contentW / visible.length : 0;
1053
+ const statsH = visible.length > 0 ? 50 : 0;
1054
+ const totalSize = activeLangsList.reduce((s, l) => s + l.size, 0) || 1;
1055
+ const sorted = [...activeLangsList].sort((a, b) => b.size - a.size);
1056
+ const visualLangs = buildLanguageSegments(sorted, totalSize, contentW);
1057
+ const barY = statsY + statsH + (statsH ? 16 : 12);
1058
+ const barH = 10;
1059
+ const maxLegend = compact ? 0 : 6;
1060
+ const legendLangs = visualLangs.slice(0, maxLegend);
1061
+ const otherSize = visualLangs.slice(maxLegend).reduce((s, l) => s + l.size, 0);
1062
+ const legendY = barY + barH + 12;
1063
+ const legendRowH = 16;
1064
+ const legendCols = 3;
1065
+ const legendColW = contentW / legendCols;
1066
+ const legendItems = legendLangs.map((l) => ({
1067
+ name: clamp(l.name, 14),
1068
+ color: l.color,
1069
+ pct: (l.size / totalSize * 100).toFixed(1)
1070
+ }));
1071
+ if (otherSize > 0 && legendItems.length > 0) {
1072
+ const existingOther = legendItems.find((item) => item.name === "Other");
1073
+ if (existingOther) {
1074
+ existingOther.pct = ((Number(existingOther.pct) / 100 * totalSize + otherSize) / totalSize * 100).toFixed(1);
1075
+ } else {
1076
+ legendItems.push({
1077
+ name: "Other",
1078
+ color: "#6b7280",
1079
+ pct: (otherSize / totalSize * 100).toFixed(1)
1080
+ });
1081
+ }
1082
+ }
1083
+ const legendRows = compact ? 0 : Math.ceil(legendItems.length / legendCols);
1084
+ const hasLangs = activeLangsList.length > 0;
1085
+ const langSectionH = hasLangs ? barH + 12 + legendRows * legendRowH + 8 : 0;
1086
+ const H = barY + (hasLangs ? langSectionH : 0) + 12 + (hasLangs ? 0 : 4);
1087
+ const parts = [];
1088
+ parts.push('<svg width="' + W + '" height="' + H + '" viewBox="0 0 ' + W + " " + H + '" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="cardTitle cardDesc">');
1089
+ parts.push('<title id="cardTitle">' + escapeXml(displayName + "'s GitHub Stats") + "</title>");
1090
+ parts.push('<desc id="cardDesc">GitHub profile card for ' + escapeXml(displayName) + " with " + kFormat(stats.stars) + " stars, " + kFormat(stats.commits) + " commits, and " + activeLangsList.length + " highlighted languages.</desc>");
1091
+ const cssLines = [];
1092
+ cssLines.push("* { font-family: " + fontFamily + "; }");
1093
+ cssLines.push(".header { font-size: 18px; font-weight: 700; fill: " + titleColor + "; }");
1094
+ cssLines.push(".stat { font-size: 14px; font-weight: 600; fill: " + textColor + "; }");
1095
+ cssLines.push(".bold { font-weight: 700; }");
1096
+ cssLines.push(".icon { fill: " + iconColor + "; }");
1097
+ cssLines.push(".lang-name { font-size: 11px; fill: " + textColor + "; opacity: 0.8; }");
1098
+ cssLines.push(".lang-progress { fill: " + textColor + "; opacity: 0.08; }");
1099
+ cssLines.push(".meta { font-size: 12px; font-weight: 500; fill: " + textColor + "; opacity: 0.7; }");
1100
+ cssLines.push(".bio { font-size: 11px; font-weight: 400; fill: " + textColor + "; opacity: 0.68; }");
1101
+ cssLines.push(".stat-label { font-size: 9px; font-weight: 600; fill: " + textColor + "; opacity: 0.5; letter-spacing: 0.08em; }");
1102
+ cssLines.push(".stat-value { font-size: 15px; font-weight: 800; fill: " + textColor + "; }");
1103
+ cssLines.push(".twitter-text { font-size: 11px; font-weight: 500; fill: " + textColor + "; opacity: 0.65; }");
1104
+ if (animate) {
1105
+ cssLines.push("@keyframes fadeInAnimation { from { opacity: 0; } to { opacity: 1; } }");
1106
+ cssLines.push(".stagger { opacity: 0; animation: fadeInAnimation 0.3s ease-in-out forwards; }");
1107
+ }
1108
+ parts.push("<style>" + cssLines.join(" ") + "</style>");
1109
+ parts.push("<defs>");
1110
+ parts.push('<clipPath id="av"><circle cx="' + (PX + avatarR) + '" cy="' + (PY + avatarR) + '" r="' + avatarR + '"/></clipPath>');
1111
+ parts.push('<radialGradient id="gl" cx="12%" cy="15%" r="65%">' + '<stop offset="0%" stop-color="' + iconColor + '" stop-opacity="0.08"/>' + '<stop offset="100%" stop-color="' + iconColor + '" stop-opacity="0"/>' + "</radialGradient>");
1112
+ parts.push('<radialGradient id="gl2" cx="92%" cy="95%" r="55%">' + '<stop offset="0%" stop-color="' + titleColor + '" stop-opacity="0.035"/>' + '<stop offset="100%" stop-color="' + titleColor + '" stop-opacity="0"/>' + "</radialGradient>");
1113
+ parts.push('<linearGradient id="ring" x1="0" y1="0" x2="1" y2="1">' + '<stop offset="0%" stop-color="' + titleColor + '"/>' + '<stop offset="100%" stop-color="' + iconColor + '"/>' + "</linearGradient>");
1114
+ parts.push('<linearGradient id="card-bg" x1="0" y1="0" x2="' + W + '" y2="' + H + '" gradientUnits="userSpaceOnUse">' + '<stop offset="0%" stop-color="' + bgColor + '"/>' + '<stop offset="82%" stop-color="' + bgColor + '"/>' + '<stop offset="100%" stop-color="' + titleColor + '" stop-opacity="0.04"/>' + "</linearGradient>");
1115
+ parts.push('<linearGradient id="rim" x1="0" y1="0" x2="' + W + '" y2="0" gradientUnits="userSpaceOnUse">' + '<stop offset="0%" stop-color="' + iconColor + '" stop-opacity="0"/>' + '<stop offset="45%" stop-color="' + iconColor + '" stop-opacity="0.28"/>' + '<stop offset="100%" stop-color="' + iconColor + '" stop-opacity="0"/>' + "</linearGradient>");
1116
+ parts.push("</defs>");
1117
+ parts.push('<rect x="0.5" y="0.5" width="' + (W - 1) + '" height="' + (H - 1) + '" rx="10" fill="' + "url(#card-bg)" + '" stroke-opacity="1"/>');
1118
+ parts.push('<rect x="0.5" y="0.5" width="' + (W - 1) + '" height="' + (H - 1) + '" rx="10" fill="url(#gl)"/>');
1119
+ parts.push('<rect x="0.5" y="0.5" width="' + (W - 1) + '" height="' + (H - 1) + '" rx="10" fill="url(#gl2)"/>');
1120
+ parts.push('<line x1="' + PX + '" y1="1.5" x2="' + (W - PX) + '" y2="1.5" stroke="url(#rim)" stroke-width="1"/>');
1121
+ if (!hideBorder) {
1122
+ parts.push('<rect x="0.5" y="0.5" width="' + (W - 1) + '" height="' + (H - 1) + '" rx="10" fill="none" stroke="' + borderColor + '" stroke-opacity="0.5"/>');
1123
+ }
1124
+ parts.push('<g transform="translate(0,0)">' + '<circle cx="' + (PX + avatarR + 1) + '" cy="' + (PY + avatarR + 1) + '" r="' + (avatarR + 3) + '" fill="' + titleColor + '" opacity="0.08"/>' + '<image href="' + avatar + '" x="' + PX + '" y="' + PY + '" width="' + avatarSize + '" height="' + avatarSize + '" clip-path="url(#av)" preserveAspectRatio="xMidYMid slice"/>' + '<circle cx="' + (PX + avatarR) + '" cy="' + (PY + avatarR) + '" r="' + (avatarR + 1.5) + '" fill="none" stroke="url(#ring)" stroke-opacity="0.55" stroke-width="1.5"/>' + "</g>");
1125
+ parts.push('<g transform="translate(0,0)">');
1126
+ parts.push('<text x="' + infoX + '" y="' + nameY + '" class="header">' + nameEsc + "</text>");
1127
+ const metaStr = pronouns ? "@" + loginEsc + " · " + pronouns : "@" + loginEsc;
1128
+ parts.push('<text x="' + infoX + '" y="' + loginY + '" class="meta">' + metaStr + "</text>");
1129
+ for (let i = 0;i < bioLines.length; i++) {
1130
+ parts.push('<text x="' + infoX + '" y="' + (bioStartY + i * 14) + '" class="bio">' + escapeXml(bioLines[i].trim()) + "</text>");
1131
+ }
1132
+ if (twitter) {
1133
+ parts.push('<g transform="translate(' + infoX + "," + (twitterY - 9) + ')">' + icon("x", textColor, 11) + '<text x="15" y="9" class="twitter-text">@' + twitter + "</text></g>");
1134
+ }
1135
+ parts.push("</g>");
1136
+ if (visible.length > 0) {
1137
+ parts.push('<rect x="' + PX + '" y="' + (statsY - 8) + '" width="' + contentW + '" height="' + (statsH + 8) + '" rx="8" fill="' + textColor + '" opacity="0.035"/>');
1138
+ parts.push('<g transform="translate(0,0)">');
1139
+ for (let i = 0;i < visible.length; i++) {
1140
+ const d = visible[i];
1141
+ const val = stats[d.key];
1142
+ const cx = PX + statW * i + statW / 2;
1143
+ const cellX = PX + statW * i + 4;
1144
+ const iy = statsY + 2;
1145
+ const staggerStyle = animate ? ' style="animation-delay: ' + (i + 3) * 150 + 'ms"' : "";
1146
+ const staggerClass = animate ? " stagger" : "";
1147
+ parts.push('<rect x="' + cellX + '" y="' + (statsY - 4) + '" width="' + Math.max(0, statW - 8) + '" height="' + (statsH - 2) + '" rx="8" fill="' + textColor + '" opacity="0.028"/>');
1148
+ parts.push('<g transform="translate(' + cx + "," + iy + ')" class="stat' + staggerClass + '"' + staggerStyle + ">");
1149
+ parts.push('<text x="0" y="26" class="stat-value" text-anchor="middle">' + kFormat(val) + "</text>");
1150
+ const labelText = d.label.toUpperCase();
1151
+ const labelW = labelText.length * 6.8;
1152
+ const rowW = 10 + 4 + labelW;
1153
+ parts.push('<g transform="translate(' + -rowW / 2 + ',31.5)">' + icon(d.iconName, iconColor, 10) + "</g>");
1154
+ parts.push('<text x="' + (-rowW / 2 + 14) + '" y="40" class="stat-label">' + labelText + "</text>");
1155
+ parts.push("</g>");
1156
+ }
1157
+ parts.push("</g>");
1158
+ }
1159
+ if (hasLangs) {
1160
+ parts.push('<line x1="' + PX + '" y1="' + (barY - 8) + '" x2="' + (W - PX) + '" y2="' + (barY - 8) + '" stroke="' + textColor + '" stroke-opacity="0.08"/>');
1161
+ parts.push('<g transform="translate(0,0)">');
1162
+ parts.push('<clipPath id="lang-clip"><rect x="' + PX + '" y="' + barY + '" width="' + (animate ? "0" : contentW) + '" height="' + barH + '" rx="5">' + (animate ? '<animate attributeName="width" from="0" to="' + contentW + '" dur="0.6s" fill="freeze"/>' : "") + "</rect></clipPath>");
1163
+ parts.push('<rect x="' + PX + '" y="' + barY + '" width="' + contentW + '" height="' + barH + '" rx="5" class="lang-progress"/>');
1164
+ parts.push('<g clip-path="url(#lang-clip)">');
1165
+ const activeLangs = visualLangs;
1166
+ let off = 0;
1167
+ for (let i = 0;i < activeLangs.length; i++) {
1168
+ const lang = activeLangs[i];
1169
+ const pct = (lang.size / totalSize * 100).toFixed(1);
1170
+ let w = i === activeLangs.length - 1 ? contentW - off : lang.size / totalSize * contentW;
1171
+ if (w < 0)
1172
+ w = 0;
1173
+ const x = PX + off;
1174
+ const tooltip = compact ? "" : "<title>" + escapeXml(lang.name) + " " + pct + "%</title>";
1175
+ parts.push('<rect x="' + x + '" y="' + barY + '" width="' + w + '" height="' + barH + '" fill="' + lang.color + '">' + tooltip + "</rect>");
1176
+ off += w;
1177
+ }
1178
+ parts.push("</g>");
1179
+ for (let i = 0;i < legendItems.length; i++) {
1180
+ const item = legendItems[i];
1181
+ const col = i % legendCols;
1182
+ const row = Math.floor(i / legendCols);
1183
+ const lx = PX + col * legendColW;
1184
+ const ly = legendY + row * legendRowH;
1185
+ const staggerStyle = animate ? ' style="animation-delay: ' + (i + 3) * 150 + 'ms"' : "";
1186
+ const staggerClass = animate ? ' class="stagger"' : "";
1187
+ parts.push("<g" + staggerClass + staggerStyle + ">");
1188
+ parts.push('<circle cx="' + (lx + 5) + '" cy="' + ly + '" r="4" fill="' + item.color + '"/>');
1189
+ parts.push('<text x="' + (lx + 14) + '" y="' + (ly + 4) + '" class="lang-name" font-weight="500">' + escapeXml(item.name) + " " + item.pct + "%</text>");
1190
+ parts.push("</g>");
1191
+ }
1192
+ parts.push("</g>");
1193
+ }
1194
+ parts.push("</svg>");
1195
+ return parts.join("");
1196
+ }
1197
+ export {
1198
+ wrapText,
1199
+ themes,
1200
+ resolveColors,
1201
+ renderCard,
1202
+ kFormat,
1203
+ icons,
1204
+ icon,
1205
+ getLangColor,
1206
+ escapeXml,
1207
+ FONT_FAMILY,
1208
+ FONT_FACE
1209
+ };