@8wave/ai-elements 0.121.0-beta.2 → 0.121.0-beta.20

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 (153) hide show
  1. package/README.md +125 -54
  2. package/dist/_chunks/{Agent-BYC51e6E.js → Agent-wt8Vi99H.js} +69 -61
  3. package/dist/_chunks/Agent-wt8Vi99H.js.map +1 -0
  4. package/dist/_chunks/{PkStreamingMarkdown-CNoHyTuC.js → PkStreamingMarkdown-Br7Z60Vm.js} +846 -841
  5. package/dist/_chunks/PkStreamingMarkdown-Br7Z60Vm.js.map +1 -0
  6. package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js → PkToolEditSpreadsheet-Di9czFTy.js} +2 -2
  7. package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js.map → PkToolEditSpreadsheet-Di9czFTy.js.map} +1 -1
  8. package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js → PkToolRequestGeolocation-dUTqHsV-.js} +2 -2
  9. package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js.map → PkToolRequestGeolocation-dUTqHsV-.js.map} +1 -1
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js → PkToolRequestOAuthConnection-cNDld72U.js} +2 -2
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js.map → PkToolRequestOAuthConnection-cNDld72U.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js → PkToolShowArtifact-DtstlRsL.js} +2 -2
  13. package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js.map → PkToolShowArtifact-DtstlRsL.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js → PkToolShowContactForm-BKaKlYGJ.js} +2 -2
  15. package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js.map → PkToolShowContactForm-BKaKlYGJ.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js → PkToolShowForm-OxANKx0g.js} +3 -3
  17. package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js.map → PkToolShowForm-OxANKx0g.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js → PkToolShowImageGallery-DRePOmUx.js} +2 -2
  19. package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js.map → PkToolShowImageGallery-DRePOmUx.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowProductList-westY5bY.js → PkToolShowProductList-Y9HR_RJ4.js} +2 -2
  21. package/dist/_chunks/{PkToolShowProductList-westY5bY.js.map → PkToolShowProductList-Y9HR_RJ4.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js → PkToolShowSources-BQnaaL2a.js} +3 -3
  23. package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js.map → PkToolShowSources-BQnaaL2a.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js → PkToolShowSuggestedReply-ghiXQuDz.js} +2 -2
  25. package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js.map → PkToolShowSuggestedReply-ghiXQuDz.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js → PkToolShowVideo-BcNWgJD7.js} +2 -2
  27. package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js.map → PkToolShowVideo-BcNWgJD7.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js → PkToolShowWebPages-Ba6DkV0V.js} +2 -2
  29. package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js.map → PkToolShowWebPages-Ba6DkV0V.js.map} +1 -1
  30. package/dist/_chunks/{chatImagePolicy-B5-QV037.js → chatImagePolicy-P0TZW1on.js} +2 -2
  31. package/dist/_chunks/{chatImagePolicy-B5-QV037.js.map → chatImagePolicy-P0TZW1on.js.map} +1 -1
  32. package/dist/_chunks/{markdown-DO_FLvlJ.js → markdown-DLplFIBU.js} +10 -10
  33. package/dist/_chunks/{markdown-DO_FLvlJ.js.map → markdown-DLplFIBU.js.map} +1 -1
  34. package/dist/ai-elements.es.js +3949 -3244
  35. package/dist/ai-elements.es.js.map +1 -1
  36. package/dist-vue/PkChatbot.js +1 -1
  37. package/dist-vue/PkChatbotEmptyState.js +1 -1
  38. package/dist-vue/PkChatbotInput.js +1 -1
  39. package/dist-vue/PkChatbotMessages.js +1 -1
  40. package/dist-vue/PkChatbotStepPayload.js +1 -1
  41. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  42. package/dist-vue/PkChatbotSteps.js +1 -1
  43. package/dist-vue/PkChatbotViewChat.js +1 -1
  44. package/dist-vue/PkChatbotViewConversations.js +1 -1
  45. package/dist-vue/PkChatbotViewFiles.js +1 -1
  46. package/dist-vue/PkChatbotViewProfile.js +1 -1
  47. package/dist-vue/_chunks/{Agent-2DVqpLwz.js → Agent-DcoF75y8.js} +68 -60
  48. package/dist-vue/_chunks/Agent-DcoF75y8.js.map +1 -0
  49. package/dist-vue/_chunks/{Document-ChfbOVVs.js → Document-C1bD6VNU.js} +10 -10
  50. package/dist-vue/_chunks/{Document-ChfbOVVs.js.map → Document-C1bD6VNU.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbot-CTZPru6f.js → PkChatbot-wyaH2IgV.js} +9 -9
  52. package/dist-vue/_chunks/PkChatbot-wyaH2IgV.js.map +1 -0
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js → PkChatbotEmptyState-h2qZ0JOD.js} +2 -2
  54. package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js.map → PkChatbotEmptyState-h2qZ0JOD.js.map} +1 -1
  55. package/dist-vue/_chunks/PkChatbotInput-C-bMNHC-.js +397 -0
  56. package/dist-vue/_chunks/PkChatbotInput-C-bMNHC-.js.map +1 -0
  57. package/dist-vue/_chunks/{PkChatbotMessages-WryjcyH7.js → PkChatbotMessages-DU8qnlVX.js} +17 -17
  58. package/dist-vue/_chunks/{PkChatbotMessages-WryjcyH7.js.map → PkChatbotMessages-DU8qnlVX.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js → PkChatbotStepPayload-BOxfKD1b.js} +2 -2
  60. package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js.map → PkChatbotStepPayload-BOxfKD1b.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js → PkChatbotStepToolDetail-Df6EOYxj.js} +3 -3
  62. package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js.map → PkChatbotStepToolDetail-Df6EOYxj.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js → PkChatbotSteps-DnDtN4Q7.js} +5 -5
  64. package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js.map → PkChatbotSteps-DnDtN4Q7.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewChat-CZjOJn6w.js → PkChatbotViewChat-D4iupq1A.js} +8 -11
  66. package/dist-vue/_chunks/PkChatbotViewChat-D4iupq1A.js.map +1 -0
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js → PkChatbotViewConversations-dKZScKD9.js} +3 -3
  68. package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js.map → PkChatbotViewConversations-dKZScKD9.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js → PkChatbotViewFiles-CQC3rInD.js} +3 -3
  70. package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js.map → PkChatbotViewFiles-CQC3rInD.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js → PkChatbotViewProfile-CkZyWh4V.js} +2 -2
  72. package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js.map → PkChatbotViewProfile-CkZyWh4V.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js → PkStreamingMarkdown-BYV68skc.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js.map → PkStreamingMarkdown-BYV68skc.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js → PkToolEditSpreadsheet-DQxJQIY0.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js.map → PkToolEditSpreadsheet-DQxJQIY0.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js → PkToolRequestGeolocation-BpjglRbg.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js.map → PkToolRequestGeolocation-BpjglRbg.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js → PkToolRequestOAuthConnection-CD3M5DWj.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js.map → PkToolRequestOAuthConnection-CD3M5DWj.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js → PkToolShowArtifact-Bm5VBF_n.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js.map → PkToolShowArtifact-Bm5VBF_n.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js → PkToolShowContactForm-CMQTQsU-.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js.map → PkToolShowContactForm-CMQTQsU-.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js → PkToolShowDiagram-adGuj4AF.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js.map → PkToolShowDiagram-adGuj4AF.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js → PkToolShowForm-Cx5KdTlZ.js} +4 -4
  88. package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js.map → PkToolShowForm-Cx5KdTlZ.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js → PkToolShowImageGallery-BtQ0gnGB.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js.map → PkToolShowImageGallery-BtQ0gnGB.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js → PkToolShowProductList-Dvatk6p-.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js.map → PkToolShowProductList-Dvatk6p-.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js → PkToolShowSources-DKkIYQ9r.js} +3 -3
  94. package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js.map → PkToolShowSources-DKkIYQ9r.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js → PkToolShowSuggestedReply-BbAfjJP9.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js.map → PkToolShowSuggestedReply-BbAfjJP9.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js → PkToolShowVideo-DTNszfdU.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js.map → PkToolShowVideo-DTNszfdU.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js → PkToolShowWebPages-euov57FB.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js.map → PkToolShowWebPages-euov57FB.js.map} +1 -1
  101. package/dist-vue/_chunks/{createChatbotApiClient-DecVahlB.js → createChatbotApiClient-qHjpFqPL.js} +19 -19
  102. package/dist-vue/_chunks/{createChatbotApiClient-DecVahlB.js.map → createChatbotApiClient-qHjpFqPL.js.map} +1 -1
  103. package/dist-vue/_chunks/{useChatbotStore-BQTq8fq-.js → useChatbotStore-CBjfSN69.js} +1143 -1143
  104. package/dist-vue/_chunks/{useChatbotStore-BQTq8fq-.js.map → useChatbotStore-CBjfSN69.js.map} +1 -1
  105. package/dist-vue/_chunks/{utils-BLMOBcka.js → utils-BCGK2AFl.js} +35 -40
  106. package/dist-vue/_chunks/utils-BCGK2AFl.js.map +1 -0
  107. package/dist-vue/api.js +1 -1
  108. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +12 -4
  109. package/dist-vue/apps/web-component/src/components/FloatingChatWidget.ce.d.ts +4 -3
  110. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +11 -5
  111. package/dist-vue/apps/web-component/src/composables/useChatbotProfileProvider.d.ts +3 -2
  112. package/dist-vue/apps/web-component/src/composables/useCopilotPageCss.d.ts +12 -4
  113. package/dist-vue/apps/web-component/src/composables/usePageModal.d.ts +19 -0
  114. package/dist-vue/apps/web-component/src/lib.d.ts +10 -3
  115. package/dist-vue/apps/web-component/src/pageTools/actions.d.ts +33 -0
  116. package/dist-vue/apps/web-component/src/pageTools/navigation.d.ts +27 -0
  117. package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +18 -2
  118. package/dist-vue/apps/web-component/src/utils/emitWidgetEvent.d.ts +8 -0
  119. package/dist-vue/apps/web-component/src/utils/layout.d.ts +3 -3
  120. package/dist-vue/composables.js +201 -21
  121. package/dist-vue/composables.js.map +1 -1
  122. package/dist-vue/index.js +4316 -4264
  123. package/dist-vue/index.js.map +1 -1
  124. package/dist-vue/locales.js +58 -22
  125. package/dist-vue/packages/auth/src/active-membership.d.ts +2 -0
  126. package/dist-vue/packages/components/src/PkSkeleton.d.ts +1 -1
  127. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +11 -5
  128. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +3 -4
  129. package/dist-vue/packages/components/src/chat/PkHostCallConfirmDialog.d.ts +19 -0
  130. package/dist-vue/packages/components/src/chat/PkWebSearchSettings.d.ts +2 -0
  131. package/dist-vue/packages/components/src/chat/utils.d.ts +5 -0
  132. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +13 -7
  133. package/dist-vue/packages/composable/src/chatbot/useGreeting.d.ts +5 -3
  134. package/dist-vue/packages/models/src/schema/Agent.d.ts +45 -18
  135. package/dist-vue/packages/models/src/schema/Member.d.ts +11 -0
  136. package/dist-vue/packages/models/src/schema/Organization.d.ts +1 -0
  137. package/dist-vue/packages/models/src/schema/OrganizationDeletion.d.ts +197 -0
  138. package/dist-vue/packages/models/src/schema/OrganizationExternalAuth.d.ts +8 -2
  139. package/dist-vue/packages/models/src/schema/OrganizationIdentityProvider.d.ts +4 -1
  140. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +5 -3
  141. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +5 -3
  142. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  143. package/dist-vue/style.css +1 -1
  144. package/package.json +1 -1
  145. package/dist/_chunks/Agent-BYC51e6E.js.map +0 -1
  146. package/dist/_chunks/PkStreamingMarkdown-CNoHyTuC.js.map +0 -1
  147. package/dist-vue/_chunks/Agent-2DVqpLwz.js.map +0 -1
  148. package/dist-vue/_chunks/PkChatbot-CTZPru6f.js.map +0 -1
  149. package/dist-vue/_chunks/PkChatbotInput-CQup254H.js +0 -399
  150. package/dist-vue/_chunks/PkChatbotInput-CQup254H.js.map +0 -1
  151. package/dist-vue/_chunks/PkChatbotViewChat-CZjOJn6w.js.map +0 -1
  152. package/dist-vue/_chunks/utils-BLMOBcka.js.map +0 -1
  153. package/dist-vue/apps/web-component/src/composables/useCopilotPush.d.ts +0 -25
@@ -1,51 +1,51 @@
1
1
  import { F as e, I as t, P as n, R as r, Y as i, Z as a, at as o, h as s, k as c, w as l, y as u, yt as d } from "./vue.runtime.esm-bundler-BkvITeKg.js";
2
2
  import { r as f } from "./vue-i18n-BoTyYk8j.js";
3
3
  import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
4
- import { M as m, f as te, g as ne, t as re, u as ie } from "./Agent-BYC51e6E.js";
4
+ import { N as m, _ as h, f as te, g as ne, t as re, u as ie } from "./Agent-wt8Vi99H.js";
5
5
  import "./src-Ra4oUpUU.js";
6
- import { n as h, t as g } from "./text-BHCGblDQ.js";
7
- import { n as ae } from "./url-validation-9DstIfq2.js";
8
- import { b as _ } from "./dist---RigjU4.js";
6
+ import { n as g, t as _ } from "./text-BHCGblDQ.js";
7
+ import { n as v } from "./url-validation-9DstIfq2.js";
8
+ import { b as ae } from "./dist---RigjU4.js";
9
9
  import { n as oe } from "./useShortUrlResolver-BGoPo6JO.js";
10
10
  import { t as se } from "./_plugin-vue_export-helper-B3ysoDQm.js";
11
- import { n as ce } from "./chatImagePolicy-B5-QV037.js";
11
+ import { n as y } from "./chatImagePolicy-P0TZW1on.js";
12
12
  //#region ../../packages/utils/src/citations.ts
13
- var v = /[ \t]*\uE200[^\uE201]*\uE201/g, y = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, le = /[\uE200-\uE20F]/g;
13
+ var b = /[ \t]*\uE200[^\uE201]*\uE201/g, ce = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, le = /[\uE200-\uE20F]/g;
14
14
  function ue(e) {
15
- return e && e.replace(v, "").replace(y, "").replace(le, "");
15
+ return e && e.replace(b, "").replace(ce, "").replace(le, "");
16
16
  }
17
17
  //#endregion
18
18
  //#region ../../packages/utils/src/message.ts
19
- function b(e) {
19
+ function de(e) {
20
20
  return e ? e.type === "text" : !1;
21
21
  }
22
22
  function x(e) {
23
23
  return e ? e.type.startsWith("tool-") : !1;
24
24
  }
25
- function S(e) {
25
+ function fe(e) {
26
26
  return x(e) ? e.type.slice(5) : "";
27
27
  }
28
- function de(e) {
28
+ function S(e) {
29
29
  return e ? e.type === "file" : !1;
30
30
  }
31
- function C(e) {
32
- if (!de(e)) return;
31
+ function pe(e) {
32
+ if (!S(e)) return;
33
33
  let t = e.providerMetadata?.["8bot"]?.media;
34
34
  return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
35
35
  }
36
- function fe(e) {
37
- if (!de(e)) return;
36
+ function me(e) {
37
+ if (!S(e)) return;
38
38
  let t = e.providerMetadata?.["8bot"]?.transcript;
39
39
  return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
40
40
  }
41
- function pe(e, t) {
41
+ function he(e, t) {
42
42
  return e.map((e) => {
43
43
  let n = t.filter((t) => t.messageId === e.id);
44
44
  return n.length === 0 ? e : {
45
45
  ...e,
46
46
  parts: e.parts.map((e) => {
47
- let t = n.find(({ storedFileName: t }) => t === C(e)?.storedFileName);
48
- return t && de(e) ? {
47
+ let t = n.find(({ storedFileName: t }) => t === pe(e)?.storedFileName);
48
+ return t && S(e) ? {
49
49
  ...e,
50
50
  providerMetadata: {
51
51
  ...e.providerMetadata,
@@ -59,53 +59,53 @@ function pe(e, t) {
59
59
  };
60
60
  });
61
61
  }
62
- function me(e) {
62
+ function ge(e) {
63
63
  return e ? e.type === "reasoning" : !1;
64
64
  }
65
- function he(e) {
66
- return e ? e.parts.some((e) => b(e)) : !1;
65
+ function _e(e) {
66
+ return e ? e.parts.some((e) => de(e)) : !1;
67
67
  }
68
- function ge(e) {
68
+ function ve(e) {
69
69
  if (!e) return;
70
70
  let t = e.parts;
71
- if (Array.isArray(t)) return t.find((e) => b(e))?.text;
71
+ if (Array.isArray(t)) return t.find((e) => de(e))?.text;
72
72
  }
73
73
  //#endregion
74
74
  //#region ../../packages/components/src/chat/utils.ts
75
- function _e(e) {
75
+ function C(e) {
76
76
  let t = [];
77
77
  for (let n of e) {
78
- if (!b(n)) {
78
+ if (!de(n)) {
79
79
  t.push(n);
80
80
  continue;
81
81
  }
82
82
  let e = t[t.length - 1];
83
- e && b(e) ? t[t.length - 1] = {
83
+ e && de(e) ? t[t.length - 1] = {
84
84
  ...e,
85
85
  text: e.text + n.text
86
86
  } : t.push(n);
87
87
  }
88
88
  return t;
89
89
  }
90
- var w = (e) => x(e) && ne(S(e));
91
- function ve(e) {
90
+ var ye = (e) => x(e) && h(fe(e));
91
+ function be(e) {
92
92
  let t = /* @__PURE__ */ new Map();
93
- for (let [n, r] of e.entries()) w(r) && r.state !== "output-error" && !T(r) && t.set(r.type, n);
94
- return e.filter((e, n) => !(w(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
93
+ for (let [n, r] of e.entries()) ye(r) && r.state !== "output-error" && !Oe(r) && t.set(r.type, n);
94
+ return e.filter((e, n) => !(ye(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
95
95
  }
96
- var ye = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
97
- function be(e) {
98
- let t = e.filter((e) => ye.has(e.type));
99
- return t.length > 0 ? [...e.filter((e) => !ye.has(e.type)), ...t] : e;
96
+ var xe = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
97
+ function Se(e) {
98
+ let t = e.filter((e) => xe.has(e.type));
99
+ return t.length > 0 ? [...e.filter((e) => !xe.has(e.type)), ...t] : e;
100
100
  }
101
- function xe(e, t) {
101
+ function Ce(e, t) {
102
102
  let n = e.toolCallId;
103
- return ye.has(e.type) && n ? `file-${n}` : t;
103
+ return xe.has(e.type) && n ? `file-${n}` : t;
104
104
  }
105
- function Se(e) {
105
+ function we(e) {
106
106
  return m(e) ? e : void 0;
107
107
  }
108
- var Ce = {
108
+ var Te = {
109
109
  page_snapshot: {
110
110
  icon: "ri:pages-line",
111
111
  label: "messagePart.pageTool.snapshot"
@@ -126,21 +126,21 @@ var Ce = {
126
126
  icon: "ri:arrow-up-down-line",
127
127
  label: "messagePart.pageTool.scroll"
128
128
  }
129
- }, we = {
129
+ }, Ee = {
130
130
  icon: "ri:survey-line",
131
131
  label: "messagePart.pageTool.form"
132
- }, Te = (e) => e.toolMetadata?.provider === "page" ? Ce[e.toolName] ?? (e.toolName.startsWith("form_") ? we : void 0) : void 0;
133
- function Ee(e) {
134
- return Se(e)?.toolMetadata?.readOnly === !1;
132
+ }, De = (e) => e.toolMetadata?.provider === "page" ? Te[e.toolName] ?? (e.toolName.startsWith("form_") ? Ee : void 0) : void 0;
133
+ function w(e) {
134
+ return we(e)?.toolMetadata?.readOnly === !1;
135
135
  }
136
- function T(e) {
136
+ function Oe(e) {
137
137
  return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
138
138
  }
139
- var De = 4e3, E = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
140
- function Oe(e, t) {
139
+ var T = 4e3, ke = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
140
+ function E(e, t) {
141
141
  if (e.length <= t) return e;
142
142
  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;
143
- for (let t of e.matchAll(E)) {
143
+ for (let t of e.matchAll(ke)) {
144
144
  if (t.index >= a) break;
145
145
  let [, e, n] = t;
146
146
  if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
@@ -151,37 +151,47 @@ function Oe(e, t) {
151
151
  }
152
152
  return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
153
153
  }
154
- var D = /* @__PURE__ */ new Set([
154
+ var Ae = /* @__PURE__ */ new Set([
155
155
  "approval-requested",
156
156
  "approval-responded",
157
157
  "output-denied"
158
158
  ]);
159
- function ke(e) {
160
- return x(e) ? D.has(e.state) ? !0 : e.approval != null : !1;
161
- }
162
- var Ae = "requestConfirm";
163
159
  function je(e) {
160
+ return x(e) ? Ae.has(e.state) ? !0 : e.approval != null : !1;
161
+ }
162
+ var Me = "requestConfirm";
163
+ function Ne(e) {
164
164
  return x(e) && e.type === "tool-requestConfirm";
165
165
  }
166
- function Me(e) {
167
- return ke(e) || je(e);
166
+ function Pe(e) {
167
+ return je(e) || Ne(e);
168
168
  }
169
- function Ne(e) {
169
+ function Fe(e) {
170
170
  if (x(e)) return e.approval?.id;
171
171
  }
172
- function Pe(e) {
172
+ function Ie(e) {
173
173
  if (e && "state" in e) return e.state;
174
174
  }
175
- function Fe(e = "000000") {
175
+ function D(e = "000000") {
176
176
  let t = e.replace("#", "");
177
177
  t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
178
178
  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;
179
179
  return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
180
180
  }
181
- function O(e, t) {
182
- return e === "white" || e === "black" ? e : Fe(t);
181
+ function Le(e) {
182
+ let t = e?.trim().replace("#", "") ?? "";
183
+ if (/^[0-9a-f]{3}$/i.test(t) && (t = t.split("").map((e) => e + e).join("")), !/^[0-9a-f]{6}$/i.test(t)) return !1;
184
+ let n = [
185
+ 0,
186
+ 2,
187
+ 4
188
+ ].map((e) => parseInt(t.substring(e, e + 2), 16));
189
+ return Math.max(...n) - Math.min(...n) < 32;
183
190
  }
184
- function Ie(e, t) {
191
+ function Re(e, t) {
192
+ return e === "white" || e === "black" ? e : D(t);
193
+ }
194
+ function ze(e, t) {
185
195
  if (e) return {
186
196
  "--chatbot-main-color": e,
187
197
  "--chatbot-contrast-color": t,
@@ -190,10 +200,10 @@ function Ie(e, t) {
190
200
  "--input-focus-color": "var(--color-brand-graphic)"
191
201
  };
192
202
  }
193
- function Le(e, t) {
203
+ function Be(e, t) {
194
204
  if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
195
205
  }
196
- function Re(e) {
206
+ function Ve(e) {
197
207
  if (e !== void 0) {
198
208
  if (typeof e == "string") return e.trim() || void 0;
199
209
  try {
@@ -204,10 +214,10 @@ function Re(e) {
204
214
  }
205
215
  }
206
216
  }
207
- function ze(e) {
208
- return Re(e) !== void 0;
217
+ function He(e) {
218
+ return Ve(e) !== void 0;
209
219
  }
210
- function Be(e, t) {
220
+ function Ue(e, t) {
211
221
  let n = e?.input;
212
222
  if (typeof t == "string") {
213
223
  let e = n?.question ?? n?.steps?.[0]?.question;
@@ -219,14 +229,14 @@ function Be(e, t) {
219
229
  return i ? `${i} ${n}` : n;
220
230
  }).join(". ");
221
231
  }
222
- function Ve(e) {
232
+ function We(e) {
223
233
  return e?.options ? e.options.map((e) => ({
224
234
  label: e.label,
225
235
  value: e.label,
226
236
  description: e.description
227
237
  })) : [];
228
238
  }
229
- function He(e, t) {
239
+ function Ge(e, t) {
230
240
  let n = {};
231
241
  if (t == null) return n;
232
242
  if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
@@ -242,12 +252,7 @@ function He(e, t) {
242
252
  for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
243
253
  return n;
244
254
  }
245
- var Ue = [
246
- "tool-perplexity_search",
247
- "tool-parallel_search",
248
- "tool-web_search",
249
- "tool-google_search"
250
- ], We = /* @__PURE__ */ new Set([
255
+ var Ke = ne.map((e) => `tool-${e}`), qe = /* @__PURE__ */ new Set([
251
256
  "tool-searchInKnowledgeBase",
252
257
  "tool-retrieveRevisedAnswers",
253
258
  "tool-expandChunkContext",
@@ -256,60 +261,60 @@ var Ue = [
256
261
  "tool-geocode",
257
262
  "tool-recallUserMemory",
258
263
  "tool-saveUserMemory",
259
- ...Ue
264
+ ...Ke
260
265
  ]);
261
- function Ge(e) {
262
- return x(e) && We.has(e.type);
266
+ function Je(e) {
267
+ return x(e) && qe.has(e.type);
263
268
  }
264
- var Ke = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, k = (e, ...t) => {
269
+ var Ye = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, O = (e, ...t) => {
265
270
  for (let n of t) {
266
271
  let t = e?.[n];
267
272
  if (typeof t == "string" && t.trim()) return t;
268
273
  }
269
274
  };
270
- function qe(e) {
275
+ function Xe(e) {
271
276
  if (!x(e)) return;
272
- let t = Ke("input" in e ? e.input : void 0), n = Ke("output" in e ? e.output : void 0);
273
- if (e.type === "tool-searchInKnowledgeBase" || Ue.includes(e.type)) {
277
+ let t = Ye("input" in e ? e.input : void 0), n = Ye("output" in e ? e.output : void 0);
278
+ if (e.type === "tool-searchInKnowledgeBase" || Ke.includes(e.type)) {
274
279
  let e = t?.queries;
275
280
  if (Array.isArray(e)) {
276
281
  let t = e.filter((e) => typeof e == "string" && !!e.trim());
277
282
  return t.length ? t.join(" · ") : void 0;
278
283
  }
279
- return k(t, "query", "objective");
284
+ return O(t, "query", "objective");
280
285
  }
281
- if (e.type === "tool-retrieveRevisedAnswers") return k(t, "query");
282
- if (e.type === "tool-getWeather") return k(n, "location") ?? k(t, "locationName");
283
- if (e.type === "tool-geocode") return k(t, "locationName");
284
- if (e.type === "tool-expandChunkContext") return k(n, "documentName");
285
- if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment") return k(n, "name");
286
+ if (e.type === "tool-retrieveRevisedAnswers") return O(t, "query");
287
+ if (e.type === "tool-getWeather") return O(n, "location") ?? O(t, "locationName");
288
+ if (e.type === "tool-geocode") return O(t, "locationName");
289
+ if (e.type === "tool-expandChunkContext") return O(n, "documentName");
290
+ if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment") return O(n, "name");
286
291
  if (e.type === "tool-readSpreadsheet") {
287
- let e = k(t, "sheet"), n = k(t, "range");
292
+ let e = O(t, "sheet"), n = O(t, "range");
288
293
  return e && n ? `${e}!${n}` : e;
289
294
  }
290
- if (e.type === "tool-editSpreadsheet") return k(n, "filename");
291
- if (e.type === "tool-querySpreadsheet") return k(n, "file");
292
- if (e.type === "tool-recallUserMemory") return k(t, "query");
293
- if (e.type === "tool-saveUserMemory") return k(t, "content", "query");
295
+ if (e.type === "tool-editSpreadsheet") return O(n, "filename");
296
+ if (e.type === "tool-querySpreadsheet") return O(n, "file");
297
+ if (e.type === "tool-recallUserMemory") return O(t, "query");
298
+ if (e.type === "tool-saveUserMemory") return O(t, "content", "query");
294
299
  }
295
- function Je(e) {
296
- let t = Se(e);
297
- if (t) return Te(t)?.icon ?? "ri:apps-line";
298
- if (x(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-enableTools" ? "ri:toggle-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-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-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-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : 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";
299
- if (me(e)) return "ri:lightbulb-line";
300
- if (b(e)) return "ri:double-quotes-r";
300
+ function Ze(e) {
301
+ let t = we(e);
302
+ if (t) return De(t)?.icon ?? "ri:apps-line";
303
+ if (x(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-enableTools" ? "ri:toggle-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-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-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-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : Ke.includes(e.type) ? "ri:global-line" : "ri:tools-line";
304
+ if (ge(e)) return "ri:lightbulb-line";
305
+ if (de(e)) return "ri:double-quotes-r";
301
306
  }
302
- var Ye = [
307
+ var Qe = [
303
308
  re,
304
309
  ie,
305
310
  te
306
311
  ];
307
- function Xe(e, { t, te: n }) {
312
+ function $e(e, { t, te: n }) {
308
313
  if (n(`agent.tool.${e}`)) return t(`agent.tool.${e}`);
309
- let r = Ye.find((t) => e.startsWith(t)), i = r ? e.slice(r.length) : e;
310
- return g(h(i).trim().toLowerCase());
314
+ let r = Qe.find((t) => e.startsWith(t)), i = r ? e.slice(r.length) : e;
315
+ return _(g(i).trim().toLowerCase());
311
316
  }
312
- var Ze = {
317
+ var et = {
313
318
  custom: (e) => e("messagePart.type.custom"),
314
319
  data: (e) => e("messagePart.type.data"),
315
320
  file: (e) => e("messagePart.type.file"),
@@ -319,13 +324,13 @@ var Ze = {
319
324
  "step-start": (e) => e("messagePart.type.stepStart"),
320
325
  text: (e) => e("messagePart.type.text")
321
326
  };
322
- function Qe(e, t) {
323
- if (x(e)) return Xe(S(e), t);
324
- if (e.type === "dynamic-tool") return Xe(e.toolName, t);
325
- let n = Ze[e.type.startsWith("data-") ? "data" : e.type];
326
- return n ? n(t.t) : g(h(e.type));
327
+ function tt(e, t) {
328
+ if (x(e)) return $e(fe(e), t);
329
+ if (e.type === "dynamic-tool") return $e(e.toolName, t);
330
+ let n = et[e.type.startsWith("data-") ? "data" : e.type];
331
+ return n ? n(t.t) : _(g(e.type));
327
332
  }
328
- function $e(e, t) {
333
+ function nt(e, t) {
329
334
  if (!e) return e;
330
335
  let n = {
331
336
  Intent: t("conversationSummary.intent"),
@@ -335,42 +340,42 @@ function $e(e, t) {
335
340
  };
336
341
  return e.replace(/\*\*(Intent|Topics covered|Key facts|Open questions)(:?)\*\*/g, (e, t, r) => `**${n[t]}${r}**`);
337
342
  }
338
- function et(e, t) {
339
- let n = Se(t);
343
+ function rt(e, t) {
344
+ let n = we(t);
340
345
  if (n) {
341
- let t = Te(n);
346
+ let t = De(n);
342
347
  return t ? e(t.label) : n.title || n.toolName;
343
348
  }
344
- return x(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : 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-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : 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") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : Ue.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : me(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
349
+ return x(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : 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-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : 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") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : Ke.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : ge(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
345
350
  }
346
351
  //#endregion
347
352
  //#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
348
- var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwnPropertyDescriptors, it = Object.getOwnPropertySymbols, A = Object.prototype.hasOwnProperty, at = Object.prototype.propertyIsEnumerable, ot = (e, t, n) => t in e ? tt(e, t, {
353
+ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnPropertyDescriptors, ot = Object.getOwnPropertySymbols, st = Object.prototype.hasOwnProperty, ct = Object.prototype.propertyIsEnumerable, lt = (e, t, n) => t in e ? it(e, t, {
349
354
  enumerable: !0,
350
355
  configurable: !0,
351
356
  writable: !0,
352
357
  value: n
353
- }) : e[t] = n, st = (e, t) => {
354
- for (var n in t ||= {}) A.call(t, n) && ot(e, n, t[n]);
355
- if (it) for (var n of it(t)) at.call(t, n) && ot(e, n, t[n]);
358
+ }) : e[t] = n, ut = (e, t) => {
359
+ for (var n in t ||= {}) st.call(t, n) && lt(e, n, t[n]);
360
+ if (ot) for (var n of ot(t)) ct.call(t, n) && lt(e, n, t[n]);
356
361
  return e;
357
- }, ct = (e, t) => nt(e, rt(t)), j = {
362
+ }, dt = (e, t) => at(e, k(t)), A = {
358
363
  PROSE: 0,
359
364
  FENCE_MARKER: 1,
360
365
  FENCE_INFO: 2,
361
366
  FENCE_BODY: 3,
362
367
  CODE_SPAN: 4,
363
368
  CODE_SPAN_OPEN: 5
364
- }, lt = /^(`{3,}|~{3,})(.*)$/, ut = (e) => e !== void 0 && e >= "0" && e <= "9", dt = (e, t) => {
369
+ }, ft = /^(`{3,}|~{3,})(.*)$/, pt = (e) => e !== void 0 && e >= "0" && e <= "9", mt = (e, t) => {
365
370
  let n = t;
366
371
  if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
367
372
  else {
368
- for (; ut(e[n]) && n - t < 9;) n += 1;
373
+ for (; pt(e[n]) && n - t < 9;) n += 1;
369
374
  if (n === t || e[n] !== "." && e[n] !== ")") return -1;
370
375
  n += 1;
371
376
  }
372
377
  return e[n] === " " ? n + 1 : -1;
373
- }, ft = (e, t, n) => {
378
+ }, ht = (e, t, n) => {
374
379
  let r = 0, i = t, a = !1, o = t;
375
380
  for (;;) {
376
381
  for (; o < n && e[o] === " ";) o += 1;
@@ -378,7 +383,7 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
378
383
  r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
379
384
  continue;
380
385
  }
381
- let t = o < n ? dt(e, o) : -1;
386
+ let t = o < n ? mt(e, o) : -1;
382
387
  if (t === -1) return {
383
388
  contentStart: o,
384
389
  listIndent: a ? o - i : 0,
@@ -386,7 +391,7 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
386
391
  };
387
392
  o = t, a = !0;
388
393
  }
389
- }, pt = (e, t, n, r) => {
394
+ }, j = (e, t, n, r) => {
390
395
  let i = t;
391
396
  for (let t = 0; t < r; t += 1) {
392
397
  for (; i < n && e[i] === " ";) i += 1;
@@ -394,10 +399,10 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
394
399
  i += 1, e[i] === " " && (i += 1);
395
400
  }
396
401
  return i;
397
- }, mt = (e, t, n, r, i) => {
402
+ }, gt = (e, t, n, r, i) => {
398
403
  let a = t + r;
399
- e.fill(j.FENCE_MARKER, a, a + i), e.fill(j.FENCE_INFO, a + i, Math.min(n + 1, e.length));
400
- }, M = (e, t, n, r) => {
404
+ e.fill(A.FENCE_MARKER, a, a + i), e.fill(A.FENCE_INFO, a + i, Math.min(n + 1, e.length));
405
+ }, _t = (e, t, n, r) => {
401
406
  let i = t;
402
407
  for (; i < n && e[i] === " ";) i += 1;
403
408
  let a = 0;
@@ -408,62 +413,62 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
408
413
  i += 1;
409
414
  }
410
415
  return !0;
411
- }, ht = (e, t, n, r) => {
412
- let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = ft(e, n, i), o = e.slice(a.contentStart, i).match(lt);
416
+ }, vt = (e, t, n, r) => {
417
+ let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = ht(e, n, i), o = e.slice(a.contentStart, i).match(ft);
413
418
  if (!o) return null;
414
419
  let [, s, c] = o, l = s[0];
415
- return l === "`" && c.includes("`") ? null : (mt(t, n, r, a.contentStart - n, s.length), {
420
+ return l === "`" && c.includes("`") ? null : (gt(t, n, r, a.contentStart - n, s.length), {
416
421
  char: l,
417
422
  length: s.length,
418
423
  listIndent: a.listIndent,
419
424
  quoteDepth: a.quoteDepth
420
425
  });
421
- }, gt = (e, t, n, r) => {
422
- let i = pt(e, t, n, r.quoteDepth);
426
+ }, yt = (e, t, n, r) => {
427
+ let i = j(e, t, n, r.quoteDepth);
423
428
  if (i === -1 || r.listIndent === 0) return i;
424
429
  let a = i;
425
430
  for (; a < n && e[a] === " ";) a += 1;
426
431
  return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
427
- }, _t = (e, t) => {
432
+ }, bt = (e, t) => {
428
433
  let n = e.length, r = null, i = 0;
429
434
  for (; i < n;) {
430
435
  let a = e.indexOf("\n", i);
431
436
  a === -1 && (a = n);
432
- let o = r ? gt(e, i, a, r) : -1;
433
- r && o === -1 && (r = null), r ? M(e, o, a, r) ? (t.fill(j.FENCE_MARKER, i, a), r = null) : t.fill(j.FENCE_BODY, i, Math.min(a + 1, n)) : r = ht(e, t, i, a), i = a + 1;
437
+ let o = r ? yt(e, i, a, r) : -1;
438
+ r && o === -1 && (r = null), r ? _t(e, o, a, r) ? (t.fill(A.FENCE_MARKER, i, a), r = null) : t.fill(A.FENCE_BODY, i, Math.min(a + 1, n)) : r = vt(e, t, i, a), i = a + 1;
434
439
  }
435
440
  return r;
436
- }, vt = (e, t) => {
441
+ }, xt = (e, t) => {
437
442
  let n = t + 1;
438
443
  for (; n < e.length && e[n] === "`";) n += 1;
439
444
  return n;
440
- }, yt = (e, t) => {
445
+ }, St = (e, t) => {
441
446
  let n = t + 1;
442
447
  for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
443
448
  return n < e.length && e[n] === "\n";
444
- }, bt = (e, t, n) => {
449
+ }, Ct = (e, t, n) => {
445
450
  let r = n;
446
451
  for (;;) {
447
452
  let n = e.indexOf("`", r);
448
453
  if (n === -1) return -1;
449
- let i = n > r && e[n - 1] === "\\" && t[n - 1] === j.PROSE;
450
- if (t[n] === j.PROSE && !i) return n;
454
+ let i = n > r && e[n - 1] === "\\" && t[n - 1] === A.PROSE;
455
+ if (t[n] === A.PROSE && !i) return n;
451
456
  r = n + 1;
452
457
  }
453
- }, xt = (e, t) => {
458
+ }, wt = (e, t) => {
454
459
  let n = e.length, r = -1, i = 0, a = 0;
455
460
  for (; a < n;) {
456
461
  if (r < 0) {
457
- if (a = bt(e, t, a), a === -1) break;
458
- let n = vt(e, a);
462
+ if (a = Ct(e, t, a), a === -1) break;
463
+ let n = xt(e, a);
459
464
  r = a, i = n - a, a = n;
460
465
  continue;
461
466
  }
462
- if (t[a] !== j.PROSE) {
463
- t.fill(j.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
467
+ if (t[a] !== A.PROSE) {
468
+ t.fill(A.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
464
469
  continue;
465
470
  }
466
- if (e[a] === "\n" && yt(e, a)) {
471
+ if (e[a] === "\n" && St(e, a)) {
467
472
  r = -1, a += 1;
468
473
  continue;
469
474
  }
@@ -471,79 +476,79 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
471
476
  a += 1;
472
477
  continue;
473
478
  }
474
- let n = vt(e, a);
475
- n - a === i && (t.fill(j.CODE_SPAN, r, n), r = -1), a = n;
479
+ let n = xt(e, a);
480
+ n - a === i && (t.fill(A.CODE_SPAN, r, n), r = -1), a = n;
476
481
  }
477
- return r >= 0 ? (t.fill(j.CODE_SPAN_OPEN, r, n), {
482
+ return r >= 0 ? (t.fill(A.CODE_SPAN_OPEN, r, n), {
478
483
  start: r,
479
484
  runLength: i
480
485
  }) : null;
481
- }, St = (e) => {
486
+ }, Tt = (e) => {
482
487
  let t = new Uint8Array(e.length);
483
488
  return {
484
489
  text: e,
485
490
  regions: t,
486
- openFence: _t(e, t),
487
- openSpan: xt(e, t),
491
+ openFence: bt(e, t),
492
+ openSpan: wt(e, t),
488
493
  mathMask: null,
489
494
  linkUrlMask: null,
490
495
  htmlTagMask: null
491
496
  };
492
- }, Ct = null, wt = null, N = (e) => {
493
- if (wt !== null && e === Ct) return wt;
494
- let t = St(e);
495
- return Ct = e, wt = t, t;
496
- }, Tt = () => {
497
- Ct = null, wt = null;
498
- }, Et = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== j.PROSE, Dt = (e, t) => e.regions[t] === j.CODE_SPAN, Ot = (e, t) => {
497
+ }, M = null, Et = null, N = (e) => {
498
+ if (Et !== null && e === M) return Et;
499
+ let t = Tt(e);
500
+ return M = e, Et = t, t;
501
+ }, Dt = () => {
502
+ M = null, Et = null;
503
+ }, Ot = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== A.PROSE, kt = (e, t) => e.regions[t] === A.CODE_SPAN, At = (e, t) => {
499
504
  let n = N(e), r = t + t, i = 0;
500
- for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === j.PROSE ? (i += 1, t += 2) : t += 1;
505
+ for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === A.PROSE ? (i += 1, t += 2) : t += 1;
501
506
  return i;
502
- }, kt = /* @__PURE__ */ new Uint8Array(), At = (e) => e === "inlineLatex" || e === "blockLatex", jt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Mt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Nt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Pt = (e, t, n) => {
507
+ }, jt = /* @__PURE__ */ new Uint8Array(), Mt = (e) => e === "inlineLatex" || e === "blockLatex", Nt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Pt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Ft = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), It = (e, t, n) => {
503
508
  let r = e[t + 1];
504
509
  if (e[t] === "\\") {
505
510
  if (r === "$") return {
506
511
  context: n,
507
512
  length: 2
508
513
  };
509
- let e = jt(n, r);
514
+ let e = Nt(n, r);
510
515
  return e === null ? null : {
511
516
  context: e,
512
517
  length: 2
513
518
  };
514
519
  }
515
- if (e[t] === "$" && !At(n)) {
520
+ if (e[t] === "$" && !Mt(n)) {
516
521
  let e = r === "$";
517
522
  return {
518
- context: Mt(n, e),
523
+ context: Pt(n, e),
519
524
  length: e ? 2 : 1
520
525
  };
521
526
  }
522
527
  return null;
523
- }, Ft = (e) => {
528
+ }, Lt = (e) => {
524
529
  let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
525
530
  for (; o < r;) {
526
531
  i[o] = a === "none" ? 0 : 1;
527
- let e = n[o] === j.PROSE ? Pt(t, o, a) : null;
532
+ let e = n[o] === A.PROSE ? It(t, o, a) : null;
528
533
  e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
529
534
  }
530
535
  return i;
531
- }, It = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Nt(e.text) ? Ft(e) : kt), e.mathMask[t] === 1), Lt = (e, t, n, r) => {
536
+ }, Rt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Ft(e.text) ? Lt(e) : jt), e.mathMask[t] === 1), zt = (e, t, n, r) => {
532
537
  let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
533
- for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === j.PROSE && (s = 1), o[e - t] = s;
538
+ for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === A.PROSE && (s = 1), o[e - t] = s;
534
539
  let c = !1;
535
- for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === j.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
536
- }, Rt = (e) => {
540
+ for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === A.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
541
+ }, Bt = (e) => {
537
542
  let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
538
543
  for (; i < n;) {
539
544
  let a = t.indexOf("\n", i);
540
- a === -1 && (a = n), Lt(e, i, a, r), i = a + 1;
545
+ a === -1 && (a = n), zt(e, i, a, r), i = a + 1;
541
546
  }
542
547
  return r;
543
- }, zt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? Rt(e) : kt), e.linkUrlMask[t] === 1), Bt = (e) => {
548
+ }, Vt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? Bt(e) : jt), e.linkUrlMask[t] === 1), Ht = (e) => {
544
549
  let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
545
550
  for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
546
- else if (i[e] = +!!a, n[e] === j.PROSE) {
551
+ else if (i[e] = +!!a, n[e] === A.PROSE) {
547
552
  if (t[e] === ">") a = !1;
548
553
  else if (t[e] === "<") {
549
554
  let n = t[e + 1];
@@ -551,56 +556,56 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
551
556
  }
552
557
  }
553
558
  return i;
554
- }, Vt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Bt(e) : kt), e.htmlTagMask[t] === 1), P = (e, t) => Et(N(e), t), Ht = (e, t) => Dt(N(e), t), Ut = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, Wt = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ut, (t, n, r, i) => P(e, i) ? t : `${n}\\>${r}`), F = (e, { delimiter: t, markerLength: n, regex: r }) => {
559
+ }, Ut = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Ht(e) : jt), e.htmlTagMask[t] === 1), P = (e, t) => Ot(N(e), t), F = (e, t) => kt(N(e), t), Wt = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, I = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Wt, (t, n, r, i) => P(e, i) ? t : `${n}\\>${r}`), Gt = (e, { delimiter: t, markerLength: n, regex: r }) => {
555
560
  let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
556
561
  return e.slice(Math.max(0, a - n + 1)).match(r);
557
- }, I = {
562
+ }, Kt = {
558
563
  delimiter: "*",
559
564
  markerLength: 2,
560
565
  regex: /(\*\*)([^*]*\*?)$/
561
- }, Gt = {
566
+ }, qt = {
562
567
  delimiter: "_",
563
568
  markerLength: 2,
564
569
  regex: /(__)([^_]*?)$/
565
- }, Kt = {
570
+ }, Jt = {
566
571
  delimiter: "*",
567
572
  markerLength: 3,
568
573
  regex: /(\*\*\*)([^*]*?)$/
569
- }, qt = {
574
+ }, Yt = {
570
575
  delimiter: "*",
571
576
  markerLength: 1,
572
577
  regex: /(\*)([^*]*?)$/
573
- }, Jt = {
578
+ }, Xt = {
574
579
  delimiter: "_",
575
580
  markerLength: 1,
576
581
  regex: /(_)([^_]*?)$/
577
- }, Yt = {
582
+ }, Zt = {
578
583
  delimiter: "~",
579
584
  markerLength: 2,
580
585
  regex: /(~~)([^~]*?)$/
581
- }, Xt = {
586
+ }, Qt = {
582
587
  delimiter: "_",
583
588
  markerLength: 2,
584
589
  regex: /(__)([^_]+)_$/
585
- }, Zt = {
590
+ }, $t = {
586
591
  delimiter: "~",
587
592
  markerLength: 2,
588
593
  regex: /(~~)([^~]+)~$/
589
- }, Qt = /^[\s_~*`]*$/, $t = /^[\s]*[-*+][\s]+$/, en = /[\p{L}\p{N}_]/u, tn = /^\*{4,}$/, L = (e) => {
594
+ }, en = /^[\s_~*`]*$/, tn = /^[\s]*[-*+][\s]+$/, nn = /[\p{L}\p{N}_]/u, rn = /^\*{4,}$/, L = (e) => {
590
595
  if (!e) return !1;
591
596
  let t = e.charCodeAt(0);
592
- return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || en.test(e);
593
- }, nn = (e, t) => {
597
+ return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || nn.test(e);
598
+ }, an = (e, t) => {
594
599
  let n = 1;
595
600
  for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
596
601
  else if (e[r] === "[" && (--n, n === 0)) return r;
597
602
  return -1;
598
- }, rn = (e, t) => {
603
+ }, on = (e, t) => {
599
604
  let n = 1;
600
605
  for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
601
606
  else if (e[r] === "]" && (--n, n === 0)) return r;
602
607
  return -1;
603
- }, an = (e, t) => It(N(e), t), on = (e, t, n) => {
608
+ }, sn = (e, t) => Rt(N(e), t), cn = (e, t, n) => {
604
609
  let r = 0;
605
610
  for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
606
611
  r = n + 1;
@@ -618,184 +623,184 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
618
623
  break;
619
624
  }
620
625
  return o >= 3 && !s;
621
- }, sn = (e, t, n, r) => n === "\\" || It(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), cn = (e) => e === " " || e === " " || e === "\n", ln = (e, t) => !!(e && t && L(e) && L(t)), un = (e, t, n, r) => {
622
- let i = ln(e, t), a = !!t && !cn(t), o = !!e && !cn(e);
626
+ }, ln = (e, t, n, r) => n === "\\" || Rt(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), un = (e) => e === " " || e === " " || e === "\n", dn = (e, t) => !!(e && t && L(e) && L(t)), fn = (e, t, n, r) => {
627
+ let i = dn(e, t), a = !!t && !un(t), o = !!e && !un(e);
623
628
  return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
624
629
  count: !0,
625
630
  inWordAsteriskChain: i
626
631
  } : { count: !1 };
627
- }, dn = (e) => {
632
+ }, pn = (e) => {
628
633
  let t = N(e), n = 0, r = !1, i = e.length;
629
634
  for (let a = 0; a < i; a += 1) {
630
- if (e[a] !== "*" || t.regions[a] !== j.PROSE) {
635
+ if (e[a] !== "*" || t.regions[a] !== A.PROSE) {
631
636
  L(e[a]) || (r = !1);
632
637
  continue;
633
638
  }
634
639
  let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
635
- if (sn(t, a, o, s)) continue;
636
- let c = un(o, s, n, r);
640
+ if (ln(t, a, o, s)) continue;
641
+ let c = fn(o, s, n, r);
637
642
  c.count && (n += 1, r = c.inWordAsteriskChain);
638
643
  }
639
644
  return n;
640
- }, fn = (e, t, n, r) => !!(n === "\\" || It(e, t) || zt(e, t) || Vt(e, t) || n === "_" || r === "_" || n && r && L(n) && L(r)), pn = (e) => {
645
+ }, mn = (e, t, n, r) => !!(n === "\\" || Rt(e, t) || Vt(e, t) || Ut(e, t) || n === "_" || r === "_" || n && r && L(n) && L(r)), hn = (e) => {
641
646
  let t = N(e), n = 0, r = e.length;
642
647
  for (let i = 0; i < r; i += 1) {
643
- if (e[i] !== "_" || t.regions[i] !== j.PROSE) continue;
648
+ if (e[i] !== "_" || t.regions[i] !== A.PROSE) continue;
644
649
  let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
645
- fn(t, i, a, o) || (n += 1);
650
+ mn(t, i, a, o) || (n += 1);
646
651
  }
647
652
  return n;
648
- }, mn = (e) => {
653
+ }, gn = (e) => {
649
654
  let t = N(e), n = 0, r = 0;
650
- for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === j.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
655
+ for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === A.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
651
656
  return r >= 3 && (n += Math.floor(r / 3)), n;
652
- }, hn = (e) => Ot(e, "*"), gn = (e) => e === "" || e === " " || e === " " || e === "\n", _n = (e, t, n, r, i) => {
653
- if (!(gn(n) && gn(r))) return !1;
657
+ }, _n = (e) => At(e, "*"), vn = (e) => e === "" || e === " " || e === " " || e === "\n", yn = (e, t, n, r, i) => {
658
+ if (!(vn(n) && vn(r))) return !1;
654
659
  if (t > i.lineEnd) {
655
660
  let n = e.indexOf("\n", t);
656
- i.lineEnd = n === -1 ? e.length : n, i.result = on(e, t, "_");
661
+ i.lineEnd = n === -1 ? e.length : n, i.result = cn(e, t, "_");
657
662
  }
658
663
  return i.result;
659
- }, vn = (e, t, n, r) => {
664
+ }, bn = (e, t, n, r) => {
660
665
  let i = e.text, a = t, o = !1;
661
666
  a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
662
667
  let s = n - a;
663
668
  if (s < 2) return !1;
664
669
  let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
665
- return L(l) && L(u) || _n(i, a, l, u, r) || It(e, a) || zt(e, a) || Vt(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
666
- }, yn = (e) => {
670
+ return L(l) && L(u) || yn(i, a, l, u, r) || Rt(e, a) || Vt(e, a) || Ut(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
671
+ }, xn = (e) => {
667
672
  let t = N(e), n = e.length, r = {
668
673
  lineEnd: -1,
669
674
  result: !1
670
675
  }, i = !1, a = 0;
671
676
  for (; a < n;) {
672
- if (e[a] !== "_" || t.regions[a] !== j.PROSE) {
677
+ if (e[a] !== "_" || t.regions[a] !== A.PROSE) {
673
678
  a += 1;
674
679
  continue;
675
680
  }
676
681
  let o = a, s = a + 1;
677
- for (; s < n && e[s] === "_" && t.regions[s] === j.PROSE;) s += 1;
678
- a = s, vn(t, o, s, r) && (i = !i);
682
+ for (; s < n && e[s] === "_" && t.regions[s] === A.PROSE;) s += 1;
683
+ a = s, bn(t, o, s, r) && (i = !i);
679
684
  }
680
685
  return i;
681
- }, bn = (e, t, n) => {
682
- if (!t || Qt.test(t)) return !0;
686
+ }, Sn = (e, t, n) => {
687
+ if (!t || en.test(t)) return !0;
683
688
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
684
- return $t.test(a) && t.includes("\n") ? !0 : on(e, n, "*");
685
- }, xn = (e) => {
686
- let t = F(e, I);
689
+ return tn.test(a) && t.includes("\n") ? !0 : cn(e, n, "*");
690
+ }, Cn = (e) => {
691
+ let t = Gt(e, Kt);
687
692
  if (!t) return e;
688
693
  let n = t[2], r = e.lastIndexOf(t[1]);
689
- return P(e, r) || Ht(e, r) || bn(e, n, r) ? e : hn(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
690
- }, Sn = (e, t, n) => {
691
- if (!t || Qt.test(t)) return !0;
694
+ return P(e, r) || F(e, r) || Sn(e, n, r) ? e : _n(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
695
+ }, wn = (e, t, n) => {
696
+ if (!t || en.test(t)) return !0;
692
697
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
693
- return $t.test(a) && t.includes("\n") ? !0 : on(e, n, "_");
694
- }, Cn = (e) => {
695
- let t = F(e, Gt);
698
+ return tn.test(a) && t.includes("\n") ? !0 : cn(e, n, "_");
699
+ }, Tn = (e) => {
700
+ let t = Gt(e, qt);
696
701
  if (!t) {
697
- let t = F(e, Xt);
702
+ let t = Gt(e, Qt);
698
703
  if (t) {
699
704
  let n = e.lastIndexOf(t[1]);
700
- if (!(P(e, n) || Ht(e, n)) && yn(e)) return `${e}_`;
705
+ if (!(P(e, n) || F(e, n)) && xn(e)) return `${e}_`;
701
706
  }
702
707
  return e;
703
708
  }
704
709
  let n = t[2], r = e.lastIndexOf(t[1]);
705
- return P(e, r) || Ht(e, r) || Sn(e, n, r) ? e : yn(e) ? `${e}__` : e;
706
- }, wn = (e, t) => {
710
+ return P(e, r) || F(e, r) || wn(e, n, r) ? e : xn(e) ? `${e}__` : e;
711
+ }, En = (e, t) => {
707
712
  let { text: n } = e;
708
- return n[t] === "*" && e.regions[t] === j.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !It(e, t);
709
- }, Tn = (e) => {
713
+ return n[t] === "*" && e.regions[t] === A.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !Rt(e, t);
714
+ }, Dn = (e) => {
710
715
  let t = N(e);
711
716
  for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
712
- if (!wn(t, n)) continue;
713
- let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || cn(r), o = !i || cn(i);
717
+ if (!En(t, n)) continue;
718
+ let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || un(r), o = !i || un(i);
714
719
  if (!(a && o) && !(r && i && L(r) && L(i)) && !o) return n;
715
720
  }
716
721
  return -1;
717
- }, En = (e) => {
718
- if (!F(e, qt)) return e;
719
- let t = Tn(e);
720
- if (t === -1 || P(e, t) || Ht(e, t)) return e;
722
+ }, On = (e) => {
723
+ if (!Gt(e, Yt)) return e;
724
+ let t = Dn(e);
725
+ if (t === -1 || P(e, t) || F(e, t)) return e;
721
726
  let n = e.substring(t + 1);
722
- return !n || Qt.test(n) ? e : dn(e) % 2 == 1 ? `${e}*` : e;
723
- }, Dn = (e) => {
727
+ return !n || en.test(n) ? e : pn(e) % 2 == 1 ? `${e}*` : e;
728
+ }, kn = (e) => {
724
729
  let t = N(e);
725
- for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === j.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !It(t, n) && !zt(t, n)) {
730
+ for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === A.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !Rt(t, n) && !Vt(t, n)) {
726
731
  let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
727
732
  if (t && r && L(t) && L(r)) continue;
728
733
  return n;
729
734
  }
730
735
  return -1;
731
- }, On = (e) => {
736
+ }, An = (e) => {
732
737
  let t = e.length;
733
738
  for (; t > 0 && e[t - 1] === "\n";) --t;
734
739
  return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
735
- }, kn = (e) => {
740
+ }, jn = (e) => {
736
741
  if (!e.endsWith("**")) return null;
737
742
  let t = e.slice(0, -2);
738
- if (hn(t) % 2 != 1) return null;
739
- let n = t.indexOf("**"), r = Dn(t);
743
+ if (_n(t) % 2 != 1) return null;
744
+ let n = t.indexOf("**"), r = kn(t);
740
745
  return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
741
- }, An = (e) => {
742
- if (!F(e, Jt)) return e;
743
- let t = Dn(e);
746
+ }, Mn = (e) => {
747
+ if (!Gt(e, Xt)) return e;
748
+ let t = kn(e);
744
749
  if (t === -1) return e;
745
750
  let n = e.substring(t + 1);
746
- if (!n || Qt.test(n) || P(e, t) || Ht(e, t)) return e;
747
- if (pn(e) % 2 == 1) {
748
- let t = kn(e);
749
- return t === null ? On(e) : t;
751
+ if (!n || en.test(n) || P(e, t) || F(e, t)) return e;
752
+ if (hn(e) % 2 == 1) {
753
+ let t = jn(e);
754
+ return t === null ? An(e) : t;
750
755
  }
751
756
  return e;
752
- }, jn = (e) => {
753
- let t = hn(e), n = dn(e);
757
+ }, Nn = (e) => {
758
+ let t = _n(e), n = pn(e);
754
759
  return t % 2 == 0 && n % 2 == 0;
755
- }, Mn = (e, t, n) => !t || Qt.test(t) || P(e, n) || Ht(e, n) ? !0 : on(e, n, "*"), Nn = (e) => {
756
- if (tn.test(e)) return e;
757
- let t = F(e, Kt);
760
+ }, Pn = (e, t, n) => !t || en.test(t) || P(e, n) || F(e, n) ? !0 : cn(e, n, "*"), Fn = (e) => {
761
+ if (rn.test(e)) return e;
762
+ let t = Gt(e, Jt);
758
763
  if (!t) return e;
759
764
  let n = t[2];
760
- return Mn(e, n, e.lastIndexOf(t[1])) ? e : mn(e) % 2 == 1 ? jn(e) ? e : `${e}***` : e;
761
- }, Pn = /<[a-zA-Z/][^>]*$/, Fn = /[a-zA-Z/]/, In = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ln = (e, t) => {
765
+ return Pn(e, n, e.lastIndexOf(t[1])) ? e : gn(e) % 2 == 1 ? Nn(e) ? e : `${e}***` : e;
766
+ }, In = /<[a-zA-Z/][^>]*$/, Ln = /[a-zA-Z/]/, Rn = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), zn = (e, t) => {
762
767
  let n = e[t + 1];
763
- return n !== void 0 && Fn.test(n);
764
- }, Rn = (e) => {
765
- let t = e.match(Pn);
768
+ return n !== void 0 && Ln.test(n);
769
+ }, Bn = (e) => {
770
+ let t = e.match(In);
766
771
  if (!t || t.index === void 0) return e;
767
- let n = In(e);
768
- for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && Ln(e, r) && !P(e, r) && !(n && an(e, r))) return e.substring(0, r).trimEnd();
772
+ let n = Rn(e);
773
+ for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && zn(e, r) && !P(e, r) && !(n && sn(e, r))) return e.substring(0, r).trimEnd();
769
774
  return e;
770
- }, zn = (e) => {
775
+ }, Vn = (e) => {
771
776
  let t = N(e);
772
777
  if (t.openFence) return e;
773
778
  let n = t.openSpan;
774
779
  if (!n) return e;
775
780
  let r = e.slice(n.start + n.runLength);
776
- if (!r || Qt.test(r)) return e;
781
+ if (!r || en.test(r)) return e;
777
782
  let i = 0, a = e.length - 1;
778
783
  for (; a >= 0 && e[a] === "`";) i += 1, --a;
779
784
  return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
780
- }, Bn = (e) => Ot(e, "$"), Vn = (e) => {
785
+ }, Hn = (e) => At(e, "$"), Un = (e) => {
781
786
  let t = N(e), n = 0;
782
- for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === j.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
787
+ for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === A.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
783
788
  return n;
784
- }, Hn = (e) => {
789
+ }, Wn = (e) => {
785
790
  if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
786
791
  let t = e.indexOf("$$");
787
792
  return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
788
793
  $$` : `${e}$$`;
789
- }, Un = (e) => Bn(e) % 2 == 0 ? e : Hn(e), Wn = (e) => Vn(e) % 2 == 1 ? `${e}$` : e, Gn = "streamdown:incomplete-image", Kn = (e, t, n) => {
794
+ }, Gn = (e) => Hn(e) % 2 == 0 ? e : Wn(e), Kn = (e) => Un(e) % 2 == 1 ? `${e}$` : e, qn = "streamdown:incomplete-image", Jn = (e, t, n) => {
790
795
  if (e.substring(t + 2).includes(")")) return null;
791
- let r = nn(e, t);
796
+ let r = an(e, t);
792
797
  if (r === -1 || P(e, r)) return null;
793
798
  let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
794
- return i ? `${o}![${s}](${Gn})` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
795
- }, qn = (e, t) => {
799
+ return i ? `${o}![${s}](${qn})` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
800
+ }, Yn = (e, t) => {
796
801
  for (let n = 0; n < t; n++) if (e[n] === "[" && !P(e, n)) {
797
802
  if (n > 0 && e[n - 1] === "!") continue;
798
- let t = rn(e, n);
803
+ let t = on(e, n);
799
804
  if (t === -1) return n;
800
805
  if (t + 1 < e.length && e[t + 1] === "(") {
801
806
  let r = e.indexOf(")", t + 2);
@@ -803,69 +808,69 @@ $$` : `${e}$$`;
803
808
  }
804
809
  }
805
810
  return t;
806
- }, Jn = (e, t, n) => {
811
+ }, Xn = (e, t, n) => {
807
812
  let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
808
- if (!e.substring(t + 1).includes("]") || rn(e, t) === -1) {
813
+ if (!e.substring(t + 1).includes("]") || on(e, t) === -1) {
809
814
  let a = e.substring(0, i);
810
- if (r) return `${a}![${e.substring(t + 1)}](${Gn})`;
815
+ if (r) return `${a}![${e.substring(t + 1)}](${qn})`;
811
816
  if (n === "text-only") {
812
- let n = qn(e, t);
817
+ let n = Yn(e, t);
813
818
  return e.substring(0, n) + e.substring(n + 1);
814
819
  }
815
820
  return `${e}](streamdown:incomplete-link)`;
816
821
  }
817
822
  return null;
818
- }, Yn = (e, t) => {
823
+ }, Zn = (e, t) => {
819
824
  let n = e.lastIndexOf("](");
820
825
  if (n !== -1 && !P(e, n)) {
821
- let r = Kn(e, n, t);
826
+ let r = Jn(e, n, t);
822
827
  if (r !== null) return r;
823
828
  }
824
829
  for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!P(e, n)) {
825
- let r = Jn(e, n, t);
830
+ let r = Xn(e, n, t);
826
831
  if (r !== null) return r;
827
832
  }
828
833
  return e;
829
- }, Xn = 32, Zn = (e, t = "protocol") => {
834
+ }, Qn = 32, $n = (e, t = "protocol") => {
830
835
  let n = e;
831
- for (let e = 0; e < Xn; e += 1) {
832
- let e = Yn(n, t);
836
+ for (let e = 0; e < Qn; e += 1) {
837
+ let e = Zn(n, t);
833
838
  if (e.length >= n.length) return e;
834
839
  n = e;
835
840
  }
836
841
  return n;
837
- }, Qn = /^-{1,2}$/, $n = /^[\s]*-{1,2}[\s]+$/, er = /^={1,2}$/, tr = /^[\s]*={1,2}[\s]+$/, nr = (e) => {
842
+ }, er = /^-{1,2}$/, tr = /^[\s]*-{1,2}[\s]+$/, nr = /^={1,2}$/, rr = /^[\s]*={1,2}[\s]+$/, ir = (e) => {
838
843
  if (!e || typeof e != "string") return e;
839
844
  let t = e.lastIndexOf("\n");
840
845
  if (t === -1) return e;
841
846
  let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
842
- if (Qn.test(i) && !n.match($n)) {
847
+ if (er.test(i) && !n.match(tr)) {
843
848
  let t = r.split("\n").at(-1);
844
849
  if (t && t.trim().length > 0) return `${e}\u200B`;
845
850
  }
846
- if (er.test(i) && !n.match(tr)) {
851
+ if (nr.test(i) && !n.match(rr)) {
847
852
  let t = r.split("\n").at(-1);
848
853
  if (t && t.trim().length > 0) return `${e}\u200B`;
849
854
  }
850
855
  return e;
851
- }, rr = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, ir = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(rr, (t, n, r) => P(e, r + n.length) ? t : `${n}\\~`), ar = (e) => Ot(e, "~"), or = (e) => {
852
- let t = F(e, Yt);
856
+ }, ar = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, or = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(ar, (t, n, r) => P(e, r + n.length) ? t : `${n}\\~`), sr = (e) => At(e, "~"), cr = (e) => {
857
+ let t = Gt(e, Zt);
853
858
  if (t) {
854
859
  let n = t[2];
855
- if (!n || Qt.test(n)) return e;
860
+ if (!n || en.test(n)) return e;
856
861
  let r = e.lastIndexOf(t[1]);
857
- if (P(e, r) || Ht(e, r)) return e;
858
- if (ar(e) % 2 == 1) return `${e}~~`;
862
+ if (P(e, r) || F(e, r)) return e;
863
+ if (sr(e) % 2 == 1) return `${e}~~`;
859
864
  } else {
860
- let t = F(e, Zt);
865
+ let t = Gt(e, $t);
861
866
  if (t) {
862
867
  let n = e.lastIndexOf(t[0].slice(0, 2));
863
- if (P(e, n) || Ht(e, n)) return e;
864
- if (ar(e) % 2 == 1) return `${e}~`;
868
+ if (P(e, n) || F(e, n)) return e;
869
+ if (sr(e) % 2 == 1) return `${e}~`;
865
870
  }
866
871
  }
867
872
  return e;
868
- }, sr = (e) => e !== !1, cr = (e) => e === !0, R = {
873
+ }, lr = (e) => e !== !1, ur = (e) => e === !0, R = {
869
874
  SINGLE_TILDE: 0,
870
875
  COMPARISON_OPERATORS: 5,
871
876
  HTML_TAGS: 10,
@@ -881,11 +886,11 @@ $$` : `${e}$$`;
881
886
  KATEX: 70,
882
887
  INLINE_KATEX: 75,
883
888
  DEFAULT: 100
884
- }, lr = [
889
+ }, dr = [
885
890
  {
886
891
  handler: {
887
892
  name: "singleTilde",
888
- handle: ir,
893
+ handle: or,
889
894
  priority: R.SINGLE_TILDE
890
895
  },
891
896
  optionKey: "singleTilde"
@@ -893,7 +898,7 @@ $$` : `${e}$$`;
893
898
  {
894
899
  handler: {
895
900
  name: "comparisonOperators",
896
- handle: Wt,
901
+ handle: I,
897
902
  priority: R.COMPARISON_OPERATORS
898
903
  },
899
904
  optionKey: "comparisonOperators"
@@ -901,7 +906,7 @@ $$` : `${e}$$`;
901
906
  {
902
907
  handler: {
903
908
  name: "htmlTags",
904
- handle: Rn,
909
+ handle: Bn,
905
910
  priority: R.HTML_TAGS
906
911
  },
907
912
  optionKey: "htmlTags"
@@ -909,7 +914,7 @@ $$` : `${e}$$`;
909
914
  {
910
915
  handler: {
911
916
  name: "setextHeadings",
912
- handle: nr,
917
+ handle: ir,
913
918
  priority: R.SETEXT_HEADINGS
914
919
  },
915
920
  optionKey: "setextHeadings"
@@ -917,7 +922,7 @@ $$` : `${e}$$`;
917
922
  {
918
923
  handler: {
919
924
  name: "links",
920
- handle: Zn,
925
+ handle: $n,
921
926
  priority: R.LINKS
922
927
  },
923
928
  optionKey: "links",
@@ -926,7 +931,7 @@ $$` : `${e}$$`;
926
931
  {
927
932
  handler: {
928
933
  name: "boldItalic",
929
- handle: Nn,
934
+ handle: Fn,
930
935
  priority: R.BOLD_ITALIC
931
936
  },
932
937
  optionKey: "boldItalic"
@@ -934,7 +939,7 @@ $$` : `${e}$$`;
934
939
  {
935
940
  handler: {
936
941
  name: "bold",
937
- handle: xn,
942
+ handle: Cn,
938
943
  priority: R.BOLD
939
944
  },
940
945
  optionKey: "bold"
@@ -942,7 +947,7 @@ $$` : `${e}$$`;
942
947
  {
943
948
  handler: {
944
949
  name: "italicDoubleUnderscore",
945
- handle: Cn,
950
+ handle: Tn,
946
951
  priority: R.ITALIC_DOUBLE_UNDERSCORE
947
952
  },
948
953
  optionKey: "italic"
@@ -950,7 +955,7 @@ $$` : `${e}$$`;
950
955
  {
951
956
  handler: {
952
957
  name: "italicSingleAsterisk",
953
- handle: En,
958
+ handle: On,
954
959
  priority: R.ITALIC_SINGLE_ASTERISK
955
960
  },
956
961
  optionKey: "italic"
@@ -958,7 +963,7 @@ $$` : `${e}$$`;
958
963
  {
959
964
  handler: {
960
965
  name: "italicSingleUnderscore",
961
- handle: An,
966
+ handle: Mn,
962
967
  priority: R.ITALIC_SINGLE_UNDERSCORE
963
968
  },
964
969
  optionKey: "italic"
@@ -966,7 +971,7 @@ $$` : `${e}$$`;
966
971
  {
967
972
  handler: {
968
973
  name: "inlineCode",
969
- handle: zn,
974
+ handle: Vn,
970
975
  priority: R.INLINE_CODE
971
976
  },
972
977
  optionKey: "inlineCode"
@@ -974,7 +979,7 @@ $$` : `${e}$$`;
974
979
  {
975
980
  handler: {
976
981
  name: "strikethrough",
977
- handle: or,
982
+ handle: cr,
978
983
  priority: R.STRIKETHROUGH
979
984
  },
980
985
  optionKey: "strikethrough"
@@ -982,7 +987,7 @@ $$` : `${e}$$`;
982
987
  {
983
988
  handler: {
984
989
  name: "katex",
985
- handle: Un,
990
+ handle: Gn,
986
991
  priority: R.KATEX
987
992
  },
988
993
  optionKey: "katex"
@@ -990,36 +995,36 @@ $$` : `${e}$$`;
990
995
  {
991
996
  handler: {
992
997
  name: "inlineKatex",
993
- handle: Wn,
998
+ handle: Kn,
994
999
  priority: R.INLINE_KATEX
995
1000
  },
996
1001
  optionKey: "inlineKatex"
997
1002
  }
998
- ], ur = (e) => {
1003
+ ], fr = (e) => {
999
1004
  let t = e?.linkMode ?? "protocol";
1000
- return lr.filter(({ handler: t, optionKey: n }) => t.name === "links" ? sr(e?.links) || sr(e?.images) : t.name === "inlineKatex" ? cr(e?.inlineKatex) : sr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
1001
- handler: ct(st({}, e), { handle: (e) => Zn(e, t) }),
1005
+ return dr.filter(({ handler: t, optionKey: n }) => t.name === "links" ? lr(e?.links) || lr(e?.images) : t.name === "inlineKatex" ? ur(e?.inlineKatex) : lr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
1006
+ handler: dt(ut({}, e), { handle: (e) => $n(e, t) }),
1002
1007
  earlyReturn: t === "protocol" ? n : void 0
1003
1008
  } : {
1004
1009
  handler: e,
1005
1010
  earlyReturn: n
1006
1011
  });
1007
- }, dr = (e, t) => {
1012
+ }, pr = (e, t) => {
1008
1013
  if (!e || typeof e != "string") return e;
1009
- let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = ur(t), i = (t?.handlers ?? []).map((e) => ({
1010
- handler: ct(st({}, e), { priority: e.priority ?? R.DEFAULT }),
1014
+ let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = fr(t), i = (t?.handlers ?? []).map((e) => ({
1015
+ handler: dt(ut({}, e), { priority: e.priority ?? R.DEFAULT }),
1011
1016
  earlyReturn: void 0
1012
1017
  })), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
1013
1018
  try {
1014
1019
  for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
1015
1020
  return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
1016
1021
  } finally {
1017
- Tt();
1022
+ Dt();
1018
1023
  }
1019
1024
  };
1020
1025
  //#endregion
1021
1026
  //#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
1022
- function fr() {
1027
+ function mr() {
1023
1028
  return {
1024
1029
  async: !1,
1025
1030
  breaks: !1,
@@ -1033,12 +1038,12 @@ function fr() {
1033
1038
  walkTokens: null
1034
1039
  };
1035
1040
  }
1036
- var pr = fr();
1037
- function mr(e) {
1038
- pr = e;
1039
- }
1040
- var hr = { exec: () => null };
1041
+ var hr = mr();
1041
1042
  function gr(e) {
1043
+ hr = e;
1044
+ }
1045
+ var _r = { exec: () => null };
1046
+ function vr(e) {
1042
1047
  let t = [];
1043
1048
  return (n) => {
1044
1049
  let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
@@ -1055,7 +1060,7 @@ function z(e, t = "") {
1055
1060
  };
1056
1061
  return r;
1057
1062
  }
1058
- var _r = ((e = "") => {
1063
+ var yr = ((e = "") => {
1059
1064
  try {
1060
1065
  return !!RegExp("(?<=1)(?<!1)" + e);
1061
1066
  } catch {
@@ -1116,113 +1121,113 @@ var _r = ((e = "") => {
1116
1121
  notSpaceStart: /^\S*/,
1117
1122
  endingNewline: /\n$/,
1118
1123
  listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
1119
- nextBulletRegex: gr((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
1120
- hrRegex: gr((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
1121
- fencesBeginRegex: gr((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
1122
- headingBeginRegex: gr((e) => RegExp(`^ {0,${e}}#`)),
1123
- htmlBeginRegex: gr((e) => RegExp(`^ {0,${e}}(?:</?(?:${Mr})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
1124
- blockquoteBeginRegex: gr((e) => RegExp(`^ {0,${e}}>`))
1125
- }, vr = /^(?:[ \t]*(?:\n|$))+/, yr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, br = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, xr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Sr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Cr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, wr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Tr = z(wr).replace(/bull/g, Cr).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(), Er = z(wr).replace(/bull/g, Cr).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(), Dr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Or = /^[^\n]+/, kr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ar = z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", kr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), jr = z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Cr).getRegex(), Mr = "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", Nr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Pr = z("^ {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-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Nr).replace("tag", Mr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Fr = (e) => z(Dr).replace("hr", xr).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", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Mr).getRegex(), Ir = Fr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Lr = Fr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Rr = {
1126
- blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Lr).getRegex(),
1127
- code: yr,
1128
- def: Ar,
1129
- fences: br,
1130
- heading: Sr,
1131
- hr: xr,
1132
- html: Pr,
1133
- lheading: Tr,
1134
- list: jr,
1135
- newline: vr,
1136
- paragraph: Ir,
1137
- table: hr,
1138
- text: Or
1139
- }, zr = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", xr).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", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Mr).getRegex(), Br = {
1140
- ...Rr,
1141
- lheading: Er,
1142
- table: zr,
1143
- paragraph: z(Dr).replace("hr", xr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", zr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Mr).getRegex()
1144
- }, Vr = {
1145
- ...Rr,
1146
- html: z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Nr).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(),
1124
+ nextBulletRegex: vr((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
1125
+ hrRegex: vr((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
1126
+ fencesBeginRegex: vr((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
1127
+ headingBeginRegex: vr((e) => RegExp(`^ {0,${e}}#`)),
1128
+ htmlBeginRegex: vr((e) => RegExp(`^ {0,${e}}(?:</?(?:${Pr})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
1129
+ blockquoteBeginRegex: vr((e) => RegExp(`^ {0,${e}}>`))
1130
+ }, br = /^(?:[ \t]*(?:\n|$))+/, xr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Sr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Cr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, wr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Tr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Er = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Dr = z(Er).replace(/bull/g, Tr).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(), Or = z(Er).replace(/bull/g, Tr).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(), kr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Ar = /^[^\n]+/, jr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Mr = z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", jr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Nr = z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Tr).getRegex(), Pr = "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", Fr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ir = z("^ {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-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Fr).replace("tag", Pr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Lr = (e) => z(kr).replace("hr", Cr).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", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Pr).getRegex(), Rr = Lr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), zr = Lr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Br = {
1131
+ blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", zr).getRegex(),
1132
+ code: xr,
1133
+ def: Mr,
1134
+ fences: Sr,
1135
+ heading: wr,
1136
+ hr: Cr,
1137
+ html: Ir,
1138
+ lheading: Dr,
1139
+ list: Nr,
1140
+ newline: br,
1141
+ paragraph: Rr,
1142
+ table: _r,
1143
+ text: Ar
1144
+ }, Vr = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Cr).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", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Pr).getRegex(), Hr = {
1145
+ ...Br,
1146
+ lheading: Or,
1147
+ table: Vr,
1148
+ paragraph: z(kr).replace("hr", Cr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Vr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Pr).getRegex()
1149
+ }, Ur = {
1150
+ ...Br,
1151
+ html: z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Fr).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(),
1147
1152
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1148
1153
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
1149
- fences: hr,
1154
+ fences: _r,
1150
1155
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1151
- paragraph: z(Dr).replace("hr", xr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Tr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1152
- }, Hr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ur = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Wr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Gr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Kr = /[\p{P}\p{S}]/u, qr = /[\s\p{P}\p{S}]/u, Jr = /[^\s\p{P}\p{S}]/u, Yr = z(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, qr).getRegex(), Xr = /[\p{Pi}\p{Ps}"']/u, Zr = /(?!~)[\p{P}\p{S}]/u, Qr = /(?!~)[\s\p{P}\p{S}]/u, $r = /(?:[^\s\p{P}\p{S}]|~)/u, ei = z(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", _r ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ti = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ni = z(ti, "u").replace(/punct/g, Kr).getRegex(), ri = z(ti, "u").replace(/punct/g, Zr).getRegex(), ii = z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Xr).replace(/punct/g, Kr).getRegex(), ai = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", oi = z(ai, "gu").replace(/notPunctSpace/g, Jr).replace(/punctSpace/g, qr).replace(/punct/g, Kr).getRegex(), si = z(ai, "gu").replace(/notPunctSpace/g, $r).replace(/punctSpace/g, Qr).replace(/punct/g, Zr).getRegex(), ci = z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Jr).replace(/punctSpace/g, qr).replace(/punct/g, Kr).getRegex(), li = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Jr).replace(/punctSpace/g, qr).replace(/punct/g, Kr).getRegex(), ui = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Jr).replace(/punctSpace/g, qr).replace(/punct/g, Kr).getRegex(), di = z(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Kr).getRegex(), fi = z("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Jr).replace(/punctSpace/g, qr).replace(/punct/g, Kr).getRegex(), pi = z(/\\(punct)/, "gu").replace(/punct/g, Kr).getRegex(), mi = z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, Kr).getRegex(), hi = z(/^<(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(), gi = z(Nr).replace("(?:-->|$)", "-->").getRegex(), _i = z("^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", gi).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vi = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, yi = z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", vi).getRegex(), bi = z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", yi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), xi = z(/^!?\[(label)\]\[(ref)\]/).replace("label", yi).replace("ref", kr).getRegex(), Si = z(/^!?\[(ref)\](?:\[\])?/).replace("ref", kr).getRegex(), Ci = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, wi = z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", vi).getRegex(), Ti = z("reflink|nolink(?!\\()", "g").replace("reflink", z(/^!?\[(label)\]\[(ref)\]/).replace("label", wi).replace("ref", Ci).getRegex()).replace("nolink", z(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ci).getRegex()).getRegex(), Ei = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Di = z(/(?: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(), Oi = {
1153
- _backpedal: hr,
1154
- anyPunctuation: pi,
1155
- anyPunctuationOutsideCode: mi,
1156
- autolink: hi,
1157
- blockSkip: ei,
1158
- br: Wr,
1159
- code: Ur,
1160
- del: hr,
1161
- delLDelim: hr,
1162
- delRDelim: hr,
1163
- emStrongLDelim: ni,
1164
- emStrongRDelimAst: oi,
1165
- emStrongRDelimUnd: li,
1166
- escape: Hr,
1167
- link: bi,
1168
- nolink: Si,
1169
- punctuation: Yr,
1170
- reflink: xi,
1171
- reflinkSearch: Ti,
1172
- tag: _i,
1173
- text: Gr,
1174
- url: hr
1175
- }, ki = {
1176
- ...Oi,
1156
+ paragraph: z(kr).replace("hr", Cr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Dr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1157
+ }, Wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Gr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Kr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, qr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Jr = /[\p{P}\p{S}]/u, Yr = /[\s\p{P}\p{S}]/u, Xr = /[^\s\p{P}\p{S}]/u, Zr = z(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Yr).getRegex(), Qr = /[\p{Pi}\p{Ps}"']/u, $r = /(?!~)[\p{P}\p{S}]/u, ei = /(?!~)[\s\p{P}\p{S}]/u, ti = /(?:[^\s\p{P}\p{S}]|~)/u, ni = z(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", yr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ri = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ii = z(ri, "u").replace(/punct/g, Jr).getRegex(), ai = z(ri, "u").replace(/punct/g, $r).getRegex(), oi = z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Qr).replace(/punct/g, Jr).getRegex(), si = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ci = z(si, "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), li = z(si, "gu").replace(/notPunctSpace/g, ti).replace(/punctSpace/g, ei).replace(/punct/g, $r).getRegex(), ui = z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), di = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), fi = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), pi = z(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Jr).getRegex(), mi = z("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), hi = z(/\\(punct)/, "gu").replace(/punct/g, Jr).getRegex(), gi = z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, Jr).getRegex(), _i = z(/^<(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(), vi = z(Fr).replace("(?:-->|$)", "-->").getRegex(), yi = z("^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", vi).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), bi = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, xi = z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", bi).getRegex(), Si = z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", xi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ci = z(/^!?\[(label)\]\[(ref)\]/).replace("label", xi).replace("ref", jr).getRegex(), wi = z(/^!?\[(ref)\](?:\[\])?/).replace("ref", jr).getRegex(), Ti = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Ei = z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", bi).getRegex(), Di = z("reflink|nolink(?!\\()", "g").replace("reflink", z(/^!?\[(label)\]\[(ref)\]/).replace("label", Ei).replace("ref", Ti).getRegex()).replace("nolink", z(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ti).getRegex()).getRegex(), Oi = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, ki = z(/(?: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(), Ai = {
1158
+ _backpedal: _r,
1159
+ anyPunctuation: hi,
1160
+ anyPunctuationOutsideCode: gi,
1161
+ autolink: _i,
1162
+ blockSkip: ni,
1163
+ br: Kr,
1164
+ code: Gr,
1165
+ del: _r,
1166
+ delLDelim: _r,
1167
+ delRDelim: _r,
1177
1168
  emStrongLDelim: ii,
1178
1169
  emStrongRDelimAst: ci,
1179
- emStrongRDelimUnd: ui,
1180
- link: z(/^!?\[(label)\]\((.*?)\)/).replace("label", yi).getRegex(),
1181
- reflink: z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", yi).getRegex()
1182
- }, Ai = {
1183
- ...Oi,
1184
- emStrongRDelimAst: si,
1185
- emStrongLDelim: ri,
1186
- delLDelim: di,
1187
- delRDelim: fi,
1188
- url: z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Di).replace("protocol", Ei).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
1189
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
1190
- del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
1191
- text: z(/^(?:[^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", Ei).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
1170
+ emStrongRDelimUnd: di,
1171
+ escape: Wr,
1172
+ link: Si,
1173
+ nolink: wi,
1174
+ punctuation: Zr,
1175
+ reflink: Ci,
1176
+ reflinkSearch: Di,
1177
+ tag: yi,
1178
+ text: qr,
1179
+ url: _r
1192
1180
  }, ji = {
1193
1181
  ...Ai,
1194
- br: z(Wr).replace("{2,}", "*").getRegex(),
1195
- text: z(Ai.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1182
+ emStrongLDelim: oi,
1183
+ emStrongRDelimAst: ui,
1184
+ emStrongRDelimUnd: fi,
1185
+ link: z(/^!?\[(label)\]\((.*?)\)/).replace("label", xi).getRegex(),
1186
+ reflink: z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", xi).getRegex()
1196
1187
  }, Mi = {
1197
- normal: Rr,
1198
- gfm: Br,
1199
- pedantic: Vr
1188
+ ...Ai,
1189
+ emStrongRDelimAst: li,
1190
+ emStrongLDelim: ai,
1191
+ delLDelim: pi,
1192
+ delRDelim: mi,
1193
+ url: z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", ki).replace("protocol", Oi).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
1194
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
1195
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
1196
+ text: z(/^(?:[^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", Oi).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
1200
1197
  }, Ni = {
1201
- normal: Oi,
1202
- gfm: Ai,
1203
- breaks: ji,
1204
- pedantic: ki
1198
+ ...Mi,
1199
+ br: z(Kr).replace("{2,}", "*").getRegex(),
1200
+ text: z(Mi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1205
1201
  }, Pi = {
1202
+ normal: Br,
1203
+ gfm: Hr,
1204
+ pedantic: Ur
1205
+ }, Fi = {
1206
+ normal: Ai,
1207
+ gfm: Mi,
1208
+ breaks: Ni,
1209
+ pedantic: ji
1210
+ }, Ii = {
1206
1211
  "&": "&amp;",
1207
1212
  "<": "&lt;",
1208
1213
  ">": "&gt;",
1209
1214
  "\"": "&quot;",
1210
1215
  "'": "&#39;"
1211
- }, Fi = (e) => Pi[e];
1216
+ }, Li = (e) => Ii[e];
1212
1217
  function V(e, t) {
1213
1218
  if (t) {
1214
- if (B.escapeTest.test(e)) return e.replace(B.escapeReplace, Fi);
1215
- } else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode, Fi);
1219
+ if (B.escapeTest.test(e)) return e.replace(B.escapeReplace, Li);
1220
+ } else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode, Li);
1216
1221
  return e;
1217
1222
  }
1218
- function Ii(e) {
1223
+ function Ri(e) {
1219
1224
  return B.numericCharacterReference.test(e) ? e.replace(B.numericCharacterReferenceOrAmpersand, (e, t, n) => {
1220
1225
  if (t === void 0 && n === void 0) return "&amp;";
1221
1226
  let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
1222
1227
  return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&amp;" : String.fromCodePoint(r);
1223
1228
  }) : e;
1224
1229
  }
1225
- function Li(e) {
1230
+ function zi(e) {
1226
1231
  try {
1227
1232
  e = encodeURI(e).replace(B.percentDecode, "%");
1228
1233
  } catch {
@@ -1230,7 +1235,7 @@ function Li(e) {
1230
1235
  }
1231
1236
  return e;
1232
1237
  }
1233
- function Ri(e, t) {
1238
+ function Bi(e, t) {
1234
1239
  let n = e.replace(B.findPipe, (e, t, n) => {
1235
1240
  let r = !1, i = t;
1236
1241
  for (; --i >= 0 && n[i] === "\\";) r = !r;
@@ -1243,7 +1248,7 @@ function Ri(e, t) {
1243
1248
  for (; r < n.length; r++) n[r] = n[r].trim().replace(B.slashPipe, "|");
1244
1249
  return n;
1245
1250
  }
1246
- function zi(e, t, n) {
1251
+ function Vi(e, t, n) {
1247
1252
  let r = e.length;
1248
1253
  if (r === 0) return "";
1249
1254
  let i = 0;
@@ -1255,15 +1260,15 @@ function zi(e, t, n) {
1255
1260
  }
1256
1261
  return e.slice(0, r - i);
1257
1262
  }
1258
- function Bi(e) {
1263
+ function Hi(e) {
1259
1264
  let t = e.split("\n"), n = t.length - 1;
1260
1265
  for (; n >= 0 && B.blankLine.test(t[n]);) n--;
1261
1266
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
1262
1267
  }
1263
- function Vi(e) {
1268
+ function Ui(e) {
1264
1269
  return e.trim().toLowerCase().toUpperCase().toLowerCase();
1265
1270
  }
1266
- function Hi(e, t) {
1271
+ function Wi(e, t) {
1267
1272
  if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
1268
1273
  let n = 0;
1269
1274
  for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
@@ -1271,7 +1276,7 @@ function Hi(e, t) {
1271
1276
  else if (e[r] === t[1] && (n--, n < 0)) return r;
1272
1277
  return n > 0 ? -2 : -1;
1273
1278
  }
1274
- function Ui(e, t = 0) {
1279
+ function Gi(e, t = 0) {
1275
1280
  let n = t, r = "";
1276
1281
  for (let t of e) if (t === " ") {
1277
1282
  let e = 4 - n % 4;
@@ -1279,7 +1284,7 @@ function Ui(e, t = 0) {
1279
1284
  } else r += t, n++;
1280
1285
  return r;
1281
1286
  }
1282
- function Wi(e, t, n, r, i) {
1287
+ function Ki(e, t, n, r, i) {
1283
1288
  let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!", l = r.state.inLink, u = r.state.linkEmitted, d = r.state.inRawBlock;
1284
1289
  r.state.inLink = !0, r.state.linkEmitted = !1;
1285
1290
  let f = r.inlineTokens(s), p = r.state.linkEmitted;
@@ -1299,7 +1304,7 @@ function Wi(e, t, n, r, i) {
1299
1304
  tokens: f
1300
1305
  };
1301
1306
  }
1302
- function Gi(e, t, n) {
1307
+ function qi(e, t, n) {
1303
1308
  let r = e.match(n.other.indentCodeCompensation);
1304
1309
  if (r === null) return t;
1305
1310
  let i = r[1];
@@ -1310,7 +1315,7 @@ function Gi(e, t, n) {
1310
1315
  return e.slice(Math.min(r.length, i.length));
1311
1316
  }).join("\n");
1312
1317
  }
1313
- function Ki(e, t, n, r) {
1318
+ function Ji(e, t, n, r) {
1314
1319
  if (!t.includes("<")) return !1;
1315
1320
  for (let i = 0; i < t.length; i++) {
1316
1321
  if (t[i] === "\\") {
@@ -1333,12 +1338,12 @@ function Ki(e, t, n, r) {
1333
1338
  }
1334
1339
  return !1;
1335
1340
  }
1336
- var qi = class {
1341
+ var Yi = class {
1337
1342
  options;
1338
1343
  rules;
1339
1344
  lexer;
1340
1345
  constructor(e) {
1341
- this.options = e || pr;
1346
+ this.options = e || hr;
1342
1347
  }
1343
1348
  space(e) {
1344
1349
  let t = this.rules.block.newline.exec(e);
@@ -1350,7 +1355,7 @@ var qi = class {
1350
1355
  code(e) {
1351
1356
  let t = this.rules.block.code.exec(e);
1352
1357
  if (t) {
1353
- let e = this.options.pedantic ? t[0] : Bi(t[0]);
1358
+ let e = this.options.pedantic ? t[0] : Hi(t[0]);
1354
1359
  return {
1355
1360
  type: "code",
1356
1361
  raw: e,
@@ -1362,7 +1367,7 @@ var qi = class {
1362
1367
  fences(e) {
1363
1368
  let t = this.rules.block.fences.exec(e);
1364
1369
  if (t) {
1365
- let e = t[0], n = Gi(e, t[3] || "", this.rules);
1370
+ let e = t[0], n = qi(e, t[3] || "", this.rules);
1366
1371
  return {
1367
1372
  type: "code",
1368
1373
  raw: e,
@@ -1376,12 +1381,12 @@ var qi = class {
1376
1381
  if (t) {
1377
1382
  let e = t[2].trim();
1378
1383
  if (this.rules.other.endingHash.test(e)) {
1379
- let t = zi(e, "#");
1384
+ let t = Vi(e, "#");
1380
1385
  (this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
1381
1386
  }
1382
1387
  return {
1383
1388
  type: "heading",
1384
- raw: zi(t[0], "\n"),
1389
+ raw: Vi(t[0], "\n"),
1385
1390
  depth: t[1].length,
1386
1391
  text: e,
1387
1392
  tokens: this.lexer.inline(e)
@@ -1392,13 +1397,13 @@ var qi = class {
1392
1397
  let t = this.rules.block.hr.exec(e);
1393
1398
  if (t) return {
1394
1399
  type: "hr",
1395
- raw: zi(t[0], "\n")
1400
+ raw: Vi(t[0], "\n")
1396
1401
  };
1397
1402
  }
1398
1403
  blockquote(e) {
1399
1404
  let t = this.rules.block.blockquote.exec(e);
1400
1405
  if (t) {
1401
- let e = zi(t[0], "\n").split("\n"), n = "", r = "", i = [];
1406
+ let e = Vi(t[0], "\n").split("\n"), n = "", r = "", i = [];
1402
1407
  for (; e.length > 0;) {
1403
1408
  let t = !1, a = [], o = 0;
1404
1409
  for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
@@ -1452,12 +1457,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1452
1457
  if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
1453
1458
  let l = r();
1454
1459
  e = e.substring(t[0].length);
1455
- let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Ui(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Ui(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
1460
+ let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Gi(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Gi(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
1456
1461
  if (this.options.pedantic ? (m = 2, a = f.trimStart()) : ee ? m = d + 1 : (m = f.search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, a = f.slice(m), m += d), ee && this.rules.other.blankLine.test(p) && (e = e.substring(p.length + 1), i = !0), !i) {
1457
1462
  let t = this.rules.other.nextBulletRegex(m), n = this.rules.other.hrRegex(m), r = this.rules.other.fencesBeginRegex(m), i = this.rules.other.headingBeginRegex(m), o = this.rules.other.htmlBeginRegex(m), s = this.rules.other.blockquoteBeginRegex(m);
1458
1463
  for (; e;) {
1459
1464
  let c = e.split("\n", 1)[0], l;
1460
- if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Ui(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
1465
+ if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Gi(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
1461
1466
  if (l.search(this.rules.other.nonSpaceChar) >= m || !p.trim()) a += "\n" + l.slice(m);
1462
1467
  else {
1463
1468
  if (ee || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || r.test(f) || i.test(f) || n.test(f)) break;
@@ -1466,10 +1471,10 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1466
1471
  ee = !p.trim(), e = e.substring(c.length + 1), f = l.slice(m);
1467
1472
  }
1468
1473
  }
1469
- let te = n.slice(l, r());
1470
- o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(te) && (c = !0)), o.items.push({
1474
+ let h = n.slice(l, r());
1475
+ o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(h) && (c = !0)), o.items.push({
1471
1476
  type: "list_item",
1472
- raw: te,
1477
+ raw: h,
1473
1478
  task: !!this.options.gfm && this.rules.other.listIsTask.test(a),
1474
1479
  loose: !1,
1475
1480
  text: a,
@@ -1518,7 +1523,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1518
1523
  html(e) {
1519
1524
  let t = this.rules.block.html.exec(e);
1520
1525
  if (t) {
1521
- let e = Bi(t[0]);
1526
+ let e = Hi(t[0]);
1522
1527
  return {
1523
1528
  type: "html",
1524
1529
  block: !0,
@@ -1531,12 +1536,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1531
1536
  def(e) {
1532
1537
  let t = this.rules.block.def.exec(e);
1533
1538
  if (t) {
1534
- if (!this.rules.other.startAngleBracket.test(t[2]) && Hi(t[2], "()") !== -1) return;
1535
- let e = Vi(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];
1539
+ if (!this.rules.other.startAngleBracket.test(t[2]) && Wi(t[2], "()") !== -1) return;
1540
+ let e = Ui(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];
1536
1541
  return {
1537
1542
  type: "def",
1538
1543
  tag: e,
1539
- raw: zi(t[0], "\n"),
1544
+ raw: Vi(t[0], "\n"),
1540
1545
  href: n,
1541
1546
  title: r
1542
1547
  };
@@ -1545,9 +1550,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1545
1550
  table(e) {
1546
1551
  let t = this.rules.block.table.exec(e);
1547
1552
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1548
- let n = Ri(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 = {
1553
+ let n = Bi(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 = {
1549
1554
  type: "table",
1550
- raw: zi(t[0], "\n"),
1555
+ raw: Vi(t[0], "\n"),
1551
1556
  header: [],
1552
1557
  align: [],
1553
1558
  rows: []
@@ -1560,7 +1565,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1560
1565
  header: !0,
1561
1566
  align: a.align[e]
1562
1567
  });
1563
- for (let e of i) a.rows.push(Ri(e, a.header.length).map((e, t) => ({
1568
+ for (let e of i) a.rows.push(Bi(e, a.header.length).map((e, t) => ({
1564
1569
  text: e,
1565
1570
  tokens: this.lexer.inline(e),
1566
1571
  header: !1,
@@ -1575,7 +1580,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1575
1580
  let e = t[1].trim();
1576
1581
  return {
1577
1582
  type: "heading",
1578
- raw: zi(t[0], "\n"),
1583
+ raw: Vi(t[0], "\n"),
1579
1584
  depth: t[2].charAt(0) === "=" ? 1 : 2,
1580
1585
  text: e,
1581
1586
  tokens: this.lexer.inline(e)
@@ -1627,14 +1632,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1627
1632
  let t = this.rules.inline.link.exec(e);
1628
1633
  if (t) {
1629
1634
  let n = t[0].charAt(0) === "!" ? 2 : 1;
1630
- if (!this.options.pedantic && Ki(e, t[1], n, this.rules)) return;
1635
+ if (!this.options.pedantic && Ji(e, t[1], n, this.rules)) return;
1631
1636
  let r = t[2].trim();
1632
1637
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
1633
1638
  if (!this.rules.other.endAngleBracket.test(r)) return;
1634
- let e = zi(r.slice(0, -1), "\\");
1639
+ let e = Vi(r.slice(0, -1), "\\");
1635
1640
  if ((r.length - e.length) % 2 == 0) return;
1636
1641
  } else {
1637
- let e = Hi(t[2], "()");
1642
+ let e = Wi(t[2], "()");
1638
1643
  if (e === -2) return;
1639
1644
  if (e > -1) {
1640
1645
  let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
@@ -1646,7 +1651,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1646
1651
  let e = this.rules.other.pedanticHrefTitle.exec(i);
1647
1652
  e && (i = e[1], a = e[3]);
1648
1653
  } else a = t[3] ? t[3].slice(1, -1) : "";
1649
- 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)), Wi(t, {
1654
+ 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)), Ki(t, {
1650
1655
  href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
1651
1656
  title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
1652
1657
  }, t[0], this.lexer, this.rules);
@@ -1656,8 +1661,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1656
1661
  let n;
1657
1662
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
1658
1663
  let r = n[0].charAt(0) === "!" ? 2 : 1;
1659
- if (!this.options.pedantic && Ki(e, n[1], r, this.rules)) return;
1660
- let i = t[Vi((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1664
+ if (!this.options.pedantic && Ji(e, n[1], r, this.rules)) return;
1665
+ let i = t[Ui((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1661
1666
  if (!i) {
1662
1667
  let e = n[0].charAt(0);
1663
1668
  return {
@@ -1666,7 +1671,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1666
1671
  text: e
1667
1672
  };
1668
1673
  }
1669
- return Wi(n, i, n[0], this.lexer, this.rules);
1674
+ return Ki(n, i, n[0], this.lexer, this.rules);
1670
1675
  }
1671
1676
  }
1672
1677
  emStrong(e, t, n = "") {
@@ -1799,7 +1804,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1799
1804
  return {
1800
1805
  type: "text",
1801
1806
  raw: t[0],
1802
- text: e ? t[0] : Ii(t[0]),
1807
+ text: e ? t[0] : Ri(t[0]),
1803
1808
  escaped: e
1804
1809
  };
1805
1810
  }
@@ -1811,7 +1816,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1811
1816
  inlineQueue;
1812
1817
  tokenizer;
1813
1818
  constructor(e) {
1814
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || pr, this.options.tokenizer = this.options.tokenizer || new qi(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1819
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || hr, this.options.tokenizer = this.options.tokenizer || new Yi(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1815
1820
  inLink: !1,
1816
1821
  inRawBlock: !1,
1817
1822
  linkEmitted: !1,
@@ -1820,15 +1825,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1820
1825
  };
1821
1826
  let t = {
1822
1827
  other: B,
1823
- block: Mi.normal,
1824
- inline: Ni.normal
1828
+ block: Pi.normal,
1829
+ inline: Fi.normal
1825
1830
  };
1826
- this.options.pedantic ? (t.block = Mi.pedantic, t.inline = Ni.pedantic) : this.options.gfm && (t.block = Mi.gfm, t.inline = this.options.breaks ? Ni.breaks : Ni.gfm), this.tokenizer.rules = t;
1831
+ this.options.pedantic ? (t.block = Pi.pedantic, t.inline = Fi.pedantic) : this.options.gfm && (t.block = Pi.gfm, t.inline = this.options.breaks ? Fi.breaks : Fi.gfm), this.tokenizer.rules = t;
1827
1832
  }
1828
1833
  static get rules() {
1829
1834
  return {
1830
- block: Mi,
1831
- inline: Ni
1835
+ block: Pi,
1836
+ inline: Fi
1832
1837
  };
1833
1838
  }
1834
1839
  static lex(t, n) {
@@ -1918,7 +1923,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1918
1923
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
1919
1924
  for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
1920
1925
  let e = t[0], n = e.lastIndexOf("[");
1921
- if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Vi(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1926
+ if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Ui(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1922
1927
  }
1923
1928
  return !1;
1924
1929
  }
@@ -1937,7 +1942,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1937
1942
  if (this.tokens.links && e.includes("[")) {
1938
1943
  let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
1939
1944
  let r = n.lastIndexOf("[");
1940
- if (!Object.hasOwn(this.tokens.links, Vi(n.slice(r + 1, -1)))) return n;
1945
+ if (!Object.hasOwn(this.tokens.links, Ui(n.slice(r + 1, -1)))) return n;
1941
1946
  if (r > 1 && n.charAt(0) !== "!") {
1942
1947
  let i = n.slice(1, r - 1);
1943
1948
  if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
@@ -1997,11 +2002,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1997
2002
  if (this.options.silent) console.error(t);
1998
2003
  else throw Error(t);
1999
2004
  }
2000
- }, Ji = class {
2005
+ }, Xi = class {
2001
2006
  options;
2002
2007
  parser;
2003
2008
  constructor(e) {
2004
- this.options = e || pr;
2009
+ this.options = e || hr;
2005
2010
  }
2006
2011
  space(e) {
2007
2012
  return "";
@@ -2087,7 +2092,7 @@ ${e}</tr>
2087
2092
  return `<del>${this.parser.parseInline(e)}</del>`;
2088
2093
  }
2089
2094
  link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
2090
- let a = i ? V(n, !0) : this.parser.parseInline(r), o = Li(e);
2095
+ let a = i ? V(n, !0) : this.parser.parseInline(r), o = zi(e);
2091
2096
  if (o === null) return a;
2092
2097
  e = V(o, i);
2093
2098
  let s = "<a href=\"" + e + "\"";
@@ -2095,7 +2100,7 @@ ${e}</tr>
2095
2100
  }
2096
2101
  image({ href: e, title: t, text: n, tokens: r }) {
2097
2102
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
2098
- let i = Li(e);
2103
+ let i = zi(e);
2099
2104
  if (i === null) return V(n);
2100
2105
  e = i;
2101
2106
  let a = `<img src="${V(e)}" alt="${V(n)}"`;
@@ -2104,7 +2109,7 @@ ${e}</tr>
2104
2109
  text(e) {
2105
2110
  return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
2106
2111
  }
2107
- }, Yi = class {
2112
+ }, Zi = class {
2108
2113
  strong({ text: e }) {
2109
2114
  return e;
2110
2115
  }
@@ -2140,7 +2145,7 @@ ${e}</tr>
2140
2145
  renderer;
2141
2146
  textRenderer;
2142
2147
  constructor(e) {
2143
- this.options = e || pr, this.options.renderer = this.options.renderer || new Ji(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Yi();
2148
+ this.options = e || hr, this.options.renderer = this.options.renderer || new Xi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Zi();
2144
2149
  }
2145
2150
  static parse(t, n) {
2146
2151
  return new e(n).parse(t);
@@ -2288,11 +2293,11 @@ ${e}</tr>
2288
2293
  }
2289
2294
  return n;
2290
2295
  }
2291
- }, Xi = class {
2296
+ }, Qi = class {
2292
2297
  options;
2293
2298
  block;
2294
2299
  constructor(e) {
2295
- this.options = e || pr;
2300
+ this.options = e || hr;
2296
2301
  }
2297
2302
  static passThroughHooks = /* @__PURE__ */ new Set([
2298
2303
  "preprocess",
@@ -2324,44 +2329,44 @@ ${e}</tr>
2324
2329
  return e ? U.parse : U.parseInline;
2325
2330
  }
2326
2331
  };
2327
- function Zi(e, t) {
2332
+ function $i(e, t) {
2328
2333
  if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n]);
2329
2334
  else e.push(t);
2330
2335
  }
2331
- var Qi = new class {
2332
- defaults = fr();
2336
+ var ea = new class {
2337
+ defaults = mr();
2333
2338
  options = this.setOptions;
2334
2339
  parse = this.parseMarkdown(!0);
2335
2340
  parseInline = this.parseMarkdown(!1);
2336
2341
  Parser = U;
2337
- Renderer = Ji;
2338
- TextRenderer = Yi;
2342
+ Renderer = Xi;
2343
+ TextRenderer = Zi;
2339
2344
  Lexer = H;
2340
- Tokenizer = qi;
2341
- Hooks = Xi;
2345
+ Tokenizer = Yi;
2346
+ Hooks = Qi;
2342
2347
  constructor(...e) {
2343
2348
  this.use(...e);
2344
2349
  }
2345
2350
  walkTokens(e, t) {
2346
2351
  let n = [];
2347
- for (let r of e) switch (Zi(n, t.call(this, r)), r.type) {
2352
+ for (let r of e) switch ($i(n, t.call(this, r)), r.type) {
2348
2353
  case "table": {
2349
2354
  let e = r;
2350
- for (let r of e.header) Zi(n, this.walkTokens(r.tokens, t));
2351
- for (let r of e.rows) for (let e of r) Zi(n, this.walkTokens(e.tokens, t));
2355
+ for (let r of e.header) $i(n, this.walkTokens(r.tokens, t));
2356
+ for (let r of e.rows) for (let e of r) $i(n, this.walkTokens(e.tokens, t));
2352
2357
  break;
2353
2358
  }
2354
2359
  case "list": {
2355
2360
  let e = r;
2356
- Zi(n, this.walkTokens(e.items, t));
2361
+ $i(n, this.walkTokens(e.items, t));
2357
2362
  break;
2358
2363
  }
2359
2364
  default: {
2360
2365
  let e = r;
2361
2366
  this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
2362
2367
  let i = e[r].flat(1 / 0);
2363
- Zi(n, this.walkTokens(i, t));
2364
- }) : e.tokens && Zi(n, this.walkTokens(e.tokens, t));
2368
+ $i(n, this.walkTokens(i, t));
2369
+ }) : e.tokens && $i(n, this.walkTokens(e.tokens, t));
2365
2370
  }
2366
2371
  }
2367
2372
  return n;
@@ -2389,7 +2394,7 @@ var Qi = new class {
2389
2394
  }
2390
2395
  "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
2391
2396
  }), n.extensions = t), e.renderer) {
2392
- let t = this.defaults.renderer || new Ji(this.defaults);
2397
+ let t = this.defaults.renderer || new Xi(this.defaults);
2393
2398
  for (let n in e.renderer) {
2394
2399
  if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
2395
2400
  if (["options", "parser"].includes(n)) continue;
@@ -2402,7 +2407,7 @@ var Qi = new class {
2402
2407
  n.renderer = t;
2403
2408
  }
2404
2409
  if (e.tokenizer) {
2405
- let t = this.defaults.tokenizer || new qi(this.defaults);
2410
+ let t = this.defaults.tokenizer || new Yi(this.defaults);
2406
2411
  for (let n in e.tokenizer) {
2407
2412
  if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
2408
2413
  if ([
@@ -2419,13 +2424,13 @@ var Qi = new class {
2419
2424
  n.tokenizer = t;
2420
2425
  }
2421
2426
  if (e.hooks) {
2422
- let t = this.defaults.hooks || new Xi();
2427
+ let t = this.defaults.hooks || new Qi();
2423
2428
  for (let n in e.hooks) {
2424
2429
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
2425
2430
  if (["options", "block"].includes(n)) continue;
2426
2431
  let r = n, i = e.hooks[r], a = t[r];
2427
- t[r] = Xi.passThroughHooks.has(n) ? (e) => {
2428
- if (this.defaults.async && Xi.passThroughHooksRespectAsync.has(n)) return (async () => {
2432
+ t[r] = Qi.passThroughHooks.has(n) ? (e) => {
2433
+ if (this.defaults.async && Qi.passThroughHooksRespectAsync.has(n)) return (async () => {
2429
2434
  let n = await i.call(t, e);
2430
2435
  return a.call(t, n);
2431
2436
  })();
@@ -2446,7 +2451,7 @@ var Qi = new class {
2446
2451
  let t = this.defaults.walkTokens, r = e.walkTokens;
2447
2452
  n.walkTokens = function(e) {
2448
2453
  let n = [];
2449
- return n.push(r.call(this, e)), t && Zi(n, t.call(this, e)), n;
2454
+ return n.push(r.call(this, e)), t && $i(n, t.call(this, e)), n;
2450
2455
  };
2451
2456
  }
2452
2457
  this.defaults = {
@@ -2505,31 +2510,31 @@ var Qi = new class {
2505
2510
  }
2506
2511
  }();
2507
2512
  function W(e, t) {
2508
- return Qi.parse(e, t);
2513
+ return ea.parse(e, t);
2509
2514
  }
2510
2515
  W.options = W.setOptions = function(e) {
2511
- return Qi.setOptions(e), W.defaults = Qi.defaults, mr(W.defaults), W;
2512
- }, W.getDefaults = fr, W.defaults = pr;
2513
- function $i(...e) {
2514
- return Qi.use(...e), W.defaults = Qi.defaults, mr(W.defaults), W;
2515
- }
2516
- W.use = $i, W.walkTokens = function(e, t) {
2517
- return Qi.walkTokens(e, t);
2518
- }, W.parseInline = Qi.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Ji, W.TextRenderer = Yi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = qi, W.Hooks = Xi, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
2516
+ return ea.setOptions(e), W.defaults = ea.defaults, gr(W.defaults), W;
2517
+ }, W.getDefaults = mr, W.defaults = hr;
2518
+ function ta(...e) {
2519
+ return ea.use(...e), W.defaults = ea.defaults, gr(W.defaults), W;
2520
+ }
2521
+ W.use = ta, W.walkTokens = function(e, t) {
2522
+ return ea.walkTokens(e, t);
2523
+ }, W.parseInline = ea.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Xi, W.TextRenderer = Zi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Yi, W.Hooks = Qi, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
2519
2524
  //#endregion
2520
2525
  //#region ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
2521
- function ea(e, t) {
2526
+ function na(e, t) {
2522
2527
  this.v = e, this.k = t;
2523
2528
  }
2524
- function ta(e, t) {
2529
+ function ra(e, t) {
2525
2530
  (t == null || t > e.length) && (t = e.length);
2526
2531
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
2527
2532
  return r;
2528
2533
  }
2529
- function na(e) {
2534
+ function ia(e) {
2530
2535
  if (Array.isArray(e)) return e;
2531
2536
  }
2532
- function ra(e, t) {
2537
+ function aa(e, t) {
2533
2538
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
2534
2539
  if (n != null) {
2535
2540
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -2550,24 +2555,24 @@ function ra(e, t) {
2550
2555
  return s;
2551
2556
  }
2552
2557
  }
2553
- function ia() {
2558
+ function oa() {
2554
2559
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2555
2560
  }
2556
- function aa(e, t) {
2557
- return na(e) || ra(e, t) || oa(e, t) || ia();
2561
+ function sa(e, t) {
2562
+ return ia(e) || aa(e, t) || ca(e, t) || oa();
2558
2563
  }
2559
- function oa(e, t) {
2564
+ function ca(e, t) {
2560
2565
  if (e) {
2561
- if (typeof e == "string") return ta(e, t);
2566
+ if (typeof e == "string") return ra(e, t);
2562
2567
  var n = {}.toString.call(e).slice(8, -1);
2563
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ta(e, t) : void 0;
2568
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ra(e, t) : void 0;
2564
2569
  }
2565
2570
  }
2566
- function sa(e) {
2571
+ function la(e) {
2567
2572
  var t, n;
2568
2573
  function r(t, n) {
2569
2574
  try {
2570
- var a = e[t](n), o = a.value, s = o instanceof ea;
2575
+ var a = e[t](n), o = a.value, s = o instanceof na;
2571
2576
  Promise.resolve(s ? o.v : o).then(function(n) {
2572
2577
  if (s) {
2573
2578
  var c = t === "return" && o.k ? t : "next";
@@ -2601,119 +2606,119 @@ function sa(e) {
2601
2606
  });
2602
2607
  }, typeof e.return != "function" && (this.return = void 0);
2603
2608
  }
2604
- sa.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
2609
+ la.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
2605
2610
  return this;
2606
- }, sa.prototype.next = function(e) {
2611
+ }, la.prototype.next = function(e) {
2607
2612
  return this._invoke("next", e);
2608
- }, sa.prototype.throw = function(e) {
2613
+ }, la.prototype.throw = function(e) {
2609
2614
  return this._invoke("throw", e);
2610
- }, sa.prototype.return = function(e) {
2615
+ }, la.prototype.return = function(e) {
2611
2616
  return this._invoke("return", e);
2612
2617
  };
2613
- var ca = Object.entries, la = Object.setPrototypeOf, ua = Object.isFrozen, da = Object.getPrototypeOf, fa = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, pa = Object.create, ma = typeof Reflect < "u" && Reflect, ha = ma.apply, ga = ma.construct;
2618
+ var ua = Object.entries, da = Object.setPrototypeOf, fa = Object.isFrozen, pa = Object.getPrototypeOf, ma = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ha = Object.create, ga = typeof Reflect < "u" && Reflect, _a = ga.apply, va = ga.construct;
2614
2619
  G ||= function(e) {
2615
2620
  return e;
2616
2621
  }, K ||= function(e) {
2617
2622
  return e;
2618
- }, ha ||= function(e, t) {
2623
+ }, _a ||= function(e, t) {
2619
2624
  var n = [...arguments].slice(2);
2620
2625
  return e.apply(t, n);
2621
- }, ga ||= function(e) {
2626
+ }, va ||= function(e) {
2622
2627
  return new e(...[...arguments].slice(1));
2623
2628
  };
2624
- var _a = Y(Array.prototype.forEach);
2629
+ var ya = Y(Array.prototype.forEach);
2625
2630
  Array.prototype.indexOf;
2626
- var va = Y(Array.prototype.lastIndexOf), ya = Y(Array.prototype.pop), ba = Y(Array.prototype.push), xa = Y(Array.prototype.slice), Sa = Y(Array.prototype.splice), Ca = Array.isArray, wa = za(Set), Ta = Y(Set.prototype.add), Ea = Y(Set.prototype.has), Da = Y(String.prototype.toLowerCase), Oa = Y(String.prototype.toString), ka = Y(String.prototype.match), Aa = Y(String.prototype.replace), ja = Y(String.prototype.indexOf), Ma = Y(String.prototype.trim), Na = Y(Number.prototype.toString), Pa = Y(Boolean.prototype.toString), Fa = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), Ia = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), La = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), Ra = za(TypeError);
2631
+ var ba = Y(Array.prototype.lastIndexOf), xa = Y(Array.prototype.pop), Sa = Y(Array.prototype.push), Ca = Y(Array.prototype.slice), wa = Y(Array.prototype.splice), Ta = Array.isArray, Ea = Va(Set), Da = Y(Set.prototype.add), Oa = Y(Set.prototype.has), ka = Y(String.prototype.toLowerCase), Aa = Y(String.prototype.toString), ja = Y(String.prototype.match), Ma = Y(String.prototype.replace), Na = Y(String.prototype.indexOf), Pa = Y(String.prototype.trim), Fa = Y(Number.prototype.toString), Ia = Y(Boolean.prototype.toString), La = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), Ra = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), za = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), Ba = Va(TypeError);
2627
2632
  function Y(e) {
2628
2633
  return function(t) {
2629
2634
  t instanceof RegExp && (t.lastIndex = 0);
2630
2635
  var n = [...arguments].slice(1);
2631
- return ha(e, t, n);
2636
+ return _a(e, t, n);
2632
2637
  };
2633
2638
  }
2634
- function za(e) {
2639
+ function Va(e) {
2635
2640
  return function() {
2636
- return ga(e, [...arguments]);
2641
+ return va(e, [...arguments]);
2637
2642
  };
2638
2643
  }
2639
2644
  function X(e, t) {
2640
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Da;
2641
- if (la && la(e, null), !Ca(t)) return e;
2645
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ka;
2646
+ if (da && da(e, null), !Ta(t)) return e;
2642
2647
  let r = t.length;
2643
2648
  for (; r--;) {
2644
2649
  let i = t[r];
2645
2650
  if (typeof i == "string") {
2646
2651
  let e = n(i);
2647
- e !== i && (ua(t) || (t[r] = e), i = e);
2652
+ e !== i && (fa(t) || (t[r] = e), i = e);
2648
2653
  }
2649
2654
  e[i] = !0;
2650
2655
  }
2651
2656
  return e;
2652
2657
  }
2653
- function Ba(e) {
2658
+ function Ha(e) {
2654
2659
  for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
2655
2660
  return e;
2656
2661
  }
2657
2662
  function Z(e) {
2658
- let t = pa(null);
2659
- for (let r of ca(e)) {
2660
- var n = aa(r, 2);
2663
+ let t = ha(null);
2664
+ for (let r of ua(e)) {
2665
+ var n = sa(r, 2);
2661
2666
  let i = n[0], a = n[1];
2662
- q(e, i) && (t[i] = Ca(a) ? Ba(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
2667
+ q(e, i) && (t[i] = Ta(a) ? Ha(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
2663
2668
  }
2664
2669
  return t;
2665
2670
  }
2666
- function Va(e) {
2671
+ function Ua(e) {
2667
2672
  switch (typeof e) {
2668
2673
  case "string": return e;
2669
- case "number": return Na(e);
2670
- case "boolean": return Pa(e);
2671
- case "bigint": return Fa ? Fa(e) : "0";
2672
- case "symbol": return Ia ? Ia(e) : "Symbol()";
2673
- case "undefined": return La(e);
2674
+ case "number": return Fa(e);
2675
+ case "boolean": return Ia(e);
2676
+ case "bigint": return La ? La(e) : "0";
2677
+ case "symbol": return Ra ? Ra(e) : "Symbol()";
2678
+ case "undefined": return za(e);
2674
2679
  case "function":
2675
2680
  case "object": {
2676
- if (e === null) return La(e);
2681
+ if (e === null) return za(e);
2677
2682
  let t = e, n = Q(t, "toString");
2678
2683
  if (typeof n == "function") {
2679
2684
  let e = n(t);
2680
- return typeof e == "string" ? e : La(e);
2685
+ return typeof e == "string" ? e : za(e);
2681
2686
  }
2682
- return La(e);
2687
+ return za(e);
2683
2688
  }
2684
- default: return La(e);
2689
+ default: return za(e);
2685
2690
  }
2686
2691
  }
2687
2692
  function Q(e, t) {
2688
2693
  for (; e !== null;) {
2689
- let n = fa(e, t);
2694
+ let n = ma(e, t);
2690
2695
  if (n) {
2691
2696
  if (n.get) return Y(n.get);
2692
2697
  if (typeof n.value == "function") return Y(n.value);
2693
2698
  }
2694
- e = da(e);
2699
+ e = pa(e);
2695
2700
  }
2696
2701
  function n() {
2697
2702
  return null;
2698
2703
  }
2699
2704
  return n;
2700
2705
  }
2701
- function Ha(e, t) {
2706
+ function Wa(e, t) {
2702
2707
  for (; e !== null;) {
2703
- let n = fa(e, t);
2708
+ let n = ma(e, t);
2704
2709
  if (n) return n.get ? Y(n.get) : null;
2705
- e = da(e);
2710
+ e = pa(e);
2706
2711
  }
2707
2712
  return null;
2708
2713
  }
2709
- function Ua(e) {
2714
+ function Ga(e) {
2710
2715
  try {
2711
2716
  return J(e, ""), !0;
2712
2717
  } catch {
2713
2718
  return !1;
2714
2719
  }
2715
2720
  }
2716
- var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Ga = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ka = G([
2721
+ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), qa = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ja = G([
2717
2722
  "feBlend",
2718
2723
  "feColorMatrix",
2719
2724
  "feComponentTransfer",
@@ -2739,7 +2744,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2739
2744
  "feSpotLight",
2740
2745
  "feTile",
2741
2746
  "feTurbulence"
2742
- ]), qa = G([
2747
+ ]), Ya = G([
2743
2748
  "animate",
2744
2749
  "color-profile",
2745
2750
  "cursor",
@@ -2762,7 +2767,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2762
2767
  "solidcolor",
2763
2768
  "unknown",
2764
2769
  "use"
2765
- ]), Ja = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Ya = G([
2770
+ ]), Xa = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Za = G([
2766
2771
  "maction",
2767
2772
  "maligngroup",
2768
2773
  "malignmark",
@@ -2778,13 +2783,13 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2778
2783
  "annotation-xml",
2779
2784
  "mprescripts",
2780
2785
  "none"
2781
- ]), Xa = G(["#text"]), Za = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Qa = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), $a = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), eo = G([
2786
+ ]), Qa = G(["#text"]), $a = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), eo = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), to = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), no = G([
2782
2787
  "xlink:href",
2783
2788
  "xml:id",
2784
2789
  "xlink:title",
2785
2790
  "xml:space",
2786
2791
  "xmlns:xlink"
2787
- ]), to = K(/{{[\w\W]*|^[\w\W]*}}/g), no = K(/<%[\w\W]*|^[\w\W]*%>/g), ro = K(/\${[\w\W]*/g), io = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), ao = K(/^aria-[\-\w]+$/), oo = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), so = K(/^(?:\w+script|data):/i), co = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), lo = K(/^html$/i), uo = K(/^[a-z][.\w]*(-[.\w]+)+$/i), fo = K(/<[/\w!]/g), po = K(/<[/\w]/g), mo = K(/<\/no(script|embed|frames)/i), ho = K(/\/>/i), $ = {
2792
+ ]), ro = K(/{{[\w\W]*|^[\w\W]*}}/g), io = K(/<%[\w\W]*|^[\w\W]*%>/g), ao = K(/\${[\w\W]*/g), oo = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), so = K(/^aria-[\-\w]+$/), co = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), lo = K(/^(?:\w+script|data):/i), uo = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), fo = K(/^html$/i), po = K(/^[a-z][.\w]*(-[.\w]+)+$/i), mo = K(/<[/\w!]/g), ho = K(/<[/\w]/g), go = K(/<\/no(script|embed|frames)/i), _o = K(/\/>/i), $ = {
2788
2793
  element: 1,
2789
2794
  attribute: 2,
2790
2795
  text: 3,
@@ -2797,7 +2802,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2797
2802
  documentType: 10,
2798
2803
  documentFragment: 11,
2799
2804
  notation: 12
2800
- }, go = G(X({}, [
2805
+ }, vo = G(X({}, [
2801
2806
  "style",
2802
2807
  "script",
2803
2808
  "xmp",
@@ -2806,9 +2811,9 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2806
2811
  "noframes",
2807
2812
  "plaintext",
2808
2813
  "noscript"
2809
- ])), _o = function() {
2814
+ ])), yo = function() {
2810
2815
  return typeof window > "u" ? null : window;
2811
- }, vo = function(e, t) {
2816
+ }, bo = function(e, t) {
2812
2817
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
2813
2818
  let n = null, r = "data-tt-policy-suffix";
2814
2819
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -2825,7 +2830,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2825
2830
  } catch {
2826
2831
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
2827
2832
  }
2828
- }, yo = function() {
2833
+ }, xo = function() {
2829
2834
  return {
2830
2835
  afterSanitizeAttributes: [],
2831
2836
  afterSanitizeElements: [],
@@ -2837,62 +2842,62 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2837
2842
  uponSanitizeElement: [],
2838
2843
  uponSanitizeShadowNode: []
2839
2844
  };
2840
- }, bo = function(e, t, n, r) {
2841
- return q(e, t) && Ca(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
2842
- }, xo = function(e, t, n) {
2845
+ }, So = function(e, t, n, r) {
2846
+ return q(e, t) && Ta(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
2847
+ }, Co = function(e, t, n) {
2843
2848
  let r = q(e, t) ? e[t] : void 0;
2844
2849
  return r && typeof r == "object" ? Z(r) : n();
2845
2850
  };
2846
- function So() {
2847
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _o(), t = (e) => So(e);
2851
+ function wo() {
2852
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : yo(), t = (e) => wo(e);
2848
2853
  if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
2849
2854
  let n = e.document, r = n, i = r.currentScript;
2850
2855
  e.DocumentFragment;
2851
2856
  let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
2852
2857
  e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
2853
- let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), te = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), ie = Q(d, "attributes"), h = o && o.prototype ? Q(o.prototype, "nodeType") : null, g = o && o.prototype ? Q(o.prototype, "nodeName") : null, ae = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, _ = function(e) {
2854
- return h ? h(e) : e.nodeType;
2855
- }, oe = function(e) {
2858
+ let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), h = Q(d, "childNodes"), te = Q(d, "parentNode"), ne = Q(d, "shadowRoot"), re = Q(d, "attributes"), ie = o && o.prototype ? Q(o.prototype, "nodeType") : null, g = o && o.prototype ? Q(o.prototype, "nodeName") : null, _ = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, v = function(e) {
2859
+ return ie ? ie(e) : e.nodeType;
2860
+ }, ae = function(e) {
2856
2861
  return g ? g(e) : e.nodeName;
2857
- }, se = Ha(d, "namespaceURI"), ce = function(e) {
2858
- return se ? se(e) : e.namespaceURI;
2862
+ }, oe = Wa(d, "namespaceURI"), se = function(e) {
2863
+ return oe ? oe(e) : e.namespaceURI;
2859
2864
  };
2860
2865
  if (typeof a == "function") {
2861
2866
  let e = n.createElement("template");
2862
2867
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
2863
2868
  }
2864
- let v, y = "", le, ue = !1, b = 0, x = function() {
2865
- if (b > 0) throw Ra("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
2866
- }, S = function(e) {
2867
- x(), b++;
2869
+ let y, b = "", ce, le = !1, ue = 0, de = function() {
2870
+ if (ue > 0) throw Ba("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
2871
+ }, x = function(e) {
2872
+ de(), ue++;
2868
2873
  try {
2869
- return v.createHTML(e);
2874
+ return y.createHTML(e);
2870
2875
  } finally {
2871
- b--;
2876
+ ue--;
2872
2877
  }
2873
- }, de = function(e) {
2874
- x(), b++;
2878
+ }, fe = function(e) {
2879
+ de(), ue++;
2875
2880
  try {
2876
- return v.createScriptURL(e);
2881
+ return y.createScriptURL(e);
2877
2882
  } finally {
2878
- b--;
2879
- }
2880
- }, C = function() {
2881
- return ue ||= (le = vo(u, i), !0), le;
2882
- }, fe = n, pe = fe.implementation, me = fe.createNodeIterator, he = fe.createDocumentFragment, ge = fe.getElementsByTagName, _e = r.importNode, w = yo();
2883
- t.isSupported = typeof ca == "function" && typeof ne == "function" && pe && pe.createHTMLDocument !== void 0;
2884
- let ve = to, ye = no, be = ro, xe = io, Se = ao, Ce = so, we = co, Te = uo, Ee = oo, T = null, De = X({}, [
2885
- ...Wa,
2886
- ...Ga,
2883
+ ue--;
2884
+ }
2885
+ }, S = function() {
2886
+ return le ||= (ce = bo(u, i), !0), ce;
2887
+ }, pe = n, me = pe.implementation, he = pe.createNodeIterator, ge = pe.createDocumentFragment, _e = pe.getElementsByTagName, ve = r.importNode, C = xo();
2888
+ t.isSupported = typeof ua == "function" && typeof te == "function" && me && me.createHTMLDocument !== void 0;
2889
+ let ye = ro, be = io, xe = ao, Se = oo, Ce = so, we = lo, Te = uo, Ee = po, De = co, w = null, Oe = X({}, [
2887
2890
  ...Ka,
2891
+ ...qa,
2888
2892
  ...Ja,
2889
- ...Xa
2890
- ]), E = null, Oe = X({}, [
2891
- ...Za,
2892
- ...Qa,
2893
+ ...Xa,
2894
+ ...Qa
2895
+ ]), T = null, ke = X({}, [
2893
2896
  ...$a,
2894
- ...eo
2895
- ]), D = Object.seal(pa(null, {
2897
+ ...eo,
2898
+ ...to,
2899
+ ...no
2900
+ ]), E = Object.seal(ha(null, {
2896
2901
  tagNameCheck: {
2897
2902
  writable: !0,
2898
2903
  configurable: !1,
@@ -2911,7 +2916,7 @@ function So() {
2911
2916
  enumerable: !0,
2912
2917
  value: !1
2913
2918
  }
2914
- })), ke = null, Ae = null, je = Object.seal(pa(null, {
2919
+ })), Ae = null, je = null, Me = Object.seal(ha(null, {
2915
2920
  tagCheck: {
2916
2921
  writable: !0,
2917
2922
  configurable: !1,
@@ -2924,14 +2929,14 @@ function So() {
2924
2929
  enumerable: !0,
2925
2930
  value: null
2926
2931
  }
2927
- })), Me = !0, Ne = !0, Pe = !1, Fe = !0, O = !1, Ie = !0, Le = !1, Re = !1, ze = null, Be = null, Ve = !1, He = !1, Ue = !1, We = !1, Ge = !0, Ke = !1, k = "user-content-", qe = !0, Je = !1, Ye = null, Xe = {}, Ze = null, Qe = X({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), $e = null, et = X({}, [
2932
+ })), Ne = !0, Pe = !0, Fe = !1, Ie = !0, D = !1, Le = !0, Re = !1, ze = !1, Be = null, Ve = null, He = !1, Ue = !1, We = !1, Ge = !1, Ke = !0, qe = !1, Je = "user-content-", Ye = !0, O = !1, Xe = null, Ze = {}, Qe = null, $e = X({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), et = null, tt = X({}, [
2928
2933
  "audio",
2929
2934
  "video",
2930
2935
  "img",
2931
2936
  "source",
2932
2937
  "image",
2933
2938
  "track"
2934
- ]), tt = null, nt = X({}, [
2939
+ ]), nt = null, rt = X({}, [
2935
2940
  "alt",
2936
2941
  "class",
2937
2942
  "for",
@@ -2946,72 +2951,72 @@ function So() {
2946
2951
  "value",
2947
2952
  "style",
2948
2953
  "xmlns"
2949
- ]), rt = "http://www.w3.org/1998/Math/MathML", it = "http://www.w3.org/2000/svg", A = "http://www.w3.org/1999/xhtml", at = A, ot = !1, st = null, ct = X({}, [
2950
- rt,
2954
+ ]), it = "http://www.w3.org/1998/Math/MathML", at = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml", ot = k, st = !1, ct = null, lt = X({}, [
2951
2955
  it,
2952
- A
2953
- ], Oa), j = G([
2956
+ at,
2957
+ k
2958
+ ], Aa), ut = G([
2954
2959
  "mi",
2955
2960
  "mo",
2956
2961
  "mn",
2957
2962
  "ms",
2958
2963
  "mtext"
2959
- ]), lt = X({}, j), ut = G(["annotation-xml"]), dt = X({}, ut), ft = X({}, [
2964
+ ]), dt = X({}, ut), A = G(["annotation-xml"]), ft = X({}, A), pt = X({}, [
2960
2965
  "title",
2961
2966
  "style",
2962
2967
  "font",
2963
2968
  "a",
2964
2969
  "script"
2965
- ]), pt = null, mt = ["application/xhtml+xml", "text/html"], M = null, ht = null, gt = n.createElement("form"), _t = function(e) {
2970
+ ]), mt = null, ht = ["application/xhtml+xml", "text/html"], j = null, gt = null, _t = n.createElement("form"), vt = function(e) {
2966
2971
  return e instanceof RegExp || e instanceof Function;
2967
- }, vt = function() {
2972
+ }, yt = function() {
2968
2973
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2969
- if (ht && ht === e) return;
2970
- (!e || typeof e != "object") && (e = {}), e = Z(e), pt = mt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, M = pt === "application/xhtml+xml" ? Oa : Da, T = bo(e, "ALLOWED_TAGS", De, { transform: M }), E = bo(e, "ALLOWED_ATTR", Oe, { transform: M }), st = bo(e, "ALLOWED_NAMESPACES", ct, { transform: Oa }), tt = bo(e, "ADD_URI_SAFE_ATTR", nt, {
2971
- transform: M,
2972
- base: nt
2973
- }), $e = bo(e, "ADD_DATA_URI_TAGS", et, {
2974
- transform: M,
2975
- base: et
2976
- }), Ze = bo(e, "FORBID_CONTENTS", Qe, { transform: M }), ke = bo(e, "FORBID_TAGS", Z({}), { transform: M }), Ae = bo(e, "FORBID_ATTR", Z({}), { transform: M }), Xe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Me = e.ALLOW_ARIA_ATTR !== !1, Ne = e.ALLOW_DATA_ATTR !== !1, Pe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Fe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, O = e.SAFE_FOR_TEMPLATES || !1, Ie = e.SAFE_FOR_XML !== !1, Le = e.WHOLE_DOCUMENT || !1, He = e.RETURN_DOM || !1, Ue = e.RETURN_DOM_FRAGMENT || !1, We = e.RETURN_TRUSTED_TYPE || !1, Ve = e.FORCE_BODY || !1, Ge = e.SANITIZE_DOM !== !1, Ke = e.SANITIZE_NAMED_PROPS || !1, qe = e.KEEP_CONTENT !== !1, Je = e.IN_PLACE || !1, Ee = Ua(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : oo, at = typeof e.NAMESPACE == "string" ? e.NAMESPACE : A, lt = xo(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, j)), dt = xo(e, "HTML_INTEGRATION_POINTS", () => X({}, ut));
2977
- let t = xo(e, "CUSTOM_ELEMENT_HANDLING", () => pa(null));
2978
- if (D = pa(null), q(t, "tagNameCheck") && _t(t.tagNameCheck) && (D.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && _t(t.attributeNameCheck) && (D.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (D.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(D), O && (Ne = !1), Ue && (He = !0), Xe && (T = X({}, Xa), E = pa(null), Xe.html === !0 && (X(T, Wa), X(E, Za)), Xe.svg === !0 && (X(T, Ga), X(E, Qa), X(E, eo)), Xe.svgFilters === !0 && (X(T, Ka), X(E, Qa), X(E, eo)), Xe.mathMl === !0 && (X(T, Ja), X(E, $a), X(E, eo))), je.tagCheck = null, je.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? je.tagCheck = e.ADD_TAGS : Ca(e.ADD_TAGS) && (T === De && (T = Z(T)), X(T, e.ADD_TAGS, M))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? je.attributeCheck = e.ADD_ATTR : Ca(e.ADD_ATTR) && (E === Oe && (E = Z(E)), X(E, e.ADD_ATTR, M))), q(e, "ADD_FORBID_CONTENTS") && Ca(e.ADD_FORBID_CONTENTS) && (Ze === Qe && (Ze = Z(Ze)), X(Ze, e.ADD_FORBID_CONTENTS, M)), qe && (T["#text"] = !0), Le && X(T, [
2974
+ if (gt && gt === e) return;
2975
+ (!e || typeof e != "object") && (e = {}), e = Z(e), mt = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, j = mt === "application/xhtml+xml" ? Aa : ka, w = So(e, "ALLOWED_TAGS", Oe, { transform: j }), T = So(e, "ALLOWED_ATTR", ke, { transform: j }), ct = So(e, "ALLOWED_NAMESPACES", lt, { transform: Aa }), nt = So(e, "ADD_URI_SAFE_ATTR", rt, {
2976
+ transform: j,
2977
+ base: rt
2978
+ }), et = So(e, "ADD_DATA_URI_TAGS", tt, {
2979
+ transform: j,
2980
+ base: tt
2981
+ }), Qe = So(e, "FORBID_CONTENTS", $e, { transform: j }), Ae = So(e, "FORBID_TAGS", Z({}), { transform: j }), je = So(e, "FORBID_ATTR", Z({}), { transform: j }), Ze = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Ne = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, Fe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ie = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, D = e.SAFE_FOR_TEMPLATES || !1, Le = e.SAFE_FOR_XML !== !1, Re = e.WHOLE_DOCUMENT || !1, Ue = e.RETURN_DOM || !1, We = e.RETURN_DOM_FRAGMENT || !1, Ge = e.RETURN_TRUSTED_TYPE || !1, He = e.FORCE_BODY || !1, Ke = e.SANITIZE_DOM !== !1, qe = e.SANITIZE_NAMED_PROPS || !1, Ye = e.KEEP_CONTENT !== !1, O = e.IN_PLACE || !1, De = Ga(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : co, ot = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, dt = Co(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, ut)), ft = Co(e, "HTML_INTEGRATION_POINTS", () => X({}, A));
2982
+ let t = Co(e, "CUSTOM_ELEMENT_HANDLING", () => ha(null));
2983
+ if (E = ha(null), q(t, "tagNameCheck") && vt(t.tagNameCheck) && (E.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && vt(t.attributeNameCheck) && (E.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(E), D && (Pe = !1), We && (Ue = !0), Ze && (w = X({}, Qa), T = ha(null), Ze.html === !0 && (X(w, Ka), X(T, $a)), Ze.svg === !0 && (X(w, qa), X(T, eo), X(T, no)), Ze.svgFilters === !0 && (X(w, Ja), X(T, eo), X(T, no)), Ze.mathMl === !0 && (X(w, Xa), X(T, to), X(T, no))), Me.tagCheck = null, Me.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Me.tagCheck = e.ADD_TAGS : Ta(e.ADD_TAGS) && (w === Oe && (w = Z(w)), X(w, e.ADD_TAGS, j))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Me.attributeCheck = e.ADD_ATTR : Ta(e.ADD_ATTR) && (T === ke && (T = Z(T)), X(T, e.ADD_ATTR, j))), q(e, "ADD_FORBID_CONTENTS") && Ta(e.ADD_FORBID_CONTENTS) && (Qe === $e && (Qe = Z(Qe)), X(Qe, e.ADD_FORBID_CONTENTS, j)), Ye && (w["#text"] = !0), Re && X(w, [
2979
2984
  "html",
2980
2985
  "head",
2981
2986
  "body"
2982
- ]), T.table && (X(T, ["tbody"]), delete ke.tbody), e.TRUSTED_TYPES_POLICY) {
2983
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Ra("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
2984
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Ra("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
2985
- let t = v;
2986
- v = e.TRUSTED_TYPES_POLICY;
2987
+ ]), w.table && (X(w, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
2988
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Ba("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
2989
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Ba("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
2990
+ let t = y;
2991
+ y = e.TRUSTED_TYPES_POLICY;
2987
2992
  try {
2988
- y = S("");
2993
+ b = x("");
2989
2994
  } catch (e) {
2990
- throw v = t, e;
2995
+ throw y = t, e;
2991
2996
  }
2992
- } else e.TRUSTED_TYPES_POLICY === null ? (v = void 0, y = "") : (v === void 0 && (v = C()), v && typeof y == "string" && (y = S("")));
2993
- G && G(e), ht = e;
2994
- }, yt = X({}, [
2995
- ...Ga,
2996
- ...Ka,
2997
- ...qa
2998
- ]), bt = X({}, [...Ja, ...Ya]), xt = function(e, t, n) {
2999
- return t.namespaceURI === A ? e === "svg" : t.namespaceURI === rt ? e === "svg" && (n === "annotation-xml" || lt[n]) : !!yt[e];
3000
- }, St = function(e, t, n) {
3001
- return t.namespaceURI === A ? e === "math" : t.namespaceURI === it ? e === "math" && dt[n] : !!bt[e];
2997
+ } else e.TRUSTED_TYPES_POLICY === null ? (y = void 0, b = "") : (y === void 0 && (y = S()), y && typeof b == "string" && (b = x("")));
2998
+ G && G(e), gt = e;
2999
+ }, bt = X({}, [
3000
+ ...qa,
3001
+ ...Ja,
3002
+ ...Ya
3003
+ ]), xt = X({}, [...Xa, ...Za]), St = function(e, t, n) {
3004
+ return t.namespaceURI === k ? e === "svg" : t.namespaceURI === it ? e === "svg" && (n === "annotation-xml" || dt[n]) : !!bt[e];
3002
3005
  }, Ct = function(e, t, n) {
3003
- return t.namespaceURI === it && !dt[n] || t.namespaceURI === rt && !lt[n] ? !1 : !bt[e] && (ft[e] || !yt[e]);
3004
- }, wt = function(e) {
3005
- let t = ce(e), n = Da(oe(e)), r = ne(e), i, a;
3006
- return r && _(r) === $.element ? (i = { namespaceURI: ce(r) }, a = Da(oe(r))) : (i = { namespaceURI: at }, a = "template"), st[t] ? t === it ? xt(n, i, a) : t === rt ? St(n, i, a) : t === A ? Ct(n, i, a) : !!(pt === "application/xhtml+xml" && st[t]) : !1;
3007
- }, N = function(e) {
3008
- ba(t.removed, { element: e });
3006
+ return t.namespaceURI === k ? e === "math" : t.namespaceURI === at ? e === "math" && ft[n] : !!xt[e];
3007
+ }, wt = function(e, t, n) {
3008
+ return t.namespaceURI === at && !ft[n] || t.namespaceURI === it && !dt[n] ? !1 : !xt[e] && (pt[e] || !bt[e]);
3009
+ }, Tt = function(e) {
3010
+ let t = se(e), n = ka(ae(e)), r = te(e), i, a;
3011
+ return r && v(r) === $.element ? (i = { namespaceURI: se(r) }, a = ka(ae(r))) : (i = { namespaceURI: ot }, a = "template"), ct[t] ? t === at ? St(n, i, a) : t === it ? Ct(n, i, a) : t === k ? wt(n, i, a) : !!(mt === "application/xhtml+xml" && ct[t]) : !1;
3012
+ }, M = function(e) {
3013
+ Sa(t.removed, { element: e });
3009
3014
  try {
3010
- ne(e).removeChild(e);
3015
+ te(e).removeChild(e);
3011
3016
  } catch {
3012
- if (p(e), !ne(e)) throw Ra("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
3017
+ if (p(e), !te(e)) throw Ba("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
3013
3018
  }
3014
- }, Tt = function(e, t, n) {
3019
+ }, Et = function(e, t, n) {
3015
3020
  try {
3016
3021
  ee(e, t);
3017
3022
  } catch {
@@ -3019,18 +3024,18 @@ function So() {
3019
3024
  e.removeAttribute(n);
3020
3025
  } catch {}
3021
3026
  }
3022
- }, Et = function(e) {
3027
+ }, N = function(e) {
3023
3028
  At(e);
3024
- let t = te(e);
3025
- t && _a(xa(t), (e) => {
3029
+ let t = h(e);
3030
+ t && ya(Ca(t), (e) => {
3026
3031
  try {
3027
3032
  p(e);
3028
3033
  } catch {}
3029
3034
  });
3030
- let n = _(e) === $.element ? ie(e) : null;
3035
+ let n = v(e) === $.element ? re(e) : null;
3031
3036
  if (n) for (let t = n.length - 1; t >= 0; --t) {
3032
3037
  let r = n[t], i = r && r.name;
3033
- typeof i == "string" && Tt(e, r, i);
3038
+ typeof i == "string" && Et(e, r, i);
3034
3039
  }
3035
3040
  }, Dt = function(e, n, r) {
3036
3041
  if (!r) try {
@@ -3038,7 +3043,7 @@ function So() {
3038
3043
  } catch {
3039
3044
  r = null;
3040
3045
  }
3041
- ba(t.removed, {
3046
+ Sa(t.removed, {
3042
3047
  attribute: r || null,
3043
3048
  from: n
3044
3049
  });
@@ -3050,34 +3055,34 @@ function So() {
3050
3055
  } catch {}
3051
3056
  }
3052
3057
  if (e === "is") {
3053
- if (He || Ue) try {
3054
- N(n);
3058
+ if (Ue || We) try {
3059
+ M(n);
3055
3060
  } catch {}
3056
3061
  else try {
3057
3062
  n.setAttribute(e, "");
3058
3063
  } catch {}
3059
3064
  }
3060
3065
  }, Ot = function(e) {
3061
- let t = ie(e);
3066
+ let t = re(e);
3062
3067
  if (t) for (let n = t.length - 1; n >= 0; --n) {
3063
3068
  let r = t[n], i = r && r.name;
3064
- typeof i != "string" || E[M(i)] || Tt(e, r, i);
3069
+ typeof i != "string" || T[j(i)] || Et(e, r, i);
3065
3070
  }
3066
3071
  }, kt = function(e, t) {
3067
3072
  let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
3068
3073
  for (; r.length > 0;) {
3069
3074
  let e = r.pop();
3070
3075
  if (t(e) === !1) continue;
3071
- if (n && _(e) === $.element) {
3072
- let t = re(e);
3073
- Wt(t) && r.push(t);
3076
+ if (n && v(e) === $.element) {
3077
+ let t = ne(e);
3078
+ F(t) && r.push(t);
3074
3079
  }
3075
- let i = te(e);
3080
+ let i = h(e);
3076
3081
  if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
3077
3082
  }
3078
3083
  }, At = function(e) {
3079
3084
  kt(e, (e) => {
3080
- _(e) === $.element && Ot(e);
3085
+ v(e) === $.element && Ot(e);
3081
3086
  });
3082
3087
  }, jt = function(e) {
3083
3088
  let t = [];
@@ -3085,49 +3090,49 @@ function So() {
3085
3090
  t.push(e);
3086
3091
  }, !0), t;
3087
3092
  }, Mt = function(e, t) {
3088
- let n = wa();
3089
- _a(jt(e), (e) => {
3090
- _(e) === $.element && Ta(n, e);
3091
- }), _a(t, (e) => {
3092
- _(e) === $.element && !Ea(n, e) && Ot(e);
3093
+ let n = Ea();
3094
+ ya(jt(e), (e) => {
3095
+ v(e) === $.element && Da(n, e);
3096
+ }), ya(t, (e) => {
3097
+ v(e) === $.element && !Oa(n, e) && Ot(e);
3093
3098
  });
3094
3099
  }, Nt = function(e, n) {
3095
3100
  let r = !1;
3096
- return _a(t.removed, (t) => {
3101
+ return ya(t.removed, (t) => {
3097
3102
  t.element && (r ||= t.element === e, At(t.element));
3098
3103
  }), Mt(e, n), r;
3099
3104
  }, Pt = function(e, t) {
3100
- let n = Ye, r = null, i = () => (r || (r = wa(), _a(t, (e) => {
3101
- Ta(r, e);
3105
+ let n = Xe, r = null, i = () => (r || (r = Ea(), ya(t, (e) => {
3106
+ Da(r, e);
3102
3107
  })), r);
3103
3108
  for (let t = 0;; t++) {
3104
3109
  let r = jt(e), a = [e], o = !1;
3105
- if (_a(r, (e) => {
3106
- _(e) === $.documentFragment ? ba(a, e) : !o && !Ea(n, e) && (o = Ea(i(), e));
3110
+ if (ya(r, (e) => {
3111
+ v(e) === $.documentFragment ? Sa(a, e) : !o && !Oa(n, e) && (o = Oa(i(), e));
3107
3112
  }), !o) return;
3108
- if (t >= 8) throw Ra("the tree kept changing during in-place sanitization; refusing to return it");
3109
- _a(a, (t, n) => {
3113
+ if (t >= 8) throw Ba("the tree kept changing during in-place sanitization; refusing to return it");
3114
+ ya(a, (t, n) => {
3110
3115
  Ft(t, n > 0, e, i());
3111
3116
  });
3112
3117
  }
3113
3118
  }, Ft = function(e, t, n, r) {
3114
3119
  let i = Bt(e), a;
3115
- for (; a = i.nextNode();) Ea(r, a) && !Ea(Ye, a) && (t && I(w.uponSanitizeShadowNode, a, null), Xt(a, n), nn(a, n), Wt(a.content) && rn(a.content));
3120
+ for (; a = i.nextNode();) Oa(r, a) && !Oa(Xe, a) && (t && I(C.uponSanitizeShadowNode, a, null), Xt(a, n), rn(a, n), F(a.content) && L(a.content));
3116
3121
  }, It = function(e) {
3117
- Ye && Ta(Ye, e);
3122
+ Xe && Da(Xe, e);
3118
3123
  }, Lt = function(e, t) {
3119
- return Ie ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
3124
+ return Le ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
3120
3125
  }, Rt = function(e) {
3121
- Ie && kt(e, (e) => {
3122
- let t = _(e);
3123
- if (t === $.processingInstruction || t === $.comment && J(po, e.data)) {
3126
+ Le && kt(e, (e) => {
3127
+ let t = v(e);
3128
+ if (t === $.processingInstruction || t === $.comment && J(ho, e.data)) {
3124
3129
  try {
3125
3130
  p(e);
3126
3131
  } catch {}
3127
3132
  return !1;
3128
3133
  }
3129
3134
  if (t === $.element) {
3130
- let t = e, n = M(oe(e));
3135
+ let t = e, n = j(ae(e));
3131
3136
  try {
3132
3137
  t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Lt("for", n) && t.removeAttribute("for");
3133
3138
  } catch {}
@@ -3136,70 +3141,70 @@ function So() {
3136
3141
  });
3137
3142
  }, zt = function(e) {
3138
3143
  let t = null, r = null;
3139
- if (Ve) e = "<remove></remove>" + e;
3144
+ if (He) e = "<remove></remove>" + e;
3140
3145
  else {
3141
- let t = ka(e, /^[\r\n\t ]+/);
3146
+ let t = ja(e, /^[\r\n\t ]+/);
3142
3147
  r = t && t[0];
3143
3148
  }
3144
- pt === "application/xhtml+xml" && at === A && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
3145
- let i = v ? S(e) : e;
3146
- if (at === A) try {
3147
- t = new l().parseFromString(i, pt);
3149
+ mt === "application/xhtml+xml" && ot === k && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
3150
+ let i = y ? x(e) : e;
3151
+ if (ot === k) try {
3152
+ t = new l().parseFromString(i, mt);
3148
3153
  } catch {}
3149
3154
  if (!t || !t.documentElement) {
3150
- t = pe.createDocument(at, "template", null);
3155
+ t = me.createDocument(ot, "template", null);
3151
3156
  try {
3152
- t.documentElement.innerHTML = ot ? y : i;
3157
+ t.documentElement.innerHTML = st ? b : i;
3153
3158
  } catch {}
3154
3159
  }
3155
3160
  let a = t.body || t.documentElement;
3156
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), at === A ? ge.call(t, Le ? "html" : "body")[0] : Le ? t.documentElement : a;
3161
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ot === k ? _e.call(t, Re ? "html" : "body")[0] : Re ? t.documentElement : a;
3157
3162
  }, Bt = function(e) {
3158
- let t = ae ? ae(e) : e.ownerDocument;
3159
- return me.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
3163
+ let t = _ ? _(e) : e.ownerDocument;
3164
+ return he.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
3160
3165
  }, Vt = function(e) {
3161
- return e = Aa(e, ve, " "), e = Aa(e, ye, " "), e = Aa(e, be, " "), e;
3162
- }, P = function(e) {
3163
- Ht(e);
3166
+ return e = Ma(e, ye, " "), e = Ma(e, be, " "), e = Ma(e, xe, " "), e;
3167
+ }, Ht = function(e) {
3168
+ Ut(e);
3164
3169
  let t = e.querySelectorAll?.call(e, "template");
3165
- t && _a(t, (e) => {
3166
- Wt(e.content) && P(e.content);
3170
+ t && ya(t, (e) => {
3171
+ F(e.content) && Ht(e.content);
3167
3172
  });
3168
- }, Ht = function(e) {
3173
+ }, Ut = function(e) {
3169
3174
  e.normalize();
3170
- let t = ae ? ae(e) : e.ownerDocument, n = me.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
3175
+ let t = _ ? _(e) : e.ownerDocument, n = he.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
3171
3176
  for (; r;) r.data = Vt(r.data), r = n.nextNode();
3172
- }, Ut = function(e) {
3177
+ }, P = function(e) {
3173
3178
  let t = g ? g(e) : null;
3174
- return typeof t != "string" || M(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ie(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== h(e) || e.childNodes !== te(e);
3175
- }, Wt = function(e) {
3176
- if (!h || typeof e != "object" || !e) return !1;
3179
+ return typeof t != "string" || j(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== re(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== ie(e) || e.childNodes !== h(e);
3180
+ }, F = function(e) {
3181
+ if (!ie || typeof e != "object" || !e) return !1;
3177
3182
  try {
3178
- return h(e) === $.documentFragment;
3183
+ return ie(e) === $.documentFragment;
3179
3184
  } catch {
3180
3185
  return !1;
3181
3186
  }
3182
- }, F = function(e) {
3183
- if (!h || typeof e != "object" || !e) return !1;
3187
+ }, Wt = function(e) {
3188
+ if (!ie || typeof e != "object" || !e) return !1;
3184
3189
  try {
3185
- return typeof h(e) == "number";
3190
+ return typeof ie(e) == "number";
3186
3191
  } catch {
3187
3192
  return !1;
3188
3193
  }
3189
3194
  };
3190
3195
  function I(e, n, r) {
3191
- e.length !== 0 && _a(e, (e) => {
3192
- e.call(t, n, r, ht);
3196
+ e.length !== 0 && ya(e, (e) => {
3197
+ e.call(t, n, r, gt);
3193
3198
  });
3194
3199
  }
3195
3200
  let Gt = function(e, t) {
3196
- return !!(Ie && e.hasChildNodes() && !F(e.firstElementChild) && J(fo, e.textContent) && J(fo, e.innerHTML) || Ie && go[t] && _(e) === $.element && ce(e) === A && (F(e.firstElementChild) || typeof e.textContent == "string" && J(fo, e.textContent)) || e.nodeType === $.processingInstruction || Ie && e.nodeType === $.comment && J(po, e.data));
3201
+ return !!(Le && e.hasChildNodes() && !Wt(e.firstElementChild) && J(mo, e.textContent) && J(mo, e.innerHTML) || Le && vo[t] && v(e) === $.element && se(e) === k && (Wt(e.firstElementChild) || typeof e.textContent == "string" && J(mo, e.textContent)) || e.nodeType === $.processingInstruction || Le && e.nodeType === $.comment && J(ho, e.data));
3197
3202
  }, Kt = function(e, t) {
3198
3203
  return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
3199
3204
  }, qt = function(e, t, n) {
3200
- if (!ke[t] && $t(t) && Kt(D.tagNameCheck, t)) return !1;
3201
- if (qe && !Ze[t] && !Ze[Da(t)]) {
3202
- let t = ne(e), r = te(e);
3205
+ if (!Ae[t] && $t(t) && Kt(E.tagNameCheck, t)) return !1;
3206
+ if (Ye && !Qe[t] && !Qe[ka(t)]) {
3207
+ let t = te(e), r = h(e);
3203
3208
  if (r && t) {
3204
3209
  let i = r.length;
3205
3210
  for (let a = i - 1; a >= 0; --a) {
@@ -3208,34 +3213,34 @@ function So() {
3208
3213
  }
3209
3214
  }
3210
3215
  }
3211
- return N(e), !0;
3216
+ return M(e), !0;
3212
3217
  }, Jt = function(e, t, n, r) {
3213
3218
  return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
3214
3219
  }, Yt = function(e, t) {
3215
- return e === t || ne(e) !== null ? !1 : (Je && At(e), !0);
3220
+ return e === t || te(e) !== null ? !1 : (O && At(e), !0);
3216
3221
  }, Xt = function(e, n) {
3217
- if (It(e), I(w.beforeSanitizeElements, e, null), Yt(e, n)) return !0;
3218
- if (Ut(e)) return N(e), !0;
3219
- let r = M(oe(e));
3220
- if (T = Jt(w.uponSanitizeElement, T, De, ze), I(w.uponSanitizeElement, e, {
3222
+ if (It(e), I(C.beforeSanitizeElements, e, null), Yt(e, n)) return !0;
3223
+ if (P(e)) return M(e), !0;
3224
+ let r = j(ae(e));
3225
+ if (w = Jt(C.uponSanitizeElement, w, Oe, Be), I(C.uponSanitizeElement, e, {
3221
3226
  tagName: r,
3222
- allowedTags: T
3227
+ allowedTags: w
3223
3228
  }), Yt(e, n)) return !0;
3224
- if (Gt(e, r)) return N(e), !0;
3225
- if (ke[r] || !(je.tagCheck instanceof Function && je.tagCheck(r)) && !T[r]) {
3229
+ if (Gt(e, r)) return M(e), !0;
3230
+ if (Ae[r] || !(Me.tagCheck instanceof Function && Me.tagCheck(r)) && !w[r]) {
3226
3231
  let t = qt(e, r, n);
3227
- return t === !1 && (I(w.afterSanitizeElements, e, null), Yt(e, n)) ? !0 : t;
3232
+ return t === !1 && (I(C.afterSanitizeElements, e, null), Yt(e, n)) ? !0 : t;
3228
3233
  }
3229
- if (_(e) === $.element && !wt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(mo, e.innerHTML)) return N(e), !0;
3230
- if (O && e.nodeType === $.text) {
3234
+ if (v(e) === $.element && !Tt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(go, e.innerHTML)) return M(e), !0;
3235
+ if (D && e.nodeType === $.text) {
3231
3236
  let n = Vt(e.textContent);
3232
- e.textContent !== n && (ba(t.removed, { element: e.cloneNode() }), e.textContent = n);
3237
+ e.textContent !== n && (Sa(t.removed, { element: e.cloneNode() }), e.textContent = n);
3233
3238
  }
3234
- return I(w.afterSanitizeElements, e, null), Yt(e, n);
3239
+ return I(C.afterSanitizeElements, e, null), Yt(e, n);
3235
3240
  }, Zt = function(e, t, r) {
3236
- if (Ae[t] || Lt(t, e) || Ge && (t === "id" || t === "name") && (r in n || r in gt)) return !1;
3237
- let i = E[t] || je.attributeCheck instanceof Function && je.attributeCheck(t, e);
3238
- return Ne && J(xe, t) || Me && J(Se, t) ? !0 : i ? tt[t] || J(Ee, Aa(r, we, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && ja(r, "data:") === 0 && $e[e] || Pe && !J(Ce, Aa(r, we, "")) ? !0 : !r : $t(e) && Kt(D.tagNameCheck, e) && Kt(D.attributeNameCheck, t, e) || t === "is" && D.allowCustomizedBuiltInElements && Kt(D.tagNameCheck, r);
3241
+ if (je[t] || Lt(t, e) || Ke && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
3242
+ let i = T[t] || Me.attributeCheck instanceof Function && Me.attributeCheck(t, e);
3243
+ return Pe && J(Se, t) || Ne && J(Ce, t) ? !0 : i ? nt[t] || J(De, Ma(r, Te, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Na(r, "data:") === 0 && et[e] || Fe && !J(we, Ma(r, Te, "")) ? !0 : !r : $t(e) && Kt(E.tagNameCheck, e) && Kt(E.attributeNameCheck, t, e) || t === "is" && E.allowCustomizedBuiltInElements && Kt(E.tagNameCheck, r);
3239
3244
  }, Qt = X({}, [
3240
3245
  "annotation-xml",
3241
3246
  "color-profile",
@@ -3246,45 +3251,45 @@ function So() {
3246
3251
  "font-face-uri",
3247
3252
  "missing-glyph"
3248
3253
  ]), $t = function(e) {
3249
- return !Qt[Da(e)] && J(Te, e);
3254
+ return !Qt[ka(e)] && J(Ee, e);
3250
3255
  }, en = function(e, t, n, r) {
3251
- if (v && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
3252
- case "TrustedHTML": return S(r);
3253
- case "TrustedScriptURL": return de(r);
3256
+ if (y && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
3257
+ case "TrustedHTML": return x(r);
3258
+ case "TrustedScriptURL": return fe(r);
3254
3259
  }
3255
3260
  return r;
3256
3261
  }, tn = function(e, t, n, r) {
3257
3262
  try {
3258
- return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Ut(e) || (N(e), !1);
3263
+ return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !P(e) || (M(e), !1);
3259
3264
  } catch {
3260
3265
  return Dt(t, e), !1;
3261
3266
  }
3262
- }, L = function(e, t) {
3263
- return Ie && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : Da(e) === "attributename" && ka(t, "href") !== null;
3264
- }, nn = function(e, n) {
3265
- if (I(w.beforeSanitizeAttributes, e, null), Yt(e, n)) return;
3267
+ }, nn = function(e, t) {
3268
+ return Le && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : ka(e) === "attributename" && ja(t, "href") !== null;
3269
+ }, rn = function(e, n) {
3270
+ if (I(C.beforeSanitizeAttributes, e, null), Yt(e, n)) return;
3266
3271
  let r = e.attributes;
3267
- if (!r || Ut(e)) return;
3268
- E = Jt(w.uponSanitizeAttribute, E, Oe, Be);
3272
+ if (!r || P(e)) return;
3273
+ T = Jt(C.uponSanitizeAttribute, T, ke, Ve);
3269
3274
  let i = {
3270
3275
  attrName: "",
3271
3276
  attrValue: "",
3272
3277
  keepAttr: !0,
3273
- allowedAttributes: E,
3278
+ allowedAttributes: T,
3274
3279
  forceKeepAttr: void 0
3275
- }, a = r.length, o = M(e.nodeName);
3280
+ }, a = r.length, o = j(e.nodeName);
3276
3281
  for (; a--;) {
3277
- let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = M(s), d = l, f = s === "value" ? d : Ma(d), p = !1;
3278
- i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(w.uponSanitizeAttribute, e, i), f = i.attrValue, Ke && (u === "id" || u === "name") && ja(f, k) !== 0 && (Dt(s, e, n), f = k + f, p = !0), L(s, f) ? Dt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Fe && J(ho, f) ? Dt(s, e, n) : (O && (f = Vt(f)), Zt(o, u, f) ? (f = en(o, u, c, f), f !== d && tn(e, s, c, f) && p && ya(t.removed)) : Dt(s, e, n)) : Dt(s, e, n));
3282
+ let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = j(s), d = l, f = s === "value" ? d : Pa(d), p = !1;
3283
+ i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(C.uponSanitizeAttribute, e, i), f = i.attrValue, qe && (u === "id" || u === "name") && Na(f, Je) !== 0 && (Dt(s, e, n), f = Je + f, p = !0), nn(s, f) ? Dt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Ie && J(_o, f) ? Dt(s, e, n) : (D && (f = Vt(f)), Zt(o, u, f) ? (f = en(o, u, c, f), f !== d && tn(e, s, c, f) && p && xa(t.removed)) : Dt(s, e, n)) : Dt(s, e, n));
3279
3284
  }
3280
- I(w.afterSanitizeAttributes, e, null), Yt(e, n);
3281
- }, rn = function(e) {
3285
+ I(C.afterSanitizeAttributes, e, null), Yt(e, n);
3286
+ }, L = function(e) {
3282
3287
  let t = null, n = Bt(e);
3283
- for (I(w.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(w.uponSanitizeShadowNode, t, null), Xt(t, e), nn(t, e), Wt(t.content) && rn(t.content), _(t) === $.element) {
3284
- let e = re(t);
3285
- Wt(e) && (an(e), rn(e));
3288
+ for (I(C.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(C.uponSanitizeShadowNode, t, null), Xt(t, e), rn(t, e), F(t.content) && L(t.content), v(t) === $.element) {
3289
+ let e = ne(t);
3290
+ F(e) && (an(e), L(e));
3286
3291
  }
3287
- O && Ht(e), I(w.afterSanitizeShadowDOM, e, null);
3292
+ D && Ut(e), I(C.afterSanitizeShadowDOM, e, null);
3288
3293
  }, an = function(e) {
3289
3294
  let t = [{
3290
3295
  node: e,
@@ -3293,27 +3298,27 @@ function So() {
3293
3298
  for (; t.length > 0;) {
3294
3299
  let e = t.pop();
3295
3300
  if (e.shadow) {
3296
- rn(e.shadow);
3301
+ L(e.shadow);
3297
3302
  continue;
3298
3303
  }
3299
- let n = e.node, r = _(n) === $.element, i = te(n);
3304
+ let n = e.node, r = v(n) === $.element, i = h(n);
3300
3305
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
3301
3306
  node: i[e],
3302
3307
  shadow: null
3303
3308
  });
3304
3309
  if (r) {
3305
3310
  let e = g ? g(n) : null;
3306
- if (typeof e == "string" && M(e) === "template") {
3311
+ if (typeof e == "string" && j(e) === "template") {
3307
3312
  let e = n.content;
3308
- Wt(e) && t.push({
3313
+ F(e) && t.push({
3309
3314
  node: e,
3310
3315
  shadow: null
3311
3316
  });
3312
3317
  }
3313
3318
  }
3314
3319
  if (r) {
3315
- let e = re(n);
3316
- Wt(e) && t.push({
3320
+ let e = ne(n);
3321
+ F(e) && t.push({
3317
3322
  node: null,
3318
3323
  shadow: e
3319
3324
  }, {
@@ -3325,82 +3330,82 @@ function So() {
3325
3330
  };
3326
3331
  return t.sanitize = function(e) {
3327
3332
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
3328
- if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !F(e) && (e = Va(e), typeof e != "string")) throw Ra("dirty is not a string, aborting");
3333
+ if (st = !e, st && (e = "<!-->"), typeof e != "string" && !Wt(e) && (e = Ua(e), typeof e != "string")) throw Ba("dirty is not a string, aborting");
3329
3334
  if (!t.isSupported) return e;
3330
- Re ? (T = ze, E = Be) : vt(n), (w.uponSanitizeElement.length > 0 || w.uponSanitizeAttribute.length > 0) && (T = Z(T)), w.uponSanitizeAttribute.length > 0 && (E = Z(E)), t.removed = [];
3331
- let c = Je && typeof e != "string" && F(e), l = [], u = Ye;
3335
+ ze ? (w = Be, T = Ve) : yt(n), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (w = Z(w)), C.uponSanitizeAttribute.length > 0 && (T = Z(T)), t.removed = [];
3336
+ let c = O && typeof e != "string" && Wt(e), l = [], u = Xe;
3332
3337
  if (c) {
3333
3338
  Rt(e);
3334
- let t = oe(e);
3339
+ let t = ae(e);
3335
3340
  if (typeof t == "string") {
3336
- let n = M(t);
3337
- if (!T[n] || ke[n]) throw Et(e), Ra("root node is forbidden and cannot be sanitized in-place");
3341
+ let n = j(t);
3342
+ if (!w[n] || Ae[n]) throw N(e), Ba("root node is forbidden and cannot be sanitized in-place");
3338
3343
  }
3339
- if (Ut(e)) throw Et(e), Ra("root node is clobbered and cannot be sanitized in-place");
3340
- l = jt(e), Ye = wa();
3341
- } else if (F(e)) i = zt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), an(i);
3344
+ if (P(e)) throw N(e), Ba("root node is clobbered and cannot be sanitized in-place");
3345
+ l = jt(e), Xe = Ea();
3346
+ } else if (Wt(e)) i = zt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), an(i);
3342
3347
  else {
3343
- if (!He && !O && !Le && e.indexOf("<") === -1) return v && We ? S(e) : e;
3344
- if (i = zt(e), !i) return He ? null : We ? y : "";
3348
+ if (!Ue && !D && !Re && e.indexOf("<") === -1) return y && Ge ? x(e) : e;
3349
+ if (i = zt(e), !i) return Ue ? null : Ge ? b : "";
3345
3350
  }
3346
- i && Ve && N(i.firstChild);
3351
+ i && He && M(i.firstChild);
3347
3352
  let d = c ? e : i;
3348
3353
  try {
3349
3354
  c && an(e);
3350
3355
  let t = Bt(d);
3351
- for (; o = t.nextNode();) Xt(o, d), nn(o, d), Wt(o.content) && rn(o.content);
3356
+ for (; o = t.nextNode();) Xt(o, d), rn(o, d), F(o.content) && L(o.content);
3352
3357
  c && Pt(e, l);
3353
3358
  } catch (t) {
3354
- throw c && (Et(e), Nt(e, l)), t;
3359
+ throw c && (N(e), Nt(e, l)), t;
3355
3360
  } finally {
3356
- Ye = u;
3361
+ Xe = u;
3357
3362
  }
3358
3363
  if (c) {
3359
- if (Nt(e, l)) throw Ra("a node selected for removal could not be safely returned; refusing to sanitize in place");
3360
- return O && P(e), e;
3364
+ if (Nt(e, l)) throw Ba("a node selected for removal could not be safely returned; refusing to sanitize in place");
3365
+ return D && Ht(e), e;
3361
3366
  }
3362
- if (He) {
3363
- if (O && P(i), Ue) for (s = he.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
3367
+ if (Ue) {
3368
+ if (D && Ht(i), We) for (s = ge.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
3364
3369
  else s = i;
3365
- return (E.shadowroot || E.shadowrootmode) && (s = _e.call(r, s, !0)), s;
3370
+ return (T.shadowroot || T.shadowrootmode) && (s = ve.call(r, s, !0)), s;
3366
3371
  }
3367
- let f = Le ? i.outerHTML : i.innerHTML;
3368
- return Le && T["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(lo, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), O && (f = Vt(f)), v && We ? S(f) : f;
3372
+ let f = Re ? i.outerHTML : i.innerHTML;
3373
+ return Re && w["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(fo, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), D && (f = Vt(f)), y && Ge ? x(f) : f;
3369
3374
  }, t.setConfig = function() {
3370
3375
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3371
- vt(e), Re = !0, ze = T, Be = E;
3376
+ yt(e), ze = !0, Be = w, Ve = T;
3372
3377
  }, t.clearConfig = function() {
3373
- ht = null, Re = !1, ze = null, Be = null, v = le, y = "";
3378
+ gt = null, ze = !1, Be = null, Ve = null, y = ce, b = "";
3374
3379
  }, t.isValidAttribute = function(e, t, n) {
3375
- ht || vt({});
3376
- let r = M(e), i = M(t);
3377
- return typeof n == "string" && (L(t, n) || !Fe && J(ho, n)) ? !1 : Zt(r, i, n);
3380
+ gt || yt({});
3381
+ let r = j(e), i = j(t);
3382
+ return typeof n == "string" && (nn(t, n) || !Ie && J(_o, n)) ? !1 : Zt(r, i, n);
3378
3383
  }, t.addHook = function(e, t) {
3379
- typeof t == "function" && q(w, e) && ba(w[e], t);
3384
+ typeof t == "function" && q(C, e) && Sa(C[e], t);
3380
3385
  }, t.removeHook = function(e, t) {
3381
- if (q(w, e)) {
3386
+ if (q(C, e)) {
3382
3387
  if (t !== void 0) {
3383
- let n = va(w[e], t);
3384
- return n === -1 ? void 0 : Sa(w[e], n, 1)[0];
3388
+ let n = ba(C[e], t);
3389
+ return n === -1 ? void 0 : wa(C[e], n, 1)[0];
3385
3390
  }
3386
- return ya(w[e]);
3391
+ return xa(C[e]);
3387
3392
  }
3388
3393
  }, t.removeHooks = function(e) {
3389
- q(w, e) && (w[e] = []);
3394
+ q(C, e) && (C[e] = []);
3390
3395
  }, t.removeAllHooks = function() {
3391
- w = yo();
3396
+ C = xo();
3392
3397
  }, t;
3393
3398
  }
3394
- var Co = So();
3399
+ var To = wo();
3395
3400
  //#endregion
3396
3401
  //#region ../../packages/components/src/chat/markdownHtml.ts
3397
- function wo(e) {
3402
+ function Eo(e) {
3398
3403
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
3399
3404
  }
3400
- function To(e, t) {
3405
+ function Do(e, t) {
3401
3406
  return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
3402
3407
  }
3403
- var Eo = {
3408
+ var Oo = {
3404
3409
  ADD_ATTR: ["target"],
3405
3410
  ALLOW_UNKNOWN_PROTOCOLS: !0,
3406
3411
  FORBID_TAGS: [
@@ -3421,21 +3426,21 @@ var Eo = {
3421
3426
  "background"
3422
3427
  ]
3423
3428
  };
3424
- Co.addHook("uponSanitizeAttribute", (e, t) => {
3429
+ To.addHook("uponSanitizeAttribute", (e, t) => {
3425
3430
  t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
3426
3431
  });
3427
- var Do = "data-held-src";
3428
- function Oo(e, t) {
3429
- if (!t) return Co.sanitize(e, Eo);
3430
- let n = Co.sanitize(e, {
3431
- ...Eo,
3432
+ var ko = "data-held-src";
3433
+ function Ao(e, t) {
3434
+ if (!t) return To.sanitize(e, Oo);
3435
+ let n = To.sanitize(e, {
3436
+ ...Oo,
3432
3437
  RETURN_DOM_FRAGMENT: !0
3433
3438
  });
3434
3439
  for (let e of Array.from(n.querySelectorAll("img"))) {
3435
3440
  let n = e.getAttribute("src") ?? "";
3436
3441
  if (t.canLoad(n)) continue;
3437
3442
  let r = e.ownerDocument.createElement("button");
3438
- r.type = "button", r.className = "markdown-held-image", r.setAttribute(Do, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
3443
+ r.type = "button", r.className = "markdown-held-image", r.setAttribute(ko, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
3439
3444
  }
3440
3445
  let r = n.ownerDocument.createElement("div");
3441
3446
  return r.append(n), r.innerHTML;
@@ -3443,7 +3448,7 @@ function Oo(e, t) {
3443
3448
  //#endregion
3444
3449
  //#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
3445
3450
  c(), o();
3446
- var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3451
+ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
3447
3452
  __name: "PkStreamingMarkdown",
3448
3453
  props: {
3449
3454
  markdown: {
@@ -3473,14 +3478,14 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3473
3478
  },
3474
3479
  setup(o) {
3475
3480
  let c = o, { t: l } = f({ useScope: "global" }), m = null;
3476
- function te() {
3481
+ function h() {
3477
3482
  return m ||= import("./dist-BK6ru3gS.js"), m;
3478
3483
  }
3479
- let ne = null;
3480
- function re() {
3481
- return ne ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), ne;
3484
+ let te = null;
3485
+ function ne() {
3486
+ return te ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), te;
3482
3487
  }
3483
- let ie = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, h = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
3488
+ let re = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ie = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
3484
3489
  W.use({ extensions: [{
3485
3490
  name: "inlineKatex",
3486
3491
  level: "inline",
@@ -3489,7 +3494,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3489
3494
  if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
3490
3495
  },
3491
3496
  tokenizer(e) {
3492
- let t = e.match(ie);
3497
+ let t = e.match(re);
3493
3498
  if (t) return {
3494
3499
  type: "inlineKatex",
3495
3500
  raw: t[0],
@@ -3498,13 +3503,13 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3498
3503
  };
3499
3504
  },
3500
3505
  renderer(e) {
3501
- return To(e.text, e.displayMode);
3506
+ return Do(e.text, e.displayMode);
3502
3507
  }
3503
3508
  }, {
3504
3509
  name: "blockKatex",
3505
3510
  level: "block",
3506
3511
  tokenizer(e) {
3507
- let t = e.match(h);
3512
+ let t = e.match(ie);
3508
3513
  if (t) return {
3509
3514
  type: "blockKatex",
3510
3515
  raw: t[0],
@@ -3513,7 +3518,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3513
3518
  };
3514
3519
  },
3515
3520
  renderer(e) {
3516
- return To(e.text, e.displayMode) + "\n";
3521
+ return Do(e.text, e.displayMode) + "\n";
3517
3522
  }
3518
3523
  }] }), W.use({ extensions: [{
3519
3524
  name: "thinking",
@@ -3534,30 +3539,30 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3534
3539
  return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
3535
3540
  }
3536
3541
  }] });
3537
- let g = new W.Renderer(), se = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), v = /^(?:javascript|data|vbscript|file):/i, y = !1, le = (e) => se(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
3542
+ let g = new W.Renderer(), _ = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), se = /^(?:javascript|data|vbscript|file):/i, b = !1, ce = (e) => _(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
3538
3543
  g.link = function({ href: e, title: t, text: n, tokens: r }) {
3539
3544
  let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
3540
- if (!a || v.test(a)) return i;
3541
- let o = y && n === a, s = t || (o ? a : ""), c = s ? ` title="${se(s)}"` : "", l = ae(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
3542
- return `<a href="${se(a)}"${c}${l}>${o ? le(a) : i}</a>`;
3545
+ if (!a || se.test(a)) return i;
3546
+ let o = b && n === a, s = t || (o ? a : ""), c = s ? ` title="${_(s)}"` : "", l = v(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
3547
+ return `<a href="${_(a)}"${c}${l}>${o ? ce(a) : i}</a>`;
3543
3548
  }, g.table = function(e) {
3544
- y = !0;
3549
+ b = !0;
3545
3550
  try {
3546
- let t = e.header.map((e) => se(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
3551
+ let t = e.header.map((e) => _(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
3547
3552
  let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
3548
3553
  return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
3549
3554
  }).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
3550
3555
  return `<div class="table-wrapper u-table-scroll"><table class="${e.header.length >= 3 && e.rows.length ? "u-table u-table--stack" : "u-table"}" role="table"><thead role="rowgroup">${n(e.header)}</thead>${r}</table></div>\n`;
3551
3556
  } finally {
3552
- y = !1;
3557
+ b = !1;
3553
3558
  }
3554
3559
  };
3555
- let b = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
3556
- g.code = ({ text: e }) => b.test(e) ? `<pre class="mermaid">${wo(e)}</pre>` : `<pre><code>${wo(e)}</code></pre>`;
3557
- function x(e) {
3560
+ let le = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
3561
+ g.code = ({ text: e }) => le.test(e) ? `<pre class="mermaid">${Eo(e)}</pre>` : `<pre><code>${Eo(e)}</code></pre>`;
3562
+ function de(e) {
3558
3563
  return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
3559
3564
  }
3560
- function S(e) {
3565
+ function x(e) {
3561
3566
  let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
3562
3567
  for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
3563
3568
  return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
@@ -3569,33 +3574,33 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3569
3574
  }
3570
3575
  }).replace(/\n{3,}/g, "\n\n");
3571
3576
  }
3572
- let de = [
3577
+ let fe = [
3573
3578
  ue,
3574
- S,
3575
- dr,
3576
- x
3577
- ], C = i("container"), fe = _(d(c, "markdown"), Ao), pe = s(() => c.tailLength ? Oe(fe.value, c.tailLength) : fe.value), { resolveText: me } = oe(), he = me(pe), ge = ce(), _e = s(() => {
3578
- let e = de.reduce((e, t) => t(e), he.value);
3579
- return Oo(W.parse(e, {
3579
+ x,
3580
+ pr,
3581
+ de
3582
+ ], S = i("container"), pe = ae(d(c, "markdown"), Mo), me = s(() => c.tailLength ? E(pe.value, c.tailLength) : pe.value), { resolveText: he } = oe(), ge = he(me), _e = y(), ve = s(() => {
3583
+ let e = fe.reduce((e, t) => t(e), ge.value);
3584
+ return Ao(W.parse(e, {
3580
3585
  async: !1,
3581
3586
  breaks: !0,
3582
3587
  renderer: g
3583
- }), ge.isGated.value ? {
3584
- canLoad: ge.canLoad,
3585
- hostOf: ge.hostOf,
3588
+ }), _e.isGated.value ? {
3589
+ canLoad: _e.canLoad,
3590
+ hostOf: _e.hostOf,
3586
3591
  label: (e) => l("label.imageHeld", { host: e })
3587
3592
  } : void 0);
3588
3593
  });
3589
- function w(e) {
3590
- let t = (e.target?.closest?.(`[${Do}]`))?.getAttribute(Do);
3591
- t && (e.preventDefault(), e.stopPropagation(), ge.release(t));
3594
+ function C(e) {
3595
+ let t = (e.target?.closest?.(`[${ko}]`))?.getAttribute(ko);
3596
+ t && (e.preventDefault(), e.stopPropagation(), _e.release(t));
3592
3597
  }
3593
- async function ve() {
3598
+ async function ye() {
3594
3599
  if (c.loading) return;
3595
3600
  await n();
3596
- let e = C.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
3601
+ let e = S.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
3597
3602
  if (!e?.length) return;
3598
- let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
3603
+ let { renderMermaidSVG: t, THEMES: r } = await h(), i = c.isDark ? r["github-dark"] : r["github-light"];
3599
3604
  for (let n of Array.from(e)) {
3600
3605
  if (!n.isConnected) continue;
3601
3606
  let e = n.textContent?.trim();
@@ -3605,19 +3610,19 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3605
3610
  } catch {}
3606
3611
  }
3607
3612
  }
3608
- async function ye() {
3613
+ async function be() {
3609
3614
  await n();
3610
- let e = C.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
3615
+ let e = S.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
3611
3616
  if (!e?.length) return;
3612
3617
  let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
3613
3618
  for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
3614
3619
  }
3615
- async function be() {
3620
+ async function xe() {
3616
3621
  await n();
3617
- let e = C.value?.querySelectorAll(".katex-pending");
3622
+ let e = S.value?.querySelectorAll(".katex-pending");
3618
3623
  if (!e?.length) return;
3619
- let t = await re();
3620
- p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(C.value));
3624
+ let t = await ne();
3625
+ p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(S.value));
3621
3626
  for (let n of Array.from(e)) {
3622
3627
  if (!n.isConnected) continue;
3623
3628
  let e = n.dataset.katex;
@@ -3631,11 +3636,11 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3631
3636
  } catch {}
3632
3637
  }
3633
3638
  }
3634
- async function xe() {
3639
+ async function Se() {
3635
3640
  await n();
3636
- let e = C.value?.querySelectorAll("pre.mermaid[data-rendered]");
3641
+ let e = S.value?.querySelectorAll("pre.mermaid[data-rendered]");
3637
3642
  if (!e?.length) return;
3638
- let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
3643
+ let { renderMermaidSVG: t, THEMES: r } = await h(), i = c.isDark ? r["github-dark"] : r["github-light"];
3639
3644
  for (let n of Array.from(e)) {
3640
3645
  if (!n.isConnected) continue;
3641
3646
  let e = n.dataset.code;
@@ -3644,7 +3649,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3644
3649
  } catch {}
3645
3650
  }
3646
3651
  }
3647
- function Se(e) {
3652
+ function Ce(e) {
3648
3653
  let t = e.target;
3649
3654
  if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
3650
3655
  t.dataset.broken = "true";
@@ -3652,60 +3657,60 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
3652
3657
  n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
3653
3658
  }
3654
3659
  t(() => {
3655
- C.value?.addEventListener("error", Se, !0);
3660
+ S.value?.addEventListener("error", Ce, !0);
3656
3661
  }), e(() => {
3657
- C.value?.removeEventListener("error", Se, !0);
3658
- }), a([_e, () => c.loading], ve, { immediate: !0 }), a(() => c.isDark, xe), a(_e, ye, { immediate: !0 }), a(_e, be, { immediate: !0 });
3659
- let Ce = 0;
3660
- function we(e, t) {
3662
+ S.value?.removeEventListener("error", Ce, !0);
3663
+ }), a([ve, () => c.loading], ye, { immediate: !0 }), a(() => c.isDark, Se), a(ve, be, { immediate: !0 }), a(ve, xe, { immediate: !0 });
3664
+ let we = 0;
3665
+ function Te(e, t) {
3661
3666
  let n = document.createElement("span");
3662
3667
  return n.style.cssText = `animation:ft-${c.animation} ${c.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
3663
3668
  let t = n.parentNode;
3664
3669
  t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
3665
3670
  }, { once: !0 }), n;
3666
3671
  }
3667
- function Te(e, t, n, r) {
3672
+ function Ee(e, t, n, r) {
3668
3673
  let i = r, a = e.split(/(\s+)/);
3669
- for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(we(e, i * 30), n), i++));
3674
+ for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(Te(e, i * 30), n), i++));
3670
3675
  return i;
3671
3676
  }
3672
- function Ee(e) {
3677
+ function De(e) {
3673
3678
  let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
3674
3679
  return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
3675
3680
  } }), n = [];
3676
3681
  for (; t.nextNode();) n.push(t.currentNode);
3677
3682
  return n;
3678
3683
  }
3679
- function T() {
3680
- if (!C.value || !c.loading || !c.animation) return;
3681
- let e = Ee(C.value), t = 0, n = 0;
3684
+ function w() {
3685
+ if (!S.value || !c.loading || !c.animation) return;
3686
+ let e = De(S.value), t = 0, n = 0;
3682
3687
  for (let r of e) {
3683
3688
  let e = r.textContent || "", i = t, a = t + e.length;
3684
- if (t = a, a <= Ce) continue;
3689
+ if (t = a, a <= we) continue;
3685
3690
  let o = r.parentNode;
3686
3691
  if (!o) continue;
3687
- if (i >= Ce) {
3692
+ if (i >= we) {
3688
3693
  let t = r.nextSibling;
3689
- o.removeChild(r), n = Te(e, o, t, n);
3694
+ o.removeChild(r), n = Ee(e, o, t, n);
3690
3695
  continue;
3691
3696
  }
3692
- let s = Ce - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
3693
- o.removeChild(c), n = Te(l, o, u, n);
3697
+ let s = we - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
3698
+ o.removeChild(c), n = Ee(l, o, u, n);
3694
3699
  }
3695
- Ce = t;
3700
+ we = t;
3696
3701
  }
3697
- return a(_e, async () => {
3698
- await n(), T();
3702
+ return a(ve, async () => {
3703
+ await n(), w();
3699
3704
  }, { immediate: !0 }), a(() => c.markdown, (e, t) => {
3700
- (!e || t && e.length < t.length) && (Ce = 0);
3705
+ (!e || t && e.length < t.length) && (we = 0);
3701
3706
  }), (e, t) => (r(), u("div", {
3702
3707
  ref: "container",
3703
- onClick: w,
3704
- innerHTML: _e.value
3705
- }, null, 8, ko));
3708
+ onClick: C,
3709
+ innerHTML: ve.value
3710
+ }, null, 8, jo));
3706
3711
  }
3707
3712
  }), [["styles", [".markdown-held-image{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-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.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)}}"]]]);
3708
3713
  //#endregion
3709
- export { Xe as A, pe as B, T as C, be as D, _e as E, he as F, de as I, me as L, fe as M, ge as N, O, S as P, b as R, Ee as S, $e as T, et as _, Ie as a, Ge as b, Be as c, Le as d, Se as f, Ne as g, Qe as h, Ue as i, C as j, Re as k, He as l, Pe as m, Ae as n, ve as o, Je as p, De as r, xe as s, jo as t, Ve as u, qe as v, je as w, Me as x, ze as y, x as z };
3714
+ export { Ve as A, x as B, w as C, C as D, nt as E, fe as F, _e as I, S as L, pe as M, me as N, Se as O, ve as P, ge as R, Pe as S, Ne as T, he as V, rt as _, ze as a, Je as b, Ue as c, Be as d, we as f, Fe as g, tt as h, Ke as i, $e as j, Re as k, Ge as l, Ie as m, Me as n, be as o, Ze as p, T as r, Ce as s, No as t, We as u, Xe as v, Oe as w, Le as x, He as y, de as z };
3710
3715
 
3711
- //# sourceMappingURL=PkStreamingMarkdown-CNoHyTuC.js.map
3716
+ //# sourceMappingURL=PkStreamingMarkdown-Br7Z60Vm.js.map