@8wave/ai-elements 0.111.0-beta.3 → 0.111.0-beta.8

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 (209) hide show
  1. package/dist/_chunks/{Agent-Su_LDF9_.js → Agent-tE7ZJPxG.js} +80 -78
  2. package/dist/_chunks/Agent-tE7ZJPxG.js.map +1 -0
  3. package/dist/_chunks/{Document-DecVclEe.js → Document-Bmx6774B.js} +33 -21
  4. package/dist/_chunks/Document-Bmx6774B.js.map +1 -0
  5. package/dist/_chunks/Media-Cft7Pwrh.js +108 -0
  6. package/dist/_chunks/Media-Cft7Pwrh.js.map +1 -0
  7. package/dist/_chunks/{PkLazyImg-ClL4nr95.js → PkLazyImg-Dbj2dDXA.js} +2 -2
  8. package/dist/_chunks/{PkLazyImg-ClL4nr95.js.map → PkLazyImg-Dbj2dDXA.js.map} +1 -1
  9. package/dist/_chunks/{PkStreamingMarkdown-CwqsJnJJ.js → PkStreamingMarkdown-CNI8aV8t.js} +636 -427
  10. package/dist/_chunks/PkStreamingMarkdown-CNI8aV8t.js.map +1 -0
  11. package/dist/_chunks/{PkToolRequestGeolocation-OokLeTf1.js → PkToolRequestGeolocation-Bzy4IYSp.js} +3 -3
  12. package/{dist-vue/_chunks/PkToolRequestGeolocation-Bxqz9oSo.js.map → dist/_chunks/PkToolRequestGeolocation-Bzy4IYSp.js.map} +1 -1
  13. package/dist/_chunks/{PkToolRequestOAuthConnection-CtqKG6Yb.js → PkToolRequestOAuthConnection-CWEKoD71.js} +3 -3
  14. package/dist/_chunks/{PkToolRequestOAuthConnection-CtqKG6Yb.js.map → PkToolRequestOAuthConnection-CWEKoD71.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js → PkToolShowArtifact-CGbHDEie.js} +4 -4
  16. package/dist/_chunks/{PkToolShowArtifact-M6jlSmyJ.js.map → PkToolShowArtifact-CGbHDEie.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js → PkToolShowCalendarEvent-DIFX_rUz.js} +3 -3
  18. package/dist/_chunks/{PkToolShowCalendarEvent-C41JgOUA.js.map → PkToolShowCalendarEvent-DIFX_rUz.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowComparison-DbbUD9pg.js → PkToolShowComparison-B38hHWq2.js} +3 -3
  20. package/dist/_chunks/{PkToolShowComparison-DbbUD9pg.js.map → PkToolShowComparison-B38hHWq2.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowContactForm-D_dW59Dl.js → PkToolShowContactForm-DUw_bZiJ.js} +4 -4
  22. package/dist/_chunks/{PkToolShowContactForm-D_dW59Dl.js.map → PkToolShowContactForm-DUw_bZiJ.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowDiagram-BdmG9gm8.js → PkToolShowDiagram-Dx1Ba0PG.js} +3 -3
  24. package/dist/_chunks/PkToolShowDiagram-Dx1Ba0PG.js.map +1 -0
  25. package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js → PkToolShowEmail-DnFFgzom.js} +3 -3
  26. package/dist/_chunks/{PkToolShowEmail-Dn3JHYIR.js.map → PkToolShowEmail-DnFFgzom.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowForm-DbJHMDbt.js → PkToolShowForm-CKQQltJ6.js} +6 -7
  28. package/dist/_chunks/PkToolShowForm-CKQQltJ6.js.map +1 -0
  29. package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js → PkToolShowImageGallery-D99N_Plf.js} +2 -2
  30. package/dist/_chunks/{PkToolShowImageGallery-C1lzlO0y.js.map → PkToolShowImageGallery-D99N_Plf.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js → PkToolShowLocation-AfnrtFVJ.js} +3 -3
  32. package/dist/_chunks/{PkToolShowLocation-CKhPxKFA.js.map → PkToolShowLocation-AfnrtFVJ.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js → PkToolShowMessage-DUo2c-im.js} +3 -3
  34. package/dist/_chunks/{PkToolShowMessage-U9CCU7eG.js.map → PkToolShowMessage-DUo2c-im.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js → PkToolShowProductList-BN6Qk1_y.js} +3 -3
  36. package/dist/_chunks/{PkToolShowProductList-UeiRMLHu.js.map → PkToolShowProductList-BN6Qk1_y.js.map} +1 -1
  37. package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js → PkToolShowQrCode-BLqeBecX.js} +3 -3
  38. package/dist/_chunks/{PkToolShowQrCode-CypLrfh5.js.map → PkToolShowQrCode-BLqeBecX.js.map} +1 -1
  39. package/dist/_chunks/{PkToolShowSources-Dot-W0Mj.js → PkToolShowSources-DpZb5FUP.js} +4 -4
  40. package/dist/_chunks/{PkToolShowSources-Dot-W0Mj.js.map → PkToolShowSources-DpZb5FUP.js.map} +1 -1
  41. package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js → PkToolShowSuggestedReply-C10nNgBs.js} +3 -3
  42. package/dist/_chunks/{PkToolShowSuggestedReply-CKxSH0Y9.js.map → PkToolShowSuggestedReply-C10nNgBs.js.map} +1 -1
  43. package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js → PkToolShowVideo-S9b4QHUj.js} +2 -2
  44. package/dist/_chunks/{PkToolShowVideo-BgKxdBcC.js.map → PkToolShowVideo-S9b4QHUj.js.map} +1 -1
  45. package/dist/_chunks/{PkToolShowWeather-LPd3tC77.js → PkToolShowWeather-CqhG430w.js} +2 -2
  46. package/dist/_chunks/PkToolShowWeather-CqhG430w.js.map +1 -0
  47. package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js → PkToolShowWebPages-txAZi_iG.js} +3 -3
  48. package/dist/_chunks/{PkToolShowWebPages-ep_erFF0.js.map → PkToolShowWebPages-txAZi_iG.js.map} +1 -1
  49. package/dist/_chunks/PkUrl-BPbjZJ1A.js.map +1 -1
  50. package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js → VvCheckboxGroup.es-CTrF3pue.js} +2 -2
  51. package/dist/_chunks/{VvCheckboxGroup.es-Bdu2gFLN.js.map → VvCheckboxGroup.es-CTrF3pue.js.map} +1 -1
  52. package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js → VvCombobox.es-BWiXmQ_S.js} +10 -10
  53. package/dist/_chunks/{VvCombobox.es-C0wpJIr_.js.map → VvCombobox.es-BWiXmQ_S.js.map} +1 -1
  54. package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js → VvInputText.es-Bo9I6g8H.js} +6 -6
  55. package/dist/_chunks/{VvInputText.es-Zgtw2YNw.js.map → VvInputText.es-Bo9I6g8H.js.map} +1 -1
  56. package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js → VvRadioGroup.es-9ooHCuik.js} +2 -2
  57. package/dist/_chunks/{VvRadioGroup.es-DZLL19SC.js.map → VvRadioGroup.es-9ooHCuik.js.map} +1 -1
  58. package/dist/_chunks/{VvSelect.es-ovnZRHG5.js → VvSelect.es-DG0VuWtP.js} +2 -2
  59. package/dist/_chunks/{VvSelect.es-ovnZRHG5.js.map → VvSelect.es-DG0VuWtP.js.map} +1 -1
  60. package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js → VvTextarea.es-Dg3pxdZy.js} +6 -6
  61. package/dist/_chunks/{VvTextarea.es-DbP5Lt2T.js.map → VvTextarea.es-Dg3pxdZy.js.map} +1 -1
  62. package/dist/_chunks/{browser-NgY6LXg-.js → browser-B0Xnbqi7.js} +726 -751
  63. package/dist/_chunks/browser-B0Xnbqi7.js.map +1 -0
  64. package/dist/_chunks/{dist-n5iFNYf-.js → dist-QdjZA6MJ.js} +143 -133
  65. package/dist/_chunks/{dist-n5iFNYf-.js.map → dist-QdjZA6MJ.js.map} +1 -1
  66. package/dist/_chunks/{index.es-dtdl3VFG.js → index.es-0YpCa4c5.js} +6 -6
  67. package/dist/_chunks/{index.es-dtdl3VFG.js.map → index.es-0YpCa4c5.js.map} +1 -1
  68. package/dist/_chunks/{index.es-BJnUA_36.js → index.es-CHkJ2TMJ.js} +10 -10
  69. package/dist/_chunks/{index.es-BJnUA_36.js.map → index.es-CHkJ2TMJ.js.map} +1 -1
  70. package/dist/_chunks/text-DbSEK8si.js.map +1 -1
  71. package/dist/ai-elements.es.js +3064 -3094
  72. package/dist/ai-elements.es.js.map +1 -1
  73. package/dist-vue/PkChatbot.js +1 -1
  74. package/dist-vue/PkChatbotEmptyState.js +1 -1
  75. package/dist-vue/PkChatbotError.js +1 -1
  76. package/dist-vue/PkChatbotInput.js +1 -1
  77. package/dist-vue/PkChatbotMessages.js +1 -1
  78. package/dist-vue/PkChatbotStepPayload.js +1 -1
  79. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  80. package/dist-vue/PkChatbotSteps.js +1 -1
  81. package/dist-vue/PkChatbotViewChat.js +1 -1
  82. package/dist-vue/PkChatbotViewConversations.js +1 -1
  83. package/dist-vue/PkChatbotViewFiles.js +1 -1
  84. package/dist-vue/PkChatbotViewProfile.js +1 -1
  85. package/dist-vue/_chunks/{Agent-C8BsTAxk.js → Agent-De2gFNjR.js} +165 -176
  86. package/dist-vue/_chunks/Agent-De2gFNjR.js.map +1 -0
  87. package/dist-vue/_chunks/{Document-CaUfI_SZ.js → Document-8umjeTVS.js} +84 -72
  88. package/dist-vue/_chunks/Document-8umjeTVS.js.map +1 -0
  89. package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
  90. package/dist-vue/_chunks/{PkChatbot-BPKSPIeC.js → PkChatbot-DE1bKmDi.js} +61 -61
  91. package/dist-vue/_chunks/PkChatbot-DE1bKmDi.js.map +1 -0
  92. package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js → PkChatbotEmptyState-BtzBYOHJ.js} +2 -2
  93. package/dist-vue/_chunks/{PkChatbotEmptyState-BvaeBxhx.js.map → PkChatbotEmptyState-BtzBYOHJ.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkChatbotError-CBP2mf-n.js → PkChatbotError-gvDpRcEz.js} +21 -19
  95. package/dist-vue/_chunks/PkChatbotError-gvDpRcEz.js.map +1 -0
  96. package/dist-vue/_chunks/{PkChatbotInput-JnHaRlfk.js → PkChatbotInput-MSpF6SB6.js} +139 -124
  97. package/dist-vue/_chunks/PkChatbotInput-MSpF6SB6.js.map +1 -0
  98. package/dist-vue/_chunks/PkChatbotMessages-B6ONEJnZ.js +776 -0
  99. package/dist-vue/_chunks/PkChatbotMessages-B6ONEJnZ.js.map +1 -0
  100. package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js → PkChatbotStepPayload-XW4gT9AZ.js} +2 -2
  101. package/dist-vue/_chunks/{PkChatbotStepPayload-BH6piqOi.js.map → PkChatbotStepPayload-XW4gT9AZ.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js → PkChatbotStepToolDetail-C4-K6Glw.js} +3 -3
  103. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BJ7xUvgi.js.map → PkChatbotStepToolDetail-C4-K6Glw.js.map} +1 -1
  104. package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js +190 -0
  105. package/dist-vue/_chunks/PkChatbotSteps-CrqjWpv0.js.map +1 -0
  106. package/dist-vue/_chunks/{PkChatbotViewChat-CEqzF1G9.js → PkChatbotViewChat-BMQtx1Gi.js} +10 -10
  107. package/dist-vue/_chunks/{PkChatbotViewChat-CEqzF1G9.js.map → PkChatbotViewChat-BMQtx1Gi.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkChatbotViewConversations-C787v5ll.js → PkChatbotViewConversations-3LaZPFyw.js} +2 -2
  109. package/dist-vue/_chunks/{PkChatbotViewConversations-C787v5ll.js.map → PkChatbotViewConversations-3LaZPFyw.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkChatbotViewFiles-CNFLt8YO.js → PkChatbotViewFiles-CTqnbsCj.js} +3 -3
  111. package/dist-vue/_chunks/{PkChatbotViewFiles-CNFLt8YO.js.map → PkChatbotViewFiles-CTqnbsCj.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkChatbotViewProfile-7p0ci3qm.js → PkChatbotViewProfile-B-Mp1jGQ.js} +2 -2
  113. package/dist-vue/_chunks/{PkChatbotViewProfile-7p0ci3qm.js.map → PkChatbotViewProfile-B-Mp1jGQ.js.map} +1 -1
  114. package/dist-vue/_chunks/PkRelativeTime--1cIphlA.js.map +1 -1
  115. package/dist-vue/_chunks/{PkStreamingMarkdown-D8_LwZMR.js → PkStreamingMarkdown-D0IOaETI.js} +432 -419
  116. package/dist-vue/_chunks/PkStreamingMarkdown-D0IOaETI.js.map +1 -0
  117. package/dist-vue/_chunks/PkSvgViewer-D-0M5bqg.js.map +1 -1
  118. package/dist-vue/_chunks/{PkToolRequestGeolocation-Bxqz9oSo.js → PkToolRequestGeolocation-Q3N3jlO8.js} +2 -2
  119. package/{dist/_chunks/PkToolRequestGeolocation-OokLeTf1.js.map → dist-vue/_chunks/PkToolRequestGeolocation-Q3N3jlO8.js.map} +1 -1
  120. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C6rXgb0s.js → PkToolRequestOAuthConnection-C0LW5Evp.js} +2 -2
  121. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C6rXgb0s.js.map → PkToolRequestOAuthConnection-C0LW5Evp.js.map} +1 -1
  122. package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js → PkToolShowArtifact-DHdJuzDi.js} +2 -2
  123. package/dist-vue/_chunks/{PkToolShowArtifact-CEXdfOGG.js.map → PkToolShowArtifact-DHdJuzDi.js.map} +1 -1
  124. package/dist-vue/_chunks/{PkToolShowContactForm-DHmzAIVF.js → PkToolShowContactForm-BB2X4UdQ.js} +2 -2
  125. package/dist-vue/_chunks/{PkToolShowContactForm-DHmzAIVF.js.map → PkToolShowContactForm-BB2X4UdQ.js.map} +1 -1
  126. package/dist-vue/_chunks/{PkToolShowDiagram-dwCVZ1up.js → PkToolShowDiagram-BH6ihikd.js} +2 -2
  127. package/dist-vue/_chunks/PkToolShowDiagram-BH6ihikd.js.map +1 -0
  128. package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js → PkToolShowEmail-DF__nKpR.js} +2 -2
  129. package/dist-vue/_chunks/{PkToolShowEmail-CavhsPvi.js.map → PkToolShowEmail-DF__nKpR.js.map} +1 -1
  130. package/dist-vue/_chunks/{PkToolShowForm-CO5A_j9L.js → PkToolShowForm-DUKIyj9V.js} +6 -6
  131. package/dist-vue/_chunks/PkToolShowForm-DUKIyj9V.js.map +1 -0
  132. package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js → PkToolShowMessage-Ck6VP-gw.js} +2 -2
  133. package/dist-vue/_chunks/{PkToolShowMessage-DQojxDiV.js.map → PkToolShowMessage-Ck6VP-gw.js.map} +1 -1
  134. package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js → PkToolShowProductList-zfM8cx-l.js} +2 -2
  135. package/dist-vue/_chunks/{PkToolShowProductList-Cn0yewM3.js.map → PkToolShowProductList-zfM8cx-l.js.map} +1 -1
  136. package/dist-vue/_chunks/{PkToolShowSources-7Q5Iogxi.js → PkToolShowSources-Dlaz2Y77.js} +4 -4
  137. package/dist-vue/_chunks/{PkToolShowSources-7Q5Iogxi.js.map → PkToolShowSources-Dlaz2Y77.js.map} +1 -1
  138. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js → PkToolShowSuggestedReply-DWLkUh2L.js} +2 -2
  139. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DQFOVonE.js.map → PkToolShowSuggestedReply-DWLkUh2L.js.map} +1 -1
  140. package/dist-vue/_chunks/PkToolShowWeather-Bzqalzh8.js.map +1 -1
  141. package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js → PkToolShowWebPages-CosBYLrE.js} +2 -2
  142. package/dist-vue/_chunks/{PkToolShowWebPages-Bzkkn9GV.js.map → PkToolShowWebPages-CosBYLrE.js.map} +1 -1
  143. package/dist-vue/_chunks/{PkUrl-xUBKVJCv.js → PkUrl-B5CNTQj9.js} +2 -2
  144. package/dist-vue/_chunks/PkUrl-B5CNTQj9.js.map +1 -0
  145. package/dist-vue/_chunks/{createChatbotApiClient-D9f69brW.js → createChatbotApiClient-MkaPbGWB.js} +2 -2
  146. package/dist-vue/_chunks/createChatbotApiClient-MkaPbGWB.js.map +1 -0
  147. package/dist-vue/_chunks/{useChatbotStore-9Cw_oR6J.js → useChatbotStore-BzfqjiYz.js} +6 -3
  148. package/dist-vue/_chunks/useChatbotStore-BzfqjiYz.js.map +1 -0
  149. package/dist-vue/_chunks/useDialogConfirm-KWz0ohCQ.js.map +1 -1
  150. package/dist-vue/_chunks/{utils-Coqik0XI.js → utils-C1666_6C.js} +58 -43
  151. package/dist-vue/_chunks/utils-C1666_6C.js.map +1 -0
  152. package/dist-vue/api.js +1 -1
  153. package/dist-vue/composables.js +3 -3
  154. package/dist-vue/index.js +3853 -3485
  155. package/dist-vue/index.js.map +1 -1
  156. package/dist-vue/locales.js +36 -8
  157. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +20 -3
  158. package/dist-vue/packages/components/src/chat/PkChatButton.d.ts +3 -2
  159. package/dist-vue/packages/components/src/chat/PkLanguageModel.d.ts +26 -2
  160. package/dist-vue/packages/components/src/chat/PkLanguageModelCombobox.d.ts +53 -1
  161. package/dist-vue/packages/components/src/chat/PkModelOption.d.ts +19 -0
  162. package/dist-vue/packages/components/src/chat/PkReasoningSettings.d.ts +6 -0
  163. package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +6 -0
  164. package/dist-vue/packages/components/src/chat/PkStreamingMarkdownAutoscroll.d.ts +1 -0
  165. package/dist-vue/packages/components/src/chat/constants.d.ts +5 -18
  166. package/dist-vue/packages/components/src/chat/index.d.ts +3 -1
  167. package/dist-vue/packages/components/src/chat/modelCatalog.d.ts +46 -0
  168. package/dist-vue/packages/components/src/chat/utils.d.ts +16 -0
  169. package/dist-vue/packages/components/src/table/PkTableSortable.d.ts +5 -1
  170. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
  171. package/dist-vue/packages/composable/src/useChatbotError.d.ts +2 -0
  172. package/dist-vue/packages/models/src/schema/Agent.d.ts +70 -10
  173. package/dist-vue/packages/models/src/schema/Chat.d.ts +10 -0
  174. package/dist-vue/packages/models/src/schema/ModelProvider.d.ts +316 -0
  175. package/dist-vue/packages/models/src/schema/Organization.d.ts +142 -2
  176. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +20 -0
  177. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +20 -0
  178. package/dist-vue/packages/models/src/schema/UserOverview.d.ts +41 -0
  179. package/dist-vue/packages/models/src/schema/constants.d.ts +56 -91
  180. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  181. package/dist-vue/style.css +1 -1
  182. package/package.json +1 -1
  183. package/dist/_chunks/Agent-Su_LDF9_.js.map +0 -1
  184. package/dist/_chunks/Document-DecVclEe.js.map +0 -1
  185. package/dist/_chunks/Media-C6SOQfJZ.js +0 -122
  186. package/dist/_chunks/Media-C6SOQfJZ.js.map +0 -1
  187. package/dist/_chunks/PkStreamingMarkdown-CwqsJnJJ.js.map +0 -1
  188. package/dist/_chunks/PkToolShowDiagram-BdmG9gm8.js.map +0 -1
  189. package/dist/_chunks/PkToolShowForm-DbJHMDbt.js.map +0 -1
  190. package/dist/_chunks/PkToolShowWeather-LPd3tC77.js.map +0 -1
  191. package/dist/_chunks/browser-NgY6LXg-.js.map +0 -1
  192. package/dist/_chunks/utils-YJ0ZOLDG.js +0 -185
  193. package/dist/_chunks/utils-YJ0ZOLDG.js.map +0 -1
  194. package/dist-vue/_chunks/Agent-C8BsTAxk.js.map +0 -1
  195. package/dist-vue/_chunks/Document-CaUfI_SZ.js.map +0 -1
  196. package/dist-vue/_chunks/PkChatbot-BPKSPIeC.js.map +0 -1
  197. package/dist-vue/_chunks/PkChatbotError-CBP2mf-n.js.map +0 -1
  198. package/dist-vue/_chunks/PkChatbotInput-JnHaRlfk.js.map +0 -1
  199. package/dist-vue/_chunks/PkChatbotMessages-DAlkoMkY.js +0 -771
  200. package/dist-vue/_chunks/PkChatbotMessages-DAlkoMkY.js.map +0 -1
  201. package/dist-vue/_chunks/PkChatbotSteps-rommD48p.js +0 -180
  202. package/dist-vue/_chunks/PkChatbotSteps-rommD48p.js.map +0 -1
  203. package/dist-vue/_chunks/PkStreamingMarkdown-D8_LwZMR.js.map +0 -1
  204. package/dist-vue/_chunks/PkToolShowDiagram-dwCVZ1up.js.map +0 -1
  205. package/dist-vue/_chunks/PkToolShowForm-CO5A_j9L.js.map +0 -1
  206. package/dist-vue/_chunks/PkUrl-xUBKVJCv.js.map +0 -1
  207. package/dist-vue/_chunks/createChatbotApiClient-D9f69brW.js.map +0 -1
  208. package/dist-vue/_chunks/useChatbotStore-9Cw_oR6J.js.map +0 -1
  209. package/dist-vue/_chunks/utils-Coqik0XI.js.map +0 -1
@@ -1,27 +1,224 @@
1
- import { C as e, F as t, J as n, L as r, N as i, O as a, P as o, X as s, m as c, v as l } from "./vue.runtime.esm-bundler-CIT_Sbqw.js";
2
- import { r as u } from "./vue-i18n-BdMHu4Kd.js";
3
- import { n as d, t as f } from "./cdn-css-JUUNhyQ6.js";
1
+ import { C as e, F as t, J as n, L as r, N as i, O as a, P as o, X as s, _t as c, it as l, m as u, v as d } from "./vue.runtime.esm-bundler-CIT_Sbqw.js";
2
+ import { r as f } from "./vue-i18n-BdMHu4Kd.js";
3
+ import { n as p, t as m } from "./cdn-css-JUUNhyQ6.js";
4
4
  import "./src-BQHP1-Xs.js";
5
- import { n as p } from "./url-validation-uLMZ5-AU.js";
6
- import { n as m } from "./useShortUrlResolver-DuDol0Oq.js";
7
- import { t as ee } from "./_plugin-vue_export-helper-B3ysoDQm.js";
5
+ import { n as ee } from "./url-validation-uLMZ5-AU.js";
6
+ import { v as te } from "./dist-QdjZA6MJ.js";
7
+ import { n as ne } from "./useShortUrlResolver-DuDol0Oq.js";
8
+ import { t as re } from "./_plugin-vue_export-helper-B3ysoDQm.js";
8
9
  //#region ../../packages/utils/src/citations.ts
9
- var te = /[ \t]*\uE200[^\uE201]*\uE201/g, ne = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, re = /[\uE200-\uE20F]/g;
10
- function ie(e) {
11
- return e && e.replace(te, "").replace(ne, "").replace(re, "");
10
+ var ie = /[ \t]*\uE200[^\uE201]*\uE201/g, ae = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, oe = /[\uE200-\uE20F]/g;
11
+ function se(e) {
12
+ return e && e.replace(ie, "").replace(ae, "").replace(oe, "");
13
+ }
14
+ //#endregion
15
+ //#region ../../packages/utils/src/message.ts
16
+ function h(e) {
17
+ return e ? e.type === "text" : !1;
18
+ }
19
+ function g(e) {
20
+ return e ? e.type.startsWith("tool-") : !1;
21
+ }
22
+ function ce(e) {
23
+ return g(e) ? e.type.slice(5) : "";
24
+ }
25
+ function le(e) {
26
+ return e ? e.type === "file" : !1;
27
+ }
28
+ function _(e) {
29
+ if (!le(e)) return;
30
+ let t = e.providerMetadata?.["8bot"]?.media;
31
+ return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
32
+ }
33
+ function v(e) {
34
+ return e ? e.type === "reasoning" : !1;
35
+ }
36
+ function ue(e) {
37
+ if (!e) return;
38
+ let t = e.parts;
39
+ if (Array.isArray(t)) return t.find((e) => h(e))?.text;
40
+ }
41
+ //#endregion
42
+ //#region ../../packages/components/src/chat/utils.ts
43
+ function de(e) {
44
+ let t = [];
45
+ for (let n of e) {
46
+ if (!h(n)) {
47
+ t.push(n);
48
+ continue;
49
+ }
50
+ let e = t[t.length - 1];
51
+ e && h(e) ? t[t.length - 1] = {
52
+ ...e,
53
+ text: e.text + n.text
54
+ } : t.push(n);
55
+ }
56
+ return t;
57
+ }
58
+ function fe(e) {
59
+ return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
60
+ }
61
+ var pe = 4e3, me = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
62
+ function he(e, t) {
63
+ if (e.length <= t) return e;
64
+ let n = e.length - t, r = n + t / 2, i = (e, t) => e !== -1 && e < r ? e + t : void 0, a = i(e.indexOf("\n\n", n), 2) ?? i(e.indexOf("\n", n), 1) ?? n, o;
65
+ for (let t of e.matchAll(me)) {
66
+ if (t.index >= a) break;
67
+ let [, e, n] = t;
68
+ if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
69
+ else {
70
+ if (e[0] === "`" && n.includes("`")) continue;
71
+ o = e;
72
+ }
73
+ }
74
+ return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
75
+ }
76
+ var y = /* @__PURE__ */ new Set([
77
+ "approval-requested",
78
+ "approval-responded",
79
+ "output-denied"
80
+ ]);
81
+ function ge(e) {
82
+ return g(e) ? y.has(e.state) ? !0 : e.approval != null : !1;
83
+ }
84
+ var _e = "requestConfirm";
85
+ function ve(e) {
86
+ return g(e) && e.type === "tool-requestConfirm";
87
+ }
88
+ function ye(e) {
89
+ return ge(e) || ve(e);
90
+ }
91
+ function b(e) {
92
+ if (g(e)) return e.approval?.id;
93
+ }
94
+ function be(e) {
95
+ if (e && "state" in e) return e.state;
96
+ }
97
+ function xe(e = "000000") {
98
+ let t = e.replace("#", "");
99
+ t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
100
+ let n = parseInt(t.substring(0, 2), 16) / 255, r = parseInt(t.substring(2, 4), 16) / 255, i = parseInt(t.substring(4, 6), 16) / 255, a = (e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
101
+ return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
102
+ }
103
+ function Se(e, t) {
104
+ return e === "white" || e === "black" ? e : xe(t);
105
+ }
106
+ function Ce(e, t) {
107
+ if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
108
+ }
109
+ function x(e) {
110
+ if (e !== void 0) {
111
+ if (typeof e == "string") return e.trim() || void 0;
112
+ try {
113
+ let t = JSON.stringify(e, null, 2);
114
+ return t === "{}" || t === "[]" ? void 0 : t;
115
+ } catch {
116
+ return;
117
+ }
118
+ }
119
+ }
120
+ function S(e) {
121
+ return x(e) !== void 0;
122
+ }
123
+ function we(e, t) {
124
+ let n = e?.input;
125
+ if (typeof t == "string") {
126
+ let e = n?.question ?? n?.steps?.[0]?.question;
127
+ return e ? `${e} ${t}` : t;
128
+ }
129
+ let r = new Map((n?.steps ?? []).map((e) => [e.id, e.question]));
130
+ return t.answers.filter(({ value: e }) => e !== null && e !== "" && !(Array.isArray(e) && !e.length)).map(({ id: e, value: t }) => {
131
+ let n = Array.isArray(t) ? t.join(", ") : String(t), i = r.get(e);
132
+ return i ? `${i} ${n}` : n;
133
+ }).join(". ");
134
+ }
135
+ function Te(e) {
136
+ return e?.options ? e.options.map((e) => ({
137
+ label: e.label,
138
+ value: e.label,
139
+ description: e.description
140
+ })) : [];
141
+ }
142
+ function Ee(e, t) {
143
+ let n = {};
144
+ if (t == null) return n;
145
+ if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
146
+ let r = (t, r) => {
147
+ e.forEach((e, i) => {
148
+ e.id === t && (n[i] = r);
149
+ });
150
+ }, i = t.answers;
151
+ if (Array.isArray(i)) {
152
+ for (let e of i) typeof e?.id == "string" && r(e.id, e.value);
153
+ return n;
154
+ }
155
+ for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
156
+ return n;
157
+ }
158
+ var C = [
159
+ "tool-perplexity_search",
160
+ "tool-parallel_search",
161
+ "tool-web_search",
162
+ "tool-google_search"
163
+ ], De = /* @__PURE__ */ new Set([
164
+ "tool-searchInKnowledgeBase",
165
+ "tool-retrieveRevisedAnswers",
166
+ "tool-expandChunkContext",
167
+ "tool-readDocumentFile",
168
+ "tool-getWeather",
169
+ "tool-geocode",
170
+ "tool-recallUserMemory",
171
+ "tool-saveUserMemory",
172
+ ...C
173
+ ]);
174
+ function Oe(e) {
175
+ return g(e) && De.has(e.type);
176
+ }
177
+ var ke = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, w = (e, ...t) => {
178
+ for (let n of t) {
179
+ let t = e?.[n];
180
+ if (typeof t == "string" && t.trim()) return t;
181
+ }
182
+ };
183
+ function Ae(e) {
184
+ if (!g(e)) return;
185
+ let t = ke("input" in e ? e.input : void 0), n = ke("output" in e ? e.output : void 0);
186
+ if (e.type === "tool-searchInKnowledgeBase" || C.includes(e.type)) {
187
+ let e = t?.queries;
188
+ if (Array.isArray(e)) {
189
+ let t = e.filter((e) => typeof e == "string" && !!e.trim());
190
+ return t.length ? t.join(" · ") : void 0;
191
+ }
192
+ return w(t, "query", "objective");
193
+ }
194
+ if (e.type === "tool-retrieveRevisedAnswers") return w(t, "query");
195
+ if (e.type === "tool-getWeather") return w(n, "location") ?? w(t, "locationName");
196
+ if (e.type === "tool-geocode") return w(t, "locationName");
197
+ if (e.type === "tool-expandChunkContext") return w(n, "documentName");
198
+ if (e.type === "tool-readDocumentFile") return w(n, "name");
199
+ if (e.type === "tool-recallUserMemory") return w(t, "query");
200
+ if (e.type === "tool-saveUserMemory") return w(t, "content", "query");
201
+ }
202
+ function je(e) {
203
+ if (g(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-perplexity_search" || e.type === "tool-parallel_search" || e.type === "tool-web_search" || e.type === "tool-google_search" ? "ri:global-line" : "ri:tools-line";
204
+ if (v(e)) return "ri:lightbulb-line";
205
+ if (h(e)) return "ri:double-quotes-r";
206
+ }
207
+ function Me(e, t) {
208
+ return g(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : C.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : v(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
12
209
  }
13
210
  //#endregion
14
211
  //#region ../../node_modules/.pnpm/remend@1.3.1/node_modules/remend/dist/index.js
15
- var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwnPropertyDescriptors, h = Object.getOwnPropertySymbols, g = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable, v = (e, t, n) => t in e ? ae(e, t, {
212
+ var Ne = Object.defineProperty, Pe = Object.defineProperties, Fe = Object.getOwnPropertyDescriptors, Ie = Object.getOwnPropertySymbols, Le = Object.prototype.hasOwnProperty, Re = Object.prototype.propertyIsEnumerable, ze = (e, t, n) => t in e ? Ne(e, t, {
16
213
  enumerable: !0,
17
214
  configurable: !0,
18
215
  writable: !0,
19
216
  value: n
20
- }) : e[t] = n, ce = (e, t) => {
21
- for (var n in t ||= {}) g.call(t, n) && v(e, n, t[n]);
22
- if (h) for (var n of h(t)) _.call(t, n) && v(e, n, t[n]);
217
+ }) : e[t] = n, Be = (e, t) => {
218
+ for (var n in t ||= {}) Le.call(t, n) && ze(e, n, t[n]);
219
+ if (Ie) for (var n of Ie(t)) Re.call(t, n) && ze(e, n, t[n]);
23
220
  return e;
24
- }, le = (e, t) => oe(e, se(t)), ue = (e) => {
221
+ }, Ve = (e, t) => Pe(e, Fe(t)), He = (e) => {
25
222
  let t = new Uint8Array(e.length + 1), n = !1, r = !1, i = 0;
26
223
  for (; i < e.length;) {
27
224
  if (e[i] === "\\" && i + 1 < e.length && e[i + 1] === "`") {
@@ -39,26 +236,26 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
39
236
  !r && e[i] === "`" && (n = !n), t[i + 1] = n || r ? 1 : 0, i += 1;
40
237
  }
41
238
  return t;
42
- }, de = null, y = (e, t) => {
43
- let n = de;
239
+ }, Ue = null, T = (e, t) => {
240
+ let n = Ue;
44
241
  return (n === null || n.text !== e) && (n = {
45
242
  text: e,
46
- lookup: ue(e)
47
- }, de = n), n.lookup[Math.min(t, e.length)] === 1;
48
- }, b = (e, t) => {
243
+ lookup: He(e)
244
+ }, Ue = n), n.lookup[Math.min(t, e.length)] === 1;
245
+ }, We = (e, t) => {
49
246
  let n = e.substring(t, t + 3) === "```", r = t > 0 && e.substring(t - 1, t + 2) === "```", i = t > 1 && e.substring(t - 2, t + 1) === "```";
50
247
  return n || r || i;
51
- }, fe = (e) => {
248
+ }, Ge = (e) => {
52
249
  let t = 0;
53
250
  for (let n = 0; n < e.length; n += 1) {
54
251
  if (e[n] === "\\" && n + 1 < e.length && e[n + 1] === "`") {
55
252
  n += 1;
56
253
  continue;
57
254
  }
58
- e[n] === "`" && !b(e, n) && (t += 1);
255
+ e[n] === "`" && !We(e, n) && (t += 1);
59
256
  }
60
257
  return t;
61
- }, x = (e, t) => {
258
+ }, E = (e, t) => {
62
259
  let n = !1, r = !1, i = -1;
63
260
  for (let a = 0; a < e.length; a += 1) {
64
261
  if (e[a] === "\\" && a + 1 < e.length && e[a + 1] === "`") {
@@ -77,21 +274,21 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
77
274
  }
78
275
  }
79
276
  return !1;
80
- }, S = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, pe = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(S, (t, n, r, i) => y(e, i) ? t : `${n}\\>${r}`), me = /(\*\*)([^*]*\*?)$/, he = /(__)([^_]*?)$/, ge = /(\*\*\*)([^*]*?)$/, _e = /(\*)([^*]*?)$/, C = /(_)([^_]*?)$/, ve = /(`)([^`]*?)$/, ye = /(~~)([^~]*?)$/, w = /^[\s_~*`]*$/, be = /^[\s]*[-*+][\s]+$/, xe = /[\p{L}\p{N}_]/u, Se = /^```[^`\n]*```?$/, Ce = /^\*{4,}$/, we = /(__)([^_]+)_$/, Te = /(~~)([^~]+)~$/, Ee = /~~/g, T = (e) => {
277
+ }, Ke = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, qe = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ke, (t, n, r, i) => T(e, i) ? t : `${n}\\>${r}`), Je = /(\*\*)([^*]*\*?)$/, Ye = /(__)([^_]*?)$/, Xe = /(\*\*\*)([^*]*?)$/, Ze = /(\*)([^*]*?)$/, Qe = /(_)([^_]*?)$/, $e = /(`)([^`]*?)$/, et = /(~~)([^~]*?)$/, D = /^[\s_~*`]*$/, tt = /^[\s]*[-*+][\s]+$/, nt = /[\p{L}\p{N}_]/u, rt = /^```[^`\n]*```?$/, it = /^\*{4,}$/, at = /(__)([^_]+)_$/, ot = /(~~)([^~]+)~$/, st = /~~/g, O = (e) => {
81
278
  if (!e) return !1;
82
279
  let t = e.charCodeAt(0);
83
- return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || xe.test(e);
84
- }, De = (e, t) => {
280
+ return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || nt.test(e);
281
+ }, ct = (e, t) => {
85
282
  let n = 1;
86
283
  for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
87
284
  else if (e[r] === "[" && (--n, n === 0)) return r;
88
285
  return -1;
89
- }, Oe = (e, t) => {
286
+ }, lt = (e, t) => {
90
287
  let n = 1;
91
288
  for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
92
289
  else if (e[r] === "]" && (--n, n === 0)) return r;
93
290
  return -1;
94
- }, ke = (e) => e === "inlineLatex" || e === "blockLatex", Ae = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, je = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", E = (e, t) => {
291
+ }, ut = (e) => e === "inlineLatex" || e === "blockLatex", dt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, ft = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", k = (e, t) => {
95
292
  let n = "none";
96
293
  for (let r = 0; r < e.length && r < t; r += 1) {
97
294
  if (e[r] === "\\" && e[r + 1] === "$") {
@@ -99,32 +296,32 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
99
296
  continue;
100
297
  }
101
298
  if (e[r] === "\\") {
102
- let t = Ae(n, e[r + 1]);
299
+ let t = dt(n, e[r + 1]);
103
300
  if (t !== null) {
104
301
  n = t, r += 1;
105
302
  continue;
106
303
  }
107
304
  }
108
- if (e[r] === "$" && !ke(n)) {
305
+ if (e[r] === "$" && !ut(n)) {
109
306
  let t = e[r + 1] === "$";
110
- n = je(n, t), t && (r += 1);
307
+ n = ft(n, t), t && (r += 1);
111
308
  }
112
309
  }
113
310
  return n !== "none";
114
- }, Me = (e, t) => {
311
+ }, pt = (e, t) => {
115
312
  for (let n = t; n < e.length; n += 1) {
116
313
  if (e[n] === ")") return !0;
117
314
  if (e[n] === "\n") return !1;
118
315
  }
119
316
  return !1;
120
- }, Ne = (e, t) => {
317
+ }, mt = (e, t) => {
121
318
  for (let n = t - 1; n >= 0; --n) {
122
319
  if (e[n] === ")") return !1;
123
- if (e[n] === "(") return n > 0 && e[n - 1] === "]" && Me(e, t);
320
+ if (e[n] === "(") return n > 0 && e[n - 1] === "]" && pt(e, t);
124
321
  if (e[n] === "\n") return !1;
125
322
  }
126
323
  return !1;
127
- }, Pe = (e, t) => {
324
+ }, ht = (e, t) => {
128
325
  for (let n = t - 1; n >= 0; --n) {
129
326
  if (e[n] === ">") return !1;
130
327
  if (e[n] === "<") {
@@ -134,7 +331,7 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
134
331
  if (e[n] === "\n") return !1;
135
332
  }
136
333
  return !1;
137
- }, D = (e, t, n) => {
334
+ }, gt = (e, t, n) => {
138
335
  let r = 0;
139
336
  for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
140
337
  r = n + 1;
@@ -152,13 +349,13 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
152
349
  break;
153
350
  }
154
351
  return o >= 3 && !s;
155
- }, Fe = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ie = (e, t, n, r) => n === "\\" || Fe(e) && E(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), O = (e) => e === " " || e === " " || e === "\n", Le = (e, t) => !!(e && t && T(e) && T(t)), Re = (e, t, n, r) => {
156
- let i = Le(e, t), a = !!t && !O(t), o = !!e && !O(e);
352
+ }, _t = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), vt = (e, t, n, r) => n === "\\" || _t(e) && k(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), A = (e) => e === " " || e === " " || e === "\n", yt = (e, t) => !!(e && t && O(e) && O(t)), bt = (e, t, n, r) => {
353
+ let i = yt(e, t), a = !!t && !A(t), o = !!e && !A(e);
157
354
  return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
158
355
  count: !0,
159
356
  inWordAsteriskChain: i
160
357
  } : { count: !1 };
161
- }, ze = (e) => {
358
+ }, xt = (e) => {
162
359
  let t = 0, n = !1, r = !1, i = e.length;
163
360
  for (let a = 0; a < i; a += 1) {
164
361
  if (e[a] === "`" && a + 2 < i && e[a + 1] === "`" && e[a + 2] === "`") {
@@ -167,16 +364,16 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
167
364
  }
168
365
  if (n) continue;
169
366
  if (e[a] !== "*") {
170
- T(e[a]) || (r = !1);
367
+ O(e[a]) || (r = !1);
171
368
  continue;
172
369
  }
173
370
  let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
174
- if (Ie(e, a, o, s)) continue;
175
- let c = Re(o, s, t, r);
371
+ if (vt(e, a, o, s)) continue;
372
+ let c = bt(o, s, t, r);
176
373
  c.count && (t += 1, r = c.inWordAsteriskChain);
177
374
  }
178
375
  return t;
179
- }, Be = (e, t, n, r) => !!(n === "\\" || Fe(e) && E(e, t) || Ne(e, t) || Pe(e, t) || n === "_" || r === "_" || n && r && T(n) && T(r)), Ve = (e) => {
376
+ }, St = (e, t, n, r) => !!(n === "\\" || _t(e) && k(e, t) || mt(e, t) || ht(e, t) || n === "_" || r === "_" || n && r && O(n) && O(r)), Ct = (e) => {
180
377
  let t = 0, n = !1, r = e.length;
181
378
  for (let i = 0; i < r; i += 1) {
182
379
  if (e[i] === "`" && i + 2 < r && e[i + 1] === "`" && e[i + 2] === "`") {
@@ -185,10 +382,10 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
185
382
  }
186
383
  if (n || e[i] !== "_") continue;
187
384
  let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
188
- Be(e, i, a, o) || (t += 1);
385
+ St(e, i, a, o) || (t += 1);
189
386
  }
190
387
  return t;
191
- }, He = (e) => {
388
+ }, wt = (e) => {
192
389
  let t = 0, n = 0, r = !1;
193
390
  for (let i = 0; i < e.length; i += 1) {
194
391
  if (e[i] === "`" && i + 2 < e.length && e[i + 1] === "`" && e[i + 2] === "`") {
@@ -198,7 +395,7 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
198
395
  r || (e[i] === "*" ? n += 1 : (n >= 3 && (t += Math.floor(n / 3)), n = 0));
199
396
  }
200
397
  return n >= 3 && (t += Math.floor(n / 3)), t;
201
- }, Ue = (e) => {
398
+ }, Tt = (e) => {
202
399
  let t = 0, n = !1;
203
400
  for (let r = 0; r < e.length; r += 1) {
204
401
  if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
@@ -208,7 +405,7 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
208
405
  n || e[r] === "*" && r + 1 < e.length && e[r + 1] === "*" && (t += 1, r += 1);
209
406
  }
210
407
  return t;
211
- }, We = (e) => {
408
+ }, Et = (e) => {
212
409
  let t = 0, n = !1;
213
410
  for (let r = 0; r < e.length; r += 1) {
214
411
  if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
@@ -218,143 +415,143 @@ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwn
218
415
  n || e[r] === "_" && r + 1 < e.length && e[r + 1] === "_" && (t += 1, r += 1);
219
416
  }
220
417
  return t;
221
- }, Ge = (e, t, n) => {
222
- if (!t || w.test(t)) return !0;
418
+ }, Dt = (e, t, n) => {
419
+ if (!t || D.test(t)) return !0;
223
420
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
224
- return be.test(a) && t.includes("\n") ? !0 : D(e, n, "*");
225
- }, Ke = (e) => {
226
- let t = e.match(me);
421
+ return tt.test(a) && t.includes("\n") ? !0 : gt(e, n, "*");
422
+ }, Ot = (e) => {
423
+ let t = e.match(Je);
227
424
  if (!t) return e;
228
425
  let n = t[2], r = e.lastIndexOf(t[1]);
229
- return y(e, r) || x(e, r) || Ge(e, n, r) ? e : Ue(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
230
- }, qe = (e, t, n) => {
231
- if (!t || w.test(t)) return !0;
426
+ return T(e, r) || E(e, r) || Dt(e, n, r) ? e : Tt(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
427
+ }, kt = (e, t, n) => {
428
+ if (!t || D.test(t)) return !0;
232
429
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
233
- return be.test(a) && t.includes("\n") ? !0 : D(e, n, "_");
234
- }, Je = (e) => {
235
- let t = e.match(he);
430
+ return tt.test(a) && t.includes("\n") ? !0 : gt(e, n, "_");
431
+ }, At = (e) => {
432
+ let t = e.match(Ye);
236
433
  if (!t) {
237
- let t = e.match(we);
434
+ let t = e.match(at);
238
435
  if (t) {
239
436
  let n = e.lastIndexOf(t[1]);
240
- if (!(y(e, n) || x(e, n)) && We(e) % 2 == 1) return `${e}_`;
437
+ if (!(T(e, n) || E(e, n)) && Et(e) % 2 == 1) return `${e}_`;
241
438
  }
242
439
  return e;
243
440
  }
244
441
  let n = t[2], r = e.lastIndexOf(t[1]);
245
- return y(e, r) || x(e, r) || qe(e, n, r) ? e : We(e) % 2 == 1 ? `${e}__` : e;
246
- }, Ye = (e) => {
442
+ return T(e, r) || E(e, r) || kt(e, n, r) ? e : Et(e) % 2 == 1 ? `${e}__` : e;
443
+ }, jt = (e) => {
247
444
  let t = !1;
248
445
  for (let n = 0; n < e.length; n += 1) {
249
446
  if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
250
447
  t = !t, n += 2;
251
448
  continue;
252
449
  }
253
- if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !E(e, n)) {
254
- let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t || O(t), a = !r || O(r);
255
- if (i && a || t && r && T(t) && T(r) || a) continue;
450
+ if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !k(e, n)) {
451
+ let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t || A(t), a = !r || A(r);
452
+ if (i && a || t && r && O(t) && O(r) || a) continue;
256
453
  return n;
257
454
  }
258
455
  }
259
456
  return -1;
260
- }, Xe = (e) => {
261
- if (!e.match(_e)) return e;
262
- let t = Ye(e);
263
- if (t === -1 || y(e, t) || x(e, t)) return e;
457
+ }, Mt = (e) => {
458
+ if (!e.match(Ze)) return e;
459
+ let t = jt(e);
460
+ if (t === -1 || T(e, t) || E(e, t)) return e;
264
461
  let n = e.substring(t + 1);
265
- return !n || w.test(n) ? e : ze(e) % 2 == 1 ? `${e}*` : e;
266
- }, Ze = (e) => {
462
+ return !n || D.test(n) ? e : xt(e) % 2 == 1 ? `${e}*` : e;
463
+ }, Nt = (e) => {
267
464
  let t = !1;
268
465
  for (let n = 0; n < e.length; n += 1) {
269
466
  if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
270
467
  t = !t, n += 2;
271
468
  continue;
272
469
  }
273
- if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !E(e, n) && !Ne(e, n)) {
470
+ if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !k(e, n) && !mt(e, n)) {
274
471
  let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
275
- if (t && r && T(t) && T(r)) continue;
472
+ if (t && r && O(t) && O(r)) continue;
276
473
  return n;
277
474
  }
278
475
  }
279
476
  return -1;
280
- }, Qe = (e) => {
477
+ }, Pt = (e) => {
281
478
  let t = e.length;
282
479
  for (; t > 0 && e[t - 1] === "\n";) --t;
283
480
  return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
284
- }, $e = (e) => {
481
+ }, Ft = (e) => {
285
482
  if (!e.endsWith("**")) return null;
286
483
  let t = e.slice(0, -2);
287
- if (Ue(t) % 2 != 1) return null;
288
- let n = t.indexOf("**"), r = Ze(t);
484
+ if (Tt(t) % 2 != 1) return null;
485
+ let n = t.indexOf("**"), r = Nt(t);
289
486
  return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
290
- }, et = (e) => {
291
- if (!e.match(C)) return e;
292
- let t = Ze(e);
487
+ }, It = (e) => {
488
+ if (!e.match(Qe)) return e;
489
+ let t = Nt(e);
293
490
  if (t === -1) return e;
294
491
  let n = e.substring(t + 1);
295
- if (!n || w.test(n) || y(e, t) || x(e, t)) return e;
296
- if (Ve(e) % 2 == 1) {
297
- let t = $e(e);
298
- return t === null ? Qe(e) : t;
492
+ if (!n || D.test(n) || T(e, t) || E(e, t)) return e;
493
+ if (Ct(e) % 2 == 1) {
494
+ let t = Ft(e);
495
+ return t === null ? Pt(e) : t;
299
496
  }
300
497
  return e;
301
- }, tt = (e) => {
302
- let t = Ue(e), n = ze(e);
498
+ }, Lt = (e) => {
499
+ let t = Tt(e), n = xt(e);
303
500
  return t % 2 == 0 && n % 2 == 0;
304
- }, nt = (e, t, n) => !t || w.test(t) || y(e, n) || x(e, n) ? !0 : D(e, n, "*"), rt = (e) => {
305
- if (Ce.test(e)) return e;
306
- let t = e.match(ge);
501
+ }, Rt = (e, t, n) => !t || D.test(t) || T(e, n) || E(e, n) ? !0 : gt(e, n, "*"), zt = (e) => {
502
+ if (it.test(e)) return e;
503
+ let t = e.match(Xe);
307
504
  if (!t) return e;
308
505
  let n = t[2];
309
- return nt(e, n, e.lastIndexOf(t[1])) ? e : He(e) % 2 == 1 ? tt(e) ? e : `${e}***` : e;
310
- }, it = /<[a-zA-Z/][^>]*$/, at = (e) => {
311
- let t = e.match(it);
312
- return !t || t.index === void 0 || y(e, t.index) ? e : e.substring(0, t.index).trimEnd();
313
- }, ot = (e) => !e.match(Se) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, st = (e) => (e.match(/```/g) || []).length % 2 == 1, ct = (e) => {
314
- let t = ot(e);
506
+ return Rt(e, n, e.lastIndexOf(t[1])) ? e : wt(e) % 2 == 1 ? Lt(e) ? e : `${e}***` : e;
507
+ }, Bt = /<[a-zA-Z/][^>]*$/, Vt = (e) => {
508
+ let t = e.match(Bt);
509
+ return !t || t.index === void 0 || T(e, t.index) ? e : e.substring(0, t.index).trimEnd();
510
+ }, Ht = (e) => !e.match(rt) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, Ut = (e) => (e.match(/```/g) || []).length % 2 == 1, Wt = (e) => {
511
+ let t = Ht(e);
315
512
  if (t !== null) return t;
316
- let n = e.match(ve);
317
- if (n && !st(e)) {
513
+ let n = e.match($e);
514
+ if (n && !Ut(e)) {
318
515
  let t = n[2];
319
- if (!t || w.test(t)) return e;
320
- if (fe(e) % 2 == 1) return `${e}\``;
516
+ if (!t || D.test(t)) return e;
517
+ if (Ge(e) % 2 == 1) return `${e}\``;
321
518
  }
322
519
  return e;
323
- }, lt = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", ut = (e) => {
520
+ }, Gt = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", Kt = (e) => {
324
521
  let t = 0, n = !1;
325
- for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !lt(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
522
+ for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !Gt(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
326
523
  return t;
327
- }, dt = (e) => {
524
+ }, qt = (e) => {
328
525
  let t = 0, n = !1;
329
526
  for (let r = 0; r < e.length; r += 1) {
330
527
  if (e[r] === "\\") {
331
528
  r += 1;
332
529
  continue;
333
530
  }
334
- if (e[r] === "`" && !lt(e, r)) {
531
+ if (e[r] === "`" && !Gt(e, r)) {
335
532
  n = !n;
336
533
  continue;
337
534
  }
338
535
  !n && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : t += 1);
339
536
  }
340
537
  return t;
341
- }, ft = (e) => {
538
+ }, Jt = (e) => {
342
539
  if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
343
540
  let t = e.indexOf("$$");
344
541
  return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
345
542
  $$` : `${e}$$`;
346
- }, pt = (e) => ut(e) % 2 == 0 ? e : ft(e), mt = (e) => dt(e) % 2 == 1 ? `${e}$` : e, ht = (e, t, n) => {
543
+ }, Yt = (e) => Kt(e) % 2 == 0 ? e : Jt(e), Xt = (e) => qt(e) % 2 == 1 ? `${e}$` : e, Zt = (e, t, n) => {
347
544
  if (e.substring(t + 2).includes(")")) return null;
348
- let r = De(e, t);
349
- if (r === -1 || y(e, r)) return null;
545
+ let r = ct(e, t);
546
+ if (r === -1 || T(e, r)) return null;
350
547
  let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a);
351
548
  if (i) return o;
352
549
  let s = e.substring(r + 1, t);
353
550
  return n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
354
- }, gt = (e, t) => {
355
- for (let n = 0; n < t; n++) if (e[n] === "[" && !y(e, n)) {
551
+ }, Qt = (e, t) => {
552
+ for (let n = 0; n < t; n++) if (e[n] === "[" && !T(e, n)) {
356
553
  if (n > 0 && e[n - 1] === "!") continue;
357
- let t = Oe(e, n);
554
+ let t = lt(e, n);
358
555
  if (t === -1) return n;
359
556
  if (t + 1 < e.length && e[t + 1] === "(") {
360
557
  let r = e.indexOf(")", t + 2);
@@ -362,70 +559,70 @@ $$` : `${e}$$`;
362
559
  }
363
560
  }
364
561
  return t;
365
- }, _t = (e, t, n) => {
562
+ }, $t = (e, t, n) => {
366
563
  let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
367
564
  if (!e.substring(t + 1).includes("]")) {
368
565
  let a = e.substring(0, i);
369
566
  if (r) return a;
370
567
  if (n === "text-only") {
371
- let n = gt(e, t);
568
+ let n = Qt(e, t);
372
569
  return e.substring(0, n) + e.substring(n + 1);
373
570
  }
374
571
  return `${e}](streamdown:incomplete-link)`;
375
572
  }
376
- if (Oe(e, t) === -1) {
573
+ if (lt(e, t) === -1) {
377
574
  let a = e.substring(0, i);
378
575
  if (r) return a;
379
576
  if (n === "text-only") {
380
- let n = gt(e, t);
577
+ let n = Qt(e, t);
381
578
  return e.substring(0, n) + e.substring(n + 1);
382
579
  }
383
580
  return `${e}](streamdown:incomplete-link)`;
384
581
  }
385
582
  return null;
386
- }, vt = (e, t = "protocol") => {
583
+ }, en = (e, t = "protocol") => {
387
584
  let n = e.lastIndexOf("](");
388
- if (n !== -1 && !y(e, n)) {
389
- let r = ht(e, n, t);
585
+ if (n !== -1 && !T(e, n)) {
586
+ let r = Zt(e, n, t);
390
587
  if (r !== null) return r;
391
588
  }
392
- for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !y(e, n)) {
393
- let r = _t(e, n, t);
589
+ for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !T(e, n)) {
590
+ let r = $t(e, n, t);
394
591
  if (r !== null) return r;
395
592
  }
396
593
  return e;
397
- }, yt = /^-{1,2}$/, bt = /^[\s]*-{1,2}[\s]+$/, xt = /^={1,2}$/, St = /^[\s]*={1,2}[\s]+$/, Ct = (e) => {
594
+ }, tn = /^-{1,2}$/, nn = /^[\s]*-{1,2}[\s]+$/, rn = /^={1,2}$/, an = /^[\s]*={1,2}[\s]+$/, on = (e) => {
398
595
  if (!e || typeof e != "string") return e;
399
596
  let t = e.lastIndexOf("\n");
400
597
  if (t === -1) return e;
401
598
  let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
402
- if (yt.test(i) && !n.match(bt)) {
599
+ if (tn.test(i) && !n.match(nn)) {
403
600
  let t = r.split("\n").at(-1);
404
601
  if (t && t.trim().length > 0) return `${e}\u200B`;
405
602
  }
406
- if (xt.test(i) && !n.match(St)) {
603
+ if (rn.test(i) && !n.match(an)) {
407
604
  let t = r.split("\n").at(-1);
408
605
  if (t && t.trim().length > 0) return `${e}\u200B`;
409
606
  }
410
607
  return e;
411
- }, wt = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, Tt = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(wt, (t, n, r) => y(e, r + n.length) ? t : `${n}\\~`), Et = (e) => {
412
- let t = e.match(ye);
608
+ }, sn = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, cn = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(sn, (t, n, r) => T(e, r + n.length) ? t : `${n}\\~`), ln = (e) => {
609
+ let t = e.match(et);
413
610
  if (t) {
414
611
  let n = t[2];
415
- if (!n || w.test(n)) return e;
612
+ if (!n || D.test(n)) return e;
416
613
  let r = e.lastIndexOf(t[1]);
417
- if (y(e, r) || x(e, r)) return e;
418
- if (e.match(Ee)?.length % 2 == 1) return `${e}~~`;
614
+ if (T(e, r) || E(e, r)) return e;
615
+ if (e.match(st)?.length % 2 == 1) return `${e}~~`;
419
616
  } else {
420
- let t = e.match(Te);
617
+ let t = e.match(ot);
421
618
  if (t) {
422
619
  let n = e.lastIndexOf(t[0].slice(0, 2));
423
- if (y(e, n) || x(e, n)) return e;
424
- if (e.match(Ee)?.length % 2 == 1) return `${e}~`;
620
+ if (T(e, n) || E(e, n)) return e;
621
+ if (e.match(st)?.length % 2 == 1) return `${e}~`;
425
622
  }
426
623
  }
427
624
  return e;
428
- }, Dt = (e) => e !== !1, Ot = (e) => e === !0, k = {
625
+ }, un = (e) => e !== !1, dn = (e) => e === !0, j = {
429
626
  SINGLE_TILDE: 0,
430
627
  COMPARISON_OPERATORS: 5,
431
628
  HTML_TAGS: 10,
@@ -441,44 +638,44 @@ $$` : `${e}$$`;
441
638
  KATEX: 70,
442
639
  INLINE_KATEX: 75,
443
640
  DEFAULT: 100
444
- }, kt = [
641
+ }, fn = [
445
642
  {
446
643
  handler: {
447
644
  name: "singleTilde",
448
- handle: Tt,
449
- priority: k.SINGLE_TILDE
645
+ handle: cn,
646
+ priority: j.SINGLE_TILDE
450
647
  },
451
648
  optionKey: "singleTilde"
452
649
  },
453
650
  {
454
651
  handler: {
455
652
  name: "comparisonOperators",
456
- handle: pe,
457
- priority: k.COMPARISON_OPERATORS
653
+ handle: qe,
654
+ priority: j.COMPARISON_OPERATORS
458
655
  },
459
656
  optionKey: "comparisonOperators"
460
657
  },
461
658
  {
462
659
  handler: {
463
660
  name: "htmlTags",
464
- handle: at,
465
- priority: k.HTML_TAGS
661
+ handle: Vt,
662
+ priority: j.HTML_TAGS
466
663
  },
467
664
  optionKey: "htmlTags"
468
665
  },
469
666
  {
470
667
  handler: {
471
668
  name: "setextHeadings",
472
- handle: Ct,
473
- priority: k.SETEXT_HEADINGS
669
+ handle: on,
670
+ priority: j.SETEXT_HEADINGS
474
671
  },
475
672
  optionKey: "setextHeadings"
476
673
  },
477
674
  {
478
675
  handler: {
479
676
  name: "links",
480
- handle: vt,
481
- priority: k.LINKS
677
+ handle: en,
678
+ priority: j.LINKS
482
679
  },
483
680
  optionKey: "links",
484
681
  earlyReturn: (e) => e.endsWith("](streamdown:incomplete-link)")
@@ -486,96 +683,96 @@ $$` : `${e}$$`;
486
683
  {
487
684
  handler: {
488
685
  name: "boldItalic",
489
- handle: rt,
490
- priority: k.BOLD_ITALIC
686
+ handle: zt,
687
+ priority: j.BOLD_ITALIC
491
688
  },
492
689
  optionKey: "boldItalic"
493
690
  },
494
691
  {
495
692
  handler: {
496
693
  name: "bold",
497
- handle: Ke,
498
- priority: k.BOLD
694
+ handle: Ot,
695
+ priority: j.BOLD
499
696
  },
500
697
  optionKey: "bold"
501
698
  },
502
699
  {
503
700
  handler: {
504
701
  name: "italicDoubleUnderscore",
505
- handle: Je,
506
- priority: k.ITALIC_DOUBLE_UNDERSCORE
702
+ handle: At,
703
+ priority: j.ITALIC_DOUBLE_UNDERSCORE
507
704
  },
508
705
  optionKey: "italic"
509
706
  },
510
707
  {
511
708
  handler: {
512
709
  name: "italicSingleAsterisk",
513
- handle: Xe,
514
- priority: k.ITALIC_SINGLE_ASTERISK
710
+ handle: Mt,
711
+ priority: j.ITALIC_SINGLE_ASTERISK
515
712
  },
516
713
  optionKey: "italic"
517
714
  },
518
715
  {
519
716
  handler: {
520
717
  name: "italicSingleUnderscore",
521
- handle: et,
522
- priority: k.ITALIC_SINGLE_UNDERSCORE
718
+ handle: It,
719
+ priority: j.ITALIC_SINGLE_UNDERSCORE
523
720
  },
524
721
  optionKey: "italic"
525
722
  },
526
723
  {
527
724
  handler: {
528
725
  name: "inlineCode",
529
- handle: ct,
530
- priority: k.INLINE_CODE
726
+ handle: Wt,
727
+ priority: j.INLINE_CODE
531
728
  },
532
729
  optionKey: "inlineCode"
533
730
  },
534
731
  {
535
732
  handler: {
536
733
  name: "strikethrough",
537
- handle: Et,
538
- priority: k.STRIKETHROUGH
734
+ handle: ln,
735
+ priority: j.STRIKETHROUGH
539
736
  },
540
737
  optionKey: "strikethrough"
541
738
  },
542
739
  {
543
740
  handler: {
544
741
  name: "katex",
545
- handle: pt,
546
- priority: k.KATEX
742
+ handle: Yt,
743
+ priority: j.KATEX
547
744
  },
548
745
  optionKey: "katex"
549
746
  },
550
747
  {
551
748
  handler: {
552
749
  name: "inlineKatex",
553
- handle: mt,
554
- priority: k.INLINE_KATEX
750
+ handle: Xt,
751
+ priority: j.INLINE_KATEX
555
752
  },
556
753
  optionKey: "inlineKatex"
557
754
  }
558
- ], At = (e) => {
755
+ ], pn = (e) => {
559
756
  let t = e?.linkMode ?? "protocol";
560
- return kt.filter(({ handler: t, optionKey: n }) => t.name === "links" ? Dt(e?.links) || Dt(e?.images) : t.name === "inlineKatex" ? Ot(e?.inlineKatex) : Dt(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
561
- handler: le(ce({}, e), { handle: (e) => vt(e, t) }),
757
+ return fn.filter(({ handler: t, optionKey: n }) => t.name === "links" ? un(e?.links) || un(e?.images) : t.name === "inlineKatex" ? dn(e?.inlineKatex) : un(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
758
+ handler: Ve(Be({}, e), { handle: (e) => en(e, t) }),
562
759
  earlyReturn: t === "protocol" ? n : void 0
563
760
  } : {
564
761
  handler: e,
565
762
  earlyReturn: n
566
763
  });
567
- }, jt = (e, t) => {
764
+ }, mn = (e, t) => {
568
765
  if (!e || typeof e != "string") return e;
569
- let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = At(t), i = (t?.handlers ?? []).map((e) => ({
570
- handler: le(ce({}, e), { priority: e.priority ?? k.DEFAULT }),
766
+ let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = pn(t), i = (t?.handlers ?? []).map((e) => ({
767
+ handler: Ve(Be({}, e), { priority: e.priority ?? j.DEFAULT }),
571
768
  earlyReturn: void 0
572
769
  })), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
573
770
  for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
574
771
  return n;
575
772
  };
576
773
  //#endregion
577
- //#region ../../node_modules/.pnpm/marked@18.0.13/node_modules/marked/lib/marked.esm.js
578
- function Mt() {
774
+ //#region ../../node_modules/.pnpm/marked@18.0.14/node_modules/marked/lib/marked.esm.js
775
+ function hn() {
579
776
  return {
580
777
  async: !1,
581
778
  breaks: !1,
@@ -589,35 +786,35 @@ function Mt() {
589
786
  walkTokens: null
590
787
  };
591
788
  }
592
- var A = Mt();
593
- function Nt(e) {
594
- A = e;
789
+ var M = hn();
790
+ function gn(e) {
791
+ M = e;
595
792
  }
596
- var j = { exec: () => null };
597
- function M(e) {
793
+ var N = { exec: () => null };
794
+ function P(e) {
598
795
  let t = [];
599
796
  return (n) => {
600
797
  let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
601
798
  return i || (i = e(r), t[r] = i), i;
602
799
  };
603
800
  }
604
- function N(e, t = "") {
801
+ function F(e, t = "") {
605
802
  let n = typeof e == "string" ? e : e.source, r = {
606
803
  replace: (e, t) => {
607
804
  let i = typeof t == "string" ? t : t.source;
608
- return i = i.replace(P.caret, "$1"), n = n.replace(e, i), r;
805
+ return i = i.replace(I.caret, "$1"), n = n.replace(e, i), r;
609
806
  },
610
807
  getRegex: () => new RegExp(n, t)
611
808
  };
612
809
  return r;
613
810
  }
614
- var Pt = ((e = "") => {
811
+ var _n = ((e = "") => {
615
812
  try {
616
813
  return !!RegExp("(?<=1)(?<!1)" + e);
617
814
  } catch {
618
815
  return !1;
619
816
  }
620
- })(), P = {
817
+ })(), I = {
621
818
  codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
622
819
  outputLinkReplace: /\\([\[\]])/g,
623
820
  indentCodeCompensation: /^(\s+)(?:```)/,
@@ -629,6 +826,7 @@ var Pt = ((e = "") => {
629
826
  nonSpaceChar: /[^ ]/,
630
827
  newLineCharGlobal: /\n/g,
631
828
  tabCharGlobal: /\t/g,
829
+ leadingSpaceTab: /^[ \t]+/,
632
830
  multipleSpaceGlobal: /\s+/g,
633
831
  blankLine: /^[ \t]*$/,
634
832
  doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
@@ -655,6 +853,7 @@ var Pt = ((e = "") => {
655
853
  endAngleBracket: />$/,
656
854
  pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
657
855
  unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
856
+ numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,
658
857
  escapeTest: /[&<>"']/,
659
858
  escapeReplace: /[&<>"']/g,
660
859
  escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
@@ -669,126 +868,132 @@ var Pt = ((e = "") => {
669
868
  notSpaceStart: /^\S*/,
670
869
  endingNewline: /\n$/,
671
870
  listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
672
- nextBulletRegex: M((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
673
- hrRegex: M((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
674
- fencesBeginRegex: M((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
675
- headingBeginRegex: M((e) => RegExp(`^ {0,${e}}#`)),
676
- htmlBeginRegex: M((e) => RegExp(`^ {0,${e}}(?:</?(?:${I})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
677
- blockquoteBeginRegex: M((e) => RegExp(`^ {0,${e}}>`))
678
- }, Ft = /^(?:[ \t]*(?:\n|$))+/, It = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Lt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, F = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Rt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, zt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Bt = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Vt = N(Bt).replace(/bull/g, zt).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ht = N(Bt).replace(/bull/g, zt).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Ut = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Wt = /^[^\n]+/, Gt = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Kt = N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Gt).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qt = N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, zt).getRegex(), I = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Jt = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Yt = N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Jt).replace("tag", I).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Xt = (e) => N(Ut).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", I).getRegex(), Zt = Xt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Qt = Xt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), $t = {
679
- blockquote: N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Qt).getRegex(),
680
- code: It,
681
- def: Kt,
682
- fences: Lt,
683
- heading: Rt,
684
- hr: F,
685
- html: Yt,
686
- lheading: Vt,
687
- list: qt,
688
- newline: Ft,
689
- paragraph: Zt,
690
- table: j,
691
- text: Wt
692
- }, en = N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", I).getRegex(), tn = {
693
- ...$t,
694
- lheading: Ht,
695
- table: en,
696
- paragraph: N(Ut).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", en).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", I).getRegex()
697
- }, nn = {
698
- ...$t,
699
- html: N("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Jt).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
871
+ nextBulletRegex: P((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
872
+ hrRegex: P((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
873
+ fencesBeginRegex: P((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
874
+ headingBeginRegex: P((e) => RegExp(`^ {0,${e}}#`)),
875
+ htmlBeginRegex: P((e) => RegExp(`^ {0,${e}}(?:</?(?:${R})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
876
+ blockquoteBeginRegex: P((e) => RegExp(`^ {0,${e}}>`))
877
+ }, vn = /^(?:[ \t]*(?:\n|$))+/, yn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, bn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, L = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, xn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Cn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, wn = F(Cn).replace(/bull/g, Sn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Tn = F(Cn).replace(/bull/g, Sn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), En = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Dn = /^[^\n]+/, On = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, kn = F(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", On).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), An = F(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Sn).getRegex(), R = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", jn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Mn = F("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", jn).replace("tag", R).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Nn = (e) => F(En).replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", R).getRegex(), Pn = Nn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Fn = Nn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), In = {
878
+ blockquote: F(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Fn).getRegex(),
879
+ code: yn,
880
+ def: kn,
881
+ fences: bn,
882
+ heading: xn,
883
+ hr: L,
884
+ html: Mn,
885
+ lheading: wn,
886
+ list: An,
887
+ newline: vn,
888
+ paragraph: Pn,
889
+ table: N,
890
+ text: Dn
891
+ }, Ln = F("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", R).getRegex(), Rn = {
892
+ ...In,
893
+ lheading: Tn,
894
+ table: Ln,
895
+ paragraph: F(En).replace("hr", L).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Ln).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", R).getRegex()
896
+ }, zn = {
897
+ ...In,
898
+ html: F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", jn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
700
899
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
701
900
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
702
- fences: j,
901
+ fences: N,
703
902
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
704
- paragraph: N(Ut).replace("hr", F).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Vt).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
705
- }, rn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, an = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, on = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, sn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, L = /[\p{P}\p{S}]/u, R = /[\s\p{P}\p{S}]/u, z = /[^\s\p{P}\p{S}]/u, cn = N(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, R).getRegex(), ln = /[\p{Pi}\p{Ps}"']/u, un = /(?!~)[\p{P}\p{S}]/u, dn = /(?!~)[\s\p{P}\p{S}]/u, fn = /(?:[^\s\p{P}\p{S}]|~)/u, pn = N(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Pt ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), mn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, hn = N(mn, "u").replace(/punct/g, L).getRegex(), gn = N(mn, "u").replace(/punct/g, un).getRegex(), _n = N(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, ln).replace(/punct/g, L).getRegex(), vn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", yn = N(vn, "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), bn = N(vn, "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, dn).replace(/punct/g, un).getRegex(), xn = N("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), Sn = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), Cn = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), wn = N(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, L).getRegex(), Tn = N("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), En = N(/\\(punct)/, "gu").replace(/punct/g, L).getRegex(), Dn = N(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), On = N(Jt).replace("(?:-->|$)", "-->").getRegex(), kn = N("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", On).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), An = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, B = N(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", An).getRegex(), jn = N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", B).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Mn = N(/^!?\[(label)\]\[(ref)\]/).replace("label", B).replace("ref", Gt).getRegex(), Nn = N(/^!?\[(ref)\](?:\[\])?/).replace("ref", Gt).getRegex(), Pn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Fn = N(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", An).getRegex(), In = N("reflink|nolink(?!\\()", "g").replace("reflink", N(/^!?\[(label)\]\[(ref)\]/).replace("label", Fn).replace("ref", Pn).getRegex()).replace("nolink", N(/^!?\[(ref)\](?:\[\])?/).replace("ref", Pn).getRegex()).getRegex(), Ln = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Rn = {
706
- _backpedal: j,
707
- anyPunctuation: En,
708
- autolink: Dn,
709
- blockSkip: pn,
710
- br: on,
711
- code: an,
712
- del: j,
713
- delLDelim: j,
714
- delRDelim: j,
715
- emStrongLDelim: hn,
716
- emStrongRDelimAst: yn,
717
- emStrongRDelimUnd: Sn,
718
- escape: rn,
719
- link: jn,
720
- nolink: Nn,
721
- punctuation: cn,
722
- reflink: Mn,
723
- reflinkSearch: In,
724
- tag: kn,
725
- text: sn,
726
- url: j
727
- }, zn = {
728
- ...Rn,
729
- emStrongLDelim: _n,
730
- emStrongRDelimAst: xn,
731
- emStrongRDelimUnd: Cn,
732
- link: N(/^!?\[(label)\]\((.*?)\)/).replace("label", B).getRegex(),
733
- reflink: N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", B).getRegex()
734
- }, Bn = {
735
- ...Rn,
736
- emStrongRDelimAst: bn,
737
- emStrongLDelim: gn,
738
- delLDelim: wn,
739
- delRDelim: Tn,
740
- url: N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Ln).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
903
+ paragraph: F(En).replace("hr", L).replace("heading", " *#{1,6} *[^\n]").replace("lheading", wn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
904
+ }, Bn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Vn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Hn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Un = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, z = /[\p{P}\p{S}]/u, B = /[\s\p{P}\p{S}]/u, V = /[^\s\p{P}\p{S}]/u, Wn = F(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, B).getRegex(), Gn = /[\p{Pi}\p{Ps}"']/u, Kn = /(?!~)[\p{P}\p{S}]/u, qn = /(?!~)[\s\p{P}\p{S}]/u, Jn = /(?:[^\s\p{P}\p{S}]|~)/u, Yn = F(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", _n ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Xn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Zn = F(Xn, "u").replace(/punct/g, z).getRegex(), Qn = F(Xn, "u").replace(/punct/g, Kn).getRegex(), $n = F(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Gn).replace(/punct/g, z).getRegex(), er = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", tr = F(er, "gu").replace(/notPunctSpace/g, V).replace(/punctSpace/g, B).replace(/punct/g, z).getRegex(), nr = F(er, "gu").replace(/notPunctSpace/g, Jn).replace(/punctSpace/g, qn).replace(/punct/g, Kn).getRegex(), rr = F("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, V).replace(/punctSpace/g, B).replace(/punct/g, z).getRegex(), ir = F("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, V).replace(/punctSpace/g, B).replace(/punct/g, z).getRegex(), ar = F("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, V).replace(/punctSpace/g, B).replace(/punct/g, z).getRegex(), or = F(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, z).getRegex(), sr = F("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, V).replace(/punctSpace/g, B).replace(/punct/g, z).getRegex(), cr = F(/\\(punct)/, "gu").replace(/punct/g, z).getRegex(), lr = F(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ur = F(jn).replace("(?:-->|$)", "-->").getRegex(), dr = F("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ur).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), fr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, H = F(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", fr).getRegex(), pr = F(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", H).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), mr = F(/^!?\[(label)\]\[(ref)\]/).replace("label", H).replace("ref", On).getRegex(), hr = F(/^!?\[(ref)\](?:\[\])?/).replace("ref", On).getRegex(), gr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, _r = F(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", fr).getRegex(), vr = F("reflink|nolink(?!\\()", "g").replace("reflink", F(/^!?\[(label)\]\[(ref)\]/).replace("label", _r).replace("ref", gr).getRegex()).replace("nolink", F(/^!?\[(ref)\](?:\[\])?/).replace("ref", gr).getRegex()).getRegex(), yr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, br = F(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), xr = {
905
+ _backpedal: N,
906
+ anyPunctuation: cr,
907
+ autolink: lr,
908
+ blockSkip: Yn,
909
+ br: Hn,
910
+ code: Vn,
911
+ del: N,
912
+ delLDelim: N,
913
+ delRDelim: N,
914
+ emStrongLDelim: Zn,
915
+ emStrongRDelimAst: tr,
916
+ emStrongRDelimUnd: ir,
917
+ escape: Bn,
918
+ link: pr,
919
+ nolink: hr,
920
+ punctuation: Wn,
921
+ reflink: mr,
922
+ reflinkSearch: vr,
923
+ tag: dr,
924
+ text: Un,
925
+ url: N
926
+ }, Sr = {
927
+ ...xr,
928
+ emStrongLDelim: $n,
929
+ emStrongRDelimAst: rr,
930
+ emStrongRDelimUnd: ar,
931
+ link: F(/^!?\[(label)\]\((.*?)\)/).replace("label", H).getRegex(),
932
+ reflink: F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", H).getRegex()
933
+ }, Cr = {
934
+ ...xr,
935
+ emStrongRDelimAst: nr,
936
+ emStrongLDelim: Qn,
937
+ delLDelim: or,
938
+ delRDelim: sr,
939
+ url: F(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", br).replace("protocol", yr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
741
940
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
742
941
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
743
- text: N(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Ln).getRegex()
744
- }, Vn = {
745
- ...Bn,
746
- br: N(on).replace("{2,}", "*").getRegex(),
747
- text: N(Bn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
748
- }, V = {
749
- normal: $t,
750
- gfm: tn,
751
- pedantic: nn
752
- }, H = {
753
- normal: Rn,
754
- gfm: Bn,
755
- breaks: Vn,
942
+ text: F(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", yr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
943
+ }, wr = {
944
+ ...Cr,
945
+ br: F(Hn).replace("{2,}", "*").getRegex(),
946
+ text: F(Cr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
947
+ }, U = {
948
+ normal: In,
949
+ gfm: Rn,
756
950
  pedantic: zn
757
- }, Hn = {
951
+ }, W = {
952
+ normal: xr,
953
+ gfm: Cr,
954
+ breaks: wr,
955
+ pedantic: Sr
956
+ }, Tr = {
758
957
  "&": "&amp;",
759
958
  "<": "&lt;",
760
959
  ">": "&gt;",
761
960
  "\"": "&quot;",
762
961
  "'": "&#39;"
763
- }, Un = (e) => Hn[e];
764
- function U(e, t) {
962
+ }, Er = (e) => Tr[e];
963
+ function G(e, t) {
765
964
  if (t) {
766
- if (P.escapeTest.test(e)) return e.replace(P.escapeReplace, Un);
767
- } else if (P.escapeTestNoEncode.test(e)) return e.replace(P.escapeReplaceNoEncode, Un);
965
+ if (I.escapeTest.test(e)) return e.replace(I.escapeReplace, Er);
966
+ } else if (I.escapeTestNoEncode.test(e)) return e.replace(I.escapeReplaceNoEncode, Er);
768
967
  return e;
769
968
  }
770
- function Wn(e) {
969
+ function Dr(e) {
970
+ return e.replace(I.numericCharacterReference, (e, t, n) => {
971
+ let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
972
+ return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
973
+ });
974
+ }
975
+ function Or(e) {
771
976
  try {
772
- e = encodeURI(e).replace(P.percentDecode, "%");
977
+ e = encodeURI(e).replace(I.percentDecode, "%");
773
978
  } catch {
774
979
  return null;
775
980
  }
776
981
  return e;
777
982
  }
778
- function Gn(e, t) {
779
- let n = e.replace(P.findPipe, (e, t, n) => {
983
+ function kr(e, t) {
984
+ let n = e.replace(I.findPipe, (e, t, n) => {
780
985
  let r = !1, i = t;
781
986
  for (; --i >= 0 && n[i] === "\\";) r = !r;
782
987
  return r ? "|" : " |";
783
- }).split(P.splitPipe), r = 0;
988
+ }).split(I.splitPipe), r = 0;
784
989
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
785
990
  if (n.length > t) n.splice(t);
786
991
  else for (; n.length < t;) n.push("");
787
992
  }
788
- for (; r < n.length; r++) n[r] = n[r].trim().replace(P.slashPipe, "|");
993
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(I.slashPipe, "|");
789
994
  return n;
790
995
  }
791
- function W(e, t, n) {
996
+ function K(e, t, n) {
792
997
  let r = e.length;
793
998
  if (r === 0) return "";
794
999
  let i = 0;
@@ -800,15 +1005,15 @@ function W(e, t, n) {
800
1005
  }
801
1006
  return e.slice(0, r - i);
802
1007
  }
803
- function Kn(e) {
1008
+ function Ar(e) {
804
1009
  let t = e.split("\n"), n = t.length - 1;
805
- for (; n >= 0 && P.blankLine.test(t[n]);) n--;
1010
+ for (; n >= 0 && I.blankLine.test(t[n]);) n--;
806
1011
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
807
1012
  }
808
- function G(e) {
809
- return e.toLowerCase().toUpperCase().toLowerCase();
1013
+ function q(e) {
1014
+ return e.trim().toLowerCase().toUpperCase().toLowerCase();
810
1015
  }
811
- function qn(e, t) {
1016
+ function jr(e, t) {
812
1017
  if (e.indexOf(t[1]) === -1) return -1;
813
1018
  let n = 0;
814
1019
  for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
@@ -816,7 +1021,7 @@ function qn(e, t) {
816
1021
  else if (e[r] === t[1] && (n--, n < 0)) return r;
817
1022
  return n > 0 ? -2 : -1;
818
1023
  }
819
- function Jn(e, t = 0) {
1024
+ function Mr(e, t = 0) {
820
1025
  let n = t, r = "";
821
1026
  for (let t of e) if (t === " ") {
822
1027
  let e = 4 - n % 4;
@@ -824,7 +1029,7 @@ function Jn(e, t = 0) {
824
1029
  } else r += t, n++;
825
1030
  return r;
826
1031
  }
827
- function Yn(e, t, n, r, i) {
1032
+ function Nr(e, t, n, r, i) {
828
1033
  let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
829
1034
  r.state.inLink = !0;
830
1035
  let l = r.state.linkEmitted, u = r.state.inRawBlock;
@@ -846,7 +1051,7 @@ function Yn(e, t, n, r, i) {
846
1051
  tokens: d
847
1052
  };
848
1053
  }
849
- function Xn(e, t, n) {
1054
+ function Pr(e, t, n) {
850
1055
  let r = e.match(n.other.indentCodeCompensation);
851
1056
  if (r === null) return t;
852
1057
  let i = r[1];
@@ -857,7 +1062,7 @@ function Xn(e, t, n) {
857
1062
  return e.slice(Math.min(r.length, i.length));
858
1063
  }).join("\n");
859
1064
  }
860
- function Zn(e, t, n, r) {
1065
+ function Fr(e, t, n, r) {
861
1066
  if (!t.includes("<")) return !1;
862
1067
  for (let i = 0; i < t.length; i++) {
863
1068
  if (t[i] === "\\") {
@@ -880,12 +1085,12 @@ function Zn(e, t, n, r) {
880
1085
  }
881
1086
  return !1;
882
1087
  }
883
- var K = class {
1088
+ var J = class {
884
1089
  options;
885
1090
  rules;
886
1091
  lexer;
887
1092
  constructor(e) {
888
- this.options = e || A;
1093
+ this.options = e || M;
889
1094
  }
890
1095
  space(e) {
891
1096
  let t = this.rules.block.newline.exec(e);
@@ -897,7 +1102,7 @@ var K = class {
897
1102
  code(e) {
898
1103
  let t = this.rules.block.code.exec(e);
899
1104
  if (t) {
900
- let e = this.options.pedantic ? t[0] : Kn(t[0]);
1105
+ let e = this.options.pedantic ? t[0] : Ar(t[0]);
901
1106
  return {
902
1107
  type: "code",
903
1108
  raw: e,
@@ -909,7 +1114,7 @@ var K = class {
909
1114
  fences(e) {
910
1115
  let t = this.rules.block.fences.exec(e);
911
1116
  if (t) {
912
- let e = t[0], n = Xn(e, t[3] || "", this.rules);
1117
+ let e = t[0], n = Pr(e, t[3] || "", this.rules);
913
1118
  return {
914
1119
  type: "code",
915
1120
  raw: e,
@@ -923,12 +1128,12 @@ var K = class {
923
1128
  if (t) {
924
1129
  let e = t[2].trim();
925
1130
  if (this.rules.other.endingHash.test(e)) {
926
- let t = W(e, "#");
1131
+ let t = K(e, "#");
927
1132
  (this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
928
1133
  }
929
1134
  return {
930
1135
  type: "heading",
931
- raw: W(t[0], "\n"),
1136
+ raw: K(t[0], "\n"),
932
1137
  depth: t[1].length,
933
1138
  text: e,
934
1139
  tokens: this.lexer.inline(e)
@@ -939,13 +1144,13 @@ var K = class {
939
1144
  let t = this.rules.block.hr.exec(e);
940
1145
  if (t) return {
941
1146
  type: "hr",
942
- raw: W(t[0], "\n")
1147
+ raw: K(t[0], "\n")
943
1148
  };
944
1149
  }
945
1150
  blockquote(e) {
946
1151
  let t = this.rules.block.blockquote.exec(e);
947
1152
  if (t) {
948
- let e = W(t[0], "\n").split("\n"), n = "", r = "", i = [];
1153
+ let e = K(t[0], "\n").split("\n"), n = "", r = "", i = [];
949
1154
  for (; e.length > 0;) {
950
1155
  let t = !1, a = [], o = 0;
951
1156
  for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
@@ -962,8 +1167,10 @@ ${c}` : c;
962
1167
  if (u?.type === "code") break;
963
1168
  if (u?.type === "blockquote") {
964
1169
  let t = u, a = e.join("\n"), o = t.raw + "\n" + a.replace(this.rules.other.blockquoteSetextReplace2, ""), s = this.blockquote(o);
965
- i[i.length - 1] = s, n = `${n}
966
- ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1170
+ i[i.length - 1] = s;
1171
+ let c = o.substring(s.raw.length).replace(/^\n/, ""), l = c ? c.split("\n").length : 0, d = l ? e.slice(0, -l) : e;
1172
+ d.length > 0 && (n = `${n}
1173
+ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
967
1174
  break;
968
1175
  }
969
1176
  if (u?.type === "list") {
@@ -997,18 +1204,18 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
997
1204
  let n = !1, r = "", s = "";
998
1205
  if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
999
1206
  r = t[0], e = e.substring(r.length);
1000
- let c = Jn(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
1001
- if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
1002
- let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
1207
+ let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? Mr(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => Mr(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
1208
+ if (this.options.pedantic ? (p = 2, s = u.trimStart()) : f ? p = l + 1 : (p = u.search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, s = u.slice(p), p += l), f && this.rules.other.blankLine.test(d) && (r += d + "\n", e = e.substring(d.length + 1), n = !0), !n) {
1209
+ let t = this.rules.other.nextBulletRegex(p), n = this.rules.other.hrRegex(p), i = this.rules.other.fencesBeginRegex(p), a = this.rules.other.headingBeginRegex(p), o = this.rules.other.htmlBeginRegex(p), c = this.rules.other.blockquoteBeginRegex(p);
1003
1210
  for (; e;) {
1004
- let p = e.split("\n", 1)[0], m;
1005
- if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
1006
- if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
1211
+ let l = e.split("\n", 1)[0], m;
1212
+ if (d = l, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), m = d) : m = d.replace(this.rules.other.leadingSpaceTab, (e) => e.replace(this.rules.other.tabCharGlobal, " ")), i.test(d) || a.test(d) || o.test(d) || c.test(d) || t.test(d) || n.test(d)) break;
1213
+ if (m.search(this.rules.other.nonSpaceChar) >= p || !d.trim()) s += "\n" + m.slice(p);
1007
1214
  else {
1008
- if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
1009
- s += "\n" + l;
1215
+ if (f || u.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(u) || a.test(u) || n.test(u)) break;
1216
+ s += "\n" + d;
1010
1217
  }
1011
- u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
1218
+ f = !d.trim(), r += l + "\n", e = e.substring(l.length + 1), u = m.slice(p);
1012
1219
  }
1013
1220
  }
1014
1221
  i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
@@ -1062,7 +1269,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1062
1269
  html(e) {
1063
1270
  let t = this.rules.block.html.exec(e);
1064
1271
  if (t) {
1065
- let e = Kn(t[0]);
1272
+ let e = Ar(t[0]);
1066
1273
  return {
1067
1274
  type: "html",
1068
1275
  block: !0,
@@ -1075,11 +1282,11 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1075
1282
  def(e) {
1076
1283
  let t = this.rules.block.def.exec(e);
1077
1284
  if (t) {
1078
- let e = G(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
1285
+ let e = q(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
1079
1286
  return {
1080
1287
  type: "def",
1081
1288
  tag: e,
1082
- raw: W(t[0], "\n"),
1289
+ raw: K(t[0], "\n"),
1083
1290
  href: n,
1084
1291
  title: r
1085
1292
  };
@@ -1088,9 +1295,9 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1088
1295
  table(e) {
1089
1296
  let t = this.rules.block.table.exec(e);
1090
1297
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1091
- let n = Gn(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1298
+ let n = kr(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1092
1299
  type: "table",
1093
- raw: W(t[0], "\n"),
1300
+ raw: K(t[0], "\n"),
1094
1301
  header: [],
1095
1302
  align: [],
1096
1303
  rows: []
@@ -1103,7 +1310,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1103
1310
  header: !0,
1104
1311
  align: a.align[e]
1105
1312
  });
1106
- for (let e of i) a.rows.push(Gn(e, a.header.length).map((e, t) => ({
1313
+ for (let e of i) a.rows.push(kr(e, a.header.length).map((e, t) => ({
1107
1314
  text: e,
1108
1315
  tokens: this.lexer.inline(e),
1109
1316
  header: !1,
@@ -1118,7 +1325,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1118
1325
  let e = t[1].trim();
1119
1326
  return {
1120
1327
  type: "heading",
1121
- raw: W(t[0], "\n"),
1328
+ raw: K(t[0], "\n"),
1122
1329
  depth: t[2].charAt(0) === "=" ? 1 : 2,
1123
1330
  text: e,
1124
1331
  tokens: this.lexer.inline(e)
@@ -1169,14 +1376,14 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1169
1376
  let t = this.rules.inline.link.exec(e);
1170
1377
  if (t) {
1171
1378
  let n = t[0].charAt(0) === "!" ? 2 : 1;
1172
- if (!this.options.pedantic && Zn(e, t[1], n, this.rules)) return;
1379
+ if (!this.options.pedantic && Fr(e, t[1], n, this.rules)) return;
1173
1380
  let r = t[2].trim();
1174
1381
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
1175
1382
  if (!this.rules.other.endAngleBracket.test(r)) return;
1176
- let e = W(r.slice(0, -1), "\\");
1383
+ let e = K(r.slice(0, -1), "\\");
1177
1384
  if ((r.length - e.length) % 2 == 0) return;
1178
1385
  } else {
1179
- let e = qn(t[2], "()");
1386
+ let e = jr(t[2], "()");
1180
1387
  if (e === -2) return;
1181
1388
  if (e > -1) {
1182
1389
  let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
@@ -1188,7 +1395,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1188
1395
  let e = this.rules.other.pedanticHrefTitle.exec(i);
1189
1396
  e && (i = e[1], a = e[3]);
1190
1397
  } else a = t[3] ? t[3].slice(1, -1) : "";
1191
- return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), Yn(t, {
1398
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), Nr(t, {
1192
1399
  href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
1193
1400
  title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
1194
1401
  }, t[0], this.lexer, this.rules);
@@ -1198,8 +1405,8 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1198
1405
  let n;
1199
1406
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
1200
1407
  let r = n[0].charAt(0) === "!" ? 2 : 1;
1201
- if (!this.options.pedantic && Zn(e, n[1], r, this.rules)) return;
1202
- let i = t[G((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1408
+ if (!this.options.pedantic && Fr(e, n[1], r, this.rules)) return;
1409
+ let i = t[q((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1203
1410
  if (!i) {
1204
1411
  let e = n[0].charAt(0);
1205
1412
  return {
@@ -1208,7 +1415,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1208
1415
  text: e
1209
1416
  };
1210
1417
  }
1211
- return Yn(n, i, n[0], this.lexer, this.rules);
1418
+ return Nr(n, i, n[0], this.lexer, this.rules);
1212
1419
  }
1213
1420
  }
1214
1421
  emStrong(e, t, n = "") {
@@ -1341,35 +1548,35 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1341
1548
  return {
1342
1549
  type: "text",
1343
1550
  raw: t[0],
1344
- text: t[0],
1551
+ text: e ? t[0] : Dr(t[0]),
1345
1552
  escaped: e
1346
1553
  };
1347
1554
  }
1348
1555
  }
1349
- }, q = class e {
1556
+ }, Y = class e {
1350
1557
  tokens;
1351
1558
  options;
1352
1559
  state;
1353
1560
  inlineQueue;
1354
1561
  tokenizer;
1355
1562
  constructor(e) {
1356
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || A, this.options.tokenizer = this.options.tokenizer || new K(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1563
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || M, this.options.tokenizer = this.options.tokenizer || new J(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1357
1564
  inLink: !1,
1358
1565
  inRawBlock: !1,
1359
1566
  linkEmitted: !1,
1360
1567
  top: !0
1361
1568
  };
1362
1569
  let t = {
1363
- other: P,
1364
- block: V.normal,
1365
- inline: H.normal
1570
+ other: I,
1571
+ block: U.normal,
1572
+ inline: W.normal
1366
1573
  };
1367
- this.options.pedantic ? (t.block = V.pedantic, t.inline = H.pedantic) : this.options.gfm && (t.block = V.gfm, t.inline = this.options.breaks ? H.breaks : H.gfm), this.tokenizer.rules = t;
1574
+ this.options.pedantic ? (t.block = U.pedantic, t.inline = W.pedantic) : this.options.gfm && (t.block = U.gfm, t.inline = this.options.breaks ? W.breaks : W.gfm), this.tokenizer.rules = t;
1368
1575
  }
1369
1576
  static get rules() {
1370
1577
  return {
1371
- block: V,
1372
- inline: H
1578
+ block: U,
1579
+ inline: W
1373
1580
  };
1374
1581
  }
1375
1582
  static lex(t, n) {
@@ -1379,7 +1586,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1379
1586
  return new e(n).inlineTokens(t);
1380
1587
  }
1381
1588
  lex(e) {
1382
- e = e.replace(P.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1589
+ e = e.replace(I.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1383
1590
  for (let e = 0; e < this.inlineQueue.length; e++) {
1384
1591
  let t = this.inlineQueue[e];
1385
1592
  this.inlineTokens(t.src, t.tokens);
@@ -1387,7 +1594,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1387
1594
  return this.inlineQueue = [], this.tokens;
1388
1595
  }
1389
1596
  blockTokens(e, t = [], n = !1) {
1390
- this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(P.tabCharGlobal, " ").replace(P.spaceLine, ""));
1597
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(I.tabCharGlobal, " ").replace(I.spaceLine, ""));
1391
1598
  let r = 1 / 0;
1392
1599
  for (; e;) {
1393
1600
  if (e.length < r) r = e.length;
@@ -1487,7 +1694,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1487
1694
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
1488
1695
  for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
1489
1696
  let e = t[0], n = e.lastIndexOf("[");
1490
- if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, G(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1697
+ if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, q(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1491
1698
  }
1492
1699
  return !1;
1493
1700
  }
@@ -1497,7 +1704,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1497
1704
  if (this.tokens.links && e.includes("[")) {
1498
1705
  let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
1499
1706
  let r = n.lastIndexOf("[");
1500
- if (!Object.hasOwn(this.tokens.links, G(n.slice(r + 1, -1)))) return n;
1707
+ if (!Object.hasOwn(this.tokens.links, q(n.slice(r + 1, -1)))) return n;
1501
1708
  if (r > 1 && n.charAt(0) !== "!") {
1502
1709
  let i = n.slice(1, r - 1);
1503
1710
  if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
@@ -1587,18 +1794,18 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
1587
1794
  if (this.options.silent) console.error(t);
1588
1795
  else throw Error(t);
1589
1796
  }
1590
- }, J = class {
1797
+ }, Ir = class {
1591
1798
  options;
1592
1799
  parser;
1593
1800
  constructor(e) {
1594
- this.options = e || A;
1801
+ this.options = e || M;
1595
1802
  }
1596
1803
  space(e) {
1597
1804
  return "";
1598
1805
  }
1599
1806
  code({ text: e, lang: t, escaped: n }) {
1600
- let r = (t || "").match(P.notSpaceStart)?.[0], i = e ? e.replace(P.endingNewline, "") + "\n" : "";
1601
- return r ? "<pre><code class=\"language-" + U(r) + "\">" + (n ? i : U(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : U(i, !0)) + "</code></pre>\n";
1807
+ let r = (t || "").match(I.notSpaceStart)?.[0], i = e ? e.replace(I.endingNewline, "") + "\n" : "";
1808
+ return r ? "<pre><code class=\"language-" + G(r) + "\">" + (n ? i : G(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : G(i, !0)) + "</code></pre>\n";
1602
1809
  }
1603
1810
  blockquote({ tokens: e }) {
1604
1811
  return `<blockquote>
@@ -1668,7 +1875,7 @@ ${e}</tr>
1668
1875
  return `<em>${this.parser.parseInline(e)}</em>`;
1669
1876
  }
1670
1877
  codespan({ text: e }) {
1671
- return `<code>${U(e, !0)}</code>`;
1878
+ return `<code>${G(e, !0)}</code>`;
1672
1879
  }
1673
1880
  br(e) {
1674
1881
  return "<br>";
@@ -1677,24 +1884,24 @@ ${e}</tr>
1677
1884
  return `<del>${this.parser.parseInline(e)}</del>`;
1678
1885
  }
1679
1886
  link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
1680
- let a = i ? U(n, !0) : this.parser.parseInline(r), o = Wn(e);
1887
+ let a = i ? G(n, !0) : this.parser.parseInline(r), o = Or(e);
1681
1888
  if (o === null) return a;
1682
- e = U(o, i);
1889
+ e = G(o, i);
1683
1890
  let s = "<a href=\"" + e + "\"";
1684
- return t && (s += " title=\"" + U(t) + "\""), s += ">" + a + "</a>", s;
1891
+ return t && (s += " title=\"" + G(t) + "\""), s += ">" + a + "</a>", s;
1685
1892
  }
1686
1893
  image({ href: e, title: t, text: n, tokens: r }) {
1687
1894
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1688
- let i = Wn(e);
1689
- if (i === null) return U(n);
1895
+ let i = Or(e);
1896
+ if (i === null) return G(n);
1690
1897
  e = i;
1691
- let a = `<img src="${U(e)}" alt="${U(n)}"`;
1692
- return t && (a += ` title="${U(t)}"`), a += ">", a;
1898
+ let a = `<img src="${G(e)}" alt="${G(n)}"`;
1899
+ return t && (a += ` title="${G(t)}"`), a += ">", a;
1693
1900
  }
1694
1901
  text(e) {
1695
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : U(e.text);
1902
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : G(e.text);
1696
1903
  }
1697
- }, Y = class {
1904
+ }, Lr = class {
1698
1905
  strong({ text: e }) {
1699
1906
  return e;
1700
1907
  }
@@ -1730,7 +1937,7 @@ ${e}</tr>
1730
1937
  renderer;
1731
1938
  textRenderer;
1732
1939
  constructor(e) {
1733
- this.options = e || A, this.options.renderer = this.options.renderer || new J(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Y();
1940
+ this.options = e || M, this.options.renderer = this.options.renderer || new Ir(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Lr();
1734
1941
  }
1735
1942
  static parse(t, n) {
1736
1943
  return new e(n).parse(t);
@@ -1882,7 +2089,7 @@ ${e}</tr>
1882
2089
  options;
1883
2090
  block;
1884
2091
  constructor(e) {
1885
- this.options = e || A;
2092
+ this.options = e || M;
1886
2093
  }
1887
2094
  static passThroughHooks = /* @__PURE__ */ new Set([
1888
2095
  "preprocess",
@@ -1908,21 +2115,21 @@ ${e}</tr>
1908
2115
  return e;
1909
2116
  }
1910
2117
  provideLexer(e = this.block) {
1911
- return e ? q.lex : q.lexInline;
2118
+ return e ? Y.lex : Y.lexInline;
1912
2119
  }
1913
2120
  provideParser(e = this.block) {
1914
2121
  return e ? X.parse : X.parseInline;
1915
2122
  }
1916
2123
  }, Q = new class {
1917
- defaults = Mt();
2124
+ defaults = hn();
1918
2125
  options = this.setOptions;
1919
2126
  parse = this.parseMarkdown(!0);
1920
2127
  parseInline = this.parseMarkdown(!1);
1921
2128
  Parser = X;
1922
- Renderer = J;
1923
- TextRenderer = Y;
1924
- Lexer = q;
1925
- Tokenizer = K;
2129
+ Renderer = Ir;
2130
+ TextRenderer = Lr;
2131
+ Lexer = Y;
2132
+ Tokenizer = J;
1926
2133
  Hooks = Z;
1927
2134
  constructor(...e) {
1928
2135
  this.use(...e);
@@ -1974,7 +2181,7 @@ ${e}</tr>
1974
2181
  }
1975
2182
  "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1976
2183
  }), n.extensions = t), e.renderer) {
1977
- let t = this.defaults.renderer || new J(this.defaults);
2184
+ let t = this.defaults.renderer || new Ir(this.defaults);
1978
2185
  for (let n in e.renderer) {
1979
2186
  if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1980
2187
  if (["options", "parser"].includes(n)) continue;
@@ -1987,7 +2194,7 @@ ${e}</tr>
1987
2194
  n.renderer = t;
1988
2195
  }
1989
2196
  if (e.tokenizer) {
1990
- let t = this.defaults.tokenizer || new K(this.defaults);
2197
+ let t = this.defaults.tokenizer || new J(this.defaults);
1991
2198
  for (let n in e.tokenizer) {
1992
2199
  if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1993
2200
  if ([
@@ -2047,7 +2254,7 @@ ${e}</tr>
2047
2254
  }, this;
2048
2255
  }
2049
2256
  lexer(e, t) {
2050
- return q.lex(e, t ?? this.defaults);
2257
+ return Y.lex(e, t ?? this.defaults);
2051
2258
  }
2052
2259
  parser(e, t) {
2053
2260
  return X.parse(e, t ?? this.defaults);
@@ -2062,14 +2269,14 @@ ${e}</tr>
2062
2269
  if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
2063
2270
  if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
2064
2271
  if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
2065
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
2272
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? Y.lex : Y.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
2066
2273
  i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
2067
2274
  let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? X.parse : X.parseInline)(a, i);
2068
2275
  return i.hooks ? await i.hooks.postprocess(o) : o;
2069
2276
  })().catch(a);
2070
2277
  try {
2071
2278
  i.hooks && (t = i.hooks.preprocess(t));
2072
- let n = (i.hooks ? i.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(t, i);
2279
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? Y.lex : Y.lexInline)(t, i);
2073
2280
  i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
2074
2281
  let r = (i.hooks ? i.hooks.provideParser(e) : e ? X.parse : X.parseInline)(n, i);
2075
2282
  return i.hooks && (r = i.hooks.postprocess(r)), r;
@@ -2081,7 +2288,7 @@ ${e}</tr>
2081
2288
  onError(e, t) {
2082
2289
  return (n) => {
2083
2290
  if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
2084
- let e = "<p>An error occurred:</p><pre>" + U(n.message + "", !0) + "</pre>";
2291
+ let e = "<p>An error occurred:</p><pre>" + G(n.message + "", !0) + "</pre>";
2085
2292
  return t ? Promise.resolve(e) : e;
2086
2293
  }
2087
2294
  if (t) return Promise.reject(n);
@@ -2093,17 +2300,15 @@ function $(e, t) {
2093
2300
  return Q.parse(e, t);
2094
2301
  }
2095
2302
  $.options = $.setOptions = function(e) {
2096
- return Q.setOptions(e), $.defaults = Q.defaults, Nt($.defaults), $;
2097
- }, $.getDefaults = Mt, $.defaults = A;
2098
- function Qn(...e) {
2099
- return Q.use(...e), $.defaults = Q.defaults, Nt($.defaults), $;
2303
+ return Q.setOptions(e), $.defaults = Q.defaults, gn($.defaults), $;
2304
+ }, $.getDefaults = hn, $.defaults = M;
2305
+ function Rr(...e) {
2306
+ return Q.use(...e), $.defaults = Q.defaults, gn($.defaults), $;
2100
2307
  }
2101
- //#endregion
2102
- //#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
2103
- $.use = Qn, $.walkTokens = function(e, t) {
2308
+ $.use = Rr, $.walkTokens = function(e, t) {
2104
2309
  return Q.walkTokens(e, t);
2105
- }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.walkTokens, $.parseInline, X.parse, q.lex, a();
2106
- var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2310
+ }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = Ir, $.TextRenderer = Lr, $.Lexer = Y, $.lexer = Y.lex, $.Tokenizer = J, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.walkTokens, $.parseInline, X.parse, Y.lex, a(), l();
2311
+ var zr = ["innerHTML"], Br = 100, Vr = /*#__PURE__*/ re(/* @__PURE__ */ e({
2107
2312
  __name: "PkStreamingMarkdown",
2108
2313
  props: {
2109
2314
  markdown: {
@@ -2125,23 +2330,27 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2125
2330
  isDark: {
2126
2331
  type: Boolean,
2127
2332
  default: !1
2333
+ },
2334
+ tailLength: {
2335
+ default: void 0,
2336
+ type: Number
2128
2337
  }
2129
2338
  },
2130
2339
  setup(e) {
2131
- let a = e, { t: ee } = u({ useScope: "global" }), te = null;
2132
- function ne() {
2133
- return te ||= import("./dist-CsXLeGNF.js"), te;
2340
+ let a = e, { t: l } = f({ useScope: "global" }), re = null;
2341
+ function ie() {
2342
+ return re ||= import("./dist-CsXLeGNF.js"), re;
2134
2343
  }
2135
- let re = null;
2136
- function ae() {
2137
- return re ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), re;
2344
+ let ae = null;
2345
+ function oe() {
2346
+ return ae ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), ae;
2138
2347
  }
2139
- let oe = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, se = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
2140
- function h(e) {
2348
+ let h = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, g = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
2349
+ function ce(e) {
2141
2350
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2142
2351
  }
2143
- function g(e, t) {
2144
- return `<span class="katex-pending" data-katex="${h(e)}" data-display="${t}"></span>`;
2352
+ function le(e, t) {
2353
+ return `<span class="katex-pending" data-katex="${ce(e)}" data-display="${t}"></span>`;
2145
2354
  }
2146
2355
  $.use({ extensions: [{
2147
2356
  name: "inlineKatex",
@@ -2151,7 +2360,7 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2151
2360
  if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
2152
2361
  },
2153
2362
  tokenizer(e) {
2154
- let t = e.match(oe);
2363
+ let t = e.match(h);
2155
2364
  if (t) return {
2156
2365
  type: "inlineKatex",
2157
2366
  raw: t[0],
@@ -2160,13 +2369,13 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2160
2369
  };
2161
2370
  },
2162
2371
  renderer(e) {
2163
- return g(e.text, e.displayMode);
2372
+ return le(e.text, e.displayMode);
2164
2373
  }
2165
2374
  }, {
2166
2375
  name: "blockKatex",
2167
2376
  level: "block",
2168
2377
  tokenizer(e) {
2169
- let t = e.match(se);
2378
+ let t = e.match(g);
2170
2379
  if (t) return {
2171
2380
  type: "blockKatex",
2172
2381
  raw: t[0],
@@ -2175,7 +2384,7 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2175
2384
  };
2176
2385
  },
2177
2386
  renderer(e) {
2178
- return g(e.text, e.displayMode) + "\n";
2387
+ return le(e.text, e.displayMode) + "\n";
2179
2388
  }
2180
2389
  }] }), $.use({ extensions: [{
2181
2390
  name: "thinking",
@@ -2196,22 +2405,22 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2196
2405
  return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
2197
2406
  }
2198
2407
  }] });
2199
- let _ = new $.Renderer(), v = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ce = /^(?:javascript|data|vbscript|file):/i;
2408
+ let _ = new $.Renderer(), v = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ue = /^(?:javascript|data|vbscript|file):/i;
2200
2409
  _.link = function({ href: e, title: t, tokens: n }) {
2201
2410
  let r = this.parser.parseInline(n), i = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
2202
- if (!i || ce.test(i)) return r;
2203
- let a = t ? ` title="${v(t)}"` : "", o = p(i) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
2411
+ if (!i || ue.test(i)) return r;
2412
+ let a = t ? ` title="${v(t)}"` : "", o = ee(i) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
2204
2413
  return `<a href="${v(i)}"${a}${o}>${r}</a>`;
2205
2414
  }, _.table = function(e) {
2206
2415
  return `<div class="table-wrapper">${$.Renderer.prototype.table.call(this, e)}</div>`;
2207
2416
  };
2208
- let le = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
2209
- _.code = ({ text: e }) => le.test(e) ? `<pre class="mermaid">${e}</pre>` : `<pre><code>${e}</code></pre>`;
2210
- function ue(e) {
2417
+ let de = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
2418
+ _.code = ({ text: e }) => de.test(e) ? `<pre class="mermaid">${e}</pre>` : `<pre><code>${e}</code></pre>`;
2419
+ function fe(e) {
2211
2420
  return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
2212
2421
  }
2213
- function de(e) {
2214
- let t = /* @__PURE__ */ new Set(), n = /^(`{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
2422
+ function pe(e) {
2423
+ let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
2215
2424
  for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
2216
2425
  return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
2217
2426
  if (t.has(r)) return e;
@@ -2222,25 +2431,25 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2222
2431
  }
2223
2432
  }).replace(/\n{3,}/g, "\n\n");
2224
2433
  }
2225
- let y = [
2226
- ie,
2227
- de,
2228
- jt,
2229
- ue
2230
- ], b = n("container"), { resolveText: fe } = m(), x = fe(() => a.markdown), S = c(() => {
2231
- let e = y.reduce((e, t) => t(e), x.value);
2434
+ let me = [
2435
+ se,
2436
+ pe,
2437
+ mn,
2438
+ fe
2439
+ ], y = n("container"), ge = te(c(a, "markdown"), Br), _e = u(() => a.tailLength ? he(ge.value, a.tailLength) : ge.value), { resolveText: ve } = ne(), ye = ve(_e), b = u(() => {
2440
+ let e = me.reduce((e, t) => t(e), ye.value);
2232
2441
  return $.parse(e, {
2233
2442
  async: !1,
2234
2443
  breaks: !0,
2235
2444
  renderer: _
2236
2445
  });
2237
2446
  });
2238
- async function pe() {
2447
+ async function be() {
2239
2448
  if (a.loading) return;
2240
2449
  await i();
2241
- let e = b.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
2450
+ let e = y.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
2242
2451
  if (!e?.length) return;
2243
- let { renderMermaidSVG: t, THEMES: n } = await ne(), r = a.isDark ? n["github-dark"] : n["github-light"];
2452
+ let { renderMermaidSVG: t, THEMES: n } = await ie(), r = a.isDark ? n["github-dark"] : n["github-light"];
2244
2453
  for (let n of Array.from(e)) {
2245
2454
  if (!n.isConnected) continue;
2246
2455
  let e = n.textContent?.trim();
@@ -2250,19 +2459,19 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2250
2459
  } catch {}
2251
2460
  }
2252
2461
  }
2253
- async function me() {
2462
+ async function xe() {
2254
2463
  await i();
2255
- let e = b.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
2464
+ let e = y.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
2256
2465
  if (!e?.length) return;
2257
2466
  let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
2258
2467
  for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
2259
2468
  }
2260
- async function he() {
2469
+ async function Se() {
2261
2470
  await i();
2262
- let e = b.value?.querySelectorAll(".katex-pending");
2471
+ let e = y.value?.querySelectorAll(".katex-pending");
2263
2472
  if (!e?.length) return;
2264
- let t = await ae();
2265
- d("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", f(b.value));
2473
+ let t = await oe();
2474
+ p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", m(y.value));
2266
2475
  for (let n of Array.from(e)) {
2267
2476
  if (!n.isConnected) continue;
2268
2477
  let e = n.dataset.katex;
@@ -2276,11 +2485,11 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2276
2485
  } catch {}
2277
2486
  }
2278
2487
  }
2279
- async function ge() {
2488
+ async function Ce() {
2280
2489
  await i();
2281
- let e = b.value?.querySelectorAll("pre.mermaid[data-rendered]");
2490
+ let e = y.value?.querySelectorAll("pre.mermaid[data-rendered]");
2282
2491
  if (!e?.length) return;
2283
- let { renderMermaidSVG: t, THEMES: n } = await ne(), r = a.isDark ? n["github-dark"] : n["github-light"];
2492
+ let { renderMermaidSVG: t, THEMES: n } = await ie(), r = a.isDark ? n["github-dark"] : n["github-light"];
2284
2493
  for (let n of Array.from(e)) {
2285
2494
  if (!n.isConnected) continue;
2286
2495
  let e = n.dataset.code;
@@ -2289,73 +2498,73 @@ var $n = ["innerHTML"], er = /*#__PURE__*/ ee(/* @__PURE__ */ e({
2289
2498
  } catch {}
2290
2499
  }
2291
2500
  }
2292
- function _e(e) {
2501
+ function x(e) {
2293
2502
  let t = e.target;
2294
2503
  if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
2295
2504
  t.dataset.broken = "true";
2296
2505
  let n = document.createElement("span");
2297
- n.className = "markdown-broken-image", n.textContent = t.alt || ee("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
2506
+ n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
2298
2507
  }
2299
2508
  t(() => {
2300
- b.value?.addEventListener("error", _e, !0);
2509
+ y.value?.addEventListener("error", x, !0);
2301
2510
  }), o(() => {
2302
- b.value?.removeEventListener("error", _e, !0);
2303
- }), s([S, () => a.loading], pe, { immediate: !0 }), s(() => a.isDark, ge), s(S, me, { immediate: !0 }), s(S, he, { immediate: !0 });
2304
- let C = 0;
2305
- function ve(e, t) {
2511
+ y.value?.removeEventListener("error", x, !0);
2512
+ }), s([b, () => a.loading], be, { immediate: !0 }), s(() => a.isDark, Ce), s(b, xe, { immediate: !0 }), s(b, Se, { immediate: !0 });
2513
+ let S = 0;
2514
+ function we(e, t) {
2306
2515
  let n = document.createElement("span");
2307
2516
  return n.style.cssText = `animation:ft-${a.animation} ${a.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
2308
2517
  let t = n.parentNode;
2309
2518
  t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
2310
2519
  }, { once: !0 }), n;
2311
2520
  }
2312
- function ye(e, t, n, r) {
2521
+ function Te(e, t, n, r) {
2313
2522
  let i = r, a = e.split(/(\s+)/);
2314
2523
  for (let e of a) if (e) {
2315
2524
  if (/^\s+$/.test(e)) {
2316
2525
  t.insertBefore(document.createTextNode(e), n);
2317
2526
  continue;
2318
2527
  }
2319
- t.insertBefore(ve(e, i * 30), n), i++;
2528
+ t.insertBefore(we(e, i * 30), n), i++;
2320
2529
  }
2321
2530
  return i;
2322
2531
  }
2323
- function w(e) {
2532
+ function Ee(e) {
2324
2533
  let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
2325
2534
  return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2326
2535
  } }), n = [];
2327
2536
  for (; t.nextNode();) n.push(t.currentNode);
2328
2537
  return n;
2329
2538
  }
2330
- function be() {
2331
- if (!b.value || !a.loading || !a.animation) return;
2332
- let e = w(b.value), t = 0, n = 0;
2539
+ function C() {
2540
+ if (!y.value || !a.loading || !a.animation) return;
2541
+ let e = Ee(y.value), t = 0, n = 0;
2333
2542
  for (let r of e) {
2334
2543
  let e = r.textContent || "", i = t, a = t + e.length;
2335
- if (t = a, a <= C) continue;
2544
+ if (t = a, a <= S) continue;
2336
2545
  let o = r.parentNode;
2337
2546
  if (!o) continue;
2338
- if (i >= C) {
2547
+ if (i >= S) {
2339
2548
  let t = r.nextSibling;
2340
- o.removeChild(r), n = ye(e, o, t, n);
2549
+ o.removeChild(r), n = Te(e, o, t, n);
2341
2550
  continue;
2342
2551
  }
2343
- let s = C - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
2344
- o.removeChild(c), n = ye(l, o, u, n);
2552
+ let s = S - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
2553
+ o.removeChild(c), n = Te(l, o, u, n);
2345
2554
  }
2346
- C = t;
2555
+ S = t;
2347
2556
  }
2348
- return s(S, async () => {
2349
- await i(), be();
2557
+ return s(b, async () => {
2558
+ await i(), C();
2350
2559
  }, { immediate: !0 }), s(() => a.markdown, (e, t) => {
2351
- (!e || t && e.length < t.length) && (C = 0);
2352
- }), (e, t) => (r(), l("div", {
2560
+ (!e || t && e.length < t.length) && (S = 0);
2561
+ }), (e, t) => (r(), d("div", {
2353
2562
  ref: "container",
2354
- innerHTML: S.value
2355
- }, null, 8, $n));
2563
+ innerHTML: b.value
2564
+ }, null, 8, zr));
2356
2565
  }
2357
2566
  }), [["styles", [".markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
2358
2567
  //#endregion
2359
- export { er as t };
2568
+ export { ue as C, h as D, v as E, g as O, _ as S, le as T, fe as _, we as a, Se as b, Ce as c, b as d, Me as f, ye as g, Oe as h, C as i, je as l, S as m, _e as n, Ee as o, Ae as p, pe as r, Te as s, Vr as t, be as u, ve as v, ce as w, x, de as y };
2360
2569
 
2361
- //# sourceMappingURL=PkStreamingMarkdown-CwqsJnJJ.js.map
2570
+ //# sourceMappingURL=PkStreamingMarkdown-CNI8aV8t.js.map