@vite-hub/ui 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +1 -1
  2. package/dist/{colors-BghReA9C-DEq4bhEP.js → colors-BghReA9C-A4M9YE0s.js} +1 -1
  3. package/dist/{comment-attachments-CMpYOJod.js → comment-attachments-DAzUbRmJ.js} +4 -0
  4. package/dist/{comment-composer-BI6CNJyO.d.ts → comment-composer-DmDM3XYP.d.ts} +1 -1
  5. package/dist/{comment-composer-BP-CJx7f.js → comment-composer-X7vJKh5b.js} +4 -4
  6. package/dist/comment-layer-KnnVfdRV.d.ts +130 -0
  7. package/dist/{comment-list-BJdZu0DS.d.ts → comment-list-ncwaCSVX.d.ts} +2 -2
  8. package/dist/{comment-panel-DISGe7yM.d.ts → comment-panel-DoLDOw3E.d.ts} +2 -42
  9. package/dist/{comment-pin-C5UeLPTa.d.ts → comment-pin-hBJFiSYW.d.ts} +1 -1
  10. package/dist/{comment-send-CH46zawK.js → comment-send-CUkL3TbZ.js} +1 -1
  11. package/dist/comment-status-nsCdrRk_.js +20 -0
  12. package/dist/{comment-thread-DSkWODKG.d.ts → comment-thread-DPV2kqA4.d.ts} +4 -8
  13. package/dist/{comment-thread-5h93DXds.js → comment-thread-jqPx6aJ8.js} +9 -9
  14. package/dist/{comments-D9dONfs9.js → comments-9MDSNm-9.js} +33 -40
  15. package/dist/{comments-CnG_c-_c.d.ts → comments-OWjNidkP.d.ts} +6 -5
  16. package/dist/{comments-context-CrjhleVA.js → comments-context-3js2YFl2.js} +2 -2
  17. package/dist/{config-xL4EBeXw.d.ts → config-COSdO-ay.d.ts} +2 -1
  18. package/dist/{config-BDvnaVUn.js → config-LRonN53j.js} +9 -3
  19. package/dist/{draw-DzSmD7uo-Cb7s9kxJ.js → draw-DzSmD7uo-BvtKi0oE.js} +2 -2
  20. package/dist/{editor-BuByBIkJ.js → editor-Dmk3k6f6.js} +1 -1
  21. package/dist/{effects-DEoFFycD.js → effects-C1zYpSpg.js} +2 -2
  22. package/dist/{format-Bc9m7-r0.js → format-CPipR1FP.js} +4 -23
  23. package/dist/headless.d.ts +2 -2
  24. package/dist/headless.js +1 -1
  25. package/dist/{image-preview-EqfPcFZ9.js → image-preview-BKVUtfwQ.js} +1 -1
  26. package/dist/index.d.ts +11 -11
  27. package/dist/index.js +10 -9
  28. package/dist/{install-qNaj4OY4.js → install-C4LwcJda.js} +1 -1
  29. package/dist/{markdown-editor-3gY9MLvy.js → markdown-editor-D1irG9Xl.js} +45 -11
  30. package/dist/markdown-editor.js +1 -1
  31. package/dist/{markdown-renderer-BgsmNqv7.js → markdown-renderer-DMyYKeil.js} +13062 -12372
  32. package/dist/{message-scroller-a6qaYHno.d.ts → message-scroller-BZqS63IX.d.ts} +2 -2
  33. package/dist/motion/core.d.ts +1 -1
  34. package/dist/motion/core.js +4 -4
  35. package/dist/{motion-core-DNl7TR1T.d.ts → motion-core-Dh20n5Se.d.ts} +2 -1
  36. package/dist/motion.d.ts +1 -1
  37. package/dist/motion.js +5 -5
  38. package/dist/nuxt.d.ts +1 -1
  39. package/dist/parts/components/agent-session.d.ts +46 -3
  40. package/dist/parts/components/agent-session.js +27 -7
  41. package/dist/parts/components/avatar-stack.js +1 -1
  42. package/dist/parts/components/chat.js +1 -1
  43. package/dist/parts/components/comment-composer.d.ts +1 -1
  44. package/dist/parts/components/comment-composer.js +1 -1
  45. package/dist/parts/components/comment-layer.d.ts +1 -1
  46. package/dist/parts/components/comment-layer.js +20 -31
  47. package/dist/parts/components/comment-list.d.ts +1 -1
  48. package/dist/parts/components/comment-list.js +3 -2
  49. package/dist/parts/components/comment-panel.d.ts +1 -1
  50. package/dist/parts/components/comment-panel.js +32 -29
  51. package/dist/parts/components/comment-pin.d.ts +1 -1
  52. package/dist/parts/components/comment-selection-bar.js +1 -1
  53. package/dist/parts/components/comment-send.js +1 -1
  54. package/dist/parts/components/comment-thread.d.ts +2 -2
  55. package/dist/parts/components/comment-thread.js +3 -3
  56. package/dist/parts/components/comments.d.ts +6 -6
  57. package/dist/parts/components/comments.js +4 -4
  58. package/dist/parts/components/copy-button.js +2 -2
  59. package/dist/parts/components/markdown-editor.js +1 -1
  60. package/dist/parts/components/markdown-renderer.js +1 -1
  61. package/dist/parts/components/markdown.js +1 -1
  62. package/dist/parts/components/message-parts.js +1 -1
  63. package/dist/parts/components/motion.js +2 -2
  64. package/dist/parts/components/prompt-input.d.ts +2 -2
  65. package/dist/parts/components/prompt-input.js +2 -2
  66. package/dist/parts/components/trace-run.js +1 -1
  67. package/dist/parts/headless/comments.d.ts +1 -1
  68. package/dist/parts/headless/comments.js +1 -1
  69. package/dist/parts/headless/message-scroller.d.ts +1 -1
  70. package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
  71. package/dist/parts/workspace/browser-support-notice.js +1 -1
  72. package/dist/parts/workspace/workspace-boot-status.js +1 -1
  73. package/dist/parts/workspace/workspace-sidebar.d.ts +1 -1
  74. package/dist/parts/workspace/workspace-sidebar.js +1 -1
  75. package/dist/parts/workspace/workspace.d.ts +1 -1
  76. package/dist/parts/workspace/workspace.js +1 -1
  77. package/dist/{ring-BN4d8vtw.js → ring-GaJsg32c.js} +63 -12
  78. package/dist/runtime/nuxt-plugin.js +1 -1
  79. package/dist/{sankey-CAYwt82B-BAAk7WkJ.js → sankey-CAYwt82B-e6k34wtW.js} +3 -3
  80. package/dist/styles.css +13 -0
  81. package/dist/{text-BWzZFnGY.js → text-gacox6bp.js} +1 -1
  82. package/dist/{travel-CwVhU_GS.js → travel-BliEidau.js} +1 -1
  83. package/dist/vue-d2Td6uu2.js +6587 -0
  84. package/dist/{vue-Cs_HmYsp.js → vue-vUGpdMct.js} +1 -1
  85. package/dist/workspace.js +1 -1
  86. package/package.json +7 -7
  87. package/dist/comment-layer-Ba2DV4L7.d.ts +0 -174
  88. package/dist/vue-BlknIGIm.js +0 -2501
@@ -1,2501 +0,0 @@
1
- import { n as __exportAll } from "./rolldown-runtime-CahUhzF3.js";
2
- import { defineComponent, h, onMounted, onUpdated, shallowRef } from "vue";
3
- import { defineComarkPlugin } from "comark";
4
- // ../../node_modules/.pnpm/comark-ui@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__@tiptap+core@3.35.0_@tipt_cf2f734d482ac6e082eda4effd9c073f/node_modules/comark-ui/dist/nodes-CwDBFXnO.mjs
5
- const isElement$2 = (node) => Array.isArray(node) && node[0] !== null;
6
- const childrenOf$2 = ([, , ...rest]) => rest;
7
- const ambiguousRanges = [
8
- 161,
9
- 161,
10
- 164,
11
- 164,
12
- 167,
13
- 168,
14
- 170,
15
- 170,
16
- 173,
17
- 174,
18
- 176,
19
- 180,
20
- 182,
21
- 186,
22
- 188,
23
- 191,
24
- 198,
25
- 198,
26
- 208,
27
- 208,
28
- 215,
29
- 216,
30
- 222,
31
- 225,
32
- 230,
33
- 230,
34
- 232,
35
- 234,
36
- 236,
37
- 237,
38
- 240,
39
- 240,
40
- 242,
41
- 243,
42
- 247,
43
- 250,
44
- 252,
45
- 252,
46
- 254,
47
- 254,
48
- 257,
49
- 257,
50
- 273,
51
- 273,
52
- 275,
53
- 275,
54
- 283,
55
- 283,
56
- 294,
57
- 295,
58
- 299,
59
- 299,
60
- 305,
61
- 307,
62
- 312,
63
- 312,
64
- 319,
65
- 322,
66
- 324,
67
- 324,
68
- 328,
69
- 331,
70
- 333,
71
- 333,
72
- 338,
73
- 339,
74
- 358,
75
- 359,
76
- 363,
77
- 363,
78
- 462,
79
- 462,
80
- 464,
81
- 464,
82
- 466,
83
- 466,
84
- 468,
85
- 468,
86
- 470,
87
- 470,
88
- 472,
89
- 472,
90
- 474,
91
- 474,
92
- 476,
93
- 476,
94
- 593,
95
- 593,
96
- 609,
97
- 609,
98
- 708,
99
- 708,
100
- 711,
101
- 711,
102
- 713,
103
- 715,
104
- 717,
105
- 717,
106
- 720,
107
- 720,
108
- 728,
109
- 731,
110
- 733,
111
- 733,
112
- 735,
113
- 735,
114
- 768,
115
- 879,
116
- 913,
117
- 929,
118
- 931,
119
- 937,
120
- 945,
121
- 961,
122
- 963,
123
- 969,
124
- 1025,
125
- 1025,
126
- 1040,
127
- 1103,
128
- 1105,
129
- 1105,
130
- 8208,
131
- 8208,
132
- 8211,
133
- 8214,
134
- 8216,
135
- 8217,
136
- 8220,
137
- 8221,
138
- 8224,
139
- 8226,
140
- 8228,
141
- 8231,
142
- 8240,
143
- 8240,
144
- 8242,
145
- 8243,
146
- 8245,
147
- 8245,
148
- 8251,
149
- 8251,
150
- 8254,
151
- 8254,
152
- 8308,
153
- 8308,
154
- 8319,
155
- 8319,
156
- 8321,
157
- 8324,
158
- 8364,
159
- 8364,
160
- 8451,
161
- 8451,
162
- 8453,
163
- 8453,
164
- 8457,
165
- 8457,
166
- 8467,
167
- 8467,
168
- 8470,
169
- 8470,
170
- 8481,
171
- 8482,
172
- 8486,
173
- 8486,
174
- 8491,
175
- 8491,
176
- 8531,
177
- 8532,
178
- 8539,
179
- 8542,
180
- 8544,
181
- 8555,
182
- 8560,
183
- 8569,
184
- 8585,
185
- 8585,
186
- 8592,
187
- 8601,
188
- 8632,
189
- 8633,
190
- 8658,
191
- 8658,
192
- 8660,
193
- 8660,
194
- 8679,
195
- 8679,
196
- 8704,
197
- 8704,
198
- 8706,
199
- 8707,
200
- 8711,
201
- 8712,
202
- 8715,
203
- 8715,
204
- 8719,
205
- 8719,
206
- 8721,
207
- 8721,
208
- 8725,
209
- 8725,
210
- 8730,
211
- 8730,
212
- 8733,
213
- 8736,
214
- 8739,
215
- 8739,
216
- 8741,
217
- 8741,
218
- 8743,
219
- 8748,
220
- 8750,
221
- 8750,
222
- 8756,
223
- 8759,
224
- 8764,
225
- 8765,
226
- 8776,
227
- 8776,
228
- 8780,
229
- 8780,
230
- 8786,
231
- 8786,
232
- 8800,
233
- 8801,
234
- 8804,
235
- 8807,
236
- 8810,
237
- 8811,
238
- 8814,
239
- 8815,
240
- 8834,
241
- 8835,
242
- 8838,
243
- 8839,
244
- 8853,
245
- 8853,
246
- 8857,
247
- 8857,
248
- 8869,
249
- 8869,
250
- 8895,
251
- 8895,
252
- 8978,
253
- 8978,
254
- 9312,
255
- 9449,
256
- 9451,
257
- 9547,
258
- 9552,
259
- 9587,
260
- 9600,
261
- 9615,
262
- 9618,
263
- 9621,
264
- 9632,
265
- 9633,
266
- 9635,
267
- 9641,
268
- 9650,
269
- 9651,
270
- 9654,
271
- 9655,
272
- 9660,
273
- 9661,
274
- 9664,
275
- 9665,
276
- 9670,
277
- 9672,
278
- 9675,
279
- 9675,
280
- 9678,
281
- 9681,
282
- 9698,
283
- 9701,
284
- 9711,
285
- 9711,
286
- 9733,
287
- 9734,
288
- 9737,
289
- 9737,
290
- 9742,
291
- 9743,
292
- 9756,
293
- 9756,
294
- 9758,
295
- 9758,
296
- 9792,
297
- 9792,
298
- 9794,
299
- 9794,
300
- 9824,
301
- 9825,
302
- 9827,
303
- 9829,
304
- 9831,
305
- 9834,
306
- 9836,
307
- 9837,
308
- 9839,
309
- 9839,
310
- 9886,
311
- 9887,
312
- 9919,
313
- 9919,
314
- 9926,
315
- 9933,
316
- 9935,
317
- 9939,
318
- 9941,
319
- 9953,
320
- 9955,
321
- 9955,
322
- 9960,
323
- 9961,
324
- 9963,
325
- 9969,
326
- 9972,
327
- 9972,
328
- 9974,
329
- 9977,
330
- 9979,
331
- 9980,
332
- 9982,
333
- 9983,
334
- 10045,
335
- 10045,
336
- 10102,
337
- 10111,
338
- 11094,
339
- 11097,
340
- 12872,
341
- 12879,
342
- 57344,
343
- 63743,
344
- 65024,
345
- 65039,
346
- 65533,
347
- 65533,
348
- 127232,
349
- 127242,
350
- 127248,
351
- 127277,
352
- 127280,
353
- 127337,
354
- 127344,
355
- 127373,
356
- 127375,
357
- 127376,
358
- 127387,
359
- 127404,
360
- 917760,
361
- 917999,
362
- 983040,
363
- 1048573,
364
- 1048576,
365
- 1114109
366
- ];
367
- const fullwidthRanges = [
368
- 12288,
369
- 12288,
370
- 65281,
371
- 65376,
372
- 65504,
373
- 65510
374
- ];
375
- const halfwidthRanges = [
376
- 8361,
377
- 8361,
378
- 65377,
379
- 65470,
380
- 65474,
381
- 65479,
382
- 65482,
383
- 65487,
384
- 65490,
385
- 65495,
386
- 65498,
387
- 65500,
388
- 65512,
389
- 65518
390
- ];
391
- const narrowRanges = [
392
- 32,
393
- 126,
394
- 162,
395
- 163,
396
- 165,
397
- 166,
398
- 172,
399
- 172,
400
- 175,
401
- 175,
402
- 10214,
403
- 10221,
404
- 10629,
405
- 10630
406
- ];
407
- const wideRanges = [
408
- 4352,
409
- 4447,
410
- 8986,
411
- 8987,
412
- 9001,
413
- 9002,
414
- 9193,
415
- 9196,
416
- 9200,
417
- 9200,
418
- 9203,
419
- 9203,
420
- 9725,
421
- 9726,
422
- 9748,
423
- 9749,
424
- 9776,
425
- 9783,
426
- 9800,
427
- 9811,
428
- 9855,
429
- 9855,
430
- 9866,
431
- 9871,
432
- 9875,
433
- 9875,
434
- 9889,
435
- 9889,
436
- 9898,
437
- 9899,
438
- 9917,
439
- 9918,
440
- 9924,
441
- 9925,
442
- 9934,
443
- 9934,
444
- 9940,
445
- 9940,
446
- 9962,
447
- 9962,
448
- 9970,
449
- 9971,
450
- 9973,
451
- 9973,
452
- 9978,
453
- 9978,
454
- 9981,
455
- 9981,
456
- 9989,
457
- 9989,
458
- 9994,
459
- 9995,
460
- 10024,
461
- 10024,
462
- 10060,
463
- 10060,
464
- 10062,
465
- 10062,
466
- 10067,
467
- 10069,
468
- 10071,
469
- 10071,
470
- 10133,
471
- 10135,
472
- 10160,
473
- 10160,
474
- 10175,
475
- 10175,
476
- 11035,
477
- 11036,
478
- 11088,
479
- 11088,
480
- 11093,
481
- 11093,
482
- 11904,
483
- 11929,
484
- 11931,
485
- 12019,
486
- 12032,
487
- 12245,
488
- 12272,
489
- 12287,
490
- 12289,
491
- 12350,
492
- 12353,
493
- 12438,
494
- 12441,
495
- 12543,
496
- 12549,
497
- 12591,
498
- 12593,
499
- 12686,
500
- 12688,
501
- 12773,
502
- 12783,
503
- 12830,
504
- 12832,
505
- 12871,
506
- 12880,
507
- 42124,
508
- 42128,
509
- 42182,
510
- 43360,
511
- 43388,
512
- 44032,
513
- 55203,
514
- 63744,
515
- 64255,
516
- 65040,
517
- 65049,
518
- 65072,
519
- 65106,
520
- 65108,
521
- 65126,
522
- 65128,
523
- 65131,
524
- 94176,
525
- 94180,
526
- 94192,
527
- 94198,
528
- 94208,
529
- 101594,
530
- 101631,
531
- 101664,
532
- 101760,
533
- 101874,
534
- 101888,
535
- 102801,
536
- 102816,
537
- 102866,
538
- 110576,
539
- 110579,
540
- 110581,
541
- 110587,
542
- 110589,
543
- 110590,
544
- 110592,
545
- 110888,
546
- 110898,
547
- 110898,
548
- 110928,
549
- 110930,
550
- 110933,
551
- 110933,
552
- 110948,
553
- 110952,
554
- 110960,
555
- 111355,
556
- 119552,
557
- 119638,
558
- 119648,
559
- 119670,
560
- 126980,
561
- 126980,
562
- 127183,
563
- 127183,
564
- 127374,
565
- 127374,
566
- 127377,
567
- 127386,
568
- 127406,
569
- 127406,
570
- 127488,
571
- 127490,
572
- 127504,
573
- 127547,
574
- 127552,
575
- 127560,
576
- 127568,
577
- 127569,
578
- 127584,
579
- 127589,
580
- 127744,
581
- 127776,
582
- 127789,
583
- 127797,
584
- 127799,
585
- 127868,
586
- 127870,
587
- 127891,
588
- 127904,
589
- 127946,
590
- 127951,
591
- 127955,
592
- 127968,
593
- 127984,
594
- 127988,
595
- 127988,
596
- 127992,
597
- 128062,
598
- 128064,
599
- 128064,
600
- 128066,
601
- 128252,
602
- 128255,
603
- 128317,
604
- 128331,
605
- 128334,
606
- 128336,
607
- 128359,
608
- 128378,
609
- 128378,
610
- 128405,
611
- 128406,
612
- 128420,
613
- 128420,
614
- 128507,
615
- 128591,
616
- 128640,
617
- 128709,
618
- 128716,
619
- 128716,
620
- 128720,
621
- 128722,
622
- 128725,
623
- 128729,
624
- 128732,
625
- 128735,
626
- 128747,
627
- 128748,
628
- 128756,
629
- 128764,
630
- 128986,
631
- 128986,
632
- 128992,
633
- 129003,
634
- 129008,
635
- 129008,
636
- 129292,
637
- 129338,
638
- 129340,
639
- 129349,
640
- 129351,
641
- 129535,
642
- 129648,
643
- 129660,
644
- 129664,
645
- 129734,
646
- 129736,
647
- 129736,
648
- 129740,
649
- 129757,
650
- 129759,
651
- 129771,
652
- 129775,
653
- 129786,
654
- 131072,
655
- 196605,
656
- 196608,
657
- 262141
658
- ];
659
- // ../../node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/utilities.js
660
- /**
661
- Binary search on a sorted flat array of [start, end] pairs.
662
-
663
- @param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].
664
- @param {number} codePoint - The value to search for.
665
- @returns {boolean} Whether the value falls within any of the ranges.
666
- */
667
- const isInRange = (ranges, codePoint) => {
668
- let low = 0;
669
- let high = Math.floor(ranges.length / 2) - 1;
670
- while (low <= high) {
671
- const mid = Math.floor((low + high) / 2);
672
- const i = mid * 2;
673
- if (codePoint < ranges[i]) high = mid - 1;
674
- else if (codePoint > ranges[i + 1]) low = mid + 1;
675
- else return true;
676
- }
677
- return false;
678
- };
679
- // ../../node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/lookup.js
680
- const commonCjkCodePoint = 19968;
681
- const [wideFastPathStart, wideFastPathEnd] = /* #__PURE__ */ findWideFastPathRange(wideRanges);
682
- function findWideFastPathRange(ranges) {
683
- let fastPathStart = ranges[0];
684
- let fastPathEnd = ranges[1];
685
- for (let index = 0; index < ranges.length; index += 2) {
686
- const start = ranges[index];
687
- const end = ranges[index + 1];
688
- if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) return [start, end];
689
- if (end - start > fastPathEnd - fastPathStart) {
690
- fastPathStart = start;
691
- fastPathEnd = end;
692
- }
693
- }
694
- return [fastPathStart, fastPathEnd];
695
- }
696
- const isAmbiguous = (codePoint) => {
697
- if (codePoint < 161 || codePoint > 1114109) return false;
698
- return isInRange(ambiguousRanges, codePoint);
699
- };
700
- const isFullwidth = (codePoint) => {
701
- if (codePoint < 12288 || codePoint > 65510) return false;
702
- return isInRange(fullwidthRanges, codePoint);
703
- };
704
- const isHalfwidth = (codePoint) => {
705
- if (codePoint < 8361 || codePoint > 65518) return false;
706
- return isInRange(halfwidthRanges, codePoint);
707
- };
708
- const isNarrow = (codePoint) => {
709
- if (codePoint < 32 || codePoint > 10630) return false;
710
- return isInRange(narrowRanges, codePoint);
711
- };
712
- const isWide = (codePoint) => {
713
- if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) return true;
714
- if (codePoint < 4352 || codePoint > 262141) return false;
715
- return isInRange(wideRanges, codePoint);
716
- };
717
- function getCategory(codePoint) {
718
- if (isAmbiguous(codePoint)) return "ambiguous";
719
- if (isFullwidth(codePoint)) return "fullwidth";
720
- if (isHalfwidth(codePoint)) return "halfwidth";
721
- if (isNarrow(codePoint)) return "narrow";
722
- if (isWide(codePoint)) return "wide";
723
- return "neutral";
724
- }
725
- // ../../node_modules/.pnpm/get-east-asian-width@1.7.0/node_modules/get-east-asian-width/index.js
726
- function validate(codePoint) {
727
- if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
728
- }
729
- function eastAsianWidthType(codePoint) {
730
- validate(codePoint);
731
- return getCategory(codePoint);
732
- }
733
- // ../../node_modules/.pnpm/markdown-it-cjk-friendly@3.0.0_@types+markdown-it@14.2.0_markdown-it@15.0.3/node_modules/markdown-it-cjk-friendly/dist/index.js
734
- function isEmoji(uc) {
735
- return /^\p{Emoji_Presentation}/u.test(String.fromCodePoint(uc));
736
- }
737
- /**
738
- * Check if `uc` is CJK. Deferred (returns `null`) if IVS.
739
- *
740
- * @param uc code point
741
- * @returns `true` if `uc` is CJK, `false` if not, `null` if IVS
742
- */
743
- function isCjkBase(uc) {
744
- if (uc < 4352) return false;
745
- switch (eastAsianWidthType(uc)) {
746
- case "fullwidth":
747
- case "halfwidth": return true;
748
- case "wide": return !isEmoji(uc);
749
- case "narrow": return false;
750
- case "ambiguous": return null;
751
- case "neutral": return /^\p{sc=Hangul}/u.test(String.fromCodePoint(uc));
752
- }
753
- }
754
- function is2PreviousCjk(uc, prev) {
755
- return isCjkBase(uc) ?? (prev === 65025 && isQuotationMark(uc));
756
- function isQuotationMark(uc) {
757
- return uc === 8216 || uc === 8217 || uc === 8220 || uc === 8221;
758
- }
759
- }
760
- function isPreviousCjk(uc) {
761
- return isCjkBase(uc) ?? (917760 <= uc && uc <= 917999);
762
- }
763
- function isNextCjk(uc) {
764
- return isCjkBase(uc) ?? false;
765
- }
766
- function nonEmojiGeneralUseVS(uc) {
767
- return uc >= 65024 && uc <= 65038;
768
- }
769
- function markdownItCjkFriendlyPlugin(md) {
770
- const PreviousState = md.inline.State;
771
- class CjkFriendlyState extends PreviousState {
772
- scanDelims(start, canSplitWord) {
773
- const max = this.posMax;
774
- const marker = this.src.charCodeAt(start);
775
- const [lastChar, lastCharPos] = getLastCharCode(this.src, start);
776
- let lastMainChar = lastChar;
777
- let twoPrevChar = null;
778
- if (nonEmojiGeneralUseVS(lastChar)) {
779
- twoPrevChar = getLastCharCode(this.src, lastCharPos)[0];
780
- if (!/^\p{Zs}/u.test(String.fromCodePoint(twoPrevChar))) lastMainChar = twoPrevChar;
781
- }
782
- let pos = start;
783
- while (pos < max && this.src.charCodeAt(pos) === marker) pos++;
784
- const count = pos - start;
785
- const nextChar = pos < max ? this.src.codePointAt(pos) : 32;
786
- const isLastWhiteSpace = md.utils.isWhiteSpace(lastMainChar);
787
- const isNextWhiteSpace = md.utils.isWhiteSpace(nextChar);
788
- if (isLastWhiteSpace || isNextWhiteSpace) return {
789
- can_open: !isNextWhiteSpace,
790
- can_close: !isLastWhiteSpace,
791
- length: count
792
- };
793
- const isLastPunctChar = md.utils.isMdAsciiPunct(lastMainChar) || md.utils.isPunctChar(String.fromCodePoint(lastMainChar));
794
- const isNextPunctChar = md.utils.isMdAsciiPunct(nextChar) || md.utils.isPunctChar(String.fromCodePoint(nextChar));
795
- let left_flanking = isLastPunctChar;
796
- let right_flanking = isNextPunctChar;
797
- if (canSplitWord) {
798
- const isEitherCJKChar = isNextCjk(nextChar) || (twoPrevChar !== null ? is2PreviousCjk(twoPrevChar, lastChar) : isPreviousCjk(lastChar));
799
- left_flanking ||= isEitherCJKChar || !isNextPunctChar;
800
- right_flanking ||= isEitherCJKChar || !isLastPunctChar;
801
- }
802
- return {
803
- can_open: left_flanking,
804
- can_close: right_flanking,
805
- length: count
806
- };
807
- function getLastCharCode(str, pos) {
808
- if (pos <= 0) return [32, -1];
809
- const charCode = str.charCodeAt(pos - 1);
810
- if ((charCode & 64512) !== 56320) return [charCode, pos - 1];
811
- const codePoint = str.codePointAt(pos - 2);
812
- return codePoint > 65535 ? [codePoint, pos - 2] : [charCode, pos - 1];
813
- }
814
- }
815
- }
816
- md.inline.State = CjkFriendlyState;
817
- }
818
- // ../../node_modules/.pnpm/comark-cjk@0.12.2_@types+markdown-it@14.2.0_comark@0.9.2_katex@0.19.1_shiki@4.6.0__markdown-it@15.0.3/node_modules/comark-cjk/dist/index.mjs
819
- const installCjkFriendly = markdownItCjkFriendlyPlugin;
820
- /**
821
- * Emphasis next to Chinese, Japanese, and Korean punctuation: `**この文は太字。**次の文` bolds, where CommonMark
822
- * leaves the asterisks as text. It runs markdown-it-cjk-friendly unchanged, so Latin text parses as before.
823
- */
824
- var src_default$4 = defineComarkPlugin(() => ({
825
- name: "comark-cjk",
826
- markdownItPlugins: [installCjkFriendly]
827
- }));
828
- // ../../node_modules/.pnpm/comark-critic@0.12.2_comark@0.9.2_katex@0.19.1_shiki@4.6.0_/node_modules/comark-critic/dist/index.mjs
829
- /**
830
- * An inline element and a block element, by the prefix of their `_open` and `_close` types. Not `mdc_block_slot` for
831
- * blocks: directly inside a `::component` Comark reads those as named slots and splits the block apart.
832
- */
833
- const SPAN$1 = "mdc_inline_span";
834
- /**
835
- * Adds a rule before or after the first of `anchors` the parser has, else last. Comark's own rules exist only with
836
- * its default plugins, and markdown-exit throws on a missing anchor, which would make every parse throw.
837
- */
838
- function addRule$2(ruler, place, anchors, name, fn, options) {
839
- for (const anchor of anchors) try {
840
- ruler[place](anchor, name, fn, options);
841
- return;
842
- } catch {}
843
- ruler.push(name, fn, options);
844
- }
845
- /**
846
- * One markdown-it function per set of options. Comark caches a parser per list of these functions by identity, so a
847
- * function built on every call would build a new parser on every parse and push the others out of its cache.
848
- */
849
- function stable(build) {
850
- const built = /* @__PURE__ */ new Map();
851
- return (options) => {
852
- const key = JSON.stringify(options) ?? "";
853
- let fn = built.get(key);
854
- if (!fn) built.set(key, fn = build(options));
855
- return fn;
856
- };
857
- }
858
- const tokens$2 = [
859
- [
860
- "background",
861
- "ui-bg",
862
- "background",
863
- "#fff",
864
- "#0a0a0a"
865
- ],
866
- [
867
- "foreground",
868
- "ui-text-highlighted",
869
- "foreground",
870
- "#0a0a0a",
871
- "#fafafa"
872
- ],
873
- [
874
- "muted",
875
- "ui-text-muted",
876
- "muted-foreground",
877
- "#737373",
878
- "#a1a1a1"
879
- ],
880
- [
881
- "border",
882
- "ui-border",
883
- "border",
884
- "#e5e5e5",
885
- "rgb(255 255 255/.1)"
886
- ],
887
- [
888
- "accent",
889
- "ui-bg-elevated",
890
- "accent",
891
- "#f5f5f5",
892
- "#262626"
893
- ],
894
- [
895
- "ring",
896
- "ui-primary",
897
- "ring",
898
- "#a1a1a1",
899
- "#737373"
900
- ]
901
- ];
902
- const groups$2 = {
903
- status: Object.values({
904
- success: [
905
- "success",
906
- "ui-success",
907
- "success",
908
- "#259f56",
909
- "#59d38c"
910
- ],
911
- danger: [
912
- "danger",
913
- "ui-error",
914
- "destructive",
915
- "#ee3533",
916
- "#fd736d"
917
- ],
918
- warning: [
919
- "warning",
920
- "ui-warning",
921
- "",
922
- "#d57506",
923
- "#fbbf24"
924
- ],
925
- info: [
926
- "info",
927
- "ui-info",
928
- "",
929
- "#2563eb",
930
- "#60a5fa"
931
- ]
932
- }),
933
- primary: [
934
- [
935
- "primary",
936
- "ui-primary",
937
- "primary",
938
- "var(--_comark-foreground)",
939
- "var(--_comark-foreground)"
940
- ],
941
- [
942
- "primary-foreground",
943
- "ui-text-inverted",
944
- "primary-foreground",
945
- "var(--_comark-background)",
946
- "var(--_comark-background)"
947
- ],
948
- [
949
- "secondary",
950
- "ui-secondary",
951
- "",
952
- "var(--_comark-muted)",
953
- "var(--_comark-muted)"
954
- ]
955
- ],
956
- shadow: [[
957
- "shadow",
958
- "",
959
- "",
960
- "0 4px 12px rgb(0 0 0/.12)",
961
- "0 4px 12px rgb(0 0 0/.5)"
962
- ]]
963
- };
964
- const chain$2 = (token, scheme) => {
965
- const shadcn = token[2] ? `var(--${token[2]},${token[scheme]})` : token[scheme];
966
- const nuxt = token[1] ? `var(--${token[1]},${shadcn})` : shadcn;
967
- return `var(--comark-${token[0]},${nuxt})`;
968
- };
969
- const resolve$2 = (list, scheme) => list.map((token) => `--_comark-${token[0]}:${chain$2(token, scheme)}`).join(";");
970
- /**
971
- * `declarations` on `selector` in dark mode: the system's, unless a `.light` class sits on the element or above it, or
972
- * a `.dark` class there whatever the system says. Either class pins a page's scheme.
973
- */
974
- function dark$2(selector, declarations) {
975
- return `@media (prefers-color-scheme:dark){:where(:not(.light,.light *)):is(${selector}){${declarations}}}:where(.dark,.dark *):is(${selector}){${declarations}}`;
976
- }
977
- /**
978
- * Resolves the `--comark-*` tokens on `selector`, falling back to Nuxt UI's variables, then shadcn/ui's, then shadcn's
979
- * neutral theme. Nuxt UI's corners are twice its `--ui-radius`, so the radius halves shadcn's to double it back. The
980
- * halving sits in the `var()` fallback without a `calc()` of its own, which reads the same once the fallback is
981
- * substituted, because postcss-calc, which cssnano runs, can't parse a `calc()` there.
982
- * They resolve on the component rather than `:root`, so a `--comark-*` set on any ancestor still inherits down.
983
- * `:where()` keeps them at zero specificity. The neutral theme follows the system's color mode, and a `.light` or
984
- * `.dark` class on the component or above it pins one (see `dark()`).
985
- *
986
- * Every block gets the core tokens. Name `"status"` for `--comark-success`, `-danger`, `-warning`, and `-info`,
987
- * `"primary"` for `--comark-primary`, `-primary-foreground`, and `-secondary`, and `"shadow"` for `--comark-shadow`, so
988
- * a block that never draws them doesn't carry them.
989
- */
990
- function theme$2(selector, ...extras) {
991
- const where = `:where(${selector})`;
992
- const list = [...tokens$2, ...extras.flatMap((name) => groups$2[name])];
993
- return `${where}{${resolve$2(list, 3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,var(--radius,.625rem)/2)*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}` + dark$2(where, resolve$2(list, 4));
994
- }
995
- const marks = ".ccm-ins,.ccm-del,.ccm-mark";
996
- const bubble = `url("data:image/svg+xml,${encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/></svg>")}")`;
997
- /**
998
- * Styles for the marks, on the shared `--comark-*` tokens: an insertion tinted green over a line, a deletion struck
999
- * through in red (shadcn/ui's `--destructive` when the page has it), a highlight in amber, and a comment as a muted note with a
1000
- * speech bubble beside the text it's about. Override `--ccm-ins`, `--ccm-del`, and `--ccm-mark`. The rules sit in the `comark`
1001
- * layer, so any unlayered rule of the host's wins.
1002
- */
1003
- const css$1 = `@layer comark{${[
1004
- theme$2(`${marks},.ccm-comment`, "status"),
1005
- `:where(${marks}){--_ccm-ins:var(--ccm-ins,var(--_comark-success));--_ccm-del:var(--ccm-del,var(--_comark-danger));--_ccm-mark:var(--ccm-mark,#f5b400)}`,
1006
- dark$2(`:where(${marks})`, "--_ccm-mark:var(--ccm-mark,#f5c84b)"),
1007
- `${marks},.ccm-comment{border-radius:calc(var(--_comark-radius) - 6px);-webkit-box-decoration-break:clone;box-decoration-break:clone}`,
1008
- `${marks}{padding:0 .125em;color:inherit}`,
1009
- ".ccm-ins{background:color-mix(in srgb,var(--_ccm-ins) 14%,transparent);box-shadow:inset 0 -1.5px color-mix(in srgb,var(--_ccm-ins) 60%,transparent);text-decoration:none}",
1010
- ".ccm-del{background:color-mix(in srgb,var(--_ccm-del) 10%,transparent);color:color-mix(in oklab,var(--_ccm-del) 60%,var(--_comark-foreground));text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--_ccm-del) 70%,transparent)}",
1011
- ".ccm-mark{background:color-mix(in srgb,var(--_ccm-mark) 30%,transparent)}",
1012
- ".ccm-comment{margin:0 .125em;padding:.0625em .375em;background:var(--_comark-accent);color:var(--_comark-muted);font-size:.8125em;font-style:normal}",
1013
- `.ccm-comment::before{content:'';display:inline-block;width:1em;height:1em;margin-right:.3125em;background:currentColor;mask:${bubble} center/contain no-repeat;vertical-align:-.15em}`
1014
- ].join("")}}`;
1015
- const COMMENT_CLASS = "ccm-comment";
1016
- const CLASSES = {
1017
- ins: "ccm-ins",
1018
- del: "ccm-del",
1019
- mark: "ccm-mark"
1020
- };
1021
- const MARKS = /* @__PURE__ */ new Map([
1022
- ["{++", {
1023
- kind: "ins",
1024
- close: "++}"
1025
- }],
1026
- ["{--", {
1027
- kind: "del",
1028
- close: "--}"
1029
- }],
1030
- ["{~~", {
1031
- kind: "sub",
1032
- close: "~~}"
1033
- }],
1034
- ["{==", {
1035
- kind: "mark",
1036
- close: "==}"
1037
- }],
1038
- ["{>>", {
1039
- kind: "comment",
1040
- close: "<<}"
1041
- }]
1042
- ]);
1043
- const MODES = /* @__PURE__ */ new Set([
1044
- "view",
1045
- "accept",
1046
- "reject"
1047
- ]);
1048
- const PROBLEM = "critic_problem";
1049
- /** Tokenizes `from` to `to` as inline Markdown, inside `tag` unless it's empty. */
1050
- function inline(state, from, to, tag = "", className = "") {
1051
- const max = state.posMax;
1052
- if (tag) {
1053
- const open = state.push(`${SPAN$1}_open`, tag, 1);
1054
- if (className) open.attrs = [["class", className]];
1055
- }
1056
- state.pos = from;
1057
- state.posMax = to;
1058
- state.md.inline.tokenize(state);
1059
- state.posMax = max;
1060
- if (tag) state.push(`${SPAN$1}_close`, tag, -1).meta = { critic: className };
1061
- }
1062
- function problem(state, opener, { rule, message }) {
1063
- const token = state.push(PROBLEM, "", 0);
1064
- token.content = message;
1065
- token.meta = { rule };
1066
- state.pending += opener;
1067
- state.pos += opener.length;
1068
- return true;
1069
- }
1070
- /** Finds a delimiter in inline source while skipping escaped text and code spans. */
1071
- function delimiter(src, from, max, needle) {
1072
- for (let index = from; index <= max - needle.length; index++) {
1073
- if (src.charCodeAt(index) === 92) {
1074
- index++;
1075
- continue;
1076
- }
1077
- if (src.charCodeAt(index) === 96) {
1078
- let end = index + 1;
1079
- while (src.charCodeAt(end) === 96) end++;
1080
- const ticks = src.slice(index, end);
1081
- const close = src.indexOf(ticks, end);
1082
- if (close >= 0 && close < max) {
1083
- index = close + ticks.length - 1;
1084
- continue;
1085
- }
1086
- }
1087
- if (src[index] === "<" && !src.startsWith(needle, index)) {
1088
- let quote = "";
1089
- let close = -1;
1090
- for (let cursor = index + 1; cursor < max; cursor++) {
1091
- const char = src[cursor];
1092
- if (quote) {
1093
- if (char === "\\") cursor++;
1094
- else if (char === quote) quote = "";
1095
- } else if (char === "\"" || char === "'") quote = char;
1096
- else if (char === ">") {
1097
- close = cursor;
1098
- break;
1099
- }
1100
- }
1101
- if (close >= 0) {
1102
- index = close;
1103
- continue;
1104
- }
1105
- }
1106
- if (src[index] === "[") {
1107
- let label = -1;
1108
- let depth = 1;
1109
- for (let cursor = index + 1; cursor < max; cursor++) if (src[cursor] === "\\") cursor++;
1110
- else if (src[cursor] === "[") depth++;
1111
- else if (src[cursor] === "]" && --depth === 0) {
1112
- label = cursor;
1113
- break;
1114
- }
1115
- if (label >= 0 && label + 1 < max && src[label + 1] === "(") {
1116
- let depth = 1;
1117
- let close = label + 2;
1118
- for (; close < max && depth; close++) if (src[close] === "\\") close++;
1119
- else if (src[close] === "(") depth++;
1120
- else if (src[close] === ")") depth--;
1121
- if (!depth) {
1122
- index = close - 1;
1123
- continue;
1124
- }
1125
- }
1126
- }
1127
- if (src[index] === "*" || src[index] === "_") {
1128
- const marker = src[index];
1129
- let run = index + 1;
1130
- while (src[run] === marker) run++;
1131
- const close = src.indexOf(src.slice(index, run), run);
1132
- if (close >= 0 && close < max) {
1133
- index = close + (run - index) - 1;
1134
- continue;
1135
- }
1136
- }
1137
- if (src.startsWith(needle, index)) return index;
1138
- }
1139
- return -1;
1140
- }
1141
- const rule = (mode) => (state, silent) => {
1142
- const start = state.pos;
1143
- if (state.src.charCodeAt(start) !== 123) return false;
1144
- const opener = state.src.slice(start, start + 3);
1145
- const mark = MARKS.get(opener);
1146
- if (!mark) return false;
1147
- const from = start + 3;
1148
- const to = delimiter(state.src, from, state.posMax, mark.close);
1149
- if (to < 0 || to + 3 > state.posMax) {
1150
- if (silent) return false;
1151
- return problem(state, opener, {
1152
- rule: "comark/critic/unclosed-mark",
1153
- message: `critic \`${opener}\` has no closing \`${mark.close}\` in its paragraph; close it there, or write \`\\${opener}\` to keep the text.`
1154
- });
1155
- }
1156
- const arrow = mark.kind === "sub" ? delimiter(state.src, from, to, "~>") : -1;
1157
- if (mark.kind === "sub" && (arrow < 0 || arrow > to)) {
1158
- if (silent) return false;
1159
- return problem(state, opener, {
1160
- rule: "comark/critic/missing-arrow",
1161
- message: `critic \`{~~${state.src.slice(from, to)}~~}\` has no \`~>\` between the old and the new text; write \`{~~old~>new~~}\`.`
1162
- });
1163
- }
1164
- if (silent) {
1165
- state.pos = to + 3;
1166
- return true;
1167
- }
1168
- const view = mode === "view";
1169
- if (mark.kind === "sub") {
1170
- if (mode !== "accept") inline(state, from, arrow, view ? "del" : "", CLASSES.del);
1171
- if (mode !== "reject") inline(state, arrow + 2, to, view ? "ins" : "", CLASSES.ins);
1172
- } else if (mark.kind === "comment") {
1173
- if (view) inline(state, from, to, "span", COMMENT_CLASS);
1174
- } else if (mark.kind === "mark") inline(state, from, to, view ? "mark" : "", CLASSES.mark);
1175
- else if (view) inline(state, from, to, mark.kind, CLASSES[mark.kind]);
1176
- else if (mark.kind === "ins" === (mode === "accept")) inline(state, from, to);
1177
- state.pos = to + 3;
1178
- return true;
1179
- };
1180
- const markdownIt$2 = stable((mode) => (md) => {
1181
- addRule$2(md.inline.ruler, "before", ["comark_inline_props", "entity"], "critic", rule(mode));
1182
- });
1183
- const problems = /* @__PURE__ */ new WeakMap();
1184
- function collect(tokens, found) {
1185
- for (let index = tokens.length - 1; index >= 0; index--) {
1186
- const token = tokens[index];
1187
- if (!token) continue;
1188
- if (token.children) collect(token.children, found);
1189
- if (token.type === "mdc_inline_props" && token.attrGet("class")) {
1190
- let before = index - 1;
1191
- while (tokens[before]?.type === "text" && !tokens[before].content.trim()) before--;
1192
- const own = (tokens[before]?.meta)?.critic;
1193
- if (own) token.attrSet("class", `${own} ${token.attrGet("class")}`);
1194
- }
1195
- if (token.type !== PROBLEM) continue;
1196
- found.unshift({
1197
- rule: token.meta.rule,
1198
- message: token.content
1199
- });
1200
- tokens.splice(index, 1);
1201
- }
1202
- }
1203
- /**
1204
- * CriticMarkup: `{++inserted++}`, `{--deleted--}`, `{~~old~>new~~}`, `{==highlighted==}`, and `{>>comments<<}`, each
1205
- * inside one paragraph. `mode` shows the changes, or renders the document with them accepted or rejected.
1206
- */
1207
- var src_default$3 = defineComarkPlugin((options) => {
1208
- const asked = options?.mode ?? "view";
1209
- const mode = MODES.has(asked) ? asked : "view";
1210
- return {
1211
- name: "comark-critic",
1212
- markdownItPlugins: [markdownIt$2(mode)],
1213
- markdownItPost(state) {
1214
- const found = [];
1215
- collect(state.tokens, found);
1216
- problems.set(state, found);
1217
- },
1218
- post(state) {
1219
- const found = problems.get(state) ?? [];
1220
- if (mode !== asked) found.unshift({
1221
- rule: "comark/critic/invalid-mode",
1222
- message: `critic: \`mode\` must be "view", "accept", or "reject", not "${String(asked)}"; until then it shows the changes.`
1223
- });
1224
- if (!found.length) return;
1225
- const { meta } = state.tree;
1226
- meta.issues = [...meta.issues ?? [], ...found.map((issue) => issue.message)];
1227
- meta.issueRules = {
1228
- ...meta.issueRules,
1229
- ...Object.fromEntries(found.map((issue) => [issue.message, issue.rule]))
1230
- };
1231
- }
1232
- };
1233
- });
1234
- // ../../node_modules/.pnpm/comark-deflist@0.12.2_comark@0.9.2_katex@0.19.1_shiki@4.6.0_/node_modules/comark-deflist/dist/index.mjs
1235
- const BLOCK$1 = "blockquote";
1236
- /**
1237
- * Adds a rule before or after the first of `anchors` the parser has, else last. Comark's own rules exist only with
1238
- * its default plugins, and markdown-exit throws on a missing anchor, which would make every parse throw.
1239
- */
1240
- function addRule$1(ruler, place, anchors, name, fn, options) {
1241
- for (const anchor of anchors) try {
1242
- ruler[place](anchor, name, fn, options);
1243
- return;
1244
- } catch {}
1245
- ruler.push(name, fn, options);
1246
- }
1247
- const ddIndents = /* @__PURE__ */ new WeakMap();
1248
- /** The position after `:` or `~` and the space that must follow it, or -1 if the line doesn't start a definition. */
1249
- function skipMarker(state, line) {
1250
- let start = (state.bMarks[line] ?? 0) + (state.tShift[line] ?? 0);
1251
- const max = state.eMarks[line] ?? 0;
1252
- if (start >= max) return -1;
1253
- if ((state.sCount[line] ?? 0) - state.blkIndent >= 4) return -1;
1254
- const marker = state.src.charCodeAt(start++);
1255
- if (marker !== 126 && marker !== 58) return -1;
1256
- const pos = state.skipSpaces(start);
1257
- if (start === pos && pos < max) return -1;
1258
- return start;
1259
- }
1260
- const open = (state, tag, map) => {
1261
- const token = state.push(`${BLOCK$1}_open`, tag, 1);
1262
- token.map = map;
1263
- return token;
1264
- };
1265
- const close = (state, tag) => state.push(`${BLOCK$1}_close`, tag, -1);
1266
- /** Drops the paragraphs directly in a tight list's items, the way markdown-it hides them in a tight bullet list. */
1267
- function unwrapTight(state, from) {
1268
- const level = state.level + 2;
1269
- const { tokens } = state;
1270
- for (let index = tokens.length - 3; index > from; index--) {
1271
- const token = tokens[index];
1272
- if (token?.level !== level || token.type !== "paragraph_open") continue;
1273
- tokens.splice(index + 2, 1);
1274
- tokens.splice(index, 1);
1275
- }
1276
- }
1277
- function deflist(state, startLine, endLine, silent) {
1278
- if (silent) {
1279
- if ((ddIndents.get(state) ?? -1) < 0) return false;
1280
- return skipMarker(state, startLine) >= 0;
1281
- }
1282
- let nextLine = startLine + 1;
1283
- if (nextLine >= endLine) return false;
1284
- let termLoose = false;
1285
- if (state.isEmpty(nextLine)) {
1286
- termLoose = true;
1287
- if (++nextLine >= endLine) return false;
1288
- }
1289
- if ((state.sCount[nextLine] ?? 0) < state.blkIndent) return false;
1290
- let contentStart = skipMarker(state, nextLine);
1291
- if (contentStart < 0) return false;
1292
- const listIndex = state.tokens.length;
1293
- let tight = !termLoose;
1294
- const listLines = [startLine, 0];
1295
- open(state, "dl", listLines);
1296
- let dtLine = startLine;
1297
- let ddLine = nextLine;
1298
- outer: for (;;) {
1299
- let prevEmptyEnd = false;
1300
- open(state, "dt", [dtLine, dtLine]);
1301
- const inline = state.push("inline", "", 0);
1302
- inline.map = [dtLine, dtLine];
1303
- inline.content = state.getLines(dtLine, dtLine + 1, state.blkIndent, false).trim();
1304
- inline.children = [];
1305
- close(state, "dt");
1306
- for (;;) {
1307
- const itemLines = [nextLine, 0];
1308
- open(state, "dd", itemLines);
1309
- let pos = contentStart;
1310
- const max = state.eMarks[ddLine] ?? 0;
1311
- let offset = (state.sCount[ddLine] ?? 0) + contentStart - ((state.bMarks[ddLine] ?? 0) + (state.tShift[ddLine] ?? 0));
1312
- while (pos < max) {
1313
- const ch = state.src.charCodeAt(pos);
1314
- if (ch === 9) offset += 4 - offset % 4;
1315
- else if (ch === 32) offset++;
1316
- else break;
1317
- pos++;
1318
- }
1319
- contentStart = pos;
1320
- const saved = {
1321
- tight: state.tight,
1322
- ddIndent: ddIndents.get(state),
1323
- blkIndent: state.blkIndent,
1324
- tShift: state.tShift[ddLine] ?? 0,
1325
- sCount: state.sCount[ddLine] ?? 0,
1326
- parentType: state.parentType
1327
- };
1328
- state.blkIndent = (state.sCount[ddLine] ?? 0) + 2;
1329
- ddIndents.set(state, state.blkIndent);
1330
- state.tShift[ddLine] = contentStart - (state.bMarks[ddLine] ?? 0);
1331
- state.sCount[ddLine] = offset;
1332
- state.tight = true;
1333
- state.parentType = "deflist";
1334
- state.md.block.tokenize(state, ddLine, endLine);
1335
- if (!state.tight || prevEmptyEnd) tight = false;
1336
- prevEmptyEnd = state.line - ddLine > 1 && state.isEmpty(state.line - 1);
1337
- state.tShift[ddLine] = saved.tShift;
1338
- state.sCount[ddLine] = saved.sCount;
1339
- state.tight = saved.tight;
1340
- state.parentType = saved.parentType;
1341
- state.blkIndent = saved.blkIndent;
1342
- if (saved.ddIndent === void 0) ddIndents.delete(state);
1343
- else ddIndents.set(state, saved.ddIndent);
1344
- close(state, "dd");
1345
- itemLines[1] = nextLine = state.line;
1346
- if (nextLine >= endLine) break outer;
1347
- if ((state.sCount[nextLine] ?? 0) < state.blkIndent) break outer;
1348
- contentStart = skipMarker(state, nextLine);
1349
- if (contentStart < 0) break;
1350
- ddLine = nextLine;
1351
- }
1352
- if (nextLine >= endLine) break;
1353
- dtLine = nextLine;
1354
- if (state.isEmpty(dtLine)) break;
1355
- if ((state.sCount[dtLine] ?? 0) < state.blkIndent) break;
1356
- ddLine = dtLine + 1;
1357
- if (ddLine >= endLine) break;
1358
- if (state.isEmpty(ddLine)) {
1359
- tight = false;
1360
- ddLine++;
1361
- }
1362
- if (ddLine >= endLine) break;
1363
- if ((state.sCount[ddLine] ?? 0) < state.blkIndent) break;
1364
- contentStart = skipMarker(state, ddLine);
1365
- if (contentStart < 0) break;
1366
- }
1367
- close(state, "dl");
1368
- listLines[1] = nextLine;
1369
- state.line = nextLine;
1370
- if (tight) unwrapTight(state, listIndex);
1371
- return true;
1372
- }
1373
- const markdownIt$1 = (md) => addRule$1(md.block.ruler, "before", ["paragraph"], "deflist", deflist, { alt: [
1374
- "paragraph",
1375
- "reference",
1376
- "blockquote"
1377
- ] });
1378
- /**
1379
- * Definition lists: a term on one line, then one or more definitions that start with `: ` or `~ `, rendered as
1380
- * `<dl>`, `<dt>`, and `<dd>`. A definition's indented lines continue it, so it can hold paragraphs, lists, and code.
1381
- */
1382
- var src_default$2 = defineComarkPlugin(() => ({
1383
- name: "comark-deflist",
1384
- markdownItPlugins: [markdownIt$1]
1385
- }));
1386
- // ../../node_modules/.pnpm/comark-footnotes@0.12.2_comark@0.9.2_katex@0.19.1_shiki@4.6.0_/node_modules/comark-footnotes/dist/index.mjs
1387
- /**
1388
- * An inline element and a block element, by the prefix of their `_open` and `_close` types. Not `mdc_block_slot` for
1389
- * blocks: directly inside a `::component` Comark reads those as named slots and splits the block apart.
1390
- */
1391
- const SPAN = "mdc_inline_span";
1392
- const BLOCK = "blockquote";
1393
- /**
1394
- * Adds a rule before or after the first of `anchors` the parser has, else last. Comark's own rules exist only with
1395
- * its default plugins, and markdown-exit throws on a missing anchor, which would make every parse throw.
1396
- */
1397
- function addRule(ruler, place, anchors, name, fn, options) {
1398
- for (const anchor of anchors) try {
1399
- ruler[place](anchor, name, fn, options);
1400
- return;
1401
- } catch {}
1402
- ruler.push(name, fn, options);
1403
- }
1404
- const isElement$1 = (node) => Array.isArray(node) && node[0] !== null;
1405
- const DEF = "cfn-def:";
1406
- const REF = "cfn-ref:";
1407
- const NOTE = "cfn-note";
1408
- /** `[^label]: text`, with the lines indented under it, as a block that holds the definition's own blocks. */
1409
- function definition(state, startLine, endLine, silent) {
1410
- const start = (state.bMarks[startLine] ?? 0) + (state.tShift[startLine] ?? 0);
1411
- const max = state.eMarks[startLine] ?? 0;
1412
- if (start + 4 > max) return false;
1413
- if (state.src.charCodeAt(start) !== 91 || state.src.charCodeAt(start + 1) !== 94) return false;
1414
- let pos = start + 2;
1415
- for (; pos < max; pos++) {
1416
- const ch = state.src.charCodeAt(pos);
1417
- if (ch === 32) return false;
1418
- if (ch === 93) break;
1419
- }
1420
- if (pos === start + 2) return false;
1421
- if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 58) return false;
1422
- if (silent) return true;
1423
- pos++;
1424
- const label = state.src.slice(start + 2, pos - 2);
1425
- const open = state.push(`${BLOCK}_open`, DEF + label, 1);
1426
- open.map = [startLine, 0];
1427
- const saved = {
1428
- bMark: state.bMarks[startLine] ?? 0,
1429
- tShift: state.tShift[startLine] ?? 0,
1430
- sCount: state.sCount[startLine] ?? 0,
1431
- parentType: state.parentType
1432
- };
1433
- const afterColon = pos;
1434
- const initial = saved.sCount + pos - (saved.bMark + saved.tShift);
1435
- let offset = initial;
1436
- while (pos < max) {
1437
- const ch = state.src.charCodeAt(pos);
1438
- if (ch === 9) offset += 4 - offset % 4;
1439
- else if (ch === 32) offset++;
1440
- else break;
1441
- pos++;
1442
- }
1443
- state.tShift[startLine] = pos - afterColon;
1444
- state.sCount[startLine] = offset - initial;
1445
- state.bMarks[startLine] = afterColon;
1446
- state.blkIndent += 4;
1447
- state.parentType = "footnote";
1448
- if ((state.sCount[startLine] ?? 0) < state.blkIndent) state.sCount[startLine] = (state.sCount[startLine] ?? 0) + state.blkIndent;
1449
- state.md.block.tokenize(state, startLine, endLine);
1450
- state.parentType = saved.parentType;
1451
- state.blkIndent -= 4;
1452
- state.tShift[startLine] = saved.tShift;
1453
- state.sCount[startLine] = saved.sCount;
1454
- state.bMarks[startLine] = saved.bMark;
1455
- open.map[1] = state.line;
1456
- state.push(`${BLOCK}_close`, DEF + label, -1);
1457
- return true;
1458
- }
1459
- /** `[^label]`, as an empty span with the label. Whether a definition exists is decided in `post`, which reports it. */
1460
- function reference(state, silent) {
1461
- const start = state.pos;
1462
- const max = state.posMax;
1463
- if (start + 3 > max) return false;
1464
- if (state.src.charCodeAt(start) !== 91 || state.src.charCodeAt(start + 1) !== 94) return false;
1465
- let pos = start + 2;
1466
- for (; pos < max; pos++) {
1467
- const ch = state.src.charCodeAt(pos);
1468
- if (ch === 32 || ch === 10) return false;
1469
- if (ch === 93) break;
1470
- }
1471
- if (pos === start + 2 || pos >= max) return false;
1472
- const end = skipIncomplete(state, pos + 1);
1473
- const next = state.src.charCodeAt(end);
1474
- if (end === pos + 1 && (next === 40 || next === 91)) return false;
1475
- if (!silent) {
1476
- const tag = REF + state.src.slice(start + 2, pos);
1477
- state.push(`${SPAN}_open`, tag, 1);
1478
- state.push(`${SPAN}_close`, tag, -1);
1479
- }
1480
- state.pos = end;
1481
- return true;
1482
- }
1483
- /** `^[text]`, a note written where it applies, as a span holding the note's inline content. */
1484
- function inlineNote(state, silent) {
1485
- const start = state.pos;
1486
- const max = state.posMax;
1487
- if (start + 2 >= max) return false;
1488
- if (state.src.charCodeAt(start) !== 94 || state.src.charCodeAt(start + 1) !== 91) return false;
1489
- const end = state.md.helpers.parseLinkLabel(state, start + 1);
1490
- if (end < 0) return false;
1491
- if (!silent) {
1492
- state.push(`${SPAN}_open`, NOTE, 1);
1493
- state.pos = start + 2;
1494
- state.posMax = end;
1495
- state.md.inline.tokenize(state);
1496
- state.push(`${SPAN}_close`, NOTE, -1);
1497
- }
1498
- state.pos = skipIncomplete(state, end + 1);
1499
- state.posMax = max;
1500
- return true;
1501
- }
1502
- const INCOMPLETE = "(comark:incomplete-link)";
1503
- const skipIncomplete = (state, pos) => state.src.startsWith(INCOMPLETE, pos) ? pos + 24 : pos;
1504
- const markdownIt = (md) => {
1505
- addRule(md.block.ruler, "before", ["reference"], "footnote_def", definition, { alt: ["paragraph", "reference"] });
1506
- addRule(md.inline.ruler, "before", ["comark_inline_span", "link"], "footnote_inline", inlineNote);
1507
- addRule(md.inline.ruler, "before", ["comark_inline_span", "link"], "footnote_ref", reference);
1508
- };
1509
- const sanitizeLabel = (label) => label.replace(/[^a-zA-Z0-9_-]/g, (char) => `-${char.charCodeAt(0).toString(16)}-`);
1510
- /** The label after a marker's tag, or nothing for another element. */
1511
- const labelAfter = (marker, [tag]) => tag.startsWith(marker) ? tag.slice(marker.length) : void 0;
1512
- const childrenOf$1 = ([, , ...children]) => children;
1513
- const built = /* @__PURE__ */ new WeakMap();
1514
- const pending = /* @__PURE__ */ new WeakMap();
1515
- /** Takes every definition out of the tree, wherever it sits, keeping the first for each label and noting the repeats. */
1516
- function takeDefinitions(nodes, start, found, repeated) {
1517
- for (let index = nodes.length - 1; index >= start; index--) {
1518
- const node = nodes[index];
1519
- if (!isElement$1(node)) continue;
1520
- const label = labelAfter(DEF, node);
1521
- if (label !== void 0) {
1522
- nodes.splice(index, 1);
1523
- const content = childrenOf$1(node);
1524
- takeDefinitions(content, 0, found, repeated);
1525
- if (found.has(label)) repeated.add(label);
1526
- found.set(label, content);
1527
- continue;
1528
- }
1529
- takeDefinitions(node, 2, found, repeated);
1530
- }
1531
- }
1532
- /**
1533
- * Footnotes: `[^label]` references with `[^label]: …` definitions, which can run over indented lines and hold any
1534
- * blocks, and `^[inline notes]`. They're numbered in the order they're first referenced and listed at the end.
1535
- * It is named `footnotes`, so it takes the place of `comark/plugins/footnotes`, with the same nodes.
1536
- */
1537
- var src_default$1 = defineComarkPlugin((options) => {
1538
- const { label = "Footnotes", hr = true, backRef = "↩" } = options ?? {};
1539
- return {
1540
- name: "footnotes",
1541
- markdownItPlugins: [markdownIt],
1542
- post(state) {
1543
- const { tree } = state;
1544
- const issues = [];
1545
- const definitions = /* @__PURE__ */ new Map();
1546
- const repeated = /* @__PURE__ */ new Set();
1547
- takeDefinitions(tree.nodes, 0, definitions, repeated);
1548
- const notes = /* @__PURE__ */ new Map();
1549
- const missing = /* @__PURE__ */ new Set();
1550
- const ids = new Set([...definitions.keys()].map(sanitizeLabel));
1551
- let inline = 0;
1552
- const autoLabel = () => {
1553
- let next;
1554
- do
1555
- next = `note-${++inline}`;
1556
- while (definitions.has(next) || notes.has(next) || ids.has(sanitizeLabel(next)));
1557
- ids.add(sanitizeLabel(next));
1558
- return next;
1559
- };
1560
- const refTo = (key, content) => {
1561
- let note = notes.get(key);
1562
- if (!note) {
1563
- note = {
1564
- label: key,
1565
- id: sanitizeLabel(key),
1566
- content: content(),
1567
- refs: 0
1568
- };
1569
- notes.set(key, note);
1570
- }
1571
- const count = ++note.refs;
1572
- const sup = [
1573
- "sup",
1574
- { class: "footnote-ref" },
1575
- [
1576
- "a",
1577
- {
1578
- href: `#fn-${note.id}`,
1579
- id: count === 1 ? `fnref-${note.id}` : `fnref-${note.id}-${count}`
1580
- },
1581
- `[${[...notes.keys()].indexOf(key) + 1}]`
1582
- ]
1583
- ];
1584
- built.set(sup, {
1585
- label: key,
1586
- content: note.content
1587
- });
1588
- return sup;
1589
- };
1590
- const replace = (nodes, start) => {
1591
- for (let index = start; index < nodes.length; index++) {
1592
- const node = nodes[index];
1593
- const waiting = pending.get(nodes)?.get(index);
1594
- if (waiting !== void 0 && node === `[^${waiting}]`) {
1595
- const content = definitions.get(waiting);
1596
- if (content) {
1597
- nodes[index] = refTo(waiting, () => content);
1598
- pending.get(nodes)?.delete(index);
1599
- continue;
1600
- }
1601
- missing.add(waiting);
1602
- continue;
1603
- }
1604
- if (!isElement$1(node)) continue;
1605
- const [tag] = node;
1606
- const key = labelAfter(REF, node);
1607
- const previous = tag === "sup" ? built.get(node) : void 0;
1608
- if (key !== void 0) {
1609
- const content = definitions.get(key);
1610
- if (content) nodes[index] = refTo(key, () => content);
1611
- else {
1612
- nodes[index] = `[^${key}]`;
1613
- let entries = pending.get(nodes);
1614
- if (!entries) pending.set(nodes, entries = /* @__PURE__ */ new Map());
1615
- entries.set(index, key);
1616
- missing.add(key);
1617
- }
1618
- } else if (tag === NOTE) {
1619
- const content = childrenOf$1(node);
1620
- nodes[index] = refTo(autoLabel(), () => content);
1621
- } else if (previous) nodes[index] = refTo(previous.label, () => previous.content);
1622
- if (nodes[index] !== node) continue;
1623
- replace(node, 2);
1624
- }
1625
- };
1626
- replace(tree.nodes, 0);
1627
- for (const note of notes.values()) replace(note.content, 0);
1628
- for (const key of missing) issues.push({
1629
- rule: "comark/footnotes/missing-definition",
1630
- message: `footnotes: [^${key}] has no definition; add a "[^${key}]: …" line, or remove the reference.`
1631
- });
1632
- for (const key of definitions.keys()) if (!notes.has(key)) issues.push({
1633
- rule: "comark/footnotes/unused-definition",
1634
- message: `footnotes: [^${key}]: is never referenced; add [^${key}] where it applies, or remove the definition.`
1635
- });
1636
- for (const key of repeated) issues.push({
1637
- rule: "comark/footnotes/duplicate-definition",
1638
- message: `footnotes: [^${key}]: is defined more than once, and only the first shows; give the others their own labels, or remove them.`
1639
- });
1640
- if (issues.length) {
1641
- tree.meta.issues = [...tree.meta.issues ?? [], ...issues.map((issue) => issue.message)];
1642
- tree.meta.issueRules = {
1643
- ...tree.meta.issueRules,
1644
- ...Object.fromEntries(issues.map((issue) => [issue.message, issue.rule]))
1645
- };
1646
- }
1647
- if (!notes.size) return;
1648
- const items = [...notes.values()].map((note) => {
1649
- const backrefs = Array.from({ length: note.refs }, (_, index) => [" ", [
1650
- "a",
1651
- {
1652
- href: index ? `#fnref-${note.id}-${index + 1}` : `#fnref-${note.id}`,
1653
- class: "footnote-backref"
1654
- },
1655
- backRef
1656
- ]]).flat();
1657
- const content = [...note.content];
1658
- const last = content.at(-1);
1659
- if (isElement$1(last) && last[0] === "p") content[content.length - 1] = [...last, ...backrefs];
1660
- else content.push(...backrefs);
1661
- return [
1662
- "li",
1663
- { id: `fn-${note.id}` },
1664
- ...content
1665
- ];
1666
- });
1667
- const rule = hr ? [["hr", {}]] : [];
1668
- const heading = label ? [[
1669
- "h2",
1670
- { id: "footnotes" },
1671
- label
1672
- ]] : [];
1673
- tree.nodes.push([
1674
- "section",
1675
- { class: "footnotes" },
1676
- ...rule,
1677
- ...heading,
1678
- [
1679
- "ol",
1680
- { class: "footnotes-list" },
1681
- ...items
1682
- ]
1683
- ]);
1684
- }
1685
- };
1686
- });
1687
- // ../../node_modules/.pnpm/comark-ui@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__@tiptap+core@3.35.0_@tipt_cf2f734d482ac6e082eda4effd9c073f/node_modules/comark-ui/dist/shiki-Cmp4i7wq.mjs
1688
- const swap = (span) => `${span}[style*="--shiki-dark:"]{color:var(--shiki-dark)!important}${span}[style*="--shiki-dark-font-style:"]{font-style:var(--shiki-dark-font-style)!important}${span}[style*="--shiki-dark-font-weight:"]{font-weight:var(--shiki-dark-font-weight)!important}`;
1689
- const shikiDark = swap(".shiki:where(.dark *) span") + `@media (prefers-color-scheme:dark){${swap(".shiki:not(:where(.light *)) span")}}`;
1690
- // ../../node_modules/.pnpm/comark-zoom@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__comark@0.9.2_katex@0.19_8b37b27720701328cc09141583dacf0f/node_modules/comark-zoom/dist/theme.mjs
1691
- const tokens$1 = [
1692
- [
1693
- "background",
1694
- "ui-bg",
1695
- "background",
1696
- "#fff",
1697
- "#0a0a0a"
1698
- ],
1699
- [
1700
- "foreground",
1701
- "ui-text-highlighted",
1702
- "foreground",
1703
- "#0a0a0a",
1704
- "#fafafa"
1705
- ],
1706
- [
1707
- "muted",
1708
- "ui-text-muted",
1709
- "muted-foreground",
1710
- "#737373",
1711
- "#a1a1a1"
1712
- ],
1713
- [
1714
- "border",
1715
- "ui-border",
1716
- "border",
1717
- "#e5e5e5",
1718
- "rgb(255 255 255/.1)"
1719
- ],
1720
- [
1721
- "accent",
1722
- "ui-bg-elevated",
1723
- "accent",
1724
- "#f5f5f5",
1725
- "#262626"
1726
- ],
1727
- [
1728
- "ring",
1729
- "ui-primary",
1730
- "ring",
1731
- "#a1a1a1",
1732
- "#737373"
1733
- ]
1734
- ];
1735
- const groups$1 = {
1736
- status: Object.values({
1737
- success: [
1738
- "success",
1739
- "ui-success",
1740
- "success",
1741
- "#259f56",
1742
- "#59d38c"
1743
- ],
1744
- danger: [
1745
- "danger",
1746
- "ui-error",
1747
- "destructive",
1748
- "#ee3533",
1749
- "#fd736d"
1750
- ],
1751
- warning: [
1752
- "warning",
1753
- "ui-warning",
1754
- "",
1755
- "#d57506",
1756
- "#fbbf24"
1757
- ],
1758
- info: [
1759
- "info",
1760
- "ui-info",
1761
- "",
1762
- "#2563eb",
1763
- "#60a5fa"
1764
- ]
1765
- }),
1766
- primary: [
1767
- [
1768
- "primary",
1769
- "ui-primary",
1770
- "primary",
1771
- "var(--_comark-foreground)",
1772
- "var(--_comark-foreground)"
1773
- ],
1774
- [
1775
- "primary-foreground",
1776
- "ui-text-inverted",
1777
- "primary-foreground",
1778
- "var(--_comark-background)",
1779
- "var(--_comark-background)"
1780
- ],
1781
- [
1782
- "secondary",
1783
- "ui-secondary",
1784
- "",
1785
- "var(--_comark-muted)",
1786
- "var(--_comark-muted)"
1787
- ]
1788
- ],
1789
- shadow: [[
1790
- "shadow",
1791
- "",
1792
- "",
1793
- "0 4px 12px rgb(0 0 0/.12)",
1794
- "0 4px 12px rgb(0 0 0/.5)"
1795
- ]]
1796
- };
1797
- const chain$1 = (token, scheme) => {
1798
- const shadcn = token[2] ? `var(--${token[2]},${token[scheme]})` : token[scheme];
1799
- const nuxt = token[1] ? `var(--${token[1]},${shadcn})` : shadcn;
1800
- return `var(--comark-${token[0]},${nuxt})`;
1801
- };
1802
- const resolve$1 = (list, scheme) => list.map((token) => `--_comark-${token[0]}:${chain$1(token, scheme)}`).join(";");
1803
- /**
1804
- * `declarations` on `selector` in dark mode: the system's, unless a `.light` class sits on the element or above it, or
1805
- * a `.dark` class there whatever the system says. Either class pins a page's scheme.
1806
- */
1807
- function dark$1(selector, declarations) {
1808
- return `@media (prefers-color-scheme:dark){:where(:not(.light,.light *)):is(${selector}){${declarations}}}:where(.dark,.dark *):is(${selector}){${declarations}}`;
1809
- }
1810
- /**
1811
- * Resolves the `--comark-*` tokens on `selector`, falling back to Nuxt UI's variables, then shadcn/ui's, then shadcn's
1812
- * neutral theme. Nuxt UI's corners are twice its `--ui-radius`, so the radius halves shadcn's to double it back. The
1813
- * halving sits in the `var()` fallback without a `calc()` of its own, which reads the same once the fallback is
1814
- * substituted, because postcss-calc, which cssnano runs, can't parse a `calc()` there.
1815
- * They resolve on the component rather than `:root`, so a `--comark-*` set on any ancestor still inherits down.
1816
- * `:where()` keeps them at zero specificity. The neutral theme follows the system's color mode, and a `.light` or
1817
- * `.dark` class on the component or above it pins one (see `dark()`).
1818
- *
1819
- * Every block gets the core tokens. Name `"status"` for `--comark-success`, `-danger`, `-warning`, and `-info`,
1820
- * `"primary"` for `--comark-primary`, `-primary-foreground`, and `-secondary`, and `"shadow"` for `--comark-shadow`, so
1821
- * a block that never draws them doesn't carry them.
1822
- */
1823
- function theme$1(selector, ...extras) {
1824
- const where = `:where(${selector})`;
1825
- const list = [...tokens$1, ...extras.flatMap((name) => groups$1[name])];
1826
- return `${where}{${resolve$1(list, 3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,var(--radius,.625rem)/2)*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}` + dark$1(where, resolve$1(list, 4));
1827
- }
1828
- // ../../node_modules/.pnpm/comark-ui@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__@tiptap+core@3.35.0_@tipt_cf2f734d482ac6e082eda4effd9c073f/node_modules/comark-ui/dist/typeset-css-3FlP5Npq.mjs
1829
- const grain = `url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E")`;
1830
- const own = ":where(.not-typeset, [data-not-typeset], .not-typeset *, [data-not-typeset] *)";
1831
- const rules = `
1832
- :scope {
1833
- --_ty-flow: var(--typeset-flow, 1.25em);
1834
- --_ty-muted: var(--_comark-muted);
1835
- --_ty-rule: var(--_comark-border);
1836
- --_ty-surface: var(--_comark-accent);
1837
- --_ty-radius: calc(var(--_comark-radius) * 0.8);
1838
- --_ty-mono: var(--comark-font-mono, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace));
1839
- font-family: var(--_comark-font);
1840
- font-size: calc(var(--typeset-size, 1em) * 1.125);
1841
- line-height: var(--typeset-leading, 1.75);
1842
- color: var(--_comark-foreground);
1843
- overflow-wrap: break-word;
1844
- /* T3 Code's grain, painted into the document's own background rather than a fixed overlay, which the compositor
1845
- would blend again on every animated frame. It sits over any background color the page gives this element. */
1846
- background-image: var(--comark-grain, ${grain});
1847
- background-repeat: repeat;
1848
- background-size: var(--comark-grain-size, 256px 256px);
1849
- @media (min-width: 48rem), print {
1850
- font-size: var(--typeset-size, 1em);
1851
- }
1852
- }
1853
-
1854
- :scope *:not(${own}) {
1855
- &:where(p) { margin-block: var(--_ty-flow) 0; }
1856
-
1857
- &:where(h1, h2, h3, h4, h5, h6) {
1858
- color: var(--_comark-foreground);
1859
- font-family: var(--comark-font-heading, var(--font-heading, inherit));
1860
- font-weight: 600;
1861
- margin-block-end: 0;
1862
- }
1863
- &:where(h1) { font-size: 1.75em; line-height: 1.3; margin-block-start: var(--_ty-flow); }
1864
- &:where(h2) { font-size: 1.25em; line-height: 1.4; margin-block-start: calc(var(--_ty-flow) * 1.4); }
1865
- &:where(h3) { font-size: 1.125em; line-height: 1.45; margin-block-start: var(--_ty-flow); }
1866
- &:where(h4) { font-size: 1em; line-height: 1.5; margin-block-start: var(--_ty-flow); }
1867
- &:where(h5) {
1868
- font-size: 0.875em; line-height: 1.5; font-weight: 500; color: var(--_ty-muted);
1869
- margin-block-start: calc(var(--_ty-flow) / 0.875);
1870
- }
1871
- &:where(h6) {
1872
- font-size: 0.8125em; line-height: 1.5; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
1873
- color: var(--_ty-muted); margin-block-start: calc(var(--_ty-flow) / 0.8125);
1874
- }
1875
- &:where([id]) { scroll-margin-block-start: var(--_ty-flow); }
1876
- /* Headings own the space below them. */
1877
- &:where(h1 + *, h2 + *, h3 + *, h4 + *, h5 + *, h6 + *) { margin-block-start: 1em; }
1878
- &:where(:is(h1, h2, h3, h4) code) { font-size: 0.9em; }
1879
-
1880
- &:where(a) {
1881
- color: inherit;
1882
- font-weight: 500;
1883
- text-decoration-line: underline;
1884
- text-decoration-color: color-mix(in oklab, currentColor 30%, transparent);
1885
- }
1886
- &:where(a:hover) { text-decoration-color: currentColor; }
1887
- &:where(a:focus-visible) { outline: 2px solid var(--_comark-ring); outline-offset: 2px; border-radius: 0.125em; }
1888
- &:where(:is(h1, h2, h3, h4, h5, h6) a) { font-weight: inherit; }
1889
-
1890
- &:where(strong, b) { font-weight: 600; }
1891
- &:where(mark) {
1892
- background-color: color-mix(in oklab, oklch(0.86 0.17 95) 40%, transparent);
1893
- color: inherit; padding: 0.05em 0.15em; border-radius: 0.2em;
1894
- }
1895
- &:where(abbr[title]) {
1896
- text-decoration-line: underline; text-decoration-style: dotted; text-underline-offset: 0.2em; cursor: help;
1897
- }
1898
- &:where(del, s) { color: var(--_ty-muted); text-decoration-line: line-through; }
1899
- &:where(sup, sub) { font-size: 0.75em; line-height: 0; position: relative; vertical-align: baseline; }
1900
- &:where(sup) { top: -0.5em; }
1901
- &:where(sub) { bottom: -0.25em; }
1902
- &:where(sup a) { text-decoration-line: none; font-weight: 500; }
1903
-
1904
- &:where(ul) { list-style-type: disc; }
1905
- &:where(ol) { list-style-type: decimal; }
1906
- &:where(ul ul) { list-style-type: circle; }
1907
- &:where(ul ul ul) { list-style-type: square; }
1908
- &:where(ol[type="a" i]) { list-style-type: lower-alpha; }
1909
- &:where(ol[type="i" i]) { list-style-type: lower-roman; }
1910
- &:where(ol[type="A" s]) { list-style-type: upper-alpha; }
1911
- &:where(ol[type="I" s]) { list-style-type: upper-roman; }
1912
- &:where(ul, ol) { margin-block: var(--_ty-flow) 0; padding-inline-start: 1.5em; }
1913
- &:where(li) { margin-block-start: 0.5em; padding-inline-start: 0.4em; }
1914
- &:where(li > p, li > ul, li > ol) { margin-block-start: 0.5em; }
1915
- &:where(ul > li, ol > li)::marker { color: var(--_ty-muted); }
1916
- &:where(ul.contains-task-list) { list-style-type: none; padding-inline-start: 0.25em; }
1917
- &:where(li.task-list-item > input[type="checkbox"]) {
1918
- margin-inline-end: 0.5em; vertical-align: -0.1em; accent-color: var(--_comark-primary);
1919
- }
1920
-
1921
- &:where(details) { margin-block: var(--_ty-flow) 0; }
1922
- &:where(summary) { cursor: pointer; font-weight: 500; }
1923
- &:where(summary)::marker { color: var(--_ty-muted); }
1924
-
1925
- &:where(kbd) {
1926
- font-family: inherit; font-size: 0.85em; font-weight: 500;
1927
- border: 1px solid var(--_ty-rule); border-block-end-width: 2px; border-radius: 0.35em; padding: 0.0625em 0.35em;
1928
- }
1929
-
1930
- &:where(dl) { margin-block: var(--_ty-flow) 0; }
1931
- &:where(dt) { font-weight: 500; margin-block-start: 1em; }
1932
- &:where(dt + dt) { margin-block-start: 0.25em; }
1933
- &:where(dd) { margin-block-start: 0.25em; margin-inline-start: 0; padding-inline-start: 1em; color: var(--_ty-muted); }
1934
-
1935
- &:where(:not(pre) > code) {
1936
- background-color: var(--_ty-surface); font-family: var(--_ty-mono); font-size: 0.85em;
1937
- border-radius: 0.35em; padding: 0.125em 0.3em;
1938
- }
1939
- &:where(pre) {
1940
- background-color: var(--_ty-surface); font-family: var(--_ty-mono); font-size: 0.875em; line-height: 1.5;
1941
- tab-size: 2; direction: ltr; border-radius: var(--_ty-radius); padding: 0.75em 1em; overflow-x: auto;
1942
- margin-block: calc(var(--_ty-flow) / 0.875) 0;
1943
- }
1944
- &:where(pre code) { background-color: transparent; font-family: inherit; font-size: inherit; padding: 0; border-radius: 0; }
1945
-
1946
- &:where(blockquote) {
1947
- border-inline-start: 2px solid var(--_ty-rule); padding-inline-start: 1em; margin-block: var(--_ty-flow) 0;
1948
- margin-inline: 0;
1949
- }
1950
-
1951
- &:where(hr) { border: 0; border-block-start: 1px solid var(--_ty-rule); margin-block: calc(var(--_ty-flow) * 2.4) 0; }
1952
- &:where(hr + h1, hr + h2, hr + h3, hr + h4) { margin-block-start: var(--_ty-flow); }
1953
-
1954
- /* comark-footnotes opens the section with its own rule and heading, so the section adds none. */
1955
- &:where(.footnotes, [data-footnotes]) {
1956
- margin-block-start: calc(var(--_ty-flow) * 2); font-size: 0.875em; color: var(--_ty-muted);
1957
- }
1958
- &:where(.footnotes > hr:first-child) { margin-block-start: 0; }
1959
- &:where(.footnote-ref a, .footnote-backref) { text-decoration-line: none; }
1960
-
1961
- &:where(math[display="block"]) {
1962
- margin-block: var(--_ty-flow) 0; overflow-x: auto; overflow-y: hidden; padding-block: 0.25em;
1963
- }
1964
-
1965
- &:where(img, video) { border-radius: var(--_ty-radius); max-width: 100%; height: auto; margin-block: var(--_ty-flow) 0; }
1966
- /* An image in a line of text sits on the text; a block's top margin would push it below. */
1967
- &:where(:is(p, li, td, th, a) img) { margin-block-start: 0; }
1968
- &:where(figure) { margin-block: var(--_ty-flow) 0; margin-inline: 0; }
1969
- &:where(figcaption, caption) {
1970
- color: var(--_ty-muted); font-size: 0.875em; text-align: center; margin-block-start: calc(0.75em / 0.875);
1971
- }
1972
- &:where(caption) { caption-side: bottom; }
1973
-
1974
- /* A table scrolls inside the column when it can't fit, as on GitHub, and its headers wrap like its cells. Separators
1975
- sit on cells, not on the last row, so appending a row keeps them. */
1976
- &:where(table) {
1977
- display: block; width: max-content; max-width: 100%; overflow-x: auto; font-size: 1em; line-height: 1.5;
1978
- font-variant-numeric: tabular-nums; border-collapse: separate; border-spacing: 0;
1979
- border-block-end: 1px solid var(--_ty-rule); margin-block: var(--_ty-flow) 0;
1980
- }
1981
- &:where(thead th) { font-weight: 500; text-align: start; padding: 0.65em 1em; }
1982
- &:where(:is(tbody, tfoot) :is(td, th)) {
1983
- padding: 0.75em 1em; text-align: start; vertical-align: top; border-block-start: 1px solid var(--_ty-rule);
1984
- }
1985
- &:where(tbody th, tfoot th) { font-weight: 500; }
1986
- &:where(th:first-child, td:first-child) { padding-inline-start: 0; }
1987
- &:where(th[align="center"], td[align="center"]) { text-align: center; }
1988
- &:where(th[align="right"], td[align="right"]) { text-align: end; }
1989
-
1990
- /* Blocks inside list items keep the list's tighter rhythm. */
1991
- &:where(li > blockquote, li > table, li > figure) { margin-block-start: 0.5em; }
1992
- &:where(li > pre) { margin-block-start: calc(0.5em / 0.875); }
1993
-
1994
- @media print {
1995
- &:where(pre, table, blockquote, figure) { break-inside: avoid; }
1996
- &:where(h1, h2, h3, h4) { break-after: avoid; }
1997
- }
1998
- /* Forced colors strips the code background, so give it a border. */
1999
- @media (forced-colors: active) {
2000
- &:where(:not(pre) > code) { border: 1px solid; }
2001
- }
2002
- }
2003
-
2004
- /* A block marked data-wide, such as a before/after comparison or a diagram wider than the text, grows past the column
2005
- into the room the page gives it on each side, --comark-wide-start and --comark-wide-end, up to its own width
2006
- (--comark-wide-width) and --comark-wide-max. It stays centered on the column while both sides have room, and moves
2007
- toward the side that has more when one doesn't. Without room set, it keeps to the column. Only the document's own
2008
- blocks grow, not one inside a list or tabs. A heading right above a comparison grows with it, so it starts where
2009
- Before does and reads as its title. comark-links may wrap the heading, and the comparison's styles may sit between them. */
2010
- :scope > [data-wide],
2011
- :scope > :is(h2, h3, h4, .cl-heading:has(> :is(h2, h3, h4))):has(+ .ca-compare, + style + .ca-compare) {
2012
- /* Room a page works out from the window can come out negative on a phone, where the column fills it: none, then. */
2013
- --_ty-start: max(0px, var(--comark-wide-start, 0px));
2014
- --_ty-end: max(0px, var(--comark-wide-end, 0px));
2015
- --_ty-wide: max(100%, min(var(--comark-wide-width, 100vw), var(--comark-wide-max, 72rem), 100% + var(--_ty-start) + var(--_ty-end)));
2016
- width: var(--_ty-wide);
2017
- margin-inline: clamp(-1 * var(--_ty-start), (100% - var(--_ty-wide)) / 2, 100% + var(--_ty-end) - var(--_ty-wide)) 0;
2018
- }
2019
-
2020
- /* The first child adds no space above. Last, so it wins ties. */
2021
- :scope > :where(:first-child):not(${own}),
2022
- :scope > :where(:first-child) > :where(:first-child):not(${own}),
2023
- :scope :where(
2024
- li > :first-child, blockquote > :first-child, td > :first-child, th > :first-child, dd > :first-child,
2025
- figure > :first-child, figure > picture > img
2026
- ):not(${own}) {
2027
- margin-block-start: 0;
2028
- }
2029
- `;
2030
- /**
2031
- * The text around the blocks: headings, paragraphs, lists, tables, code, and quotes. `@scope` with no selector styles
2032
- * the element the `<style>` sits in, so the document carries its own look into any page and leaves the rest of the
2033
- * page alone. The `typeset` layer sits inside `comark`, so every block's own rules win over it, and any plain rule of
2034
- * the page wins over both.
2035
- */
2036
- const typesetCss = `@layer comark{@layer typeset{@scope{${theme$1(":scope", "primary")}${rules}${shikiDark}}}}`.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/ ?([{};,>(]) ?/g, "$1").replace(/: /g, ":").trim();
2037
- // ../../node_modules/.pnpm/comark-ui@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__@tiptap+core@3.35.0_@tipt_cf2f734d482ac6e082eda4effd9c073f/node_modules/comark-ui/dist/styles-vZMqDkIY.mjs
2038
- /**
2039
- * Adds a package's styles to the page once, unless the page already carries them as a `style` or a `link` with
2040
- * `data-comark-<name>`, which is how the HTML renderer inlines them and how an app that imports `style.css` marks them.
2041
- */
2042
- function addStyles$2(name, css) {
2043
- const attribute = `data-comark-${name}`;
2044
- if (document.querySelector(`style[${attribute}],link[${attribute}]`)) return;
2045
- const style = document.createElement("style");
2046
- style.setAttribute(attribute, "");
2047
- style.textContent = css;
2048
- document.head.append(style);
2049
- }
2050
- // ../../node_modules/.pnpm/comark-ui@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__@tiptap+core@3.35.0_@tipt_cf2f734d482ac6e082eda4effd9c073f/node_modules/comark-ui/dist/text-BaJTbiwp.mjs
2051
- /**
2052
- * A prop value as text. Comark writes strings, numbers, and booleans, so an object, array, function, or missing value
2053
- * is no text. The `typeof` check, unlike `instanceof`, can't throw on a revoked proxy.
2054
- */
2055
- function scalar(value) {
2056
- switch (typeof value) {
2057
- case "string": return value;
2058
- case "number":
2059
- case "boolean":
2060
- case "bigint":
2061
- case "symbol": return String(value);
2062
- default: return;
2063
- }
2064
- }
2065
- /** A prop value as text exactly as written, or empty when it has none. */
2066
- const rawText = (value) => scalar(value) ?? "";
2067
- /** FNV-1a, in base 36: short, and the same every time the same text is hashed, so ids derived from it are stable. */
2068
- function hash(source) {
2069
- let value = 2166136261;
2070
- for (let at = 0; at < source.length; at++) value = Math.imul(value ^ source.charCodeAt(at), 16777619);
2071
- return (value >>> 0).toString(36);
2072
- }
2073
- // ../../node_modules/.pnpm/comark-properties@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__comark@0.9.2_kate_59411aee8c5739dfe2d5ce1e917d29ab/node_modules/comark-properties/dist/src-DQfL0wbb.mjs
2074
- const isElement = (node) => Array.isArray(node) && node[0] !== null;
2075
- const childrenOf = ([, , ...rest]) => rest;
2076
- const KEYS = [
2077
- "status",
2078
- "pr",
2079
- "author",
2080
- "date",
2081
- "tags"
2082
- ];
2083
- const LABELS = /* @__PURE__ */ new Map([["pr", "PR"], ["url", "URL"]]);
2084
- const REFERENCE = /^https:\/\/(?:www\.)?(?:github\.com|gitlab\.com)\/([\w.-]+\/[\w.-]+)\/(?:-\/)?(?:pull|issues|merge_requests)\/(\d+)\/?(?:[?#].*)?$/;
2085
- const isContent = (node) => Array.isArray(node) ? node[0] !== null : node.trim() !== "";
2086
- const labelOf = (key, labels) => labels[key] ?? LABELS.get(key) ?? (key.charAt(0).toUpperCase() + key.slice(1)).replace(/[-_]+/g, " ");
2087
- function link(href) {
2088
- const reference = REFERENCE.exec(href);
2089
- const url = new URL(href);
2090
- const text = reference ? `${reference[1]}#${reference[2]}` : `${url.host.replace(/^www\./, "")}${url.pathname === "/" ? "" : url.pathname}`;
2091
- return [
2092
- "a",
2093
- { href: url.href },
2094
- text
2095
- ];
2096
- }
2097
- const DAY = /^\d{4}-\d{2}-\d{2}$/;
2098
- const KINDS = /* @__PURE__ */ new Map([
2099
- ["status", "status"],
2100
- ["pr", "pr"],
2101
- ["author", "person"],
2102
- ["date", "date"],
2103
- ["tags", "tags"]
2104
- ]);
2105
- /** What the row's icon shows: the key's own for the default keys, otherwise one for the kind of value. */
2106
- function kindOf(key, value) {
2107
- const own = KINDS.get(key);
2108
- if (own) return own;
2109
- if (Array.isArray(value)) return "tags";
2110
- if (Number(value) === value) return "number";
2111
- if (value === true || value === false) return "boolean";
2112
- const text = String(value);
2113
- if (DAY.test(text)) return "date";
2114
- return /^https?:\/\//.test(text) ? "link" : "text";
2115
- }
2116
- /** `2026-10-23` as `Oct 23, 2026`, in a `time` that keeps the date for machines. */
2117
- function day(text, locale) {
2118
- const date = /* @__PURE__ */ new Date(`${text}T00:00:00Z`);
2119
- if (Number.isNaN(date.getTime()) || date.toISOString().slice(0, 10) !== text) return [
2120
- "span",
2121
- {},
2122
- text
2123
- ];
2124
- const shown = date.toLocaleDateString(locale ?? "en-US", {
2125
- month: "short",
2126
- day: "numeric",
2127
- year: "numeric",
2128
- timeZone: "UTC"
2129
- });
2130
- return [
2131
- "time",
2132
- locale ? {
2133
- datetime: text,
2134
- lang: locale
2135
- } : { datetime: text },
2136
- shown
2137
- ];
2138
- }
2139
- /** A frontmatter value as nodes: text, a link for an http(s) URL, or one tag per item of a list of those. */
2140
- function valueOf(value, nested = false) {
2141
- if (Array.isArray(value)) {
2142
- if (nested) return;
2143
- const items = value.map((item) => valueOf(item, true));
2144
- if (items.some((item) => item === void 0)) return;
2145
- return items.map((item) => [
2146
- "span",
2147
- { class: "cfm-tag" },
2148
- ...item ?? []
2149
- ]);
2150
- }
2151
- if (value === void 0 || value === null || value instanceof Object) return;
2152
- const text = String(value);
2153
- return /^https?:\/\/\S+$/.test(text) && URL.canParse(text) ? [link(text)] : [text];
2154
- }
2155
- /**
2156
- * The rows of the properties box for a document's frontmatter, as `div` nodes of a `dt` and a `dd`, and a problem for
2157
- * each value it can't show. An editor uses it to show the same box above the text.
2158
- */
2159
- function rowsOf(frontmatter, options = {}) {
2160
- const keys = options.keys ?? KEYS;
2161
- const labels = options.labels ?? {};
2162
- const issues = [];
2163
- const rows = [];
2164
- let locale = options.locale;
2165
- if (locale !== void 0) try {
2166
- Intl.getCanonicalLocales(locale);
2167
- } catch {
2168
- locale = void 0;
2169
- issues.push({
2170
- rule: "comark/properties/invalid-locale",
2171
- message: "properties: `locale` is not a valid language tag, so dates use the reader's locale. Use a tag such as `de-DE`, or leave `locale` unset."
2172
- });
2173
- }
2174
- for (const key of keys) {
2175
- const value = frontmatter[key];
2176
- if (value === void 0 || value === null || value === "" || Array.isArray(value) && value.length === 0) continue;
2177
- const nodes = valueOf(value);
2178
- if (!nodes) {
2179
- issues.push({
2180
- rule: "comark/properties/invalid-value",
2181
- message: `properties: \`${key}\` in the frontmatter is neither text, a number, a link, nor a list of them, so it isn't shown. Write it as one of those.`
2182
- });
2183
- continue;
2184
- }
2185
- const kind = kindOf(key, value);
2186
- const text = Array.isArray(value) ? void 0 : String(value);
2187
- const shown = kind === "status" && text !== void 0 ? [[
2188
- "span",
2189
- { class: "cfm-status" },
2190
- ...nodes
2191
- ]] : kind === "date" && text !== void 0 && DAY.test(text) ? [day(text, locale)] : nodes;
2192
- rows.push([
2193
- "div",
2194
- {
2195
- "data-key": key,
2196
- "data-kind": kind
2197
- },
2198
- [
2199
- "dt",
2200
- {},
2201
- labelOf(key, labels)
2202
- ],
2203
- [
2204
- "dd",
2205
- {},
2206
- ...shown
2207
- ]
2208
- ]);
2209
- }
2210
- return {
2211
- rows,
2212
- issues
2213
- };
2214
- }
2215
- /**
2216
- * Shows chosen frontmatter keys, such as a review document's status, pull request, author, date, and tags, as a box of
2217
- * properties where `::properties` sits, or at the top of the document. Problems are added to `meta.issues`.
2218
- */
2219
- var src_default = defineComarkPlugin((options = {}) => ({
2220
- name: "comark-properties",
2221
- post(state) {
2222
- const { tree } = state;
2223
- const keys = options.keys ?? KEYS;
2224
- const { rows, issues } = rowsOf(tree.frontmatter, options);
2225
- let placed = 0;
2226
- const walk = (nodes, start) => {
2227
- for (let index = start; index < nodes.length; index++) {
2228
- const node = nodes[index];
2229
- if (!node || !isElement(node)) continue;
2230
- if (node[0] !== "properties") {
2231
- walk(node, 2);
2232
- continue;
2233
- }
2234
- const name = `\`::properties\` ${++placed}`;
2235
- if (childrenOf(node).some(isContent)) issues.push({
2236
- rule: "comark/properties/content-dropped",
2237
- message: `${name} drops the content inside it. Close the block with \`::\` on the line after it, and write text outside it.`
2238
- });
2239
- for (const key of Object.keys(node[1])) {
2240
- const prop = key.replace(/^:/, "");
2241
- if (prop !== "id" && prop !== "class") issues.push({
2242
- rule: "comark/properties/unknown-prop",
2243
- message: `${name}: \`${prop}\` isn't a prop of \`::properties\`, so it's ignored. Choose the keys with the plugin's \`keys\` option.`
2244
- });
2245
- }
2246
- if (!rows.length) issues.push({
2247
- rule: "comark/properties/nothing-to-show",
2248
- message: `${name} has nothing to show: the frontmatter has none of ${keys.map((key) => `\`${key}\``).join(", ")}. Add one, or remove the block.`
2249
- });
2250
- nodes[index] = [
2251
- "properties",
2252
- {},
2253
- ...rows
2254
- ];
2255
- }
2256
- };
2257
- walk(tree.nodes, 0);
2258
- if (!placed && rows.length && options.top !== false) tree.nodes.unshift([
2259
- "properties",
2260
- {},
2261
- ...rows
2262
- ]);
2263
- tree.meta.issues = [...tree.meta.issues ?? [], ...issues.map((issue) => issue.message)];
2264
- tree.meta.issueRules = {
2265
- ...tree.meta.issueRules,
2266
- ...Object.fromEntries(issues.map((issue) => [issue.message, issue.rule]))
2267
- };
2268
- }
2269
- }));
2270
- // ../../node_modules/.pnpm/comark-properties@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__comark@0.9.2_kate_59411aee8c5739dfe2d5ce1e917d29ab/node_modules/comark-properties/dist/client-BK9vCkqq.mjs
2271
- const tokens = [
2272
- [
2273
- "background",
2274
- "ui-bg",
2275
- "background",
2276
- "#fff",
2277
- "#0a0a0a"
2278
- ],
2279
- [
2280
- "foreground",
2281
- "ui-text-highlighted",
2282
- "foreground",
2283
- "#0a0a0a",
2284
- "#fafafa"
2285
- ],
2286
- [
2287
- "muted",
2288
- "ui-text-muted",
2289
- "muted-foreground",
2290
- "#737373",
2291
- "#a1a1a1"
2292
- ],
2293
- [
2294
- "border",
2295
- "ui-border",
2296
- "border",
2297
- "#e5e5e5",
2298
- "rgb(255 255 255/.1)"
2299
- ],
2300
- [
2301
- "accent",
2302
- "ui-bg-elevated",
2303
- "accent",
2304
- "#f5f5f5",
2305
- "#262626"
2306
- ],
2307
- [
2308
- "ring",
2309
- "ui-primary",
2310
- "ring",
2311
- "#a1a1a1",
2312
- "#737373"
2313
- ]
2314
- ];
2315
- const groups = {
2316
- status: Object.values({
2317
- success: [
2318
- "success",
2319
- "ui-success",
2320
- "success",
2321
- "#259f56",
2322
- "#59d38c"
2323
- ],
2324
- danger: [
2325
- "danger",
2326
- "ui-error",
2327
- "destructive",
2328
- "#ee3533",
2329
- "#fd736d"
2330
- ],
2331
- warning: [
2332
- "warning",
2333
- "ui-warning",
2334
- "",
2335
- "#d57506",
2336
- "#fbbf24"
2337
- ],
2338
- info: [
2339
- "info",
2340
- "ui-info",
2341
- "",
2342
- "#2563eb",
2343
- "#60a5fa"
2344
- ]
2345
- }),
2346
- primary: [
2347
- [
2348
- "primary",
2349
- "ui-primary",
2350
- "primary",
2351
- "var(--_comark-foreground)",
2352
- "var(--_comark-foreground)"
2353
- ],
2354
- [
2355
- "primary-foreground",
2356
- "ui-text-inverted",
2357
- "primary-foreground",
2358
- "var(--_comark-background)",
2359
- "var(--_comark-background)"
2360
- ],
2361
- [
2362
- "secondary",
2363
- "ui-secondary",
2364
- "",
2365
- "var(--_comark-muted)",
2366
- "var(--_comark-muted)"
2367
- ]
2368
- ],
2369
- shadow: [[
2370
- "shadow",
2371
- "",
2372
- "",
2373
- "0 4px 12px rgb(0 0 0/.12)",
2374
- "0 4px 12px rgb(0 0 0/.5)"
2375
- ]]
2376
- };
2377
- const chain = (token, scheme) => {
2378
- const shadcn = token[2] ? `var(--${token[2]},${token[scheme]})` : token[scheme];
2379
- const nuxt = token[1] ? `var(--${token[1]},${shadcn})` : shadcn;
2380
- return `var(--comark-${token[0]},${nuxt})`;
2381
- };
2382
- const resolve = (list, scheme) => list.map((token) => `--_comark-${token[0]}:${chain(token, scheme)}`).join(";");
2383
- /**
2384
- * `declarations` on `selector` in dark mode: the system's, unless a `.light` class sits on the element or above it, or
2385
- * a `.dark` class there whatever the system says. Either class pins a page's scheme.
2386
- */
2387
- function dark(selector, declarations) {
2388
- return `@media (prefers-color-scheme:dark){:where(:not(.light,.light *)):is(${selector}){${declarations}}}:where(.dark,.dark *):is(${selector}){${declarations}}`;
2389
- }
2390
- /**
2391
- * Resolves the `--comark-*` tokens on `selector`, falling back to Nuxt UI's variables, then shadcn/ui's, then shadcn's
2392
- * neutral theme. Nuxt UI's corners are twice its `--ui-radius`, so the radius halves shadcn's to double it back. The
2393
- * halving sits in the `var()` fallback without a `calc()` of its own, which reads the same once the fallback is
2394
- * substituted, because postcss-calc, which cssnano runs, can't parse a `calc()` there.
2395
- * They resolve on the component rather than `:root`, so a `--comark-*` set on any ancestor still inherits down.
2396
- * `:where()` keeps them at zero specificity. The neutral theme follows the system's color mode, and a `.light` or
2397
- * `.dark` class on the component or above it pins one (see `dark()`).
2398
- *
2399
- * Every block gets the core tokens. Name `"status"` for `--comark-success`, `-danger`, `-warning`, and `-info`,
2400
- * `"primary"` for `--comark-primary`, `-primary-foreground`, and `-secondary`, and `"shadow"` for `--comark-shadow`, so
2401
- * a block that never draws them doesn't carry them.
2402
- */
2403
- function theme(selector, ...extras) {
2404
- const where = `:where(${selector})`;
2405
- const list = [...tokens, ...extras.flatMap((name) => groups[name])];
2406
- return `${where}{${resolve(list, 3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,var(--radius,.625rem)/2)*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}` + dark(where, resolve(list, 4));
2407
- }
2408
- const icons = {
2409
- status: "<path d=\"M10.1 2.182a10 10 0 0 1 3.8 0m0 19.636a10 10 0 0 1-3.8 0m7.509-18.097a10 10 0 0 1 2.69 2.7M2.182 13.9a10 10 0 0 1 0-3.8m18.097 7.509a10 10 0 0 1-2.7 2.69M21.818 10.1a10 10 0 0 1 0 3.8M3.721 6.391a10 10 0 0 1 2.7-2.69m-.03 16.578a10 10 0 0 1-2.69-2.7\"/>",
2410
- pr: "<circle cx=\"18\" cy=\"18\" r=\"3\"/><circle cx=\"6\" cy=\"6\" r=\"3\"/><path d=\"M13 6h3a2 2 0 0 1 2 2v7M6 9v12\"/>",
2411
- person: "<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/><circle cx=\"12\" cy=\"7\" r=\"4\"/>",
2412
- date: "<path d=\"M8 2v3m8-3v3\"/><rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\"/><path d=\"M3 9h18\"/>",
2413
- tags: "<path d=\"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1zM2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193\"/><circle cx=\"10.5\" cy=\"6.5\" r=\".5\"/>",
2414
- link: "<path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"/>",
2415
- number: "<path d=\"M4 9h16M4 15h16M10 3L8 21m8-18l-2 18\"/>",
2416
- boolean: "<rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\"/><path d=\"m16 9l-5.5 5.5L8 12\"/>",
2417
- text: "<path d=\"M12 4v16M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2M9 20h6\"/>"
2418
- };
2419
- const url = (body) => `url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${body}</svg>`)}")`;
2420
- /**
2421
- * The properties as rows, like the property rows of a Notion page: an icon and a muted label, then the value. On a
2422
- * narrow page the label sits above its value. Status reads as a pill, lists as small badges in the style of shadcn/ui's
2423
- * Badge, on the shared `--comark-*` tokens. The rules sit in the `comark` layer, so any unlayered rule of the host's wins.
2424
- */
2425
- const css = `@layer comark{${[
2426
- theme(".cfm"),
2427
- ".cfm{container:cfm/inline-size;display:grid;gap:.125rem;margin:0 0 1.5rem;padding:0 0 .75rem;border-bottom:1px solid var(--_comark-border);color:var(--_comark-foreground);font:400 .875rem/1.5rem var(--_comark-font)}",
2428
- ".cfm>div{display:grid;grid-template-columns:minmax(0,9rem) minmax(0,1fr);gap:.5rem;align-items:start}",
2429
- ".cfm :is(dt,dd){margin:0;padding:0}",
2430
- ".cfm dt{overflow:hidden;color:var(--_comark-muted);font-size:.8125rem;line-height:2rem;white-space:nowrap;text-overflow:ellipsis}",
2431
- `.cfm dt::before{content:"";display:inline-block;width:1rem;height:1rem;margin-right:.5rem;vertical-align:-.1875rem;background:currentColor;opacity:.7;forced-color-adjust:none;-webkit-mask:var(--cfm-icon,${url(icons.text)}) center/contain no-repeat;mask:var(--cfm-icon,${url(icons.text)}) center/contain no-repeat}`,
2432
- ...Object.entries(icons).filter(([kind]) => kind !== "text").map(([kind, body]) => `.cfm>[data-kind=${kind}]{--cfm-icon:${url(body)}}`),
2433
- ".cfm dd{display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;min-width:0;min-height:2rem;padding:.25rem 0;overflow-wrap:anywhere}",
2434
- ".cfm time{font-variant-numeric:tabular-nums}",
2435
- ".cfm a{color:inherit;text-decoration-color:var(--_comark-border);text-underline-offset:4px}",
2436
- ".cfm a:hover{text-decoration-color:currentColor}",
2437
- ".cfm a:focus-visible{border-radius:calc(var(--_comark-radius)/4);outline:2px solid var(--_comark-ring);outline-offset:2px;box-shadow:0 0 0 3px color-mix(in srgb,var(--_comark-ring) 50%,transparent)}",
2438
- ".cfm-tag,.cfm-status{display:inline-flex;align-items:center;padding:0 .5rem;border:1px solid var(--_comark-border);font-size:.75rem;font-weight:500;line-height:1.25rem}",
2439
- ".cfm-tag{border-radius:calc(var(--_comark-radius) - 2px);background:var(--_comark-accent)}",
2440
- ".cfm-status{gap:.375rem;border-radius:999px}",
2441
- ".cfm-status::before{content:\"\";width:.375rem;height:.375rem;border-radius:50%;background:var(--_comark-muted)}",
2442
- "@container cfm (max-width:22rem){.cfm>div{grid-template-columns:minmax(0,1fr);gap:0}.cfm dt{line-height:1.75rem}.cfm dd{min-height:0;padding:0 0 .25rem}}",
2443
- "@media print{.cfm{break-inside:avoid}}"
2444
- ].join("")}}`;
2445
- /**
2446
- * Adds a package's styles to the page once, unless the page already carries them as a `style` or a `link` with
2447
- * `data-comark-<name>`, which is how the HTML renderer inlines them and how an app that imports `style.css` marks them.
2448
- */
2449
- function addStyles$1(name, css) {
2450
- const attribute = `data-comark-${name}`;
2451
- if (document.querySelector(`style[${attribute}],link[${attribute}]`)) return;
2452
- const style = document.createElement("style");
2453
- style.setAttribute(attribute, "");
2454
- style.textContent = css;
2455
- document.head.append(style);
2456
- }
2457
- /** Adds the properties styles to the page once. The Vue, React, and Svelte components call it when they mount. */
2458
- const addStyles = () => addStyles$1("properties", css);
2459
- /**
2460
- * Rewrites each date in the properties boxes under `root` in the reader's locale. A date the `locale` option fixed
2461
- * keeps its `lang` and stays as written. The HTML renderer inlines this function, so it uses nothing from outside it.
2462
- */
2463
- function localizeDates(root) {
2464
- for (const time of root.querySelectorAll(".cfm time[datetime]:not([lang])")) time.textContent = (/* @__PURE__ */ new Date(`${time.dateTime}T00:00:00Z`)).toLocaleDateString(void 0, {
2465
- month: "short",
2466
- day: "numeric",
2467
- year: "numeric",
2468
- timeZone: "UTC"
2469
- });
2470
- }
2471
- // ../../node_modules/.pnpm/comark-properties@0.12.2_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__comark@0.9.2_kate_59411aee8c5739dfe2d5ce1e917d29ab/node_modules/comark-properties/dist/vue.mjs
2472
- var vue_exports = /* @__PURE__ */ __exportAll({
2473
- Properties: () => Properties,
2474
- components: () => components,
2475
- default: () => src_default
2476
- });
2477
- /** The properties box for `@comark/vue`. */
2478
- const Properties = defineComponent({
2479
- name: "Properties",
2480
- inheritAttrs: false,
2481
- setup(_, { slots }) {
2482
- const box = shallowRef();
2483
- const localize = () => box.value && localizeDates(box.value);
2484
- onMounted(() => {
2485
- addStyles();
2486
- localize();
2487
- });
2488
- onUpdated(localize);
2489
- return () => {
2490
- const rows = slots.default?.();
2491
- return rows?.length ? h("dl", {
2492
- class: "cfm",
2493
- "data-comark-frame": "",
2494
- ref: box
2495
- }, rows) : null;
2496
- };
2497
- }
2498
- });
2499
- /** Pass these as `components` to `@comark/vue`. */
2500
- const components = { Properties };
2501
- export { childrenOf$2 as _, hash as a, addStyles$2 as c, shikiDark as d, src_default$1 as f, src_default$4 as g, src_default$3 as h, rowsOf as i, typesetCss as l, css$1 as m, components as n, rawText as o, src_default$2 as p, vue_exports as r, scalar as s, Properties as t, theme$1 as u, isElement$2 as v };