@vite-hub/ui 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/README.md +106 -46
  2. package/dist/AttachmentTitle-BWw0ck0T.js +110 -0
  3. package/dist/BubbleContent-B1a4e3vE.js +45 -0
  4. package/dist/Chat-BZxkf3Tt.js +112 -0
  5. package/dist/ChatMessage-Blr5F-zi.js +94 -0
  6. package/dist/CodeBlockContent-BjXJm8lO.js +92 -0
  7. package/dist/CodeBlockTitle-DYrYpc1U.js +99 -0
  8. package/dist/CommentRow-ViZ7r8nr.js +86 -0
  9. package/dist/CopyButton-Dtg_Oc9_.js +115 -0
  10. package/dist/Markdown-_w7feFzl.js +70 -0
  11. package/dist/MarkdownCodeBlock-B4j7x0H6.js +127 -0
  12. package/dist/MarkdownImage-CJN3myt4.js +111 -0
  13. package/dist/MessageHeader-CJ9eBHSS.js +61 -0
  14. package/dist/MessageParts-FVyYZNsn.js +57 -0
  15. package/dist/MessageScrollerViewport-BaTlWLki.js +142 -0
  16. package/dist/MorphText-CYTndbyp.js +36 -0
  17. package/dist/RollNumber-Bo2tzfAp.js +49 -0
  18. package/dist/TraceTitle-Cp0y7RRD.js +133 -0
  19. package/dist/agent-session-BwZSMi4S.d.ts +312 -0
  20. package/dist/agent-session-DhlTKCQG.js +875 -0
  21. package/dist/{announce-B0DLwflT.js → announce-CJNXaYbT.js} +1 -3
  22. package/dist/appendItems-hQ4aBd9Q.js +4047 -0
  23. package/dist/attachment-BllgHx9Q.d.ts +124 -0
  24. package/dist/attachment-DQMJNfj0.js +35 -0
  25. package/dist/avatar-stack-Bj1xUkzY.d.ts +4 -0
  26. package/dist/avatar-stack-nQErr0qn.js +72 -0
  27. package/dist/bubble-D3M2_InY.js +32 -0
  28. package/dist/bubble-DmplVxLr.d.ts +64 -0
  29. package/dist/chat-DWdyMSuj.d.ts +13 -0
  30. package/dist/chat-message-QLHnX_ED.d.ts +11 -0
  31. package/dist/chat-session-BOj5L3Ey.d.ts +29 -0
  32. package/dist/chat-session-hjZRL6jY.js +43 -0
  33. package/dist/choices-input-DqgXl5a-.d.ts +97 -0
  34. package/dist/client-BG-oCUtv-5i4sRwXP.js +6587 -0
  35. package/dist/code-block-Bp8y-XJp.d.ts +182 -0
  36. package/dist/code-block-CMERLfew.js +14 -0
  37. package/dist/code-view-26RY6dX8.js +137 -0
  38. package/dist/code-view-D8yYdFUc.d.ts +184 -0
  39. package/dist/{colors-BghReA9C-DEq4bhEP.js → colors-BghReA9C-A4M9YE0s.js} +1 -1
  40. package/dist/{comment-composer-BP-CJx7f.js → comment-composer-BUt6vbnr.js} +176 -38
  41. package/dist/{comment-composer-BI6CNJyO.d.ts → comment-composer-CIsbz-78.d.ts} +7 -7
  42. package/dist/comment-layer-BlVNORgj.d.ts +139 -0
  43. package/dist/comment-layer-Ck2H24oJ.js +1206 -0
  44. package/dist/comment-panel-Djx-KxVa.d.ts +173 -0
  45. package/dist/comment-selection-bar-CbOEI98x.d.ts +33 -0
  46. package/dist/comment-selection-bar-CxPkJxVl.js +145 -0
  47. package/dist/comment-send.css +2 -2
  48. package/dist/{comment-thread-5h93DXds.js → comment-thread-C_Q4UDaV.js} +78 -53
  49. package/dist/{comment-thread-DSkWODKG.d.ts → comment-thread-X6gYMNay.d.ts} +11 -14
  50. package/dist/comments-B1itauwb.d.ts +52 -0
  51. package/dist/{comments-D9dONfs9.js → comments-BaSrroRV.js} +65 -44
  52. package/dist/comments-BtD28xEn.js +390 -0
  53. package/dist/{comments-CnG_c-_c.d.ts → comments-ZfV6IZs8.d.ts} +15 -7
  54. package/dist/{comments-context-CrjhleVA.js → comments-context-3js2YFl2.js} +2 -2
  55. package/dist/components-CM5mZe0a.js +269 -0
  56. package/dist/{config-BDvnaVUn.js → config-CFwvNt4Y.js} +16 -29
  57. package/dist/{config-xL4EBeXw.d.ts → config-JmsTI7gs.d.ts} +21 -33
  58. package/dist/connection-status-BVSH2ZVo.js +72 -0
  59. package/dist/connection-status-g62BTn44.d.ts +37 -0
  60. package/dist/copy-button-CRiXUFsl.d.ts +17 -0
  61. package/dist/device-frame-BW6IjB6P.d.ts +78 -0
  62. package/dist/device-frame-DDWoyB-G.js +515 -0
  63. package/dist/diffs-BTKaVnsb.d.ts +272 -0
  64. package/dist/diffs.d.ts +3 -0
  65. package/dist/{pierre-code-view-C49BVDrc.js → diffs.js} +147 -4223
  66. package/dist/{draw-DzSmD7uo-Cb7s9kxJ.js → draw-DzSmD7uo-BvtKi0oE.js} +2 -2
  67. package/dist/drop-field-C0bXv1J-.d.ts +35 -0
  68. package/dist/drop-field-DKpYQ3tO.js +77 -0
  69. package/dist/editor-BsOTjnnN.d.ts +540 -0
  70. package/dist/{markdown-editor-3gY9MLvy.js → editor-DJPUs1nt.js} +877 -116
  71. package/dist/editor.d.ts +2 -0
  72. package/dist/editor.js +3 -0
  73. package/dist/element-BpjNQvZ0.js +6 -0
  74. package/dist/{file-tree-CRFIdtzw.js → file-tree-B4JKbp4r.js} +19 -18
  75. package/dist/{file-tree-DOtkeBaq.d.ts → file-tree-BdnKA6UA.d.ts} +33 -8
  76. package/dist/file-tree-DDSIafDn.d.ts +22 -0
  77. package/dist/file-tree-DS5shGSL.js +46 -0
  78. package/dist/file-tree.d.ts +2 -0
  79. package/dist/file-tree.js +1 -0
  80. package/dist/files-cuVXzWlx.js +30 -0
  81. package/dist/filter-search-C9e6sGij.d.ts +28 -0
  82. package/dist/filter-search-COZsoRiR.js +73 -0
  83. package/dist/formatCSSVariablePrefix-DLS1Ed1_.js +5 -0
  84. package/dist/headless-2IcUWHMq.d.ts +51 -0
  85. package/dist/headless.d.ts +7 -4
  86. package/dist/headless.js +5 -3
  87. package/dist/highlight.d.ts +2 -0
  88. package/dist/highlight.js +1 -0
  89. package/dist/{highlights-C2AbEdDI.js → highlights-8Al0-h-v.js} +3 -2
  90. package/dist/{hold-to-delete-BSMrpE-i.d.ts → hold-to-delete-CQc1JaG_.d.ts} +7 -0
  91. package/dist/{hold-to-delete-Cludb56v.js → hold-to-delete-CcQbfiQx.js} +111 -20
  92. package/dist/hold-to-delete-cOPqQ9FJ.js +85 -0
  93. package/dist/hold-to-delete-ksBE7wxc.d.ts +58 -0
  94. package/dist/index-9Z6Gwtnf.d.ts +77 -0
  95. package/dist/{index-B2cbt3py.d.ts → index-D3-uYBqH.d.ts} +1 -1
  96. package/dist/index.d.ts +165 -52
  97. package/dist/index.js +127 -670
  98. package/dist/markdown-BLALLOc0.d.ts +45 -0
  99. package/dist/{markdown-renderer-BgsmNqv7.js → markdown-DDyOdYq_.js} +13044 -12356
  100. package/dist/{parts/components/markdown-renderer.d.ts → markdown-DkDxdpMU.d.ts} +10 -7
  101. package/dist/markdown-editor.d.ts +51 -98
  102. package/dist/markdown-editor.js +70 -3
  103. package/dist/markdown.d.ts +2 -0
  104. package/dist/markdown.js +1 -0
  105. package/dist/marker-CvcWZ3Zp.d.ts +59 -0
  106. package/dist/marker-DNL6QR3L.js +63 -0
  107. package/dist/message-BwivYIEl.js +13 -0
  108. package/dist/message-DEq4K5cQ.d.ts +72 -0
  109. package/dist/message-parts-B1BZFVKe.d.ts +3 -0
  110. package/dist/message-parts-CG3gNWn8.d.ts +11 -0
  111. package/dist/message-parts.d.ts +2 -0
  112. package/dist/message-parts.js +1 -0
  113. package/dist/message-scroller-D7AvM31v.d.ts +41 -0
  114. package/dist/motion/core.d.ts +4 -4
  115. package/dist/motion/core.js +5 -11
  116. package/dist/motion-BH6ShUam.d.ts +12 -0
  117. package/dist/{effects-DEoFFycD.js → motion-core-BdTfxAhY.js} +1779 -55
  118. package/dist/{motion-core-DNl7TR1T.d.ts → motion-core-BfIefToe.d.ts} +32 -74
  119. package/dist/motion-dPwxx3Wk.js +76 -0
  120. package/dist/{install-qNaj4OY4.js → motion-itHFtXwA.js} +1 -1
  121. package/dist/motion-list-BBbz93WT.js +49 -0
  122. package/dist/motion.d.ts +5 -14
  123. package/dist/motion.js +6 -13
  124. package/dist/nuxt-ui-CPdiTwwD.js +22 -0
  125. package/dist/nuxt.d.ts +9 -5
  126. package/dist/nuxt.js +28 -32
  127. package/dist/parts/components/agent-session.d.ts +2 -252
  128. package/dist/parts/components/agent-session.js +1 -639
  129. package/dist/parts/components/attachment.d.ts +2 -85
  130. package/dist/parts/components/attachment.js +3 -72
  131. package/dist/parts/components/avatar-stack.d.ts +3 -2
  132. package/dist/parts/components/avatar-stack.js +1 -60
  133. package/dist/parts/components/bubble.d.ts +2 -69
  134. package/dist/parts/components/bubble.js +3 -52
  135. package/dist/parts/components/chat-message.d.ts +3 -25
  136. package/dist/parts/components/chat-message.js +1 -50
  137. package/dist/parts/components/chat-session.d.ts +2 -26
  138. package/dist/parts/components/chat-session.js +1 -37
  139. package/dist/parts/components/chat.d.ts +3 -52
  140. package/dist/parts/components/chat.js +1 -105
  141. package/dist/parts/components/code-block.d.ts +2 -102
  142. package/dist/parts/components/code-block.js +4 -109
  143. package/dist/parts/components/code-view.d.ts +3 -268
  144. package/dist/parts/components/code-view.js +1 -1
  145. package/dist/parts/components/comment-composer.d.ts +1 -1
  146. package/dist/parts/components/comment-composer.js +1 -1
  147. package/dist/parts/components/comment-layer.d.ts +1 -1
  148. package/dist/parts/components/comment-layer.js +1 -645
  149. package/dist/parts/components/comment-panel.d.ts +2 -2
  150. package/dist/parts/components/comment-panel.js +49 -40
  151. package/dist/parts/components/comment-selection-bar.d.ts +2 -2
  152. package/dist/parts/components/comment-selection-bar.js +1 -116
  153. package/dist/parts/components/comment-thread.d.ts +2 -2
  154. package/dist/parts/components/comment-thread.js +1 -3
  155. package/dist/parts/components/comments.d.ts +8 -9
  156. package/dist/parts/components/comments.js +6 -9
  157. package/dist/parts/components/connection-status.d.ts +2 -36
  158. package/dist/parts/components/connection-status.js +1 -64
  159. package/dist/parts/components/copy-button.d.ts +3 -126
  160. package/dist/parts/components/copy-button.js +3 -226
  161. package/dist/parts/components/device-frame.d.ts +2 -128
  162. package/dist/parts/components/device-frame.js +1 -470
  163. package/dist/parts/components/drop-field.d.ts +2 -67
  164. package/dist/parts/components/drop-field.js +1 -76
  165. package/dist/parts/components/file-tree.d.ts +3 -2
  166. package/dist/parts/components/file-tree.js +3 -1
  167. package/dist/parts/components/filter-search.d.ts +2 -45
  168. package/dist/parts/components/filter-search.js +1 -57
  169. package/dist/parts/components/hold-to-delete.d.ts +2 -80
  170. package/dist/parts/components/hold-to-delete.js +1 -75
  171. package/dist/parts/components/markdown.d.ts +3 -45
  172. package/dist/parts/components/markdown.js +1 -46
  173. package/dist/parts/components/marker.d.ts +2 -32
  174. package/dist/parts/components/marker.js +1 -22
  175. package/dist/parts/components/message-parts.d.ts +3 -25
  176. package/dist/parts/components/message-parts.js +1 -45
  177. package/dist/parts/components/message.d.ts +2 -32
  178. package/dist/parts/components/message.js +3 -22
  179. package/dist/parts/components/motion-list.d.ts +2 -40
  180. package/dist/parts/components/motion-list.js +1 -41
  181. package/dist/parts/components/motion.d.ts +5 -118
  182. package/dist/parts/components/motion.js +4 -171
  183. package/dist/parts/components/patch-parsers.d.ts +1 -1
  184. package/dist/parts/components/progress.d.ts +2 -39
  185. package/dist/parts/components/progress.js +1 -53
  186. package/dist/parts/components/prompt-input.d.ts +2 -134
  187. package/dist/parts/components/prompt-input.js +1 -253
  188. package/dist/parts/components/relative-time.d.ts +2 -71
  189. package/dist/parts/components/relative-time.js +1 -1
  190. package/dist/parts/components/status.d.ts +2 -58
  191. package/dist/parts/components/status.js +1 -47
  192. package/dist/parts/components/sync-status.d.ts +2 -22
  193. package/dist/parts/components/sync-status.js +1 -48
  194. package/dist/parts/components/tool-list.d.ts +2 -28
  195. package/dist/parts/components/tool-list.js +1 -118
  196. package/dist/parts/components/trace-run.d.ts +2 -25
  197. package/dist/parts/components/trace-run.js +1 -89
  198. package/dist/parts/components/trace.d.ts +2 -59
  199. package/dist/parts/components/trace.js +1 -76
  200. package/dist/parts/composables/attachments.js +75 -1
  201. package/dist/parts/headless/choices-input.d.ts +2 -2
  202. package/dist/parts/headless/choices-input.js +49 -37
  203. package/dist/parts/headless/comments.d.ts +1 -1
  204. package/dist/parts/headless/comments.js +1 -1
  205. package/dist/parts/headless/message-scroller.d.ts +2 -2
  206. package/dist/parts/headless/message-scroller.js +211 -309
  207. package/dist/parts/headless/relative-time.d.ts +2 -0
  208. package/dist/parts/headless/relative-time.js +1 -0
  209. package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
  210. package/dist/parts/workspace/browser-support-notice.js +6 -5
  211. package/dist/parts/workspace/connect-panel.js +1 -1
  212. package/dist/parts/workspace/runners/web-container.js +2 -2
  213. package/dist/parts/workspace/workspace-bar.d.ts +1 -1
  214. package/dist/parts/workspace/workspace-bar.js +1 -1
  215. package/dist/parts/workspace/workspace-boot-status.d.ts +1 -1
  216. package/dist/parts/workspace/workspace-boot-status.js +1 -206
  217. package/dist/parts/workspace/workspace-editor-head.d.ts +1 -1
  218. package/dist/parts/workspace/workspace-editor-head.js +1 -1
  219. package/dist/parts/workspace/workspace-editor.d.ts +2 -2
  220. package/dist/parts/workspace/workspace-examples.js +1 -1
  221. package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
  222. package/dist/parts/workspace/workspace-file-tree.js +3 -2
  223. package/dist/parts/workspace/workspace-guide.js +1 -1
  224. package/dist/parts/workspace/workspace-preview.d.ts +1 -1
  225. package/dist/parts/workspace/workspace-preview.js +14 -12
  226. package/dist/parts/workspace/workspace-shell.d.ts +1 -1
  227. package/dist/parts/workspace/workspace-shell.js +11 -11
  228. package/dist/parts/workspace/workspace-sidebar.d.ts +3 -3
  229. package/dist/parts/workspace/workspace-sidebar.js +2 -2
  230. package/dist/parts/workspace/workspace-start.js +1 -1
  231. package/dist/parts/workspace/workspace-steps.js +1 -1
  232. package/dist/parts/workspace/workspace.d.ts +4 -4
  233. package/dist/parts/workspace/workspace.js +5 -5
  234. package/dist/press-BuEC-XvZ.d.ts +83 -0
  235. package/dist/progress-Ch0fA-bf.d.ts +8 -0
  236. package/dist/progress-D_9sG648.js +47 -0
  237. package/dist/prompt-input-CRXEJBAK.js +412 -0
  238. package/dist/prompt-input-j4OFTF5p.d.ts +116 -0
  239. package/dist/relative-time-BnJfjeEm.js +131 -0
  240. package/dist/relative-time-BuP-Gvzn.d.ts +43 -0
  241. package/dist/{relative-time-DJnw45tr.js → relative-time-Dz2DR4eb.js} +64 -114
  242. package/dist/relative-time-grHFu1kY.d.ts +11 -0
  243. package/dist/{ring-BN4d8vtw.js → ring-DoL9jivj.js} +64 -14
  244. package/dist/runtime/nuxt-plugin.js +2 -5
  245. package/dist/{sankey-CAYwt82B-BAAk7WkJ.js → sankey-CAYwt82B-e6k34wtW.js} +3 -3
  246. package/dist/{shiki-CbfEu_Az.js → shiki-CxzM_xNo.js} +3 -2
  247. package/dist/stand-ins-CuKM1UH1.js +339 -0
  248. package/dist/status-B2Yhrwv8.js +67 -0
  249. package/dist/status-ySiRa-8O.d.ts +38 -0
  250. package/dist/{stream-tokenizer-ByC3l0HQ.js → stream-tokenizer-BsjV6wxW.js} +1 -1
  251. package/dist/styles.css +4315 -3362
  252. package/dist/sync-status-BRroyOre.js +59 -0
  253. package/dist/sync-status-D4KdGO6y.d.ts +35 -0
  254. package/dist/theme.css +3 -0
  255. package/dist/theme.d.ts +14 -0
  256. package/dist/theme.js +19 -8
  257. package/dist/{themes-DKugPHlg.js → themes-B0_ioVT0.js} +1 -1
  258. package/dist/tool-list-DDaCqpR6.js +209 -0
  259. package/dist/tool-list-DMRPM0Yi.d.ts +50 -0
  260. package/dist/trace-KCBvOsw_.d.ts +113 -0
  261. package/dist/trace-run-Dk962P5a.d.ts +49 -0
  262. package/dist/trace-run-nh6FIsl6.js +202 -0
  263. package/dist/{opt-out-D66l60sg.js → tween-lVMRCUEv.js} +60 -1
  264. package/dist/types-BF_U0tgp.d.ts +74 -0
  265. package/dist/types-CTk3aNb5.d.ts +15 -0
  266. package/dist/types-D0a3i4Fw.d.ts +21 -0
  267. package/dist/types-DTecvcsZ.d.ts +35 -0
  268. package/dist/types-D_BWab7g.d.ts +75 -0
  269. package/dist/types-RHaQ4gj1.d.ts +27 -0
  270. package/dist/ui-components-CKQAPI-W.js +7 -0
  271. package/dist/unwrapDefault-CExq-4rm.js +5 -0
  272. package/dist/use-copy-DK1SSZkh.js +66 -0
  273. package/dist/utils-hi9-xROt.js +37 -0
  274. package/dist/vite.d.ts +0 -1
  275. package/dist/vite.js +8 -14
  276. package/dist/{vue-Cs_HmYsp.js → vue-DdYvDVOr.js} +1 -1
  277. package/dist/workspace-boot-status-CyGlJS06.js +216 -0
  278. package/dist/{workspace-shell-ChCwWPyv.d.ts → workspace-shell-B4A7CINd.d.ts} +1 -1
  279. package/dist/workspace.d.ts +1 -1
  280. package/dist/workspace.js +1 -2
  281. package/package.json +49 -15
  282. package/dist/attachments-DgwoQZKY.js +0 -88
  283. package/dist/avatar-stack-C0IKwj6g.d.ts +0 -57
  284. package/dist/choices-input-BUf-QqGj.d.ts +0 -92
  285. package/dist/code-view-Cg4nyTNA.js +0 -172
  286. package/dist/comment-attachments-CMpYOJod.js +0 -19
  287. package/dist/comment-layer-Ba2DV4L7.d.ts +0 -174
  288. package/dist/comment-list-BJdZu0DS.d.ts +0 -60
  289. package/dist/comment-panel-DISGe7yM.d.ts +0 -206
  290. package/dist/comment-person-D_IyIjXo.js +0 -39
  291. package/dist/comment-pin-C5UeLPTa.d.ts +0 -66
  292. package/dist/comment-row-DPMWI5Z0.js +0 -38
  293. package/dist/comment-selection-bar-CVuS-FNL.d.ts +0 -40
  294. package/dist/comment-send-CH46zawK.js +0 -275
  295. package/dist/comment-send-MmxFsOQf.d.ts +0 -23
  296. package/dist/drop-field-CNZgwFVO.js +0 -162
  297. package/dist/editor-BuByBIkJ.js +0 -620
  298. package/dist/format-Bc9m7-r0.js +0 -38
  299. package/dist/handlers-CnbkvXjX.js +0 -181
  300. package/dist/icon-XZaCUZTG.d.ts +0 -29
  301. package/dist/image-preview-EqfPcFZ9.js +0 -104
  302. package/dist/index-B_PSX-5h.d.ts +0 -69
  303. package/dist/list-DUTAo0uC.js +0 -270
  304. package/dist/markdown-editor-B7gD60tp.d.ts +0 -189
  305. package/dist/message-scroller-a6qaYHno.d.ts +0 -173
  306. package/dist/nuxt-ui-7ByUrymx.js +0 -43
  307. package/dist/parts/components/comment-list.d.ts +0 -2
  308. package/dist/parts/components/comment-list.js +0 -172
  309. package/dist/parts/components/comment-pin.d.ts +0 -2
  310. package/dist/parts/components/comment-pin.js +0 -74
  311. package/dist/parts/components/comment-send.d.ts +0 -2
  312. package/dist/parts/components/comment-send.js +0 -1
  313. package/dist/parts/components/markdown-editor.d.ts +0 -2
  314. package/dist/parts/components/markdown-editor.js +0 -1
  315. package/dist/parts/components/markdown-renderer.js +0 -1
  316. package/dist/payload-text-DQNRbJY5.js +0 -31
  317. package/dist/progress-DL9k-ERG.js +0 -265
  318. package/dist/registry-DAIjCjWd.js +0 -77
  319. package/dist/slot-part-BWHvQ3mK.js +0 -25
  320. package/dist/text-BWzZFnGY.js +0 -822
  321. package/dist/travel-CwVhU_GS.js +0 -180
  322. package/dist/tween-Dv3IIIQG.js +0 -61
  323. package/dist/types-Ceh7h7NT.d.ts +0 -31
  324. package/dist/visual-copy-CHHBfJ6O.js +0 -14
  325. package/dist/vue-BlknIGIm.js +0 -2501
@@ -1,6 +1,7 @@
1
- import { n as __exportAll } from "./rolldown-runtime-CahUhzF3.js";
2
- import { A as SPLIT_WITH_NEWLINES, C as DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY, D as HEADER_FILENAME_SUFFIX_SLOT_ID, E as EMPTY_LINE_ANNOTATIONS, M as UNSAFE_CSS_ATTRIBUTE, O as HEADER_METADATA_SLOT_ID, S as DEFAULT_VIRTUAL_FILE_METRICS, T as DIFFS_TAG_NAME, _ as DEFAULT_MESSAGES, b as DEFAULT_THEMES, c as cleanLastNewline, d as CODE_VIEW_FOOTER_ATTRIBUTE, f as CODE_VIEW_HEADER_ATTRIBUTE, g as DEFAULT_EXPANDED_REGION, h as DEFAULT_CODE_VIEW_LAYOUT, i as resolveDiffLib, j as THEME_CSS_ATTRIBUTE, k as HEADER_PREFIX_SLOT_ID, l as getHunkSideEndBoundary, m as DEFAULT_CODE_VIEW_FILE_METRICS, n as parseDiffFromFile, o as slideBlankBoundaryBlocksUp, p as CUSTOM_HEADER_SLOT_ID, r as diffLibs, s as composeCacheKey, t as getSingularPatch, u as getHunkSideStartBoundary, v as DEFAULT_RENDER_RANGE, w as DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, x as DEFAULT_TOKENIZE_MAX_LENGTH, y as DEFAULT_SMOOTH_SCROLL_SETTINGS } from "./getSingularPatch-C7LmmBrW.js";
3
- import { s as pierrePropTypes } from "./code-view-Cg4nyTNA.js";
1
+ import { A as SPLIT_WITH_NEWLINES, C as DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY, D as HEADER_FILENAME_SUFFIX_SLOT_ID, E as EMPTY_LINE_ANNOTATIONS, M as UNSAFE_CSS_ATTRIBUTE, O as HEADER_METADATA_SLOT_ID, S as DEFAULT_VIRTUAL_FILE_METRICS, T as DIFFS_TAG_NAME, _ as DEFAULT_MESSAGES, a as parsePatchFiles, b as DEFAULT_THEMES, c as cleanLastNewline, d as CODE_VIEW_FOOTER_ATTRIBUTE, f as CODE_VIEW_HEADER_ATTRIBUTE, g as DEFAULT_EXPANDED_REGION, h as DEFAULT_CODE_VIEW_LAYOUT, i as resolveDiffLib, j as THEME_CSS_ATTRIBUTE, k as HEADER_PREFIX_SLOT_ID, l as getHunkSideEndBoundary, m as DEFAULT_CODE_VIEW_FILE_METRICS, n as parseDiffFromFile, o as slideBlankBoundaryBlocksUp, p as CUSTOM_HEADER_SLOT_ID, r as diffLibs, s as composeCacheKey, t as getSingularPatch, u as getHunkSideStartBoundary, v as DEFAULT_RENDER_RANGE, w as DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE, x as DEFAULT_TOKENIZE_MAX_LENGTH, y as DEFAULT_SMOOTH_SCROLL_SETTINGS } from "./getSingularPatch-C7LmmBrW.js";
2
+ import { i as AttachedLanguages, r as h$1, t as createSegmenter } from "./utils-hi9-xROt.js";
3
+ import { C as releaseHighlighterType, S as getHighlighterType, _ as createTokenRow, a as DecoratedLineBuilder, b as HighlighterDisposedError, c as attributeFor, d as createGutterItem, f as createGutterWrapper, g as createTextNodeElement, h as createPlainRow, i as setDeferredArrayItem, l as hastToHtml, m as createIconElement, n as renderTokenLines, o as lineChangesOf, p as createHastElement, r as wrapTokenFragments, s as moveLineEntries, t as appendItems, u as createGutterGap, v as createDiffsThemeResolver, w as resolveHighlighterType, x as acquireHighlighterType } from "./appendItems-hQ4aBd9Q.js";
4
+ import { t as formatCSSVariablePrefix } from "./formatCSSVariablePrefix-DLS1Ed1_.js";
4
5
  import { computed, defineComponent, h, onBeforeUnmount, shallowRef, toRaw, watchEffect } from "vue";
5
6
  // ../../node_modules/.pnpm/@pierre+theming@1.0.2_@pierre+theme@2.1.0_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6_shiki@4.6.0/node_modules/@pierre/theming/dist/modules/color.js
6
7
  const HEX_TRANSPARENT_RE = /^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i;
@@ -157,38 +158,6 @@ function getLineAnnotationSource(annotation) {
157
158
  const source = lineAnnotationSources.get(annotation);
158
159
  return source == null ? annotation : source;
159
160
  }
160
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/highlighter/highlighterType.js
161
- let activeType;
162
- let holds = 0;
163
- var HighlighterDisposedError = class extends Error {
164
- constructor() {
165
- super("Highlighter is disposed");
166
- this.name = "HighlighterDisposedError";
167
- }
168
- };
169
- function getHighlighterType() {
170
- return activeType;
171
- }
172
- function resolveHighlighterType(type) {
173
- return type ?? activeType ?? "shiki-js";
174
- }
175
- function assertHighlighterType(type) {
176
- if (activeType != null && activeType !== type) throw new Error(`Cannot load the "${type}" highlighter while "${activeType}" is in use. Only one highlighter type can be active at a time; dispose every "${activeType}" instance (disposeHighlighter() disposes the shared one) before switching.`);
177
- }
178
- function acquireHighlighterType(type) {
179
- assertHighlighterType(type);
180
- activeType = type;
181
- holds++;
182
- }
183
- function releaseHighlighterType() {
184
- holds--;
185
- if (holds === 0) activeType = void 0;
186
- }
187
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/highlighter/languages/constants.js
188
- const ResolvedLanguages = /* @__PURE__ */ new Map();
189
- const ResolvingLanguages = /* @__PURE__ */ new Map();
190
- const RegisteredCustomLanguages = /* @__PURE__ */ new Map();
191
- const AttachedLanguages = /* @__PURE__ */ new Set();
192
161
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/getThemes.js
193
162
  function getThemes(theme = DEFAULT_THEMES) {
194
163
  const themesArr = [];
@@ -199,275 +168,6 @@ function getThemes(theme = DEFAULT_THEMES) {
199
168
  }
200
169
  return themesArr;
201
170
  }
202
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/isWorkerContext.js
203
- function isWorkerContext() {
204
- return typeof WorkerGlobalScope !== "undefined" && typeof self !== "undefined" && self instanceof WorkerGlobalScope;
205
- }
206
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/highlighter/themes/createCachedLoader.js
207
- function createCachedLoader(loader) {
208
- let cached;
209
- return () => cached ??= loader().then((loaded) => {
210
- cached = loaded;
211
- return loaded;
212
- }, (error) => {
213
- cached = void 0;
214
- throw error;
215
- });
216
- }
217
- // ../../node_modules/.pnpm/@pierre+theming@1.0.2_@pierre+theme@2.1.0_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6_shiki@4.6.0/node_modules/@pierre/theming/dist/modules/unwrapDefault.js
218
- function unwrapDefault(value) {
219
- return value !== null && typeof value === "object" && "default" in value ? value.default : value;
220
- }
221
- // ../../node_modules/.pnpm/@pierre+theming@1.0.2_@pierre+theme@2.1.0_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6_shiki@4.6.0/node_modules/@pierre/theming/dist/modules/createThemeResolver.js
222
- var DuplicateThemeError = class extends Error {
223
- constructor(name) {
224
- super(`Theme "${name}" is already registered`);
225
- this.name = "DuplicateThemeError";
226
- }
227
- };
228
- var UnregisteredThemeError = class extends Error {
229
- constructor(name) {
230
- super(`No loader registered for theme "${name}"`);
231
- this.name = "UnregisteredThemeError";
232
- }
233
- };
234
- var UnresolvedThemeError = class extends Error {
235
- constructor(name) {
236
- super(`Theme "${name}" has not been resolved`);
237
- this.name = "UnresolvedThemeError";
238
- }
239
- };
240
- function createThemeResolver(options = {}) {
241
- const loaders = /* @__PURE__ */ new Map();
242
- const resolved = /* @__PURE__ */ new Map();
243
- const inflight = /* @__PURE__ */ new Map();
244
- let cacheGeneration = 0;
245
- function registerTheme(name, loader) {
246
- if (loaders.has(name)) throw new DuplicateThemeError(name);
247
- loaders.set(name, loader);
248
- }
249
- function registerThemeIfAbsent(name, loader) {
250
- if (loaders.has(name)) return false;
251
- loaders.set(name, loader);
252
- return true;
253
- }
254
- function hasRegisteredTheme(name) {
255
- return loaders.has(name);
256
- }
257
- function resolveTheme(name) {
258
- const cached = resolved.get(name);
259
- if (cached !== void 0) return Promise.resolve(cached);
260
- const existing = inflight.get(name);
261
- if (existing !== void 0) return existing;
262
- const loader = loaders.get(name);
263
- if (loader === void 0 && options.fallbackLoader === void 0) return Promise.reject(new UnregisteredThemeError(name));
264
- const generation = cacheGeneration;
265
- const promise = Promise.resolve().then(() => loader !== void 0 ? loader() : options.fallbackLoader?.(name)).then(async (result) => {
266
- if (result === void 0) throw new UnregisteredThemeError(name);
267
- const loaded = unwrapDefault(result);
268
- const theme = options.normalizeTheme === void 0 ? loaded : await options.normalizeTheme(loaded, name);
269
- if (generation === cacheGeneration) resolved.set(name, theme);
270
- if (inflight.get(name) === promise) inflight.delete(name);
271
- return theme;
272
- }).catch((err) => {
273
- if (inflight.get(name) === promise) inflight.delete(name);
274
- throw err;
275
- });
276
- inflight.set(name, promise);
277
- return promise;
278
- }
279
- function resolveThemes(names) {
280
- return Promise.all(names.map((name) => resolveTheme(name)));
281
- }
282
- function seedResolvedTheme(name, theme) {
283
- resolved.set(name, theme);
284
- }
285
- function seedResolvedThemes(entries) {
286
- for (const [name, theme] of entries) seedResolvedTheme(name, theme);
287
- }
288
- function getResolvedTheme(name) {
289
- return resolved.get(name);
290
- }
291
- function getResolvedThemes(names) {
292
- const themes = [];
293
- for (const name of names) {
294
- const theme = resolved.get(name);
295
- if (theme === void 0) throw new UnresolvedThemeError(name);
296
- themes.push(theme);
297
- }
298
- return themes;
299
- }
300
- function hasResolvedTheme(name) {
301
- return resolved.has(name);
302
- }
303
- function hasResolvedThemes(names) {
304
- for (const name of names) if (!resolved.has(name)) return false;
305
- return true;
306
- }
307
- function getResolvedOrResolveTheme(name) {
308
- const cached = resolved.get(name);
309
- if (cached !== void 0) return cached;
310
- return resolveTheme(name);
311
- }
312
- function clearResolvedThemes() {
313
- cacheGeneration++;
314
- resolved.clear();
315
- inflight.clear();
316
- }
317
- return {
318
- clearResolvedThemes,
319
- getResolvedOrResolveTheme,
320
- getResolvedTheme,
321
- getResolvedThemes,
322
- hasRegisteredTheme,
323
- hasResolvedTheme,
324
- hasResolvedThemes,
325
- registerTheme,
326
- registerThemeIfAbsent,
327
- resolveTheme,
328
- resolveThemes,
329
- seedResolvedTheme,
330
- seedResolvedThemes
331
- };
332
- }
333
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/highlighter/themes/themeResolver.js
334
- const customThemes = /* @__PURE__ */ new Map();
335
- const resolvers = /* @__PURE__ */ new Map();
336
- const loadHighlightsThemeCatalog = createCachedLoader(() => import("./loader-CYMEjzwc.js"));
337
- const loadPierreThemeCatalog = createCachedLoader(() => import("./themes-DKugPHlg.js"));
338
- const loadShikiCore = createCachedLoader(() => import("shiki/core"));
339
- const ZED_COLOR_ALIASES = [
340
- ["editor.lineHighlightBackground", "editor.active_line.background"],
341
- ["editor.selectionBackground", "element.selected"],
342
- ["editor.findMatchHighlightBackground", "search.match_background"],
343
- ["editorBracketMatch.background", "editor.document_highlight.bracket_background"],
344
- ["editorError.foreground", "error"],
345
- ["editorWarning.foreground", "warning"],
346
- ["editorInfo.foreground", "info"],
347
- ["editorHint.foreground", "hint"],
348
- [
349
- "gitDecoration.addedResourceForeground",
350
- "created",
351
- "terminal.ansi.green"
352
- ],
353
- [
354
- "gitDecoration.deletedResourceForeground",
355
- "deleted",
356
- "terminal.ansi.red"
357
- ],
358
- [
359
- "gitDecoration.modifiedResourceForeground",
360
- "modified",
361
- "terminal.ansi.blue"
362
- ]
363
- ];
364
- function createHighlightsTheme(name, raw) {
365
- const theme = "themes" in raw ? raw.themes[0] : raw;
366
- if (theme == null) throw new Error(`Theme "${name}" is an empty Zed theme family.`);
367
- const zed = {
368
- ...theme,
369
- name
370
- };
371
- const colors = {};
372
- for (const [key, value] of Object.entries(zed.style)) if (typeof value === "string") colors[key] = value;
373
- const player = zed.style.players?.[0];
374
- if (player?.cursor != null) colors["editorCursor.foreground"] ??= player.cursor;
375
- if (player?.selection != null) colors["editor.selectionBackground"] ??= player.selection;
376
- for (const [target, ...sources] of ZED_COLOR_ALIASES) {
377
- if (colors[target] != null) continue;
378
- const source = sources.find((key) => colors[key] != null);
379
- if (source != null) colors[target] = colors[source];
380
- }
381
- if (zed.cssVariables === true) {
382
- colors["editor.foreground"] = "var(--hls-foreground)";
383
- colors["editor.background"] = "var(--hls-background)";
384
- } else if (typeof zed.cssVariables === "object") {
385
- colors["editor.foreground"] ??= colors.text ?? colors.foreground ?? "foreground";
386
- colors["editor.background"] ??= colors.background ?? "background";
387
- const { prefix = "--hls-", defaults } = zed.cssVariables;
388
- for (const [key, value] of Object.entries(colors)) {
389
- const fallback = defaults?.[value];
390
- colors[key] = `var(${prefix}${value}${fallback ? `, ${fallback}` : ""})`;
391
- }
392
- }
393
- const type = zed.appearance === "light" ? "light" : "dark";
394
- return {
395
- name,
396
- type,
397
- colors,
398
- zed,
399
- fg: colors["editor.foreground"] ?? colors.text ?? colors.foreground ?? (type === "light" ? "#333333" : "#bbbbbb"),
400
- bg: colors["editor.background"] ?? colors.background ?? (type === "light" ? "#ffffff" : "#1e1e1e")
401
- };
402
- }
403
- /** Keep caches separate because the same name can have TextMate and Zed palettes. */
404
- function createDiffsThemeResolver(backend) {
405
- let resolver = resolvers.get(backend);
406
- if (resolver != null) return resolver;
407
- resolver = createThemeResolver({
408
- fallbackLoader: async (name) => {
409
- if (typeof __DIFFS_WORKER__ !== "undefined" ? __DIFFS_WORKER__ : isWorkerContext()) throw new Error(`Theme "${name}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);
410
- const custom = customThemes.get(name);
411
- if (backend === "highlights") {
412
- const loader = custom?.zed ?? custom?.diffs;
413
- if (loader != null) {
414
- const loaded = await loader();
415
- const theme = "default" in loaded ? loaded.default : loaded;
416
- if ("zed" in theme && theme.zed != null) return theme;
417
- if ("style" in theme || "themes" in theme) return createHighlightsTheme(name, theme);
418
- throw new Error(`Theme "${name}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`);
419
- }
420
- const catalog = loadHighlightsThemeCatalog();
421
- const { themes } = catalog instanceof Promise ? await catalog : catalog;
422
- const bundledLoader = themes[name];
423
- if (bundledLoader != null) return createHighlightsTheme(name, (await bundledLoader()).default);
424
- if (custom?.textmate != null) throw new Error(`Theme "${name}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`);
425
- } else {
426
- const loader = custom?.textmate ?? custom?.diffs;
427
- let loaded;
428
- if (loader != null) {
429
- const result = await loader();
430
- loaded = "default" in result ? result.default : result;
431
- } else {
432
- const catalog = loadPierreThemeCatalog();
433
- const { themes } = catalog instanceof Promise ? await catalog : catalog;
434
- const descriptor = themes.getTheme(name);
435
- if (descriptor == null && custom?.zed != null) throw new Error(`Theme "${name}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);
436
- if (descriptor == null) throw new Error(`No valid theme loader registered for "${name}"`);
437
- const result = await descriptor.load();
438
- loaded = "default" in result ? result.default : result;
439
- }
440
- if ("style" in loaded || "themes" in loaded) throw new Error(`Theme "${name}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);
441
- const core = loadShikiCore();
442
- const { normalizeTheme, createCssVariablesTheme } = core instanceof Promise ? await core : core;
443
- if ("cssVariables" in loaded && loaded.cssVariables != null) return {
444
- ...loaded,
445
- textmate: normalizeTheme(createCssVariablesTheme(loaded.cssVariables))
446
- };
447
- if ("textmate" in loaded && loaded.textmate != null) return {
448
- ...loaded,
449
- textmate: normalizeTheme(loaded.textmate)
450
- };
451
- const textmate = normalizeTheme(loaded);
452
- return {
453
- name: textmate.name,
454
- type: textmate.type,
455
- fg: textmate.fg,
456
- bg: textmate.bg,
457
- colors: textmate.colors,
458
- textmate
459
- };
460
- }
461
- throw new Error(`No valid theme loader registered for "${name}"`);
462
- },
463
- normalizeTheme: (theme, name) => {
464
- if (theme.name !== name) throw new Error(`resolvedTheme: themeName: ${name} does not match theme.name: ${theme.name}`);
465
- return theme;
466
- }
467
- });
468
- resolvers.set(backend, resolver);
469
- return resolver;
470
- }
471
171
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.js
472
172
  function areThemesAttached(themes, highlighter = resolveHighlighterType()) {
473
173
  if (typeof highlighter !== "string" && highlighter.isDisposed) return false;
@@ -484,10 +184,10 @@ async function createHighlighter(type) {
484
184
  acquireHighlighterType(resolvedType);
485
185
  try {
486
186
  if (resolvedType === "highlights") {
487
- const { HighlightsHighlighter } = await import("./highlights-C2AbEdDI.js");
187
+ const { HighlightsHighlighter } = await import("./highlights-8Al0-h-v.js");
488
188
  return new HighlightsHighlighter();
489
189
  }
490
- const { ShikiHighlighter } = await import("./shiki-CbfEu_Az.js");
190
+ const { ShikiHighlighter } = await import("./shiki-CxzM_xNo.js");
491
191
  return await ShikiHighlighter.create(resolvedType);
492
192
  } finally {
493
193
  releaseHighlighterType();
@@ -640,10 +340,6 @@ function patchScrollbarGutterSize(themeCSS, scrollbarGutter) {
640
340
  function escapeRegExp$1(value) {
641
341
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
642
342
  }
643
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.js
644
- function formatCSSVariablePrefix(type) {
645
- return `--${type === "token" ? "diffs-token" : "diffs"}-`;
646
- }
647
343
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.js
648
344
  function getHighlighterThemeStyles({ theme = DEFAULT_THEMES, highlighter, prefix }) {
649
345
  let styles = "";
@@ -896,96 +592,6 @@ var I18n = class {
896
592
  }
897
593
  };
898
594
  const i18n = new I18n();
899
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/hast_utils.js
900
- function createTextNodeElement(value) {
901
- return {
902
- type: "text",
903
- value
904
- };
905
- }
906
- function createHastElement({ tagName, children = [], properties = {} }) {
907
- return {
908
- type: "element",
909
- tagName,
910
- properties,
911
- children
912
- };
913
- }
914
- function createIconElement({ name, width = 16, height = 16, properties }) {
915
- return createHastElement({
916
- tagName: "svg",
917
- properties: {
918
- width,
919
- height,
920
- viewBox: "0 0 16 16",
921
- ...properties
922
- },
923
- children: [createHastElement({
924
- tagName: "use",
925
- properties: { href: `#${name.replace(/^#/, "")}` }
926
- })]
927
- });
928
- }
929
- function createGutterWrapper(children) {
930
- return createHastElement({
931
- tagName: "div",
932
- properties: { "data-gutter": "" },
933
- children
934
- });
935
- }
936
- function createGutterItem(lineType, lineNumber, lineIndex, properties = {}) {
937
- return createHastElement({
938
- tagName: "div",
939
- properties: {
940
- "data-line-type": lineType,
941
- "data-column-number": lineNumber,
942
- "data-line-index": lineIndex,
943
- ...properties
944
- },
945
- children: lineNumber != null ? [createHastElement({
946
- tagName: "span",
947
- properties: { "data-line-number-content": "" },
948
- children: [createTextNodeElement(`${lineNumber}`)]
949
- })] : void 0
950
- });
951
- }
952
- function createGutterGap(type, bufferType, size) {
953
- return createHastElement({
954
- tagName: "div",
955
- properties: {
956
- "data-gutter-buffer": bufferType,
957
- "data-buffer-size": size,
958
- "data-line-type": bufferType === "annotation" ? void 0 : type,
959
- style: bufferType === "annotation" ? `grid-row: span ${size};` : `grid-row: span ${size};min-height:calc(${size} * 1lh);`
960
- }
961
- });
962
- }
963
- function createTokenRow(tokens) {
964
- return createHastElement({
965
- tagName: "div",
966
- children: tokens.map(([char, color, text]) => {
967
- if (char === 0 && color === "") return text === "" ? createHastElement({ tagName: "br" }) : createTextNodeElement(text);
968
- return createHastElement({
969
- tagName: "span",
970
- properties: {
971
- "data-char": char,
972
- style: `color:${color};`
973
- },
974
- children: [createTextNodeElement(text)]
975
- });
976
- })
977
- });
978
- }
979
- function createPlainRow(lineText) {
980
- return createHastElement({
981
- tagName: "div",
982
- children: lineText === "" ? [createHastElement({ tagName: "br" })] : [createHastElement({
983
- tagName: "span",
984
- properties: { "data-char": 0 },
985
- children: [createTextNodeElement(lineText)]
986
- })]
987
- });
988
- }
989
595
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/rows/LineCuts.js
990
596
  function cutLineLength(text, limit) {
991
597
  if (text.length <= limit) return;
@@ -2553,3265 +2159,97 @@ function createWindowFromScrollPosition({ scrollTop, scrollHeight, height, fitPe
2553
2159
  if (bottom > scrollHeight) bottom = scrollHeight;
2554
2160
  top = Math.floor(Math.max(top, 0));
2555
2161
  return {
2556
- top,
2557
- bottom: Math.ceil(Math.max(Math.min(bottom, scrollHeight), top))
2558
- };
2559
- }
2560
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/prefersReducedMotion.js
2561
- function prefersReducedMotion() {
2562
- if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
2563
- return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2564
- }
2565
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/lineEndings.js
2566
- /** The line ending a file uses, read from its first line break. */
2567
- function lineEndingOf(text) {
2568
- const first = /\r\n|\r|\n/.exec(text)?.[0];
2569
- return first === "\r\n" || first === "\r" ? first : "\n";
2570
- }
2571
- /** `text` with every line break rewritten to the one its first line uses. */
2572
- function uniformLineEndings(text) {
2573
- if (!text.includes("\r")) return text;
2574
- const eol = lineEndingOf(text);
2575
- return text.replace(/\r\n|\r|\n/g, eol);
2576
- }
2577
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/areGhostTextRowsEqual.js
2578
- /**
2579
- * Whether two ghost text row maps (zero-based line -> row count) show the
2580
- * same rows under the same lines. The editor replaces its map on every
2581
- * change, so a different map is not by itself a change in height.
2582
- */
2583
- function areGhostTextRowsEqual(a, b) {
2584
- if (a === b) return true;
2585
- if (a.size !== b.size) return false;
2586
- for (const [line, rows] of a) if (b.get(line) !== rows) return false;
2587
- return true;
2588
- }
2589
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/dom/CodeColumns.js
2590
- /**
2591
- * The code columns a component renders, by role, and their horizontal scroll
2592
- * offsets. The offsets are kept from the columns' scroll events, so reading
2593
- * them never touches the DOM. The columns scroll together, but a narrower
2594
- * column clamps lower, so the widest one's offset is the component's.
2595
- */
2596
- var CodeColumns = class {
2597
- #elements = /* @__PURE__ */ new Map();
2598
- #scrollLefts = /* @__PURE__ */ new Map();
2599
- get(role) {
2600
- return this.#elements.get(role);
2601
- }
2602
- /**
2603
- * Installs a role's column, moving the scroll listener from the column it
2604
- * replaces. A column already on screen is read once; a new one starts at
2605
- * zero.
2606
- */
2607
- set(role, column) {
2608
- const previous = this.#elements.get(role);
2609
- if (previous === column) return;
2610
- if (previous != null) {
2611
- previous.removeEventListener("scroll", this.#handleScroll);
2612
- this.#scrollLefts.delete(previous);
2613
- this.#elements.delete(role);
2614
- }
2615
- if (column != null) {
2616
- column.addEventListener("scroll", this.#handleScroll, { passive: true });
2617
- this.#scrollLefts.set(column, column.isConnected ? column.scrollLeft : 0);
2618
- this.#elements.set(role, column);
2619
- }
2620
- }
2621
- /** Forgets every column and stops listening to it. */
2622
- cleanUp() {
2623
- for (const role of [...this.#elements.keys()]) this.set(role, void 0);
2624
- }
2625
- /** The widest column's horizontal scroll offset. */
2626
- get scrollLeft() {
2627
- let scrollLeft = 0;
2628
- for (const columnScrollLeft of this.#scrollLefts.values()) scrollLeft = Math.max(scrollLeft, columnScrollLeft);
2629
- return scrollLeft;
2630
- }
2631
- /**
2632
- * Scrolls every column to `position` and keeps where each one landed: a
2633
- * column clamps a position past its content, and no scroll event follows
2634
- * when it did not move.
2635
- */
2636
- setScrollLeft(position) {
2637
- for (const column of this.#scrollLefts.keys()) {
2638
- column.scrollLeft = position;
2639
- this.#scrollLefts.set(column, column.scrollLeft);
2640
- }
2641
- }
2642
- #handleScroll = (event) => {
2643
- const { currentTarget } = event;
2644
- if (currentTarget instanceof HTMLElement) this.#scrollLefts.set(currentTarget, currentTarget.scrollLeft);
2645
- };
2646
- };
2647
- // ../../node_modules/.pnpm/html-void-elements@3.0.0/node_modules/html-void-elements/index.js
2648
- /**
2649
- * List of HTML void tag names.
2650
- *
2651
- * @type {Array<string>}
2652
- */
2653
- const htmlVoidElements = [
2654
- "area",
2655
- "base",
2656
- "basefont",
2657
- "bgsound",
2658
- "br",
2659
- "col",
2660
- "command",
2661
- "embed",
2662
- "frame",
2663
- "hr",
2664
- "image",
2665
- "img",
2666
- "input",
2667
- "keygen",
2668
- "link",
2669
- "meta",
2670
- "param",
2671
- "source",
2672
- "track",
2673
- "wbr"
2674
- ];
2675
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/schema.js
2676
- /**
2677
- * @import {Schema as SchemaType, Space} from 'property-information'
2678
- */
2679
- /** @type {SchemaType} */
2680
- var Schema = class {
2681
- /**
2682
- * @param {SchemaType['property']} property
2683
- * Property.
2684
- * @param {SchemaType['normal']} normal
2685
- * Normal.
2686
- * @param {Space | undefined} [space]
2687
- * Space.
2688
- * @returns
2689
- * Schema.
2690
- */
2691
- constructor(property, normal, space) {
2692
- this.normal = normal;
2693
- this.property = property;
2694
- if (space) this.space = space;
2695
- }
2696
- };
2697
- Schema.prototype.normal = {};
2698
- Schema.prototype.property = {};
2699
- Schema.prototype.space = void 0;
2700
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/merge.js
2701
- /**
2702
- * @import {Info, Space} from 'property-information'
2703
- */
2704
- /**
2705
- * @param {ReadonlyArray<Schema>} definitions
2706
- * Definitions.
2707
- * @param {Space | undefined} [space]
2708
- * Space.
2709
- * @returns {Schema}
2710
- * Schema.
2711
- */
2712
- function merge(definitions, space) {
2713
- /** @type {Record<string, Info>} */
2714
- const property = {};
2715
- /** @type {Record<string, string>} */
2716
- const normal = {};
2717
- for (const definition of definitions) {
2718
- Object.assign(property, definition.property);
2719
- Object.assign(normal, definition.normal);
2720
- }
2721
- return new Schema(property, normal, space);
2722
- }
2723
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/normalize.js
2724
- /**
2725
- * Get the cleaned case insensitive form of an attribute or property.
2726
- *
2727
- * @param {string} value
2728
- * An attribute-like or property-like name.
2729
- * @returns {string}
2730
- * Value that can be used to look up the properly cased property on a
2731
- * `Schema`.
2732
- */
2733
- function normalize(value) {
2734
- return value.toLowerCase();
2735
- }
2736
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/info.js
2737
- /**
2738
- * @import {Info as InfoType} from 'property-information'
2739
- */
2740
- /** @type {InfoType} */
2741
- var Info = class {
2742
- /**
2743
- * @param {string} property
2744
- * Property.
2745
- * @param {string} attribute
2746
- * Attribute.
2747
- * @returns
2748
- * Info.
2749
- */
2750
- constructor(property, attribute) {
2751
- this.attribute = attribute;
2752
- this.property = property;
2753
- }
2754
- };
2755
- Info.prototype.attribute = "";
2756
- Info.prototype.booleanish = false;
2757
- Info.prototype.boolean = false;
2758
- Info.prototype.commaOrSpaceSeparated = false;
2759
- Info.prototype.commaSeparated = false;
2760
- Info.prototype.defined = false;
2761
- Info.prototype.mustUseProperty = false;
2762
- Info.prototype.number = false;
2763
- Info.prototype.overloadedBoolean = false;
2764
- Info.prototype.property = "";
2765
- Info.prototype.spaceSeparated = false;
2766
- Info.prototype.space = void 0;
2767
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/types.js
2768
- var types_exports = /* @__PURE__ */ __exportAll({
2769
- boolean: () => boolean,
2770
- booleanish: () => booleanish,
2771
- commaOrSpaceSeparated: () => commaOrSpaceSeparated,
2772
- commaSeparated: () => commaSeparated,
2773
- number: () => number,
2774
- overloadedBoolean: () => overloadedBoolean,
2775
- spaceSeparated: () => spaceSeparated
2776
- });
2777
- let powers = 0;
2778
- const boolean = increment();
2779
- const booleanish = increment();
2780
- const overloadedBoolean = increment();
2781
- const number = increment();
2782
- const spaceSeparated = increment();
2783
- const commaSeparated = increment();
2784
- const commaOrSpaceSeparated = increment();
2785
- function increment() {
2786
- return 2 ** ++powers;
2787
- }
2788
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/defined-info.js
2789
- /**
2790
- * @import {Space} from 'property-information'
2791
- */
2792
- const checks = Object.keys(types_exports);
2793
- var DefinedInfo = class extends Info {
2794
- /**
2795
- * @constructor
2796
- * @param {string} property
2797
- * Property.
2798
- * @param {string} attribute
2799
- * Attribute.
2800
- * @param {number | null | undefined} [mask]
2801
- * Mask.
2802
- * @param {Space | undefined} [space]
2803
- * Space.
2804
- * @returns
2805
- * Info.
2806
- */
2807
- constructor(property, attribute, mask, space) {
2808
- let index = -1;
2809
- super(property, attribute);
2810
- mark(this, "space", space);
2811
- if (typeof mask === "number") while (++index < checks.length) {
2812
- const check = checks[index];
2813
- mark(this, checks[index], (mask & types_exports[check]) === types_exports[check]);
2814
- }
2815
- }
2816
- };
2817
- DefinedInfo.prototype.defined = true;
2818
- /**
2819
- * @template {keyof DefinedInfo} Key
2820
- * Key type.
2821
- * @param {DefinedInfo} values
2822
- * Info.
2823
- * @param {Key} key
2824
- * Key.
2825
- * @param {DefinedInfo[Key]} value
2826
- * Value.
2827
- * @returns {undefined}
2828
- * Nothing.
2829
- */
2830
- function mark(values, key, value) {
2831
- if (value) values[key] = value;
2832
- }
2833
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/create.js
2834
- /**
2835
- * @import {Info, Space} from 'property-information'
2836
- */
2837
- /**
2838
- * @typedef Definition
2839
- * Definition of a schema.
2840
- * @property {Record<string, string> | undefined} [attributes]
2841
- * Normalzed names to special attribute case.
2842
- * @property {ReadonlyArray<string> | undefined} [mustUseProperty]
2843
- * Normalized names that must be set as properties.
2844
- * @property {Record<string, number | null>} properties
2845
- * Property names to their types.
2846
- * @property {Space | undefined} [space]
2847
- * Space.
2848
- * @property {Transform} transform
2849
- * Transform a property name.
2850
- */
2851
- /**
2852
- * @callback Transform
2853
- * Transform.
2854
- * @param {Record<string, string>} attributes
2855
- * Attributes.
2856
- * @param {string} property
2857
- * Property.
2858
- * @returns {string}
2859
- * Attribute.
2860
- */
2861
- /**
2862
- * @param {Definition} definition
2863
- * Definition.
2864
- * @returns {Schema}
2865
- * Schema.
2866
- */
2867
- function create(definition) {
2868
- /** @type {Record<string, Info>} */
2869
- const properties = {};
2870
- /** @type {Record<string, string>} */
2871
- const normals = {};
2872
- for (const [property, value] of Object.entries(definition.properties)) {
2873
- const info = new DefinedInfo(property, definition.transform(definition.attributes || {}, property), value, definition.space);
2874
- if (definition.mustUseProperty && definition.mustUseProperty.includes(property)) info.mustUseProperty = true;
2875
- properties[property] = info;
2876
- normals[normalize(property)] = property;
2877
- normals[normalize(info.attribute)] = property;
2878
- }
2879
- return new Schema(properties, normals, definition.space);
2880
- }
2881
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/aria.js
2882
- const aria = create({
2883
- properties: {
2884
- ariaActiveDescendant: null,
2885
- ariaAtomic: booleanish,
2886
- ariaAutoComplete: null,
2887
- ariaBusy: booleanish,
2888
- ariaChecked: booleanish,
2889
- ariaColCount: number,
2890
- ariaColIndex: number,
2891
- ariaColSpan: number,
2892
- ariaControls: spaceSeparated,
2893
- ariaCurrent: null,
2894
- ariaDescribedBy: spaceSeparated,
2895
- ariaDetails: null,
2896
- ariaDisabled: booleanish,
2897
- ariaDropEffect: spaceSeparated,
2898
- ariaErrorMessage: null,
2899
- ariaExpanded: booleanish,
2900
- ariaFlowTo: spaceSeparated,
2901
- ariaGrabbed: booleanish,
2902
- ariaHasPopup: null,
2903
- ariaHidden: booleanish,
2904
- ariaInvalid: null,
2905
- ariaKeyShortcuts: null,
2906
- ariaLabel: null,
2907
- ariaLabelledBy: spaceSeparated,
2908
- ariaLevel: number,
2909
- ariaLive: null,
2910
- ariaModal: booleanish,
2911
- ariaMultiLine: booleanish,
2912
- ariaMultiSelectable: booleanish,
2913
- ariaOrientation: null,
2914
- ariaOwns: spaceSeparated,
2915
- ariaPlaceholder: null,
2916
- ariaPosInSet: number,
2917
- ariaPressed: booleanish,
2918
- ariaReadOnly: booleanish,
2919
- ariaRelevant: null,
2920
- ariaRequired: booleanish,
2921
- ariaRoleDescription: spaceSeparated,
2922
- ariaRowCount: number,
2923
- ariaRowIndex: number,
2924
- ariaRowSpan: number,
2925
- ariaSelected: booleanish,
2926
- ariaSetSize: number,
2927
- ariaSort: null,
2928
- ariaValueMax: number,
2929
- ariaValueMin: number,
2930
- ariaValueNow: number,
2931
- ariaValueText: null,
2932
- role: null
2933
- },
2934
- transform(_, property) {
2935
- return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
2936
- }
2937
- });
2938
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-sensitive-transform.js
2939
- /**
2940
- * @param {Record<string, string>} attributes
2941
- * Attributes.
2942
- * @param {string} attribute
2943
- * Attribute.
2944
- * @returns {string}
2945
- * Transformed attribute.
2946
- */
2947
- function caseSensitiveTransform(attributes, attribute) {
2948
- return attribute in attributes ? attributes[attribute] : attribute;
2949
- }
2950
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/util/case-insensitive-transform.js
2951
- /**
2952
- * @param {Record<string, string>} attributes
2953
- * Attributes.
2954
- * @param {string} property
2955
- * Property.
2956
- * @returns {string}
2957
- * Transformed property.
2958
- */
2959
- function caseInsensitiveTransform(attributes, property) {
2960
- return caseSensitiveTransform(attributes, property.toLowerCase());
2961
- }
2962
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/html.js
2963
- const html$3 = create({
2964
- attributes: {
2965
- acceptcharset: "accept-charset",
2966
- classname: "class",
2967
- htmlfor: "for",
2968
- httpequiv: "http-equiv"
2969
- },
2970
- mustUseProperty: [
2971
- "checked",
2972
- "multiple",
2973
- "muted",
2974
- "selected"
2975
- ],
2976
- properties: {
2977
- abbr: null,
2978
- accept: commaSeparated,
2979
- acceptCharset: spaceSeparated,
2980
- accessKey: spaceSeparated,
2981
- action: null,
2982
- allow: null,
2983
- allowFullScreen: boolean,
2984
- allowPaymentRequest: boolean,
2985
- allowUserMedia: boolean,
2986
- alpha: boolean,
2987
- alt: null,
2988
- as: null,
2989
- async: boolean,
2990
- autoCapitalize: null,
2991
- autoComplete: spaceSeparated,
2992
- autoFocus: boolean,
2993
- autoPlay: boolean,
2994
- blocking: spaceSeparated,
2995
- capture: null,
2996
- charSet: null,
2997
- checked: boolean,
2998
- cite: null,
2999
- className: spaceSeparated,
3000
- closedBy: null,
3001
- colorSpace: null,
3002
- cols: number,
3003
- colSpan: number,
3004
- command: null,
3005
- commandFor: null,
3006
- content: null,
3007
- contentEditable: booleanish,
3008
- controls: boolean,
3009
- controlsList: spaceSeparated,
3010
- coords: number | commaSeparated,
3011
- crossOrigin: null,
3012
- data: null,
3013
- dateTime: null,
3014
- decoding: null,
3015
- default: boolean,
3016
- defer: boolean,
3017
- dir: null,
3018
- dirName: null,
3019
- disabled: boolean,
3020
- download: overloadedBoolean,
3021
- draggable: booleanish,
3022
- encType: null,
3023
- enterKeyHint: null,
3024
- fetchPriority: null,
3025
- form: null,
3026
- formAction: null,
3027
- formEncType: null,
3028
- formMethod: null,
3029
- formNoValidate: boolean,
3030
- formTarget: null,
3031
- headers: spaceSeparated,
3032
- height: number,
3033
- hidden: overloadedBoolean,
3034
- high: number,
3035
- href: null,
3036
- hrefLang: null,
3037
- htmlFor: spaceSeparated,
3038
- httpEquiv: spaceSeparated,
3039
- id: null,
3040
- imageSizes: null,
3041
- imageSrcSet: null,
3042
- inert: boolean,
3043
- inputMode: null,
3044
- integrity: null,
3045
- is: null,
3046
- isMap: boolean,
3047
- itemId: null,
3048
- itemProp: spaceSeparated,
3049
- itemRef: spaceSeparated,
3050
- itemScope: boolean,
3051
- itemType: spaceSeparated,
3052
- kind: null,
3053
- label: null,
3054
- lang: null,
3055
- language: null,
3056
- list: null,
3057
- loading: null,
3058
- loop: boolean,
3059
- low: number,
3060
- manifest: null,
3061
- max: null,
3062
- maxLength: number,
3063
- media: null,
3064
- method: null,
3065
- min: null,
3066
- minLength: number,
3067
- multiple: boolean,
3068
- muted: boolean,
3069
- name: null,
3070
- nonce: null,
3071
- noModule: boolean,
3072
- noValidate: boolean,
3073
- onAbort: null,
3074
- onAfterPrint: null,
3075
- onAuxClick: null,
3076
- onBeforeMatch: null,
3077
- onBeforePrint: null,
3078
- onBeforeToggle: null,
3079
- onBeforeUnload: null,
3080
- onBlur: null,
3081
- onCancel: null,
3082
- onCanPlay: null,
3083
- onCanPlayThrough: null,
3084
- onChange: null,
3085
- onClick: null,
3086
- onClose: null,
3087
- onContextLost: null,
3088
- onContextMenu: null,
3089
- onContextRestored: null,
3090
- onCopy: null,
3091
- onCueChange: null,
3092
- onCut: null,
3093
- onDblClick: null,
3094
- onDrag: null,
3095
- onDragEnd: null,
3096
- onDragEnter: null,
3097
- onDragExit: null,
3098
- onDragLeave: null,
3099
- onDragOver: null,
3100
- onDragStart: null,
3101
- onDrop: null,
3102
- onDurationChange: null,
3103
- onEmptied: null,
3104
- onEnded: null,
3105
- onError: null,
3106
- onFocus: null,
3107
- onFormData: null,
3108
- onHashChange: null,
3109
- onInput: null,
3110
- onInvalid: null,
3111
- onKeyDown: null,
3112
- onKeyPress: null,
3113
- onKeyUp: null,
3114
- onLanguageChange: null,
3115
- onLoad: null,
3116
- onLoadedData: null,
3117
- onLoadedMetadata: null,
3118
- onLoadEnd: null,
3119
- onLoadStart: null,
3120
- onMessage: null,
3121
- onMessageError: null,
3122
- onMouseDown: null,
3123
- onMouseEnter: null,
3124
- onMouseLeave: null,
3125
- onMouseMove: null,
3126
- onMouseOut: null,
3127
- onMouseOver: null,
3128
- onMouseUp: null,
3129
- onOffline: null,
3130
- onOnline: null,
3131
- onPageHide: null,
3132
- onPageShow: null,
3133
- onPaste: null,
3134
- onPause: null,
3135
- onPlay: null,
3136
- onPlaying: null,
3137
- onPopState: null,
3138
- onProgress: null,
3139
- onRateChange: null,
3140
- onRejectionHandled: null,
3141
- onReset: null,
3142
- onResize: null,
3143
- onScroll: null,
3144
- onScrollEnd: null,
3145
- onSecurityPolicyViolation: null,
3146
- onSeeked: null,
3147
- onSeeking: null,
3148
- onSelect: null,
3149
- onSlotChange: null,
3150
- onStalled: null,
3151
- onStorage: null,
3152
- onSubmit: null,
3153
- onSuspend: null,
3154
- onTimeUpdate: null,
3155
- onToggle: null,
3156
- onUnhandledRejection: null,
3157
- onUnload: null,
3158
- onVolumeChange: null,
3159
- onWaiting: null,
3160
- onWheel: null,
3161
- open: boolean,
3162
- optimum: number,
3163
- pattern: null,
3164
- ping: spaceSeparated,
3165
- placeholder: null,
3166
- playsInline: boolean,
3167
- popover: null,
3168
- popoverTarget: null,
3169
- popoverTargetAction: null,
3170
- poster: null,
3171
- preload: null,
3172
- readOnly: boolean,
3173
- referrerPolicy: null,
3174
- rel: spaceSeparated,
3175
- required: boolean,
3176
- reversed: boolean,
3177
- rows: number,
3178
- rowSpan: number,
3179
- sandbox: spaceSeparated,
3180
- scope: null,
3181
- scoped: boolean,
3182
- seamless: boolean,
3183
- selected: boolean,
3184
- shadowRootClonable: boolean,
3185
- shadowRootCustomElementRegistry: boolean,
3186
- shadowRootDelegatesFocus: boolean,
3187
- shadowRootMode: null,
3188
- shadowRootSerializable: boolean,
3189
- shape: null,
3190
- size: number,
3191
- sizes: null,
3192
- slot: null,
3193
- span: number,
3194
- spellCheck: booleanish,
3195
- src: null,
3196
- srcDoc: null,
3197
- srcLang: null,
3198
- srcSet: null,
3199
- start: number,
3200
- step: null,
3201
- style: null,
3202
- tabIndex: number,
3203
- target: null,
3204
- title: null,
3205
- translate: null,
3206
- type: null,
3207
- typeMustMatch: boolean,
3208
- useMap: null,
3209
- value: booleanish,
3210
- width: number,
3211
- wrap: null,
3212
- writingSuggestions: null,
3213
- align: null,
3214
- aLink: null,
3215
- archive: spaceSeparated,
3216
- axis: null,
3217
- background: null,
3218
- bgColor: null,
3219
- border: number,
3220
- borderColor: null,
3221
- bottomMargin: number,
3222
- cellPadding: null,
3223
- cellSpacing: null,
3224
- char: null,
3225
- charOff: null,
3226
- classId: null,
3227
- clear: null,
3228
- code: null,
3229
- codeBase: null,
3230
- codeType: null,
3231
- color: null,
3232
- compact: boolean,
3233
- declare: boolean,
3234
- event: null,
3235
- face: null,
3236
- frame: null,
3237
- frameBorder: null,
3238
- hSpace: number,
3239
- leftMargin: number,
3240
- link: null,
3241
- longDesc: null,
3242
- lowSrc: null,
3243
- marginHeight: number,
3244
- marginWidth: number,
3245
- noResize: boolean,
3246
- noHref: boolean,
3247
- noShade: boolean,
3248
- noWrap: boolean,
3249
- object: null,
3250
- profile: null,
3251
- prompt: null,
3252
- rev: null,
3253
- rightMargin: number,
3254
- rules: null,
3255
- scheme: null,
3256
- scrolling: booleanish,
3257
- standby: null,
3258
- summary: null,
3259
- text: null,
3260
- topMargin: number,
3261
- valueType: null,
3262
- version: null,
3263
- vAlign: null,
3264
- vLink: null,
3265
- vSpace: number,
3266
- allowTransparency: null,
3267
- autoCorrect: null,
3268
- autoSave: null,
3269
- credentialless: boolean,
3270
- disablePictureInPicture: boolean,
3271
- disableRemotePlayback: boolean,
3272
- exportParts: commaSeparated,
3273
- part: spaceSeparated,
3274
- prefix: null,
3275
- property: null,
3276
- results: number,
3277
- security: null,
3278
- unselectable: null
3279
- },
3280
- space: "html",
3281
- transform: caseInsensitiveTransform
3282
- });
3283
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/svg.js
3284
- const svg$1 = create({
3285
- attributes: {
3286
- accentHeight: "accent-height",
3287
- alignmentBaseline: "alignment-baseline",
3288
- arabicForm: "arabic-form",
3289
- baselineShift: "baseline-shift",
3290
- capHeight: "cap-height",
3291
- className: "class",
3292
- clipPath: "clip-path",
3293
- clipRule: "clip-rule",
3294
- colorInterpolation: "color-interpolation",
3295
- colorInterpolationFilters: "color-interpolation-filters",
3296
- colorProfile: "color-profile",
3297
- colorRendering: "color-rendering",
3298
- crossOrigin: "crossorigin",
3299
- dataType: "datatype",
3300
- dominantBaseline: "dominant-baseline",
3301
- enableBackground: "enable-background",
3302
- fillOpacity: "fill-opacity",
3303
- fillRule: "fill-rule",
3304
- floodColor: "flood-color",
3305
- floodOpacity: "flood-opacity",
3306
- fontFamily: "font-family",
3307
- fontSize: "font-size",
3308
- fontSizeAdjust: "font-size-adjust",
3309
- fontStretch: "font-stretch",
3310
- fontStyle: "font-style",
3311
- fontVariant: "font-variant",
3312
- fontWeight: "font-weight",
3313
- glyphName: "glyph-name",
3314
- glyphOrientationHorizontal: "glyph-orientation-horizontal",
3315
- glyphOrientationVertical: "glyph-orientation-vertical",
3316
- hrefLang: "hreflang",
3317
- horizAdvX: "horiz-adv-x",
3318
- horizOriginX: "horiz-origin-x",
3319
- horizOriginY: "horiz-origin-y",
3320
- imageRendering: "image-rendering",
3321
- letterSpacing: "letter-spacing",
3322
- lightingColor: "lighting-color",
3323
- markerEnd: "marker-end",
3324
- markerMid: "marker-mid",
3325
- markerStart: "marker-start",
3326
- maskType: "mask-type",
3327
- navDown: "nav-down",
3328
- navDownLeft: "nav-down-left",
3329
- navDownRight: "nav-down-right",
3330
- navLeft: "nav-left",
3331
- navNext: "nav-next",
3332
- navPrev: "nav-prev",
3333
- navRight: "nav-right",
3334
- navUp: "nav-up",
3335
- navUpLeft: "nav-up-left",
3336
- navUpRight: "nav-up-right",
3337
- onAbort: "onabort",
3338
- onActivate: "onactivate",
3339
- onAfterPrint: "onafterprint",
3340
- onBeforePrint: "onbeforeprint",
3341
- onBegin: "onbegin",
3342
- onCancel: "oncancel",
3343
- onCanPlay: "oncanplay",
3344
- onCanPlayThrough: "oncanplaythrough",
3345
- onChange: "onchange",
3346
- onClick: "onclick",
3347
- onClose: "onclose",
3348
- onCopy: "oncopy",
3349
- onCueChange: "oncuechange",
3350
- onCut: "oncut",
3351
- onDblClick: "ondblclick",
3352
- onDrag: "ondrag",
3353
- onDragEnd: "ondragend",
3354
- onDragEnter: "ondragenter",
3355
- onDragExit: "ondragexit",
3356
- onDragLeave: "ondragleave",
3357
- onDragOver: "ondragover",
3358
- onDragStart: "ondragstart",
3359
- onDrop: "ondrop",
3360
- onDurationChange: "ondurationchange",
3361
- onEmptied: "onemptied",
3362
- onEnd: "onend",
3363
- onEnded: "onended",
3364
- onError: "onerror",
3365
- onFocus: "onfocus",
3366
- onFocusIn: "onfocusin",
3367
- onFocusOut: "onfocusout",
3368
- onHashChange: "onhashchange",
3369
- onInput: "oninput",
3370
- onInvalid: "oninvalid",
3371
- onKeyDown: "onkeydown",
3372
- onKeyPress: "onkeypress",
3373
- onKeyUp: "onkeyup",
3374
- onLoad: "onload",
3375
- onLoadedData: "onloadeddata",
3376
- onLoadedMetadata: "onloadedmetadata",
3377
- onLoadStart: "onloadstart",
3378
- onMessage: "onmessage",
3379
- onMouseDown: "onmousedown",
3380
- onMouseEnter: "onmouseenter",
3381
- onMouseLeave: "onmouseleave",
3382
- onMouseMove: "onmousemove",
3383
- onMouseOut: "onmouseout",
3384
- onMouseOver: "onmouseover",
3385
- onMouseUp: "onmouseup",
3386
- onMouseWheel: "onmousewheel",
3387
- onOffline: "onoffline",
3388
- onOnline: "ononline",
3389
- onPageHide: "onpagehide",
3390
- onPageShow: "onpageshow",
3391
- onPaste: "onpaste",
3392
- onPause: "onpause",
3393
- onPlay: "onplay",
3394
- onPlaying: "onplaying",
3395
- onPopState: "onpopstate",
3396
- onProgress: "onprogress",
3397
- onRateChange: "onratechange",
3398
- onRepeat: "onrepeat",
3399
- onReset: "onreset",
3400
- onResize: "onresize",
3401
- onScroll: "onscroll",
3402
- onSeeked: "onseeked",
3403
- onSeeking: "onseeking",
3404
- onSelect: "onselect",
3405
- onShow: "onshow",
3406
- onStalled: "onstalled",
3407
- onStorage: "onstorage",
3408
- onSubmit: "onsubmit",
3409
- onSuspend: "onsuspend",
3410
- onTimeUpdate: "ontimeupdate",
3411
- onToggle: "ontoggle",
3412
- onUnload: "onunload",
3413
- onVolumeChange: "onvolumechange",
3414
- onWaiting: "onwaiting",
3415
- onZoom: "onzoom",
3416
- overlinePosition: "overline-position",
3417
- overlineThickness: "overline-thickness",
3418
- paintOrder: "paint-order",
3419
- panose1: "panose-1",
3420
- pointerEvents: "pointer-events",
3421
- referrerPolicy: "referrerpolicy",
3422
- renderingIntent: "rendering-intent",
3423
- shapeRendering: "shape-rendering",
3424
- stopColor: "stop-color",
3425
- stopOpacity: "stop-opacity",
3426
- strikethroughPosition: "strikethrough-position",
3427
- strikethroughThickness: "strikethrough-thickness",
3428
- strokeDashArray: "stroke-dasharray",
3429
- strokeDashOffset: "stroke-dashoffset",
3430
- strokeLineCap: "stroke-linecap",
3431
- strokeLineJoin: "stroke-linejoin",
3432
- strokeMiterLimit: "stroke-miterlimit",
3433
- strokeOpacity: "stroke-opacity",
3434
- strokeWidth: "stroke-width",
3435
- tabIndex: "tabindex",
3436
- textAnchor: "text-anchor",
3437
- textDecoration: "text-decoration",
3438
- textRendering: "text-rendering",
3439
- transformOrigin: "transform-origin",
3440
- typeOf: "typeof",
3441
- underlinePosition: "underline-position",
3442
- underlineThickness: "underline-thickness",
3443
- unicodeBidi: "unicode-bidi",
3444
- unicodeRange: "unicode-range",
3445
- unitsPerEm: "units-per-em",
3446
- vAlphabetic: "v-alphabetic",
3447
- vHanging: "v-hanging",
3448
- vIdeographic: "v-ideographic",
3449
- vMathematical: "v-mathematical",
3450
- vectorEffect: "vector-effect",
3451
- vertAdvY: "vert-adv-y",
3452
- vertOriginX: "vert-origin-x",
3453
- vertOriginY: "vert-origin-y",
3454
- wordSpacing: "word-spacing",
3455
- writingMode: "writing-mode",
3456
- xHeight: "x-height",
3457
- playbackOrder: "playbackorder",
3458
- timelineBegin: "timelinebegin"
3459
- },
3460
- properties: {
3461
- about: commaOrSpaceSeparated,
3462
- accentHeight: number,
3463
- accumulate: null,
3464
- additive: null,
3465
- alignmentBaseline: null,
3466
- alphabetic: number,
3467
- amplitude: number,
3468
- arabicForm: null,
3469
- ascent: number,
3470
- attributeName: null,
3471
- attributeType: null,
3472
- azimuth: number,
3473
- bandwidth: null,
3474
- baselineShift: null,
3475
- baseFrequency: null,
3476
- baseProfile: null,
3477
- bbox: null,
3478
- begin: null,
3479
- bias: number,
3480
- by: null,
3481
- calcMode: null,
3482
- capHeight: number,
3483
- className: spaceSeparated,
3484
- clip: null,
3485
- clipPath: null,
3486
- clipPathUnits: null,
3487
- clipRule: null,
3488
- color: null,
3489
- colorInterpolation: null,
3490
- colorInterpolationFilters: null,
3491
- colorProfile: null,
3492
- colorRendering: null,
3493
- content: null,
3494
- contentScriptType: null,
3495
- contentStyleType: null,
3496
- crossOrigin: null,
3497
- cursor: null,
3498
- cx: null,
3499
- cy: null,
3500
- d: null,
3501
- dataType: null,
3502
- defaultAction: null,
3503
- descent: number,
3504
- diffuseConstant: number,
3505
- direction: null,
3506
- display: null,
3507
- dur: null,
3508
- divisor: number,
3509
- dominantBaseline: null,
3510
- download: boolean,
3511
- dx: null,
3512
- dy: null,
3513
- edgeMode: null,
3514
- editable: null,
3515
- elevation: number,
3516
- enableBackground: null,
3517
- end: null,
3518
- event: null,
3519
- exponent: number,
3520
- externalResourcesRequired: null,
3521
- fill: null,
3522
- fillOpacity: number,
3523
- fillRule: null,
3524
- filter: null,
3525
- filterRes: null,
3526
- filterUnits: null,
3527
- floodColor: null,
3528
- floodOpacity: null,
3529
- focusable: null,
3530
- focusHighlight: null,
3531
- fontFamily: null,
3532
- fontSize: null,
3533
- fontSizeAdjust: null,
3534
- fontStretch: null,
3535
- fontStyle: null,
3536
- fontVariant: null,
3537
- fontWeight: null,
3538
- format: null,
3539
- fr: null,
3540
- from: null,
3541
- fx: null,
3542
- fy: null,
3543
- g1: commaSeparated,
3544
- g2: commaSeparated,
3545
- glyphName: commaSeparated,
3546
- glyphOrientationHorizontal: null,
3547
- glyphOrientationVertical: null,
3548
- glyphRef: null,
3549
- gradientTransform: null,
3550
- gradientUnits: null,
3551
- handler: null,
3552
- hanging: number,
3553
- hatchContentUnits: null,
3554
- hatchUnits: null,
3555
- height: null,
3556
- href: null,
3557
- hrefLang: null,
3558
- horizAdvX: number,
3559
- horizOriginX: number,
3560
- horizOriginY: number,
3561
- id: null,
3562
- ideographic: number,
3563
- imageRendering: null,
3564
- initialVisibility: null,
3565
- in: null,
3566
- in2: null,
3567
- intercept: number,
3568
- k: number,
3569
- k1: number,
3570
- k2: number,
3571
- k3: number,
3572
- k4: number,
3573
- kernelMatrix: commaOrSpaceSeparated,
3574
- kernelUnitLength: null,
3575
- keyPoints: null,
3576
- keySplines: null,
3577
- keyTimes: null,
3578
- kerning: null,
3579
- lang: null,
3580
- lengthAdjust: null,
3581
- letterSpacing: null,
3582
- lightingColor: null,
3583
- limitingConeAngle: number,
3584
- local: null,
3585
- markerEnd: null,
3586
- markerMid: null,
3587
- markerStart: null,
3588
- markerHeight: null,
3589
- markerUnits: null,
3590
- markerWidth: null,
3591
- mask: null,
3592
- maskContentUnits: null,
3593
- maskType: null,
3594
- maskUnits: null,
3595
- mathematical: null,
3596
- max: null,
3597
- media: null,
3598
- mediaCharacterEncoding: null,
3599
- mediaContentEncodings: null,
3600
- mediaSize: number,
3601
- mediaTime: null,
3602
- method: null,
3603
- min: null,
3604
- mode: null,
3605
- name: null,
3606
- navDown: null,
3607
- navDownLeft: null,
3608
- navDownRight: null,
3609
- navLeft: null,
3610
- navNext: null,
3611
- navPrev: null,
3612
- navRight: null,
3613
- navUp: null,
3614
- navUpLeft: null,
3615
- navUpRight: null,
3616
- numOctaves: null,
3617
- observer: null,
3618
- offset: null,
3619
- onAbort: null,
3620
- onActivate: null,
3621
- onAfterPrint: null,
3622
- onBeforePrint: null,
3623
- onBegin: null,
3624
- onCancel: null,
3625
- onCanPlay: null,
3626
- onCanPlayThrough: null,
3627
- onChange: null,
3628
- onClick: null,
3629
- onClose: null,
3630
- onCopy: null,
3631
- onCueChange: null,
3632
- onCut: null,
3633
- onDblClick: null,
3634
- onDrag: null,
3635
- onDragEnd: null,
3636
- onDragEnter: null,
3637
- onDragExit: null,
3638
- onDragLeave: null,
3639
- onDragOver: null,
3640
- onDragStart: null,
3641
- onDrop: null,
3642
- onDurationChange: null,
3643
- onEmptied: null,
3644
- onEnd: null,
3645
- onEnded: null,
3646
- onError: null,
3647
- onFocus: null,
3648
- onFocusIn: null,
3649
- onFocusOut: null,
3650
- onHashChange: null,
3651
- onInput: null,
3652
- onInvalid: null,
3653
- onKeyDown: null,
3654
- onKeyPress: null,
3655
- onKeyUp: null,
3656
- onLoad: null,
3657
- onLoadedData: null,
3658
- onLoadedMetadata: null,
3659
- onLoadStart: null,
3660
- onMessage: null,
3661
- onMouseDown: null,
3662
- onMouseEnter: null,
3663
- onMouseLeave: null,
3664
- onMouseMove: null,
3665
- onMouseOut: null,
3666
- onMouseOver: null,
3667
- onMouseUp: null,
3668
- onMouseWheel: null,
3669
- onOffline: null,
3670
- onOnline: null,
3671
- onPageHide: null,
3672
- onPageShow: null,
3673
- onPaste: null,
3674
- onPause: null,
3675
- onPlay: null,
3676
- onPlaying: null,
3677
- onPopState: null,
3678
- onProgress: null,
3679
- onRateChange: null,
3680
- onRepeat: null,
3681
- onReset: null,
3682
- onResize: null,
3683
- onScroll: null,
3684
- onSeeked: null,
3685
- onSeeking: null,
3686
- onSelect: null,
3687
- onShow: null,
3688
- onStalled: null,
3689
- onStorage: null,
3690
- onSubmit: null,
3691
- onSuspend: null,
3692
- onTimeUpdate: null,
3693
- onToggle: null,
3694
- onUnload: null,
3695
- onVolumeChange: null,
3696
- onWaiting: null,
3697
- onZoom: null,
3698
- opacity: null,
3699
- operator: null,
3700
- order: null,
3701
- orient: null,
3702
- orientation: null,
3703
- origin: null,
3704
- overflow: null,
3705
- overlay: null,
3706
- overlinePosition: number,
3707
- overlineThickness: number,
3708
- paintOrder: null,
3709
- panose1: null,
3710
- path: null,
3711
- pathLength: number,
3712
- patternContentUnits: null,
3713
- patternTransform: null,
3714
- patternUnits: null,
3715
- phase: null,
3716
- ping: spaceSeparated,
3717
- pitch: null,
3718
- playbackOrder: null,
3719
- pointerEvents: null,
3720
- points: null,
3721
- pointsAtX: number,
3722
- pointsAtY: number,
3723
- pointsAtZ: number,
3724
- preserveAlpha: null,
3725
- preserveAspectRatio: null,
3726
- primitiveUnits: null,
3727
- propagate: null,
3728
- property: commaOrSpaceSeparated,
3729
- r: null,
3730
- radius: null,
3731
- referrerPolicy: null,
3732
- refX: null,
3733
- refY: null,
3734
- rel: commaOrSpaceSeparated,
3735
- rev: commaOrSpaceSeparated,
3736
- renderingIntent: null,
3737
- repeatCount: null,
3738
- repeatDur: null,
3739
- requiredExtensions: commaOrSpaceSeparated,
3740
- requiredFeatures: commaOrSpaceSeparated,
3741
- requiredFonts: commaOrSpaceSeparated,
3742
- requiredFormats: commaOrSpaceSeparated,
3743
- resource: null,
3744
- restart: null,
3745
- result: null,
3746
- rotate: null,
3747
- rx: null,
3748
- ry: null,
3749
- scale: null,
3750
- seed: null,
3751
- shapeRendering: null,
3752
- side: null,
3753
- slope: null,
3754
- snapshotTime: null,
3755
- specularConstant: number,
3756
- specularExponent: number,
3757
- spreadMethod: null,
3758
- spacing: null,
3759
- startOffset: null,
3760
- stdDeviation: null,
3761
- stemh: null,
3762
- stemv: null,
3763
- stitchTiles: null,
3764
- stopColor: null,
3765
- stopOpacity: null,
3766
- strikethroughPosition: number,
3767
- strikethroughThickness: number,
3768
- string: null,
3769
- stroke: null,
3770
- strokeDashArray: commaOrSpaceSeparated,
3771
- strokeDashOffset: null,
3772
- strokeLineCap: null,
3773
- strokeLineJoin: null,
3774
- strokeMiterLimit: number,
3775
- strokeOpacity: number,
3776
- strokeWidth: null,
3777
- style: null,
3778
- surfaceScale: number,
3779
- syncBehavior: null,
3780
- syncBehaviorDefault: null,
3781
- syncMaster: null,
3782
- syncTolerance: null,
3783
- syncToleranceDefault: null,
3784
- systemLanguage: commaOrSpaceSeparated,
3785
- tabIndex: number,
3786
- tableValues: null,
3787
- target: null,
3788
- targetX: number,
3789
- targetY: number,
3790
- textAnchor: null,
3791
- textDecoration: null,
3792
- textRendering: null,
3793
- textLength: null,
3794
- timelineBegin: null,
3795
- title: null,
3796
- transformBehavior: null,
3797
- type: null,
3798
- typeOf: commaOrSpaceSeparated,
3799
- to: null,
3800
- transform: null,
3801
- transformOrigin: null,
3802
- u1: null,
3803
- u2: null,
3804
- underlinePosition: number,
3805
- underlineThickness: number,
3806
- unicode: null,
3807
- unicodeBidi: null,
3808
- unicodeRange: null,
3809
- unitsPerEm: number,
3810
- values: null,
3811
- vAlphabetic: number,
3812
- vMathematical: number,
3813
- vectorEffect: null,
3814
- vHanging: number,
3815
- vIdeographic: number,
3816
- version: null,
3817
- vertAdvY: number,
3818
- vertOriginX: number,
3819
- vertOriginY: number,
3820
- viewBox: null,
3821
- viewTarget: null,
3822
- visibility: null,
3823
- width: null,
3824
- widths: null,
3825
- wordSpacing: null,
3826
- writingMode: null,
3827
- x: null,
3828
- x1: null,
3829
- x2: null,
3830
- xChannelSelector: null,
3831
- xHeight: number,
3832
- y: null,
3833
- y1: null,
3834
- y2: null,
3835
- yChannelSelector: null,
3836
- z: null,
3837
- zoomAndPan: null
3838
- },
3839
- space: "svg",
3840
- transform: caseSensitiveTransform
3841
- });
3842
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xlink.js
3843
- const xlink = create({
3844
- properties: {
3845
- xLinkActuate: null,
3846
- xLinkArcRole: null,
3847
- xLinkHref: null,
3848
- xLinkRole: null,
3849
- xLinkShow: null,
3850
- xLinkTitle: null,
3851
- xLinkType: null
3852
- },
3853
- space: "xlink",
3854
- transform(_, property) {
3855
- return "xlink:" + property.slice(5).toLowerCase();
3856
- }
3857
- });
3858
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xmlns.js
3859
- const xmlns = create({
3860
- attributes: { xmlnsxlink: "xmlns:xlink" },
3861
- properties: {
3862
- xmlnsXLink: null,
3863
- xmlns: null
3864
- },
3865
- space: "xmlns",
3866
- transform: caseInsensitiveTransform
3867
- });
3868
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/xml.js
3869
- const xml = create({
3870
- properties: {
3871
- xmlBase: null,
3872
- xmlLang: null,
3873
- xmlSpace: null
3874
- },
3875
- space: "xml",
3876
- transform(_, property) {
3877
- return "xml:" + property.slice(3).toLowerCase();
3878
- }
3879
- });
3880
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/lib/find.js
3881
- /**
3882
- * @import {Schema} from 'property-information'
3883
- */
3884
- const cap = /[A-Z]/g;
3885
- const dash = /-[a-z]/g;
3886
- const valid = /^data[-\w.:]+$/i;
3887
- /**
3888
- * Look up info on a property.
3889
- *
3890
- * In most cases the given `schema` contains info on the property.
3891
- * All standard,
3892
- * most legacy,
3893
- * and some non-standard properties are supported.
3894
- * For these cases,
3895
- * the returned `Info` has hints about the value of the property.
3896
- *
3897
- * `name` can also be a valid data attribute or property,
3898
- * in which case an `Info` object with the correctly cased `attribute` and
3899
- * `property` is returned.
3900
- *
3901
- * `name` can be an unknown attribute,
3902
- * in which case an `Info` object with `attribute` and `property` set to the
3903
- * given name is returned.
3904
- * It is not recommended to provide unsupported legacy or recently specced
3905
- * properties.
3906
- *
3907
- *
3908
- * @param {Schema} schema
3909
- * Schema;
3910
- * either the `html` or `svg` export.
3911
- * @param {string} value
3912
- * An attribute-like or property-like name;
3913
- * it will be passed through `normalize` to hopefully find the correct info.
3914
- * @returns {Info}
3915
- * Info.
3916
- */
3917
- function find(schema, value) {
3918
- const normal = normalize(value);
3919
- let property = value;
3920
- let Type = Info;
3921
- if (normal in schema.normal) return schema.property[schema.normal[normal]];
3922
- if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) {
3923
- if (value.charAt(4) === "-") {
3924
- const rest = value.slice(5).replace(dash, camelcase);
3925
- property = "data" + rest.charAt(0).toUpperCase() + rest.slice(1);
3926
- } else {
3927
- const rest = value.slice(4);
3928
- if (!dash.test(rest)) {
3929
- let dashes = rest.replace(cap, kebab);
3930
- if (dashes.charAt(0) !== "-") dashes = "-" + dashes;
3931
- value = "data" + dashes;
3932
- }
3933
- }
3934
- Type = DefinedInfo;
3935
- }
3936
- return new Type(property, value);
3937
- }
3938
- /**
3939
- * @param {string} $0
3940
- * Value.
3941
- * @returns {string}
3942
- * Kebab.
3943
- */
3944
- function kebab($0) {
3945
- return "-" + $0.toLowerCase();
3946
- }
3947
- /**
3948
- * @param {string} $0
3949
- * Value.
3950
- * @returns {string}
3951
- * Camel.
3952
- */
3953
- function camelcase($0) {
3954
- return $0.charAt(1).toUpperCase();
3955
- }
3956
- // ../../node_modules/.pnpm/property-information@7.2.0/node_modules/property-information/index.js
3957
- const html$2 = merge([
3958
- aria,
3959
- html$3,
3960
- xlink,
3961
- xmlns,
3962
- xml
3963
- ], "html");
3964
- const svg = merge([
3965
- aria,
3966
- svg$1,
3967
- xlink,
3968
- xmlns,
3969
- xml
3970
- ], "svg");
3971
- // ../../node_modules/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.js
3972
- /**
3973
- * @callback Handler
3974
- * Handle a value, with a certain ID field set to a certain value.
3975
- * The ID field is passed to `zwitch`, and it’s value is this function’s
3976
- * place on the `handlers` record.
3977
- * @param {...any} parameters
3978
- * Arbitrary parameters passed to the zwitch.
3979
- * The first will be an object with a certain ID field set to a certain value.
3980
- * @returns {any}
3981
- * Anything!
3982
- */
3983
- /**
3984
- * @callback UnknownHandler
3985
- * Handle values that do have a certain ID field, but it’s set to a value
3986
- * that is not listed in the `handlers` record.
3987
- * @param {unknown} value
3988
- * An object with a certain ID field set to an unknown value.
3989
- * @param {...any} rest
3990
- * Arbitrary parameters passed to the zwitch.
3991
- * @returns {any}
3992
- * Anything!
3993
- */
3994
- /**
3995
- * @callback InvalidHandler
3996
- * Handle values that do not have a certain ID field.
3997
- * @param {unknown} value
3998
- * Any unknown value.
3999
- * @param {...any} rest
4000
- * Arbitrary parameters passed to the zwitch.
4001
- * @returns {void|null|undefined|never}
4002
- * This should crash or return nothing.
4003
- */
4004
- /**
4005
- * @template {InvalidHandler} [Invalid=InvalidHandler]
4006
- * @template {UnknownHandler} [Unknown=UnknownHandler]
4007
- * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
4008
- * @typedef Options
4009
- * Configuration (required).
4010
- * @property {Invalid} [invalid]
4011
- * Handler to use for invalid values.
4012
- * @property {Unknown} [unknown]
4013
- * Handler to use for unknown values.
4014
- * @property {Handlers} [handlers]
4015
- * Handlers to use.
4016
- */
4017
- const own$2 = {}.hasOwnProperty;
4018
- /**
4019
- * Handle values based on a field.
4020
- *
4021
- * @template {InvalidHandler} [Invalid=InvalidHandler]
4022
- * @template {UnknownHandler} [Unknown=UnknownHandler]
4023
- * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
4024
- * @param {string} key
4025
- * Field to switch on.
4026
- * @param {Options<Invalid, Unknown, Handlers>} [options]
4027
- * Configuration (required).
4028
- * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}
4029
- */
4030
- function zwitch(key, options) {
4031
- const settings = options || {};
4032
- /**
4033
- * Handle one value.
4034
- *
4035
- * Based on the bound `key`, a respective handler will be called.
4036
- * If `value` is not an object, or doesn’t have a `key` property, the special
4037
- * “invalid” handler will be called.
4038
- * If `value` has an unknown `key`, the special “unknown” handler will be
4039
- * called.
4040
- *
4041
- * All arguments, and the context object, are passed through to the handler,
4042
- * and it’s result is returned.
4043
- *
4044
- * @this {unknown}
4045
- * Any context object.
4046
- * @param {unknown} [value]
4047
- * Any value.
4048
- * @param {...unknown} parameters
4049
- * Arbitrary parameters passed to the zwitch.
4050
- * @property {Handler} invalid
4051
- * Handle for values that do not have a certain ID field.
4052
- * @property {Handler} unknown
4053
- * Handle values that do have a certain ID field, but it’s set to a value
4054
- * that is not listed in the `handlers` record.
4055
- * @property {Handlers} handlers
4056
- * Record of handlers.
4057
- * @returns {unknown}
4058
- * Anything.
4059
- */
4060
- function one(value, ...parameters) {
4061
- /** @type {Handler|undefined} */
4062
- let fn = one.invalid;
4063
- const handlers = one.handlers;
4064
- if (value && own$2.call(value, key)) {
4065
- const id = String(value[key]);
4066
- fn = own$2.call(handlers, id) ? handlers[id] : one.unknown;
4067
- }
4068
- if (fn) return fn.call(this, value, ...parameters);
4069
- }
4070
- one.handlers = settings.handlers || {};
4071
- one.invalid = settings.invalid;
4072
- one.unknown = settings.unknown;
4073
- return one;
4074
- }
4075
- // ../../node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/core.js
4076
- /**
4077
- * @typedef CoreOptions
4078
- * @property {ReadonlyArray<string>} [subset=[]]
4079
- * Whether to only escape the given subset of characters.
4080
- * @property {boolean} [escapeOnly=false]
4081
- * Whether to only escape possibly dangerous characters.
4082
- * Those characters are `"`, `&`, `'`, `<`, `>`, and `` ` ``.
4083
- *
4084
- * @typedef FormatOptions
4085
- * @property {(code: number, next: number, options: CoreWithFormatOptions) => string} format
4086
- * Format strategy.
4087
- *
4088
- * @typedef {CoreOptions & FormatOptions & import('./util/format-smart.js').FormatSmartOptions} CoreWithFormatOptions
4089
- */
4090
- const defaultSubsetRegex = /["&'<>`]/g;
4091
- const surrogatePairsRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
4092
- const controlCharactersRegex = /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;
4093
- const regexEscapeRegex = /[|\\{}()[\]^$+*?.]/g;
4094
- /** @type {WeakMap<ReadonlyArray<string>, RegExp>} */
4095
- const subsetToRegexCache = /* @__PURE__ */ new WeakMap();
4096
- /**
4097
- * Encode certain characters in `value`.
4098
- *
4099
- * @param {string} value
4100
- * @param {CoreWithFormatOptions} options
4101
- * @returns {string}
4102
- */
4103
- function core(value, options) {
4104
- value = value.replace(options.subset ? charactersToExpressionCached(options.subset) : defaultSubsetRegex, basic);
4105
- if (options.subset || options.escapeOnly) return value;
4106
- return value.replace(surrogatePairsRegex, surrogate).replace(controlCharactersRegex, basic);
4107
- /**
4108
- * @param {string} pair
4109
- * @param {number} index
4110
- * @param {string} all
4111
- */
4112
- function surrogate(pair, index, all) {
4113
- return options.format((pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536, all.charCodeAt(index + 2), options);
4114
- }
4115
- /**
4116
- * @param {string} character
4117
- * @param {number} index
4118
- * @param {string} all
4119
- */
4120
- function basic(character, index, all) {
4121
- return options.format(character.charCodeAt(0), all.charCodeAt(index + 1), options);
4122
- }
4123
- }
4124
- /**
4125
- * A wrapper function that caches the result of `charactersToExpression` with a WeakMap.
4126
- * This can improve performance when tooling calls `charactersToExpression` repeatedly
4127
- * with the same subset.
4128
- *
4129
- * @param {ReadonlyArray<string>} subset
4130
- * @returns {RegExp}
4131
- */
4132
- function charactersToExpressionCached(subset) {
4133
- let cached = subsetToRegexCache.get(subset);
4134
- if (!cached) {
4135
- cached = charactersToExpression(subset);
4136
- subsetToRegexCache.set(subset, cached);
4137
- }
4138
- return cached;
4139
- }
4140
- /**
4141
- * @param {ReadonlyArray<string>} subset
4142
- * @returns {RegExp}
4143
- */
4144
- function charactersToExpression(subset) {
4145
- /** @type {Array<string>} */
4146
- const groups = [];
4147
- let index = -1;
4148
- while (++index < subset.length) groups.push(subset[index].replace(regexEscapeRegex, "\\$&"));
4149
- return new RegExp("(?:" + groups.join("|") + ")", "g");
4150
- }
4151
- // ../../node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-hexadecimal.js
4152
- const hexadecimalRegex = /[\dA-Fa-f]/;
4153
- /**
4154
- * Configurable ways to encode characters as hexadecimal references.
4155
- *
4156
- * @param {number} code
4157
- * @param {number} next
4158
- * @param {boolean|undefined} omit
4159
- * @returns {string}
4160
- */
4161
- function toHexadecimal(code, next, omit) {
4162
- const value = "&#x" + code.toString(16).toUpperCase();
4163
- return omit && next && !hexadecimalRegex.test(String.fromCharCode(next)) ? value : value + ";";
4164
- }
4165
- // ../../node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-decimal.js
4166
- const decimalRegex = /\d/;
4167
- /**
4168
- * Configurable ways to encode characters as decimal references.
4169
- *
4170
- * @param {number} code
4171
- * @param {number} next
4172
- * @param {boolean|undefined} omit
4173
- * @returns {string}
4174
- */
4175
- function toDecimal(code, next, omit) {
4176
- const value = "&#" + String(code);
4177
- return omit && next && !decimalRegex.test(String.fromCharCode(next)) ? value : value + ";";
4178
- }
4179
- // ../../node_modules/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js
4180
- /**
4181
- * List of legacy HTML named character references that don’t need a trailing semicolon.
4182
- *
4183
- * @type {Array<string>}
4184
- */
4185
- const characterEntitiesLegacy = [
4186
- "AElig",
4187
- "AMP",
4188
- "Aacute",
4189
- "Acirc",
4190
- "Agrave",
4191
- "Aring",
4192
- "Atilde",
4193
- "Auml",
4194
- "COPY",
4195
- "Ccedil",
4196
- "ETH",
4197
- "Eacute",
4198
- "Ecirc",
4199
- "Egrave",
4200
- "Euml",
4201
- "GT",
4202
- "Iacute",
4203
- "Icirc",
4204
- "Igrave",
4205
- "Iuml",
4206
- "LT",
4207
- "Ntilde",
4208
- "Oacute",
4209
- "Ocirc",
4210
- "Ograve",
4211
- "Oslash",
4212
- "Otilde",
4213
- "Ouml",
4214
- "QUOT",
4215
- "REG",
4216
- "THORN",
4217
- "Uacute",
4218
- "Ucirc",
4219
- "Ugrave",
4220
- "Uuml",
4221
- "Yacute",
4222
- "aacute",
4223
- "acirc",
4224
- "acute",
4225
- "aelig",
4226
- "agrave",
4227
- "amp",
4228
- "aring",
4229
- "atilde",
4230
- "auml",
4231
- "brvbar",
4232
- "ccedil",
4233
- "cedil",
4234
- "cent",
4235
- "copy",
4236
- "curren",
4237
- "deg",
4238
- "divide",
4239
- "eacute",
4240
- "ecirc",
4241
- "egrave",
4242
- "eth",
4243
- "euml",
4244
- "frac12",
4245
- "frac14",
4246
- "frac34",
4247
- "gt",
4248
- "iacute",
4249
- "icirc",
4250
- "iexcl",
4251
- "igrave",
4252
- "iquest",
4253
- "iuml",
4254
- "laquo",
4255
- "lt",
4256
- "macr",
4257
- "micro",
4258
- "middot",
4259
- "nbsp",
4260
- "not",
4261
- "ntilde",
4262
- "oacute",
4263
- "ocirc",
4264
- "ograve",
4265
- "ordf",
4266
- "ordm",
4267
- "oslash",
4268
- "otilde",
4269
- "ouml",
4270
- "para",
4271
- "plusmn",
4272
- "pound",
4273
- "quot",
4274
- "raquo",
4275
- "reg",
4276
- "sect",
4277
- "shy",
4278
- "sup1",
4279
- "sup2",
4280
- "sup3",
4281
- "szlig",
4282
- "thorn",
4283
- "times",
4284
- "uacute",
4285
- "ucirc",
4286
- "ugrave",
4287
- "uml",
4288
- "uuml",
4289
- "yacute",
4290
- "yen",
4291
- "yuml"
4292
- ];
4293
- // ../../node_modules/.pnpm/character-entities-html4@2.1.0/node_modules/character-entities-html4/index.js
4294
- /**
4295
- * Map of named character references from HTML 4.
4296
- *
4297
- * @type {Record<string, string>}
4298
- */
4299
- const characterEntitiesHtml4 = {
4300
- nbsp: "\xA0",
4301
- iexcl: "¡",
4302
- cent: "¢",
4303
- pound: "£",
4304
- curren: "¤",
4305
- yen: "¥",
4306
- brvbar: "¦",
4307
- sect: "§",
4308
- uml: "¨",
4309
- copy: "©",
4310
- ordf: "ª",
4311
- laquo: "«",
4312
- not: "¬",
4313
- shy: "­",
4314
- reg: "®",
4315
- macr: "¯",
4316
- deg: "°",
4317
- plusmn: "±",
4318
- sup2: "²",
4319
- sup3: "³",
4320
- acute: "´",
4321
- micro: "µ",
4322
- para: "¶",
4323
- middot: "·",
4324
- cedil: "¸",
4325
- sup1: "¹",
4326
- ordm: "º",
4327
- raquo: "»",
4328
- frac14: "¼",
4329
- frac12: "½",
4330
- frac34: "¾",
4331
- iquest: "¿",
4332
- Agrave: "À",
4333
- Aacute: "Á",
4334
- Acirc: "Â",
4335
- Atilde: "Ã",
4336
- Auml: "Ä",
4337
- Aring: "Å",
4338
- AElig: "Æ",
4339
- Ccedil: "Ç",
4340
- Egrave: "È",
4341
- Eacute: "É",
4342
- Ecirc: "Ê",
4343
- Euml: "Ë",
4344
- Igrave: "Ì",
4345
- Iacute: "Í",
4346
- Icirc: "Î",
4347
- Iuml: "Ï",
4348
- ETH: "Ð",
4349
- Ntilde: "Ñ",
4350
- Ograve: "Ò",
4351
- Oacute: "Ó",
4352
- Ocirc: "Ô",
4353
- Otilde: "Õ",
4354
- Ouml: "Ö",
4355
- times: "×",
4356
- Oslash: "Ø",
4357
- Ugrave: "Ù",
4358
- Uacute: "Ú",
4359
- Ucirc: "Û",
4360
- Uuml: "Ü",
4361
- Yacute: "Ý",
4362
- THORN: "Þ",
4363
- szlig: "ß",
4364
- agrave: "à",
4365
- aacute: "á",
4366
- acirc: "â",
4367
- atilde: "ã",
4368
- auml: "ä",
4369
- aring: "å",
4370
- aelig: "æ",
4371
- ccedil: "ç",
4372
- egrave: "è",
4373
- eacute: "é",
4374
- ecirc: "ê",
4375
- euml: "ë",
4376
- igrave: "ì",
4377
- iacute: "í",
4378
- icirc: "î",
4379
- iuml: "ï",
4380
- eth: "ð",
4381
- ntilde: "ñ",
4382
- ograve: "ò",
4383
- oacute: "ó",
4384
- ocirc: "ô",
4385
- otilde: "õ",
4386
- ouml: "ö",
4387
- divide: "÷",
4388
- oslash: "ø",
4389
- ugrave: "ù",
4390
- uacute: "ú",
4391
- ucirc: "û",
4392
- uuml: "ü",
4393
- yacute: "ý",
4394
- thorn: "þ",
4395
- yuml: "ÿ",
4396
- fnof: "ƒ",
4397
- Alpha: "Α",
4398
- Beta: "Β",
4399
- Gamma: "Γ",
4400
- Delta: "Δ",
4401
- Epsilon: "Ε",
4402
- Zeta: "Ζ",
4403
- Eta: "Η",
4404
- Theta: "Θ",
4405
- Iota: "Ι",
4406
- Kappa: "Κ",
4407
- Lambda: "Λ",
4408
- Mu: "Μ",
4409
- Nu: "Ν",
4410
- Xi: "Ξ",
4411
- Omicron: "Ο",
4412
- Pi: "Π",
4413
- Rho: "Ρ",
4414
- Sigma: "Σ",
4415
- Tau: "Τ",
4416
- Upsilon: "Υ",
4417
- Phi: "Φ",
4418
- Chi: "Χ",
4419
- Psi: "Ψ",
4420
- Omega: "Ω",
4421
- alpha: "α",
4422
- beta: "β",
4423
- gamma: "γ",
4424
- delta: "δ",
4425
- epsilon: "ε",
4426
- zeta: "ζ",
4427
- eta: "η",
4428
- theta: "θ",
4429
- iota: "ι",
4430
- kappa: "κ",
4431
- lambda: "λ",
4432
- mu: "μ",
4433
- nu: "ν",
4434
- xi: "ξ",
4435
- omicron: "ο",
4436
- pi: "π",
4437
- rho: "ρ",
4438
- sigmaf: "ς",
4439
- sigma: "σ",
4440
- tau: "τ",
4441
- upsilon: "υ",
4442
- phi: "φ",
4443
- chi: "χ",
4444
- psi: "ψ",
4445
- omega: "ω",
4446
- thetasym: "ϑ",
4447
- upsih: "ϒ",
4448
- piv: "ϖ",
4449
- bull: "•",
4450
- hellip: "…",
4451
- prime: "′",
4452
- Prime: "″",
4453
- oline: "‾",
4454
- frasl: "⁄",
4455
- weierp: "℘",
4456
- image: "ℑ",
4457
- real: "ℜ",
4458
- trade: "™",
4459
- alefsym: "ℵ",
4460
- larr: "←",
4461
- uarr: "↑",
4462
- rarr: "→",
4463
- darr: "↓",
4464
- harr: "↔",
4465
- crarr: "↵",
4466
- lArr: "⇐",
4467
- uArr: "⇑",
4468
- rArr: "⇒",
4469
- dArr: "⇓",
4470
- hArr: "⇔",
4471
- forall: "∀",
4472
- part: "∂",
4473
- exist: "∃",
4474
- empty: "∅",
4475
- nabla: "∇",
4476
- isin: "∈",
4477
- notin: "∉",
4478
- ni: "∋",
4479
- prod: "∏",
4480
- sum: "∑",
4481
- minus: "−",
4482
- lowast: "∗",
4483
- radic: "√",
4484
- prop: "∝",
4485
- infin: "∞",
4486
- ang: "∠",
4487
- and: "∧",
4488
- or: "∨",
4489
- cap: "∩",
4490
- cup: "∪",
4491
- int: "∫",
4492
- there4: "∴",
4493
- sim: "∼",
4494
- cong: "≅",
4495
- asymp: "≈",
4496
- ne: "≠",
4497
- equiv: "≡",
4498
- le: "≤",
4499
- ge: "≥",
4500
- sub: "⊂",
4501
- sup: "⊃",
4502
- nsub: "⊄",
4503
- sube: "⊆",
4504
- supe: "⊇",
4505
- oplus: "⊕",
4506
- otimes: "⊗",
4507
- perp: "⊥",
4508
- sdot: "⋅",
4509
- lceil: "⌈",
4510
- rceil: "⌉",
4511
- lfloor: "⌊",
4512
- rfloor: "⌋",
4513
- lang: "〈",
4514
- rang: "〉",
4515
- loz: "◊",
4516
- spades: "♠",
4517
- clubs: "♣",
4518
- hearts: "♥",
4519
- diams: "♦",
4520
- quot: "\"",
4521
- amp: "&",
4522
- lt: "<",
4523
- gt: ">",
4524
- OElig: "Œ",
4525
- oelig: "œ",
4526
- Scaron: "Š",
4527
- scaron: "š",
4528
- Yuml: "Ÿ",
4529
- circ: "ˆ",
4530
- tilde: "˜",
4531
- ensp: " ",
4532
- emsp: " ",
4533
- thinsp: " ",
4534
- zwnj: "‌",
4535
- zwj: "‍",
4536
- lrm: "‎",
4537
- rlm: "‏",
4538
- ndash: "–",
4539
- mdash: "—",
4540
- lsquo: "‘",
4541
- rsquo: "’",
4542
- sbquo: "‚",
4543
- ldquo: "“",
4544
- rdquo: "”",
4545
- bdquo: "„",
4546
- dagger: "†",
4547
- Dagger: "‡",
4548
- permil: "‰",
4549
- lsaquo: "‹",
4550
- rsaquo: "›",
4551
- euro: "€"
4552
- };
4553
- // ../../node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/constant/dangerous.js
4554
- /**
4555
- * List of legacy (that don’t need a trailing `;`) named references which could,
4556
- * depending on what follows them, turn into a different meaning
4557
- *
4558
- * @type {Array<string>}
4559
- */
4560
- const dangerous = [
4561
- "cent",
4562
- "copy",
4563
- "divide",
4564
- "gt",
4565
- "lt",
4566
- "not",
4567
- "para",
4568
- "times"
4569
- ];
4570
- // ../../node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-named.js
4571
- const own$1 = {}.hasOwnProperty;
4572
- /**
4573
- * `characterEntitiesHtml4` but inverted.
4574
- *
4575
- * @type {Record<string, string>}
4576
- */
4577
- const characters = {};
4578
- /** @type {string} */
4579
- let key;
4580
- for (key in characterEntitiesHtml4) if (own$1.call(characterEntitiesHtml4, key)) characters[characterEntitiesHtml4[key]] = key;
4581
- const notAlphanumericRegex = /[^\dA-Za-z]/;
4582
- /**
4583
- * Configurable ways to encode characters as named references.
4584
- *
4585
- * @param {number} code
4586
- * @param {number} next
4587
- * @param {boolean|undefined} omit
4588
- * @param {boolean|undefined} attribute
4589
- * @returns {string}
4590
- */
4591
- function toNamed(code, next, omit, attribute) {
4592
- const character = String.fromCharCode(code);
4593
- if (own$1.call(characters, character)) {
4594
- const name = characters[character];
4595
- const value = "&" + name;
4596
- if (omit && characterEntitiesLegacy.includes(name) && !dangerous.includes(name) && (!attribute || next && next !== 61 && notAlphanumericRegex.test(String.fromCharCode(next)))) return value;
4597
- return value + ";";
4598
- }
4599
- return "";
4600
- }
4601
- // ../../node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/format-smart.js
4602
- /**
4603
- * @typedef FormatSmartOptions
4604
- * @property {boolean} [useNamedReferences=false]
4605
- * Prefer named character references (`&amp;`) where possible.
4606
- * @property {boolean} [useShortestReferences=false]
4607
- * Prefer the shortest possible reference, if that results in less bytes.
4608
- * **Note**: `useNamedReferences` can be omitted when using `useShortestReferences`.
4609
- * @property {boolean} [omitOptionalSemicolons=false]
4610
- * Whether to omit semicolons when possible.
4611
- * **Note**: This creates what HTML calls “parse errors” but is otherwise still valid HTML — don’t use this except when building a minifier.
4612
- * Omitting semicolons is possible for certain named and numeric references in some cases.
4613
- * @property {boolean} [attribute=false]
4614
- * Create character references which don’t fail in attributes.
4615
- * **Note**: `attribute` only applies when operating dangerously with
4616
- * `omitOptionalSemicolons: true`.
4617
- */
4618
- /**
4619
- * Configurable ways to encode a character yielding pretty or small results.
4620
- *
4621
- * @param {number} code
4622
- * @param {number} next
4623
- * @param {FormatSmartOptions} options
4624
- * @returns {string}
4625
- */
4626
- function formatSmart(code, next, options) {
4627
- let numeric = toHexadecimal(code, next, options.omitOptionalSemicolons);
4628
- /** @type {string|undefined} */
4629
- let named;
4630
- if (options.useNamedReferences || options.useShortestReferences) named = toNamed(code, next, options.omitOptionalSemicolons, options.attribute);
4631
- if ((options.useShortestReferences || !named) && options.useShortestReferences) {
4632
- const decimal = toDecimal(code, next, options.omitOptionalSemicolons);
4633
- if (decimal.length < numeric.length) numeric = decimal;
4634
- }
4635
- return named && (!options.useShortestReferences || named.length < numeric.length) ? named : numeric;
4636
- }
4637
- // ../../node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/index.js
4638
- /**
4639
- * @typedef {import('./core.js').CoreOptions & import('./util/format-smart.js').FormatSmartOptions} Options
4640
- * @typedef {import('./core.js').CoreOptions} LightOptions
4641
- */
4642
- /**
4643
- * Encode special characters in `value`.
4644
- *
4645
- * @param {string} value
4646
- * Value to encode.
4647
- * @param {Options} [options]
4648
- * Configuration.
4649
- * @returns {string}
4650
- * Encoded value.
4651
- */
4652
- function stringifyEntities(value, options) {
4653
- return core(value, Object.assign({ format: formatSmart }, options));
4654
- }
4655
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/comment.js
4656
- /**
4657
- * @import {Comment, Parents} from 'hast'
4658
- * @import {State} from '../index.js'
4659
- */
4660
- const htmlCommentRegex = /^>|^->|<!--|-->|--!>|<!-$/g;
4661
- const bogusCommentEntitySubset = [">"];
4662
- const commentEntitySubset = ["<", ">"];
4663
- /**
4664
- * Serialize a comment.
4665
- *
4666
- * @param {Comment} node
4667
- * Node to handle.
4668
- * @param {number | undefined} _1
4669
- * Index of `node` in `parent.
4670
- * @param {Parents | undefined} _2
4671
- * Parent of `node`.
4672
- * @param {State} state
4673
- * Info passed around about the current state.
4674
- * @returns {string}
4675
- * Serialized node.
4676
- */
4677
- function comment(node, _1, _2, state) {
4678
- return state.settings.bogusComments ? "<?" + stringifyEntities(node.value, Object.assign({}, state.settings.characterReferences, { subset: bogusCommentEntitySubset })) + ">" : "<!--" + node.value.replace(htmlCommentRegex, encode) + "-->";
4679
- /**
4680
- * @param {string} $0
4681
- */
4682
- function encode($0) {
4683
- return stringifyEntities($0, Object.assign({}, state.settings.characterReferences, { subset: commentEntitySubset }));
4684
- }
4685
- }
4686
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/doctype.js
4687
- /**
4688
- * @import {Doctype, Parents} from 'hast'
4689
- * @import {State} from '../index.js'
4690
- */
4691
- /**
4692
- * Serialize a doctype.
4693
- *
4694
- * @param {Doctype} _1
4695
- * Node to handle.
4696
- * @param {number | undefined} _2
4697
- * Index of `node` in `parent.
4698
- * @param {Parents | undefined} _3
4699
- * Parent of `node`.
4700
- * @param {State} state
4701
- * Info passed around about the current state.
4702
- * @returns {string}
4703
- * Serialized node.
4704
- */
4705
- function doctype(_1, _2, _3, state) {
4706
- return "<!" + (state.settings.upperDoctype ? "DOCTYPE" : "doctype") + (state.settings.tightDoctype ? "" : " ") + "html>";
4707
- }
4708
- // ../../node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.js
4709
- /**
4710
- * Count how often a character (or substring) is used in a string.
4711
- *
4712
- * @param {string} value
4713
- * Value to search in.
4714
- * @param {string} character
4715
- * Character (or substring) to look for.
4716
- * @return {number}
4717
- * Number of times `character` occurred in `value`.
4718
- */
4719
- function ccount(value, character) {
4720
- const source = String(value);
4721
- if (typeof character !== "string") throw new TypeError("Expected character");
4722
- let count = 0;
4723
- let index = source.indexOf(character);
4724
- while (index !== -1) {
4725
- count++;
4726
- index = source.indexOf(character, index + character.length);
4727
- }
4728
- return count;
4729
- }
4730
- // ../../node_modules/.pnpm/comma-separated-tokens@2.0.3/node_modules/comma-separated-tokens/index.js
4731
- /**
4732
- * Serialize an array of strings or numbers to comma-separated tokens.
4733
- *
4734
- * @param {Array<string|number>} values
4735
- * List of tokens.
4736
- * @param {Options} [options]
4737
- * Configuration for `stringify` (optional).
4738
- * @returns {string}
4739
- * Comma-separated tokens.
4740
- */
4741
- function stringify$1(values, options) {
4742
- const settings = options || {};
4743
- return (values[values.length - 1] === "" ? [...values, ""] : values).join((settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ")).trim();
4744
- }
4745
- // ../../node_modules/.pnpm/space-separated-tokens@2.0.2/node_modules/space-separated-tokens/index.js
4746
- /**
4747
- * Serialize an array of strings as space separated-tokens.
4748
- *
4749
- * @param {Array<string|number>} values
4750
- * List of tokens.
4751
- * @returns {string}
4752
- * Space-separated tokens.
4753
- */
4754
- function stringify(values) {
4755
- return values.join(" ").trim();
4756
- }
4757
- // ../../node_modules/.pnpm/hast-util-whitespace@3.0.0/node_modules/hast-util-whitespace/lib/index.js
4758
- /**
4759
- * @typedef {import('hast').Nodes} Nodes
4760
- */
4761
- const re = /[ \t\n\f\r]/g;
4762
- /**
4763
- * Check if the given value is *inter-element whitespace*.
4764
- *
4765
- * @param {Nodes | string} thing
4766
- * Thing to check (`Node` or `string`).
4767
- * @returns {boolean}
4768
- * Whether the `value` is inter-element whitespace (`boolean`): consisting of
4769
- * zero or more of space, tab (`\t`), line feed (`\n`), carriage return
4770
- * (`\r`), or form feed (`\f`); if a node is passed it must be a `Text` node,
4771
- * whose `value` field is checked.
4772
- */
4773
- function whitespace(thing) {
4774
- return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
4775
- }
4776
- /**
4777
- * @param {string} value
4778
- * @returns {boolean}
4779
- */
4780
- function empty(value) {
4781
- return value.replace(re, "") === "";
4782
- }
4783
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/util/siblings.js
4784
- /**
4785
- * @import {Parents, RootContent} from 'hast'
4786
- */
4787
- const siblingAfter = siblings(1);
4788
- const siblingBefore = siblings(-1);
4789
- /** @type {Array<RootContent>} */
4790
- const emptyChildren$1 = [];
4791
- /**
4792
- * Factory to check siblings in a direction.
4793
- *
4794
- * @param {number} increment
4795
- */
4796
- function siblings(increment) {
4797
- return sibling;
4798
- /**
4799
- * Find applicable siblings in a direction.
4800
- *
4801
- * @template {Parents} Parent
4802
- * Parent type.
4803
- * @param {Parent | undefined} parent
4804
- * Parent.
4805
- * @param {number | undefined} index
4806
- * Index of child in `parent`.
4807
- * @param {boolean | undefined} [includeWhitespace=false]
4808
- * Whether to include whitespace (default: `false`).
4809
- * @returns {Parent extends {children: Array<infer Child>} ? Child | undefined : never}
4810
- * Child of parent.
4811
- */
4812
- function sibling(parent, index, includeWhitespace) {
4813
- const siblings = parent ? parent.children : emptyChildren$1;
4814
- let offset = (index || 0) + increment;
4815
- let next = siblings[offset];
4816
- if (!includeWhitespace) while (next && whitespace(next)) {
4817
- offset += increment;
4818
- next = siblings[offset];
4819
- }
4820
- return next;
4821
- }
4822
- }
4823
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/omission.js
4824
- /**
4825
- * @import {Element, Parents} from 'hast'
4826
- */
4827
- /**
4828
- * @callback OmitHandle
4829
- * Check if a tag can be omitted.
4830
- * @param {Element} element
4831
- * Element to check.
4832
- * @param {number | undefined} index
4833
- * Index of element in parent.
4834
- * @param {Parents | undefined} parent
4835
- * Parent of element.
4836
- * @returns {boolean}
4837
- * Whether to omit a tag.
4838
- *
4839
- */
4840
- const own = {}.hasOwnProperty;
4841
- /**
4842
- * Factory to check if a given node can have a tag omitted.
4843
- *
4844
- * @param {Record<string, OmitHandle>} handlers
4845
- * Omission handlers, where each key is a tag name, and each value is the
4846
- * corresponding handler.
4847
- * @returns {OmitHandle}
4848
- * Whether to omit a tag of an element.
4849
- */
4850
- function omission(handlers) {
4851
- return omit;
4852
- /**
4853
- * Check if a given node can have a tag omitted.
4854
- *
4855
- * @type {OmitHandle}
4856
- */
4857
- function omit(node, index, parent) {
4858
- return own.call(handlers, node.tagName) && handlers[node.tagName](node, index, parent);
4859
- }
4860
- }
4861
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/closing.js
4862
- /**
4863
- * @import {Element, Parents} from 'hast'
4864
- */
4865
- const closing = omission({
4866
- body: body$1,
4867
- caption: headOrColgroupOrCaption,
4868
- colgroup: headOrColgroupOrCaption,
4869
- dd,
4870
- dt,
4871
- head: headOrColgroupOrCaption,
4872
- html: html$1,
4873
- li,
4874
- optgroup,
4875
- option,
4876
- p,
4877
- rp: rubyElement,
4878
- rt: rubyElement,
4879
- tbody: tbody$1,
4880
- td: cells,
4881
- tfoot,
4882
- th: cells,
4883
- thead,
4884
- tr
4885
- });
4886
- /**
4887
- * Macro for `</head>`, `</colgroup>`, and `</caption>`.
4888
- *
4889
- * @param {Element} _
4890
- * Element.
4891
- * @param {number | undefined} index
4892
- * Index of element in parent.
4893
- * @param {Parents | undefined} parent
4894
- * Parent of element.
4895
- * @returns {boolean}
4896
- * Whether the closing tag can be omitted.
4897
- */
4898
- function headOrColgroupOrCaption(_, index, parent) {
4899
- const next = siblingAfter(parent, index, true);
4900
- return !next || next.type !== "comment" && !(next.type === "text" && whitespace(next.value.charAt(0)));
4901
- }
4902
- /**
4903
- * Whether to omit `</html>`.
4904
- *
4905
- * @param {Element} _
4906
- * Element.
4907
- * @param {number | undefined} index
4908
- * Index of element in parent.
4909
- * @param {Parents | undefined} parent
4910
- * Parent of element.
4911
- * @returns {boolean}
4912
- * Whether the closing tag can be omitted.
4913
- */
4914
- function html$1(_, index, parent) {
4915
- const next = siblingAfter(parent, index);
4916
- return !next || next.type !== "comment";
4917
- }
4918
- /**
4919
- * Whether to omit `</body>`.
4920
- *
4921
- * @param {Element} _
4922
- * Element.
4923
- * @param {number | undefined} index
4924
- * Index of element in parent.
4925
- * @param {Parents | undefined} parent
4926
- * Parent of element.
4927
- * @returns {boolean}
4928
- * Whether the closing tag can be omitted.
4929
- */
4930
- function body$1(_, index, parent) {
4931
- const next = siblingAfter(parent, index);
4932
- return !next || next.type !== "comment";
4933
- }
4934
- /**
4935
- * Whether to omit `</p>`.
4936
- *
4937
- * @param {Element} _
4938
- * Element.
4939
- * @param {number | undefined} index
4940
- * Index of element in parent.
4941
- * @param {Parents | undefined} parent
4942
- * Parent of element.
4943
- * @returns {boolean}
4944
- * Whether the closing tag can be omitted.
4945
- */
4946
- function p(_, index, parent) {
4947
- const next = siblingAfter(parent, index);
4948
- return next ? next.type === "element" && (next.tagName === "address" || next.tagName === "article" || next.tagName === "aside" || next.tagName === "blockquote" || next.tagName === "details" || next.tagName === "div" || next.tagName === "dl" || next.tagName === "fieldset" || next.tagName === "figcaption" || next.tagName === "figure" || next.tagName === "footer" || next.tagName === "form" || next.tagName === "h1" || next.tagName === "h2" || next.tagName === "h3" || next.tagName === "h4" || next.tagName === "h5" || next.tagName === "h6" || next.tagName === "header" || next.tagName === "hgroup" || next.tagName === "hr" || next.tagName === "main" || next.tagName === "menu" || next.tagName === "nav" || next.tagName === "ol" || next.tagName === "p" || next.tagName === "pre" || next.tagName === "section" || next.tagName === "table" || next.tagName === "ul") : !parent || !(parent.type === "element" && (parent.tagName === "a" || parent.tagName === "audio" || parent.tagName === "del" || parent.tagName === "ins" || parent.tagName === "map" || parent.tagName === "noscript" || parent.tagName === "video"));
4949
- }
4950
- /**
4951
- * Whether to omit `</li>`.
4952
- *
4953
- * @param {Element} _
4954
- * Element.
4955
- * @param {number | undefined} index
4956
- * Index of element in parent.
4957
- * @param {Parents | undefined} parent
4958
- * Parent of element.
4959
- * @returns {boolean}
4960
- * Whether the closing tag can be omitted.
4961
- */
4962
- function li(_, index, parent) {
4963
- const next = siblingAfter(parent, index);
4964
- return !next || next.type === "element" && next.tagName === "li";
4965
- }
4966
- /**
4967
- * Whether to omit `</dt>`.
4968
- *
4969
- * @param {Element} _
4970
- * Element.
4971
- * @param {number | undefined} index
4972
- * Index of element in parent.
4973
- * @param {Parents | undefined} parent
4974
- * Parent of element.
4975
- * @returns {boolean}
4976
- * Whether the closing tag can be omitted.
4977
- */
4978
- function dt(_, index, parent) {
4979
- const next = siblingAfter(parent, index);
4980
- return Boolean(next && next.type === "element" && (next.tagName === "dt" || next.tagName === "dd"));
4981
- }
4982
- /**
4983
- * Whether to omit `</dd>`.
4984
- *
4985
- * @param {Element} _
4986
- * Element.
4987
- * @param {number | undefined} index
4988
- * Index of element in parent.
4989
- * @param {Parents | undefined} parent
4990
- * Parent of element.
4991
- * @returns {boolean}
4992
- * Whether the closing tag can be omitted.
4993
- */
4994
- function dd(_, index, parent) {
4995
- const next = siblingAfter(parent, index);
4996
- return !next || next.type === "element" && (next.tagName === "dt" || next.tagName === "dd");
4997
- }
4998
- /**
4999
- * Whether to omit `</rt>` or `</rp>`.
5000
- *
5001
- * @param {Element} _
5002
- * Element.
5003
- * @param {number | undefined} index
5004
- * Index of element in parent.
5005
- * @param {Parents | undefined} parent
5006
- * Parent of element.
5007
- * @returns {boolean}
5008
- * Whether the closing tag can be omitted.
5009
- */
5010
- function rubyElement(_, index, parent) {
5011
- const next = siblingAfter(parent, index);
5012
- return !next || next.type === "element" && (next.tagName === "rp" || next.tagName === "rt");
5013
- }
5014
- /**
5015
- * Whether to omit `</optgroup>`.
5016
- *
5017
- * @param {Element} _
5018
- * Element.
5019
- * @param {number | undefined} index
5020
- * Index of element in parent.
5021
- * @param {Parents | undefined} parent
5022
- * Parent of element.
5023
- * @returns {boolean}
5024
- * Whether the closing tag can be omitted.
5025
- */
5026
- function optgroup(_, index, parent) {
5027
- const next = siblingAfter(parent, index);
5028
- return !next || next.type === "element" && next.tagName === "optgroup";
5029
- }
5030
- /**
5031
- * Whether to omit `</option>`.
5032
- *
5033
- * @param {Element} _
5034
- * Element.
5035
- * @param {number | undefined} index
5036
- * Index of element in parent.
5037
- * @param {Parents | undefined} parent
5038
- * Parent of element.
5039
- * @returns {boolean}
5040
- * Whether the closing tag can be omitted.
5041
- */
5042
- function option(_, index, parent) {
5043
- const next = siblingAfter(parent, index);
5044
- return !next || next.type === "element" && (next.tagName === "option" || next.tagName === "optgroup");
5045
- }
5046
- /**
5047
- * Whether to omit `</thead>`.
5048
- *
5049
- * @param {Element} _
5050
- * Element.
5051
- * @param {number | undefined} index
5052
- * Index of element in parent.
5053
- * @param {Parents | undefined} parent
5054
- * Parent of element.
5055
- * @returns {boolean}
5056
- * Whether the closing tag can be omitted.
5057
- */
5058
- function thead(_, index, parent) {
5059
- const next = siblingAfter(parent, index);
5060
- return Boolean(next && next.type === "element" && (next.tagName === "tbody" || next.tagName === "tfoot"));
5061
- }
5062
- /**
5063
- * Whether to omit `</tbody>`.
5064
- *
5065
- * @param {Element} _
5066
- * Element.
5067
- * @param {number | undefined} index
5068
- * Index of element in parent.
5069
- * @param {Parents | undefined} parent
5070
- * Parent of element.
5071
- * @returns {boolean}
5072
- * Whether the closing tag can be omitted.
5073
- */
5074
- function tbody$1(_, index, parent) {
5075
- const next = siblingAfter(parent, index);
5076
- return !next || next.type === "element" && (next.tagName === "tbody" || next.tagName === "tfoot");
5077
- }
5078
- /**
5079
- * Whether to omit `</tfoot>`.
5080
- *
5081
- * @param {Element} _
5082
- * Element.
5083
- * @param {number | undefined} index
5084
- * Index of element in parent.
5085
- * @param {Parents | undefined} parent
5086
- * Parent of element.
5087
- * @returns {boolean}
5088
- * Whether the closing tag can be omitted.
5089
- */
5090
- function tfoot(_, index, parent) {
5091
- return !siblingAfter(parent, index);
5092
- }
5093
- /**
5094
- * Whether to omit `</tr>`.
5095
- *
5096
- * @param {Element} _
5097
- * Element.
5098
- * @param {number | undefined} index
5099
- * Index of element in parent.
5100
- * @param {Parents | undefined} parent
5101
- * Parent of element.
5102
- * @returns {boolean}
5103
- * Whether the closing tag can be omitted.
5104
- */
5105
- function tr(_, index, parent) {
5106
- const next = siblingAfter(parent, index);
5107
- return !next || next.type === "element" && next.tagName === "tr";
5108
- }
5109
- /**
5110
- * Whether to omit `</td>` or `</th>`.
5111
- *
5112
- * @param {Element} _
5113
- * Element.
5114
- * @param {number | undefined} index
5115
- * Index of element in parent.
5116
- * @param {Parents | undefined} parent
5117
- * Parent of element.
5118
- * @returns {boolean}
5119
- * Whether the closing tag can be omitted.
5120
- */
5121
- function cells(_, index, parent) {
5122
- const next = siblingAfter(parent, index);
5123
- return !next || next.type === "element" && (next.tagName === "td" || next.tagName === "th");
5124
- }
5125
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/omission/opening.js
5126
- /**
5127
- * @import {Element, Parents} from 'hast'
5128
- */
5129
- const opening = omission({
5130
- body,
5131
- colgroup,
5132
- head,
5133
- html,
5134
- tbody
5135
- });
5136
- /**
5137
- * Whether to omit `<html>`.
5138
- *
5139
- * @param {Element} node
5140
- * Element.
5141
- * @returns {boolean}
5142
- * Whether the opening tag can be omitted.
5143
- */
5144
- function html(node) {
5145
- const head = siblingAfter(node, -1);
5146
- return !head || head.type !== "comment";
5147
- }
5148
- /**
5149
- * Whether to omit `<head>`.
5150
- *
5151
- * @param {Element} node
5152
- * Element.
5153
- * @returns {boolean}
5154
- * Whether the opening tag can be omitted.
5155
- */
5156
- function head(node) {
5157
- /** @type {Set<string>} */
5158
- const seen = /* @__PURE__ */ new Set();
5159
- for (const child of node.children) if (child.type === "element" && (child.tagName === "base" || child.tagName === "title")) {
5160
- if (seen.has(child.tagName)) return false;
5161
- seen.add(child.tagName);
5162
- }
5163
- const child = node.children[0];
5164
- return !child || child.type === "element";
5165
- }
5166
- /**
5167
- * Whether to omit `<body>`.
5168
- *
5169
- * @param {Element} node
5170
- * Element.
5171
- * @returns {boolean}
5172
- * Whether the opening tag can be omitted.
5173
- */
5174
- function body(node) {
5175
- const head = siblingAfter(node, -1, true);
5176
- return !head || head.type !== "comment" && !(head.type === "text" && whitespace(head.value.charAt(0))) && !(head.type === "element" && (head.tagName === "meta" || head.tagName === "link" || head.tagName === "script" || head.tagName === "style" || head.tagName === "template"));
5177
- }
5178
- /**
5179
- * Whether to omit `<colgroup>`.
5180
- * The spec describes some logic for the opening tag, but it’s easier to
5181
- * implement in the closing tag, to the same effect, so we handle it there
5182
- * instead.
5183
- *
5184
- * @param {Element} node
5185
- * Element.
5186
- * @param {number | undefined} index
5187
- * Index of element in parent.
5188
- * @param {Parents | undefined} parent
5189
- * Parent of element.
5190
- * @returns {boolean}
5191
- * Whether the opening tag can be omitted.
5192
- */
5193
- function colgroup(node, index, parent) {
5194
- const previous = siblingBefore(parent, index);
5195
- const head = siblingAfter(node, -1, true);
5196
- if (parent && previous && previous.type === "element" && previous.tagName === "colgroup" && closing(previous, parent.children.indexOf(previous), parent)) return false;
5197
- return Boolean(head && head.type === "element" && head.tagName === "col");
5198
- }
5199
- /**
5200
- * Whether to omit `<tbody>`.
5201
- *
5202
- * @param {Element} node
5203
- * Element.
5204
- * @param {number | undefined} index
5205
- * Index of element in parent.
5206
- * @param {Parents | undefined} parent
5207
- * Parent of element.
5208
- * @returns {boolean}
5209
- * Whether the opening tag can be omitted.
5210
- */
5211
- function tbody(node, index, parent) {
5212
- const previous = siblingBefore(parent, index);
5213
- const head = siblingAfter(node, -1);
5214
- if (parent && previous && previous.type === "element" && (previous.tagName === "thead" || previous.tagName === "tbody") && closing(previous, parent.children.indexOf(previous), parent)) return false;
5215
- return Boolean(head && head.type === "element" && head.tagName === "tr");
5216
- }
5217
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/element.js
5218
- /**
5219
- * @import {Element, Parents, Properties} from 'hast'
5220
- * @import {State} from '../index.js'
5221
- */
5222
- /**
5223
- * Maps of subsets.
5224
- *
5225
- * Each value is a matrix of tuples.
5226
- * The value at `0` causes parse errors, the value at `1` is valid.
5227
- * Of both, the value at `0` is unsafe, and the value at `1` is safe.
5228
- *
5229
- * @type {Record<'double' | 'name' | 'single' | 'unquoted', Array<[Array<string>, Array<string>]>>}
5230
- */
5231
- const constants = {
5232
- name: [[" \n\f\r &/=>".split(""), " \n\f\r \"&'/=>`".split("")], ["\0 \n\f\r \"&'/<=>".split(""), "\0 \n\f\r \"&'/<=>`".split("")]],
5233
- unquoted: [[" \n\f\r &>".split(""), "\0 \n\f\r \"&'<=>`".split("")], ["\0 \n\f\r \"&'<=>`".split(""), "\0 \n\f\r \"&'<=>`".split("")]],
5234
- single: [["&'".split(""), "\"&'`".split("")], ["\0&'".split(""), "\0\"&'`".split("")]],
5235
- double: [["\"&".split(""), "\"&'`".split("")], ["\0\"&".split(""), "\0\"&'`".split("")]]
5236
- };
5237
- /**
5238
- * Serialize an element node.
5239
- *
5240
- * @param {Element} node
5241
- * Node to handle.
5242
- * @param {number | undefined} index
5243
- * Index of `node` in `parent.
5244
- * @param {Parents | undefined} parent
5245
- * Parent of `node`.
5246
- * @param {State} state
5247
- * Info passed around about the current state.
5248
- * @returns {string}
5249
- * Serialized node.
5250
- */
5251
- function element(node, index, parent, state) {
5252
- const schema = state.schema;
5253
- const omit = schema.space === "svg" ? false : state.settings.omitOptionalTags;
5254
- let selfClosing = schema.space === "svg" ? state.settings.closeEmptyElements : state.settings.voids.includes(node.tagName.toLowerCase());
5255
- /** @type {Array<string>} */
5256
- const parts = [];
5257
- /** @type {string} */
5258
- let last;
5259
- if (schema.space === "html" && node.tagName === "svg") state.schema = svg;
5260
- const attributes = serializeAttributes$1(state, node.properties);
5261
- const content = state.all(schema.space === "html" && node.tagName === "template" ? node.content : node);
5262
- state.schema = schema;
5263
- if (content) selfClosing = false;
5264
- if (attributes || !omit || !opening(node, index, parent)) {
5265
- parts.push("<", node.tagName, attributes ? " " + attributes : "");
5266
- if (selfClosing && (schema.space === "svg" || state.settings.closeSelfClosing)) {
5267
- last = attributes.charAt(attributes.length - 1);
5268
- if (!state.settings.tightSelfClosing || last === "/" || last && last !== "\"" && last !== "'") parts.push(" ");
5269
- parts.push("/");
5270
- }
5271
- parts.push(">");
5272
- }
5273
- parts.push(content);
5274
- if (!selfClosing && (!omit || !closing(node, index, parent))) parts.push("</" + node.tagName + ">");
5275
- return parts.join("");
5276
- }
5277
- /**
5278
- * @param {State} state
5279
- * @param {Properties | null | undefined} properties
5280
- * @returns {string}
5281
- */
5282
- function serializeAttributes$1(state, properties) {
5283
- /** @type {Array<string>} */
5284
- const values = [];
5285
- let index = -1;
5286
- /** @type {string} */
5287
- let key;
5288
- if (properties) {
5289
- for (key in properties) if (properties[key] !== null && properties[key] !== void 0) {
5290
- const value = serializeAttribute(state, key, properties[key]);
5291
- if (value) values.push(value);
5292
- }
5293
- }
5294
- while (++index < values.length) {
5295
- const last = state.settings.tightAttributes ? values[index].charAt(values[index].length - 1) : void 0;
5296
- if (index !== values.length - 1 && last !== "\"" && last !== "'") values[index] += " ";
5297
- }
5298
- return values.join("");
5299
- }
5300
- /**
5301
- * @param {State} state
5302
- * @param {string} key
5303
- * @param {Properties[keyof Properties]} value
5304
- * @returns {string}
5305
- */
5306
- function serializeAttribute(state, key, value) {
5307
- const info = find(state.schema, key);
5308
- const x = state.settings.allowParseErrors && state.schema.space === "html" ? 0 : 1;
5309
- const y = state.settings.allowDangerousCharacters ? 0 : 1;
5310
- let quote = state.quote;
5311
- /** @type {string | undefined} */
5312
- let result;
5313
- if (info.overloadedBoolean && (value === info.attribute || value === "")) value = true;
5314
- else if ((info.boolean || info.overloadedBoolean) && (typeof value !== "string" || value === info.attribute || value === "")) value = Boolean(value);
5315
- if (value === null || value === void 0 || value === false || typeof value === "number" && Number.isNaN(value)) return "";
5316
- const name = stringifyEntities(info.attribute, Object.assign({}, state.settings.characterReferences, { subset: constants.name[x][y] }));
5317
- if (value === true) return name;
5318
- value = Array.isArray(value) ? (info.commaSeparated ? stringify$1 : stringify)(value, { padLeft: !state.settings.tightCommaSeparatedLists }) : String(value);
5319
- if (state.settings.collapseEmptyAttributes && !value) return name;
5320
- if (state.settings.preferUnquoted) result = stringifyEntities(value, Object.assign({}, state.settings.characterReferences, {
5321
- attribute: true,
5322
- subset: constants.unquoted[x][y]
5323
- }));
5324
- if (result !== value) {
5325
- if (state.settings.quoteSmart && ccount(value, quote) > ccount(value, state.alternative)) quote = state.alternative;
5326
- result = quote + stringifyEntities(value, Object.assign({}, state.settings.characterReferences, {
5327
- subset: (quote === "'" ? constants.single : constants.double)[x][y],
5328
- attribute: true
5329
- })) + quote;
5330
- }
5331
- return name + (result ? "=" + result : result);
5332
- }
5333
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/text.js
5334
- /**
5335
- * @import {Parents, Text} from 'hast'
5336
- * @import {Raw} from 'mdast-util-to-hast'
5337
- * @import {State} from '../index.js'
5338
- */
5339
- const textEntitySubset = ["<", "&"];
5340
- /**
5341
- * Serialize a text node.
5342
- *
5343
- * @param {Raw | Text} node
5344
- * Node to handle.
5345
- * @param {number | undefined} _
5346
- * Index of `node` in `parent.
5347
- * @param {Parents | undefined} parent
5348
- * Parent of `node`.
5349
- * @param {State} state
5350
- * Info passed around about the current state.
5351
- * @returns {string}
5352
- * Serialized node.
5353
- */
5354
- function text(node, _, parent, state) {
5355
- return parent && parent.type === "element" && (parent.tagName === "script" || parent.tagName === "style") ? node.value : stringifyEntities(node.value, Object.assign({}, state.settings.characterReferences, { subset: textEntitySubset }));
5356
- }
5357
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/raw.js
5358
- /**
5359
- * @import {Parents} from 'hast'
5360
- * @import {Raw} from 'mdast-util-to-hast'
5361
- * @import {State} from '../index.js'
5362
- */
5363
- /**
5364
- * Serialize a raw node.
5365
- *
5366
- * @param {Raw} node
5367
- * Node to handle.
5368
- * @param {number | undefined} index
5369
- * Index of `node` in `parent.
5370
- * @param {Parents | undefined} parent
5371
- * Parent of `node`.
5372
- * @param {State} state
5373
- * Info passed around about the current state.
5374
- * @returns {string}
5375
- * Serialized node.
5376
- */
5377
- function raw(node, index, parent, state) {
5378
- return state.settings.allowDangerousHtml ? node.value : text(node, index, parent, state);
5379
- }
5380
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/root.js
5381
- /**
5382
- * @import {Parents, Root} from 'hast'
5383
- * @import {State} from '../index.js'
5384
- */
5385
- /**
5386
- * Serialize a root.
5387
- *
5388
- * @param {Root} node
5389
- * Node to handle.
5390
- * @param {number | undefined} _1
5391
- * Index of `node` in `parent.
5392
- * @param {Parents | undefined} _2
5393
- * Parent of `node`.
5394
- * @param {State} state
5395
- * Info passed around about the current state.
5396
- * @returns {string}
5397
- * Serialized node.
5398
- */
5399
- function root(node, _1, _2, state) {
5400
- return state.all(node);
5401
- }
5402
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/handle/index.js
5403
- /**
5404
- * @import {Nodes, Parents} from 'hast'
5405
- * @import {State} from '../index.js'
5406
- */
5407
- /**
5408
- * @type {(node: Nodes, index: number | undefined, parent: Parents | undefined, state: State) => string}
5409
- */
5410
- const handle = zwitch("type", {
5411
- invalid,
5412
- unknown,
5413
- handlers: {
5414
- comment,
5415
- doctype,
5416
- element,
5417
- raw,
5418
- root,
5419
- text
5420
- }
5421
- });
5422
- /**
5423
- * Fail when a non-node is found in the tree.
5424
- *
5425
- * @param {unknown} node
5426
- * Unknown value.
5427
- * @returns {never}
5428
- * Never.
5429
- */
5430
- function invalid(node) {
5431
- throw new Error("Expected node, not `" + node + "`");
5432
- }
5433
- /**
5434
- * Fail when a node with an unknown type is found in the tree.
5435
- *
5436
- * @param {unknown} node_
5437
- * Unknown node.
5438
- * @returns {never}
5439
- * Never.
5440
- */
5441
- function unknown(node_) {
5442
- throw new Error("Cannot compile unknown node `" + node_.type + "`");
5443
- }
5444
- // ../../node_modules/.pnpm/hast-util-to-html@9.0.5/node_modules/hast-util-to-html/lib/index.js
5445
- /**
5446
- * @import {Nodes, Parents, RootContent} from 'hast'
5447
- * @import {Schema} from 'property-information'
5448
- * @import {Options as StringifyEntitiesOptions} from 'stringify-entities'
5449
- */
5450
- /**
5451
- * @typedef {Omit<StringifyEntitiesOptions, 'attribute' | 'escapeOnly' | 'subset'>} CharacterReferences
5452
- *
5453
- * @typedef Options
5454
- * Configuration.
5455
- * @property {boolean | null | undefined} [allowDangerousCharacters=false]
5456
- * Do not encode some characters which cause XSS vulnerabilities in older
5457
- * browsers (default: `false`).
5458
- *
5459
- * > ⚠️ **Danger**: only set this if you completely trust the content.
5460
- * @property {boolean | null | undefined} [allowDangerousHtml=false]
5461
- * Allow `raw` nodes and insert them as raw HTML (default: `false`).
5462
- *
5463
- * When `false`, `Raw` nodes are encoded.
5464
- *
5465
- * > ⚠️ **Danger**: only set this if you completely trust the content.
5466
- * @property {boolean | null | undefined} [allowParseErrors=false]
5467
- * Do not encode characters which cause parse errors (even though they work),
5468
- * to save bytes (default: `false`).
5469
- *
5470
- * Not used in the SVG space.
5471
- *
5472
- * > 👉 **Note**: intentionally creates parse errors in markup (how parse
5473
- * > errors are handled is well defined, so this works but isn’t pretty).
5474
- * @property {boolean | null | undefined} [bogusComments=false]
5475
- * Use “bogus comments” instead of comments to save byes: `<?charlie>`
5476
- * instead of `<!--charlie-->` (default: `false`).
5477
- *
5478
- * > 👉 **Note**: intentionally creates parse errors in markup (how parse
5479
- * > errors are handled is well defined, so this works but isn’t pretty).
5480
- * @property {CharacterReferences | null | undefined} [characterReferences]
5481
- * Configure how to serialize character references (optional).
5482
- * @property {boolean | null | undefined} [closeEmptyElements=false]
5483
- * Close SVG elements without any content with slash (`/`) on the opening tag
5484
- * instead of an end tag: `<circle />` instead of `<circle></circle>`
5485
- * (default: `false`).
5486
- *
5487
- * See `tightSelfClosing` to control whether a space is used before the
5488
- * slash.
5489
- *
5490
- * Not used in the HTML space.
5491
- * @property {boolean | null | undefined} [closeSelfClosing=false]
5492
- * Close self-closing nodes with an extra slash (`/`): `<img />` instead of
5493
- * `<img>` (default: `false`).
5494
- *
5495
- * See `tightSelfClosing` to control whether a space is used before the
5496
- * slash.
5497
- *
5498
- * Not used in the SVG space.
5499
- * @property {boolean | null | undefined} [collapseEmptyAttributes=false]
5500
- * Collapse empty attributes: get `class` instead of `class=""` (default:
5501
- * `false`).
5502
- *
5503
- * Not used in the SVG space.
5504
- *
5505
- * > 👉 **Note**: boolean attributes (such as `hidden`) are always collapsed.
5506
- * @property {boolean | null | undefined} [omitOptionalTags=false]
5507
- * Omit optional opening and closing tags (default: `false`).
5508
- *
5509
- * For example, in `<ol><li>one</li><li>two</li></ol>`, both `</li>` closing
5510
- * tags can be omitted.
5511
- * The first because it’s followed by another `li`, the last because it’s
5512
- * followed by nothing.
5513
- *
5514
- * Not used in the SVG space.
5515
- * @property {boolean | null | undefined} [preferUnquoted=false]
5516
- * Leave attributes unquoted if that results in less bytes (default: `false`).
5517
- *
5518
- * Not used in the SVG space.
5519
- * @property {boolean | null | undefined} [quoteSmart=false]
5520
- * Use the other quote if that results in less bytes (default: `false`).
5521
- * @property {Quote | null | undefined} [quote='"']
5522
- * Preferred quote to use (default: `'"'`).
5523
- * @property {Space | null | undefined} [space='html']
5524
- * When an `<svg>` element is found in the HTML space, this package already
5525
- * automatically switches to and from the SVG space when entering and exiting
5526
- * it (default: `'html'`).
5527
- *
5528
- * > 👉 **Note**: hast is not XML.
5529
- * > It supports SVG as embedded in HTML.
5530
- * > It does not support the features available in XML.
5531
- * > Passing SVG might break but fragments of modern SVG should be fine.
5532
- * > Use [`xast`][xast] if you need to support SVG as XML.
5533
- * @property {boolean | null | undefined} [tightAttributes=false]
5534
- * Join attributes together, without whitespace, if possible: get
5535
- * `class="a b"title="c d"` instead of `class="a b" title="c d"` to save
5536
- * bytes (default: `false`).
5537
- *
5538
- * Not used in the SVG space.
5539
- *
5540
- * > 👉 **Note**: intentionally creates parse errors in markup (how parse
5541
- * > errors are handled is well defined, so this works but isn’t pretty).
5542
- * @property {boolean | null | undefined} [tightCommaSeparatedLists=false]
5543
- * Join known comma-separated attribute values with just a comma (`,`),
5544
- * instead of padding them on the right as well (`,␠`, where `␠` represents a
5545
- * space) (default: `false`).
5546
- * @property {boolean | null | undefined} [tightDoctype=false]
5547
- * Drop unneeded spaces in doctypes: `<!doctypehtml>` instead of
5548
- * `<!doctype html>` to save bytes (default: `false`).
5549
- *
5550
- * > 👉 **Note**: intentionally creates parse errors in markup (how parse
5551
- * > errors are handled is well defined, so this works but isn’t pretty).
5552
- * @property {boolean | null | undefined} [tightSelfClosing=false]
5553
- * Do not use an extra space when closing self-closing elements: `<img/>`
5554
- * instead of `<img />` (default: `false`).
5555
- *
5556
- * > 👉 **Note**: only used if `closeSelfClosing: true` or
5557
- * > `closeEmptyElements: true`.
5558
- * @property {boolean | null | undefined} [upperDoctype=false]
5559
- * Use a `<!DOCTYPE…` instead of `<!doctype…` (default: `false`).
5560
- *
5561
- * Useless except for XHTML.
5562
- * @property {ReadonlyArray<string> | null | undefined} [voids]
5563
- * Tag names of elements to serialize without closing tag (default: `html-void-elements`).
5564
- *
5565
- * Not used in the SVG space.
5566
- *
5567
- * > 👉 **Note**: It’s highly unlikely that you want to pass this, because
5568
- * > hast is not for XML, and HTML will not add more void elements.
5569
- *
5570
- * @typedef {'"' | "'"} Quote
5571
- * HTML quotes for attribute values.
5572
- *
5573
- * @typedef {Omit<Required<{[key in keyof Options]: Exclude<Options[key], null | undefined>}>, 'space' | 'quote'>} Settings
5574
- *
5575
- * @typedef {'html' | 'svg'} Space
5576
- * Namespace.
5577
- *
5578
- * @typedef State
5579
- * Info passed around about the current state.
5580
- * @property {(node: Parents | undefined) => string} all
5581
- * Serialize the children of a parent node.
5582
- * @property {Quote} alternative
5583
- * Alternative quote.
5584
- * @property {(node: Nodes, index: number | undefined, parent: Parents | undefined) => string} one
5585
- * Serialize one node.
5586
- * @property {Quote} quote
5587
- * Preferred quote.
5588
- * @property {Schema} schema
5589
- * Current schema.
5590
- * @property {Settings} settings
5591
- * User configuration.
5592
- */
5593
- /** @type {Options} */
5594
- const emptyOptions = {};
5595
- /** @type {CharacterReferences} */
5596
- const emptyCharacterReferences = {};
5597
- /** @type {Array<never>} */
5598
- const emptyChildren = [];
5599
- /**
5600
- * Serialize hast as HTML.
5601
- *
5602
- * @param {Array<RootContent> | Nodes} tree
5603
- * Tree to serialize.
5604
- * @param {Options | null | undefined} [options]
5605
- * Configuration (optional).
5606
- * @returns {string}
5607
- * Serialized HTML.
5608
- */
5609
- function toHtml(tree, options) {
5610
- const options_ = options || emptyOptions;
5611
- const quote = options_.quote || "\"";
5612
- const alternative = quote === "\"" ? "'" : "\"";
5613
- if (quote !== "\"" && quote !== "'") throw new Error("Invalid quote `" + quote + "`, expected `'` or `\"`");
5614
- return {
5615
- one,
5616
- all,
5617
- settings: {
5618
- omitOptionalTags: options_.omitOptionalTags || false,
5619
- allowParseErrors: options_.allowParseErrors || false,
5620
- allowDangerousCharacters: options_.allowDangerousCharacters || false,
5621
- quoteSmart: options_.quoteSmart || false,
5622
- preferUnquoted: options_.preferUnquoted || false,
5623
- tightAttributes: options_.tightAttributes || false,
5624
- upperDoctype: options_.upperDoctype || false,
5625
- tightDoctype: options_.tightDoctype || false,
5626
- bogusComments: options_.bogusComments || false,
5627
- tightCommaSeparatedLists: options_.tightCommaSeparatedLists || false,
5628
- tightSelfClosing: options_.tightSelfClosing || false,
5629
- collapseEmptyAttributes: options_.collapseEmptyAttributes || false,
5630
- allowDangerousHtml: options_.allowDangerousHtml || false,
5631
- voids: options_.voids || htmlVoidElements,
5632
- characterReferences: options_.characterReferences || emptyCharacterReferences,
5633
- closeSelfClosing: options_.closeSelfClosing || false,
5634
- closeEmptyElements: options_.closeEmptyElements || false
5635
- },
5636
- schema: options_.space === "svg" ? svg : html$2,
5637
- quote,
5638
- alternative
5639
- }.one(Array.isArray(tree) ? {
5640
- type: "root",
5641
- children: tree
5642
- } : tree, void 0, void 0);
2162
+ top,
2163
+ bottom: Math.ceil(Math.max(Math.min(bottom, scrollHeight), top))
2164
+ };
5643
2165
  }
5644
- /**
5645
- * Serialize a node.
5646
- *
5647
- * @this {State}
5648
- * Info passed around about the current state.
5649
- * @param {Nodes} node
5650
- * Node to handle.
5651
- * @param {number | undefined} index
5652
- * Index of `node` in `parent.
5653
- * @param {Parents | undefined} parent
5654
- * Parent of `node`.
5655
- * @returns {string}
5656
- * Serialized node.
5657
- */
5658
- function one(node, index, parent) {
5659
- return handle(node, index, parent, this);
2166
+ // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/prefersReducedMotion.js
2167
+ function prefersReducedMotion() {
2168
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
2169
+ return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2170
+ }
2171
+ // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/lineEndings.js
2172
+ /** The line ending a file uses, read from its first line break. */
2173
+ function lineEndingOf(text) {
2174
+ const first = /\r\n|\r|\n/.exec(text)?.[0];
2175
+ return first === "\r\n" || first === "\r" ? first : "\n";
2176
+ }
2177
+ /** `text` with every line break rewritten to the one its first line uses. */
2178
+ function uniformLineEndings(text) {
2179
+ if (!text.includes("\r")) return text;
2180
+ const eol = lineEndingOf(text);
2181
+ return text.replace(/\r\n|\r|\n/g, eol);
5660
2182
  }
2183
+ // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/areGhostTextRowsEqual.js
5661
2184
  /**
5662
- * Serialize all children of `parent`.
5663
- *
5664
- * @this {State}
5665
- * Info passed around about the current state.
5666
- * @param {Parents | undefined} parent
5667
- * Parent whose children to serialize.
5668
- * @returns {string}
2185
+ * Whether two ghost text row maps (zero-based line -> row count) show the
2186
+ * same rows under the same lines. The editor replaces its map on every
2187
+ * change, so a different map is not by itself a change in height.
5669
2188
  */
5670
- function all(parent) {
5671
- /** @type {Array<string>} */
5672
- const results = [];
5673
- const children = parent && parent.children || emptyChildren;
5674
- let index = -1;
5675
- while (++index < children.length) results[index] = this.one(children[index], index, parent);
5676
- return results.join("");
5677
- }
5678
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/hastToHtml.js
5679
- const VOID_ELEMENTS = /* @__PURE__ */ new Set([
5680
- "area",
5681
- "base",
5682
- "basefont",
5683
- "bgsound",
5684
- "br",
5685
- "col",
5686
- "command",
5687
- "embed",
5688
- "frame",
5689
- "hr",
5690
- "image",
5691
- "img",
5692
- "input",
5693
- "keygen",
5694
- "link",
5695
- "meta",
5696
- "param",
5697
- "source",
5698
- "track",
5699
- "wbr"
5700
- ]);
5701
- const DELEGATED_TAGS = /* @__PURE__ */ new Set([
5702
- "svg",
5703
- "template",
5704
- "script",
5705
- "style"
5706
- ]);
5707
- const ATTRIBUTE_NAMES = {
5708
- class: "class",
5709
- className: "class",
5710
- contenteditable: "contenteditable",
5711
- contentEditable: "contenteditable",
5712
- id: "id",
5713
- role: "role",
5714
- style: "style",
5715
- tabIndex: "tabindex",
5716
- tabindex: "tabindex",
5717
- title: "title"
5718
- };
5719
- const DATA_ATTRIBUTE = /^data-[\w.:-]+$/;
5720
- const TEXT_ESCAPE = /[<&]/g;
5721
- const ATTRIBUTE_ESCAPE = /[\0"&'`]/g;
5722
- const CHARACTER_REFERENCES = {
5723
- "<": "&#x3C;",
5724
- "&": "&#x26;",
5725
- "\"": "&#x22;",
5726
- "'": "&#x27;",
5727
- "`": "&#x60;",
5728
- "\0": "&#x0;"
5729
- };
5730
- const MAX_CACHED_STYLES = 256;
2189
+ function areGhostTextRowsEqual(a, b) {
2190
+ if (a === b) return true;
2191
+ if (a.size !== b.size) return false;
2192
+ for (const [line, rows] of a) if (b.get(line) !== rows) return false;
2193
+ return true;
2194
+ }
2195
+ // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/dom/CodeColumns.js
5731
2196
  /**
5732
- * Serializes a HAST node or node array to HTML. Common token spans use a fast
5733
- * path; other nodes and attributes use hast-util-to-html's default serialization.
2197
+ * The code columns a component renders, by role, and their horizontal scroll
2198
+ * offsets. The offsets are kept from the columns' scroll events, so reading
2199
+ * them never touches the DOM. The columns scroll together, but a narrower
2200
+ * column clamps lower, so the widest one's offset is the component's.
5734
2201
  */
5735
- function hastToHtml(tree) {
5736
- const styles = /* @__PURE__ */ new Map();
5737
- return Array.isArray(tree) ? serializeChildren(tree, styles) : serializeNode(tree, styles);
5738
- }
5739
- function serializeChildren(children, styles) {
5740
- let html = "";
5741
- for (const child of children) html += serializeNode(child, styles);
5742
- return html;
5743
- }
5744
- function serializeNode(node, styles) {
5745
- switch (node.type) {
5746
- case "text": return escapeText(node.value);
5747
- case "element": return serializeElement(node, styles);
5748
- case "root": return serializeChildren(node.children, styles);
5749
- default: return toHtml(node);
5750
- }
5751
- }
5752
- function serializeElement(node, styles) {
5753
- const { tagName } = node;
5754
- if (tagName === "span" && node.children.length === 1 && node.children[0].type === "text" && typeof node.properties?.style === "string") {
5755
- let styleOnly = true;
5756
- for (const key in node.properties) if (key !== "style" && node.properties[key] != null) {
5757
- styleOnly = false;
5758
- break;
2202
+ var CodeColumns = class {
2203
+ #elements = /* @__PURE__ */ new Map();
2204
+ #scrollLefts = /* @__PURE__ */ new Map();
2205
+ get(role) {
2206
+ return this.#elements.get(role);
2207
+ }
2208
+ /**
2209
+ * Installs a role's column, moving the scroll listener from the column it
2210
+ * replaces. A column already on screen is read once; a new one starts at
2211
+ * zero.
2212
+ */
2213
+ set(role, column) {
2214
+ const previous = this.#elements.get(role);
2215
+ if (previous === column) return;
2216
+ if (previous != null) {
2217
+ previous.removeEventListener("scroll", this.#handleScroll);
2218
+ this.#scrollLefts.delete(previous);
2219
+ this.#elements.delete(role);
2220
+ }
2221
+ if (column != null) {
2222
+ column.addEventListener("scroll", this.#handleScroll, { passive: true });
2223
+ this.#scrollLefts.set(column, column.isConnected ? column.scrollLeft : 0);
2224
+ this.#elements.set(role, column);
5759
2225
  }
5760
- if (styleOnly) return `<span ${serializeStyle(node.properties.style, styles)}>${escapeText(node.children[0].value)}</span>`;
5761
2226
  }
5762
- if (DELEGATED_TAGS.has(tagName)) return toHtml(node);
5763
- const attributes = serializeAttributes(node.properties, styles);
5764
- if (attributes == null) return toHtml(node);
5765
- const open = attributes === "" ? `<${tagName}>` : `<${tagName} ${attributes}>`;
5766
- const content = serializeChildren(node.children, styles);
5767
- if (content === "" && VOID_ELEMENTS.has(tagName.toLowerCase())) return open;
5768
- return `${open}${content}</${tagName}>`;
5769
- }
5770
- function serializeStyle(value, styles) {
5771
- let attribute = styles.get(value);
5772
- if (attribute == null) {
5773
- attribute = `style="${escapeAttribute(value)}"`;
5774
- if (styles.size < MAX_CACHED_STYLES) styles.set(value, attribute);
2227
+ /** Forgets every column and stops listening to it. */
2228
+ cleanUp() {
2229
+ for (const role of [...this.#elements.keys()]) this.set(role, void 0);
5775
2230
  }
5776
- return attribute;
5777
- }
5778
- /**
5779
- * The attribute a HAST property serializes to: its name and value as the
5780
- * markup carries them. `null` when the property writes nothing (unset,
5781
- * false or NaN), undefined when it needs the full HTML schema.
5782
- */
5783
- function attributeFor(key, value) {
5784
- if (value == null) return null;
5785
- const name = ATTRIBUTE_NAMES[key] ?? (DATA_ATTRIBUTE.test(key) ? key : void 0);
5786
- if (name == null) return;
5787
- if (value === false || typeof value === "number" && Number.isNaN(value)) return null;
5788
- return {
5789
- name,
5790
- value: value === true ? "" : Array.isArray(value) ? value.join(" ").trim() : String(value)
5791
- };
5792
- }
5793
- function serializeAttributes(properties, styles) {
5794
- let attributes = "";
5795
- for (const key in properties) {
5796
- const value = properties[key];
5797
- if (value == null) continue;
5798
- const name = ATTRIBUTE_NAMES[key] ?? (DATA_ATTRIBUTE.test(key) ? key : void 0);
5799
- if (name == null) return;
5800
- if (value === false || typeof value === "number" && Number.isNaN(value)) continue;
5801
- const attribute = key === "style" && typeof value === "string" ? serializeStyle(value, styles) : value === true ? name : `${name}="${escapeAttribute(Array.isArray(value) ? value.join(" ").trim() : String(value))}"`;
5802
- attributes += attributes === "" ? attribute : ` ${attribute}`;
2231
+ /** The widest column's horizontal scroll offset. */
2232
+ get scrollLeft() {
2233
+ let scrollLeft = 0;
2234
+ for (const columnScrollLeft of this.#scrollLefts.values()) scrollLeft = Math.max(scrollLeft, columnScrollLeft);
2235
+ return scrollLeft;
5803
2236
  }
5804
- return attributes;
5805
- }
5806
- function escapeText(value) {
5807
- return value.indexOf("<") < 0 && value.indexOf("&") < 0 ? value : value.replace(TEXT_ESCAPE, toCharacterReference);
5808
- }
5809
- function escapeAttribute(value) {
5810
- return value.replace(ATTRIBUTE_ESCAPE, toCharacterReference);
5811
- }
5812
- function toCharacterReference(character) {
5813
- return CHARACTER_REFERENCES[character];
5814
- }
2237
+ /**
2238
+ * Scrolls every column to `position` and keeps where each one landed: a
2239
+ * column clamps a position past its content, and no scroll event follows
2240
+ * when it did not move.
2241
+ */
2242
+ setScrollLeft(position) {
2243
+ for (const column of this.#scrollLefts.keys()) {
2244
+ column.scrollLeft = position;
2245
+ this.#scrollLefts.set(column, column.scrollLeft);
2246
+ }
2247
+ }
2248
+ #handleScroll = (event) => {
2249
+ const { currentTarget } = event;
2250
+ if (currentTarget instanceof HTMLElement) this.#scrollLefts.set(currentTarget, currentTarget.scrollLeft);
2251
+ };
2252
+ };
5815
2253
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/dom/ColumnReconciler.js
5816
2254
  /**
5817
2255
  * Keeps a code column's gutter and content children in step with a list of
@@ -8098,54 +4536,6 @@ function readAllLines(document) {
8098
4536
  characterCount
8099
4537
  };
8100
4538
  }
8101
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/lineChanges.js
8102
- /**
8103
- * The line changes of a document change. A change made of edits always
8104
- * carries them; a change with no edits moves no lines.
8105
- */
8106
- function lineChangesOf(change) {
8107
- const { changes, changedLineChanges } = change;
8108
- if (changedLineChanges != null) return changedLineChanges;
8109
- if (changes.length > 0) throw new Error("lineChangesOf: a change with edits has no line changes");
8110
- return [];
8111
- }
8112
- /**
8113
- * Moves one-entry-per-line data through an edit's line changes so every
8114
- * entry stays with its line, in one pass over the list. The changes come in
8115
- * document order, each numbered as if the changes before it were already
8116
- * applied. Within a change the lines that remain keep their entries, first
8117
- * for first; a line the edit added gets `blank()`; the entries of lines the
8118
- * edit removed are returned. A list may stop short of the document's last
8119
- * line; lines added past its end are not added to it.
8120
- */
8121
- function moveLineEntries(entries, lineChanges, blank) {
8122
- const removed = [];
8123
- if (lineChanges.every(([, , lineDelta]) => lineDelta === 0)) return {
8124
- entries,
8125
- removed
8126
- };
8127
- const moved = [];
8128
- let read = 0;
8129
- let shift = 0;
8130
- for (const [, end, lineDelta] of lineChanges) {
8131
- if (lineDelta === 0) continue;
8132
- const at = (lineDelta > 0 ? end - lineDelta + 1 : end + 1) - shift;
8133
- if (at < read) throw new Error("moveLineEntries: line changes are out of order");
8134
- for (; read < at && read < entries.length; read++) moved.push(entries[read]);
8135
- if (lineDelta > 0) {
8136
- if (at <= entries.length) for (let count = 0; count < lineDelta; count++) moved.push(blank());
8137
- } else {
8138
- const stop = Math.min(at - lineDelta, entries.length);
8139
- for (; read < stop; read++) removed.push(entries[read]);
8140
- }
8141
- shift += lineDelta;
8142
- }
8143
- for (; read < entries.length; read++) moved.push(entries[read]);
8144
- return {
8145
- entries: moved,
8146
- removed
8147
- };
8148
- }
8149
4539
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/model/LineMap.js
8150
4540
  /**
8151
4541
  * Gives every line of an edited document a stable id.
@@ -8939,452 +5329,6 @@ function getLineAnnotationName(annotation) {
8939
5329
  function isDefaultRenderRange(renderRange) {
8940
5330
  return renderRange.startingLine === 0 && renderRange.totalLines === Infinity && renderRange.bufferBefore === 0 && renderRange.bufferAfter === 0;
8941
5331
  }
8942
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/processLine.js
8943
- function processLine$1(node, line, state) {
8944
- const lineInfo = typeof state.lineInfo === "function" ? state.lineInfo(line) : state.lineInfo[line - 1];
8945
- if (lineInfo == null) {
8946
- const errorMessage = `processLine: line ${line}, contains no state.lineInfo`;
8947
- console.error(errorMessage, {
8948
- node,
8949
- line,
8950
- state
8951
- });
8952
- throw new Error(errorMessage);
8953
- }
8954
- node.tagName = "div";
8955
- node.properties["data-line"] = lineInfo.lineNumber;
8956
- node.properties["data-alt-line"] = lineInfo.altLineNumber;
8957
- node.properties["data-line-type"] = lineInfo.type;
8958
- node.properties["data-line-index"] = lineInfo.lineIndex;
8959
- if (node.children.length === 0) node.children.push(createTextNodeElement("\n"));
8960
- return node;
8961
- }
8962
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/tokenStyle.js
8963
- const htmlStyleCache = /* @__PURE__ */ new WeakMap();
8964
- /**
8965
- * Returns CSS declarations for a highlighted token. Enable caching only when
8966
- * htmlStyle objects are immutable and reused across tokens.
8967
- */
8968
- function tokenStyle(token, cacheHtmlStyle = false) {
8969
- const { htmlStyle } = token;
8970
- if (htmlStyle != null) {
8971
- let style = cacheHtmlStyle ? htmlStyleCache.get(htmlStyle) : void 0;
8972
- if (style == null) {
8973
- style = "";
8974
- for (const name in htmlStyle) style += `${style === "" ? "" : ";"}${name}:${htmlStyle[name]}`;
8975
- if (cacheHtmlStyle) htmlStyleCache.set(htmlStyle, style);
8976
- }
8977
- return style;
8978
- }
8979
- let style = token.color != null ? `color:${token.color}` : "";
8980
- if (token.bgColor != null) style += `;background-color:${token.bgColor}`;
8981
- if (token.fontStyle != null) {
8982
- if ((token.fontStyle & 1) !== 0) style += ";font-style:italic";
8983
- if ((token.fontStyle & 2) !== 0) style += ";font-weight:bold";
8984
- const underline = (token.fontStyle & 4) !== 0;
8985
- const strikethrough = (token.fontStyle & 8) !== 0;
8986
- if (underline || strikethrough) style += `;text-decoration:${underline ? "underline" : ""}${underline && strikethrough ? " " : ""}${strikethrough ? "line-through" : ""}`;
8987
- }
8988
- return style.replace(/^;/, "");
8989
- }
8990
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/DecoratedLineBuilder.js
8991
- /**
8992
- * Builds the children of one line element and wraps each decorated range in
8993
- * a <span> with that decoration's attributes.
8994
- *
8995
- * Add the line's text from left to right. Before adding text at a column,
8996
- * call `moveTo(column)`, then add the text to `parent`. Text must be split at
8997
- * `nextEdge`. After the last text, call `moveTo` with the line length.
8998
- */
8999
- var DecoratedLineBuilder = class {
9000
- /** The element that text at the current column should be added to. */
9001
- parent;
9002
- /**
9003
- * The column where the next decoration starts or ends, or the line length
9004
- * when there are no more. It is never Infinity, because that makes the
9005
- * callers' text loops noticeably slower.
9006
- */
9007
- nextEdge;
9008
- #line;
9009
- #lineLength;
9010
- #boundaries = [];
9011
- #boundaryIndex = 0;
9012
- #active = [];
9013
- #stack = [];
9014
- constructor(line, spans, lineIndex, lineLength) {
9015
- this.parent = this.#line = line;
9016
- this.#lineLength = lineLength;
9017
- if (spans.length > 1) spans.sort((a, b) => {
9018
- if (a.start.line !== b.start.line) return a.start.line - b.start.line;
9019
- if (a.start.character !== b.start.character) return a.start.character - b.start.character;
9020
- if (a.end.line !== b.end.line) return b.end.line - a.end.line;
9021
- return b.end.character - a.end.character;
9022
- });
9023
- const boundaries = this.#boundaries;
9024
- for (let order = 0; order < spans.length; order++) {
9025
- const decoration = spans[order];
9026
- const range = {
9027
- decoration,
9028
- order,
9029
- from: decoration.start.line === lineIndex ? decoration.start.character : 0,
9030
- to: decoration.end.line === lineIndex ? decoration.end.character : lineLength
9031
- };
9032
- boundaries.push({
9033
- position: Math.max(0, Math.min(range.from, lineLength)),
9034
- range,
9035
- start: true
9036
- }, {
9037
- position: Math.max(0, Math.min(range.to, lineLength)),
9038
- range,
9039
- start: false
9040
- });
9041
- }
9042
- boundaries.sort((a, b) => a.position - b.position);
9043
- this.nextEdge = boundaries[0]?.position ?? lineLength;
9044
- }
9045
- /** Opens and closes decorations for text that starts at `column`. */
9046
- moveTo(column) {
9047
- if (this.nextEdge === column && this.#boundaryIndex < this.#boundaries.length) this.#advance(column);
9048
- }
9049
- #advance(position) {
9050
- const boundaries = this.#boundaries;
9051
- const lineLength = this.#lineLength;
9052
- const first = this.#boundaryIndex;
9053
- let boundaryIndex = first;
9054
- while (boundaries[boundaryIndex]?.position === position) boundaryIndex++;
9055
- this.#boundaryIndex = boundaryIndex;
9056
- this.nextEdge = boundaries[boundaryIndex]?.position ?? this.#lineLength;
9057
- let hasMarker = false;
9058
- for (let i = first; i < boundaryIndex; i++) {
9059
- const { range, start } = boundaries[i];
9060
- if (!start && range.from !== range.to && position < lineLength) this.#updateActive(range, false);
9061
- }
9062
- for (let i = first; i < boundaryIndex; i++) {
9063
- const { range, start } = boundaries[i];
9064
- if (start && range.from <= position && range.to >= position && (range.to > position || range.from === position || position === lineLength)) {
9065
- this.#updateActive(range, true);
9066
- if (range.from === range.to) hasMarker = true;
9067
- }
9068
- }
9069
- if (hasMarker) {
9070
- this.#getParent();
9071
- for (let i = first; i < boundaryIndex; i++) {
9072
- const { range, start } = boundaries[i];
9073
- if (start && range.from === range.to) this.#updateActive(range, false);
9074
- }
9075
- }
9076
- if (position < lineLength) this.parent = this.#getParent();
9077
- }
9078
- #updateActive(range, add) {
9079
- const active = this.#active;
9080
- let low = 0;
9081
- let high = active.length;
9082
- while (low < high) {
9083
- const middle = low + high >>> 1;
9084
- if (active[middle].order < range.order) low = middle + 1;
9085
- else high = middle;
9086
- }
9087
- if (add) active.splice(low, 0, range);
9088
- else if (active[low] === range) active.splice(low, 1);
9089
- }
9090
- #getParent() {
9091
- const stack = this.#stack;
9092
- let parent = this.#line;
9093
- let depth = 0;
9094
- for (const range of this.#active) {
9095
- if (stack[depth]?.range !== range) {
9096
- stack.length = depth;
9097
- const wrapper = {
9098
- type: "element",
9099
- tagName: "span",
9100
- properties: { ...range.decoration.properties },
9101
- children: []
9102
- };
9103
- parent.children.push(wrapper);
9104
- stack.push({
9105
- range,
9106
- node: wrapper
9107
- });
9108
- }
9109
- parent = stack[depth++].node;
9110
- }
9111
- stack.length = depth;
9112
- return parent;
9113
- }
9114
- };
9115
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/setDeferredArrayItem.js
9116
- function setDeferredArrayItem(array, index, create, { retain = true } = {}) {
9117
- let initialized = false;
9118
- let cached;
9119
- Object.defineProperty(array, index, {
9120
- configurable: true,
9121
- enumerable: true,
9122
- get() {
9123
- if (initialized) return cached;
9124
- const value = create();
9125
- if (!retain) return value;
9126
- cached = value;
9127
- initialized = true;
9128
- if (Object.getOwnPropertyDescriptor(array, index)?.configurable === true) Object.defineProperty(array, index, {
9129
- configurable: true,
9130
- enumerable: true,
9131
- writable: true,
9132
- value: cached
9133
- });
9134
- return cached;
9135
- },
9136
- set(value) {
9137
- if (Object.getOwnPropertyDescriptor(array, index)?.configurable === true) Object.defineProperty(array, index, {
9138
- configurable: true,
9139
- enumerable: true,
9140
- writable: true,
9141
- value
9142
- });
9143
- else if (Object.isFrozen(array)) throw new TypeError(`Cannot assign to read only array index '${index}'`);
9144
- else {
9145
- cached = value;
9146
- initialized = true;
9147
- }
9148
- }
9149
- });
9150
- }
9151
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/wrapTokenFragments.js
9152
- const NO_TOKEN = Symbol("no-token");
9153
- const MULTIPLE_TOKENS = Symbol("multiple-tokens");
9154
- function wrapTokenFragments(container) {
9155
- const ownTokenChar = getTokenChar(container);
9156
- if (ownTokenChar != null) return ownTokenChar;
9157
- let containerTokenState = NO_TOKEN;
9158
- const wrappedChildren = [];
9159
- let currentTokenChildren = [];
9160
- let currentTokenChar;
9161
- const flushTokenChildren = () => {
9162
- if (currentTokenChildren.length === 0 || currentTokenChar == null) {
9163
- currentTokenChildren = [];
9164
- currentTokenChar = void 0;
9165
- return;
9166
- }
9167
- if (currentTokenChildren.length === 1) {
9168
- const child = currentTokenChildren[0];
9169
- if (child?.type === "element") {
9170
- setTokenChar(child, currentTokenChar);
9171
- for (const grandChild of child.children) stripTokenChar(grandChild);
9172
- } else stripTokenChar(child);
9173
- wrappedChildren.push(child);
9174
- currentTokenChildren = [];
9175
- currentTokenChar = void 0;
9176
- return;
9177
- }
9178
- for (const child of currentTokenChildren) stripTokenChar(child);
9179
- wrappedChildren.push(createHastElement({
9180
- tagName: "span",
9181
- properties: { "data-char": currentTokenChar },
9182
- children: currentTokenChildren
9183
- }));
9184
- currentTokenChildren = [];
9185
- currentTokenChar = void 0;
9186
- };
9187
- const mergeContainerTokenState = (childTokenState) => {
9188
- if (childTokenState === NO_TOKEN) return;
9189
- if (childTokenState === MULTIPLE_TOKENS) {
9190
- containerTokenState = MULTIPLE_TOKENS;
9191
- return;
9192
- }
9193
- if (containerTokenState === NO_TOKEN) {
9194
- containerTokenState = childTokenState;
9195
- return;
9196
- }
9197
- if (containerTokenState !== childTokenState) containerTokenState = MULTIPLE_TOKENS;
9198
- };
9199
- for (const child of container.children) {
9200
- const childTokenState = child.type === "element" ? wrapTokenFragments(child) : NO_TOKEN;
9201
- mergeContainerTokenState(childTokenState);
9202
- if (typeof childTokenState !== "number") {
9203
- flushTokenChildren();
9204
- wrappedChildren.push(child);
9205
- continue;
9206
- }
9207
- if (currentTokenChar != null && currentTokenChar !== childTokenState) flushTokenChildren();
9208
- currentTokenChar ??= childTokenState;
9209
- currentTokenChildren.push(child);
9210
- }
9211
- flushTokenChildren();
9212
- container.children = wrappedChildren;
9213
- return containerTokenState;
9214
- }
9215
- function getTokenChar(node) {
9216
- const value = node.properties["data-char"];
9217
- if (typeof value === "number") return value;
9218
- }
9219
- function stripTokenChar(node) {
9220
- if (node.type !== "element") return;
9221
- node.properties["data-char"] = void 0;
9222
- for (const child of node.children) stripTokenChar(child);
9223
- }
9224
- function setTokenChar(node, char) {
9225
- node.properties["data-char"] = char;
9226
- }
9227
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/renderTokenLines.js
9228
- /**
9229
- * Converts highlighted tokens to one HAST element per line for custom renderers.
9230
- * Callers provide any line separators and enclosing pre/code elements.
9231
- */
9232
- function renderTokenLines(lines, { state, lazyLineAST = false, cacheHtmlStyles = false, useTokenTransformer = false, mergeWhitespaces = "always", decorations = [], lineOffsets = [] }) {
9233
- let decorationsByLine;
9234
- for (const decoration of decorations) {
9235
- const byLine = decorationsByLine ??= /* @__PURE__ */ new Map();
9236
- const normalized = {
9237
- ...decoration,
9238
- start: getDecorationPosition(decoration.start, lineOffsets),
9239
- end: getDecorationPosition(decoration.end, lineOffsets)
9240
- };
9241
- const lastLine = Math.min(normalized.end.line, lines.length - 1);
9242
- for (let line = normalized.start.line; line <= lastLine; line++) {
9243
- let spans = byLine.get(line);
9244
- if (spans == null) byLine.set(line, spans = []);
9245
- spans.push(normalized);
9246
- }
9247
- }
9248
- const renderLine = (tokens, lineIndex) => {
9249
- let normalized;
9250
- if (useTokenTransformer || mergeWhitespaces !== "never") {
9251
- let pendingWhitespace = "";
9252
- let whitespaceOffset = 0;
9253
- for (let i = 0; i < tokens.length; i++) {
9254
- let token = tokens[i];
9255
- if (useTokenTransformer) {
9256
- const content = token.content.trim();
9257
- if (content !== "" && content !== token.content) {
9258
- normalized ??= tokens.slice(0, i);
9259
- const start = token.content.indexOf(content);
9260
- if (start > 0) normalized.push({
9261
- content: token.content.slice(0, start),
9262
- offset: token.offset
9263
- });
9264
- normalized.push({
9265
- ...token,
9266
- content,
9267
- offset: token.offset + start
9268
- });
9269
- const end = start + content.length;
9270
- if (end < token.content.length) normalized.push({
9271
- content: token.content.slice(end),
9272
- offset: token.offset + end
9273
- });
9274
- continue;
9275
- }
9276
- } else {
9277
- const decoratedWhitespace = ((token.fontStyle ?? 0) & 12) !== 0;
9278
- if (!decoratedWhitespace && /^\s+$/.test(token.content) && i < tokens.length - 1) {
9279
- normalized ??= tokens.slice(0, i);
9280
- if (pendingWhitespace === "") whitespaceOffset = token.offset;
9281
- pendingWhitespace += token.content;
9282
- continue;
9283
- }
9284
- if (pendingWhitespace !== "" && normalized != null) {
9285
- if (decoratedWhitespace) normalized.push({
9286
- content: pendingWhitespace,
9287
- offset: whitespaceOffset
9288
- });
9289
- else token = {
9290
- ...token,
9291
- content: pendingWhitespace + token.content,
9292
- offset: whitespaceOffset
9293
- };
9294
- pendingWhitespace = "";
9295
- }
9296
- }
9297
- normalized?.push(token);
9298
- }
9299
- }
9300
- normalized ??= tokens;
9301
- const line = {
9302
- type: "element",
9303
- tagName: state == null ? "span" : "div",
9304
- properties: state == null ? { class: "line" } : {},
9305
- children: []
9306
- };
9307
- const spans = decorationsByLine?.get(lineIndex);
9308
- const column = spans == null ? appendTokens(line, normalized, useTokenTransformer, cacheHtmlStyles) : appendDecoratedTokens(line, normalized, spans, lineIndex, useTokenTransformer, cacheHtmlStyles);
9309
- if (useTokenTransformer && column === 0) line.children.push({
9310
- type: "element",
9311
- tagName: "br",
9312
- properties: {},
9313
- children: []
9314
- });
9315
- if (useTokenTransformer && spans != null) wrapTokenFragments(line);
9316
- return state == null ? line : processLine$1(line, lineIndex + 1, state);
9317
- };
9318
- if (!lazyLineAST) return lines.map(renderLine);
9319
- const rows = new Array(lines.length);
9320
- for (let index = 0; index < lines.length; index++) {
9321
- const tokens = lines[index];
9322
- setDeferredArrayItem(rows, index, () => renderLine(tokens, index));
9323
- }
9324
- return rows;
9325
- }
9326
- function appendTokens(line, tokens, useTokenTransformer, cacheHtmlStyles) {
9327
- let column = 0;
9328
- for (const token of tokens) {
9329
- if (token.content === "") continue;
9330
- line.children.push(createTokenSpan(token, tokenStyle(token, cacheHtmlStyles), token.content, column, useTokenTransformer));
9331
- column += token.content.length;
9332
- }
9333
- return column;
9334
- }
9335
- function appendDecoratedTokens(line, tokens, spans, lineIndex, useTokenTransformer, cacheHtmlStyles) {
9336
- let lineLength = 0;
9337
- for (const token of tokens) lineLength += token.content.length;
9338
- const builder = new DecoratedLineBuilder(line, spans, lineIndex, lineLength);
9339
- let column = 0;
9340
- for (const token of tokens) {
9341
- const { content } = token;
9342
- if (content === "") continue;
9343
- const start = column;
9344
- const end = start + content.length;
9345
- const style = tokenStyle(token, cacheHtmlStyles);
9346
- while (column < end) {
9347
- builder.moveTo(column);
9348
- const to = Math.min(end, builder.nextEdge);
9349
- builder.parent.children.push(createTokenSpan(token, style, column === start && to === end ? content : content.slice(column - start, to - start), start, useTokenTransformer));
9350
- column = to;
9351
- }
9352
- }
9353
- builder.moveTo(column);
9354
- return column;
9355
- }
9356
- function createTokenSpan(token, style, text, start, useTokenTransformer) {
9357
- const properties = token.htmlAttrs != null ? { ...token.htmlAttrs } : {};
9358
- if (style !== "") properties.style = style;
9359
- if (useTokenTransformer) properties["data-char"] = start;
9360
- return {
9361
- type: "element",
9362
- tagName: "span",
9363
- properties,
9364
- children: [{
9365
- type: "text",
9366
- value: text
9367
- }]
9368
- };
9369
- }
9370
- function getDecorationPosition(position, lineOffsets) {
9371
- if (typeof position !== "number") return position;
9372
- let low = 0;
9373
- let high = lineOffsets.length;
9374
- while (low + 1 < high) {
9375
- const middle = low + high >>> 1;
9376
- if (lineOffsets[middle] <= position) low = middle;
9377
- else high = middle;
9378
- }
9379
- return {
9380
- line: low,
9381
- character: position - (lineOffsets[low] ?? 0)
9382
- };
9383
- }
9384
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/appendItems.js
9385
- function appendItems(target, items) {
9386
- for (const item of items) target.push(item);
9387
- }
9388
5332
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/utils/getTokenOptions.js
9389
5333
  function getTokenOptions(lang, theme, tokenizeMaxLineLength) {
9390
5334
  return {
@@ -18678,37 +14622,6 @@ function parseLineIndex(lineIndexAttr, diffStyle) {
18678
14622
  const [unifiedIndex, splitIndex] = lineIndexAttr.split(",").map(Number);
18679
14623
  return diffStyle === "split" ? splitIndex : unifiedIndex;
18680
14624
  }
18681
- // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/editor/utils.js
18682
- function h$1(tagName, props, parent) {
18683
- const { style, dataset, children, ...attrs } = props ?? {};
18684
- const el = document.createElement(tagName);
18685
- Object.assign(el, attrs);
18686
- if (style !== void 0) {
18687
- if (typeof style === "string") el.style.cssText = style;
18688
- else Object.assign(el.style, style);
18689
- }
18690
- if (dataset !== void 0) {
18691
- if (typeof dataset === "string") el.dataset[dataset] = "";
18692
- else if (Array.isArray(dataset)) dataset.forEach((key) => {
18693
- el.dataset[key] = "";
18694
- });
18695
- else Object.assign(el.dataset, dataset);
18696
- }
18697
- if (children !== void 0) el.replaceChildren(...children);
18698
- if (parent !== void 0) parent.appendChild(el);
18699
- return el;
18700
- }
18701
- function debounce(func, wait) {
18702
- let timeout;
18703
- return function(...args) {
18704
- clearTimeout(timeout);
18705
- timeout = setTimeout(() => func.apply(this, args), wait);
18706
- };
18707
- }
18708
- function createSegmenter(options) {
18709
- if (typeof Intl === "undefined" || typeof Intl.Segmenter !== "function") return;
18710
- return new Intl.Segmenter(void 0, options);
18711
- }
18712
14625
  // ../../node_modules/.pnpm/@pierre+diffs@1.7.1_@shikijs+themes@4.6.0_react-dom@19.2.8_react@19.2.6__react@19.2.6/node_modules/@pierre/diffs/dist/editor/selection.js
18713
14626
  /**
18714
14627
  * Checks if a selection is collapsed.
@@ -24174,6 +20087,21 @@ function getUnresolvedDiffHunksRendererOptions(options, baseOptions) {
24174
20087
  mergeConflictActionsType: typeof options?.mergeConflictActionsType === "function" ? "custom" : options?.mergeConflictActionsType
24175
20088
  };
24176
20089
  }
20090
+ // src/internal/pierre-props.ts
20091
+ const pierrePropTypes = {
20092
+ codeViewItems: Array,
20093
+ codeViewOptions: Object,
20094
+ codeViewSelection: Object,
20095
+ diffLineAnnotations: Array,
20096
+ fileContents: Object,
20097
+ fileDiff: Object,
20098
+ fileDiffOptions: Object,
20099
+ fileOptions: Object,
20100
+ lineAnnotations: Array,
20101
+ nullableFileContents: [Object, null],
20102
+ selectedLines: Object,
20103
+ unresolvedFileOptions: Object
20104
+ };
24177
20105
  // src/internal/pierre-code-view.ts
24178
20106
  const selectedLinesProp = {
24179
20107
  default: void 0,
@@ -24214,10 +20142,6 @@ function useOwnerRender() {
24214
20142
  function sameDiffSource(diff, rendered) {
24215
20143
  return diff === rendered || diff?.cacheKey != null && diff.cacheKey === rendered?.cacheKey;
24216
20144
  }
24217
- /**
24218
- * Centers `row` in the nearest ancestor of the view that scrolls, else in the page. `scrollIntoView` alone also moves
24219
- * each `overflow: hidden` ancestor, such as an app shell.
24220
- */
24221
20145
  function scrollToRow(host, row) {
24222
20146
  let scroller = host;
24223
20147
  while (scroller && !(/auto|scroll|overlay/.test(getComputedStyle(scroller).overflowY) && scroller.scrollHeight > scroller.clientHeight)) scroller = scroller.parentElement;
@@ -24231,10 +20155,6 @@ function scrollToRow(host, row) {
24231
20155
  const rect = row.getBoundingClientRect();
24232
20156
  scroller.scrollTop += rect.top - scroller.getBoundingClientRect().top - (scroller.clientHeight - rect.height) / 2;
24233
20157
  }
24234
- /**
24235
- * Scrolls the first selected line into view, once for each new range or `source`. Pierre marks the selected rows in a
24236
- * later frame and renders the file after its highlighter loads, so this waits for the row of the new selection.
24237
- */
24238
20158
  function createSelectionScroll(getHost, isSourceRendered) {
24239
20159
  let key;
24240
20160
  let observer;
@@ -24320,10 +20240,6 @@ function trackArrayItems(values) {
24320
20240
  for (const value of values) trackShallow(value);
24321
20241
  return toRaw(values);
24322
20242
  }
24323
- /**
24324
- * The annotations to pass to Pierre. Pierre compares annotation lists by reference, so the list is a new array only
24325
- * when the prop or one of its items changes, and the same array when the view renders for another reason.
24326
- */
24327
20243
  function useLineAnnotations(read) {
24328
20244
  return computed(() => [...trackArrayItems(read()) ?? []]);
24329
20245
  }
@@ -24337,19 +20253,20 @@ function copyParseDiffOptions(options) {
24337
20253
  headerOptions: options.headerOptions ? { ...options.headerOptions } : void 0
24338
20254
  };
24339
20255
  }
20256
+ const pierreDiffProps = {
20257
+ fileDiff: { type: pierrePropTypes.fileDiff },
20258
+ lineAnnotations: { type: pierrePropTypes.diffLineAnnotations },
20259
+ newFile: { type: pierrePropTypes.nullableFileContents },
20260
+ oldFile: { type: pierrePropTypes.nullableFileContents },
20261
+ options: { type: pierrePropTypes.fileDiffOptions },
20262
+ patch: { type: String },
20263
+ scrollToSelectedLines: scrollToSelectedLinesProp,
20264
+ selectedLines: selectedLinesProp
20265
+ };
24340
20266
  const PierreDiff = defineComponent({
24341
20267
  name: "ViteHubPierreDiff",
24342
20268
  inheritAttrs: false,
24343
- props: {
24344
- fileDiff: { type: pierrePropTypes.fileDiff },
24345
- lineAnnotations: { type: pierrePropTypes.diffLineAnnotations },
24346
- newFile: { type: pierrePropTypes.nullableFileContents },
24347
- oldFile: { type: pierrePropTypes.nullableFileContents },
24348
- options: { type: pierrePropTypes.fileDiffOptions },
24349
- patch: { type: String },
24350
- scrollToSelectedLines: scrollToSelectedLinesProp,
24351
- selectedLines: selectedLinesProp
24352
- },
20269
+ props: pierreDiffProps,
24353
20270
  setup(props, { attrs, expose }) {
24354
20271
  let host = null;
24355
20272
  let instance;
@@ -24403,21 +20320,23 @@ const PierreDiff = defineComponent({
24403
20320
  });
24404
20321
  expose({ getInstance: () => instance });
24405
20322
  return () => h(DIFFS_TAG_NAME, {
20323
+ "data-slot": "pierre-diff",
24406
20324
  ...attrs,
24407
20325
  ref: setHost
24408
20326
  });
24409
20327
  }
24410
20328
  });
20329
+ const pierreFileProps = {
20330
+ file: { type: pierrePropTypes.fileContents },
20331
+ lineAnnotations: { type: pierrePropTypes.lineAnnotations },
20332
+ options: { type: pierrePropTypes.fileOptions },
20333
+ scrollToSelectedLines: scrollToSelectedLinesProp,
20334
+ selectedLines: selectedLinesProp
20335
+ };
24411
20336
  const PierreFile = defineComponent({
24412
20337
  name: "ViteHubPierreFile",
24413
20338
  inheritAttrs: false,
24414
- props: {
24415
- file: { type: pierrePropTypes.fileContents },
24416
- lineAnnotations: { type: pierrePropTypes.lineAnnotations },
24417
- options: { type: pierrePropTypes.fileOptions },
24418
- scrollToSelectedLines: scrollToSelectedLinesProp,
24419
- selectedLines: selectedLinesProp
24420
- },
20339
+ props: pierreFileProps,
24421
20340
  setup(props, { attrs, expose }) {
24422
20341
  let host = null;
24423
20342
  let instance;
@@ -24456,21 +20375,23 @@ const PierreFile = defineComponent({
24456
20375
  });
24457
20376
  expose({ getInstance: () => instance });
24458
20377
  return () => h(DIFFS_TAG_NAME, {
20378
+ "data-slot": "pierre-file",
24459
20379
  ...attrs,
24460
20380
  ref: setHost
24461
20381
  });
24462
20382
  }
24463
20383
  });
20384
+ const pierreUnresolvedFileProps = {
20385
+ file: { type: pierrePropTypes.fileContents },
20386
+ lineAnnotations: { type: pierrePropTypes.diffLineAnnotations },
20387
+ options: { type: pierrePropTypes.unresolvedFileOptions },
20388
+ scrollToSelectedLines: scrollToSelectedLinesProp,
20389
+ selectedLines: selectedLinesProp
20390
+ };
24464
20391
  const PierreUnresolvedFile = defineComponent({
24465
20392
  name: "ViteHubPierreUnresolvedFile",
24466
20393
  inheritAttrs: false,
24467
- props: {
24468
- file: { type: pierrePropTypes.fileContents },
24469
- lineAnnotations: { type: pierrePropTypes.diffLineAnnotations },
24470
- options: { type: pierrePropTypes.unresolvedFileOptions },
24471
- scrollToSelectedLines: scrollToSelectedLinesProp,
24472
- selectedLines: selectedLinesProp
24473
- },
20394
+ props: pierreUnresolvedFileProps,
24474
20395
  setup(props, { attrs, expose }) {
24475
20396
  let host = null;
24476
20397
  let instance;
@@ -24516,26 +20437,28 @@ const PierreUnresolvedFile = defineComponent({
24516
20437
  });
24517
20438
  expose({ getInstance: () => instance });
24518
20439
  return () => h(DIFFS_TAG_NAME, {
20440
+ "data-slot": "pierre-unresolved-file",
24519
20441
  ...attrs,
24520
20442
  ref: setHost
24521
20443
  });
24522
20444
  }
24523
20445
  });
20446
+ const pierreCodeViewProps = {
20447
+ items: {
20448
+ required: true,
20449
+ type: pierrePropTypes.codeViewItems
20450
+ },
20451
+ options: { type: pierrePropTypes.codeViewOptions },
20452
+ scrollToSelectedLines: scrollToSelectedLinesProp,
20453
+ selectedLines: {
20454
+ default: void 0,
20455
+ type: pierrePropTypes.codeViewSelection
20456
+ }
20457
+ };
24524
20458
  const PierreCodeView = defineComponent({
24525
20459
  name: "ViteHubPierreCodeView",
24526
20460
  inheritAttrs: false,
24527
- props: {
24528
- items: {
24529
- required: true,
24530
- type: pierrePropTypes.codeViewItems
24531
- },
24532
- options: { type: pierrePropTypes.codeViewOptions },
24533
- scrollToSelectedLines: scrollToSelectedLinesProp,
24534
- selectedLines: {
24535
- default: void 0,
24536
- type: pierrePropTypes.codeViewSelection
24537
- }
24538
- },
20461
+ props: pierreCodeViewProps,
24539
20462
  setup(props, { attrs, expose }) {
24540
20463
  let host = null;
24541
20464
  let instance;
@@ -24569,9 +20492,10 @@ const PierreCodeView = defineComponent({
24569
20492
  onBeforeUnmount(() => instance?.cleanUp());
24570
20493
  expose({ getInstance: () => instance });
24571
20494
  return () => h("div", {
20495
+ "data-slot": "pierre-code-view",
24572
20496
  ...attrs,
24573
20497
  ref: setHost
24574
20498
  });
24575
20499
  }
24576
20500
  });
24577
- export { PierreCodeView, PierreDiff, PierreFile, PierreUnresolvedFile, releaseHighlighterType as _, moveLineEntries as a, createDiffsThemeResolver as c, AttachedLanguages as d, RegisteredCustomLanguages as f, acquireHighlighterType as g, HighlighterDisposedError as h, lineChangesOf as i, unwrapDefault as l, ResolvingLanguages as m, appendItems as n, hastToHtml as o, ResolvedLanguages as p, renderTokenLines as r, formatCSSVariablePrefix as s, debounce as t, isWorkerContext as u };
20501
+ export { PierreCodeView, PierreDiff, PierreFile, PierreUnresolvedFile, getSingularPatch, parseDiffFromFile, parsePatchFiles };