@vertesia/ui 1.5.0-dev.20260901.052906Z → 1.5.0-dev.20260910.051115Z

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 (563) hide show
  1. package/lib/core/components/Avatar.d.ts.map +1 -1
  2. package/lib/core/components/Avatar.js +3 -3
  3. package/lib/core/components/Avatar.js.map +1 -1
  4. package/lib/core/components/ComboBox.js +1 -1
  5. package/lib/core/components/ComboBox.js.map +1 -1
  6. package/lib/core/components/FileUpload.js +1 -1
  7. package/lib/core/components/FileUpload.js.map +1 -1
  8. package/lib/core/components/Link.js +1 -1
  9. package/lib/core/components/Link.js.map +1 -1
  10. package/lib/core/components/SelectList.js +1 -1
  11. package/lib/core/components/SelectList.js.map +1 -1
  12. package/lib/core/components/SidePanel.js +1 -1
  13. package/lib/core/components/SidePanel.js.map +1 -1
  14. package/lib/core/components/Spinner.js +1 -1
  15. package/lib/core/components/Spinner.js.map +1 -1
  16. package/lib/core/components/TagsInput.js +8 -8
  17. package/lib/core/components/TagsInput.js.map +1 -1
  18. package/lib/core/components/shadcn/MessageBox.js +1 -1
  19. package/lib/core/components/shadcn/MessageBox.js.map +1 -1
  20. package/lib/core/components/shadcn/button.js +1 -1
  21. package/lib/core/components/shadcn/button.js.map +1 -1
  22. package/lib/core/components/shadcn/card.d.ts.map +1 -1
  23. package/lib/core/components/shadcn/card.js +1 -1
  24. package/lib/core/components/shadcn/card.js.map +1 -1
  25. package/lib/core/components/shadcn/command.js +5 -5
  26. package/lib/core/components/shadcn/command.js.map +1 -1
  27. package/lib/core/components/shadcn/filters/DynamicLabel.js +1 -1
  28. package/lib/core/components/shadcn/filters/DynamicLabel.js.map +1 -1
  29. package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js +3 -3
  30. package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -1
  31. package/lib/core/components/shadcn/input.js +3 -3
  32. package/lib/core/components/shadcn/input.js.map +1 -1
  33. package/lib/core/components/shadcn/modal/ConfirmModal.js +1 -1
  34. package/lib/core/components/shadcn/modal/ConfirmModal.js.map +1 -1
  35. package/lib/core/components/shadcn/modal/dialog.d.ts.map +1 -1
  36. package/lib/core/components/shadcn/modal/dialog.js +2 -2
  37. package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
  38. package/lib/core/components/shadcn/overflowTabs.js +2 -2
  39. package/lib/core/components/shadcn/overflowTabs.js.map +1 -1
  40. package/lib/core/components/shadcn/popover.js +1 -1
  41. package/lib/core/components/shadcn/popover.js.map +1 -1
  42. package/lib/core/components/shadcn/radioGroup.d.ts.map +1 -1
  43. package/lib/core/components/shadcn/radioGroup.js +3 -3
  44. package/lib/core/components/shadcn/radioGroup.js.map +1 -1
  45. package/lib/core/components/shadcn/selectBox.js +1 -1
  46. package/lib/core/components/shadcn/selectBox.js.map +1 -1
  47. package/lib/core/components/shadcn/tabs.d.ts.map +1 -1
  48. package/lib/core/components/shadcn/tabs.js +5 -2
  49. package/lib/core/components/shadcn/tabs.js.map +1 -1
  50. package/lib/core/components/styles.js +1 -1
  51. package/lib/core/components/styles.js.map +1 -1
  52. package/lib/core/components/table/index.js +1 -1
  53. package/lib/core/hooks/useFetch.d.ts.map +1 -1
  54. package/lib/core/hooks/useFetch.js +2 -0
  55. package/lib/core/hooks/useFetch.js.map +1 -1
  56. package/lib/features/activity-doc/ActivityDoc.js +8 -8
  57. package/lib/features/activity-doc/ActivityDoc.js.map +1 -1
  58. package/lib/features/agent/chat/AgentChart.js +1 -1
  59. package/lib/features/agent/chat/AgentChart.js.map +1 -1
  60. package/lib/features/agent/chat/AgentRightPanel.d.ts +2 -3
  61. package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
  62. package/lib/features/agent/chat/AgentRightPanel.js +3 -3
  63. package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
  64. package/lib/features/agent/chat/AskUserWidget.d.ts.map +1 -1
  65. package/lib/features/agent/chat/AskUserWidget.js +13 -13
  66. package/lib/features/agent/chat/AskUserWidget.js.map +1 -1
  67. package/lib/features/agent/chat/DocumentPanel.d.ts +7 -7
  68. package/lib/features/agent/chat/DocumentPanel.d.ts.map +1 -1
  69. package/lib/features/agent/chat/DocumentPanel.js +6 -12
  70. package/lib/features/agent/chat/DocumentPanel.js.map +1 -1
  71. package/lib/features/agent/chat/DocumentsTab.d.ts +15 -0
  72. package/lib/features/agent/chat/DocumentsTab.d.ts.map +1 -0
  73. package/lib/features/agent/chat/DocumentsTab.js +33 -0
  74. package/lib/features/agent/chat/DocumentsTab.js.map +1 -0
  75. package/lib/features/agent/chat/JumpingDots.js +1 -1
  76. package/lib/features/agent/chat/JumpingDots.js.map +1 -1
  77. package/lib/features/agent/chat/ModernAgentConversation.js +3 -3
  78. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  79. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  80. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +22 -9
  81. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  82. package/lib/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js +5 -5
  83. package/lib/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js.map +1 -1
  84. package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  85. package/lib/features/agent/chat/ModernAgentOutput/Header.js +16 -11
  86. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  87. package/lib/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js +1 -1
  88. package/lib/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js.map +1 -1
  89. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +1 -1
  90. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  91. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  92. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +7 -7
  93. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  94. package/lib/features/agent/chat/ModernAgentOutput/MessagesContainer.js +1 -1
  95. package/lib/features/agent/chat/ModernAgentOutput/MessagesContainer.js.map +1 -1
  96. package/lib/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts.map +1 -1
  97. package/lib/features/agent/chat/ModernAgentOutput/PlanPanel.js +10 -10
  98. package/lib/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -1
  99. package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js +1 -1
  100. package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -1
  101. package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.d.ts.map +1 -1
  102. package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js +1 -1
  103. package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
  104. package/lib/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +17 -17
  105. package/lib/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -1
  106. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.js +1 -1
  107. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.js.map +1 -1
  108. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
  109. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +14 -2
  110. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
  111. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
  112. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +15 -15
  113. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
  114. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
  115. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +18 -0
  116. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
  117. package/lib/features/agent/chat/SlidingThinkingIndicator.d.ts.map +1 -1
  118. package/lib/features/agent/chat/SlidingThinkingIndicator.js +5 -2
  119. package/lib/features/agent/chat/SlidingThinkingIndicator.js.map +1 -1
  120. package/lib/features/agent/chat/VegaLiteChart.d.ts.map +1 -1
  121. package/lib/features/agent/chat/VegaLiteChart.js +6 -2
  122. package/lib/features/agent/chat/VegaLiteChart.js.map +1 -1
  123. package/lib/features/agent/chat/hooks/useDocumentPanel.d.ts +2 -2
  124. package/lib/features/agent/chat/hooks/useDocumentPanel.d.ts.map +1 -1
  125. package/lib/features/agent/chat/hooks/useDocumentPanel.js +0 -18
  126. package/lib/features/agent/chat/hooks/useDocumentPanel.js.map +1 -1
  127. package/lib/features/errors/RowErrorBoundary.js +1 -1
  128. package/lib/features/errors/RowErrorBoundary.js.map +1 -1
  129. package/lib/features/facets/AgentRunnerFacetsNav.js +1 -1
  130. package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  131. package/lib/features/facets/utils/VInteractionFacet.d.ts +3 -5
  132. package/lib/features/facets/utils/VInteractionFacet.d.ts.map +1 -1
  133. package/lib/features/facets/utils/VInteractionFacet.js +10 -23
  134. package/lib/features/facets/utils/VInteractionFacet.js.map +1 -1
  135. package/lib/features/facets/utils/VUserFacet.js +1 -1
  136. package/lib/features/facets/utils/VUserFacet.js.map +1 -1
  137. package/lib/features/layout/GenericPageNavHeader.d.ts.map +1 -1
  138. package/lib/features/layout/GenericPageNavHeader.js +4 -1
  139. package/lib/features/layout/GenericPageNavHeader.js.map +1 -1
  140. package/lib/features/layout/NotFoundView.js +1 -1
  141. package/lib/features/layout/NotFoundView.js.map +1 -1
  142. package/lib/features/magic-pdf/AnnotatedImageSlider.js +4 -12
  143. package/lib/features/magic-pdf/AnnotatedImageSlider.js.map +1 -1
  144. package/lib/features/magic-pdf/ExtractedContentView.js +4 -4
  145. package/lib/features/magic-pdf/ExtractedContentView.js.map +1 -1
  146. package/lib/features/magic-pdf/MagicPdfView.js +1 -1
  147. package/lib/features/magic-pdf/MagicPdfView.js.map +1 -1
  148. package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
  149. package/lib/features/oauth/McpConnectionsButton.js +4 -1
  150. package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
  151. package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
  152. package/lib/features/oauth/McpConnectionsDialog.js +3 -2
  153. package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
  154. package/lib/features/oauth/useMcpConnections.d.ts +6 -7
  155. package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
  156. package/lib/features/oauth/useMcpConnections.js +27 -20
  157. package/lib/features/oauth/useMcpConnections.js.map +1 -1
  158. package/lib/features/pdf-viewer/PdfPageRenderer.js +2 -2
  159. package/lib/features/pdf-viewer/PdfPageRenderer.js.map +1 -1
  160. package/lib/features/pdf-viewer/PdfPageSlider.js +3 -3
  161. package/lib/features/pdf-viewer/PdfPageSlider.js.map +1 -1
  162. package/lib/features/pdf-viewer/SimplePdfViewer.js +1 -1
  163. package/lib/features/pdf-viewer/SimplePdfViewer.js.map +1 -1
  164. package/lib/features/permissions/UserPermissionsProvider.d.ts +2 -1
  165. package/lib/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
  166. package/lib/features/permissions/UserPermissionsProvider.js +35 -22
  167. package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
  168. package/lib/features/permissions/useRoleMappings.d.ts +19 -0
  169. package/lib/features/permissions/useRoleMappings.d.ts.map +1 -0
  170. package/lib/features/permissions/useRoleMappings.js +87 -0
  171. package/lib/features/permissions/useRoleMappings.js.map +1 -0
  172. package/lib/features/store/collections/SelectCollection.js +1 -1
  173. package/lib/features/store/collections/SelectCollection.js.map +1 -1
  174. package/lib/features/store/objects/DocumentPreviewPanel.d.ts.map +1 -1
  175. package/lib/features/store/objects/DocumentPreviewPanel.js +9 -9
  176. package/lib/features/store/objects/DocumentPreviewPanel.js.map +1 -1
  177. package/lib/features/store/objects/DocumentTable.js +1 -1
  178. package/lib/features/store/objects/DocumentTable.js.map +1 -1
  179. package/lib/features/store/objects/components/DocumentIcon.js +2 -2
  180. package/lib/features/store/objects/components/DocumentIcon.js.map +1 -1
  181. package/lib/features/store/objects/components/DocumentInput.js +1 -1
  182. package/lib/features/store/objects/components/DocumentInput.js.map +1 -1
  183. package/lib/features/store/objects/components/PropertiesEditorModal.js +1 -1
  184. package/lib/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
  185. package/lib/features/store/objects/components/SaveVersionConfirmModal.js +1 -1
  186. package/lib/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
  187. package/lib/features/store/objects/layout/documentLayout.d.ts.map +1 -1
  188. package/lib/features/store/objects/layout/documentLayout.js +2 -2
  189. package/lib/features/store/objects/layout/documentLayout.js.map +1 -1
  190. package/lib/features/store/objects/selection/SelectionActions.js +1 -1
  191. package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
  192. package/lib/features/store/types/IntakePolicyEditor.d.ts +10 -1
  193. package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
  194. package/lib/features/store/types/IntakePolicyEditor.js +29 -19
  195. package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
  196. package/lib/features/store/types/IntakePolicyForm.d.ts +1 -1
  197. package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -1
  198. package/lib/features/store/types/IntakePolicyForm.js +5 -3
  199. package/lib/features/store/types/IntakePolicyForm.js.map +1 -1
  200. package/lib/features/store/types/SelectContentTypeModal.js +1 -1
  201. package/lib/features/store/types/SelectContentTypeModal.js.map +1 -1
  202. package/lib/features/store/types/TypeRegistry.d.ts +10 -5
  203. package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
  204. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +10 -5
  205. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
  206. package/lib/features/user/UserAvatar.js +2 -2
  207. package/lib/features/user/UserAvatar.js.map +1 -1
  208. package/lib/features/user/UserInfo.d.ts.map +1 -1
  209. package/lib/features/user/UserInfo.js +7 -7
  210. package/lib/features/user/UserInfo.js.map +1 -1
  211. package/lib/features/utils/index.d.ts +1 -0
  212. package/lib/features/utils/index.d.ts.map +1 -1
  213. package/lib/features/utils/index.js +1 -0
  214. package/lib/features/utils/index.js.map +1 -1
  215. package/lib/features/utils/interaction.d.ts +55 -0
  216. package/lib/features/utils/interaction.d.ts.map +1 -0
  217. package/lib/features/utils/interaction.js +77 -0
  218. package/lib/features/utils/interaction.js.map +1 -0
  219. package/lib/features/views/ViewResults.js +2 -2
  220. package/lib/features/views/ViewResults.js.map +1 -1
  221. package/lib/i18n/locales/ar.json +17 -1
  222. package/lib/i18n/locales/de.json +13 -1
  223. package/lib/i18n/locales/en.json +13 -1
  224. package/lib/i18n/locales/es.json +13 -1
  225. package/lib/i18n/locales/fr.json +13 -1
  226. package/lib/i18n/locales/it.json +13 -1
  227. package/lib/i18n/locales/ja.json +13 -1
  228. package/lib/i18n/locales/ko.json +13 -1
  229. package/lib/i18n/locales/pt.json +13 -1
  230. package/lib/i18n/locales/ru.json +15 -1
  231. package/lib/i18n/locales/tr.json +13 -1
  232. package/lib/i18n/locales/zh-TW.json +13 -1
  233. package/lib/i18n/locales/zh.json +13 -1
  234. package/lib/layout/FullHeightLayout.js +2 -2
  235. package/lib/layout/FullHeightLayout.js.map +1 -1
  236. package/lib/layout/Navbar.js +4 -4
  237. package/lib/layout/Navbar.js.map +1 -1
  238. package/lib/layout/Sidebar.js +1 -1
  239. package/lib/layout/Sidebar.js.map +1 -1
  240. package/lib/router/NestedNavigationContext.d.ts +3 -1
  241. package/lib/router/NestedNavigationContext.d.ts.map +1 -1
  242. package/lib/router/NestedNavigationContext.js +2 -2
  243. package/lib/router/NestedNavigationContext.js.map +1 -1
  244. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  245. package/lib/session/UserSessionProvider.js +2 -13
  246. package/lib/session/UserSessionProvider.js.map +1 -1
  247. package/lib/session/auth/authState.d.ts +13 -0
  248. package/lib/session/auth/authState.d.ts.map +1 -0
  249. package/lib/session/auth/authState.js +37 -0
  250. package/lib/session/auth/authState.js.map +1 -0
  251. package/lib/session/auth/domainRouting.d.ts +39 -0
  252. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  253. package/lib/session/auth/domainRouting.js +85 -0
  254. package/lib/session/auth/domainRouting.js.map +1 -1
  255. package/lib/session/auth/useAuthState.d.ts +4 -7
  256. package/lib/session/auth/useAuthState.d.ts.map +1 -1
  257. package/lib/session/auth/useAuthState.js +5 -41
  258. package/lib/session/auth/useAuthState.js.map +1 -1
  259. package/lib/session/index.d.ts +1 -0
  260. package/lib/session/index.d.ts.map +1 -1
  261. package/lib/session/index.js +2 -0
  262. package/lib/session/index.js.map +1 -1
  263. package/lib/shell/SplashScreen.d.ts +1 -1
  264. package/lib/shell/SplashScreen.d.ts.map +1 -1
  265. package/lib/shell/SplashScreen.js +6 -2
  266. package/lib/shell/SplashScreen.js.map +1 -1
  267. package/lib/shell/VertesiaShell.js +1 -1
  268. package/lib/shell/VertesiaShell.js.map +1 -1
  269. package/lib/shell/apps/AppProjectSelector.js +1 -1
  270. package/lib/shell/apps/AppProjectSelector.js.map +1 -1
  271. package/lib/shell/apps/StandaloneApp.js +2 -2
  272. package/lib/shell/apps/StandaloneApp.js.map +1 -1
  273. package/lib/shell/login/SignInPrimitives.js +2 -2
  274. package/lib/shell/login/SignInPrimitives.js.map +1 -1
  275. package/lib/shell/login/SigninScreen.js +1 -1
  276. package/lib/shell/login/SigninScreen.js.map +1 -1
  277. package/lib/shell/login/SignupForm.js +1 -1
  278. package/lib/shell/login/SignupForm.js.map +1 -1
  279. package/lib/shell/login/TerminalLogin.js +2 -2
  280. package/lib/shell/login/TerminalLogin.js.map +1 -1
  281. package/lib/shell/login/UserInfo.d.ts.map +1 -1
  282. package/lib/shell/login/UserInfo.js +1 -1
  283. package/lib/shell/login/UserInfo.js.map +1 -1
  284. package/lib/shell/login/UserSessionMenu.js +1 -1
  285. package/lib/shell/login/UserSessionMenu.js.map +1 -1
  286. package/lib/vertesia-ui-core.js +7 -7
  287. package/lib/vertesia-ui-core.js.map +1 -1
  288. package/lib/vertesia-ui-features.js +179 -182
  289. package/lib/vertesia-ui-features.js.map +1 -1
  290. package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js +5 -0
  291. package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js.map +1 -0
  292. package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js +5 -0
  293. package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js.map +1 -0
  294. package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js +5 -0
  295. package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js.map +1 -0
  296. package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js +5 -0
  297. package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js.map +1 -0
  298. package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js +5 -0
  299. package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js.map +1 -0
  300. package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js +5 -0
  301. package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js.map +1 -0
  302. package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js +5 -0
  303. package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js.map +1 -0
  304. package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js +5 -0
  305. package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js.map +1 -0
  306. package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js +5 -0
  307. package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js.map +1 -0
  308. package/lib/vertesia-ui-i18n.DN79y06J.chunk.js +5 -0
  309. package/lib/vertesia-ui-i18n.DN79y06J.chunk.js.map +1 -0
  310. package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js +5 -0
  311. package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js.map +1 -0
  312. package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js +5 -0
  313. package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js.map +1 -0
  314. package/lib/vertesia-ui-i18n.js +2 -2
  315. package/lib/vertesia-ui-layout.js +1 -1
  316. package/lib/vertesia-ui-layout.js.map +1 -1
  317. package/lib/vertesia-ui-rich-text.js +24 -24
  318. package/lib/vertesia-ui-rich-text.js.map +1 -1
  319. package/lib/vertesia-ui-router.js +1 -1
  320. package/lib/vertesia-ui-router.js.map +1 -1
  321. package/lib/vertesia-ui-session.js +1 -1
  322. package/lib/vertesia-ui-session.js.map +1 -1
  323. package/lib/vertesia-ui-shell.js +3 -3
  324. package/lib/vertesia-ui-shell.js.map +1 -1
  325. package/lib/vertesia-ui-widgets.js +54 -54
  326. package/lib/vertesia-ui-widgets.js.map +1 -1
  327. package/lib/widgets/Progress.js +1 -1
  328. package/lib/widgets/Progress.js.map +1 -1
  329. package/lib/widgets/form/Form.js +2 -2
  330. package/lib/widgets/form/Form.js.map +1 -1
  331. package/lib/widgets/form/fields.js +2 -2
  332. package/lib/widgets/form/fields.js.map +1 -1
  333. package/lib/widgets/json-view/JSONView.js +1 -1
  334. package/lib/widgets/json-view/JSONView.js.map +1 -1
  335. package/lib/widgets/markdown/MermaidDiagram.js +1 -1
  336. package/lib/widgets/markdown/MermaidDiagram.js.map +1 -1
  337. package/lib/widgets/markdown/remarkDirectiveHandler.d.ts +7 -2
  338. package/lib/widgets/markdown/remarkDirectiveHandler.d.ts.map +1 -1
  339. package/lib/widgets/markdown/remarkDirectiveHandler.js +19 -4
  340. package/lib/widgets/markdown/remarkDirectiveHandler.js.map +1 -1
  341. package/lib/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
  342. package/lib/widgets/monacoEditor/MonacoEditor.js +4 -2
  343. package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
  344. package/lib/widgets/monacoEditor/index.d.ts +1 -0
  345. package/lib/widgets/monacoEditor/index.d.ts.map +1 -1
  346. package/lib/widgets/monacoEditor/index.js +1 -0
  347. package/lib/widgets/monacoEditor/index.js.map +1 -1
  348. package/lib/widgets/monacoEditor/loadMonaco.d.ts +45 -0
  349. package/lib/widgets/monacoEditor/loadMonaco.d.ts.map +1 -0
  350. package/lib/widgets/monacoEditor/loadMonaco.js +62 -0
  351. package/lib/widgets/monacoEditor/loadMonaco.js.map +1 -0
  352. package/lib/widgets/properties/PropertiesView.js +1 -1
  353. package/lib/widgets/properties/PropertiesView.js.map +1 -1
  354. package/lib/widgets/schema-editor/editor/Editable.js +2 -2
  355. package/lib/widgets/schema-editor/editor/Editable.js.map +1 -1
  356. package/lib/widgets/schema-editor/editor/PropertyEditor.js +1 -1
  357. package/lib/widgets/schema-editor/editor/PropertyEditor.js.map +1 -1
  358. package/lib/widgets/schema-editor/editor/SchemaEditor.js +2 -2
  359. package/lib/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
  360. package/lib/widgets/upload/DropZone.js +1 -1
  361. package/lib/widgets/upload/DropZone.js.map +1 -1
  362. package/lib/widgets/upload/UploadResultCategory.d.ts +1 -1
  363. package/lib/widgets/upload/UploadResultCategory.d.ts.map +1 -1
  364. package/lib/widgets/upload/UploadResultCategory.js +3 -3
  365. package/lib/widgets/upload/UploadResultCategory.js.map +1 -1
  366. package/lib/widgets/upload/UploadSummary.js +1 -1
  367. package/lib/widgets/upload/UploadSummary.js.map +1 -1
  368. package/lib/widgets/xml-viewer/components/XMLViewer.d.ts.map +1 -1
  369. package/lib/widgets/xml-viewer/components/XMLViewer.js +7 -3
  370. package/lib/widgets/xml-viewer/components/XMLViewer.js.map +1 -1
  371. package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
  372. package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts +11 -13
  373. package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts.map +1 -1
  374. package/lib/widgets/xml-viewer/hooks/useXMLViewer.js +41 -14
  375. package/lib/widgets/xml-viewer/hooks/useXMLViewer.js.map +1 -1
  376. package/package.json +7 -7
  377. package/src/__tests__/contrast.test.ts +1 -0
  378. package/src/core/components/Avatar.tsx +3 -3
  379. package/src/core/components/ComboBox.tsx +1 -1
  380. package/src/core/components/FileUpload.tsx +4 -4
  381. package/src/core/components/Link.tsx +1 -1
  382. package/src/core/components/SelectList.tsx +1 -1
  383. package/src/core/components/SidePanel.tsx +1 -1
  384. package/src/core/components/Spinner.tsx +1 -1
  385. package/src/core/components/TagsInput.tsx +8 -8
  386. package/src/core/components/shadcn/MessageBox.tsx +1 -1
  387. package/src/core/components/shadcn/button.tsx +1 -1
  388. package/src/core/components/shadcn/card.tsx +1 -3
  389. package/src/core/components/shadcn/command.tsx +5 -5
  390. package/src/core/components/shadcn/filters/DynamicLabel.tsx +1 -1
  391. package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +3 -3
  392. package/src/core/components/shadcn/input.tsx +3 -3
  393. package/src/core/components/shadcn/modal/ConfirmModal.tsx +3 -3
  394. package/src/core/components/shadcn/modal/dialog.tsx +2 -4
  395. package/src/core/components/shadcn/overflowTabs.tsx +2 -2
  396. package/src/core/components/shadcn/popover.tsx +1 -1
  397. package/src/core/components/shadcn/radioGroup.tsx +5 -7
  398. package/src/core/components/shadcn/selectBox.tsx +1 -1
  399. package/src/core/components/shadcn/tabs.tsx +4 -2
  400. package/src/core/components/styles.ts +1 -1
  401. package/src/core/components/table/index.tsx +1 -1
  402. package/src/core/hooks/useFetch.test.ts +20 -0
  403. package/src/core/hooks/useFetch.ts +2 -0
  404. package/src/css/base.css +1 -1
  405. package/src/css/color.css +4 -0
  406. package/src/css/theme.css +1 -0
  407. package/src/css/typography.css +2 -2
  408. package/src/features/activity-doc/ActivityDoc.tsx +11 -11
  409. package/src/features/agent/chat/AgentChart.tsx +1 -1
  410. package/src/features/agent/chat/AgentRightPanel.tsx +4 -8
  411. package/src/features/agent/chat/AskUserWidget.tsx +19 -23
  412. package/src/features/agent/chat/DocumentPanel.tsx +39 -48
  413. package/src/features/agent/chat/DocumentsTab.test.tsx +87 -0
  414. package/src/features/agent/chat/DocumentsTab.tsx +124 -0
  415. package/src/features/agent/chat/JumpingDots.tsx +3 -3
  416. package/src/features/agent/chat/ModernAgentConversation.test.tsx +0 -1
  417. package/src/features/agent/chat/ModernAgentConversation.tsx +3 -5
  418. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +60 -1
  419. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +44 -24
  420. package/src/features/agent/chat/ModernAgentOutput/BatchProgressPanel.tsx +12 -12
  421. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +28 -15
  422. package/src/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.tsx +4 -4
  423. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +2 -2
  424. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +7 -12
  425. package/src/features/agent/chat/ModernAgentOutput/MessagesContainer.tsx +1 -1
  426. package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +16 -22
  427. package/src/features/agent/chat/ModernAgentOutput/SlideInPanel.tsx +4 -4
  428. package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +2 -4
  429. package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +21 -21
  430. package/src/features/agent/chat/ModernAgentOutput/StreamingMessage.tsx +4 -4
  431. package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +16 -1
  432. package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +19 -40
  433. package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.test.ts +41 -0
  434. package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +19 -0
  435. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +93 -0
  436. package/src/features/agent/chat/SlidingThinkingIndicator.tsx +5 -2
  437. package/src/features/agent/chat/VegaLiteChart.tsx +6 -2
  438. package/src/features/agent/chat/hooks/useDocumentPanel.test.tsx +33 -0
  439. package/src/features/agent/chat/hooks/useDocumentPanel.ts +3 -20
  440. package/src/features/errors/RowErrorBoundary.tsx +1 -1
  441. package/src/features/facets/AgentRunnerFacetsNav.tsx +1 -1
  442. package/src/features/facets/utils/VInteractionFacet.tsx +22 -34
  443. package/src/features/facets/utils/VUserFacet.tsx +1 -1
  444. package/src/features/layout/GenericPageNavHeader.tsx +9 -1
  445. package/src/features/layout/NotFoundView.tsx +1 -1
  446. package/src/features/magic-pdf/AnnotatedImageSlider.tsx +8 -16
  447. package/src/features/magic-pdf/ExtractedContentView.tsx +4 -4
  448. package/src/features/magic-pdf/MagicPdfView.tsx +1 -1
  449. package/src/features/oauth/McpConnectionsButton.test.tsx +79 -8
  450. package/src/features/oauth/McpConnectionsButton.tsx +6 -3
  451. package/src/features/oauth/McpConnectionsDialog.tsx +9 -3
  452. package/src/features/oauth/useMcpConnections.ts +33 -27
  453. package/src/features/pdf-viewer/PdfPageRenderer.tsx +2 -2
  454. package/src/features/pdf-viewer/PdfPageSlider.tsx +4 -4
  455. package/src/features/pdf-viewer/SimplePdfViewer.tsx +1 -1
  456. package/src/features/permissions/UserPermissionsProvider.test.tsx +172 -0
  457. package/src/features/permissions/UserPermissionsProvider.tsx +68 -21
  458. package/src/features/permissions/useRoleMappings.ts +105 -0
  459. package/src/features/store/collections/SelectCollection.tsx +1 -1
  460. package/src/features/store/objects/DocumentPreviewPanel.tsx +43 -53
  461. package/src/features/store/objects/DocumentTable.tsx +2 -2
  462. package/src/features/store/objects/components/DocumentIcon.tsx +4 -4
  463. package/src/features/store/objects/components/DocumentInput.tsx +3 -3
  464. package/src/features/store/objects/components/PropertiesEditorModal.tsx +2 -2
  465. package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +2 -2
  466. package/src/features/store/objects/layout/documentLayout.tsx +2 -4
  467. package/src/features/store/objects/selection/SelectionActions.tsx +1 -1
  468. package/src/features/store/types/IntakePolicyEditor.tsx +70 -36
  469. package/src/features/store/types/IntakePolicyForm.tsx +11 -3
  470. package/src/features/store/types/SelectContentTypeModal.tsx +1 -1
  471. package/src/features/user/UserAvatar.tsx +3 -3
  472. package/src/features/user/UserInfo.tsx +11 -16
  473. package/src/features/utils/index.ts +1 -0
  474. package/src/features/utils/interaction.test.tsx +93 -0
  475. package/src/features/utils/interaction.tsx +125 -0
  476. package/src/features/views/ViewResults.tsx +3 -3
  477. package/src/i18n/locales/ar.json +17 -1
  478. package/src/i18n/locales/de.json +13 -1
  479. package/src/i18n/locales/en.json +13 -1
  480. package/src/i18n/locales/es.json +13 -1
  481. package/src/i18n/locales/fr.json +13 -1
  482. package/src/i18n/locales/it.json +13 -1
  483. package/src/i18n/locales/ja.json +13 -1
  484. package/src/i18n/locales/ko.json +13 -1
  485. package/src/i18n/locales/pt.json +13 -1
  486. package/src/i18n/locales/ru.json +15 -1
  487. package/src/i18n/locales/tr.json +13 -1
  488. package/src/i18n/locales/zh-TW.json +13 -1
  489. package/src/i18n/locales/zh.json +13 -1
  490. package/src/layout/FullHeightLayout.tsx +2 -2
  491. package/src/layout/Navbar.tsx +5 -5
  492. package/src/layout/Sidebar.tsx +1 -1
  493. package/src/router/NestedNavigationContext.test.tsx +54 -0
  494. package/src/router/NestedNavigationContext.tsx +9 -2
  495. package/src/session/UserSessionProvider.tsx +2 -15
  496. package/src/session/auth/authState.test.ts +35 -0
  497. package/src/session/auth/authState.ts +42 -0
  498. package/src/session/auth/domainRouting.test.ts +169 -1
  499. package/src/session/auth/domainRouting.ts +89 -0
  500. package/src/session/auth/useAuthState.ts +5 -49
  501. package/src/session/index.ts +6 -0
  502. package/src/shell/SplashScreen.test.tsx +22 -0
  503. package/src/shell/SplashScreen.tsx +6 -2
  504. package/src/shell/VertesiaShell.tsx +1 -1
  505. package/src/shell/apps/AppProjectSelector.tsx +1 -1
  506. package/src/shell/apps/StandaloneApp.tsx +9 -9
  507. package/src/shell/login/SignInPrimitives.tsx +2 -2
  508. package/src/shell/login/SigninScreen.tsx +1 -1
  509. package/src/shell/login/SignupForm.tsx +2 -2
  510. package/src/shell/login/TerminalLogin.tsx +5 -5
  511. package/src/shell/login/UserInfo.tsx +2 -5
  512. package/src/shell/login/UserSessionMenu.tsx +2 -2
  513. package/src/widgets/Progress.tsx +2 -2
  514. package/src/widgets/form/Form.tsx +4 -4
  515. package/src/widgets/form/fields.tsx +2 -2
  516. package/src/widgets/json-view/JSONView.tsx +1 -6
  517. package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +33 -29
  518. package/src/widgets/markdown/MarkdownRenderer.test.tsx +52 -0
  519. package/src/widgets/markdown/MermaidDiagram.tsx +2 -2
  520. package/src/widgets/markdown/remarkDirectiveHandler.ts +21 -5
  521. package/src/widgets/monacoEditor/MonacoEditor.tsx +4 -2
  522. package/src/widgets/monacoEditor/index.ts +1 -0
  523. package/src/widgets/monacoEditor/loadMonaco.test.ts +63 -0
  524. package/src/widgets/monacoEditor/loadMonaco.ts +70 -0
  525. package/src/widgets/properties/PropertiesView.tsx +1 -1
  526. package/src/widgets/schema-editor/editor/Editable.tsx +2 -2
  527. package/src/widgets/schema-editor/editor/PropertyEditor.tsx +1 -1
  528. package/src/widgets/schema-editor/editor/SchemaEditor.tsx +2 -2
  529. package/src/widgets/upload/DropZone.tsx +1 -1
  530. package/src/widgets/upload/UploadResultCategory.tsx +7 -7
  531. package/src/widgets/upload/UploadSummary.tsx +4 -4
  532. package/src/widgets/xml-viewer/components/XMLViewer.tsx +7 -3
  533. package/src/widgets/xml-viewer/hooks/useXMLViewer.test.ts +60 -7
  534. package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +70 -16
  535. package/lib/features/agent/chat/DocumentTabBar.d.ts +0 -9
  536. package/lib/features/agent/chat/DocumentTabBar.d.ts.map +0 -1
  537. package/lib/features/agent/chat/DocumentTabBar.js +0 -9
  538. package/lib/features/agent/chat/DocumentTabBar.js.map +0 -1
  539. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js +0 -5
  540. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js.map +0 -1
  541. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js +0 -5
  542. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js.map +0 -1
  543. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js +0 -5
  544. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js.map +0 -1
  545. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js +0 -5
  546. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js.map +0 -1
  547. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js +0 -5
  548. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js.map +0 -1
  549. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js +0 -5
  550. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js.map +0 -1
  551. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js +0 -5
  552. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js.map +0 -1
  553. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js +0 -5
  554. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js.map +0 -1
  555. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js +0 -5
  556. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js.map +0 -1
  557. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js +0 -5
  558. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js.map +0 -1
  559. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js +0 -5
  560. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js.map +0 -1
  561. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js +0 -5
  562. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js.map +0 -1
  563. package/src/features/agent/chat/DocumentTabBar.tsx +0 -41
@@ -1,11 +1,11 @@
1
- import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Button as r,Center as i,DotBadge as a,DropdownMenu as o,DropdownMenuContent as s,DropdownMenuItem as c,DropdownMenuTrigger as l,FormItem as u,MessageBox as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,SelectBox as g,Spinner as _,Styles as v,Switch as y,Table as b,Textarea as x,VTooltip as S,cn as C,errorMessage as w,useClickOutside as T,useFlag as E,useTheme as D,useToast as O}from"@vertesia/ui/core";import k,{clsx as A}from"clsx";import*as j from"react";import M,{Suspense as ee,createContext as N,createElement as te,forwardRef as P,lazy as ne,memo as re,useCallback as F,useContext as ie,useEffect as I,useId as ae,useMemo as L,useRef as R,useState as z}from"react";import oe from"ajv";import se from"ajv-formats";import{useUITranslation as B}from"@vertesia/ui/i18n";import ce from"debounce";import{FusionFragmentHandler as le,FusionFragmentProvider as ue}from"@vertesia/fusion-ux";import de from"dompurify";import{DismissableLayer as fe,useDismissableLayerSurface as pe}from"@radix-ui/react-dismissable-layer";import{FocusScope as me}from"@radix-ui/react-focus-scope";import*as he from"react-dom";import{useFocusGuards as ge}from"@radix-ui/react-focus-guards";import{RemoveScroll as _e}from"react-remove-scroll";import{hideOthers as ve}from"aria-hidden";import{useUserSession as ye}from"@vertesia/ui/session";import be from"papaparse";import{twMerge as xe}from"tailwind-merge";import{XMLParser as V}from"fast-xml-parser";import{isNil as Se,omit as Ce}from"lodash-es";var we=Object.create,Te=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,De=Object.getOwnPropertyNames,Oe=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,Ae=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},je=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Me=(e,t)=>{let n={};for(var r in e)Te(n,r,{get:e[r],enumerable:!0});return t||Te(n,Symbol.toStringTag,{value:`Module`}),n},Ne=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=De(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ke.call(e,s)&&s!==n&&Te(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ee(t,s))||r.enumerable});return e},Pe=(e,t,n)=>(n=e==null?{}:we(Oe(e)),Ne(t||!e||!e.__esModule||!ke.call(e,`default`)?Te(n,`default`,{value:e,enumerable:!0}):n,e)),Fe=e=>ke.call(e,`module.exports`)?e[`module.exports`]:Ne(Te({},`__esModule`,{value:!0}),e);
1
+ import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Button as r,Center as i,DotBadge as a,DropdownMenu as o,DropdownMenuContent as s,DropdownMenuItem as c,DropdownMenuTrigger as l,FormItem as u,MessageBox as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,SelectBox as g,Spinner as _,Styles as v,Switch as y,Table as b,Textarea as x,VTooltip as S,cn as C,errorMessage as w,useClickOutside as T,useFlag as E,useTheme as D,useToast as O}from"@vertesia/ui/core";import k,{clsx as A}from"clsx";import*as j from"react";import M,{Suspense as ee,createContext as N,createElement as P,forwardRef as F,lazy as te,memo as ne,useCallback as I,useContext as re,useEffect as L,useId as ie,useMemo as R,useRef as z,useState as B}from"react";import ae from"ajv";import oe from"ajv-formats";import{useUITranslation as se}from"@vertesia/ui/i18n";import ce from"debounce";import{FusionFragmentHandler as le,FusionFragmentProvider as ue}from"@vertesia/fusion-ux";import de from"dompurify";import{DismissableLayer as fe,useDismissableLayerSurface as pe}from"@radix-ui/react-dismissable-layer";import{FocusScope as me}from"@radix-ui/react-focus-scope";import*as he from"react-dom";import{useFocusGuards as ge}from"@radix-ui/react-focus-guards";import{RemoveScroll as _e}from"react-remove-scroll";import{hideOthers as ve}from"aria-hidden";import{useUserSession as ye}from"@vertesia/ui/session";import{twMerge as be}from"tailwind-merge";import{isNil as xe,omit as V}from"lodash-es";var Se=Object.create,Ce=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyNames,Ee=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Oe=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},ke=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Ae=(e,t)=>{let n={};for(var r in e)Ce(n,r,{get:e[r],enumerable:!0});return t||Ce(n,Symbol.toStringTag,{value:`Module`}),n},je=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Te(t),a=0,o=i.length,s;a<o;a++)s=i[a],!De.call(e,s)&&s!==n&&Ce(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=we(t,s))||r.enumerable});return e},Me=(e,t,n)=>(n=e==null?{}:Se(Ee(e)),je(t||!e||!e.__esModule||!De.call(e,`default`)?Ce(n,`default`,{value:e,enumerable:!0}):n,e)),Ne=e=>De.call(e,`module.exports`)?e[`module.exports`]:je(Ce({},`__esModule`,{value:!0}),e);
2
2
  /**
3
3
  * @license lucide-react v1.31.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const Ie=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Le=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Re=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ze=e=>{
8
+ const Pe=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Fe=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ie=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Le=e=>{
9
9
  /**
10
10
  * @license lucide-react v1.31.0 - ISC
11
11
  *
@@ -24,21 +24,21 @@ const Ie=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(`
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
26
  */
27
- let t=Re(e);return t.charAt(0).toUpperCase()+t.slice(1)};
27
+ let t=Ie(e);return t.charAt(0).toUpperCase()+t.slice(1)};
28
28
  /**
29
29
  * @license lucide-react v1.31.0 - ISC
30
30
  *
31
31
  * This source code is licensed under the ISC license.
32
32
  * See the LICENSE file in the root directory of this source tree.
33
33
  */
34
- var Be={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};
34
+ var Re={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};
35
35
  /**
36
36
  * @license lucide-react v1.31.0 - ISC
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
40
  */
41
- const Ve=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},He=N({}),Ue=()=>ie(He),We=P(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{
41
+ const ze=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Be=N({}),Ve=()=>re(Be),He=F(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{
42
42
  /**
43
43
  * @license lucide-react v1.31.0 - ISC
44
44
  *
@@ -51,14 +51,14 @@ const Ve=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)re
51
51
  * This source code is licensed under the ISC license.
52
52
  * See the LICENSE file in the root directory of this source tree.
53
53
  */
54
- let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Ue()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return te(`svg`,{ref:c,...Be,width:t??l??Be.width,height:t??l??Be.height,stroke:e??f,strokeWidth:m,className:Ie(`lucide`,p,i),...!a&&!Ve(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>te(e,t)),...Array.isArray(a)?a:[a]])}),H=(e,t)=>{
54
+ let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Ve()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return P(`svg`,{ref:c,...Re,width:t??l??Re.width,height:t??l??Re.height,stroke:e??f,strokeWidth:m,className:Pe(`lucide`,p,i),...!a&&!ze(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>P(e,t)),...Array.isArray(a)?a:[a]])}),H=(e,t)=>{
55
55
  /**
56
56
  * @license lucide-react v1.31.0 - ISC
57
57
  *
58
58
  * This source code is licensed under the ISC license.
59
59
  * See the LICENSE file in the root directory of this source tree.
60
60
  */
61
- let n=P(({className:n,...r},i)=>te(We,{ref:i,iconNode:t,className:Ie(`lucide-${Le(ze(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ze(e),n},Ge=H(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Ke=H(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),qe=H(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Je=H(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ye=H(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Xe=H(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ze=H(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Qe=H(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),$e=H(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),et=H(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),tt=H(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),nt=H(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),rt=H(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),it=H(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),at=H(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),ot=H(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),st=H(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ct=H(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),lt=H(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ut=H(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),dt=H(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ft=H(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),pt=H(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),mt=H(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),ht=H(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),gt=H(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),_t=H(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),vt=H(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),yt=H(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),bt=H(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),xt=H(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),St=H(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),Ct=H(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),wt=H(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Tt=H(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Et=N(void 0),Dt=Et.Provider
61
+ let n=F(({className:n,...r},i)=>P(He,{ref:i,iconNode:t,className:Pe(`lucide-${Fe(Le(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Le(e),n},Ue=H(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),We=H(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ge=H(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ke=H(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),qe=H(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Je=H(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ye=H(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Xe=H(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Ze=H(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Qe=H(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),$e=H(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),et=H(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),tt=H(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),nt=H(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),rt=H(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),it=H(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),at=H(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ot=H(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),st=H(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ct=H(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),lt=H(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ut=H(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),dt=H(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ft=H(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),pt=H(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),mt=H(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ht=H(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),gt=H(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),_t=H(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),vt=H(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),yt=H(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),bt=H(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),xt=H(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),St=H(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ct=H(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),wt=N(void 0),Tt=wt.Provider
62
62
  /**
63
63
  * @license lucide-react v1.31.0 - ISC
64
64
  *
@@ -269,75 +269,75 @@ let n=P(({className:n,...r},i)=>te(We,{ref:i,iconNode:t,className:Ie(`lucide-${L
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
271
  */
272
- ;function Ot(){let e=ie(Et);if(!e)throw Error(`useFieldSet must be used within a Form or FieldSet element`);return e}var kt=class{object;components;disabled;constructor(e,t={},n=!1){this.object=e,this.components=t,this.disabled=n}};const At=N(void 0);function jt(){let e=ie(At);if(!e)throw Error(`useForm must be used within a Form element`);return e}const Mt=At.Provider,Nt=M.forwardRef(({object:e,type:n=`text`,onChange:r,...i},a)=>{let[o,s]=z(e.value==null?``:String(e.value)),[c,l]=z(e.schema.isBoolean&&e.value===!0);i.className=i.className?k(v.INPUT,i.className):v.INPUT;let u=t=>{i.disabled||(s(t.target.value),e.schema.isBoolean?(e.value=t.target.checked,l(e.value)):e.value=t.target.value,r?.(t))};return n===`textarea`?t(`textarea`,{ref:a,...i,value:o,onChange:u}):n===`checkbox`?t(`input`,{ref:a,...i,type:`checkbox`,checked:c,onChange:u,className:`form-check-input`}):t(`input`,{ref:a,...i,type:n,value:o,onChange:u})});function Pt({object:e,components:n,onSubmit:r,children:i,onChange:a,disabled:o}){return e.observer=a,t(Mt,{value:new kt(e,n||{},o??!1),children:t(`form`,{className:`w-full`,onSubmit:t=>{t.stopPropagation(),t.preventDefault(),r?.(e.value)},children:i})})}function Ft(){let e=jt();return t(`div`,{className:`flex flex-col gap-4 w-full`,children:e.object.properties.map(Lt)})}function It({children:e,...r}){return n(Pt,{...r,children:[t(Ft,{}),e]})}function Lt(e){return e.isList?t(Vt,{object:e},e.name):e.isObject?t(Bt,{object:e},e.name):t(zt,{object:e},e.name)}function Rt(e,n){return e.isList?t(Vt,{object:e}):e.isObject?t(Bt,{object:e}):t(zt,{object:e,editor:n})}function zt({object:e,editor:n,inline:r=!1}){n||=e.schema.editor;let{components:i,disabled:a}=jt(),o=n&&i[n]||Nt,s=e.getInputType();s===`checkbox`&&(r=!0);let c=t=>{a||(e.value=e.schema.isBoolean?t.target instanceof HTMLInputElement&&t.target.checked:e.schema.isNumber?parseFloat(t.target.value):t.target.value)};return e.isListItem?t(o,{object:e,type:s,onChange:c,disabled:a}):t(u,{label:e.title,required:e.schema.isRequired,description:e.schema.description,className:k(`flex`,r?`flex-row items-center`:`flex-col`),children:t(o,{object:e,type:s,onChange:c,disabled:a})})}function Bt({object:e}){return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-slate-100 dark:border-s-slate-600`,children:[!e.isListItem&&t(`div`,{className:`text-gray-900 dark:text-gray-200 font-semibold`,children:e.title}),e.properties.map(Lt)]})}function Vt({object:e}){let{disabled:i}=jt(),a=R((e.value??[]).length),[o,s]=z(()=>(e.value??[]).map((e,t)=>t)),c=()=>{i||(e.add(),s(e=>[...e,a.current++]))},l=t=>{i||(e.remove(t),s(e=>e.filter((e,n)=>n!==t)))};return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-slate-100 darK:border-s-slate-600`,children:[!e.isListItem&&t(`div`,{className:`text-gray-900 dark:text-gray-200 font-semibold`,children:e.title}),e.items.map((n,r)=>{let a=o[r];return t(Ht,{object:n,list:e,onDelete:()=>l(r),disabled:i},a)}),t(`div`,{children:n(r,{variant:`outline`,onClick:c,disabled:i,children:[t(gt,{className:`size-6`}),` Add`]})})]})}function Ht({list:e,object:i,onDelete:a,disabled:o}){let s=typeof e.schema.arraySchema.editor==`string`?e.schema.arraySchema.editor:void 0;return n(`div`,{className:`flex gap-2 w-full`,children:[t(`div`,{className:`flex-1`,children:Rt(i,s)}),t(r,{variant:`ghost`,onClick:a,disabled:o,title:`Delete`,children:t(Ct,{className:`size-4 text-destructive`})})]})}function Ut({label:e,required:n,children:r}){return t(u,{label:e,required:n,children:r})}function Wt({children:e}){return t(`p`,{className:`mt-2 text-sm text-gray-500`,children:e})}function Gt({children:e}){return t(`p`,{className:`mt-2 text-sm text-red-600`,children:e})}function Kt(e){return e===`object`?{type:`object`,properties:{}}:e===`array`?{type:`array`,items:{}}:{type:e}}var qt=class{schema;properties={};_validator;constructor(e){this.schema=e||{type:`object`,properties:{}},this.load()}get validator(){if(!this._validator){let e=new oe({allErrors:!0,strict:!1});se(e),this._validator=e.compile(this.schema)}return this._validator}load(){if(this.schema.properties){let e=this.schema.properties;Object.keys(e).forEach(t=>{this.loadProperty(t,e[t])})}}hasProperties(){return Object.keys(this.properties).length>0}get title(){let e=this.schema.title;if(typeof e==`string`)return e;let t=this.schema.name;return typeof t==`string`?t:void 0}get description(){return this.schema.description}loadProperty(e,t){let n;return n=t.type===`array`?new Xt(this,e,t):new Jt(this,e,t),this.properties[e]=n,n}get type(){return this.schema.type}validate(e){return this.validator(e)?null:this.validator.errors||[]}addProperty(e,t,n=!1){this.schema.type!==`object`&&(this.schema.type=`object`),this.schema.properties||(this.schema.properties={});let r=typeof t==`string`?Kt(t):t,i=this.loadProperty(e,r);return this.schema.properties[i.name]=i.schema,n&&(i.isRequired=!0),i}removeProperty(e){this.schema.properties&&(delete this.schema.properties[e],Array.isArray(this.schema.required)&&(this.schema.required=this.schema.required.filter(t=>t!==e))),delete this.properties[e]}getProperty(e){return this.properties[e]}get editor(){return typeof this.schema.editor==`string`?this.schema.editor:void 0}},Jt=class extends qt{parent;name;constructor(e,t,n){if(super(n),this.parent=e,this.name=t,n.type===`array`)throw Error(`Array property must be instantiated using ArrayPropertySchema`);n.type===`object`&&!n.properties&&(n.properties={})}get isMulti(){return!1}get isReadOnly(){return!!this.schema.readOnly}set isReadOnly(e){this.schema.readOnly=e}get defaultValue(){return this.schema.default}set defaultValue(e){this.schema.default=e}get enum(){return this.schema.enum}set enum(e){this.schema.enum=e}get isRequired(){let e=this.parent.schema.required;return e?e.includes(this.name):!1}set isRequired(e){let t=Array.isArray(this.parent.schema.required)?this.parent.schema.required:[];t=e?t.concat(this.name):t.filter(e=>e!==this.name),this.parent.schema.required=t}get type(){return this.schema.type}set type(e){this.schema.type!==e&&(this.schema.type=e,e!==`object`&&(this.properties={},this.schema.properties=void 0))}remove(){this.parent.removeProperty(this.name)}get isBoolean(){return this.type===`boolean`}get isString(){return this.type===`string`}get isNumber(){return this.type===`number`||this.type===`integer`}get isObject(){return this.type===`object`}};function Yt(e){if(e.type!==`array`)throw Error(`Expecting an array schema`);if(!e.items)e.items={};else if(Array.isArray(e.items))throw Error(`Tuple arrays are not supported`);return e.items}var Xt=class extends Jt{arraySchema;constructor(e,t,n){super(e,t,Yt(n)),this.arraySchema=n}get isMulti(){return!0}};function Zt(e){return e=e.replace(/_/g,` `).replace(/([a-z0-9])&([A-Z])/g,`$1 $2`),e[0].toUpperCase()+e.slice(1)}function Qt(e,t){if(t.editor)return t.editor;if(t.schema.format)return t.schema.format;switch(t.type){case`number`:case`integer`:return`number`;case`boolean`:return`checkbox`;case`string`:return`text`;default:return`text`}}var $t=class{parent;schema;name;observer;constructor(e,t,n){this.parent=e,this.schema=t,this.name=n}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get path(){return this.parent?this.parent.path.concat(this.name):[]}get isScalar(){return!1}get isListItem(){return!1}get isObject(){return!1}get isList(){return!1}get title(){return this.schema.title||Zt(this.name)}onChange(e){this.observer&&this.observer(this)===!1||this.parent?.onChange(e)}},en=class extends $t{get isObject(){return!0}getProperty(e){let t=this.schema.properties[e];return t.isMulti?new an(this,t,this.getOrInitArrayProperty(e)):t.isObject?new nn(this,t,t.name,this.getOrInitObjectProperty(e)):new rn(this,t)}getOrInitObjectProperty(e){let t=this.value[e];return t||(this.value[e]=t={}),t}getOrInitArrayProperty(e){let t=this.value[e];return t||(this.value[e]=t=[]),t}setPropertyValue(e,t){return this.value[e]!==t&&(this.value[e]=t,!0)}getPropertyValue(e){return this.value[e]}get properties(){let e=[];for(let t of Object.values(this.schema.properties))t.isMulti?e.push(new an(this,t,this.getOrInitArrayProperty(t.name))):t.isObject?e.push(new nn(this,t,t.name,this.getOrInitObjectProperty(t.name))):e.push(new rn(this,t));return e}[Symbol.iterator](){return this.properties[Symbol.iterator]()}},tn=class extends en{value;constructor(e,t={}){super(null,e instanceof qt?e:new qt(e),`#root`),this.value=t}},nn=class extends en{value;constructor(e,t,n,r){super(e,t,n),this.value=r}},rn=class extends $t{constructor(e,t){super(e,t,t.name),e.value[this.name]===void 0&&t.defaultValue!==void 0&&(e.value[this.name]=t.defaultValue)}get isScalar(){return!0}set value(e){this.parent.setPropertyValue(this.name,e)&&this.onChange(this)}get value(){return this.parent.getPropertyValue(this.name)}getInputType(){return Qt(this.name,this.schema)}},an=class extends $t{value;items=[];constructor(e,t,n){super(e,t,t.name),this.value=n;for(let e of this.value)this.add()}get isList(){return!0}newItem(e){return this.schema.isObject?new on(this,e):new sn(this,e)}add(){let e=this.newItem(this.items.length);return this.items.push(e),e}remove(e){let t=this.value;if(e>=0&&e<this.items.length){this.items.splice(e,1);for(let e=0,t=this.items.length;e<t;e++){let t=this.items[e];t.index=e,t.name=String(e)}}Array.isArray(t)&&e>=0&&e<t.length&&(t.splice(e,1),this.onChange(this))}[Symbol.iterator](){return this.items[Symbol.iterator]()}item(e){if(e<0||e>=this.value.length)return;let t=this.value[e];return this.schema.isObject?new nn(this,this.schema,String(e),t):new sn(this,e)}trim(){for(;this.items[this.items.length-1]===void 0;)this.items.pop()}},on=class extends en{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&(e.value[t]={}),this.key=`${this.name}@${Date.now()}`}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}},sn=class extends $t{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&e.schema.defaultValue!==void 0&&(e.value[t]=e.schema.defaultValue),this.key=`${this.name}@${Date.now()}`}get isScalar(){return!0}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}getInputType(){return Qt(this.name,this.schema)}};function cn({data:e,className:r}){let i=L(()=>{try{return JSON.stringify(e,null,2)}catch(e){return console.error(`Failed to stringify JSON:`,e),`{}`}},[e]),a=L(()=>i.split(`
273
- `),[i]);return t(`pre`,{className:`h-full overflow-auto rounded-md border bg-background p-3 font-mono text-xs leading-5 text-foreground ${r||``}`,children:t(`code`,{children:a.map((e,t)=>n(`span`,{children:[dn(e),t<a.length-1?`
274
- `:null]},`line-${t}`))})})}const ln=/("(?:\\.|[^"\\])*"?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,un=/^\s*:/;function dn(e){ln.lastIndex=0;let n=[],r=0,i=ln.exec(e);for(;i!==null;){i.index>r&&n.push(e.slice(r,i.index));let[a,o,s,c]=i,l=o!==void 0&&un.test(e.slice(i.index+a.length))?`text-info`:o?`text-success`:s?`text-primary`:c?`text-attention`:void 0;n.push(t(`span`,{className:l,children:a},`${i.index}-${a}`)),r=i.index+a.length,i=ln.exec(e)}return r<e.length&&n.push(e.slice(r)),n.length?n:e}function fn({value:e}){return Array.isArray(e)?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(gn,{value:e})}):typeof e!=`object`||!e?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(hn,{name:`value`,value:e})}):t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:Object.entries(e).map(([e,n])=>t(hn,{name:e,value:n},e))})}function pn({name:e}){return t(`div`,{className:`text-sm font-semibold`,children:Zt(e)})}function mn({children:e,className:n}){return t(`div`,{className:k(`flex flex-col gap-4 py-2 ps-4 border-s-4 border-s-solid border-s-slate-100 dark:border-s-slate-600`,n),children:e})}function hn({name:e,value:r}){let i=yn(r);switch(i.type){case vn.Inline:return n(`div`,{className:`w-full flex gap-2 text-sm`,children:[t(pn,{name:`${e}:`}),t(`p`,{children:i.value})]});case vn.Paragraph:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(pn,{name:e}),t(`p`,{children:i.value})]});case vn.Prose:return n(`div`,{className:`prose dark:prose-invert`,children:[t(pn,{name:e}),t(`div`,{className:`vprose prose-sm dark:prose-invert`,children:i.value})]});case vn.Array:return t(gn,{name:e,value:r});case vn.Object:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(pn,{name:e}),t(mn,{className:`mt-2`,children:Object.entries(r).map(([e,n])=>t(hn,{name:e,value:n},e))})]})}}function gn({name:e,value:r}){let i=r.join(` `).length,o=i/r.length,s=typeof r[0]==`string`&&(i<80||i<400&&o<32),c=r.length>9,l=r.map((e,t)=>({item:e,index:t,key:`${t}-${JSON.stringify(e)}`}));return s?n(`div`,{className:`flex gap-2 flex-wrap`,children:[e&&t(pn,{name:`${e}:`}),l.map(({item:e,key:n})=>t(a,{children:String(e)},n))]}):n(`div`,{children:[e&&t(pn,{name:e}),t(`div`,{className:`flex flex-col gap-2`,children:l.map(({item:e,index:n,key:r})=>t(_n,{index:n,value:e,useBullet:c},r))})]})}function _n({index:e,value:r,useBullet:i}){let a=i?t(`span`,{className:`text-xl`,children:`•`}):n(`span`,{children:[e+1,`.`]}),o=yn(r),s;switch(o.type){case vn.Object:s=t(mn,{children:Object.entries(r).map(([e,n])=>t(hn,{name:e,value:n},e))});break;case vn.Array:s=t(gn,{value:r});break;case vn.Prose:s=t(`div`,{className:`prose dark:prose-invert`,children:o.value});break;default:s=t(`div`,{children:o.value})}return n(`div`,{className:`flex gap-4 hover:bg-muted py-2 pe-2 ps-4`,children:[t(`div`,{className:`font-semibold text-muted`,children:a}),t(`div`,{children:s})]})}var vn;(function(e){e[e.Inline=0]=`Inline`,e[e.Paragraph=1]=`Paragraph`,e[e.Prose=2]=`Prose`,e[e.Array=3]=`Array`,e[e.Object=4]=`Object`})(vn||={});function yn(e){if(e==null)return{value:`-`,type:vn.Inline};if(Array.isArray(e))return{value:e,type:vn.Array};if(typeof e==`string`){let t=e.length,n,r=e;return t<80?n=vn.Inline:t>400?n=vn.Prose:(n=vn.Paragraph,r=e.replace(/(?:\n\n)+/g,`
272
+ ;function Et(){let e=re(wt);if(!e)throw Error(`useFieldSet must be used within a Form or FieldSet element`);return e}var Dt=class{object;components;disabled;constructor(e,t={},n=!1){this.object=e,this.components=t,this.disabled=n}};const Ot=N(void 0);function kt(){let e=re(Ot);if(!e)throw Error(`useForm must be used within a Form element`);return e}const At=Ot.Provider,jt=M.forwardRef(({object:e,type:n=`text`,onChange:r,...i},a)=>{let[o,s]=B(e.value==null?``:String(e.value)),[c,l]=B(e.schema.isBoolean&&e.value===!0);i.className=i.className?k(v.INPUT,i.className):v.INPUT;let u=t=>{i.disabled||(s(t.target.value),e.schema.isBoolean?(e.value=t.target.checked,l(e.value)):e.value=t.target.value,r?.(t))};return n===`textarea`?t(`textarea`,{ref:a,...i,value:o,onChange:u}):n===`checkbox`?t(`input`,{ref:a,...i,type:`checkbox`,checked:c,onChange:u,className:`form-check-input`}):t(`input`,{ref:a,...i,type:n,value:o,onChange:u})});function Mt({object:e,components:n,onSubmit:r,children:i,onChange:a,disabled:o}){return e.observer=a,t(At,{value:new Dt(e,n||{},o??!1),children:t(`form`,{className:`w-full`,onSubmit:t=>{t.stopPropagation(),t.preventDefault(),r?.(e.value)},children:i})})}function Nt(){let e=kt();return t(`div`,{className:`flex flex-col gap-4 w-full`,children:e.object.properties.map(Ft)})}function Pt({children:e,...r}){return n(Mt,{...r,children:[t(Nt,{}),e]})}function Ft(e){return e.isList?t(zt,{object:e},e.name):e.isObject?t(Rt,{object:e},e.name):t(Lt,{object:e},e.name)}function It(e,n){return e.isList?t(zt,{object:e}):e.isObject?t(Rt,{object:e}):t(Lt,{object:e,editor:n})}function Lt({object:e,editor:n,inline:r=!1}){n||=e.schema.editor;let{components:i,disabled:a}=kt(),o=n&&i[n]||jt,s=e.getInputType();s===`checkbox`&&(r=!0);let c=t=>{a||(e.value=e.schema.isBoolean?t.target instanceof HTMLInputElement&&t.target.checked:e.schema.isNumber?parseFloat(t.target.value):t.target.value)};return e.isListItem?t(o,{object:e,type:s,onChange:c,disabled:a}):t(u,{label:e.title,required:e.schema.isRequired,description:e.schema.description,className:k(`flex`,r?`flex-row items-center`:`flex-col`),children:t(o,{object:e,type:s,onChange:c,disabled:a})})}function Rt({object:e}){return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-border`,children:[!e.isListItem&&t(`div`,{className:`text-foreground font-semibold`,children:e.title}),e.properties.map(Ft)]})}function zt({object:e}){let{disabled:i}=kt(),a=z((e.value??[]).length),[o,s]=B(()=>(e.value??[]).map((e,t)=>t)),c=()=>{i||(e.add(),s(e=>[...e,a.current++]))},l=t=>{i||(e.remove(t),s(e=>e.filter((e,n)=>n!==t)))};return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-border darK:border-s-border`,children:[!e.isListItem&&t(`div`,{className:`text-foreground font-semibold`,children:e.title}),e.items.map((n,r)=>{let a=o[r];return t(Bt,{object:n,list:e,onDelete:()=>l(r),disabled:i},a)}),t(`div`,{children:n(r,{variant:`outline`,onClick:c,disabled:i,children:[t(mt,{className:`size-6`}),` Add`]})})]})}function Bt({list:e,object:i,onDelete:a,disabled:o}){let s=typeof e.schema.arraySchema.editor==`string`?e.schema.arraySchema.editor:void 0;return n(`div`,{className:`flex gap-2 w-full`,children:[t(`div`,{className:`flex-1`,children:It(i,s)}),t(r,{variant:`ghost`,onClick:a,disabled:o,title:`Delete`,children:t(xt,{className:`size-4 text-destructive`})})]})}function Vt({label:e,required:n,children:r}){return t(u,{label:e,required:n,children:r})}function Ht({children:e}){return t(`p`,{className:`mt-2 text-sm text-muted`,children:e})}function Ut({children:e}){return t(`p`,{className:`mt-2 text-sm text-destructive`,children:e})}function Wt(e){return e===`object`?{type:`object`,properties:{}}:e===`array`?{type:`array`,items:{}}:{type:e}}var Gt=class{schema;properties={};_validator;constructor(e){this.schema=e||{type:`object`,properties:{}},this.load()}get validator(){if(!this._validator){let e=new ae({allErrors:!0,strict:!1});oe(e),this._validator=e.compile(this.schema)}return this._validator}load(){if(this.schema.properties){let e=this.schema.properties;Object.keys(e).forEach(t=>{this.loadProperty(t,e[t])})}}hasProperties(){return Object.keys(this.properties).length>0}get title(){let e=this.schema.title;if(typeof e==`string`)return e;let t=this.schema.name;return typeof t==`string`?t:void 0}get description(){return this.schema.description}loadProperty(e,t){let n;return n=t.type===`array`?new Jt(this,e,t):new Kt(this,e,t),this.properties[e]=n,n}get type(){return this.schema.type}validate(e){return this.validator(e)?null:this.validator.errors||[]}addProperty(e,t,n=!1){this.schema.type!==`object`&&(this.schema.type=`object`),this.schema.properties||(this.schema.properties={});let r=typeof t==`string`?Wt(t):t,i=this.loadProperty(e,r);return this.schema.properties[i.name]=i.schema,n&&(i.isRequired=!0),i}removeProperty(e){this.schema.properties&&(delete this.schema.properties[e],Array.isArray(this.schema.required)&&(this.schema.required=this.schema.required.filter(t=>t!==e))),delete this.properties[e]}getProperty(e){return this.properties[e]}get editor(){return typeof this.schema.editor==`string`?this.schema.editor:void 0}},Kt=class extends Gt{parent;name;constructor(e,t,n){if(super(n),this.parent=e,this.name=t,n.type===`array`)throw Error(`Array property must be instantiated using ArrayPropertySchema`);n.type===`object`&&!n.properties&&(n.properties={})}get isMulti(){return!1}get isReadOnly(){return!!this.schema.readOnly}set isReadOnly(e){this.schema.readOnly=e}get defaultValue(){return this.schema.default}set defaultValue(e){this.schema.default=e}get enum(){return this.schema.enum}set enum(e){this.schema.enum=e}get isRequired(){let e=this.parent.schema.required;return e?e.includes(this.name):!1}set isRequired(e){let t=Array.isArray(this.parent.schema.required)?this.parent.schema.required:[];t=e?t.concat(this.name):t.filter(e=>e!==this.name),this.parent.schema.required=t}get type(){return this.schema.type}set type(e){this.schema.type!==e&&(this.schema.type=e,e!==`object`&&(this.properties={},this.schema.properties=void 0))}remove(){this.parent.removeProperty(this.name)}get isBoolean(){return this.type===`boolean`}get isString(){return this.type===`string`}get isNumber(){return this.type===`number`||this.type===`integer`}get isObject(){return this.type===`object`}};function qt(e){if(e.type!==`array`)throw Error(`Expecting an array schema`);if(!e.items)e.items={};else if(Array.isArray(e.items))throw Error(`Tuple arrays are not supported`);return e.items}var Jt=class extends Kt{arraySchema;constructor(e,t,n){super(e,t,qt(n)),this.arraySchema=n}get isMulti(){return!0}};function Yt(e){return e=e.replace(/_/g,` `).replace(/([a-z0-9])&([A-Z])/g,`$1 $2`),e[0].toUpperCase()+e.slice(1)}function Xt(e,t){if(t.editor)return t.editor;if(t.schema.format)return t.schema.format;switch(t.type){case`number`:case`integer`:return`number`;case`boolean`:return`checkbox`;case`string`:return`text`;default:return`text`}}var Zt=class{parent;schema;name;observer;constructor(e,t,n){this.parent=e,this.schema=t,this.name=n}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get path(){return this.parent?this.parent.path.concat(this.name):[]}get isScalar(){return!1}get isListItem(){return!1}get isObject(){return!1}get isList(){return!1}get title(){return this.schema.title||Yt(this.name)}onChange(e){this.observer&&this.observer(this)===!1||this.parent?.onChange(e)}},Qt=class extends Zt{get isObject(){return!0}getProperty(e){let t=this.schema.properties[e];return t.isMulti?new nn(this,t,this.getOrInitArrayProperty(e)):t.isObject?new en(this,t,t.name,this.getOrInitObjectProperty(e)):new tn(this,t)}getOrInitObjectProperty(e){let t=this.value[e];return t||(this.value[e]=t={}),t}getOrInitArrayProperty(e){let t=this.value[e];return t||(this.value[e]=t=[]),t}setPropertyValue(e,t){return this.value[e]!==t&&(this.value[e]=t,!0)}getPropertyValue(e){return this.value[e]}get properties(){let e=[];for(let t of Object.values(this.schema.properties))t.isMulti?e.push(new nn(this,t,this.getOrInitArrayProperty(t.name))):t.isObject?e.push(new en(this,t,t.name,this.getOrInitObjectProperty(t.name))):e.push(new tn(this,t));return e}[Symbol.iterator](){return this.properties[Symbol.iterator]()}},$t=class extends Qt{value;constructor(e,t={}){super(null,e instanceof Gt?e:new Gt(e),`#root`),this.value=t}},en=class extends Qt{value;constructor(e,t,n,r){super(e,t,n),this.value=r}},tn=class extends Zt{constructor(e,t){super(e,t,t.name),e.value[this.name]===void 0&&t.defaultValue!==void 0&&(e.value[this.name]=t.defaultValue)}get isScalar(){return!0}set value(e){this.parent.setPropertyValue(this.name,e)&&this.onChange(this)}get value(){return this.parent.getPropertyValue(this.name)}getInputType(){return Xt(this.name,this.schema)}},nn=class extends Zt{value;items=[];constructor(e,t,n){super(e,t,t.name),this.value=n;for(let e of this.value)this.add()}get isList(){return!0}newItem(e){return this.schema.isObject?new rn(this,e):new an(this,e)}add(){let e=this.newItem(this.items.length);return this.items.push(e),e}remove(e){let t=this.value;if(e>=0&&e<this.items.length){this.items.splice(e,1);for(let e=0,t=this.items.length;e<t;e++){let t=this.items[e];t.index=e,t.name=String(e)}}Array.isArray(t)&&e>=0&&e<t.length&&(t.splice(e,1),this.onChange(this))}[Symbol.iterator](){return this.items[Symbol.iterator]()}item(e){if(e<0||e>=this.value.length)return;let t=this.value[e];return this.schema.isObject?new en(this,this.schema,String(e),t):new an(this,e)}trim(){for(;this.items[this.items.length-1]===void 0;)this.items.pop()}},rn=class extends Qt{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&(e.value[t]={}),this.key=`${this.name}@${Date.now()}`}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}},an=class extends Zt{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&e.schema.defaultValue!==void 0&&(e.value[t]=e.schema.defaultValue),this.key=`${this.name}@${Date.now()}`}get isScalar(){return!0}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}getInputType(){return Xt(this.name,this.schema)}};function on({data:e,className:r}){let i=R(()=>{try{return JSON.stringify(e,null,2)}catch(e){return console.error(`Failed to stringify JSON:`,e),`{}`}},[e]),a=R(()=>i.split(`
273
+ `),[i]);return t(`pre`,{className:`h-full overflow-auto rounded-md border bg-background p-3 font-mono text-xs leading-5 text-foreground ${r||``}`,children:t(`code`,{children:a.map((e,t)=>n(`span`,{children:[ln(e),t<a.length-1?`
274
+ `:null]},`line-${t}`))})})}const sn=/("(?:\\.|[^"\\])*"?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,cn=/^\s*:/;function ln(e){sn.lastIndex=0;let n=[],r=0,i=sn.exec(e);for(;i!==null;){i.index>r&&n.push(e.slice(r,i.index));let[a,o,s,c]=i,l=o!==void 0&&cn.test(e.slice(i.index+a.length))?`text-info`:o?`text-success`:s?`text-primary`:c?`text-attention`:void 0;n.push(t(`span`,{className:l,children:a},`${i.index}-${a}`)),r=i.index+a.length,i=sn.exec(e)}return r<e.length&&n.push(e.slice(r)),n.length?n:e}function un({value:e}){return Array.isArray(e)?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(mn,{value:e})}):typeof e!=`object`||!e?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(pn,{name:`value`,value:e})}):t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:Object.entries(e).map(([e,n])=>t(pn,{name:e,value:n},e))})}function dn({name:e}){return t(`div`,{className:`text-sm font-semibold`,children:Yt(e)})}function fn({children:e,className:n}){return t(`div`,{className:k(`flex flex-col gap-4 py-2 ps-4 border-s-4 border-s-solid border-s-border`,n),children:e})}function pn({name:e,value:r}){let i=_n(r);switch(i.type){case gn.Inline:return n(`div`,{className:`w-full flex gap-2 text-sm`,children:[t(dn,{name:`${e}:`}),t(`p`,{children:i.value})]});case gn.Paragraph:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(dn,{name:e}),t(`p`,{children:i.value})]});case gn.Prose:return n(`div`,{className:`prose dark:prose-invert`,children:[t(dn,{name:e}),t(`div`,{className:`vprose prose-sm dark:prose-invert`,children:i.value})]});case gn.Array:return t(mn,{name:e,value:r});case gn.Object:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(dn,{name:e}),t(fn,{className:`mt-2`,children:Object.entries(r).map(([e,n])=>t(pn,{name:e,value:n},e))})]})}}function mn({name:e,value:r}){let i=r.join(` `).length,o=i/r.length,s=typeof r[0]==`string`&&(i<80||i<400&&o<32),c=r.length>9,l=r.map((e,t)=>({item:e,index:t,key:`${t}-${JSON.stringify(e)}`}));return s?n(`div`,{className:`flex gap-2 flex-wrap`,children:[e&&t(dn,{name:`${e}:`}),l.map(({item:e,key:n})=>t(a,{children:String(e)},n))]}):n(`div`,{children:[e&&t(dn,{name:e}),t(`div`,{className:`flex flex-col gap-2`,children:l.map(({item:e,index:n,key:r})=>t(hn,{index:n,value:e,useBullet:c},r))})]})}function hn({index:e,value:r,useBullet:i}){let a=i?t(`span`,{className:`text-xl`,children:`•`}):n(`span`,{children:[e+1,`.`]}),o=_n(r),s;switch(o.type){case gn.Object:s=t(fn,{children:Object.entries(r).map(([e,n])=>t(pn,{name:e,value:n},e))});break;case gn.Array:s=t(mn,{value:r});break;case gn.Prose:s=t(`div`,{className:`prose dark:prose-invert`,children:o.value});break;default:s=t(`div`,{children:o.value})}return n(`div`,{className:`flex gap-4 hover:bg-muted py-2 pe-2 ps-4`,children:[t(`div`,{className:`font-semibold text-muted`,children:a}),t(`div`,{children:s})]})}var gn;(function(e){e[e.Inline=0]=`Inline`,e[e.Paragraph=1]=`Paragraph`,e[e.Prose=2]=`Prose`,e[e.Array=3]=`Array`,e[e.Object=4]=`Object`})(gn||={});function _n(e){if(e==null)return{value:`-`,type:gn.Inline};if(Array.isArray(e))return{value:e,type:gn.Array};if(typeof e==`string`){let t=e.length,n,r=e;return t<80?n=gn.Inline:t>400?n=gn.Prose:(n=gn.Paragraph,r=e.replace(/(?:\n\n)+/g,`
275
275
 
276
- `)),{type:n,value:r}}return typeof e==`number`||typeof e==`boolean`?{value:String(e),type:vn.Inline}:{value:e,type:vn.Object}}function bn({value:e,viewCode:n=!1}){let{t:r}=B();return e?t(`div`,{className:`relative w-full h-full flex flex-col`,children:n||!xn(e)?t(cn,{data:e}):t(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:t(fn,{value:e})})}):t(`pre`,{className:`whitespace-pre-wrap`,children:r(`misc.noData`)})}function xn(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`?!0:Array.isArray(e)?e.every(xn):typeof e==`object`&&Object.values(e).every(xn)}const Sn=new Set;function Cn(e){Sn.has(`markdown`)||(Sn.add(`markdown`),e.languages.registerFoldingRangeProvider(`markdown`,{provideFoldingRanges(e){let t=[],n=e.getLinesContent(),r=/^(#{1,6})\s/,i=[];for(let e=0;e<n.length;e++){let a=e+1,o=r.exec(n[e]);if(o){let e=o[1].length;for(;i.length>0&&i[i.length-1].level>=e;){let e=i.pop();e&&a-1>e.line&&t.push({start:e.line,end:a-1})}i.push({level:e,line:a})}}let a=n.length;for(;i.length>0;){let e=i.pop();e&&a>e.line&&t.push({start:e.line,end:a})}return t}}));for(let t of[`javascript`,`typescript`])Sn.has(t)||(Sn.add(t),e.languages.registerFoldingRangeProvider(t,{provideFoldingRanges(e){let t=e.getLinesContent(),n=/^(#{1,6})\s/,r=[],i=[],a=[],o=[],s=!1,c=!1,l=``;for(let e=0;e<t.length;e++){let u=e+1,d=t[e],f=s;for(let e=0;e<d.length;e++){let t=d[e];if(t===`\\`){e++;continue}if(c){t===l&&(c=!1);continue}if(s){t==="`"&&(s=!1);continue}if(t==="`"){s=!0;continue}if(t===`"`||t===`'`){c=!0,l=t;continue}if(t===`{`&&a.push(u),t===`}`&&a.length>0){let t=a.pop(),n=d.slice(e+1).trimStart().length>0?u-1:u;t!==void 0&&n>t&&r.push({start:t,end:n})}}if(f){let e=n.exec(d);if(e){let t=e[1].length;for(;o.length>0&&o[o.length-1].level>=t;){let e=o.pop();e&&u-1>e.line&&i.push({start:e.line,end:u-1})}o.push({level:t,line:u})}if(!s)for(;o.length>0;){let e=o.pop();e&&u>e.line&&i.push({start:e.line,end:u})}}}return[...r,...i]}}))}const wn=ne(()=>import(`@monaco-editor/react`).then(({Editor:e})=>({default:e})));let Tn;function En(){if(!(typeof document>`u`)){if(!Tn){let e=document.createElement(`div`);e.className=`monaco-editor`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.zIndex=`10000`,document.body.appendChild(e),Tn=e}return Tn}}const Dn=new Map;let On=0;function kn(e){(e.languages.json?.jsonDefaults)?.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:Array.from(Dn.entries()).map(([e,t])=>({uri:`vertesia://schemas/${encodeURIComponent(e)}`,fileMatch:[e],schema:t}))})}var An=class{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||``)}};function jn({onChange:e,value:n,className:r,editorRef:i,language:a=`javascript`,path:o,debounceTimeout:s=0,options:c={},beforeMount:l,onMount:u,defaultValue:d,useCustomFolding:f=!1,jsonSchema:p}){let[m,h]=z(n||d||``),g=R(null),_=R(null),[v]=z(()=>p?`inmemory://vertesia/json/${++On}.json`:void 0),y=o??v,{theme:b}=D(),x=b===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:b,S=n||d||``,C=R(()=>m),w=R(e=>{h(e),g.current&&g.current.setValue(e)});I(()=>{C.current=()=>m},[m]),I(()=>(i&&(i.current=new An(()=>C.current(),e=>w.current(e))),()=>{i&&(i.current=void 0)}),[i]);let T=L(()=>{if(e)return s>0?ce(t=>e(t),s):e},[e,s]),E=F(async(e,t)=>{let n=e.getModel();if(n)for(let r of n.getValue().matchAll(/```[\s\S]*?```/g)){let i=n.getPositionAt(r.index).lineNumber,a=n.getPositionAt(r.index+r[0].length).lineNumber;e.setSelection(new t.Selection(i,1,a,1)),await e.getAction(`editor.createFoldingRangeFromSelection`)?.run()}},[]),O=F(e=>{let t=e||``;if(h(t),T){let e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};T(e)}},[T]),A=F((e,t)=>{g.current=e,_.current=t,p&&y&&a===`json`&&(Dn.set(y,p),kn(t)),f&&Cn(t),w.current=t=>{h(t),e.setValue(t)},t.editor.defineTheme(`errorLineTheme`,{base:x===`dark`?`vs-dark`:`vs`,inherit:!0,rules:[],colors:{"editorError.background":`#ffebee`,"editorError.border":`#f44336`}}),t.editor.setTheme(`errorLineTheme`),f&&setTimeout(()=>E(e,t),300),u?.(e,t)},[u,x,f,E,p,y,a]);I(()=>()=>{p&&y&&Dn.delete(y)&&_.current&&kn(_.current)},[p,y]),I(()=>{g.current?.hasTextFocus()||h(e=>S===e?e:(g.current&&g.current.setValue(S),S))},[S]),I(()=>{if(!S||!f||!g.current||!_.current||g.current.hasTextFocus())return;let e=g.current,t=_.current,n=setTimeout(()=>E(e,t),300);return()=>clearTimeout(n)},[S,f,E]);let j={fontSize:14,fontFamily:`monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,lineNumbers:`on`,folding:!0,lineDecorationsWidth:10,lineNumbersMinChars:3,automaticLayout:!0,formatOnPaste:!0,formatOnType:!0,tabSize:2,insertSpaces:!0,fixedOverflowWidgets:!0,overflowWidgetsDomNode:En(),glyphMargin:!0,renderValidationDecorations:`on`,renderLineHighlight:`line`,hover:{enabled:`on`,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...c};return t(`div`,{className:k(r,`w-full h-full!`),children:t(ee,{fallback:t(`div`,{className:`h-full w-full`}),children:t(wn,{className:`h-full w-full`,height:`100%`,theme:x===`dark`?`vs-dark`:`light`,language:a,path:y,onChange:O,onMount:A,beforeMount:l,options:j,defaultValue:S})})})}function Mn({value:e,onChange:r,onValidChange:i,readonly:a=!1,height:o=`200px`,placeholder:s,className:c}){let{theme:l}=D(),u=R(void 0),[d,f]=z(null),p=L(()=>{if(e==null)return s??`{}`;try{return JSON.stringify(e,null,2)}catch{return`{}`}},[e,s]),m=F(()=>{if(!u.current||a)return;let e=u.current.getValue();try{let t=JSON.parse(e);f(null),i?.(t)}catch{f(`Invalid JSON`)}},[a,i]);return n(`div`,{className:c,children:[t(`div`,{className:`border rounded overflow-hidden`,style:{height:o},children:t(jn,{defaultValue:p,editorRef:u,language:`json`,theme:l===`dark`?`vs-dark`:`vs`,onChange:m,options:a?{readOnly:!0,domReadOnly:!0}:void 0})}),d&&t(`p`,{className:`text-xs text-destructive mt-1`,children:d})]})}function Nn(e){if(!e.current)return null;try{return JSON.parse(e.current.getValue())}catch{return null}}function Pn({title:e,viewCode:i,setViewCode:a}){return n(`div`,{className:`flex items-center gap-1 bg-muted mb-2 p-1 rounded`,children:[t(r,{variant:i?`ghost`:`primary`,size:`sm`,title:`Preview properties`,onClick:()=>a(!1),children:e}),t(r,{variant:i?`primary`:`ghost`,size:`sm`,title:`View in JSON format`,onClick:()=>a(!0),children:`JSON`})]})}function Fn(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase())}function In(r){return r==null?`Failed to query`:typeof r==`string`?r:Array.isArray(r)?r.length===0?`None`:r.some(e=>e&&typeof e==`object`)?t(e,{children:r.map((e,r)=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[r+1,`:`]}),t(`span`,{className:`text-xs`,children:In(e)})]},`item-${r}`))}):r.map(e=>String(e)).join(`, `):typeof r==`object`?t(e,{children:Object.entries(r).map(([e,r])=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[Fn(e),`:`]}),t(`span`,{className:`text-xs`,children:In(r)})]},e))}):String(r)}function Ln({data:e,className:r}){let i=e?Object.entries(e):[];return t(`table`,{className:r||`mb-2 text-xs bg-muted rounded-sm w-full`,children:t(`tbody`,{children:i.map(([e,r])=>n(`tr`,{className:`align-top hover:bg-background border-y`,children:[t(`td`,{className:`align-top pe-4 p-2`,children:Fn(e)}),t(`td`,{className:`p-2`,children:In(r)})]},e))})})}const Rn=N(()=>({kind:`none`})),zn=Rn.Provider;function Bn(){return ie(Rn)}const Vn={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function Hn(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Vn,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Vn[n],id:r}}var Un=Object.defineProperty,Wn=(e,t)=>Un(e,`name`,{value:t,configurable:!0}),Gn=!!(typeof window<`u`&&window.document&&window.document.createElement);function Kn(e,t,{checkForDefaultPrevented:n=!0}={}){return Wn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Wn(Kn,`composeEventHandlers`);function qn(e){if(!Gn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Wn(qn,`getOwnerWindow`);function Jn(e){if(!Gn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Wn(Jn,`getOwnerDocument`);function Yn(e,t=!1){let{activeElement:n}=Jn(e);if(!n?.nodeName)return null;if(Xn(n)&&n.contentDocument)return Yn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Jn(n).getElementById(e);if(t)return t}}return n}Wn(Yn,`getActiveElement`);function Xn(e){return e.tagName===`IFRAME`}Wn(Xn,`isFrame`);var Zn=Object.defineProperty,Qn=(e,t)=>Zn(e,`name`,{value:t,configurable:!0});function $n(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qn($n,`setRef`);function er(...e){return t=>{let n=!1,r=e.map(e=>{let r=$n(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():$n(e[t],null)}}}}Qn(er,`composeRefs`);function tr(...e){return j.useCallback(er(...e),e)}Qn(tr,`useComposedRefs`);var nr=Object.defineProperty,rr=(e,t)=>nr(e,`name`,{value:t,configurable:!0});function ir(e,n){let r=j.createContext(n);r.displayName=e+`Context`;let i=rr(e=>{let{children:n,...i}=e,a=j.useMemo(()=>i,Object.values(i));return t(r.Provider,{value:a,children:n})},`Provider`);i.displayName=e+`Provider`;function a(t,i={}){let{optional:a=!1}=i,o=j.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return rr(a,`useContext`),[i,a]}rr(ir,`createContext`);function ar(e,n=[]){let r=[];function i(n,i){let a=j.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=rr(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=j.useMemo(()=>s,Object.values(s));return t(c.Provider,{value:l,children:i})},`Provider`);s.displayName=n+`Provider`;function c(t,r,s={}){let{optional:c=!1}=s,l=r?.[e]?.[o]||a,u=j.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return rr(c,`useContext`),[s,c]}rr(i,`createContext`);let a=rr(()=>{let t=r.map(e=>j.createContext(e));return rr(function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,or(a,...n)]}rr(ar,`createContextScope`);function or(...e){let t=e[0];if(e.length===1)return t;let n=rr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return rr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}rr(or,`composeContextScopes`);var sr=globalThis?.document?j.useLayoutEffect:()=>{},cr=Object.defineProperty,lr=(e,t)=>cr(e,`name`,{value:t,configurable:!0}),ur=j.useId||(()=>void 0),dr=0;function fr(e){let[t,n]=j.useState(ur());return sr(()=>{e||n(e=>e??String(dr++))},[e]),e||(t?`radix-${t}`:``)}lr(fr,`useId`);var pr=Object.defineProperty,mr=(e,t)=>pr(e,`name`,{value:t,configurable:!0}),hr=j.useEffectEvent,gr=j.useInsertionEffect;function _r(e){if(typeof hr==`function`)return hr(e);let t=j.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof gr==`function`?gr(()=>{t.current=e}):sr(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}mr(_r,`useEffectEvent`);var vr=Object.defineProperty,yr=(e,t)=>vr(e,`name`,{value:t,configurable:!0}),br=j.useInsertionEffect||sr;function xr({prop:e,defaultProp:t,onChange:n=yr(()=>{},`onChange`),caller:r}){let[i,a,o]=Sr({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,j.useCallback(t=>{if(s){let n=Cr(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}yr(xr,`useControllableState`);function Sr({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return br(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}yr(Sr,`useUncontrolledState`);function Cr(e){return typeof e==`function`}yr(Cr,`isFunction`);var wr=Symbol(`RADIX:SYNC_STATE`);function Tr(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=_r(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=j.useReducer((t,n)=>{if(n.type===wr)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=j.useRef(p);j.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=j.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return j.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:wr,state:i})},[i,d.state,c]),[h,f]}yr(Tr,`useControllableStateReducer`);var Er=Object.defineProperty,Dr=(e,t)=>Er(e,`name`,{value:t,configurable:!0});function Or(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ir(r)&&typeof Br==`function`&&(r=Br(r._payload)),j.Children.forEach(r,e=>{if(Pr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ir(n)&&typeof Br==`function`&&(n=Br(n._payload)),a=jr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?Nr(a):void 0,l=tr(n,c);if(!a){if(r||r===0)throw Error(o?zr(e):Rr(e));return r}let u=Mr(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Dr(Or,`createSlot`);var kr=Symbol.for(`radix.slottable`);function Ar(e){let t=Dr(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=kr,t}Dr(Ar,`createSlottable`);var jr=Dr((e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Mr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Dr(Mr,`mergeProps`);function Nr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Dr(Nr,`getElementRef`);function Pr(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===kr}Dr(Pr,`isSlottable`);var Fr=Symbol.for(`react.lazy`);function Ir(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Fr&&`_payload`in e&&Lr(e._payload)}Dr(Ir,`isLazyComponent`);function Lr(e){return typeof e==`object`&&!!e&&`then`in e}Dr(Lr,`isPromiseLike`);var Rr=Dr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),zr=Dr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Br=j.use,Vr=Object.defineProperty,Hr=(e,t)=>Vr(e,`name`,{value:t,configurable:!0}),Ur=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=Or(`Primitive.${n}`),i=j.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Wr(e,t){e&&he.flushSync(()=>e.dispatchEvent(t))}Hr(Wr,`dispatchDiscreteCustomEvent`);var Gr=Object.defineProperty,Kr=j.forwardRef(((e,t)=>Gr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=j.useState(!1);sr(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?he.createPortal(t(Ur.div,{...i,ref:n}),s):null},`Portal`)),qr=Object.defineProperty,Jr=(e,t)=>qr(e,`name`,{value:t,configurable:!0});function Yr(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}Jr(Yr,`useStateMachine`);var Xr=Jr(e=>{let{present:t,children:n}=e,r=Zr(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=$r(r.ref,ti(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null},`Presence`);function Zr(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Yr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??ei(r.current),o.current=void 0):a.current=`none`},[s]),sr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ei(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),sr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Jr(a=>{let o=ei(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Jr(e=>{e.target===t&&(a.current=ei(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ei(t)}else r.current=null;n(e)},[])}}Jr(Zr,`usePresence`);function Qr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Jr(Qr,`setRef`);function $r(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Qr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Qr(n[e],null)}}},[])}Jr($r,`useStableComposedRefs`);function ei(e){return e?.animationName||`none`}Jr(ei,`getAnimationName`);function ti(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Jr(ti,`getElementRef`);var ni=Object.defineProperty,ri=(e,t)=>ni(e,`name`,{value:t,configurable:!0}),ii=`Dialog`,[ai,oi]=ar(ii),[si,ci]=ai(ii),li=ri(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=j.useRef(null),l=j.useRef(null),[u,d]=xr({prop:i,defaultProp:a??!1,onChange:o,caller:ii}),[f,p]=j.useState(0),[m,h]=j.useState(0);return t(si,{scope:n,triggerRef:c,contentRef:l,contentId:fr(),titleId:fr(),descriptionId:fr(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),ui=`DialogPortal`,[di,fi]=ai(ui,{forceMount:void 0}),pi=ri(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=ci(ui,n);return t(di,{scope:n,forceMount:r,children:j.Children.map(i,e=>t(Xr,{present:r||o.open,children:t(Kr,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),mi=`DialogOverlay`,hi=j.forwardRef(ri(function(e,n){let r=fi(mi,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=ci(mi,e.__scopeDialog);return o.modal?t(Xr,{present:i||o.open,children:t(_i,{...a,ref:n})}):null},`DialogOverlay`)),gi=Or(`DialogOverlay.RemoveScroll`),_i=j.forwardRef(ri(function(e,n){let{__scopeDialog:r,...i}=e,a=ci(mi,r),o=tr(n,pe());return t(_e,{as:gi,allowPinchZoom:!0,shards:[a.contentRef],children:t(Ur.div,{"data-state":ki(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),vi=`DialogContent`,yi=j.forwardRef(ri(function(e,n){let r=fi(vi,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=ci(vi,e.__scopeDialog);return t(Xr,{present:i||o.open,children:o.modal?t(bi,{...a,ref:n}):t(xi,{...a,ref:n})})},`DialogContent`)),bi=j.forwardRef(ri(function(e,n){let r=ci(vi,e.__scopeDialog),i=j.useRef(null),a=tr(n,r.contentRef,i);return j.useEffect(()=>{let e=i.current;if(e)return ve(e)},[]),t(Si,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Kn(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Kn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Kn(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),xi=j.forwardRef(ri(function(e,n){let r=ci(vi,e.__scopeDialog),i=j.useRef(!1),a=j.useRef(!1);return t(Si,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),Si=j.forwardRef(ri(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=ci(vi,i);return ge(),t(e,{children:t(me,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(fe,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":ki(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),Ci=`DialogTitle`,wi=j.forwardRef(ri(function(e,n){let{__scopeDialog:r,...i}=e,a=ci(Ci,r),{setTitleCount:o}=a;return sr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Ur.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),Ti=`DialogDescription`,Ei=j.forwardRef(ri(function(e,n){let{__scopeDialog:r,...i}=e,a=ci(Ti,r),{setDescriptionCount:o}=a;return sr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Ur.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),Di=`DialogClose`,Oi=j.forwardRef(ri(function(e,n){let{__scopeDialog:r,...i}=e,a=ci(Di,r);return t(Ur.button,{type:`button`,...i,ref:n,onClick:Kn(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function ki(e){return e?`open`:`closed`}ri(ki,`getState`);function Ai(...e){return xe(A(e))}const ji=N(null);function Mi(){return ie(ji)}function Ni(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function Pi(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Fi(e){return`file:${e}`}const Ii=ne(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function Li({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-red-600 dark:text-red-400`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate`,children:e})]})})}function Ri(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(ut,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function zi({isOpen:e,onClose:i,title:a,description:o,children:s}){let{t:c}=B();return t(li,{open:e,onOpenChange:e=>!e&&i(),children:n(pi,{children:[t(hi,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(yi,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-white dark:bg-gray-900 rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:i,children:[t(Oi,{asChild:!0,children:t(r,{variant:`unstyled`,onClick:i,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(Tt,{className:`w-5 h-5 text-gray-600 dark:text-gray-300`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:s}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-gray-200 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50 rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(wi,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:a||c(`agent.dashboard`)}),o&&t(Ei,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:o})]})})]})]})})}function Bi(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}const Vi={categorical:[`#6366f1`,`#8b5cf6`,`#ec4899`,`#f43f5e`,`#f97316`,`#eab308`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#3b82f6`],blues:[`#dbeafe`,`#93c5fd`,`#3b82f6`,`#1d4ed8`,`#1e3a8a`],purples:[`#f3e8ff`,`#c4b5fd`,`#8b5cf6`,`#6d28d9`,`#4c1d95`],greens:[`#dcfce7`,`#86efac`,`#22c55e`,`#15803d`,`#14532d`],diverging:[`#ef4444`,`#fca5a5`,`#fef3c7`,`#86efac`,`#22c55e`]};function Hi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ui(e){return Hi(e)}function Wi(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(Ki(t,r)||a&&qi(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function Gi(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function Ki(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(Ki(n,t))return!0}return!1}function qi(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function Ji(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{Ui(e)&&n.push(...Ji(e,[...t,r,String(i)]))}):Ui(i)&&n.push(...Ji(i,[...t,r]))}return n}function Yi(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!Hi(n))break;i=n}let a=t[t.length-1],o=i[a];Hi(o)&&(delete o.url,o.values=r)}return n}function Xi(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:Vi.categorical,diverging:Vi.diverging,heatmap:Vi.purples,ramp:Vi.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80}};return e?{...t,axis:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,gridColor:`#3f3f46`,domainColor:`#52525b`,tickColor:`#52525b`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#fafafa`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}:{...t,axis:{labelColor:`#71717a`,titleColor:`#3f3f46`,gridColor:`#e4e4e7`,domainColor:`#d4d4d8`,tickColor:`#d4d4d8`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#71717a`,titleColor:`#3f3f46`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#18181b`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}}const Zi=re(function({spec:i,artifactRunId:a}){let{t:o}=B(),{title:s,description:c,options:l}=i,u=i.spec,[d,f]=z(!1),[p,m]=z(!1),[h,g]=z(null),[_,v]=z(!1),y=R(null),b=R(null),x=R(null),{client:S}=ye(),C=Mi(),w=R(S);w.current=S;let T=R(C);T.current=C;let[E,D]=z(null),[O,k]=z(!1),[A,j]=z(null),M=l?.mode||`chart`,N=M===`dashboard`,te=l?.enableFullscreen??N,P=l?.height||Bi(u,M);I(()=>{let e=Ji(u);if(e.length===0){D(u),k(!1),j(null);return}a?console.info(`[VegaLiteChart] resolving artifacts with runId:`,a,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:a});let t=!1;return k(!0),j(null),(async()=>{let n=new Map,r=w.current,i=T.current;for(let o of e)try{let e=o.path.join(`.`),t;if(a&&!Ni(o.artifactPath)){let e=Pi(a,o.artifactPath,`inline`);t=i?await i.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url}else{let e=Fi(o.artifactPath);t=i?await i.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let e=await s.text();l=be.parse(e,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||j(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=Yi(u,n);D(e),k(!1)}})(),()=>{t=!0}},[u,a]);let[ne,re]=z(!1),ie=R(!1);I(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==ie.current&&(ie.current=e,re(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ae,oe]=z(0),se=R(0);I(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==se.current&&(se.current=e,oe(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return se.current=n,oe(n),()=>{clearTimeout(e),t.disconnect()}},[]);let ce=L(()=>Ji(u).length>0,[u]),le=L(()=>{if(ce&&!E)return null;let e=E||u;return e?(l?.parameterValues&&(e=Gi(e,l.parameterValues)),Wi(e)):null},[E,u,ce,l?.parameterValues]),ue=F((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>ue(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>ue(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>ue(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),de=F((e,t=!1)=>{if(!le)return null;let n=Xi(ne),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ae>0?ae-24:500,i=`vconcat`in le||`hconcat`in le||`concat`in le,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},o=le;i&&r&&(o=ue(le,r));let c=o.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=o;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?o:d,...s&&!le.title?{title:s}:{},config:{...n,...le.config}}},[le,s,ne,ae,ue]),fe=F(async()=>{let e=_?b.current:y.current;if(!(!e||p))try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),pe=F(async()=>{let e=_?b.current:y.current;if(!(!e||d)){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${s||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[s,d,_]),me=F(e=>{y.current=e,g(null)},[]),he=F(e=>{b.current=e},[]),ge=F(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),_e=F(()=>{v(e=>!e)},[]);I(()=>{g(null)},[u]);let ve=({className:e})=>n(`div`,{className:Ai(`flex items-center gap-2`,e),children:[n(r,{variant:`unstyled`,onClick:fe,disabled:p,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:o(`agent.copyToClipboard`),children:[t(p?Ke:et,{className:`w-3 h-3`}),o(p?`agent.copied`:`agent.copy`)]}),n(r,{variant:`unstyled`,onClick:pe,disabled:d,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:o(`agent.exportAsPng`),children:[t(tt,{className:`w-3 h-3`}),o(d?`agent.exporting`:`agent.export`)]}),te&&n(r,{variant:`unstyled`,onClick:_e,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors flex items-center gap-1`,title:o(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?pt:dt,{className:`w-3 h-3`}),o(_?`agent.exit`:`agent.fullscreen`)]})]});if(O||ce&&!E)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:P},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(ut,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(A)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(Li,{error:A,chartTitle:s})})]})});if(h)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(Li,{error:h,chartTitle:s})})]})});let xe=de(P),V=de(0,!0);return xe?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:s,hasData:!!xe.data?.values,dataLength:xe.data?.values?.length}),n(e,{children:[t(`div`,{className:Ai(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,N&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||(N?`Dashboard`:`Chart`)}),N&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-300`,children:`Interactive`})]}),t(ve,{})]}),c&&t(`span`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:c}),t(`div`,{ref:x,className:`bg-white dark:bg-gray-900 rounded overflow-hidden`,style:{width:`100%`,height:P,minWidth:0},children:t(ee,{fallback:t(Ri,{}),children:t(Ii,{spec:xe,onEmbed:e=>me(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(zi,{isOpen:_,onClose:()=>v(!1),title:s||(N?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:V&&t(ee,{fallback:t(Ri,{}),children:t(Ii,{spec:V,onEmbed:e=>he(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(ve,{className:`bg-white dark:bg-gray-800 rounded-lg shadow-lg p-2 border border-gray-200 dark:border-gray-700`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),Qi=M.createContext({});function $i({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=L(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(Qi.Provider,{value:o,children:e})}function ea(){return M.useContext(Qi)}const ta={chart:{icon:Ge,label:`chart`,defaultHeight:200},mermaid:{icon:rt,label:`diagram`,defaultHeight:150},proposal:{icon:ft,label:`options`,defaultHeight:100},code:{icon:$e,label:`code`,defaultHeight:80},image:{icon:ot,label:`image`,defaultHeight:150},link:{icon:ct,label:`link`,defaultHeight:24},expand:{icon:tt,label:`content`,defaultHeight:100},table:{icon:xt,label:`table`,defaultHeight:150},markdown:{icon:nt,label:`content`,defaultHeight:100},"fusion-fragment":{icon:$e,label:`fragment`,defaultHeight:150}};function U({type:e,error:i,onRetry:a,message:o,height:s}){let c=ta[e],l=s??c.defaultHeight,u=e===`link`;if(i)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),a&&t(r,{variant:`unstyled`,onClick:a,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:o||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:o||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var na=class extends M.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(U,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function ra(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function ia(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function aa({content:e}){let{headers:r,rows:i}=L(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(U,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function oa({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function sa(e){return de.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function ca(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function la({content:e}){let n=L(()=>{let t=typeof e==`string`?e.trim():``;return t?ca(sa(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(U,{type:`expand`,error:`Empty mockup`})}function ua({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function da({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=ea();switch(L(()=>n===`auto`?ra(e,r,a):n,[e,r,a,n])){case`chart`:{let n=ia(e);return n?t(na,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Zi,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=ia(e);return n?t(na,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Zi,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!Zi}),n.template&&n.data?t(na,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(ue,{data:n.data,ChartComponent:Zi,artifactRunId:i,children:t(le,{code:JSON.stringify(n.template),data:n.data})})}):t(na,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(le,{code:JSON.stringify(e)})})}case`table`:return t(na,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(aa,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(na,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(na,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(la,{content:e})});case`image`:return t(na,{type:`image`,fallbackCode:r,children:t(ua,{content:e,path:r})});default:return t(oa,{content:e,path:r})}}function fa(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const pa=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ma=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ha={};function ga(e,t){return((t||ha).jsx?ma:pa).test(e)}const _a=/[ \t\n\f\r]/g;function va(e){return typeof e==`object`?e.type===`text`&&ya(e.value):ya(e)}function ya(e){return e.replace(_a,``)===``}var ba=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ba.prototype.normal={},ba.prototype.property={},ba.prototype.space=void 0;function xa(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ba(n,r,t)}function Sa(e){return e.toLowerCase()}var Ca=class{constructor(e,t){this.attribute=t,this.property=e}};Ca.prototype.attribute=``,Ca.prototype.booleanish=!1,Ca.prototype.boolean=!1,Ca.prototype.commaOrSpaceSeparated=!1,Ca.prototype.commaSeparated=!1,Ca.prototype.defined=!1,Ca.prototype.mustUseProperty=!1,Ca.prototype.number=!1,Ca.prototype.overloadedBoolean=!1,Ca.prototype.property=``,Ca.prototype.spaceSeparated=!1,Ca.prototype.space=void 0;var wa=Me({boolean:()=>W,booleanish:()=>G,commaOrSpaceSeparated:()=>Oa,commaSeparated:()=>Da,number:()=>K,overloadedBoolean:()=>Ea,spaceSeparated:()=>q});let Ta=0;const W=ka(),G=ka(),Ea=ka(),K=ka(),q=ka(),Da=ka(),Oa=ka();function ka(){return 2**++Ta}const Aa=Object.keys(wa);var ja=class extends Ca{constructor(e,t,n,r){let i=-1;if(super(e,t),Ma(this,`space`,r),typeof n==`number`)for(;++i<Aa.length;){let e=Aa[i];Ma(this,Aa[i],(n&wa[e])===wa[e])}}};ja.prototype.defined=!0;function Ma(e,t,n){n&&(e[t]=n)}function Na(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ja(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Sa(r)]=r,n[Sa(a.attribute)]=r}return new ba(t,n,e.space)}const Pa=Na({properties:{ariaActiveDescendant:null,ariaAtomic:G,ariaAutoComplete:null,ariaBusy:G,ariaChecked:G,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:G,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:G,ariaFlowTo:q,ariaGrabbed:G,ariaHasPopup:null,ariaHidden:G,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:K,ariaLive:null,ariaModal:G,ariaMultiLine:G,ariaMultiSelectable:G,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:G,ariaReadOnly:G,ariaRelevant:null,ariaRequired:G,ariaRoleDescription:q,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:G,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Fa(e,t){return t in e?e[t]:t}function Ia(e,t){return Fa(e,t.toLowerCase())}const La=Na({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Da,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:q,autoFocus:W,autoPlay:W,blocking:q,capture:null,charSet:null,checked:W,cite:null,className:q,cols:K,colSpan:null,content:null,contentEditable:G,controls:W,controlsList:q,coords:K|Da,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:Ea,draggable:G,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:q,height:K,hidden:Ea,high:K,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:q,itemRef:q,itemScope:W,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:W,optimum:K,pattern:null,ping:q,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:q,required:W,reversed:W,rows:K,rowSpan:K,sandbox:q,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:G,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:G,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:G,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:K,security:null,unselectable:null},space:`html`,transform:Ia}),Ra=Na({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Oa,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:q,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Da,g2:Da,glyphName:Da,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:Oa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:K,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Oa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Oa,rev:Oa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Oa,requiredFeatures:Oa,requiredFonts:Oa,requiredFormats:Oa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:Oa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Oa,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Oa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Fa}),za=Na({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ba=Na({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ia}),Va=Na({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ha={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ua=/[A-Z]/g,Wa=/-[a-z]/g,Ga=/^data[-\w.:]+$/i;function Ka(e,t){let n=Sa(t),r=t,i=Ca;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ga.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Wa,Ja);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Wa.test(e)){let n=e.replace(Ua,qa);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ja}return new i(r,t)}function qa(e){return`-`+e.toLowerCase()}function Ja(e){return e.charAt(1).toUpperCase()}const Ya=xa([Pa,La,za,Ba,Va],`html`),Xa=xa([Pa,Ra,za,Ba,Va],`svg`);function Za(e){return e.join(` `).trim()}function Qa(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(to);t&&(n+=t.length);var i=e.lastIndexOf(co);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(no)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(lo==e.charAt(0)&&uo==e.charAt(1)){for(var n=2;fo!=e.charAt(n)&&(uo!=e.charAt(n)||lo!=e.charAt(n+1));)++n;if(n+=2,fo===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:po,comment:o})}}function f(){var e=a(),t=c(ro);if(t){if(d(),!c(io))return s(`property missing ':'`);var n=c(ao),r=e({type:mo,property:$a(t[0].replace(eo,fo)),value:n?$a(n[0].replace(eo,fo)):fo});return c(oo),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function $a(e){return e?e.replace(so,fo):fo}var eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho=Ae((()=>{eo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,to=/\n/g,no=/^\s*/,ro=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,io=/^:\s*/,ao=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,oo=/^[;\s]*/,so=/^\s+|\s+$/g,co=`
277
- `,lo=`/`,uo=`*`,fo=``,po=`comment`,mo=`declaration`})),go=Me({default:()=>_o});function _o(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Qa(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var vo=Ae((()=>{ho()})),yo=je((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),bo=je(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((vo(),Fe(go))),r=yo();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const xo=Co(`end`),So=Co(`start`);function Co(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function wo(e){let t=So(e),n=xo(e);if(t&&n)return{start:t,end:n}}function To(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Do(e.position):`start`in e||`end`in e?Do(e):`line`in e||`column`in e?Eo(e):``}function Eo(e){return Oo(e&&e.line)+`:`+Oo(e&&e.column)}function Do(e){return Eo(e&&e.start)+`-`+Eo(e&&e.end)}function Oo(e){return e&&typeof e==`number`?e:1}var ko=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=To(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ko.prototype.file=``,ko.prototype.name=``,ko.prototype.reason=``,ko.prototype.message=``,ko.prototype.stack=``,ko.prototype.column=void 0,ko.prototype.line=void 0,ko.prototype.ancestors=void 0,ko.prototype.cause=void 0,ko.prototype.fatal=void 0,ko.prototype.place=void 0,ko.prototype.ruleId=void 0,ko.prototype.source=void 0;var Ao=Pe(bo(),1);const jo={}.hasOwnProperty,Mo=new Map,No=/[A-Z]/g,Po=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Fo=new Set([`td`,`th`]);function Io(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=qo(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Ko(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Xa:Ya,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Lo(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Lo(e,t,n){if(t.type===`element`)return Ro(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return zo(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Vo(e,t,n);if(t.type===`mdxjsEsm`)return Bo(e,t);if(t.type===`root`)return Ho(e,t,n);if(t.type===`text`)return Uo(e,t)}function Ro(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Xa,e.schema=i),e.ancestors.push(t);let a=$o(e,t.tagName,!1),o=Jo(e,t),s=Xo(e,t);return Po.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!va(e)})),Wo(e,o,a,t),Go(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function zo(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}es(e,t.position)}function Bo(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);es(e,t.position)}function Vo(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Xa,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:$o(e,t.name,!0),o=Yo(e,t),s=Xo(e,t);return Wo(e,o,a,t),Go(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ho(e,t,n){let r={};return Go(r,Xo(e,t)),e.create(t,e.Fragment,r,n)}function Uo(e,t){return t.value}function Wo(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Go(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ko(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function qo(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=So(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Jo(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&jo.call(t.properties,i)){let a=Zo(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Fo.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Yo(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else es(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else es(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Xo(e,t){let n=[],r=-1,i=e.passKeys?new Map:Mo;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Lo(e,a,o);s!==void 0&&n.push(s)}return n}function Zo(e,t,n){let r=Ka(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?fa(n):Za(n)),r.property===`style`){let t=typeof n==`object`?n:Qo(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ts(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ha[r.property]||r.property:r.attribute,n]}}function Qo(e,t){try{return(0,Ao.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ko("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function $o(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ga(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ga(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return jo.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);es(e)}function es(e,t){let n=new ko("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function ts(e){let t={},n;for(n in e)jo.call(e,n)&&(t[ns(n)]=e[n]);return t}function ns(e){let t=e.replace(No,rs);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function rs(e){return`-`+e.toLowerCase()}const is={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},as={};function os(e,t){let n=t||as;return ss(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function ss(e,t,n){if(ls(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return cs(e.children,t,n)}return Array.isArray(e)?cs(e,t,n):``}function cs(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ss(e[i],t,n);return r.join(``)}function ls(e){return!!(e&&typeof e==`object`)}const us=document.createElement(`i`);function ds(e){let t=`&`+e+`;`;us.innerHTML=t;let n=us.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function J(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function fs(e,t){return e.length>0?(J(e,e.length,0,t),e):t}const ps={}.hasOwnProperty;function ms(e){let t={},n=-1;for(;++n<e.length;)hs(t,e[n]);return t}function hs(e,t){let n;for(n in t){let r=(ps.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ps.call(r,a)||(r[a]=[]);let e=i[a];gs(r[a],Array.isArray(e)?e:e?[e]:[])}}}function gs(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);J(e,0,0,r)}function _s(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function vs(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const ys=Os(/[A-Za-z]/),bs=Os(/[\dA-Za-z]/),xs=Os(/[#-'*+\--9=?A-Z^-~]/);function Ss(e){return e!==null&&(e<32||e===127)}const Cs=Os(/\d/),ws=Os(/[\dA-Fa-f]/),Ts=Os(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const Es=Os(/\p{P}|\p{S}/u),Ds=Os(/\s/);function Os(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ks(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&bs(e.charCodeAt(n+1))&&bs(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const As={tokenize:js};function js(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const Ms={tokenize:Ps},Ns={tokenize:Fs};function Ps(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return J(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ns,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ns,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;J(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Fs(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Is(e){if(e===null||X(e)||Ds(e))return 1;if(Es(e))return 2}function Ls(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Rs={name:`attention`,resolveAll:zs,tokenize:Bs};function zs(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Vs(d,-c),Vs(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=fs(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=fs(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=fs(l,Ls(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=fs(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=fs(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,J(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Bs(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Is(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Is(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Vs(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Hs={name:`autolink`,tokenize:Us};function Us(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return ys(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||bs(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||bs(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Ss(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):xs(t)?(e.consume(t),l):n(t)}function u(e){return bs(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||bs(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Ws={partial:!0,tokenize:Gs};function Gs(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const Ks={continuation:{tokenize:Js},exit:Ys,name:`blockQuote`,tokenize:qs};function qs(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Js(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ks,t,n)(r)}}function Ys(e){e.exit(`blockQuote`)}const Xs={name:`characterEscape`,tokenize:Zs};function Zs(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ts(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Qs={name:`characterReference`,tokenize:$s};function $s(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=bs,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=ws,u):(e.enter(`characterReferenceValue`),a=7,o=Cs,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===bs&&!ds(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const ec={partial:!0,tokenize:rc},tc={concrete:!0,name:`codeFenced`,tokenize:nc};function nc(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ec,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(ec,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function rc(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const ic={name:`codeIndented`,tokenize:oc},ac={partial:!0,tokenize:sc};function oc(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(ac,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function sc(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}const cc={name:`codeText`,previous:uc,resolve:lc,tokenize:dc};function lc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function uc(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function dc(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var fc=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&pc(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),pc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),pc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);pc(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);pc(this.left,t.reverse())}}}};function pc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function mc(e){let t={},n=-1,r,i,a,o,s,c,l,u=new fc(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,hc(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return J(e,0,1/0,u.slice(0)),!l}function hc(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const gc={resolve:vc,tokenize:yc},_c={partial:!0,tokenize:bc};function vc(e){return mc(e),e}function yc(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(_c,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function bc(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function xc(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Ss(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Ss(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Sc(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Cc(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function wc(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Tc={name:`definition`,tokenize:Dc},Ec={partial:!0,tokenize:Oc};function Dc(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Sc.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=vs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?wc(e,l)(t):l(t)}function l(t){return xc(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ec,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Oc(e,t,n){return r;function r(t){return X(t)?wc(e,i)(t):n(t)}function i(t){return Cc(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const kc={name:`hardBreakEscape`,tokenize:Ac};function Ac(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const jc={name:`headingAtx`,resolve:Mc,tokenize:Nc};function Mc(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},J(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Nc(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Pc=`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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Fc=[`pre`,`script`,`style`,`textarea`],Ic={concrete:!0,name:`htmlFlow`,resolveTo:zc,tokenize:Bc},Lc={partial:!0,tokenize:Hc},Rc={partial:!0,tokenize:Vc};function zc(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Bc(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):ys(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):ys(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return ys(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Fc.includes(l)?(i=1,r.interrupt?t(s):O(s)):Pc.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||bs(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||ys(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||bs(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),ee):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Lc,re,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Rc,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function ee(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Fc.includes(n)?(e.consume(t),ne):O(t)}return ys(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function Vc(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Hc(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ws,t,n)}}const Uc={name:`htmlText`,tokenize:Wc};function Wc(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):ys(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):ys(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,ee(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,ee(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Y(t)?(o=v,ee(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,ee(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return ys(t)?(e.consume(t),S):n(t)}function S(t){return t===45||bs(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,ee(t)):Z(t)?(e.consume(t),C):M(t)}function w(t){return t===45||bs(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||ys(t)?(e.consume(t),E):Y(t)?(o=T,ee(t)):Z(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||bs(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,ee(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,ee(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Y(t)?(o=k,ee(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||X(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ee(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return Z(t)?Q(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}const Gc={name:`labelEnd`,resolveAll:Yc,resolveTo:Xc,tokenize:Zc},Kc={tokenize:Qc},qc={tokenize:$c},Jc={tokenize:el};function Yc(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&J(e,0,e.length,n),e}function Xc(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=fs(s,e.slice(a+1,a+r+3)),s=fs(s,[[`enter`,u,t]]),s=fs(s,Ls(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=fs(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=fs(s,e.slice(o+1)),s=fs(s,[[`exit`,c,t]]),J(e,a,e.length,s),e}function Zc(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(vs(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Kc,u,o?u:d)(t):t===91?e.attempt(qc,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Jc,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Qc(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?wc(e,a)(t):a(t)}function a(t){return t===41?u(t):xc(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?wc(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Cc(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?wc(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function $c(e,t,n){let r=this;return i;function i(t){return Sc.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(vs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function el(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const tl={name:`labelStartImage`,resolveAll:Gc.resolveAll,tokenize:nl};function nl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const rl={name:`labelStartLink`,resolveAll:Gc.resolveAll,tokenize:il};function il(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const al={name:`lineEnding`,tokenize:ol};function ol(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}const sl={name:`thematicBreak`,tokenize:cl};function cl(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}const ll={continuation:{tokenize:pl},exit:hl,name:`list`,tokenize:fl},ul={partial:!0,tokenize:gl},dl={partial:!0,tokenize:ml};function fl(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Cs(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(sl,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Cs(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Ws,r.interrupt?n:u,e.attempt(ul,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function pl(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ws,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dl,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(ll,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ml(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function hl(e){e.exit(this.containerState.type)}function gl(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const _l={name:`setextUnderline`,resolveTo:vl,tokenize:yl};function vl(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function yl(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const bl={tokenize:xl};function xl(e){let t=this,n=e.attempt(Ws,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gc,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const Sl={resolveAll:El()},Cl=Tl(`string`),wl=Tl(`text`);function Tl(e){return{resolveAll:El(e===`text`?Dl:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function El(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Dl(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Ol=Me({attentionMarkers:()=>Il,contentInitial:()=>Al,disable:()=>Ll,document:()=>kl,flow:()=>Ml,flowInitial:()=>jl,insideSpan:()=>Fl,string:()=>Nl,text:()=>Pl});const kl={42:ll,43:ll,45:ll,48:ll,49:ll,50:ll,51:ll,52:ll,53:ll,54:ll,55:ll,56:ll,57:ll,62:Ks},Al={91:Tc},jl={[-2]:ic,[-1]:ic,32:ic},Ml={35:jc,42:sl,45:[_l,sl],60:Ic,61:_l,95:sl,96:tc,126:tc},Nl={38:Qs,92:Xs},Pl={[-5]:al,[-4]:al,[-3]:al,33:tl,38:Qs,42:Rs,60:[Hs,Uc],91:rl,92:[kc,Xs],93:Gc,95:Rs,96:cc},Fl={null:[Rs,Sl]},Il={null:[42,95]},Ll={null:[]};function Rl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=fs(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ls(a,l.events,l),l.events):[]}function f(e,t){return Bl(p(e),t)}function p(e){return zl(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&J(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zl(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Bl(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
276
+ `)),{type:n,value:r}}return typeof e==`number`||typeof e==`boolean`?{value:String(e),type:gn.Inline}:{value:e,type:gn.Object}}function vn({value:e,viewCode:n=!1}){let{t:r}=se();return e?t(`div`,{className:`relative w-full h-full flex flex-col`,children:n||!yn(e)?t(on,{data:e}):t(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:t(un,{value:e})})}):t(`pre`,{className:`whitespace-pre-wrap`,children:r(`misc.noData`)})}function yn(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`?!0:Array.isArray(e)?e.every(yn):typeof e==`object`&&Object.values(e).every(yn)}const bn=new Set;function xn(e){bn.has(`markdown`)||(bn.add(`markdown`),e.languages.registerFoldingRangeProvider(`markdown`,{provideFoldingRanges(e){let t=[],n=e.getLinesContent(),r=/^(#{1,6})\s/,i=[];for(let e=0;e<n.length;e++){let a=e+1,o=r.exec(n[e]);if(o){let e=o[1].length;for(;i.length>0&&i[i.length-1].level>=e;){let e=i.pop();e&&a-1>e.line&&t.push({start:e.line,end:a-1})}i.push({level:e,line:a})}}let a=n.length;for(;i.length>0;){let e=i.pop();e&&a>e.line&&t.push({start:e.line,end:a})}return t}}));for(let t of[`javascript`,`typescript`])bn.has(t)||(bn.add(t),e.languages.registerFoldingRangeProvider(t,{provideFoldingRanges(e){let t=e.getLinesContent(),n=/^(#{1,6})\s/,r=[],i=[],a=[],o=[],s=!1,c=!1,l=``;for(let e=0;e<t.length;e++){let u=e+1,d=t[e],f=s;for(let e=0;e<d.length;e++){let t=d[e];if(t===`\\`){e++;continue}if(c){t===l&&(c=!1);continue}if(s){t==="`"&&(s=!1);continue}if(t==="`"){s=!0;continue}if(t===`"`||t===`'`){c=!0,l=t;continue}if(t===`{`&&a.push(u),t===`}`&&a.length>0){let t=a.pop(),n=d.slice(e+1).trimStart().length>0?u-1:u;t!==void 0&&n>t&&r.push({start:t,end:n})}}if(f){let e=n.exec(d);if(e){let t=e[1].length;for(;o.length>0&&o[o.length-1].level>=t;){let e=o.pop();e&&u-1>e.line&&i.push({start:e.line,end:u-1})}o.push({level:t,line:u})}if(!s)for(;o.length>0;){let e=o.pop();e&&u>e.line&&i.push({start:e.line,end:u})}}}return[...r,...i]}}))}let Sn=!1;function Cn(e){Sn||=(e.config({paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}}),!0)}let wn;function Tn(){return wn??=import(`@monaco-editor/react`).then(e=>(Cn(e.loader),e)).catch(e=>{throw wn=void 0,e}),wn}const En=te(()=>Tn().then(({Editor:e})=>({default:e})));let Dn;function On(){if(!(typeof document>`u`)){if(!Dn){let e=document.createElement(`div`);e.className=`monaco-editor`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.zIndex=`10000`,document.body.appendChild(e),Dn=e}return Dn}}const kn=new Map;let An=0;function jn(e){(e.languages.json?.jsonDefaults)?.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:Array.from(kn.entries()).map(([e,t])=>({uri:`vertesia://schemas/${encodeURIComponent(e)}`,fileMatch:[e],schema:t}))})}var Mn=class{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||``)}};function Nn({onChange:e,value:n,className:r,editorRef:i,language:a=`javascript`,path:o,debounceTimeout:s=0,options:c={},beforeMount:l,onMount:u,defaultValue:d,useCustomFolding:f=!1,jsonSchema:p}){let[m,h]=B(n||d||``),g=z(null),_=z(null),[v]=B(()=>p?`inmemory://vertesia/json/${++An}.json`:void 0),y=o??v,{theme:b}=D(),x=b===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:b,S=n||d||``,C=z(()=>m),w=z(e=>{h(e),g.current&&g.current.setValue(e)});L(()=>{C.current=()=>m},[m]),L(()=>(i&&(i.current=new Mn(()=>C.current(),e=>w.current(e))),()=>{i&&(i.current=void 0)}),[i]);let T=R(()=>{if(e)return s>0?ce(t=>e(t),s):e},[e,s]),E=I(async(e,t)=>{let n=e.getModel();if(n)for(let r of n.getValue().matchAll(/```[\s\S]*?```/g)){let i=n.getPositionAt(r.index).lineNumber,a=n.getPositionAt(r.index+r[0].length).lineNumber;e.setSelection(new t.Selection(i,1,a,1)),await e.getAction(`editor.createFoldingRangeFromSelection`)?.run()}},[]),O=I(e=>{let t=e||``;if(h(t),T){let e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};T(e)}},[T]),A=I((e,t)=>{g.current=e,_.current=t,p&&y&&a===`json`&&(kn.set(y,p),jn(t)),f&&xn(t),w.current=t=>{h(t),e.setValue(t)},t.editor.defineTheme(`errorLineTheme`,{base:x===`dark`?`vs-dark`:`vs`,inherit:!0,rules:[],colors:{"editorError.background":`#ffebee`,"editorError.border":`#f44336`}}),t.editor.setTheme(`errorLineTheme`),f&&setTimeout(()=>E(e,t),300),u?.(e,t)},[u,x,f,E,p,y,a]);L(()=>()=>{p&&y&&kn.delete(y)&&_.current&&jn(_.current)},[p,y]),L(()=>{g.current?.hasTextFocus()||h(e=>S===e?e:(g.current&&g.current.setValue(S),S))},[S]),L(()=>{if(!S||!f||!g.current||!_.current||g.current.hasTextFocus())return;let e=g.current,t=_.current,n=setTimeout(()=>E(e,t),300);return()=>clearTimeout(n)},[S,f,E]);let j={fontSize:14,fontFamily:`monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,lineNumbers:`on`,folding:!0,lineDecorationsWidth:10,lineNumbersMinChars:3,automaticLayout:!0,formatOnPaste:!0,formatOnType:!0,tabSize:2,insertSpaces:!0,fixedOverflowWidgets:!0,overflowWidgetsDomNode:On(),glyphMargin:!0,renderValidationDecorations:`on`,renderLineHighlight:`line`,hover:{enabled:`on`,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...c};return t(`div`,{className:k(r,`w-full h-full!`),children:t(ee,{fallback:t(`div`,{className:`h-full w-full`}),children:t(En,{className:`h-full w-full`,height:`100%`,theme:x===`dark`?`vs-dark`:`light`,language:a,path:y,onChange:O,onMount:A,beforeMount:l,options:j,defaultValue:S})})})}function Pn({value:e,onChange:r,onValidChange:i,readonly:a=!1,height:o=`200px`,placeholder:s,className:c}){let{theme:l}=D(),u=z(void 0),[d,f]=B(null),p=R(()=>{if(e==null)return s??`{}`;try{return JSON.stringify(e,null,2)}catch{return`{}`}},[e,s]),m=I(()=>{if(!u.current||a)return;let e=u.current.getValue();try{let t=JSON.parse(e);f(null),i?.(t)}catch{f(`Invalid JSON`)}},[a,i]);return n(`div`,{className:c,children:[t(`div`,{className:`border rounded overflow-hidden`,style:{height:o},children:t(Nn,{defaultValue:p,editorRef:u,language:`json`,theme:l===`dark`?`vs-dark`:`vs`,onChange:m,options:a?{readOnly:!0,domReadOnly:!0}:void 0})}),d&&t(`p`,{className:`text-xs text-destructive mt-1`,children:d})]})}function Fn(e){if(!e.current)return null;try{return JSON.parse(e.current.getValue())}catch{return null}}function In({title:e,viewCode:i,setViewCode:a}){return n(`div`,{className:`flex items-center gap-1 bg-muted mb-2 p-1 rounded`,children:[t(r,{variant:i?`ghost`:`primary`,size:`sm`,title:`Preview properties`,onClick:()=>a(!1),children:e}),t(r,{variant:i?`primary`:`ghost`,size:`sm`,title:`View in JSON format`,onClick:()=>a(!0),children:`JSON`})]})}function Ln(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase())}function Rn(r){return r==null?`Failed to query`:typeof r==`string`?r:Array.isArray(r)?r.length===0?`None`:r.some(e=>e&&typeof e==`object`)?t(e,{children:r.map((e,r)=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[r+1,`:`]}),t(`span`,{className:`text-xs`,children:Rn(e)})]},`item-${r}`))}):r.map(e=>String(e)).join(`, `):typeof r==`object`?t(e,{children:Object.entries(r).map(([e,r])=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[Ln(e),`:`]}),t(`span`,{className:`text-xs`,children:Rn(r)})]},e))}):String(r)}function zn({data:e,className:r}){let i=e?Object.entries(e):[];return t(`table`,{className:r||`mb-2 text-xs bg-muted rounded-sm w-full`,children:t(`tbody`,{children:i.map(([e,r])=>n(`tr`,{className:`align-top hover:bg-background border-y`,children:[t(`td`,{className:`align-top pe-4 p-2`,children:Ln(e)}),t(`td`,{className:`p-2`,children:Rn(r)})]},e))})})}const Bn=N(()=>({kind:`none`})),Vn=Bn.Provider;function Hn(){return re(Bn)}const Un={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function Wn(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Un,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Un[n],id:r}}var Gn=Object.defineProperty,Kn=(e,t)=>Gn(e,`name`,{value:t,configurable:!0}),qn=!!(typeof window<`u`&&window.document&&window.document.createElement);function Jn(e,t,{checkForDefaultPrevented:n=!0}={}){return Kn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Kn(Jn,`composeEventHandlers`);function Yn(e){if(!qn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Kn(Yn,`getOwnerWindow`);function Xn(e){if(!qn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Kn(Xn,`getOwnerDocument`);function Zn(e,t=!1){let{activeElement:n}=Xn(e);if(!n?.nodeName)return null;if(Qn(n)&&n.contentDocument)return Zn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Xn(n).getElementById(e);if(t)return t}}return n}Kn(Zn,`getActiveElement`);function Qn(e){return e.tagName===`IFRAME`}Kn(Qn,`isFrame`);var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0});function tr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}er(tr,`setRef`);function nr(...e){return t=>{let n=!1,r=e.map(e=>{let r=tr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():tr(e[t],null)}}}}er(nr,`composeRefs`);function rr(...e){return j.useCallback(nr(...e),e)}er(rr,`useComposedRefs`);var ir=Object.defineProperty,ar=(e,t)=>ir(e,`name`,{value:t,configurable:!0});function or(e,n){let r=j.createContext(n);r.displayName=e+`Context`;let i=ar(e=>{let{children:n,...i}=e,a=j.useMemo(()=>i,Object.values(i));return t(r.Provider,{value:a,children:n})},`Provider`);i.displayName=e+`Provider`;function a(t,i={}){let{optional:a=!1}=i,o=j.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return ar(a,`useContext`),[i,a]}ar(or,`createContext`);function sr(e,n=[]){let r=[];function i(n,i){let a=j.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=ar(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=j.useMemo(()=>s,Object.values(s));return t(c.Provider,{value:l,children:i})},`Provider`);s.displayName=n+`Provider`;function c(t,r,s={}){let{optional:c=!1}=s,l=r?.[e]?.[o]||a,u=j.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return ar(c,`useContext`),[s,c]}ar(i,`createContext`);let a=ar(()=>{let t=r.map(e=>j.createContext(e));return ar(function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,cr(a,...n)]}ar(sr,`createContextScope`);function cr(...e){let t=e[0];if(e.length===1)return t;let n=ar(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return ar(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}ar(cr,`composeContextScopes`);var lr=globalThis?.document?j.useLayoutEffect:()=>{},ur=Object.defineProperty,dr=(e,t)=>ur(e,`name`,{value:t,configurable:!0}),fr=j.useId||(()=>void 0),pr=0;function mr(e){let[t,n]=j.useState(fr());return lr(()=>{e||n(e=>e??String(pr++))},[e]),e||(t?`radix-${t}`:``)}dr(mr,`useId`);var hr=Object.defineProperty,gr=(e,t)=>hr(e,`name`,{value:t,configurable:!0}),_r=j.useEffectEvent,vr=j.useInsertionEffect;function yr(e){if(typeof _r==`function`)return _r(e);let t=j.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof vr==`function`?vr(()=>{t.current=e}):lr(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}gr(yr,`useEffectEvent`);var br=Object.defineProperty,xr=(e,t)=>br(e,`name`,{value:t,configurable:!0}),Sr=j.useInsertionEffect||lr;function Cr({prop:e,defaultProp:t,onChange:n=xr(()=>{},`onChange`),caller:r}){let[i,a,o]=wr({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,j.useCallback(t=>{if(s){let n=Tr(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}xr(Cr,`useControllableState`);function wr({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return Sr(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}xr(wr,`useUncontrolledState`);function Tr(e){return typeof e==`function`}xr(Tr,`isFunction`);var Er=Symbol(`RADIX:SYNC_STATE`);function Dr(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=yr(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=j.useReducer((t,n)=>{if(n.type===Er)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=j.useRef(p);j.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=j.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return j.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Er,state:i})},[i,d.state,c]),[h,f]}xr(Dr,`useControllableStateReducer`);var Or=Object.defineProperty,kr=(e,t)=>Or(e,`name`,{value:t,configurable:!0});function Ar(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Rr(r)&&typeof Hr==`function`&&(r=Hr(r._payload)),j.Children.forEach(r,e=>{if(Ir(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Rr(n)&&typeof Hr==`function`&&(n=Hr(n._payload)),a=Nr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?Fr(a):void 0,l=rr(n,c);if(!a){if(r||r===0)throw Error(o?Vr(e):Br(e));return r}let u=Pr(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}kr(Ar,`createSlot`);var jr=Symbol.for(`radix.slottable`);function Mr(e){let t=kr(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=jr,t}kr(Mr,`createSlottable`);var Nr=kr((e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Pr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}kr(Pr,`mergeProps`);function Fr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}kr(Fr,`getElementRef`);function Ir(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===jr}kr(Ir,`isSlottable`);var Lr=Symbol.for(`react.lazy`);function Rr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Lr&&`_payload`in e&&zr(e._payload)}kr(Rr,`isLazyComponent`);function zr(e){return typeof e==`object`&&!!e&&`then`in e}kr(zr,`isPromiseLike`);var Br=kr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Vr=kr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Hr=j.use,Ur=Object.defineProperty,Wr=(e,t)=>Ur(e,`name`,{value:t,configurable:!0}),Gr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=Ar(`Primitive.${n}`),i=j.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Kr(e,t){e&&he.flushSync(()=>e.dispatchEvent(t))}Wr(Kr,`dispatchDiscreteCustomEvent`);var qr=Object.defineProperty,Jr=j.forwardRef(((e,t)=>qr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=j.useState(!1);lr(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?he.createPortal(t(Gr.div,{...i,ref:n}),s):null},`Portal`)),Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0});function Zr(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}Xr(Zr,`useStateMachine`);var Qr=Xr(e=>{let{present:t,children:n}=e,r=$r(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=ti(r.ref,ri(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null},`Presence`);function $r(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Zr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??ni(r.current),o.current=void 0):a.current=`none`},[s]),lr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ni(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),lr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Xr(a=>{let o=ni(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Xr(e=>{e.target===t&&(a.current=ni(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ni(t)}else r.current=null;n(e)},[])}}Xr($r,`usePresence`);function ei(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Xr(ei,`setRef`);function ti(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ei(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ei(n[e],null)}}},[])}Xr(ti,`useStableComposedRefs`);function ni(e){return e?.animationName||`none`}Xr(ni,`getAnimationName`);function ri(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Xr(ri,`getElementRef`);var ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0}),oi=`Dialog`,[si,ci]=sr(oi),[li,ui]=si(oi),di=ai(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=j.useRef(null),l=j.useRef(null),[u,d]=Cr({prop:i,defaultProp:a??!1,onChange:o,caller:oi}),[f,p]=j.useState(0),[m,h]=j.useState(0);return t(li,{scope:n,triggerRef:c,contentRef:l,contentId:mr(),titleId:mr(),descriptionId:mr(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),fi=`DialogPortal`,[pi,mi]=si(fi,{forceMount:void 0}),hi=ai(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=ui(fi,n);return t(pi,{scope:n,forceMount:r,children:j.Children.map(i,e=>t(Qr,{present:r||o.open,children:t(Jr,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),gi=`DialogOverlay`,_i=j.forwardRef(ai(function(e,n){let r=mi(gi,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=ui(gi,e.__scopeDialog);return o.modal?t(Qr,{present:i||o.open,children:t(yi,{...a,ref:n})}):null},`DialogOverlay`)),vi=Ar(`DialogOverlay.RemoveScroll`),yi=j.forwardRef(ai(function(e,n){let{__scopeDialog:r,...i}=e,a=ui(gi,r),o=rr(n,pe());return t(_e,{as:vi,allowPinchZoom:!0,shards:[a.contentRef],children:t(Gr.div,{"data-state":ji(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),bi=`DialogContent`,xi=j.forwardRef(ai(function(e,n){let r=mi(bi,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=ui(bi,e.__scopeDialog);return t(Qr,{present:i||o.open,children:o.modal?t(Si,{...a,ref:n}):t(Ci,{...a,ref:n})})},`DialogContent`)),Si=j.forwardRef(ai(function(e,n){let r=ui(bi,e.__scopeDialog),i=j.useRef(null),a=rr(n,r.contentRef,i);return j.useEffect(()=>{let e=i.current;if(e)return ve(e)},[]),t(wi,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Jn(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Jn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Jn(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ci=j.forwardRef(ai(function(e,n){let r=ui(bi,e.__scopeDialog),i=j.useRef(!1),a=j.useRef(!1);return t(wi,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),wi=j.forwardRef(ai(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=ui(bi,i);return ge(),t(e,{children:t(me,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(fe,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":ji(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),Ti=`DialogTitle`,Ei=j.forwardRef(ai(function(e,n){let{__scopeDialog:r,...i}=e,a=ui(Ti,r),{setTitleCount:o}=a;return lr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Gr.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),Di=`DialogDescription`,Oi=j.forwardRef(ai(function(e,n){let{__scopeDialog:r,...i}=e,a=ui(Di,r),{setDescriptionCount:o}=a;return lr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Gr.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),ki=`DialogClose`,Ai=j.forwardRef(ai(function(e,n){let{__scopeDialog:r,...i}=e,a=ui(ki,r);return t(Gr.button,{type:`button`,...i,ref:n,onClick:Jn(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function ji(e){return e?`open`:`closed`}ai(ji,`getState`);function Mi(...e){return be(A(e))}const Ni=N(null);function Pi(){return re(Ni)}function Fi(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function Ii(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Li(e){return`file:${e}`}const Ri=te(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function zi({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-red-600 dark:text-red-400`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate`,children:e})]})})}function Bi(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(ct,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function Vi({isOpen:e,onClose:i,title:a,description:o,children:s}){let{t:c}=se();return t(di,{open:e,onOpenChange:e=>!e&&i(),children:n(hi,{children:[t(_i,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(xi,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-white dark:bg-gray-900 rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:i,children:[t(Ai,{asChild:!0,children:t(r,{variant:`unstyled`,onClick:i,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(Ct,{className:`w-5 h-5 text-gray-600 dark:text-gray-300`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:s}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-gray-200 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50 rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(Ei,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:a||c(`agent.dashboard`)}),o&&t(Oi,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:o})]})})]})]})})}function Hi(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}const Ui={categorical:[`#6366f1`,`#8b5cf6`,`#ec4899`,`#f43f5e`,`#f97316`,`#eab308`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#3b82f6`],blues:[`#dbeafe`,`#93c5fd`,`#3b82f6`,`#1d4ed8`,`#1e3a8a`],purples:[`#f3e8ff`,`#c4b5fd`,`#8b5cf6`,`#6d28d9`,`#4c1d95`],greens:[`#dcfce7`,`#86efac`,`#22c55e`,`#15803d`,`#14532d`],diverging:[`#ef4444`,`#fca5a5`,`#fef3c7`,`#86efac`,`#22c55e`]};function Wi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Gi(e){return Wi(e)}function Ki(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(Ji(t,r)||a&&Yi(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function qi(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function Ji(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(Ji(n,t))return!0}return!1}function Yi(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function Xi(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{Gi(e)&&n.push(...Xi(e,[...t,r,String(i)]))}):Gi(i)&&n.push(...Xi(i,[...t,r]))}return n}function Zi(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!Wi(n))break;i=n}let a=t[t.length-1],o=i[a];Wi(o)&&(delete o.url,o.values=r)}return n}function Qi(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:Ui.categorical,diverging:Ui.diverging,heatmap:Ui.purples,ramp:Ui.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80}};return e?{...t,axis:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,gridColor:`#3f3f46`,domainColor:`#52525b`,tickColor:`#52525b`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#fafafa`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}:{...t,axis:{labelColor:`#71717a`,titleColor:`#3f3f46`,gridColor:`#e4e4e7`,domainColor:`#d4d4d8`,tickColor:`#d4d4d8`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#71717a`,titleColor:`#3f3f46`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#18181b`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}}const $i=ne(function({spec:i,artifactRunId:a}){let{t:o}=se(),{title:s,description:c,options:l}=i,u=i.spec,[d,f]=B(!1),[p,m]=B(!1),[h,g]=B(null),[_,v]=B(!1),y=z(null),b=z(null),x=z(null),{client:S}=ye(),C=Pi(),w=z(S);w.current=S;let T=z(C);T.current=C;let[E,D]=B(null),[O,k]=B(!1),[A,j]=B(null),M=l?.mode||`chart`,N=M===`dashboard`,P=l?.enableFullscreen??N,F=l?.height||Hi(u,M);L(()=>{let e=Xi(u);if(e.length===0){D(u),k(!1),j(null);return}a?console.info(`[VegaLiteChart] resolving artifacts with runId:`,a,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:a});let t=!1;return k(!0),j(null),(async()=>{let n=new Map,r=w.current,i=T.current;for(let o of e)try{let e=o.path.join(`.`),t;if(a&&!Fi(o.artifactPath)){let e=Ii(a,o.artifactPath,`inline`);t=i?await i.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url}else{let e=Li(o.artifactPath);t=i?await i.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let{default:e}=await import(`papaparse`),t=await s.text();l=e.parse(t,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||j(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=Zi(u,n);D(e),k(!1)}})(),()=>{t=!0}},[u,a]);let[te,ne]=B(!1),re=z(!1);L(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==re.current&&(re.current=e,ne(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ie,ae]=B(0),oe=z(0);L(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==oe.current&&(oe.current=e,ae(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return oe.current=n,ae(n),()=>{clearTimeout(e),t.disconnect()}},[]);let ce=R(()=>Xi(u).length>0,[u]),le=R(()=>{if(ce&&!E)return null;let e=E||u;return e?(l?.parameterValues&&(e=qi(e,l.parameterValues)),Ki(e)):null},[E,u,ce,l?.parameterValues]),ue=I((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>ue(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>ue(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>ue(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),de=I((e,t=!1)=>{if(!le)return null;let n=Qi(te),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ie>0?ie-24:500,i=`vconcat`in le||`hconcat`in le||`concat`in le,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},o=le;i&&r&&(o=ue(le,r));let c=o.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=o;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?o:d,...s&&!le.title?{title:s}:{},config:{...n,...le.config}}},[le,s,te,ie,ue]),fe=I(async()=>{let e=_?b.current:y.current;if(!(!e||p))try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),pe=I(async()=>{let e=_?b.current:y.current;if(!(!e||d)){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${s||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[s,d,_]),me=I(e=>{y.current=e,g(null)},[]),he=I(e=>{b.current=e},[]),ge=I(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),_e=I(()=>{v(e=>!e)},[]);L(()=>{g(null)},[u]);let ve=({className:e})=>n(`div`,{className:Mi(`flex items-center gap-2`,e),children:[n(r,{variant:`unstyled`,onClick:fe,disabled:p,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:o(`agent.copyToClipboard`),children:[t(p?We:Qe,{className:`w-3 h-3`}),o(p?`agent.copied`:`agent.copy`)]}),n(r,{variant:`unstyled`,onClick:pe,disabled:d,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:o(`agent.exportAsPng`),children:[t($e,{className:`w-3 h-3`}),o(d?`agent.exporting`:`agent.export`)]}),P&&n(r,{variant:`unstyled`,onClick:_e,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors flex items-center gap-1`,title:o(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?dt:lt,{className:`w-3 h-3`}),o(_?`agent.exit`:`agent.fullscreen`)]})]});if(O||ce&&!E)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:F},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(ct,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(A)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:F},children:t(zi,{error:A,chartTitle:s})})]})});if(h)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:F},children:t(zi,{error:h,chartTitle:s})})]})});let be=de(F),xe=de(0,!0);return be?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:s,hasData:!!be.data?.values,dataLength:be.data?.values?.length}),n(e,{children:[t(`div`,{className:Mi(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,N&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:s||(N?`Dashboard`:`Chart`)}),N&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-300`,children:`Interactive`})]}),t(ve,{})]}),c&&t(`span`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:c}),t(`div`,{ref:x,className:`bg-white dark:bg-gray-900 rounded overflow-hidden`,style:{width:`100%`,height:F,minWidth:0},children:t(ee,{fallback:t(Bi,{}),children:t(Ri,{spec:be,onEmbed:e=>me(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Vi,{isOpen:_,onClose:()=>v(!1),title:s||(N?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:xe&&t(ee,{fallback:t(Bi,{}),children:t(Ri,{spec:xe,onEmbed:e=>he(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(ve,{className:`bg-white dark:bg-gray-800 rounded-lg shadow-lg p-2 border border-gray-200 dark:border-gray-700`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),ea=M.createContext({});function ta({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=R(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(ea.Provider,{value:o,children:e})}function na(){return M.useContext(ea)}const ra={chart:{icon:Ue,label:`chart`,defaultHeight:200},mermaid:{icon:tt,label:`diagram`,defaultHeight:150},proposal:{icon:ut,label:`options`,defaultHeight:100},code:{icon:Ze,label:`code`,defaultHeight:80},image:{icon:it,label:`image`,defaultHeight:150},link:{icon:ot,label:`link`,defaultHeight:24},expand:{icon:$e,label:`content`,defaultHeight:100},table:{icon:yt,label:`table`,defaultHeight:150},markdown:{icon:et,label:`content`,defaultHeight:100},"fusion-fragment":{icon:Ze,label:`fragment`,defaultHeight:150}};function U({type:e,error:i,onRetry:a,message:o,height:s}){let c=ra[e],l=s??c.defaultHeight,u=e===`link`;if(i)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),a&&t(r,{variant:`unstyled`,onClick:a,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:o||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:o||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var ia=class extends M.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(U,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function aa(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function oa(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function sa({content:e}){let{headers:r,rows:i}=R(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(U,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function ca({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function la(e){return de.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function ua(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function da({content:e}){let n=R(()=>{let t=typeof e==`string`?e.trim():``;return t?ua(la(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(U,{type:`expand`,error:`Empty mockup`})}function fa({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function pa({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=na();switch(R(()=>n===`auto`?aa(e,r,a):n,[e,r,a,n])){case`chart`:{let n=oa(e);return n?t(ia,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t($i,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=oa(e);return n?t(ia,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t($i,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!$i}),n.template&&n.data?t(ia,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(ue,{data:n.data,ChartComponent:$i,artifactRunId:i,children:t(le,{code:JSON.stringify(n.template),data:n.data})})}):t(ia,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(le,{code:JSON.stringify(e)})})}case`table`:return t(ia,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(sa,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(ia,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(ia,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(da,{content:e})});case`image`:return t(ia,{type:`image`,fallbackCode:r,children:t(fa,{content:e,path:r})});default:return t(ca,{content:e,path:r})}}function ma(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const ha=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ga=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_a={};function va(e,t){return((t||_a).jsx?ga:ha).test(e)}const ya=/[ \t\n\f\r]/g;function ba(e){return typeof e==`object`?e.type===`text`&&xa(e.value):xa(e)}function xa(e){return e.replace(ya,``)===``}var Sa=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Sa.prototype.normal={},Sa.prototype.property={},Sa.prototype.space=void 0;function Ca(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Sa(n,r,t)}function wa(e){return e.toLowerCase()}var Ta=class{constructor(e,t){this.attribute=t,this.property=e}};Ta.prototype.attribute=``,Ta.prototype.booleanish=!1,Ta.prototype.boolean=!1,Ta.prototype.commaOrSpaceSeparated=!1,Ta.prototype.commaSeparated=!1,Ta.prototype.defined=!1,Ta.prototype.mustUseProperty=!1,Ta.prototype.number=!1,Ta.prototype.overloadedBoolean=!1,Ta.prototype.property=``,Ta.prototype.spaceSeparated=!1,Ta.prototype.space=void 0;var Ea=Ae({boolean:()=>W,booleanish:()=>G,commaOrSpaceSeparated:()=>Aa,commaSeparated:()=>ka,number:()=>K,overloadedBoolean:()=>Oa,spaceSeparated:()=>q});let Da=0;const W=ja(),G=ja(),Oa=ja(),K=ja(),q=ja(),ka=ja(),Aa=ja();function ja(){return 2**++Da}const Ma=Object.keys(Ea);var Na=class extends Ta{constructor(e,t,n,r){let i=-1;if(super(e,t),Pa(this,`space`,r),typeof n==`number`)for(;++i<Ma.length;){let e=Ma[i];Pa(this,Ma[i],(n&Ea[e])===Ea[e])}}};Na.prototype.defined=!0;function Pa(e,t,n){n&&(e[t]=n)}function Fa(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Na(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[wa(r)]=r,n[wa(a.attribute)]=r}return new Sa(t,n,e.space)}const Ia=Fa({properties:{ariaActiveDescendant:null,ariaAtomic:G,ariaAutoComplete:null,ariaBusy:G,ariaChecked:G,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:G,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:G,ariaFlowTo:q,ariaGrabbed:G,ariaHasPopup:null,ariaHidden:G,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:K,ariaLive:null,ariaModal:G,ariaMultiLine:G,ariaMultiSelectable:G,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:G,ariaReadOnly:G,ariaRelevant:null,ariaRequired:G,ariaRoleDescription:q,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:G,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function La(e,t){return t in e?e[t]:t}function Ra(e,t){return La(e,t.toLowerCase())}const za=Fa({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ka,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:q,autoFocus:W,autoPlay:W,blocking:q,capture:null,charSet:null,checked:W,cite:null,className:q,cols:K,colSpan:null,content:null,contentEditable:G,controls:W,controlsList:q,coords:K|ka,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:Oa,draggable:G,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:q,height:K,hidden:Oa,high:K,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:q,itemRef:q,itemScope:W,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:W,optimum:K,pattern:null,ping:q,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:q,required:W,reversed:W,rows:K,rowSpan:K,sandbox:q,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:G,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:G,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:G,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:W,disableRemotePlayback:W,prefix:null,property:null,results:K,security:null,unselectable:null},space:`html`,transform:Ra}),Ba=Fa({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Aa,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:q,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ka,g2:ka,glyphName:ka,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:Aa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:K,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Aa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Aa,rev:Aa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Aa,requiredFeatures:Aa,requiredFonts:Aa,requiredFormats:Aa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:Aa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Aa,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Aa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:La}),Va=Fa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ha=Fa({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ra}),Ua=Fa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Wa={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ga=/[A-Z]/g,Ka=/-[a-z]/g,qa=/^data[-\w.:]+$/i;function Ja(e,t){let n=wa(t),r=t,i=Ta;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&qa.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ka,Xa);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ka.test(e)){let n=e.replace(Ga,Ya);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Na}return new i(r,t)}function Ya(e){return`-`+e.toLowerCase()}function Xa(e){return e.charAt(1).toUpperCase()}const Za=Ca([Ia,za,Va,Ha,Ua],`html`),Qa=Ca([Ia,Ba,Va,Ha,Ua],`svg`);function $a(e){return e.join(` `).trim()}function eo(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(ro);t&&(n+=t.length);var i=e.lastIndexOf(uo);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(io)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(fo==e.charAt(0)&&po==e.charAt(1)){for(var n=2;mo!=e.charAt(n)&&(po!=e.charAt(n)||fo!=e.charAt(n+1));)++n;if(n+=2,mo===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:ho,comment:o})}}function f(){var e=a(),t=c(ao);if(t){if(d(),!c(oo))return s(`property missing ':'`);var n=c(so),r=e({type:go,property:to(t[0].replace(no,mo)),value:n?to(n[0].replace(no,mo)):mo});return c(co),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function to(e){return e?e.replace(lo,mo):mo}var no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho,go,_o=Oe((()=>{no=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ro=/\n/g,io=/^\s*/,ao=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,oo=/^:\s*/,so=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,co=/^[;\s]*/,lo=/^\s+|\s+$/g,uo=`
277
+ `,fo=`/`,po=`*`,mo=``,ho=`comment`,go=`declaration`})),vo=Ae({default:()=>yo});function yo(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=eo(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var bo=Oe((()=>{_o()})),xo=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),So=ke(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((bo(),Ne(vo))),r=xo();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const Co=To(`end`),wo=To(`start`);function To(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Eo(e){let t=wo(e),n=Co(e);if(t&&n)return{start:t,end:n}}function Do(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ko(e.position):`start`in e||`end`in e?ko(e):`line`in e||`column`in e?Oo(e):``}function Oo(e){return Ao(e&&e.line)+`:`+Ao(e&&e.column)}function ko(e){return Oo(e&&e.start)+`-`+Oo(e&&e.end)}function Ao(e){return e&&typeof e==`number`?e:1}var jo=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Do(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};jo.prototype.file=``,jo.prototype.name=``,jo.prototype.reason=``,jo.prototype.message=``,jo.prototype.stack=``,jo.prototype.column=void 0,jo.prototype.line=void 0,jo.prototype.ancestors=void 0,jo.prototype.cause=void 0,jo.prototype.fatal=void 0,jo.prototype.place=void 0,jo.prototype.ruleId=void 0,jo.prototype.source=void 0;var Mo=Me(So(),1);const No={}.hasOwnProperty,Po=new Map,Fo=/[A-Z]/g,Io=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Lo=new Set([`td`,`th`]);function Ro(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Yo(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Jo(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Qa:Za,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=zo(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function zo(e,t,n){if(t.type===`element`)return Bo(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Vo(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Uo(e,t,n);if(t.type===`mdxjsEsm`)return Ho(e,t);if(t.type===`root`)return Wo(e,t,n);if(t.type===`text`)return Go(e,t)}function Bo(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Qa,e.schema=i),e.ancestors.push(t);let a=ts(e,t.tagName,!1),o=Xo(e,t),s=Qo(e,t);return Io.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ba(e)})),Ko(e,o,a,t),qo(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vo(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ns(e,t.position)}function Ho(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ns(e,t.position)}function Uo(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Qa,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ts(e,t.name,!0),o=Zo(e,t),s=Qo(e,t);return Ko(e,o,a,t),qo(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Wo(e,t,n){let r={};return qo(r,Qo(e,t)),e.create(t,e.Fragment,r,n)}function Go(e,t){return t.value}function Ko(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qo(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Jo(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Yo(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=wo(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Xo(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&No.call(t.properties,i)){let a=$o(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Lo.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Zo(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ns(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else ns(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Qo(e,t){let n=[],r=-1,i=e.passKeys?new Map:Po;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=zo(e,a,o);s!==void 0&&n.push(s)}return n}function $o(e,t,n){let r=Ja(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ma(n):$a(n)),r.property===`style`){let t=typeof n==`object`?n:es(e,String(n));return e.stylePropertyNameCase===`css`&&(t=rs(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Wa[r.property]||r.property:r.attribute,n]}}function es(e,t){try{return(0,Mo.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new jo("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function ts(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=va(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=va(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return No.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ns(e)}function ns(e,t){let n=new jo("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function rs(e){let t={},n;for(n in e)No.call(e,n)&&(t[is(n)]=e[n]);return t}function is(e){let t=e.replace(Fo,as);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function as(e){return`-`+e.toLowerCase()}const os={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},ss={};function cs(e,t){let n=t||ss;return ls(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function ls(e,t,n){if(ds(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return us(e.children,t,n)}return Array.isArray(e)?us(e,t,n):``}function us(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ls(e[i],t,n);return r.join(``)}function ds(e){return!!(e&&typeof e==`object`)}const fs=document.createElement(`i`);function ps(e){let t=`&`+e+`;`;fs.innerHTML=t;let n=fs.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function J(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ms(e,t){return e.length>0?(J(e,e.length,0,t),e):t}const hs={}.hasOwnProperty;function gs(e){let t={},n=-1;for(;++n<e.length;)_s(t,e[n]);return t}function _s(e,t){let n;for(n in t){let r=(hs.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){hs.call(r,a)||(r[a]=[]);let e=i[a];vs(r[a],Array.isArray(e)?e:e?[e]:[])}}}function vs(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);J(e,0,0,r)}function ys(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function bs(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const xs=As(/[A-Za-z]/),Ss=As(/[\dA-Za-z]/),Cs=As(/[#-'*+\--9=?A-Z^-~]/);function ws(e){return e!==null&&(e<32||e===127)}const Ts=As(/\d/),Es=As(/[\dA-Fa-f]/),Ds=As(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const Os=As(/\p{P}|\p{S}/u),ks=As(/\s/);function As(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function js(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ss(e.charCodeAt(n+1))&&Ss(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Ms={tokenize:Ns};function Ns(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const Ps={tokenize:Is},Fs={tokenize:Ls};function Is(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return J(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fs,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Fs,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;J(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ls(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Rs(e){if(e===null||X(e)||ks(e))return 1;if(Os(e))return 2}function zs(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Bs={name:`attention`,resolveAll:Vs,tokenize:Hs};function Vs(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Us(d,-c),Us(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ms(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ms(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ms(l,zs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ms(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ms(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,J(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Hs(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Rs(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Rs(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Us(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ws={name:`autolink`,tokenize:Gs};function Gs(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return xs(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Ss(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Ss(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ws(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Cs(t)?(e.consume(t),l):n(t)}function u(e){return Ss(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Ss(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Ks={partial:!0,tokenize:qs};function qs(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const Js={continuation:{tokenize:Xs},exit:Zs,name:`blockQuote`,tokenize:Ys};function Ys(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Xs(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Js,t,n)(r)}}function Zs(e){e.exit(`blockQuote`)}const Qs={name:`characterEscape`,tokenize:$s};function $s(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ds(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const ec={name:`characterReference`,tokenize:tc};function tc(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Ss,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Es,u):(e.enter(`characterReferenceValue`),a=7,o=Ts,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Ss&&!ps(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const nc={partial:!0,tokenize:ac},rc={concrete:!0,name:`codeFenced`,tokenize:ic};function ic(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(nc,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(nc,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ac(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const oc={name:`codeIndented`,tokenize:cc},sc={partial:!0,tokenize:lc};function cc(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(sc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function lc(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}const uc={name:`codeText`,previous:fc,resolve:dc,tokenize:pc};function dc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fc(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function pc(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var mc=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&hc(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),hc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);hc(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);hc(this.left,t.reverse())}}}};function hc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function gc(e){let t={},n=-1,r,i,a,o,s,c,l,u=new mc(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_c(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return J(e,0,1/0,u.slice(0)),!l}function _c(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const vc={resolve:bc,tokenize:xc},yc={partial:!0,tokenize:Sc};function bc(e){return gc(e),e}function xc(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(yc,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Sc(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Cc(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ws(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ws(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function wc(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Tc(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ec(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Dc={name:`definition`,tokenize:kc},Oc={partial:!0,tokenize:Ac};function kc(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return wc.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=bs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?Ec(e,l)(t):l(t)}function l(t){return Cc(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Oc,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ac(e,t,n){return r;function r(t){return X(t)?Ec(e,i)(t):n(t)}function i(t){return Tc(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const jc={name:`hardBreakEscape`,tokenize:Mc};function Mc(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Nc={name:`headingAtx`,resolve:Pc,tokenize:Fc};function Pc(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},J(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Fc(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Ic=`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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Lc=[`pre`,`script`,`style`,`textarea`],Rc={concrete:!0,name:`htmlFlow`,resolveTo:Vc,tokenize:Hc},zc={partial:!0,tokenize:Wc},Bc={partial:!0,tokenize:Uc};function Vc(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hc(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):xs(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):xs(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return xs(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Lc.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ic.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Ss(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||xs(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Ss(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),ee):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(zc,ne,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Bc,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function ee(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Lc.includes(n)?(e.consume(t),te):O(t)}return xs(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function Uc(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Wc(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ks,t,n)}}const Gc={name:`htmlText`,tokenize:Kc};function Kc(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):xs(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):xs(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,ee(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,ee(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Y(t)?(o=v,ee(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,ee(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return xs(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Ss(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,ee(t)):Z(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Ss(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||xs(t)?(e.consume(t),E):Y(t)?(o=T,ee(t)):Z(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Ss(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,ee(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,ee(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Y(t)?(o=k,ee(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||X(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ee(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return Z(t)?Q(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}const qc={name:`labelEnd`,resolveAll:Zc,resolveTo:Qc,tokenize:$c},Jc={tokenize:el},Yc={tokenize:tl},Xc={tokenize:nl};function Zc(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&J(e,0,e.length,n),e}function Qc(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=ms(s,e.slice(a+1,a+r+3)),s=ms(s,[[`enter`,u,t]]),s=ms(s,zs(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ms(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ms(s,e.slice(o+1)),s=ms(s,[[`exit`,c,t]]),J(e,a,e.length,s),e}function $c(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(bs(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Jc,u,o?u:d)(t):t===91?e.attempt(Yc,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Xc,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function el(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?Ec(e,a)(t):a(t)}function a(t){return t===41?u(t):Cc(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?Ec(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Tc(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?Ec(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function tl(e,t,n){let r=this;return i;function i(t){return wc.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(bs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function nl(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const rl={name:`labelStartImage`,resolveAll:qc.resolveAll,tokenize:il};function il(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const al={name:`labelStartLink`,resolveAll:qc.resolveAll,tokenize:ol};function ol(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const sl={name:`lineEnding`,tokenize:cl};function cl(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}const ll={name:`thematicBreak`,tokenize:ul};function ul(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}const dl={continuation:{tokenize:hl},exit:_l,name:`list`,tokenize:ml},fl={partial:!0,tokenize:vl},pl={partial:!0,tokenize:gl};function ml(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ts(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ll,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ts(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Ks,r.interrupt?n:u,e.attempt(fl,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function hl(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ks,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pl,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(dl,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function gl(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function _l(e){e.exit(this.containerState.type)}function vl(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const yl={name:`setextUnderline`,resolveTo:bl,tokenize:xl};function bl(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function xl(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const Sl={tokenize:Cl};function Cl(e){let t=this,n=e.attempt(Ks,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vc,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const wl={resolveAll:Ol()},Tl=Dl(`string`),El=Dl(`text`);function Dl(e){return{resolveAll:Ol(e===`text`?kl:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ol(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function kl(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Al=Ae({attentionMarkers:()=>Rl,contentInitial:()=>Ml,disable:()=>zl,document:()=>jl,flow:()=>Pl,flowInitial:()=>Nl,insideSpan:()=>Ll,string:()=>Fl,text:()=>Il});const jl={42:dl,43:dl,45:dl,48:dl,49:dl,50:dl,51:dl,52:dl,53:dl,54:dl,55:dl,56:dl,57:dl,62:Js},Ml={91:Dc},Nl={[-2]:oc,[-1]:oc,32:oc},Pl={35:Nc,42:ll,45:[yl,ll],60:Rc,61:yl,95:ll,96:rc,126:rc},Fl={38:ec,92:Qs},Il={[-5]:sl,[-4]:sl,[-3]:sl,33:rl,38:ec,42:Bs,60:[Ws,Gc],91:al,92:[jc,Qs],93:qc,95:Bs,96:uc},Ll={null:[Bs,wl]},Rl={null:[42,95]},zl={null:[]};function Bl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ms(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=zs(a,l.events,l),l.events):[]}function f(e,t){return Hl(p(e),t)}function p(e){return Vl(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&J(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Vl(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Hl(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
278
278
  `;break;case-3:o=`\r
279
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Vl(e){let t={constructs:ms([Ol,...(e||{}).extensions||[]]),content:n(As),defined:[],document:n(Ms),flow:n(bl),lazy:{},string:n(Cl),text:n(wl)};return t;function n(e){return n;function n(n){return Rl(t,e,n)}}}function Hl(e){for(;!mc(e););return e}const Ul=/[\0\t\n\r]/g;function Wl(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Ul.lastIndex=u,c=Ul.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const Gl=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Kl(e){return e.replace(Gl,ql)}function ql(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return _s(n.slice(t?2:1),t?16:10)}return ds(n)||e}const Jl={}.hasOwnProperty;function Yl(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),Xl(n)(Hl(Vl(n).document().write(Wl()(e,t,!0))))}function Xl(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(oe),characterEscape:T,characterReference:T,codeFenced:a(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(se,o),codeText:a(B,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:z,autolinkProtocol:R,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:I,characterReferenceMarkerNumeric:I,characterReferenceValue:ae,characterReference:L,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(ee),label:te,labelText:N,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:P,resourceTitleString:ne,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Ql(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Jl.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||eu).call(a,void 0,e[0])}for(r.position={start:Zl(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Zl(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Zl(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||eu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+To({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Zl(e.end)}function u(){return os(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vs(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:Zl(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Zl(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Zl(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Kl(t),n.identifier=vs(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function F(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vs(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function I(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=_s(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ds(t);let i=this.stack[this.stack.length-1];i.value+=r}function L(e){let t=this.stack.pop();t.position.end=Zl(e.end)}function R(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function z(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[]}}function se(){return{type:`code`,lang:null,meta:null,value:``}}function B(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function Zl(e){return{line:e.line,column:e.column,offset:e.offset}}function Ql(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Ql(e,r):$l(e,r)}}function $l(e,t){let n;for(n in t)if(Jl.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function eu(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+To({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+To({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+To({start:t.start,end:t.end})+`) is still open`)}function tu(e){let t=this;t.parser=n;function n(n){return Yl(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function nu(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ru(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
280
- `}]}function iu(e,t){let n=t.value?t.value+`
281
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function au(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ou(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function su(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=ks(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function cu(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lu(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function uu(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function du(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uu(e,t);let i={src:ks(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function fu(e,t){let n={src:ks(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function pu(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function mu(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uu(e,t);let i={href:ks(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function hu(e,t){let n={href:ks(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gu(e,t,n){let r=e.all(t),i=n?_u(n):vu(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
279
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Ul(e){let t={constructs:gs([Al,...(e||{}).extensions||[]]),content:n(Ms),defined:[],document:n(Ps),flow:n(Sl),lazy:{},string:n(Tl),text:n(El)};return t;function n(e){return n;function n(n){return Bl(t,e,n)}}}function Wl(e){for(;!gc(e););return e}const Gl=/[\0\t\n\r]/g;function Kl(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Gl.lastIndex=u,c=Gl.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const ql=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Jl(e){return e.replace(ql,Yl)}function Yl(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ys(n.slice(t?2:1),t?16:10)}return ps(n)||e}const Xl={}.hasOwnProperty;function Zl(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),Ql(n)(Wl(Ul(n).document().write(Kl()(e,t,!0))))}function Ql(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ae),characterEscape:T,characterReference:T,codeFenced:a(oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(oe,o),codeText:a(se,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:B,autolinkProtocol:z,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:ie,characterReference:R,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(ee),label:P,labelText:N,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:F,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};eu(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Xl.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||nu).call(a,void 0,e[0])}for(r.position={start:$l(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:$l(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:$l(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||nu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Do({start:e.start,end:e.end})+`): it’s not open`);n.position.end=$l(e.end)}function u(){return cs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=bs(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:$l(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=$l(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=$l(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Jl(t),n.identifier=bs(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function I(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=bs(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function L(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ys(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ps(t);let i=this.stack[this.stack.length-1];i.value+=r}function R(e){let t=this.stack.pop();t.position.end=$l(e.end)}function z(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function B(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function oe(){return{type:`code`,lang:null,meta:null,value:``}}function se(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function $l(e){return{line:e.line,column:e.column,offset:e.offset}}function eu(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?eu(e,r):tu(e,r)}}function tu(e,t){let n;for(n in t)if(Xl.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function nu(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Do({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Do({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Do({start:t.start,end:t.end})+`) is still open`)}function ru(e){let t=this;t.parser=n;function n(n){return Zl(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function iu(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function au(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
280
+ `}]}function ou(e,t){let n=t.value?t.value+`
281
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function su(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cu(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lu(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=js(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function uu(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function du(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fu(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function pu(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fu(e,t);let i={src:js(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function mu(e,t){let n={src:js(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function hu(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function gu(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fu(e,t);let i={href:js(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function _u(e,t){let n={href:js(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vu(e,t,n){let r=e.all(t),i=n?yu(n):bu(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
282
282
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
283
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function _u(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=vu(n[r])}return t}function vu(e){return e.spread??e.children.length>1}function yu(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function bu(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xu(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Su(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cu(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=So(t.children[1]),o=xo(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function wu(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Tu(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eu(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Du(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Du(t.slice(i),i>0,!1)),a.join(``)}function Du(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Ou(e,t){let n={type:`text`,value:Eu(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ku(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Au={blockquote:nu,break:ru,code:iu,delete:au,emphasis:ou,footnoteReference:su,heading:cu,html:lu,imageReference:du,image:fu,inlineCode:pu,linkReference:mu,link:hu,listItem:gu,list:yu,paragraph:bu,root:xu,strong:Su,table:Cu,tableCell:Tu,tableRow:wu,text:Ou,thematicBreak:ku,toml:ju,yaml:ju,definition:ju,footnoteDefinition:ju};function ju(){}const Mu=typeof self==`object`?self:globalThis,Nu=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Mu[e](t)},Pu=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Mu[e]==`function`?Nu(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Nu(a,o),i)};return r},Fu=e=>Pu(new Map,e)(0),{toString:Iu}={},{keys:Lu}=Object,Ru=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Iu.call(e).slice(8,-1);switch(n){case`Array`:return[1,``];case`Object`:return[2,``];case`Date`:return[3,``];case`RegExp`:return[4,``];case`Map`:return[5,``];case`Set`:return[6,``];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},zu=([e,t])=>e===0&&(t===`function`||t===`symbol`),Bu=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Ru(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Lu(r))(e||!zu(Ru(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?``:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(zu(Ru(n))||zu(Ru(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!zu(Ru(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Vu=(e,{json:t,lossy:n}={})=>{let r=[];return Bu(!(t||n),!!t,new Map,r)(e),r};var Hu=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Fu(Vu(e,t)):structuredClone(e):(e,t)=>Fu(Vu(e,t));function Uu(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Wu(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Gu(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Uu,r=e.options.footnoteBackLabel||Wu,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=ks(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Hu(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
283
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function yu(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=bu(n[r])}return t}function bu(e){return e.spread??e.children.length>1}function xu(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Su(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cu(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wu(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tu(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=wo(t.children[1]),o=Co(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Eu(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Du(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ou(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(ku(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(ku(t.slice(i),i>0,!1)),a.join(``)}function ku(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Au(e,t){let n={type:`text`,value:Ou(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ju(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Mu={blockquote:iu,break:au,code:ou,delete:su,emphasis:cu,footnoteReference:lu,heading:uu,html:du,imageReference:pu,image:mu,inlineCode:hu,linkReference:gu,link:_u,listItem:vu,list:xu,paragraph:Su,root:Cu,strong:wu,table:Tu,tableCell:Du,tableRow:Eu,text:Au,thematicBreak:ju,toml:Nu,yaml:Nu,definition:Nu,footnoteDefinition:Nu};function Nu(){}const Pu=typeof self==`object`?self:globalThis,Fu=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Pu[e](t)},Iu=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Pu[e]==`function`?Fu(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Fu(a,o),i)};return r},Lu=e=>Iu(new Map,e)(0),{toString:Ru}={},{keys:zu}=Object,Bu=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Ru.call(e).slice(8,-1);switch(n){case`Array`:return[1,``];case`Object`:return[2,``];case`Date`:return[3,``];case`RegExp`:return[4,``];case`Map`:return[5,``];case`Set`:return[6,``];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Vu=([e,t])=>e===0&&(t===`function`||t===`symbol`),Hu=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Bu(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of zu(r))(e||!Vu(Bu(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?``:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Vu(Bu(n))||Vu(Bu(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Vu(Bu(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Uu=(e,{json:t,lossy:n}={})=>{let r=[];return Hu(!(t||n),!!t,new Map,r)(e),r};var Wu=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Lu(Uu(e,t)):structuredClone(e):(e,t)=>Lu(Uu(e,t));function Gu(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Ku(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function qu(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Gu,r=e.options.footnoteBackLabel||Ku,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=js(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Wu(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
284
284
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
285
- `}]}}const Ku=(function(e){if(e==null)return Zu;if(typeof e==`function`)return Xu(e);if(typeof e==`object`)return Array.isArray(e)?qu(e):Ju(e);if(typeof e==`string`)return Yu(e);throw Error(`Expected function, string, or object as test`)});function qu(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ku(e[n]);return Xu(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Ju(e){let t=e;return Xu(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Yu(e){return Xu(t);function t(t){return t&&t.type===e}}function Xu(e){return t;function t(t,n,r){return!!(Qu(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Zu(){return!0}function Qu(e){return typeof e==`object`&&!!e&&`type`in e}function $u(e){return e}const ed=[];function td(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ku(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+$u(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ed,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=nd(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function nd(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ed:[e]}function rd(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),td(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const id={}.hasOwnProperty,ad={};function od(e,t){let n=t||ad,r=new Map,i=new Map,a={all:s,applyData:cd,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Au,...n.handlers},one:o,options:n,patch:sd,wrap:ud};return rd(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(id.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Hu(n);return r.children=a.all(e),r}return Hu(e)}return(a.options.unknownHandler||ld)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=dd(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=dd(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function sd(e,t){e.position&&(t.position=wo(e))}function cd(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Hu(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function ld(e,t){let n=t.data||{},r=`value`in t&&!(id.call(n,`hProperties`)||id.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ud(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
285
+ `}]}}const Ju=(function(e){if(e==null)return $u;if(typeof e==`function`)return Qu(e);if(typeof e==`object`)return Array.isArray(e)?Yu(e):Xu(e);if(typeof e==`string`)return Zu(e);throw Error(`Expected function, string, or object as test`)});function Yu(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ju(e[n]);return Qu(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Xu(e){let t=e;return Qu(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Zu(e){return Qu(t);function t(t){return t&&t.type===e}}function Qu(e){return t;function t(t,n,r){return!!(ed(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function $u(){return!0}function ed(e){return typeof e==`object`&&!!e&&`type`in e}function td(e){return e}const nd=[],rd=`skip`;function id(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ju(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+td(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=nd,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ad(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function ad(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?nd:[e]}function od(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),id(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const sd={}.hasOwnProperty,cd={};function ld(e,t){let n=t||cd,r=new Map,i=new Map,a={all:s,applyData:dd,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Mu,...n.handlers},one:o,options:n,patch:ud,wrap:pd};return od(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(sd.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Wu(n);return r.children=a.all(e),r}return Wu(e)}return(a.options.unknownHandler||fd)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=md(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=md(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function ud(e,t){e.position&&(t.position=Eo(e))}function dd(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Wu(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function fd(e,t){let n=t.data||{},r=`value`in t&&!(sd.call(n,`hProperties`)||sd.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pd(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
286
286
  `});++r<e.length;)r&&n.push({type:`text`,value:`
287
287
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
288
- `}),n}function dd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fd(e,t){let n=od(e,t),r=n.one(e,void 0),i=Gu(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
289
- `},i)),a}function pd(e,t){return e&&`run`in e?async function(n,r){let i=fd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fd(n,{file:r,...e||t})}}function md(e){if(e)throw e}var hd=je(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function gd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function _d(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?vd(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function vd(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const yd={basename:bd,dirname:xd,extname:Sd,join:Cd,sep:`/`};function bd(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Ed(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function xd(e){if(Ed(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Sd(e){Ed(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Cd(...e){let t=-1,n;for(;++t<e.length;)Ed(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:wd(n)}function wd(e){Ed(e);let t=e.codePointAt(0)===47,n=Td(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Td(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Ed(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const Dd={cwd:Od};function Od(){return`/`}function kd(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ad(e){if(typeof e==`string`)e=new URL(e);else if(!kd(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return jd(e)}function jd(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}const Md=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var Nd=class{constructor(e){let t;t=e?kd(e)?{path:e}:typeof e==`string`||Ld(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Dd.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Md.length;){let e=Md[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Md.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?yd.basename(this.path):void 0}set basename(e){Fd(e,`basename`),Pd(e,`basename`),this.path=yd.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?yd.dirname(this.path):void 0}set dirname(e){Id(this.basename,`dirname`),this.path=yd.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?yd.extname(this.path):void 0}set extname(e){if(Pd(e,`extname`),Id(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=yd.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){kd(e)&&(e=Ad(e)),Fd(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?yd.basename(this.path,this.extname):void 0}set stem(e){Fd(e,`stem`),Pd(e,`stem`),this.path=yd.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new ko(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Pd(e,t){if(e&&e.includes(yd.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+yd.sep+"`")}function Fd(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Id(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ld(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Rd=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var zd=Pe(hd(),1);const Bd={}.hasOwnProperty,Vd=new class e extends Rd{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_d()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,zd.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Wd(`data`,this.frozen),this.namespace[e]=t,this):Bd.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Wd(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=qd(e),n=this.parser||this.Parser;return Hd(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Hd(`process`,this.parser||this.Parser),Ud(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=qd(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Yd(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Hd(`processSync`,this.parser||this.Parser),Ud(`processSync`,this.compiler||this.Compiler),this.process(e,r),Kd(`processSync`,`process`,t),n;function r(e,r){t=!0,md(e),n=r}}run(e,t,n){Gd(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=qd(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Kd(`runSync`,`run`,n),r;function i(e,t){md(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=qd(t),r=this.compiler||this.Compiler;return Ud(`stringify`,r),Gd(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Wd(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,zd.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];gd(o)&&gd(r)&&(r=(0,zd.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Hd(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ud(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Wd(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gd(e){if(!gd(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Kd(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function qd(e){return Jd(e)?e:new Nd(e)}function Jd(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Yd(e){return typeof e==`string`||Xd(e)}function Xd(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Zd=[],Qd={allowDangerousHtml:!0},$d=/^(https?|ircs?|mailto|xmpp)$/i,ef=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function tf(e){let t=nf(e),n=rf(e);return af(t.runSync(t.parse(n),n),e)}function nf(e){let t=e.rehypePlugins||Zd,n=e.remarkPlugins||Zd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Qd}:Qd;return Vd().use(tu).use(n).use(pd,r).use(t)}function rf(e){let t=e.children||``,n=new Nd;return typeof t==`string`?n.value=t:``+t,n}function af(r,i){let a=i.allowedElements,o=i.allowElement,s=i.components,c=i.disallowedElements,l=i.skipHtml,u=i.unwrapDisallowed,d=i.urlTransform||of;for(let e of ef)Object.hasOwn(i,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return rd(r,f),Io(r,{Fragment:e,components:s,ignoreInvalidStyle:!0,jsx:t,jsxs:n,passKeys:!0,passNode:!0});function f(e,t,n){if(e.type===`raw`&&n&&typeof t==`number`)return l?n.children.splice(t,1):n.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in is)if(Object.hasOwn(is,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=is[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=d(String(n||``),t,e))}}if(e.type===`element`){let r=a?!a.includes(e.tagName):c?c.includes(e.tagName):!1;if(!r&&o&&typeof t==`number`&&(r=!o(e,t,n)),r&&n&&typeof t==`number`)return u&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}function of(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||$d.test(e.slice(0,t))?e:``}const sf={enter:{defList:cf,defListTerm:uf,defListDescription:ff},exit:{defList:lf,defListTerm:df,defListDescription:pf}};function cf(e){this.enter({type:`defList`,children:[]},e)}function lf(e){this.exit(e)}function uf(e){this.enter({type:`defListTerm`,children:[]},e)}function df(e){this.exit(e)}function ff(e){this.enter({type:`defListDescription`,spread:!!e._loose,children:[]},e)}function pf(e){this.exit(e)}const mf={join:[(e,t,n,r)=>{if(n.type===`defList`)return e.type===`defListDescription`&&t.type===`defListTerm`||`spread`in t&&t.spread?1:0}],unsafe:[{character:`:`,atBreak:!0,after:`(?:[ \r
288
+ `}),n}function md(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hd(e,t){let n=ld(e,t),r=n.one(e,void 0),i=qu(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
289
+ `},i)),a}function gd(e,t){return e&&`run`in e?async function(n,r){let i=hd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return hd(n,{file:r,...e||t})}}function _d(e){if(e)throw e}var vd=ke(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function yd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bd(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?xd(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function xd(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const Sd={basename:Cd,dirname:wd,extname:Td,join:Ed,sep:`/`};function Cd(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);kd(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function wd(e){if(kd(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Td(e){kd(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Ed(...e){let t=-1,n;for(;++t<e.length;)kd(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Dd(n)}function Dd(e){kd(e);let t=e.codePointAt(0)===47,n=Od(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Od(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function kd(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const Ad={cwd:jd};function jd(){return`/`}function Md(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Nd(e){if(typeof e==`string`)e=new URL(e);else if(!Md(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Pd(e)}function Pd(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}const Fd=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var Id=class{constructor(e){let t;t=e?Md(e)?{path:e}:typeof e==`string`||Bd(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Ad.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Fd.length;){let e=Fd[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Fd.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Sd.basename(this.path):void 0}set basename(e){Rd(e,`basename`),Ld(e,`basename`),this.path=Sd.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Sd.dirname(this.path):void 0}set dirname(e){zd(this.basename,`dirname`),this.path=Sd.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Sd.extname(this.path):void 0}set extname(e){if(Ld(e,`extname`),zd(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Sd.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Md(e)&&(e=Nd(e)),Rd(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Sd.basename(this.path,this.extname):void 0}set stem(e){Rd(e,`stem`),Ld(e,`stem`),this.path=Sd.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new jo(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Ld(e,t){if(e&&e.includes(Sd.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Sd.sep+"`")}function Rd(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function zd(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Bd(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Vd=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var Hd=Me(vd(),1);const Ud={}.hasOwnProperty,Wd=new class e extends Vd{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=bd()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Hd.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(qd(`data`,this.frozen),this.namespace[e]=t,this):Ud.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qd(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Xd(e),n=this.parser||this.Parser;return Gd(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Gd(`process`,this.parser||this.Parser),Kd(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Xd(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Qd(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Gd(`processSync`,this.parser||this.Parser),Kd(`processSync`,this.compiler||this.Compiler),this.process(e,r),Yd(`processSync`,`process`,t),n;function r(e,r){t=!0,_d(e),n=r}}run(e,t,n){Jd(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Xd(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Yd(`runSync`,`run`,n),r;function i(e,t){_d(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Xd(t),r=this.compiler||this.Compiler;return Kd(`stringify`,r),Jd(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(qd(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Hd.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];yd(o)&&yd(r)&&(r=(0,Hd.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Gd(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Kd(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function qd(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Jd(e){if(!yd(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Yd(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Xd(e){return Zd(e)?e:new Id(e)}function Zd(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Qd(e){return typeof e==`string`||$d(e)}function $d(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const ef=[],tf={allowDangerousHtml:!0},nf=/^(https?|ircs?|mailto|xmpp)$/i,rf=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function af(e){let t=of(e),n=sf(e);return cf(t.runSync(t.parse(n),n),e)}function of(e){let t=e.rehypePlugins||ef,n=e.remarkPlugins||ef,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tf}:tf;return Wd().use(ru).use(n).use(gd,r).use(t)}function sf(e){let t=e.children||``,n=new Id;return typeof t==`string`?n.value=t:``+t,n}function cf(r,i){let a=i.allowedElements,o=i.allowElement,s=i.components,c=i.disallowedElements,l=i.skipHtml,u=i.unwrapDisallowed,d=i.urlTransform||lf;for(let e of rf)Object.hasOwn(i,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return od(r,f),Ro(r,{Fragment:e,components:s,ignoreInvalidStyle:!0,jsx:t,jsxs:n,passKeys:!0,passNode:!0});function f(e,t,n){if(e.type===`raw`&&n&&typeof t==`number`)return l?n.children.splice(t,1):n.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in os)if(Object.hasOwn(os,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=os[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=d(String(n||``),t,e))}}if(e.type===`element`){let r=a?!a.includes(e.tagName):c?c.includes(e.tagName):!1;if(!r&&o&&typeof t==`number`&&(r=!o(e,t,n)),r&&n&&typeof t==`number`)return u&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}function lf(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||nf.test(e.slice(0,t))?e:``}const uf={enter:{defList:df,defListTerm:pf,defListDescription:hf},exit:{defList:ff,defListTerm:mf,defListDescription:gf}};function df(e){this.enter({type:`defList`,children:[]},e)}function ff(e){this.exit(e)}function pf(e){this.enter({type:`defListTerm`,children:[]},e)}function mf(e){this.exit(e)}function hf(e){this.enter({type:`defListDescription`,spread:!!e._loose,children:[]},e)}function gf(e){this.exit(e)}const _f={join:[(e,t,n,r)=>{if(n.type===`defList`)return e.type===`defListDescription`&&t.type===`defListTerm`||`spread`in t&&t.spread?1:0}],unsafe:[{character:`:`,atBreak:!0,after:`(?:[ \r
290
290
  ])`}],handlers:{defList:(e,t,n,r)=>{let i=n.enter(`defList`),a=n.containerFlow(e,r);return i(),a},defListTerm:(e,t,n,r)=>{let i=n.enter(`defListTerm`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:`
291
291
  `,after:`
292
- `});return a(),i(),o},defListDescription:(e,t,n,r)=>{let i=n.enter(`defListDescription`),a=n.indentLines(n.containerFlow(e,r),o);return i(),a;function o(e,t,n){return t?n?``:` `.repeat(4)+e:n?`:`+` `.repeat(3):`:`+` `.repeat(3)+e}}}};function hf(e,t,n){let r={type:String(e)};return n==null&&(typeof t==`string`||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r}const $={defList:`defList`,defListTerm:`defListTerm`,defListDescriptionMarker:`defListDescriptionMarker`,defListDescriptionPrefix:`defListDescriptionPrefix`,defListDescriptionPrefixWhitespace:`defListDescriptionPrefixWhitespace`,defListDescription:`defListDescription`};function gf(e){let t=e._tokenizer.events,n,r,i;for(let e=t.length-1;e>=0;e--){let a=t[e];if(a[1].type===`paragraph`){if(a[0]===`exit`)r=e;else{n=e,i=a[1].start.offset;for(let n=e-1;n>=0;n--){let e=t[n];if(e[1].type!==`content`){if(e[1].type===`linePrefix`){i=e[1].start.offset;break}break}}break}}}return n!=null&&r!=null&&i!=null?{flowEvents:t,paragraph:{enterIndex:n,exitIndex:r,startOffset:i}}:{flowEvents:t}}function _f(e){let t=e._tokenizer.events,n=[],r=[],i=[],a=[],o,s,c,l,u=[],d=[];for(let f=t.length-1;f>=0;f--){let p=t[f],m=p[1];if(m.start.offset>=e.end.offset){a.push(f);continue}switch(m.type){case`paragraph`:o==null&&p[0]===`enter`?o=f:s==null&&p[0]===`exit`&&(s=f);break;case`content`:p[0]===`enter`?c=f:p[0]===`exit`&&(l=f);break;default:e.start.offset<=m.start.offset&&m.end.offset<=e.end.offset?(m.type===`chunkText`&&(m.previous&&m.previous.start.offset<e.start.offset&&(m.previous.next=void 0,m.previous=void 0),m.next&&e.end.offset<m.next.end.offset&&(m.next.previous=void 0,m.next=void 0)),o==null&&s==null?r.unshift(p):o==null&&s!=null?i.unshift(p):n.unshift(p),a.push(f)):(o==null&&s!=null&&u.unshift(p),c==null&&l!=null&&d.unshift(p))}if(m.end.offset<=e.start.offset)break}s!=null&&(u.length>=1?t[s][1].end=Object.assign({},u[u.length-1][1].end):o!=null&&a.push(o,s)),l!=null&&(d.length>=1?t[l][1].end=Object.assign({},d[d.length-1][1].end):c!=null&&a.push(c,l)),a.sort((e,t)=>t-e);for(let e of a)J(t,e,1,[]);return{leadingChildEvents:n,termChildEvents:i,trailingChildEvents:r}}function vf(e,t,n){let r=e[t][1];r.previous!=null&&(r.previous.next=void 0,r.previous=void 0);let i=_f(r),a=e[n][2],o=[];if(i.termChildEvents.length>0){let e={type:$.defListTerm,start:Object.assign({},r.start),end:Object.assign({},r.end)};o.push([`enter`,e,a]),o.push(...i.leadingChildEvents),o.push(...i.termChildEvents),o.push(...i.trailingChildEvents),o.push([`exit`,e,a])}else o.push(...i.leadingChildEvents),o.push(...i.trailingChildEvents);return J(e,n,1,[]),J(e,t,1,o),e}const yf=new Set([`linePrefix`,`blockQuotePrefix`,`blockQuoteMarker`,`blockQuotePrefixWhitespace`]),bf={name:`defList`,tokenize:kf,continuation:{tokenize:Af},resolveAll:wf,exit:Nf},xf={tokenize:Mf,partial:!0},Sf={tokenize:jf,partial:!0},Cf={document:{58:bf,null:[]}};function wf(e,t){let n=0;for(;n<e.length;){let r=e[n];r[0]===`enter`&&r[1].type===$.defList&&(n+=Tf(n,e,t)),n++}let r=[];for(n=0;n<e.length;){let t=e[n];if(t[0]===`enter`&&t[1].type===$.defList&&r.push(t[1]),t[0]===`exit`&&t[1].type===$.defList){let i=!1,a=1;for(;n+a<e.length;){let t=e[n+a];if(t[0]===`enter`&&t[1].type===$.defList){i=!0;break}if(!yf.has(t[1].type))break;a++}i?(t[1].end=Object.assign({},e[n+a][1].end),J(e,n,a+1,[]),n-=a):t[1]=r.pop()}n++}return e}function Tf(e,t,n){let r=0,i,a=!0,o=e+1;for(o+=Df(e,t);o<t.length;){let l=t[o];if(l[0]===`enter`&&l[1].type===$.defList&&(o+=Tf(o,t,n)),l[0]===`exit`&&l[1].type===$.defList){o+=c(o,t),i=void 0,r=o-e;break}if(l[0]===`exit`&&l[1].type===$.defListDescriptionPrefix&&(a||(o+=c(o,t),i=void 0),o+=s(o,t,l[1]._loose),a=!1),l[0]===`enter`&&l[1].type===$.defListDescriptionPrefix){if(t[o-1][1].type===`lineEndingBlank`)l[1]._loose=!0;else if(t[o-1][1].type===`chunkFlow`){let e=t[o-1][1]._tokenizer.events;e[e.length-1][1].type===`lineEndingBlank`&&(l[1]._loose=!0)}}o++}return r;function s(e,t,r){return i={type:$.defListDescription,start:Object.assign({},t[e+1][1].start),end:Object.assign({},t[e+1][1].end),_loose:r},J(t,e+1,0,[[`enter`,i,n]]),1}function c(e,t){return i.end=Object.assign({},t[e-1][1].end),J(t,e,0,[[`exit`,i,n]]),1}}function Ef(e,t,n,r){let i=e[t][2],a=gf(e[t][1]).paragraph;if(a==null){let t=e[n],r={type:$.defListTerm,start:Object.assign({},t[1].start),end:Object.assign({},t[1].start)};return J(e,n,0,[[`enter`,r,i],[`exit`,r,i]]),n}let o=e[t][2].parser.lazy,s=0,c;for(let n=t;n>=0;n--){let t=e[n];if(t[1].type!==`chunkFlow`){s=n+1;break}if(t[1].start.offset<a.startOffset){s=n+1;break}if(t[0]===`exit`){if(r&&!o[t[1].start.line]){s=n+1;break}c=n}else vf(e,n,c),c=void 0}return s}function Df(e,t){let n,r,i;for(let a=e-1;a>=0;a--)if(!yf.has(t[a][1].type)){if(a===e-1&&t[a][1].type===`blockQuote`&&t[a][0]===`exit`){i=a,r=t[a];continue}t[a][1].type===`chunkFlow`&&(n=a);break}let a=t[e];J(t,e,1,[]),i!=null&&J(t,i,1,[]);let o=Ef(t,n,e,r!=null);return i!=null&&(r[1].end=Object.assign({},t[o-1][1].end),J(t,o,0,[r]),o+=1),a[1].start=Object.assign({},t[o][1].start),J(t,o,0,[a]),o-e}function Of(e){if(e.length<=1)return!1;let t=e[e.length-1][2].parser.lazy,n=!1,r,i;for(let t=e.length-1;t>=0;t--){let a=e[t];if(!yf.has(a[1].type)){if(t===e.length-1&&a[1].type===`blockQuote`&&a[0]===`exit`){n=!0;continue}if(a[1].type===`chunkFlow`)a[0]===`enter`&&(i??=a[1]._tokenizer?.events,r=a);else break}}if(i!=null&&r!=null){let e=0;for(let a=i.length-1;a>=0;a--){let o=i[a],s=o[1];if(s.start.offset<r[1].start.offset)break;if(o[0]===`enter`&&s.type===`lineEndingBlank`){if(e>=1)break;e++}if(s.type!==`lineEnding`&&s.type!==`linePrefix`&&s.type!==`lineEndingBlank`&&s.type!==`content`)return n&&!t[s.end.line]?!1:s.type===`paragraph`||s.type===`chunkContent`||s.type===`tableHead`||s.type===`tableRow`}}return!1}function kf(e,t,n){let r=this;r.containerState??={};let i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0;if(r.containerState.type==null){if(Of(r.events))e.enter($.defList,{_container:!0}),r.containerState.type=$.defList;else return n}return o;function o(t){return t===58?(e.enter($.defListDescriptionPrefix,{_loose:r.containerState?.lastBlankLine}),r.containerState.lastBlankLine=void 0,e.enter($.defListDescriptionMarker),e.consume(t),e.exit($.defListDescriptionMarker),e.check(Ws,s,e.attempt(xf,l,c))):n(t)}function s(e){return r.containerState.initialBlankLine=!0,a++,l(e)}function c(t){return Z(t)?(e.enter($.defListDescriptionPrefixWhitespace),e.consume(t),e.exit($.defListDescriptionPrefixWhitespace),l):n(t)}function l(n){return r.containerState.size=a+r.sliceSerialize(e.exit($.defListDescriptionPrefix),!0).length,t(n)}}function Af(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ws,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines??r.containerState.initialBlankLine,r.containerState.lastBlankLine=!0,Q(e,t,`linePrefix`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines??!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,r.containerState.lastBlankLine=void 0,e.attempt(Sf,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(bf,t,n),`linePrefix`,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function jf(e,t,n){let r=this;return Q(e,i,`linePrefix`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`linePrefix`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Mf(e,t,n){let r=this;return Q(e,i,$.defListDescriptionPrefixWhitespace,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===$.defListDescriptionPrefixWhitespace?t(e):n(e)}}function Nf(e){e.exit($.defList)}const Pf=(e,t,n)=>{let r=e.all(t),i=[];for(let e=0;e<r.length;e++)i.push(hf(`text`,`
293
- `)),i.push(r[e]);r.length>0&&i.push(hf(`text`,`
294
- `));let a={type:`element`,tagName:`dl`,children:i,properties:{}};return e.patch(t,a),a},Ff=(e,t,n)=>{let r={type:`element`,tagName:`dt`,properties:{},children:e.all(t)};return e.patch(t,r),r},If=(e,t,n)=>{let r=[],i=e.all(t);for(let e=0;e<i.length;e++){let n=i[e];(t.spread||e!==0||n.type!==`element`||n.tagName!==`p`)&&r.push(hf(`text`,`
295
- `)),!t.spread&&n.type===`element`&&n.tagName===`p`?r.push(...n.children):r.push(n)}let a=r[r.length-1];a&&(t.spread||!(`tagName`in a)||a.tagName!==`p`)&&r.push(hf(`text`,`
296
- `));let o={type:`element`,tagName:`dd`,properties:{},children:r};return e.patch(t,o),o},Lf={[$.defList]:Pf,[$.defListTerm]:Ff,[$.defListDescription]:If},Rf=Ku([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function zf(){let e=this.data(),t=e.micromarkExtensions??=[],n=e.fromMarkdownExtensions??=[],r=e.toMarkdownExtensions??=[];t.push(Cf),n.push(sf),r.push(mf)}function Bf(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Vf=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Hf={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Uf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Wf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Gf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Kf(e){return Gf(e)||Uf(e)}const qf=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Jf(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Kf:u===`decimal`?Uf:Wf;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Vf.includes(y)&&(_=y,v=ds(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&ds(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1)){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Kf(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Yf(e))h(7,S),C=`�`;else if(e in Hf)h(6,S),C=Hf[e];else{let t=``;Xf(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,qf[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Yf(e){return e>=55296&&e<=57343||e>1114111}function Xf(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const Zf=/["&'<>`]/g,Qf=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$f=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ep=/[|\\{}()[\]^$+*?.]/g,tp=new WeakMap;function np(e,t){if(e=e.replace(t.subset?rp(t.subset):Zf,r),t.subset||t.escapeOnly)return e;return e.replace(Qf,n).replace($f,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function rp(e){let t=tp.get(e);return t||(t=ip(e),tp.set(e,t)),t}function ip(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(ep,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function ap(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function op(e,t){return np(e,Object.assign({format:ap},t))}const sp={}.hasOwnProperty,cp={},lp=/^[^\t\n\r "#'.<=>`}]+$/,up=/^[^\t\n\r "'<=>`}]+$/;function dp(){return{canContainEols:[`textDirective`],enter:{directiveContainer:pp,directiveContainerAttributes:bp,directiveContainerLabel:vp,directiveLeaf:mp,directiveLeafAttributes:bp,directiveText:hp,directiveTextAttributes:bp},exit:{directiveContainer:Ep,directiveContainerAttributeClassValue:Sp,directiveContainerAttributeIdValue:xp,directiveContainerAttributeName:wp,directiveContainerAttributeValue:Cp,directiveContainerAttributes:Tp,directiveContainerLabel:yp,directiveContainerName:_p,directiveLeaf:Ep,directiveLeafAttributeClassValue:Sp,directiveLeafAttributeIdValue:xp,directiveLeafAttributeName:wp,directiveLeafAttributeValue:Cp,directiveLeafAttributes:Tp,directiveLeafName:_p,directiveText:Ep,directiveTextAttributeClassValue:Sp,directiveTextAttributeIdValue:xp,directiveTextAttributeName:wp,directiveTextAttributeValue:Cp,directiveTextAttributes:Tp,directiveTextName:_p}}}function fp(e){let t=e||cp;if(t.quote!==`"`&&t.quote!==`'`&&t.quote!==null&&t.quote!==void 0)throw Error("Invalid quote `"+t.quote+"`, expected `'` or `\"`");return n.peek=Dp,{handlers:{containerDirective:n,leafDirective:n,textDirective:n},unsafe:[{character:`\r`,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{character:`
297
- `,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{before:`[^:]`,character:`:`,after:`[A-Za-z]`,inConstruct:[`phrasing`]},{atBreak:!0,character:`:`,after:`:`}]};function n(e,t,n,i){let a=n.createTracker(i),o=kp(e),s=n.enter(e.type),c=a.move(o+(e.name||``)),l;if(e.type===`containerDirective`){let t=(e.children||[])[0];l=Op(t)?t:void 0}else l=e;if(l&&l.children&&l.children.length>0){let t=n.enter(`label`),r=`${e.type}Label`,i=n.enter(r);c+=a.move(`[`),c+=a.move(n.containerPhrasing(l,{...a.current(),before:c,after:`]`})),c+=a.move(`]`),i(),t()}if(c+=a.move(r(e,n)),e.type===`containerDirective`){let t=(e.children||[])[0],r=e;Op(t)&&(r=Object.assign({},e,{children:e.children.slice(1)})),r&&r.children&&r.children.length>0&&(c+=a.move(`
292
+ `});return a(),i(),o},defListDescription:(e,t,n,r)=>{let i=n.enter(`defListDescription`),a=n.indentLines(n.containerFlow(e,r),o);return i(),a;function o(e,t,n){return t?n?``:` `.repeat(4)+e:n?`:`+` `.repeat(3):`:`+` `.repeat(3)+e}}}};function vf(e,t,n){let r={type:String(e)};return n==null&&(typeof t==`string`||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r}const $={defList:`defList`,defListTerm:`defListTerm`,defListDescriptionMarker:`defListDescriptionMarker`,defListDescriptionPrefix:`defListDescriptionPrefix`,defListDescriptionPrefixWhitespace:`defListDescriptionPrefixWhitespace`,defListDescription:`defListDescription`};function yf(e){let t=e._tokenizer.events,n,r,i;for(let e=t.length-1;e>=0;e--){let a=t[e];if(a[1].type===`paragraph`){if(a[0]===`exit`)r=e;else{n=e,i=a[1].start.offset;for(let n=e-1;n>=0;n--){let e=t[n];if(e[1].type!==`content`){if(e[1].type===`linePrefix`){i=e[1].start.offset;break}break}}break}}}return n!=null&&r!=null&&i!=null?{flowEvents:t,paragraph:{enterIndex:n,exitIndex:r,startOffset:i}}:{flowEvents:t}}function bf(e){let t=e._tokenizer.events,n=[],r=[],i=[],a=[],o,s,c,l,u=[],d=[];for(let f=t.length-1;f>=0;f--){let p=t[f],m=p[1];if(m.start.offset>=e.end.offset){a.push(f);continue}switch(m.type){case`paragraph`:o==null&&p[0]===`enter`?o=f:s==null&&p[0]===`exit`&&(s=f);break;case`content`:p[0]===`enter`?c=f:p[0]===`exit`&&(l=f);break;default:e.start.offset<=m.start.offset&&m.end.offset<=e.end.offset?(m.type===`chunkText`&&(m.previous&&m.previous.start.offset<e.start.offset&&(m.previous.next=void 0,m.previous=void 0),m.next&&e.end.offset<m.next.end.offset&&(m.next.previous=void 0,m.next=void 0)),o==null&&s==null?r.unshift(p):o==null&&s!=null?i.unshift(p):n.unshift(p),a.push(f)):(o==null&&s!=null&&u.unshift(p),c==null&&l!=null&&d.unshift(p))}if(m.end.offset<=e.start.offset)break}s!=null&&(u.length>=1?t[s][1].end=Object.assign({},u[u.length-1][1].end):o!=null&&a.push(o,s)),l!=null&&(d.length>=1?t[l][1].end=Object.assign({},d[d.length-1][1].end):c!=null&&a.push(c,l)),a.sort((e,t)=>t-e);for(let e of a)J(t,e,1,[]);return{leadingChildEvents:n,termChildEvents:i,trailingChildEvents:r}}function xf(e,t,n){let r=e[t][1];r.previous!=null&&(r.previous.next=void 0,r.previous=void 0);let i=bf(r),a=e[n][2],o=[];if(i.termChildEvents.length>0){let e={type:$.defListTerm,start:Object.assign({},r.start),end:Object.assign({},r.end)};o.push([`enter`,e,a]),o.push(...i.leadingChildEvents),o.push(...i.termChildEvents),o.push(...i.trailingChildEvents),o.push([`exit`,e,a])}else o.push(...i.leadingChildEvents),o.push(...i.trailingChildEvents);return J(e,n,1,[]),J(e,t,1,o),e}const Sf=new Set([`linePrefix`,`blockQuotePrefix`,`blockQuoteMarker`,`blockQuotePrefixWhitespace`]),Cf={name:`defList`,tokenize:Mf,continuation:{tokenize:Nf},resolveAll:Df,exit:If},wf={tokenize:Ff,partial:!0},Tf={tokenize:Pf,partial:!0},Ef={document:{58:Cf,null:[]}};function Df(e,t){let n=0;for(;n<e.length;){let r=e[n];r[0]===`enter`&&r[1].type===$.defList&&(n+=Of(n,e,t)),n++}let r=[];for(n=0;n<e.length;){let t=e[n];if(t[0]===`enter`&&t[1].type===$.defList&&r.push(t[1]),t[0]===`exit`&&t[1].type===$.defList){let i=!1,a=1;for(;n+a<e.length;){let t=e[n+a];if(t[0]===`enter`&&t[1].type===$.defList){i=!0;break}if(!Sf.has(t[1].type))break;a++}i?(t[1].end=Object.assign({},e[n+a][1].end),J(e,n,a+1,[]),n-=a):t[1]=r.pop()}n++}return e}function Of(e,t,n){let r=0,i,a=!0,o=e+1;for(o+=Af(e,t);o<t.length;){let l=t[o];if(l[0]===`enter`&&l[1].type===$.defList&&(o+=Of(o,t,n)),l[0]===`exit`&&l[1].type===$.defList){o+=c(o,t),i=void 0,r=o-e;break}if(l[0]===`exit`&&l[1].type===$.defListDescriptionPrefix&&(a||(o+=c(o,t),i=void 0),o+=s(o,t,l[1]._loose),a=!1),l[0]===`enter`&&l[1].type===$.defListDescriptionPrefix){if(t[o-1][1].type===`lineEndingBlank`)l[1]._loose=!0;else if(t[o-1][1].type===`chunkFlow`){let e=t[o-1][1]._tokenizer.events;e[e.length-1][1].type===`lineEndingBlank`&&(l[1]._loose=!0)}}o++}return r;function s(e,t,r){return i={type:$.defListDescription,start:Object.assign({},t[e+1][1].start),end:Object.assign({},t[e+1][1].end),_loose:r},J(t,e+1,0,[[`enter`,i,n]]),1}function c(e,t){return i.end=Object.assign({},t[e-1][1].end),J(t,e,0,[[`exit`,i,n]]),1}}function kf(e,t,n,r){let i=e[t][2],a=yf(e[t][1]).paragraph;if(a==null){let t=e[n],r={type:$.defListTerm,start:Object.assign({},t[1].start),end:Object.assign({},t[1].start)};return J(e,n,0,[[`enter`,r,i],[`exit`,r,i]]),n}let o=e[t][2].parser.lazy,s=0,c;for(let n=t;n>=0;n--){let t=e[n];if(t[1].type!==`chunkFlow`){s=n+1;break}if(t[1].start.offset<a.startOffset){s=n+1;break}if(t[0]===`exit`){if(r&&!o[t[1].start.line]){s=n+1;break}c=n}else xf(e,n,c),c=void 0}return s}function Af(e,t){let n,r,i;for(let a=e-1;a>=0;a--)if(!Sf.has(t[a][1].type)){if(a===e-1&&t[a][1].type===`blockQuote`&&t[a][0]===`exit`){i=a,r=t[a];continue}t[a][1].type===`chunkFlow`&&(n=a);break}let a=t[e];J(t,e,1,[]),i!=null&&J(t,i,1,[]);let o=kf(t,n,e,r!=null);return i!=null&&(r[1].end=Object.assign({},t[o-1][1].end),J(t,o,0,[r]),o+=1),a[1].start=Object.assign({},t[o][1].start),J(t,o,0,[a]),o-e}function jf(e){if(e.length<=1)return!1;let t=e[e.length-1][2].parser.lazy,n=!1,r,i;for(let t=e.length-1;t>=0;t--){let a=e[t];if(!Sf.has(a[1].type)){if(t===e.length-1&&a[1].type===`blockQuote`&&a[0]===`exit`){n=!0;continue}if(a[1].type===`chunkFlow`)a[0]===`enter`&&(i??=a[1]._tokenizer?.events,r=a);else break}}if(i!=null&&r!=null){let e=0;for(let a=i.length-1;a>=0;a--){let o=i[a],s=o[1];if(s.start.offset<r[1].start.offset)break;if(o[0]===`enter`&&s.type===`lineEndingBlank`){if(e>=1)break;e++}if(s.type!==`lineEnding`&&s.type!==`linePrefix`&&s.type!==`lineEndingBlank`&&s.type!==`content`)return n&&!t[s.end.line]?!1:s.type===`paragraph`||s.type===`chunkContent`||s.type===`tableHead`||s.type===`tableRow`}}return!1}function Mf(e,t,n){let r=this;r.containerState??={};let i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0;if(r.containerState.type==null){if(jf(r.events))e.enter($.defList,{_container:!0}),r.containerState.type=$.defList;else return n}return o;function o(t){return t===58?(e.enter($.defListDescriptionPrefix,{_loose:r.containerState?.lastBlankLine}),r.containerState.lastBlankLine=void 0,e.enter($.defListDescriptionMarker),e.consume(t),e.exit($.defListDescriptionMarker),e.check(Ks,s,e.attempt(wf,l,c))):n(t)}function s(e){return r.containerState.initialBlankLine=!0,a++,l(e)}function c(t){return Z(t)?(e.enter($.defListDescriptionPrefixWhitespace),e.consume(t),e.exit($.defListDescriptionPrefixWhitespace),l):n(t)}function l(n){return r.containerState.size=a+r.sliceSerialize(e.exit($.defListDescriptionPrefix),!0).length,t(n)}}function Nf(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ks,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines??r.containerState.initialBlankLine,r.containerState.lastBlankLine=!0,Q(e,t,`linePrefix`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines??!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,r.containerState.lastBlankLine=void 0,e.attempt(Tf,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(Cf,t,n),`linePrefix`,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Pf(e,t,n){let r=this;return Q(e,i,`linePrefix`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`linePrefix`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Ff(e,t,n){let r=this;return Q(e,i,$.defListDescriptionPrefixWhitespace,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===$.defListDescriptionPrefixWhitespace?t(e):n(e)}}function If(e){e.exit($.defList)}const Lf=(e,t,n)=>{let r=e.all(t),i=[];for(let e=0;e<r.length;e++)i.push(vf(`text`,`
293
+ `)),i.push(r[e]);r.length>0&&i.push(vf(`text`,`
294
+ `));let a={type:`element`,tagName:`dl`,children:i,properties:{}};return e.patch(t,a),a},Rf=(e,t,n)=>{let r={type:`element`,tagName:`dt`,properties:{},children:e.all(t)};return e.patch(t,r),r},zf=(e,t,n)=>{let r=[],i=e.all(t);for(let e=0;e<i.length;e++){let n=i[e];(t.spread||e!==0||n.type!==`element`||n.tagName!==`p`)&&r.push(vf(`text`,`
295
+ `)),!t.spread&&n.type===`element`&&n.tagName===`p`?r.push(...n.children):r.push(n)}let a=r[r.length-1];a&&(t.spread||!(`tagName`in a)||a.tagName!==`p`)&&r.push(vf(`text`,`
296
+ `));let o={type:`element`,tagName:`dd`,properties:{},children:r};return e.patch(t,o),o},Bf={[$.defList]:Lf,[$.defListTerm]:Rf,[$.defListDescription]:zf},Vf=Ju([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Hf(){let e=this.data(),t=e.micromarkExtensions??=[],n=e.fromMarkdownExtensions??=[],r=e.toMarkdownExtensions??=[];t.push(Ef),n.push(uf),r.push(_f)}function Uf(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Wf=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Gf={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Kf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function qf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Jf(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Yf(e){return Jf(e)||Kf(e)}const Xf=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Zf(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Yf:u===`decimal`?Kf:qf;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Wf.includes(y)&&(_=y,v=ps(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&ps(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1)){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Yf(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Qf(e))h(7,S),C=`�`;else if(e in Gf)h(6,S),C=Gf[e];else{let t=``;$f(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Xf[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Qf(e){return e>=55296&&e<=57343||e>1114111}function $f(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const ep=/["&'<>`]/g,tp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,np=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rp=/[|\\{}()[\]^$+*?.]/g,ip=new WeakMap;function ap(e,t){if(e=e.replace(t.subset?op(t.subset):ep,r),t.subset||t.escapeOnly)return e;return e.replace(tp,n).replace(np,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function op(e){let t=ip.get(e);return t||(t=sp(e),ip.set(e,t)),t}function sp(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(rp,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function cp(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function lp(e,t){return ap(e,Object.assign({format:cp},t))}const up={}.hasOwnProperty,dp={},fp=/^[^\t\n\r "#'.<=>`}]+$/,pp=/^[^\t\n\r "'<=>`}]+$/;function mp(){return{canContainEols:[`textDirective`],enter:{directiveContainer:gp,directiveContainerAttributes:Cp,directiveContainerLabel:xp,directiveLeaf:_p,directiveLeafAttributes:Cp,directiveText:vp,directiveTextAttributes:Cp},exit:{directiveContainer:kp,directiveContainerAttributeClassValue:Tp,directiveContainerAttributeIdValue:wp,directiveContainerAttributeName:Dp,directiveContainerAttributeValue:Ep,directiveContainerAttributes:Op,directiveContainerLabel:Sp,directiveContainerName:bp,directiveLeaf:kp,directiveLeafAttributeClassValue:Tp,directiveLeafAttributeIdValue:wp,directiveLeafAttributeName:Dp,directiveLeafAttributeValue:Ep,directiveLeafAttributes:Op,directiveLeafName:bp,directiveText:kp,directiveTextAttributeClassValue:Tp,directiveTextAttributeIdValue:wp,directiveTextAttributeName:Dp,directiveTextAttributeValue:Ep,directiveTextAttributes:Op,directiveTextName:bp}}}function hp(e){let t=e||dp;if(t.quote!==`"`&&t.quote!==`'`&&t.quote!==null&&t.quote!==void 0)throw Error("Invalid quote `"+t.quote+"`, expected `'` or `\"`");return n.peek=Ap,{handlers:{containerDirective:n,leafDirective:n,textDirective:n},unsafe:[{character:`\r`,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{character:`
297
+ `,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{before:`[^:]`,character:`:`,after:`[A-Za-z]`,inConstruct:[`phrasing`]},{atBreak:!0,character:`:`,after:`:`}]};function n(e,t,n,i){let a=n.createTracker(i),o=Mp(e),s=n.enter(e.type),c=a.move(o+(e.name||``)),l;if(e.type===`containerDirective`){let t=(e.children||[])[0];l=jp(t)?t:void 0}else l=e;if(l&&l.children&&l.children.length>0){let t=n.enter(`label`),r=`${e.type}Label`,i=n.enter(r);c+=a.move(`[`),c+=a.move(n.containerPhrasing(l,{...a.current(),before:c,after:`]`})),c+=a.move(`]`),i(),t()}if(c+=a.move(r(e,n)),e.type===`containerDirective`){let t=(e.children||[])[0],r=e;jp(t)&&(r=Object.assign({},e,{children:e.children.slice(1)})),r&&r.children&&r.children.length>0&&(c+=a.move(`
298
298
  `),c+=a.move(n.containerFlow(r,a.current()))),c+=a.move(`
299
- `+o)}return s(),c}function r(e,n){let r=e.attributes||{},a=[],o,s,c,l;for(l in r)if(sp.call(r,l)&&r[l]!==void 0&&r[l]!==null){let u=String(r[l]);if(l===`id`)c=t.preferShortcut!==!1&&lp.test(u)?`#`+u:i(`id`,u,e,n);else if(l===`class`){let r=u.split(/[\t\n\r ]+/g),a=[],c=[],l=-1;for(;++l<r.length;)(t.preferShortcut!==!1&&lp.test(r[l])?c:a).push(r[l]);o=a.length>0?i(`class`,a.join(` `),e,n):``,s=c.length>0?`.`+c.join(`.`):``}else a.push(i(l,u,e,n))}return o&&a.unshift(o),s&&a.unshift(s),c&&a.unshift(c),a.length>0?`{`+a.join(` `)+`}`:``}function i(e,n,r,i){if(t.collapseEmptyAttributes!==!1&&!n)return e;if(t.preferUnquoted&&up.test(n))return e+`=`+n;let a=t.quote||i.options.quote||`"`,o=a===`"`?`'`:`"`,s=t.quoteSmart&&Bf(n,a)>Bf(n,o)?o:a,c=r.type===`textDirective`?[s]:[s,`
300
- `,`\r`];return e+`=`+s+op(n,{subset:c})+s}}function pp(e){gp.call(this,`containerDirective`,e)}function mp(e){gp.call(this,`leafDirective`,e)}function hp(e){gp.call(this,`textDirective`,e)}function gp(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function _p(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function vp(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function yp(e){this.exit(e)}function bp(){this.data.directiveAttributes=[],this.buffer()}function xp(e){this.data.directiveAttributes.push([`id`,Jf(this.sliceSerialize(e),{attribute:!0})])}function Sp(e){this.data.directiveAttributes.push([`class`,Jf(this.sliceSerialize(e),{attribute:!0})])}function Cp(e){let t=this.data.directiveAttributes;t[t.length-1][1]=Jf(this.sliceSerialize(e),{attribute:!0})}function wp(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function Tp(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function Ep(e){this.exit(e)}function Dp(){return`:`}function Op(e){return!!(e&&e.type===`paragraph`&&e.data&&e.data.directiveLabel)}function kp(e){let t=0;return e.type===`containerDirective`?(td(e,function(e,n){if(e.type===`containerDirective`){let e=n.length,r=0;for(;e--;)n[e].type===`containerDirective`&&r++;r>t&&(t=r)}}),t+=3):t=e.type===`leafDirective`?2:1,`:`.repeat(t)}function Ap(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&Z(t)?Q(e,v,`whitespace`)(t):!m&&X(t)?wc(e,v)(t):t===null||Y(t)||Ds(t)||Es(t)&&t!==45&&t!==95?A(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||X(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||X(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||Y(t)||Ds(t)||Es(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&Z(t)?Q(e,C,`whitespace`)(t):!m&&X(t)?wc(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&Y(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&Z(t)?Q(e,w,`whitespace`)(t):!m&&X(t)?wc(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||X(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),k):(e.enter(d),D(t))}function D(t){return t===g?(e.exit(d),E(t)):t===null?n(t):Y(t)?m?n(t):wc(e,D)(t):(e.enter(p),e.consume(t),O)}function O(t){return t===g||t===null||Y(t)?(e.exit(p),D(t)):(e.consume(t),O)}function k(e){return e===125||X(e)?v(e):A(e)}function A(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function jp(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):Y(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function Mp(e,t,n,r){let i=this;return a;function a(t){return t===null||Y(t)||Es(t)||Ds(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||Y(a)||Ds(a)||Es(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}const Np={tokenize:Lp,concrete:!0},Pp={tokenize:Rp,partial:!0},Fp={tokenize:zp,partial:!0},Ip={tokenize:Bp,partial:!0};function Lp(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),Mp.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(Pp,d,d)(t):d(t)}function d(t){return t===123?e.attempt(Fp,f,f)(t):f(t)}function f(t){return Q(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):Y(i)?r.interrupt?t(i):e.attempt(Ip,m,C)(i):n(i)}function m(t){return t===null?C(t):Y(t)?e.check(Ip,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?Q(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):Y(t)?e.check(Ip,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return Y(t)?e.check(Ip,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function Rp(e,t,n){return jp(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function zp(e,t,n){return Ap(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function Bp(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Vp={tokenize:Wp},Hp={tokenize:Gp,partial:!0},Up={tokenize:Kp,partial:!0};function Wp(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),Mp.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(Hp,s,s)(t):s(t)}function s(t){return t===123?e.attempt(Up,c,c)(t):c(t)}function c(t){return Q(e,l,`whitespace`)(t)}function l(r){return r===null||Y(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function Gp(e,t,n){return jp(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function Kp(e,t,n){return Ap(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}const qp={tokenize:Zp,previous:Xp},Jp={tokenize:Qp,partial:!0},Yp={tokenize:$p,partial:!0};function Xp(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function Zp(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),Mp.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(Jp,o,o)(t):o(t)}function o(t){return t===123?e.attempt(Yp,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function Qp(e,t,n){return jp(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function $p(e,t,n){return Ap(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function em(){return{text:{58:qp},flow:{58:[Np,Vp]}}}function tm(){let e=this.data(),t=e.micromarkExtensions||=[],n=e.fromMarkdownExtensions||=[],r=e.toMarkdownExtensions||=[];t.push(em()),n.push(dp()),r.push(fp())}function nm(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function rm(e,t,n){let r=Ku((n||{}).ignore||[]),i=im(t),a=-1;for(;++a<i.length;)td(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function im(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([am(e[0]),om(e[1])])}return t}function am(e){return typeof e==`string`?new RegExp(nm(e),`g`):e}function om(e){return typeof e==`function`?e:function(){return e}}const sm=`phrasing`,cm=[`autolink`,`link`,`image`,`label`];function lm(){return{transforms:[_m],enter:{literalAutolink:dm,literalAutolinkEmail:fm,literalAutolinkHttp:fm,literalAutolinkWww:fm},exit:{literalAutolink:gm,literalAutolinkEmail:hm,literalAutolinkHttp:pm,literalAutolinkWww:mm}}}function um(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:sm,notInConstruct:cm},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:sm,notInConstruct:cm},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:sm,notInConstruct:cm}]}}function dm(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function fm(e){this.config.enter.autolinkProtocol.call(this,e)}function pm(e){this.config.exit.autolinkProtocol.call(this,e)}function mm(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function hm(e){this.config.exit.autolinkEmail.call(this,e)}function gm(e){this.exit(e)}function _m(e){rm(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vm],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ym]],{ignore:[`link`,`linkReference`]})}function vm(e,t,n,r,i){let a=``;if(!Sm(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!bm(n)))return!1;let o=xm(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function ym(e,t,n,r){return!Sm(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function bm(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function xm(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Bf(e,`(`),a=Bf(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Sm(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Ds(n)||Es(n))&&(!t||n!==47)}Mm.peek=jm;function Cm(){this.buffer()}function wm(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Tm(){this.buffer()}function Em(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Dm(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Om(e){this.exit(e)}function km(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Am(e){this.exit(e)}function jm(){return`[`}function Mm(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Nm(){return{enter:{gfmFootnoteCallString:Cm,gfmFootnoteCall:wm,gfmFootnoteDefinitionLabelString:Tm,gfmFootnoteDefinition:Em},exit:{gfmFootnoteCallString:Dm,gfmFootnoteCall:Om,gfmFootnoteDefinitionLabelString:km,gfmFootnoteDefinition:Am}}}function Pm(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Mm},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
301
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Im:Fm))),s(),o}}function Fm(e,t,n){return t===0?e:Im(e,t,n)}function Im(e,t,n){return(n?``:` `)+e}const Lm=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Hm.peek=Um;function Rm(){return{canContainEols:[`delete`],enter:{strikethrough:Bm},exit:{strikethrough:Vm}}}function zm(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Lm}],handlers:{delete:Hm}}}function Bm(e){this.enter({type:`delete`,children:[]},e)}function Vm(e){this.exit(e)}function Hm(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Um(){return`~`}function Wm(e){return e.length}function Gm(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Wm,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Km(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=qm(r[d]);else{let e=qm(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
302
- `)}function Km(e){return e==null?``:String(e)}function qm(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Jm(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Ym);return i(),o}function Ym(e,t,n){return`>`+(n?``:` `)+e}function Xm(e,t){return Zm(e,t.inConstruct,!0)&&!Zm(e,t.notInConstruct,!1)}function Zm(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Qm(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
303
- `&&Xm(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
304
- `}function $m(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function eh(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function th(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function nh(e,t,n,r){let i=th(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(eh(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,rh);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max($m(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
299
+ `+o)}return s(),c}function r(e,n){let r=e.attributes||{},a=[],o,s,c,l;for(l in r)if(up.call(r,l)&&r[l]!==void 0&&r[l]!==null){let u=String(r[l]);if(l===`id`)c=t.preferShortcut!==!1&&fp.test(u)?`#`+u:i(`id`,u,e,n);else if(l===`class`){let r=u.split(/[\t\n\r ]+/g),a=[],c=[],l=-1;for(;++l<r.length;)(t.preferShortcut!==!1&&fp.test(r[l])?c:a).push(r[l]);o=a.length>0?i(`class`,a.join(` `),e,n):``,s=c.length>0?`.`+c.join(`.`):``}else a.push(i(l,u,e,n))}return o&&a.unshift(o),s&&a.unshift(s),c&&a.unshift(c),a.length>0?`{`+a.join(` `)+`}`:``}function i(e,n,r,i){if(t.collapseEmptyAttributes!==!1&&!n)return e;if(t.preferUnquoted&&pp.test(n))return e+`=`+n;let a=t.quote||i.options.quote||`"`,o=a===`"`?`'`:`"`,s=t.quoteSmart&&Uf(n,a)>Uf(n,o)?o:a,c=r.type===`textDirective`?[s]:[s,`
300
+ `,`\r`];return e+`=`+s+lp(n,{subset:c})+s}}function gp(e){yp.call(this,`containerDirective`,e)}function _p(e){yp.call(this,`leafDirective`,e)}function vp(e){yp.call(this,`textDirective`,e)}function yp(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function bp(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function xp(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function Sp(e){this.exit(e)}function Cp(){this.data.directiveAttributes=[],this.buffer()}function wp(e){this.data.directiveAttributes.push([`id`,Zf(this.sliceSerialize(e),{attribute:!0})])}function Tp(e){this.data.directiveAttributes.push([`class`,Zf(this.sliceSerialize(e),{attribute:!0})])}function Ep(e){let t=this.data.directiveAttributes;t[t.length-1][1]=Zf(this.sliceSerialize(e),{attribute:!0})}function Dp(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function Op(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function kp(e){this.exit(e)}function Ap(){return`:`}function jp(e){return!!(e&&e.type===`paragraph`&&e.data&&e.data.directiveLabel)}function Mp(e){let t=0;return e.type===`containerDirective`?(id(e,function(e,n){if(e.type===`containerDirective`){let e=n.length,r=0;for(;e--;)n[e].type===`containerDirective`&&r++;r>t&&(t=r)}}),t+=3):t=e.type===`leafDirective`?2:1,`:`.repeat(t)}function Np(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&Z(t)?Q(e,v,`whitespace`)(t):!m&&X(t)?Ec(e,v)(t):t===null||Y(t)||ks(t)||Os(t)&&t!==45&&t!==95?A(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||X(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||X(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||Y(t)||ks(t)||Os(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&Z(t)?Q(e,C,`whitespace`)(t):!m&&X(t)?Ec(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&Y(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&Z(t)?Q(e,w,`whitespace`)(t):!m&&X(t)?Ec(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||X(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),k):(e.enter(d),D(t))}function D(t){return t===g?(e.exit(d),E(t)):t===null?n(t):Y(t)?m?n(t):Ec(e,D)(t):(e.enter(p),e.consume(t),O)}function O(t){return t===g||t===null||Y(t)?(e.exit(p),D(t)):(e.consume(t),O)}function k(e){return e===125||X(e)?v(e):A(e)}function A(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function Pp(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):Y(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function Fp(e,t,n,r){let i=this;return a;function a(t){return t===null||Y(t)||Os(t)||ks(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||Y(a)||ks(a)||Os(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}const Ip={tokenize:Bp,concrete:!0},Lp={tokenize:Vp,partial:!0},Rp={tokenize:Hp,partial:!0},zp={tokenize:Up,partial:!0};function Bp(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),Fp.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(Lp,d,d)(t):d(t)}function d(t){return t===123?e.attempt(Rp,f,f)(t):f(t)}function f(t){return Q(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):Y(i)?r.interrupt?t(i):e.attempt(zp,m,C)(i):n(i)}function m(t){return t===null?C(t):Y(t)?e.check(zp,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?Q(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):Y(t)?e.check(zp,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return Y(t)?e.check(zp,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function Vp(e,t,n){return Pp(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function Hp(e,t,n){return Np(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function Up(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Wp={tokenize:qp},Gp={tokenize:Jp,partial:!0},Kp={tokenize:Yp,partial:!0};function qp(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),Fp.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(Gp,s,s)(t):s(t)}function s(t){return t===123?e.attempt(Kp,c,c)(t):c(t)}function c(t){return Q(e,l,`whitespace`)(t)}function l(r){return r===null||Y(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function Jp(e,t,n){return Pp(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function Yp(e,t,n){return Np(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}const Xp={tokenize:em,previous:$p},Zp={tokenize:tm,partial:!0},Qp={tokenize:nm,partial:!0};function $p(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function em(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),Fp.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(Zp,o,o)(t):o(t)}function o(t){return t===123?e.attempt(Qp,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function tm(e,t,n){return Pp(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function nm(e,t,n){return Np(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function rm(){return{text:{58:Xp},flow:{58:[Ip,Wp]}}}function im(){let e=this.data(),t=e.micromarkExtensions||=[],n=e.fromMarkdownExtensions||=[],r=e.toMarkdownExtensions||=[];t.push(rm()),n.push(mp()),r.push(hp())}function am(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function om(e,t,n){let r=Ju((n||{}).ignore||[]),i=sm(t),a=-1;for(;++a<i.length;)id(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function sm(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([cm(e[0]),lm(e[1])])}return t}function cm(e){return typeof e==`string`?new RegExp(am(e),`g`):e}function lm(e){return typeof e==`function`?e:function(){return e}}const um=`phrasing`,dm=[`autolink`,`link`,`image`,`label`];function fm(){return{transforms:[bm],enter:{literalAutolink:mm,literalAutolinkEmail:hm,literalAutolinkHttp:hm,literalAutolinkWww:hm},exit:{literalAutolink:ym,literalAutolinkEmail:vm,literalAutolinkHttp:gm,literalAutolinkWww:_m}}}function pm(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:um,notInConstruct:dm},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:um,notInConstruct:dm},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:um,notInConstruct:dm}]}}function mm(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function hm(e){this.config.enter.autolinkProtocol.call(this,e)}function gm(e){this.config.exit.autolinkProtocol.call(this,e)}function _m(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function vm(e){this.config.exit.autolinkEmail.call(this,e)}function ym(e){this.exit(e)}function bm(e){om(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xm],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Sm]],{ignore:[`link`,`linkReference`]})}function xm(e,t,n,r,i){let a=``;if(!Tm(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Cm(n)))return!1;let o=wm(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Sm(e,t,n,r){return!Tm(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Cm(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function wm(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Uf(e,`(`),a=Uf(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Tm(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||ks(n)||Os(n))&&(!t||n!==47)}Fm.peek=Pm;function Em(){this.buffer()}function Dm(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Om(){this.buffer()}function km(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Am(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jm(e){this.exit(e)}function Mm(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Nm(e){this.exit(e)}function Pm(){return`[`}function Fm(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Im(){return{enter:{gfmFootnoteCallString:Em,gfmFootnoteCall:Dm,gfmFootnoteDefinitionLabelString:Om,gfmFootnoteDefinition:km},exit:{gfmFootnoteCallString:Am,gfmFootnoteCall:jm,gfmFootnoteDefinitionLabelString:Mm,gfmFootnoteDefinition:Nm}}}function Lm(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fm},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
301
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?zm:Rm))),s(),o}}function Rm(e,t,n){return t===0?e:zm(e,t,n)}function zm(e,t,n){return(n?``:` `)+e}const Bm=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Gm.peek=Km;function Vm(){return{canContainEols:[`delete`],enter:{strikethrough:Um},exit:{strikethrough:Wm}}}function Hm(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Bm}],handlers:{delete:Gm}}}function Um(e){this.enter({type:`delete`,children:[]},e)}function Wm(e){this.exit(e)}function Gm(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Km(){return`~`}function qm(e){return e.length}function Jm(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||qm,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Ym(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Xm(r[d]);else{let e=Xm(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
302
+ `)}function Ym(e){return e==null?``:String(e)}function Xm(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Zm(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Qm);return i(),o}function Qm(e,t,n){return`>`+(n?``:` `)+e}function $m(e,t){return eh(e,t.inConstruct,!0)&&!eh(e,t.notInConstruct,!1)}function eh(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function th(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
303
+ `&&$m(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
304
+ `}function nh(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function rh(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ih(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ah(e,t,n,r){let i=ih(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(rh(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,oh);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(nh(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
305
305
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
306
306
  `),a&&(u+=s.move(a+`
307
- `)),u+=s.move(c),l(),u}function rh(e,t,n){return(n?``:` `)+e}function ih(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ah(e,t,n,r){let i=ih(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
308
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function oh(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function sh(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function ch(e,t,n){let r=Is(e),i=Is(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}lh.peek=uh;function lh(e,t,n,r){let i=oh(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=ch(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=sh(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=ch(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+sh(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function uh(e,t,n){return n.options.emphasis||`*`}function dh(e,t){let n=!1;return rd(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&os(e)&&(t.options.setext||n))}function fh(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(dh(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
307
+ `)),u+=s.move(c),l(),u}function oh(e,t,n){return(n?``:` `)+e}function sh(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ch(e,t,n,r){let i=sh(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
308
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function lh(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function uh(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function dh(e,t,n){let r=Rs(e),i=Rs(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}fh.peek=ph;function fh(e,t,n,r){let i=lh(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=dh(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=uh(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=dh(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+uh(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ph(e,t,n){return n.options.emphasis||`*`}function mh(e,t){let n=!1;return od(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&cs(e)&&(t.options.setext||n))}function hh(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(mh(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
309
309
  `,after:`
310
310
  `});return r(),t(),o+`
311
311
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
312
312
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
313
- `,...a.current()});return/^[\t ]/.test(l)&&(l=sh(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ph.peek=mh;function ph(e){return e.value||``}function mh(){return`<`}hh.peek=gh;function hh(e,t,n,r){let i=ih(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function gh(){return`!`}_h.peek=vh;function _h(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function vh(){return`!`}yh.peek=bh;function yh(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function bh(){return"`"}function xh(e,t){let n=os(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Sh.peek=Ch;function Sh(e,t,n,r){let i=ih(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(xh(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Ch(e,t,n){return xh(e,n)?`<`:`[`}wh.peek=Th;function wh(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Th(){return`[`}function Eh(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Dh(e){let t=Eh(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Oh(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function kh(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ah(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Oh(n):Eh(n),s=e.ordered?o===`.`?`)`:`.`:Dh(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),kh(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function jh(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Mh(e,t,n,r){let i=jh(n),a=n.bulletCurrent||Eh(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Nh(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Ph(e,t,n,r){return(e.children.some(function(e){return Rf(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Fh(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ih.peek=Lh;function Ih(e,t,n,r){let i=Fh(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=ch(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=sh(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=ch(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+sh(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Lh(e,t,n){return n.options.strong||`*`}function Rh(e,t,n,r){return n.safe(e.value,r)}function zh(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Bh(e,t,n){let r=(kh(n)+(n.options.ruleSpaces?` `:``)).repeat(zh(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Vh={blockquote:Jm,break:Qm,code:nh,definition:ah,emphasis:lh,hardBreak:Qm,heading:fh,html:ph,image:hh,imageReference:_h,inlineCode:yh,link:Sh,linkReference:wh,list:Ah,listItem:Mh,paragraph:Nh,root:Ph,strong:Ih,text:Rh,thematicBreak:Bh};function Hh(){return{enter:{table:Uh,tableData:qh,tableHeader:qh,tableRow:Gh},exit:{codeText:Jh,table:Wh,tableData:Kh,tableHeader:Kh,tableRow:Kh}}}function Uh(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Wh(e){this.exit(e),this.data.inTable=void 0}function Gh(e){this.enter({type:`tableRow`,children:[]},e)}function Kh(e){this.exit(e)}function qh(e){this.enter({type:`tableCell`,children:[]},e)}function Jh(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Yh));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Yh(e,t){return t===`|`?t:e}function Xh(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
313
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=uh(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}gh.peek=_h;function gh(e){return e.value||``}function _h(){return`<`}vh.peek=yh;function vh(e,t,n,r){let i=sh(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function yh(){return`!`}bh.peek=xh;function bh(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function xh(){return`!`}Sh.peek=Ch;function Sh(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Ch(){return"`"}function wh(e,t){let n=cs(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Th.peek=Eh;function Th(e,t,n,r){let i=sh(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(wh(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Eh(e,t,n){return wh(e,n)?`<`:`[`}Dh.peek=Oh;function Dh(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Oh(){return`[`}function kh(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Ah(e){let t=kh(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function jh(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Mh(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Nh(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?jh(n):kh(n),s=e.ordered?o===`.`?`)`:`.`:Ah(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Mh(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Ph(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Fh(e,t,n,r){let i=Ph(n),a=n.bulletCurrent||kh(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Ih(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Lh(e,t,n,r){return(e.children.some(function(e){return Vf(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Rh(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zh.peek=Bh;function zh(e,t,n,r){let i=Rh(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=dh(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=uh(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=dh(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+uh(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Bh(e,t,n){return n.options.strong||`*`}function Vh(e,t,n,r){return n.safe(e.value,r)}function Hh(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Uh(e,t,n){let r=(Mh(n)+(n.options.ruleSpaces?` `:``)).repeat(Hh(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Wh={blockquote:Zm,break:th,code:ah,definition:ch,emphasis:fh,hardBreak:th,heading:hh,html:gh,image:vh,imageReference:bh,inlineCode:Sh,link:Th,linkReference:Dh,list:Nh,listItem:Fh,paragraph:Ih,root:Lh,strong:zh,text:Vh,thematicBreak:Uh};function Gh(){return{enter:{table:Kh,tableData:Xh,tableHeader:Xh,tableRow:Jh},exit:{codeText:Zh,table:qh,tableData:Yh,tableHeader:Yh,tableRow:Yh}}}function Kh(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function qh(e){this.exit(e),this.data.inTable=void 0}function Jh(e){this.enter({type:`tableRow`,children:[]},e)}function Yh(e){this.exit(e)}function Xh(e){this.enter({type:`tableCell`,children:[]},e)}function Zh(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Qh));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Qh(e,t){return t===`|`?t:e}function $h(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
314
314
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
315
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Gm(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Vh.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Zh(){return{exit:{taskListCheckValueChecked:$h,taskListCheckValueUnchecked:$h,paragraph:eg}}}function Qh(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:tg}}}function $h(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function eg(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function tg(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Vh.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ng(){return[lm(),Nm(),Rm(),Hh(),Zh()]}function rg(e){return{extensions:[um(),Pm(e),zm(),Xh(e),Qh()]}}const ig={tokenize:vg,partial:!0},ag={tokenize:yg,partial:!0},og={tokenize:bg,partial:!0},sg={tokenize:xg,partial:!0},cg={tokenize:Sg,partial:!0},lg={name:`wwwAutolink`,tokenize:gg,previous:Cg},ug={name:`protocolAutolink`,tokenize:_g,previous:wg},dg={name:`emailAutolink`,tokenize:hg,previous:Tg},fg={};function pg(){return{text:fg}}let mg=48;for(;mg<123;)fg[mg]=dg,mg++,mg===58?mg=65:mg===91&&(mg=97);fg[43]=dg,fg[45]=dg,fg[46]=dg,fg[95]=dg,fg[72]=[dg,ug],fg[104]=[dg,ug],fg[87]=[dg,lg],fg[119]=[dg,lg];function hg(e,t,n){let r=this,i,a;return o;function o(t){return!Eg(t)||!Tg.call(r,r.previous)||Dg(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Eg(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(cg,u,l)(t):t===45||t===95||bs(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&ys(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function gg(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Cg.call(r,r.previous)||Dg(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(ig,e.attempt(ag,e.attempt(og,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function _g(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&wg.call(r,r.previous)&&!Dg(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ys(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Ss(t)||X(t)||Ds(t)||Es(t)?n(t):e.attempt(ag,e.attempt(og,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function vg(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function yg(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(sg,c,s)(t):t===null||X(t)||Ds(t)||t!==45&&Es(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function bg(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(sg,t,a)(o):o===null||X(o)||Ds(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function xg(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||Ds(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||Ds(e)?t(e):r(e)}function a(e){return ys(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ys(t)?(e.consume(t),o):n(t)}}function Sg(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return bs(e)?n(e):t(e)}}function Cg(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function wg(e){return!ys(e)}function Tg(e){return!(e===47||Eg(e))}function Eg(e){return e===43||e===45||e===46||e===95||bs(e)}function Dg(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Og={tokenize:Ig,partial:!0};function kg(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Ng,continuation:{tokenize:Pg},exit:Fg}},text:{91:{name:`gfmFootnoteCall`,tokenize:Mg},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ag,resolveTo:jg}}}}function Ag(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=vs(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function jg(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Mg(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(vs(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Ng(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=vs(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Pg(e,t,n){return e.check(Ws,t,e.attempt(Og,t,n))}function Fg(e){e.exit(`gfmFootnoteDefinition`)}function Ig(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Lg(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&J(o,o.length,0,Ls(s,e.slice(r+1,n),t)),J(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),J(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Is(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Is(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Rg=class{constructor(){this.map=[]}add(e,t,n){zg(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function zg(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Bg(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Vg(){return{flow:{null:{name:`table`,tokenize:Hg,resolveAll:Ug}}}}function Hg(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Ug(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Rg;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Gg(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Wg(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Wg(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Wg(f,t,o,i,n,d)):(o[0]=o[1],d=Wg(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Gg(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Bg(t.events,n))}return e}function Wg(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Kg(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Kg(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Kg(t.events,n[2]),a=Kg(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Kg(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Gg(e,t,n,r,i){let a=[],o=Kg(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Kg(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const qg={name:`tasklistCheck`,tokenize:Yg};function Jg(){return{text:{91:qg}}}function Yg(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:Xg},t,n)(r):n(r)}}function Xg(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Zg(e){return ms([pg(),kg(),Lg(e),Vg(),Jg()])}const Qg={};function $g(e){let t=this,n=e||Qg,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Zg(n)),a.push(ng()),o.push(rg(n))}const e_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,t_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,n_=({legacyTitle:e=!1,tagName:t=`div`,classNames:n=``}={})=>r=>{rd(r,`blockquote`,(r,i,a)=>{let o=``,s=``,c=!0,l=r.children.map(t=>{if(c&&t.type===`paragraph`){let n=t.children[0],r=n.type===`text`?n.value:``,i=e?t_:e_,a=r.match(i);if(a&&(c=!1,o=a[1].toLocaleLowerCase(),s=e&&a[2]||o.toLocaleUpperCase(),r.includes(`
315
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Jm(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Wh.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function eg(){return{exit:{taskListCheckValueChecked:ng,taskListCheckValueUnchecked:ng,paragraph:rg}}}function tg(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:ig}}}function ng(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function rg(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function ig(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Wh.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ag(){return[fm(),Im(),Vm(),Gh(),eg()]}function og(e){return{extensions:[pm(),Lm(e),Hm(),$h(e),tg()]}}const sg={tokenize:xg,partial:!0},cg={tokenize:Sg,partial:!0},lg={tokenize:Cg,partial:!0},ug={tokenize:wg,partial:!0},dg={tokenize:Tg,partial:!0},fg={name:`wwwAutolink`,tokenize:yg,previous:Eg},pg={name:`protocolAutolink`,tokenize:bg,previous:Dg},mg={name:`emailAutolink`,tokenize:vg,previous:Og},hg={};function gg(){return{text:hg}}let _g=48;for(;_g<123;)hg[_g]=mg,_g++,_g===58?_g=65:_g===91&&(_g=97);hg[43]=mg,hg[45]=mg,hg[46]=mg,hg[95]=mg,hg[72]=[mg,pg],hg[104]=[mg,pg],hg[87]=[mg,fg],hg[119]=[mg,fg];function vg(e,t,n){let r=this,i,a;return o;function o(t){return!kg(t)||!Og.call(r,r.previous)||Ag(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return kg(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(dg,u,l)(t):t===45||t===95||Ss(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&xs(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function yg(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Eg.call(r,r.previous)||Ag(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(sg,e.attempt(cg,e.attempt(lg,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function bg(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Dg.call(r,r.previous)&&!Ag(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(xs(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||ws(t)||X(t)||ks(t)||Os(t)?n(t):e.attempt(cg,e.attempt(lg,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function xg(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Sg(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ug,c,s)(t):t===null||X(t)||ks(t)||t!==45&&Os(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Cg(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ug,t,a)(o):o===null||X(o)||ks(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function wg(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||ks(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||ks(e)?t(e):r(e)}function a(e){return xs(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):xs(t)?(e.consume(t),o):n(t)}}function Tg(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ss(e)?n(e):t(e)}}function Eg(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function Dg(e){return!xs(e)}function Og(e){return!(e===47||kg(e))}function kg(e){return e===43||e===45||e===46||e===95||Ss(e)}function Ag(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const jg={tokenize:zg,partial:!0};function Mg(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Ig,continuation:{tokenize:Lg},exit:Rg}},text:{91:{name:`gfmFootnoteCall`,tokenize:Fg},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ng,resolveTo:Pg}}}}function Ng(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=bs(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Pg(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Fg(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(bs(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Ig(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=bs(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Lg(e,t,n){return e.check(Ks,t,e.attempt(jg,t,n))}function Rg(e){e.exit(`gfmFootnoteDefinition`)}function zg(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Bg(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&J(o,o.length,0,zs(s,e.slice(r+1,n),t)),J(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),J(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Rs(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Rs(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Vg=class{constructor(){this.map=[]}add(e,t,n){Hg(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Hg(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Ug(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Wg(){return{flow:{null:{name:`table`,tokenize:Gg,resolveAll:Kg}}}}function Gg(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Kg(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Vg;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Jg(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=qg(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=qg(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=qg(f,t,o,i,n,d)):(o[0]=o[1],d=qg(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Jg(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Ug(t.events,n))}return e}function qg(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Yg(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Yg(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Yg(t.events,n[2]),a=Yg(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Yg(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Jg(e,t,n,r,i){let a=[],o=Yg(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Yg(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const Xg={name:`tasklistCheck`,tokenize:Qg};function Zg(){return{text:{91:Xg}}}function Qg(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:$g},t,n)(r):n(r)}}function $g(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function e_(e){return gs([gg(),Mg(),Bg(e),Wg(),Zg()])}const t_={};function n_(e){let t=this,n=e||t_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(e_(n)),a.push(ag()),o.push(og(n))}const r_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,i_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,a_=({legacyTitle:e=!1,tagName:t=`div`,classNames:n=``}={})=>r=>{od(r,`blockquote`,(r,i,a)=>{let o=``,s=``,c=!0,l=r.children.map(t=>{if(c&&t.type===`paragraph`){let n=t.children[0],r=n.type===`text`?n.value:``,i=e?i_:r_,a=r.match(i);if(a&&(c=!1,o=a[1].toLocaleLowerCase(),s=e&&a[2]||o.toLocaleUpperCase(),r.includes(`
316
316
  `)&&(t.children[0]={type:`text`,value:r.replace(i,``).replace(/^\n+/,``)}),!r.includes(`
317
- `))){let e=[];t.children.forEach((t,n)=>{n!=0&&(n!=1||t.type!==`break`)&&e.push(t)}),t.children=[...e]}}return t});o&&(r.data={hName:t,hProperties:{className:[`markdown-alert`,`markdown-alert-${o}`,...n.split(` `).filter(e=>e.length)],dir:`auto`}},l.unshift({type:`paragraph`,children:[r_(o),{type:`text`,value:s.replace(/^\//,``)}],data:{hProperties:{className:`markdown-alert-title`,dir:`auto`}}})),r.children=[...l]})};function r_(e){return{type:`emphasis`,data:{hName:`svg`,hProperties:{className:[`octicon`],viewBox:`0 0 16 16`,width:`16`,height:`16`,ariaHidden:`true`}},children:[{type:`emphasis`,data:{hName:`path`,hProperties:{d:i_[e]??``}},children:[]}]}}const i_={note:`M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`,tip:`M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z`,important:`M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,warning:`M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,caution:`M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`};function a_(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function o_(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
318
- `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max($m(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
317
+ `))){let e=[];t.children.forEach((t,n)=>{n!=0&&(n!=1||t.type!==`break`)&&e.push(t)}),t.children=[...e]}}return t});o&&(r.data={hName:t,hProperties:{className:[`markdown-alert`,`markdown-alert-${o}`,...n.split(` `).filter(e=>e.length)],dir:`auto`}},l.unshift({type:`paragraph`,children:[o_(o),{type:`text`,value:s.replace(/^\//,``)}],data:{hProperties:{className:`markdown-alert-title`,dir:`auto`}}})),r.children=[...l]})};function o_(e){return{type:`emphasis`,data:{hName:`svg`,hProperties:{className:[`octicon`],viewBox:`0 0 16 16`,width:`16`,height:`16`,ariaHidden:`true`}},children:[{type:`emphasis`,data:{hName:`path`,hProperties:{d:s_[e]??``}},children:[]}]}}const s_={note:`M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`,tip:`M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z`,important:`M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,warning:`M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,caution:`M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`};function c_(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function l_(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
318
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(nh(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
319
319
  `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
320
320
  `),i&&(c+=a.move(i+`
321
- `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const s_={tokenize:l_,concrete:!0,name:`mathFlow`},c_={tokenize:u_,partial:!0};function l_(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,l,`whitespace`)(t))}function l(t){return t===null||Y(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(c_,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Q(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Y(t)?e.attempt(c_,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Y(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function u_(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function d_(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:f_,previous:p_,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Y(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function f_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function p_(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function m_(e){return{flow:{36:s_},text:{36:d_(e)}}}const h_={};function g_(e){let t=this,n=e||h_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(m_(n)),a.push(a_()),o.push(o_(n))}const __=(function(e){if(e==null)return S_;if(typeof e==`string`)return b_(e);if(typeof e==`object`)return Array.isArray(e)?v_(e):y_(e);if(typeof e==`function`)return x_(e);throw Error(`Expected function, string, or object as test`)});function v_(e){let t=[],n=-1;for(;++n<e.length;)t[n]=__(e[n]);return x_(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function y_(e){return x_(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function b_(e){return x_(t);function t(t){return t&&t.type===e}}function x_(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function S_(){return!0}function C_(e){return e}const w_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=__(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+C_(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=T_(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function T_(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const E_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),w_(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}});function D_(){return e=>{E_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\^/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`superscript`,data:{hName:`sup`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)}),E_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\~/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`subscript`,data:{hName:`sub`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)})}}var O_=class{components={};registerComponent(e,t){this.components[e]=t}getComponent(e){return this.components[e]}};const k_=N(null);function A_({components:e,children:n}){let r=L(()=>{let t=new O_;for(let[n,r]of Object.entries(e))t.registerComponent(n,r);return t},[e]);return t(k_.Provider,{value:r,children:n})}function j_(){return ie(k_)}function M_(e){let t=ie(k_);if(t)return t.getComponent(e)}const N_=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function P_(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function F_(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let I_;function L_(){return I_||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:N_,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:N_}}),e)),I_}function R_({code:e,className:n}){let r=R(null),[i,a]=z(null),[o,s]=z(null),c=ae().replace(/:/g,`_`);return I(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=P_(e),{svg:i}=await(await L_()).render(n,r),o=F_(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-gray-200 dark:bg-gray-700 rounded`})})}function z_(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function B_({runId:e,path:t,parseJson:n=!0}){let{client:r}=ye(),i=Mi(),a=R(r);a.current=r;let o=R(i);o.current=i;let[s,c]=z({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=F(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=z_(t);try{let a=Pi(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);I(()=>{l()},[l]);let u=F(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function V_(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function H_(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function U_(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function W_({code:e}){let{artifactRunId:n}=ea();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=L(()=>V_(e),[e]),i=L(()=>{if(r)return null;let t=H_(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(na,{type:`chart`,fallbackCode:e,children:t(Zi,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}function G_({code:e}){let{artifactRunId:n}=ea();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=L(()=>V_(e),[e]),i=L(()=>{if(r)return null;let t=H_(e);return!t||!U_(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(na,{type:`chart`,fallbackCode:e,children:t(Zi,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function K_({code:e}){let n=e.trim();return n?t(na,{type:`mermaid`,fallbackCode:e,children:t(R_,{code:n})}):t(U,{type:`mermaid`,error:`Empty diagram`})}function q_({code:e}){let n=L(()=>{let t=e.trim();return t?ca(sa(t)):null},[e]);return n?t(na,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(U,{type:`code`,error:`Empty mockup`})}function J_({code:e,language:n}){let{artifactRunId:r}=ea(),i=e.trim(),a=L(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=B_({runId:r,path:i});return r?s?t(U,{type:`expand`,message:`Loading ${i}...`}):c?t(U,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(U,{type:`expand`,error:`No content found in artifact`}):t(da,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(U,{type:`expand`,error:`No artifact run ID available`})}function Y_(e){return e?.startsWith(`expand`)??!1}function X_(){return{chart:G_,"vega-lite":W_,vegalite:W_,mermaid:K_,mockup:q_,svg:q_}}const Z_=new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function Q_(e){return e.trim().replace(/^\/+/,``)}function $_(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Z_.has(n))return{scheme:n,path:Q_(e.slice(t+1))}}return{scheme:`standard`,path:e}}function ev({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ye(),i=Mi(),a=R(r);a.current=r;let o=R(i);o.current=i;let{scheme:s,path:c}=$_(e),[l,u]=z(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Ni(c)?Pi(t,c,n):Fi(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=F(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Ni(c)){let a=Pi(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Fi(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Fi(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);I(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=F(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function tv({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=$_(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(nv,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function nv({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=ev({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(U,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(U,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function rv({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=$_(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(iv,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function iv({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=ev({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(U,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(U,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}function av({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=Hn(l);if(u)return t(ov,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=$_(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(sv,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function ov({resource:e,rawHref:n,artifactRunId:i,className:a,children:o,ExistingLink:s,rest:c}){let l=Bn()(e,{workflowRunId:i,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof s==`function`?t(s,{href:l.href,className:a,...c,children:o}):t(`a`,{href:l.href,...c,className:a,target:`_blank`,rel:`noopener noreferrer`,children:o}):l.kind===`activate`?t(r,{variant:`link`,size:`none`,className:a,onClick:l.onActivate,children:o}):t(`span`,{className:a,children:o})}function sv({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=ev({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(U,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(U,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}const cv=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],lv=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,uv=/`[^`\n]*`/g,dv=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,fv=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function pv(e){return cv.some(t=>e.startsWith(t))}function mv(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&pv(t.slice(1,n).trim()))return e}let n=t.match(fv)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return pv(r)?`<${r}>${i}`:e}function hv(e){return e.replace(lv,(e,t,n,r)=>`${t}${mv(n)}${r}`)}function gv(e){let t=``,n=0;for(let r of e.matchAll(uv))t+=hv(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=hv(e.slice(n)),t}function _v(e){if(!e||!cv.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(dv))t+=gv(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=gv(e.slice(n)),t}const vv=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,yv=/^\w+/;function bv(e){return e?.includes(`:::`)?e.replace(vv,(e,t,n)=>{let r=n.trim(),i=yv.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const xv=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,Sv=/`[^`\n]*`/g,Cv=/\\\$/g,wv=/\\[^\s]/,Tv=/[{}]/,Ev=/[_^][\w{]/,Dv=/^[a-zA-Z]$/,Ov=/^[a-zA-Z]\s*=/,kv=/^\s/,Av=/\s$/,jv=/[+*/-]$/,Mv=/\^[+-]$/;function Nv(e){return wv.test(e)||Tv.test(e)||Ev.test(e)||Dv.test(e)||Ov.test(e)}function Pv(e){return!!(kv.test(e)||Av.test(e)||jv.test(e)&&!Mv.test(e))}function Fv(e){let t=[];for(let n=0;n<e.length;n++)if(e[n]===`$`&&!(n>0&&e[n-1]===`\\`)){if(n+1<e.length&&e[n+1]===`$`){n++;continue}n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)}return t}function Iv(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
322
- `)?null:r}function Lv(e){let t=Fv(e);if(t.length<2)return e;let n=new Set,r=new Set,i=Array(t.length-1);for(let n=0;n<t.length-1;n++)i[n]=Iv(e,t[n],t[n+1]);let a=[];for(let e=0;e<t.length-1;e++){if(n.has(e))continue;let r=i[e];r!==null&&Nv(r)&&(n.add(e),n.add(e+1),a.push([t[e],t[e+1]]))}let o=0;for(;o<t.length;){if(n.has(o)){o++;continue}let e=o+1;for(;e<t.length&&n.has(e);)e++;if(e>=t.length)break;if(e>o+1){r.add(t[o]),o++;continue}let a=i[o];if(a===null){o++;continue}Pv(a)&&(r.add(t[o]),r.add(t[e])),n.add(o),n.add(e),o=e+1}for(let e=0;e<t.length;e++)n.has(e)||e+1<t.length&&n.has(e+1)&&r.add(t[e]);if(r.size===0&&a.length===0)return e;let s=[],c=0,l=Array.from(r).sort((e,t)=>e-t),u=0,d=0;for(;u<l.length||d<a.length;){let t=u<l.length?l[u]:1/0;if(t<(d<a.length?a[d][0]:1/0))t>c&&s.push(e.slice(c,t)),s.push(`\\$`),c=t+1,u++;else{let[t,n]=a[d];t>c&&s.push(e.slice(c,t));let r=e.slice(t,n+1);for(s.push(r.replace(Cv,`\\text{\\textdollar}`)),c=n+1;u<l.length&&l[u]<=n;)u++;d++}}return c<e.length&&s.push(e.slice(c)),s.join(``)}function Rv(e){let t=[],n=0;for(let r of e.matchAll(Sv))t.push(Lv(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(Lv(e.slice(n))),t.join(``)}function zv(e){if(!e?.includes(`$`))return e;let t=[],n=0;for(let r of e.matchAll(xv))t.push(Rv(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(Rv(e.slice(n))),t.join(``)}const Bv={note:`md-callout-info`,tip:`md-callout-info`,warning:`md-callout-attention`,important:`md-callout-attention`,caution:`md-callout-destructive`},Vv={note:`Note`,tip:`Tip`,warning:`Warning`,important:`Important`,caution:`Caution`};function Hv(){return e=>{rd(e,e=>{if(e.type!==`containerDirective`&&e.type!==`leafDirective`&&e.type!==`textDirective`)return;let t=e;t.data||={};let n=t.data,r=t.attributes||{},i=t.name;if(i===`pagebreak`){n.hName=`hr`,n.hProperties={className:`md-pagebreak`};return}if(i===`columns`){n.hName=`div`,n.hProperties={className:`md-columns`};return}if(i===`column`){n.hName=`div`;let e={className:`md-column`};r.width&&(e.style=`flex-basis:${r.width};flex-grow:0;flex-shrink:0`),n.hProperties=e;return}if(i in Bv){n.hName=`div`,n.hProperties={className:`md-callout ${Bv[i]}`,"data-callout-type":i};let e=Vv[i];if(e&&t.children){let n={type:`paragraph`,data:{hName:`p`,hProperties:{className:`md-callout-title`}},children:[{type:`text`,value:e}]};t.children.unshift(n)}return}n.hName=`div`,n.hProperties={className:`md-${i}`,...Object.fromEntries(Object.entries(r).filter(([e])=>e!==`class`))},r.class&&(n.hProperties.className+=` ${r.class}`)})}}const Uv=/(?:^|[^\\])\$/,Wv=[];let Gv,Kv;function qv(){return Kv||=import(`rehype-katex`).then(({default:e})=>(Gv=e,e)),Kv}function Jv(e){let t=M.useMemo(()=>Uv.test(e),[e]),[n,r]=M.useState(()=>Gv);return M.useEffect(()=>{if(!t||n)return;let e=!1;return qv().then(t=>{e||r(()=>t)}).catch(e=>{console.error(`Failed to load KaTeX; math will render unstyled`,e)}),()=>{e=!0}},[t,n]),M.useMemo(()=>n?[n]:Wv,[n])}const Yv=[`artifact:`,`image:`,`store:`,`document:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`];function Xv(e){return Yv.some(t=>e.startsWith(t))?e:of(e)}function Zv(){return e=>{rd(e,`html`,(e,t,n)=>{let r=e,i=n;if(typeof r.value==`string`&&/<!--[\s\S]*?-->/.test(r.value)&&i?.children&&typeof t==`number`)return i.children.splice(t,1),[`skip`,t]})}}const Qv=X_();function $v({children:e,components:n,remarkPlugins:r=[],removeComments:i=!0,artifactRunId:a,onArtifactOpen:o,className:s,codeClassName:c,inlineCodeClassName:l,linkClassName:u,imageClassName:d,onProposalSelect:f,onProposalSubmit:p,preserveSourcePositions:m=!1}){let h=j_(),g=M.useMemo(()=>m?e:bv(_v(zv(e))),[e,m]),_=M.useMemo(()=>{let e=[$g,tm,Hv,n_,zf,D_,g_,...r];return i&&e.push(Zv),e},[r,i]),v=Jv(g),y=M.useMemo(()=>({handlers:{...Lf}}),[]),b=M.useMemo(()=>{let e=n||{},r=e.code,i=e.a,s=e.img,f=({node:e,className:n,children:i,...a})=>{let o=/language-([\w-]+)/.exec(n||``),s=!o,u=o?o[1]:``;if(!s&&u){if(h){let e=h.getComponent(u);if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}if(Y_(u)){let e=String(i||``).trim();return t(J_,{code:e,language:u})}let e=Qv[u];if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}return typeof r==`function`?t(r,{node:e,className:n,...a,children:i}):t(`code`,{...a,className:s?`px-1.5 py-0.5 rounded ${l||``}`:` ${c||``}`,children:i})},p=e=>{let{node:n,href:r,children:s,...c}=e;return t(av,{node:n,href:r,className:u,artifactRunId:a,onArtifactOpen:o,ExistingLink:typeof i==`function`?i:void 0,...c,children:s})},m=e=>{let{node:n,src:r,alt:i,title:o,...c}=e;return o?t(tv,{src:r,alt:i,caption:o,className:d,artifactRunId:a}):t(rv,{node:n,src:r,alt:i,className:d,artifactRunId:a,ExistingImg:typeof s==`function`?s:void 0,...c})};return{...e,code:f,a:p,img:m}},[n,a,o,h,c,l,u,d]),x=t($i,{artifactRunId:a,onProposalSelect:f,onProposalSubmit:p,MarkdownRenderer:$v,children:t(tf,{remarkPlugins:_,rehypePlugins:v,remarkRehypeOptions:y,components:b,urlTransform:Xv,children:g})});return s?t(`div`,{className:`md-content ${s}`,children:x}):t(`div`,{className:`md-content`,children:x})}const ey=new Set([`list`,`blockquote`,`table`]),ty=N(null),ny=N(!1),ry=ne(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownComponentEditor}))),iy=/^ {0,3}(#{1,6})[\t ]+(.+?)[\t ]*#*[\t ]*$/,ay=/^ {0,3}(`{3,}|~{3,})/;function oy(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`edit-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function sy(e,t,n){let r=t?.position?.start.offset,i=t?.position?.end.offset,a=typeof r==`number`&&typeof i==`number`&&r>=0&&i>=r,o=a?e.slice(r,i):``;return{block_id:a?`${n}:${r}:${i}`:`${n}:${oy()}`,block_type:n,...a?{source_range:{start:r,end:i}}:{},exact_text:o,...a&&r>0?{prefix:e.slice(Math.max(0,r-80),r)}:{},...a&&i<e.length?{suffix:e.slice(i,Math.min(e.length,i+80))}:{}}}function cy(e,t){let n=t.source_range?.start;if(typeof n!=`number`)return t;let r=uy(e,n),i=dy(e,t.exact_text,n,r);return{...t,...r.length>0?{heading_path:r}:{},occurrence_index:i}}function ly(e,t,n){return cy(e,sy(e,t,n))}function uy(e,t){let n=[],r=null,i=0;for(let a of e.slice(0,t).split(`
323
- `)){let e=ay.exec(a);if(e){let t=e[1]?.[0];r?t===r&&(r=null):r=t??null,i+=a.length+1;continue}if(!r){let e=iy.exec(a);if(e){let t=e[1]?.length??1,r=e[2]?.trim();r&&(n.length=t-1,n[t-1]=r)}}if(i+=a.length+1,i>t)break}return n.filter(e=>!!e)}function dy(e,t,n,r){if(!t)return 0;let i=0,a=e.indexOf(t);for(;a>=0&&a<n;){let n=uy(e,a);n.length===r.length&&n.every((e,t)=>e===r[t])&&i++,a=e.indexOf(t,a+Math.max(1,t.length))}return i}function fy(e){return e.kind===`store_document`?`store:${e.document_id}`:`artifact:${e.path} (run ${e.run_id})`}function py(...e){let t=0;for(let n of e)for(let e of n.matchAll(/`+/g))t=Math.max(t,e[0].length);return"`".repeat(Math.max(3,t+1))}function my(e,t){let n=t.user_change;if(!n)return;let{before:r,after:i}=n,a=t.anchor.source_range;if(a&&e.slice(a.start,a.end)===r)return e.slice(0,a.start)+i+e.slice(a.end);let o=t.anchor.prefix;if(o){let t=e.indexOf(o+r);if(t>=0&&e.indexOf(o+r,t+1)<0){let n=t+o.length;return e.slice(0,n)+i+e.slice(n+r.length)}}let s=e.indexOf(r);if(!(s<0||e.indexOf(r,s+1)>=0))return e.slice(0,s)+i+e.slice(s+r.length)}function hy(e){let t=fy(e.resource),n=e.anchor.block_type.replace(`_`,` `);if(e.action===`edit`&&e.user_change&&e.applied){let r=py(e.user_change.before,e.user_change.after);return[`I already edited the ${n} in ${t} myself and the change is saved${e.updated_document_id?` as revision ${e.updated_document_id}`:``}.`,`Operation: ${e.operation_id}`,`This is a notification only. Do not apply this change again and do not modify the document in response; acknowledge briefly and use the latest content going forward.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
324
- `)}if(e.action===`edit`&&e.user_change){let r=py(e.user_change.before,e.user_change.after);return[`Apply my edit to the ${n} in ${t}, then update the resource.`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
325
- `)}let r=py(e.anchor.exact_text);return[`Update the ${n} in ${t} based on this comment:`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,e.comment??``,``,`Selected content:`,`${r}markdown`,e.anchor.exact_text,r].join(`
326
- `)}function gy(){let e=ie(ty);if(!e)throw Error(`Collaborative Markdown blocks must be rendered inside CollaborativeMarkdownRenderer`);return e}function _y({anchor:e,mode:i,initialDraft:a}){let{t:o}=B(),{artifactRunId:s,readOnly:c,allowComments:l,cancelEditing:u,submit:d,updateDraft:f}=gy(),[p,m]=z(i===`edit`?e.exact_text:i===`insert`?a??``:``),[h,g]=z(!1),_=i===`comment`?!l:c,v=e=>{m(e),f(e)},y=async()=>{if(!(!p.trim()||h)){g(!0);try{await d(e,i,i===`comment`?p.trim():p)}finally{g(!1)}}};return n(`div`,{className:`mb-2 space-y-2`,children:[i===`edit`||i===`insert`?t(ee,{fallback:t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.editSelectionPlaceholder`),rows:6,autoFocus:!0}),children:t(ry,{value:p,onChange:v,artifactRunId:s,editable:!c,externalValueSync:`manual`,autoFocus:!0})}):t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,disabled:!l}),n(`div`,{className:`flex justify-end gap-2`,children:[n(r,{variant:`outline`,size:`sm`,onClick:u,disabled:h,children:[t(Tt,{className:`me-1 size-4`}),o(`store.cancelEdit`)]}),n(r,{size:`sm`,onClick:()=>void y(),disabled:_||!p.trim()||h,children:[t(vt,{className:`me-1 size-4`}),o(`agent.send`)]})]})]})}function vy(i,a,u){return function({node:d,children:f,...p}){let{t:m}=B(),{markdown:h,readOnly:g,allowComments:_,activeEditing:v,highlightChangesFrom:y,flashChangedBlocks:b,beginEditing:x}=gy(),w=ie(ny),T=u?M.createElement(u,{node:d,...p},f):M.createElement(i,p,f);if(w)return T;let E=sy(h,d,a),D=!!(E.source_range&&E.exact_text),O=!g&&D,k=_&&D,A=v?.anchor.block_id===E.block_id,j=A&&v?.mode===`edit`,ee=b&&!!E.exact_text&&!!y&&!y?.includes(E.exact_text),N=C(`group/collab relative rounded-md border transition-colors duration-700`,`-mx-2 -my-1 px-2 py-1`,j?`border-transparent`:A?`border-info bg-mixer-info/5`:O||k?`border-transparent hover:border-mixer-info/30 hover:bg-mixer-muted/10`:`border-transparent`,ee&&`border-mixer-success/50 bg-mixer-success/15 ring-1 ring-mixer-success/20`),te=O||k||A?n(e,{children:[n(`div`,{className:C(`absolute end-1 top-1 z-10 flex items-center gap-0.5 rounded-md border bg-background p-0.5 shadow-sm`,(!O&&!k||j)&&`hidden`,A?`opacity-100`:`pointer-events-none opacity-0 group-hover/collab:pointer-events-auto group-hover/collab:opacity-100 group-focus-within/collab:pointer-events-auto group-focus-within/collab:opacity-100`),children:[k?t(S,{description:m(`agent.commentOnSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.commentOnSelection`),onClick:()=>x(E,`comment`),children:t(ft,{className:`size-4`})})}):null,O?t(S,{description:m(`agent.editSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.editSelection`),onClick:()=>x(E,`edit`),children:t(mt,{className:`size-4`})})}):null,O?n(o,{children:[t(S,{description:m(`agent.insertComponent`),asChild:!0,children:t(l,{asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.insertComponent`),children:t(gt,{className:`size-4`})})})}),n(s,{align:`end`,className:`w-52`,children:[n(c,{onClick:()=>x(E,`insert`,m(`richText.paragraph`)),children:[t(ht,{}),m(`richText.paragraph`)]}),n(c,{onClick:()=>x(E,`insert`,`## ${m(`richText.heading2`)}`),children:[t(at,{}),m(`richText.heading2`)]}),n(c,{onClick:()=>x(E,`insert`,`- ${m(`richText.bulletList`)}`),children:[t(lt,{}),m(`richText.bulletList`)]}),n(c,{onClick:()=>x(E,`insert`,`> ${m(`richText.blockquote`)}`),children:[t(_t,{}),m(`richText.blockquote`)]}),n(c,{onClick:()=>x(E,`insert`,"```\nCode\n```"),children:[t(Qe,{}),m(`richText.codeBlock`)]}),n(c,{onClick:()=>x(E,`insert`,`| Column | Value |
321
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const u_={tokenize:f_,concrete:!0,name:`mathFlow`},d_={tokenize:p_,partial:!0};function f_(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,l,`whitespace`)(t))}function l(t){return t===null||Y(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(d_,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Q(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Y(t)?e.attempt(d_,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Y(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function p_(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function m_(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:h_,previous:g_,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Y(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function h_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function g_(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function __(e){return{flow:{36:u_},text:{36:m_(e)}}}const v_={};function y_(e){let t=this,n=e||v_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(__(n)),a.push(c_()),o.push(l_(n))}const b_=(function(e){if(e==null)return T_;if(typeof e==`string`)return C_(e);if(typeof e==`object`)return Array.isArray(e)?x_(e):S_(e);if(typeof e==`function`)return w_(e);throw Error(`Expected function, string, or object as test`)});function x_(e){let t=[],n=-1;for(;++n<e.length;)t[n]=b_(e[n]);return w_(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function S_(e){return w_(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function C_(e){return w_(t);function t(t){return t&&t.type===e}}function w_(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function T_(){return!0}function E_(e){return e}const D_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=b_(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+E_(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=O_(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function O_(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const k_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),D_(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}});function A_(){return e=>{k_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\^/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`superscript`,data:{hName:`sup`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)}),k_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\~/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`subscript`,data:{hName:`sub`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)})}}var j_=class{components={};registerComponent(e,t){this.components[e]=t}getComponent(e){return this.components[e]}};const M_=N(null);function N_({components:e,children:n}){let r=R(()=>{let t=new j_;for(let[n,r]of Object.entries(e))t.registerComponent(n,r);return t},[e]);return t(M_.Provider,{value:r,children:n})}function P_(){return re(M_)}function F_(e){let t=re(M_);if(t)return t.getComponent(e)}const I_=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function L_(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function R_(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let z_;function B_(){return z_||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:I_,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:I_}}),e)),z_}function V_({code:e,className:n}){let r=z(null),[i,a]=B(null),[o,s]=B(null),c=ie().replace(/:/g,`_`);return L(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=L_(e),{svg:i}=await(await B_()).render(n,r),o=R_(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-muted rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-muted rounded`})})}function H_(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function U_({runId:e,path:t,parseJson:n=!0}){let{client:r}=ye(),i=Pi(),a=z(r);a.current=r;let o=z(i);o.current=i;let[s,c]=B({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=I(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=H_(t);try{let a=Ii(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);L(()=>{l()},[l]);let u=I(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function W_(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function G_(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function K_(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function q_({code:e}){let{artifactRunId:n}=na();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=R(()=>W_(e),[e]),i=R(()=>{if(r)return null;let t=G_(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(ia,{type:`chart`,fallbackCode:e,children:t($i,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}function J_({code:e}){let{artifactRunId:n}=na();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=R(()=>W_(e),[e]),i=R(()=>{if(r)return null;let t=G_(e);return!t||!K_(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(ia,{type:`chart`,fallbackCode:e,children:t($i,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Y_({code:e}){let n=e.trim();return n?t(ia,{type:`mermaid`,fallbackCode:e,children:t(V_,{code:n})}):t(U,{type:`mermaid`,error:`Empty diagram`})}function X_({code:e}){let n=R(()=>{let t=e.trim();return t?ua(la(t)):null},[e]);return n?t(ia,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(U,{type:`code`,error:`Empty mockup`})}function Z_({code:e,language:n}){let{artifactRunId:r}=na(),i=e.trim(),a=R(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=U_({runId:r,path:i});return r?s?t(U,{type:`expand`,message:`Loading ${i}...`}):c?t(U,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(U,{type:`expand`,error:`No content found in artifact`}):t(pa,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(U,{type:`expand`,error:`No artifact run ID available`})}function Q_(e){return e?.startsWith(`expand`)??!1}function $_(){return{chart:J_,"vega-lite":q_,vegalite:q_,mermaid:Y_,mockup:X_,svg:X_}}const ev=new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function tv(e){return e.trim().replace(/^\/+/,``)}function nv(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(ev.has(n))return{scheme:n,path:tv(e.slice(t+1))}}return{scheme:`standard`,path:e}}function rv({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ye(),i=Pi(),a=z(r);a.current=r;let o=z(i);o.current=i;let{scheme:s,path:c}=nv(e),[l,u]=B(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Fi(c)?Ii(t,c,n):Li(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=I(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Fi(c)){let a=Ii(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Li(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Li(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);L(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=I(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function iv({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=nv(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(av,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function av({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=rv({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(U,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(U,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function ov({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=nv(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(sv,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function sv({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=rv({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(U,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(U,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}function cv({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=Wn(l);if(u)return t(lv,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=nv(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(uv,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function lv({resource:e,rawHref:n,artifactRunId:i,className:a,children:o,ExistingLink:s,rest:c}){let l=Hn()(e,{workflowRunId:i,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof s==`function`?t(s,{href:l.href,className:a,...c,children:o}):t(`a`,{href:l.href,...c,className:a,target:`_blank`,rel:`noopener noreferrer`,children:o}):l.kind===`activate`?t(r,{variant:`link`,size:`none`,className:a,onClick:l.onActivate,children:o}):t(`span`,{className:a,children:o})}function uv({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=rv({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(U,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(U,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}const dv=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],fv=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,pv=/`[^`\n]*`/g,mv=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,hv=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function gv(e){return dv.some(t=>e.startsWith(t))}function _v(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&gv(t.slice(1,n).trim()))return e}let n=t.match(hv)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return gv(r)?`<${r}>${i}`:e}function vv(e){return e.replace(fv,(e,t,n,r)=>`${t}${_v(n)}${r}`)}function yv(e){let t=``,n=0;for(let r of e.matchAll(pv))t+=vv(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=vv(e.slice(n)),t}function bv(e){if(!e||!dv.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(mv))t+=yv(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=yv(e.slice(n)),t}const xv=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,Sv=/^\w+/;function Cv(e){return e?.includes(`:::`)?e.replace(xv,(e,t,n)=>{let r=n.trim(),i=Sv.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const wv=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,Tv=/`[^`\n]*`/g,Ev=/\\\$/g,Dv=/\\[^\s]/,Ov=/[{}]/,kv=/[_^][\w{]/,Av=/^[a-zA-Z]$/,jv=/^[a-zA-Z]\s*=/,Mv=/^\s/,Nv=/\s$/,Pv=/[+*/-]$/,Fv=/\^[+-]$/;function Iv(e){return Dv.test(e)||Ov.test(e)||kv.test(e)||Av.test(e)||jv.test(e)}function Lv(e){return!!(Mv.test(e)||Nv.test(e)||Pv.test(e)&&!Fv.test(e))}function Rv(e){let t=[];for(let n=0;n<e.length;n++)if(e[n]===`$`&&!(n>0&&e[n-1]===`\\`)){if(n+1<e.length&&e[n+1]===`$`){n++;continue}n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)}return t}function zv(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
322
+ `)?null:r}function Bv(e){let t=Rv(e);if(t.length<2)return e;let n=new Set,r=new Set,i=Array(t.length-1);for(let n=0;n<t.length-1;n++)i[n]=zv(e,t[n],t[n+1]);let a=[];for(let e=0;e<t.length-1;e++){if(n.has(e))continue;let r=i[e];r!==null&&Iv(r)&&(n.add(e),n.add(e+1),a.push([t[e],t[e+1]]))}let o=0;for(;o<t.length;){if(n.has(o)){o++;continue}let e=o+1;for(;e<t.length&&n.has(e);)e++;if(e>=t.length)break;if(e>o+1){r.add(t[o]),o++;continue}let a=i[o];if(a===null){o++;continue}Lv(a)&&(r.add(t[o]),r.add(t[e])),n.add(o),n.add(e),o=e+1}for(let e=0;e<t.length;e++)n.has(e)||e+1<t.length&&n.has(e+1)&&r.add(t[e]);if(r.size===0&&a.length===0)return e;let s=[],c=0,l=Array.from(r).sort((e,t)=>e-t),u=0,d=0;for(;u<l.length||d<a.length;){let t=u<l.length?l[u]:1/0;if(t<(d<a.length?a[d][0]:1/0))t>c&&s.push(e.slice(c,t)),s.push(`\\$`),c=t+1,u++;else{let[t,n]=a[d];t>c&&s.push(e.slice(c,t));let r=e.slice(t,n+1);for(s.push(r.replace(Ev,`\\text{\\textdollar}`)),c=n+1;u<l.length&&l[u]<=n;)u++;d++}}return c<e.length&&s.push(e.slice(c)),s.join(``)}function Vv(e){let t=[],n=0;for(let r of e.matchAll(Tv))t.push(Bv(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(Bv(e.slice(n))),t.join(``)}function Hv(e){if(!e?.includes(`$`))return e;let t=[],n=0;for(let r of e.matchAll(wv))t.push(Vv(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(Vv(e.slice(n))),t.join(``)}const Uv={note:`md-callout-info`,tip:`md-callout-info`,warning:`md-callout-attention`,important:`md-callout-attention`,caution:`md-callout-destructive`},Wv={note:`Note`,tip:`Tip`,warning:`Warning`,important:`Important`,caution:`Caution`};function Gv(){return(e,t)=>{od(e,(e,n,r)=>{if(e.type===`textDirective`){let i=e.position?.start.offset,a=e.position?.end.offset;if(r&&n!==void 0&&i!==void 0&&a!==void 0){let o={type:`text`,value:t.toString().slice(i,a),position:e.position};r.children[n]=o}return rd}if(e.type!==`containerDirective`&&e.type!==`leafDirective`)return;let i=e;i.data||={};let a=i.data,o=i.attributes||{},s=i.name;if(s===`pagebreak`){a.hName=`hr`,a.hProperties={className:`md-pagebreak`};return}if(s===`columns`){a.hName=`div`,a.hProperties={className:`md-columns`};return}if(s===`column`){a.hName=`div`;let e={className:`md-column`};o.width&&(e.style=`flex-basis:${o.width};flex-grow:0;flex-shrink:0`),a.hProperties=e;return}if(s in Uv){a.hName=`div`,a.hProperties={className:`md-callout ${Uv[s]}`,"data-callout-type":s};let e=Wv[s];if(e&&i.children){let t={type:`paragraph`,data:{hName:`p`,hProperties:{className:`md-callout-title`}},children:[{type:`text`,value:e}]};i.children.unshift(t)}return}a.hName=`div`,a.hProperties={className:`md-${s}`,...Object.fromEntries(Object.entries(o).filter(([e])=>e!==`class`))},o.class&&(a.hProperties.className+=` ${o.class}`)})}}const Kv=/(?:^|[^\\])\$/,qv=[];let Jv,Yv;function Xv(){return Yv||=import(`rehype-katex`).then(({default:e})=>(Jv=e,e)),Yv}function Zv(e){let t=M.useMemo(()=>Kv.test(e),[e]),[n,r]=M.useState(()=>Jv);return M.useEffect(()=>{if(!t||n)return;let e=!1;return Xv().then(t=>{e||r(()=>t)}).catch(e=>{console.error(`Failed to load KaTeX; math will render unstyled`,e)}),()=>{e=!0}},[t,n]),M.useMemo(()=>n?[n]:qv,[n])}const Qv=[`artifact:`,`image:`,`store:`,`document:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`];function $v(e){return Qv.some(t=>e.startsWith(t))?e:lf(e)}function ey(){return e=>{od(e,`html`,(e,t,n)=>{let r=e,i=n;if(typeof r.value==`string`&&/<!--[\s\S]*?-->/.test(r.value)&&i?.children&&typeof t==`number`)return i.children.splice(t,1),[rd,t]})}}const ty=$_();function ny({children:e,components:n,remarkPlugins:r=[],removeComments:i=!0,artifactRunId:a,onArtifactOpen:o,className:s,codeClassName:c,inlineCodeClassName:l,linkClassName:u,imageClassName:d,onProposalSelect:f,onProposalSubmit:p,preserveSourcePositions:m=!1}){let h=P_(),g=M.useMemo(()=>m?e:Cv(bv(Hv(e))),[e,m]),_=M.useMemo(()=>{let e=[n_,im,Gv,a_,Hf,A_,y_,...r];return i&&e.push(ey),e},[r,i]),v=Zv(g),y=M.useMemo(()=>({handlers:{...Bf}}),[]),b=M.useMemo(()=>{let e=n||{},r=e.code,i=e.a,s=e.img,f=({node:e,className:n,children:i,...a})=>{let o=/language-([\w-]+)/.exec(n||``),s=!o,u=o?o[1]:``;if(!s&&u){if(h){let e=h.getComponent(u);if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}if(Q_(u)){let e=String(i||``).trim();return t(Z_,{code:e,language:u})}let e=ty[u];if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}return typeof r==`function`?t(r,{node:e,className:n,...a,children:i}):t(`code`,{...a,className:s?`px-1.5 py-0.5 rounded ${l||``}`:` ${c||``}`,children:i})},p=e=>{let{node:n,href:r,children:s,...c}=e;return t(cv,{node:n,href:r,className:u,artifactRunId:a,onArtifactOpen:o,ExistingLink:typeof i==`function`?i:void 0,...c,children:s})},m=e=>{let{node:n,src:r,alt:i,title:o,...c}=e;return o?t(iv,{src:r,alt:i,caption:o,className:d,artifactRunId:a}):t(ov,{node:n,src:r,alt:i,className:d,artifactRunId:a,ExistingImg:typeof s==`function`?s:void 0,...c})};return{...e,code:f,a:p,img:m}},[n,a,o,h,c,l,u,d]),x=t(ta,{artifactRunId:a,onProposalSelect:f,onProposalSubmit:p,MarkdownRenderer:ny,children:t(af,{remarkPlugins:_,rehypePlugins:v,remarkRehypeOptions:y,components:b,urlTransform:$v,children:g})});return s?t(`div`,{className:`md-content ${s}`,children:x}):t(`div`,{className:`md-content`,children:x})}const ry=new Set([`list`,`blockquote`,`table`]),iy=N(null),ay=N(!1),oy=te(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownComponentEditor}))),sy=/^ {0,3}(#{1,6})[\t ]+(.+?)[\t ]*#*[\t ]*$/,cy=/^ {0,3}(`{3,}|~{3,})/;function ly(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`edit-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function uy(e,t,n){let r=t?.position?.start.offset,i=t?.position?.end.offset,a=typeof r==`number`&&typeof i==`number`&&r>=0&&i>=r,o=a?e.slice(r,i):``;return{block_id:a?`${n}:${r}:${i}`:`${n}:${ly()}`,block_type:n,...a?{source_range:{start:r,end:i}}:{},exact_text:o,...a&&r>0?{prefix:e.slice(Math.max(0,r-80),r)}:{},...a&&i<e.length?{suffix:e.slice(i,Math.min(e.length,i+80))}:{}}}function dy(e,t){let n=t.source_range?.start;if(typeof n!=`number`)return t;let r=py(e,n),i=my(e,t.exact_text,n,r);return{...t,...r.length>0?{heading_path:r}:{},occurrence_index:i}}function fy(e,t,n){return dy(e,uy(e,t,n))}function py(e,t){let n=[],r=null,i=0;for(let a of e.slice(0,t).split(`
323
+ `)){let e=cy.exec(a);if(e){let t=e[1]?.[0];r?t===r&&(r=null):r=t??null,i+=a.length+1;continue}if(!r){let e=sy.exec(a);if(e){let t=e[1]?.length??1,r=e[2]?.trim();r&&(n.length=t-1,n[t-1]=r)}}if(i+=a.length+1,i>t)break}return n.filter(e=>!!e)}function my(e,t,n,r){if(!t)return 0;let i=0,a=e.indexOf(t);for(;a>=0&&a<n;){let n=py(e,a);n.length===r.length&&n.every((e,t)=>e===r[t])&&i++,a=e.indexOf(t,a+Math.max(1,t.length))}return i}function hy(e){return e.kind===`store_document`?`store:${e.document_id}`:`artifact:${e.path} (run ${e.run_id})`}function gy(...e){let t=0;for(let n of e)for(let e of n.matchAll(/`+/g))t=Math.max(t,e[0].length);return"`".repeat(Math.max(3,t+1))}function _y(e,t){let n=t.user_change;if(!n)return;let{before:r,after:i}=n,a=t.anchor.source_range;if(a&&e.slice(a.start,a.end)===r)return e.slice(0,a.start)+i+e.slice(a.end);let o=t.anchor.prefix;if(o){let t=e.indexOf(o+r);if(t>=0&&e.indexOf(o+r,t+1)<0){let n=t+o.length;return e.slice(0,n)+i+e.slice(n+r.length)}}let s=e.indexOf(r);if(!(s<0||e.indexOf(r,s+1)>=0))return e.slice(0,s)+i+e.slice(s+r.length)}function vy(e){let t=hy(e.resource),n=e.anchor.block_type.replace(`_`,` `);if(e.action===`edit`&&e.user_change&&e.applied){let r=gy(e.user_change.before,e.user_change.after);return[`I already edited the ${n} in ${t} myself and the change is saved${e.updated_document_id?` as revision ${e.updated_document_id}`:``}.`,`Operation: ${e.operation_id}`,`This is a notification only. Do not apply this change again and do not modify the document in response; acknowledge briefly and use the latest content going forward.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
324
+ `)}if(e.action===`edit`&&e.user_change){let r=gy(e.user_change.before,e.user_change.after);return[`Apply my edit to the ${n} in ${t}, then update the resource.`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
325
+ `)}let r=gy(e.anchor.exact_text);return[`Update the ${n} in ${t} based on this comment:`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,e.comment??``,``,`Selected content:`,`${r}markdown`,e.anchor.exact_text,r].join(`
326
+ `)}function yy(){let e=re(iy);if(!e)throw Error(`Collaborative Markdown blocks must be rendered inside CollaborativeMarkdownRenderer`);return e}function by({anchor:e,mode:i,initialDraft:a}){let{t:o}=se(),{artifactRunId:s,readOnly:c,allowComments:l,cancelEditing:u,submit:d,updateDraft:f}=yy(),[p,m]=B(i===`edit`?e.exact_text:i===`insert`?a??``:``),[h,g]=B(!1),_=i===`comment`?!l:c,v=e=>{m(e),f(e)},y=async()=>{if(!(!p.trim()||h)){g(!0);try{await d(e,i,i===`comment`?p.trim():p)}finally{g(!1)}}};return n(`div`,{className:`mb-2 space-y-2`,children:[i===`edit`||i===`insert`?t(ee,{fallback:t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.editSelectionPlaceholder`),rows:6,autoFocus:!0}),children:t(oy,{value:p,onChange:v,artifactRunId:s,editable:!c,externalValueSync:`manual`,autoFocus:!0})}):t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,disabled:!l}),n(`div`,{className:`flex justify-end gap-2`,children:[n(r,{variant:`outline`,size:`sm`,onClick:u,disabled:h,children:[t(Ct,{className:`me-1 size-4`}),o(`store.cancelEdit`)]}),n(r,{size:`sm`,onClick:()=>void y(),disabled:_||!p.trim()||h,children:[t(gt,{className:`me-1 size-4`}),o(`agent.send`)]})]})]})}function xy(i,a,u){return function({node:d,children:f,...p}){let{t:m}=se(),{markdown:h,readOnly:g,allowComments:_,activeEditing:v,highlightChangesFrom:y,flashChangedBlocks:b,beginEditing:x}=yy(),w=re(ay),T=u?M.createElement(u,{node:d,...p},f):M.createElement(i,p,f);if(w)return T;let E=uy(h,d,a),D=!!(E.source_range&&E.exact_text),O=!g&&D,k=_&&D,A=v?.anchor.block_id===E.block_id,j=A&&v?.mode===`edit`,ee=b&&!!E.exact_text&&!!y&&!y?.includes(E.exact_text),N=C(`group/collab relative rounded-md border transition-colors duration-700`,`-mx-2 -my-1 px-2 py-1`,j?`border-transparent`:A?`border-info bg-mixer-info/5`:O||k?`border-transparent hover:border-mixer-info/30 hover:bg-mixer-muted/10`:`border-transparent`,ee&&`border-mixer-success/50 bg-mixer-success/15 ring-1 ring-mixer-success/20`),P=O||k||A?n(e,{children:[n(`div`,{className:C(`absolute end-1 top-1 z-10 flex items-center gap-0.5 rounded-md border bg-background p-0.5 shadow-sm`,(!O&&!k||j)&&`hidden`,A?`opacity-100`:`pointer-events-none opacity-0 group-hover/collab:pointer-events-auto group-hover/collab:opacity-100 group-focus-within/collab:pointer-events-auto group-focus-within/collab:opacity-100`),children:[k?t(S,{description:m(`agent.commentOnSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.commentOnSelection`),onClick:()=>x(E,`comment`),children:t(ut,{className:`size-4`})})}):null,O?t(S,{description:m(`agent.editSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.editSelection`),onClick:()=>x(E,`edit`),children:t(ft,{className:`size-4`})})}):null,O?n(o,{children:[t(S,{description:m(`agent.insertComponent`),asChild:!0,children:t(l,{asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.insertComponent`),children:t(mt,{className:`size-4`})})})}),n(s,{align:`end`,className:`w-52`,children:[n(c,{onClick:()=>x(E,`insert`,m(`richText.paragraph`)),children:[t(pt,{}),m(`richText.paragraph`)]}),n(c,{onClick:()=>x(E,`insert`,`## ${m(`richText.heading2`)}`),children:[t(rt,{}),m(`richText.heading2`)]}),n(c,{onClick:()=>x(E,`insert`,`- ${m(`richText.bulletList`)}`),children:[t(st,{}),m(`richText.bulletList`)]}),n(c,{onClick:()=>x(E,`insert`,`> ${m(`richText.blockquote`)}`),children:[t(ht,{}),m(`richText.blockquote`)]}),n(c,{onClick:()=>x(E,`insert`,"```\nCode\n```"),children:[t(Xe,{}),m(`richText.codeBlock`)]}),n(c,{onClick:()=>x(E,`insert`,`| Column | Value |
327
327
  | --- | --- |
328
- | A | 1 |`),children:[t(bt,{}),m(`richText.table`)]}),n(c,{onClick:()=>x(E,`insert`,`[${m(`agent.insertLink`)}](https://example.com)`),children:[t(ct,{}),m(`agent.insertLink`)]}),n(c,{onClick:()=>x(E,`insert`,'```chart\n{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"category":"A","value":1}]},"mark":"bar","encoding":{"x":{"field":"category","type":"nominal"},"y":{"field":"value","type":"quantitative"}}}\n```'),children:[t(Ge,{}),m(`agent.insertChart`)]})]})]}):null]}),A&&v?t(_y,{anchor:v.anchor,mode:v.mode,initialDraft:v.initialDraft},`${v.anchor.block_id}:${v.mode}:${v.initialDraft??``}`):null]}):null,P=ey.has(a)?t(ny.Provider,{value:!0,children:T}):T;return n(`div`,{className:N,"data-collaborative-block":E.block_id,children:[j?null:P,te]})}}function yy({children:e,resource:i,baseVersion:a,artifactRunId:o,components:s,readOnly:c=!1,allowComments:l=!c,highlightChangesFrom:u,highlightVersion:d=0,onAction:f,className:p,...m}){let{t:h}=B(),[g,_]=z(),[v,y]=z(),[b,S]=z(!1),C=R(``);I(()=>{if(!u||d<=0)return;S(!0);let e=window.setTimeout(()=>S(!1),1800);return()=>window.clearTimeout(e)},[u,d]),I(()=>{let t=g?.anchor.source_range;if(!g||!t||e.slice(t.start,t.end)===g.anchor.exact_text)return;let n=C.current,r=g.mode===`edit`?g.anchor.exact_text:g.mode===`insert`?g.initialDraft??``:``;n.trim()&&n!==r&&y({...g,draft:n}),_(void 0)},[g,e]);let w=L(()=>({...s,p:vy(`p`,`paragraph`,s?.p),h1:vy(`h1`,`heading`,s?.h1),h2:vy(`h2`,`heading`,s?.h2),h3:vy(`h3`,`heading`,s?.h3),h4:vy(`h4`,`heading`,s?.h4),h5:vy(`h5`,`heading`,s?.h5),h6:vy(`h6`,`heading`,s?.h6),ul:vy(`ul`,`list`,s?.ul),ol:vy(`ol`,`list`,s?.ol),blockquote:vy(`blockquote`,`blockquote`,s?.blockquote),pre:vy(`pre`,`code_block`,s?.pre),table:vy(`table`,`table`,s?.table),hr:vy(`hr`,`separator`,s?.hr)}),[s]),T=F((t,n,r)=>{if(n===`comment`&&!l||n!==`comment`&&c)return;let i=cy(e,t);C.current=n===`edit`?i.exact_text:r??``,_({anchor:i,mode:n,initialDraft:r})},[l,e,c]),E=F(()=>{C.current=``,_(void 0)},[]),D=F(e=>{C.current=e},[]),O=F(async(e,t,n)=>{if(t===`comment`&&!l||t!==`comment`&&c)return;let r=t===`insert`?`${e.exact_text.replace(/\s+$/,``)}\n\n${n.trim()}`:n;await f({operation_id:oy(),resource:i,base_version:a,action:t===`insert`?`edit`:t,anchor:e,...t===`comment`?{comment:n}:{user_change:{before:e.exact_text,after:r}}}),C.current=``,_(void 0)},[l,a,f,c,i]),k=L(()=>({markdown:e,artifactRunId:o,readOnly:c,allowComments:l,activeEditing:g,highlightChangesFrom:u,flashChangedBlocks:b,beginEditing:T,cancelEditing:E,updateDraft:D,submit:O}),[g,l,o,T,E,b,u,e,c,O,D]);return n(ty.Provider,{value:k,children:[v?n(`div`,{className:`not-prose mb-3 rounded-md border border-mixer-attention/35 bg-mixer-attention/10 p-3`,children:[n(`div`,{className:`flex items-start justify-between gap-3`,children:[n(`div`,{children:[t(`div`,{className:`text-sm font-semibold text-foreground`,children:h(`agent.documentEditingDraftPreserved`)}),t(`div`,{className:`mt-0.5 text-xs leading-4 text-muted`,children:h(`agent.documentEditingDraftPreservedDescription`)})]}),t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 p-0`,onClick:()=>y(void 0),"aria-label":h(`agent.close`),children:t(Tt,{className:`size-4`})})]}),t(x,{className:`mt-2`,value:v.draft,onChange:e=>y(t=>t&&{...t,draft:e.target.value}),rows:4})]}):null,t($v,{...m,artifactRunId:o,className:p,components:w,preserveSourcePositions:!0,children:e})]})}function by(e){return e.split(/(\s+)/).filter(e=>e.length>0)}function xy(e,t,n){if(!n)return;let r=e[e.length-1];r&&r.type===t?r.text+=n:e.push({type:t,text:n})}function Sy(e,t,n){let r=e.length+1,i=t.length+1,a=new Uint32Array(r*i);for(let n=e.length-1;n>=0;n--)for(let r=t.length-1;r>=0;r--)a[n*i+r]=e[n]===t[r]?a[(n+1)*i+r+1]+1:Math.max(a[(n+1)*i+r],a[n*i+r+1]);let o=0,s=0;for(;o<e.length&&s<t.length;)e[o]===t[s]?(xy(n,`equal`,e[o]),o++,s++):a[(o+1)*i+s]>=a[o*i+s+1]?(xy(n,`removed`,e[o]),o++):(xy(n,`added`,t[s]),s++);xy(n,`removed`,e.slice(o).join(``)),xy(n,`added`,t.slice(s).join(``))}function Cy(e,t){if(e===t)return e?[{type:`equal`,text:e}]:[];let n=by(e),r=by(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)a--,o--;let s=[];xy(s,`equal`,n.slice(0,i).join(``));let c=n.slice(i,a),l=r.slice(i,o);return c.length*l.length>36e4?(xy(s,`removed`,c.join(``)),xy(s,`added`,l.join(``))):Sy(c,l,s),xy(s,`equal`,n.slice(a).join(``)),s}function wy(e,t){let n=[],r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)n.push({type:`equal`,line:e[r]}),r++;let i=e.length,a=t.length,o=[];for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--,o.unshift({type:`equal`,line:e[i]});let s=e.slice(r,i),c=t.slice(r,a);if(s.length*c.length>36e4){for(let e of s)n.push({type:`removed`,line:e});for(let e of c)n.push({type:`added`,line:e});return[...n,...o]}let l=s.length+1,u=c.length+1,d=new Uint32Array(l*u);for(let e=s.length-1;e>=0;e--)for(let t=c.length-1;t>=0;t--)d[e*u+t]=s[e]===c[t]?d[(e+1)*u+t+1]+1:Math.max(d[(e+1)*u+t],d[e*u+t+1]);let f=0,p=0;for(;f<s.length&&p<c.length;)s[f]===c[p]?(n.push({type:`equal`,line:s[f]}),f++,p++):d[(f+1)*u+p]>=d[f*u+p+1]?(n.push({type:`removed`,line:s[f]}),f++):(n.push({type:`added`,line:c[p]}),p++);for(;f<s.length;)n.push({type:`removed`,line:s[f++]});for(;p<c.length;)n.push({type:`added`,line:c[p++]});return[...n,...o]}function Ty(e){return e.match(/[^\n]*\n|[^\n]+$/g)??[]}function Ey(e,t){if(!e.includes(`
328
+ | A | 1 |`),children:[t(vt,{}),m(`richText.table`)]}),n(c,{onClick:()=>x(E,`insert`,`[${m(`agent.insertLink`)}](https://example.com)`),children:[t(ot,{}),m(`agent.insertLink`)]}),n(c,{onClick:()=>x(E,`insert`,'```chart\n{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"category":"A","value":1}]},"mark":"bar","encoding":{"x":{"field":"category","type":"nominal"},"y":{"field":"value","type":"quantitative"}}}\n```'),children:[t(Ue,{}),m(`agent.insertChart`)]})]})]}):null]}),A&&v?t(by,{anchor:v.anchor,mode:v.mode,initialDraft:v.initialDraft},`${v.anchor.block_id}:${v.mode}:${v.initialDraft??``}`):null]}):null,F=ry.has(a)?t(ay.Provider,{value:!0,children:T}):T;return n(`div`,{className:N,"data-collaborative-block":E.block_id,children:[j?null:F,P]})}}function Sy({children:e,resource:i,baseVersion:a,artifactRunId:o,components:s,readOnly:c=!1,allowComments:l=!c,highlightChangesFrom:u,highlightVersion:d=0,onAction:f,className:p,...m}){let{t:h}=se(),[g,_]=B(),[v,y]=B(),[b,S]=B(!1),C=z(``);L(()=>{if(!u||d<=0)return;S(!0);let e=window.setTimeout(()=>S(!1),1800);return()=>window.clearTimeout(e)},[u,d]),L(()=>{let t=g?.anchor.source_range;if(!g||!t||e.slice(t.start,t.end)===g.anchor.exact_text)return;let n=C.current,r=g.mode===`edit`?g.anchor.exact_text:g.mode===`insert`?g.initialDraft??``:``;n.trim()&&n!==r&&y({...g,draft:n}),_(void 0)},[g,e]);let w=R(()=>({...s,p:xy(`p`,`paragraph`,s?.p),h1:xy(`h1`,`heading`,s?.h1),h2:xy(`h2`,`heading`,s?.h2),h3:xy(`h3`,`heading`,s?.h3),h4:xy(`h4`,`heading`,s?.h4),h5:xy(`h5`,`heading`,s?.h5),h6:xy(`h6`,`heading`,s?.h6),ul:xy(`ul`,`list`,s?.ul),ol:xy(`ol`,`list`,s?.ol),blockquote:xy(`blockquote`,`blockquote`,s?.blockquote),pre:xy(`pre`,`code_block`,s?.pre),table:xy(`table`,`table`,s?.table),hr:xy(`hr`,`separator`,s?.hr)}),[s]),T=I((t,n,r)=>{if(n===`comment`&&!l||n!==`comment`&&c)return;let i=dy(e,t);C.current=n===`edit`?i.exact_text:r??``,_({anchor:i,mode:n,initialDraft:r})},[l,e,c]),E=I(()=>{C.current=``,_(void 0)},[]),D=I(e=>{C.current=e},[]),O=I(async(e,t,n)=>{if(t===`comment`&&!l||t!==`comment`&&c)return;let r=t===`insert`?`${e.exact_text.replace(/\s+$/,``)}\n\n${n.trim()}`:n;await f({operation_id:ly(),resource:i,base_version:a,action:t===`insert`?`edit`:t,anchor:e,...t===`comment`?{comment:n}:{user_change:{before:e.exact_text,after:r}}}),C.current=``,_(void 0)},[l,a,f,c,i]),k=R(()=>({markdown:e,artifactRunId:o,readOnly:c,allowComments:l,activeEditing:g,highlightChangesFrom:u,flashChangedBlocks:b,beginEditing:T,cancelEditing:E,updateDraft:D,submit:O}),[g,l,o,T,E,b,u,e,c,O,D]);return n(iy.Provider,{value:k,children:[v?n(`div`,{className:`not-prose mb-3 rounded-md border border-mixer-attention/35 bg-mixer-attention/10 p-3`,children:[n(`div`,{className:`flex items-start justify-between gap-3`,children:[n(`div`,{children:[t(`div`,{className:`text-sm font-semibold text-foreground`,children:h(`agent.documentEditingDraftPreserved`)}),t(`div`,{className:`mt-0.5 text-xs leading-4 text-muted`,children:h(`agent.documentEditingDraftPreservedDescription`)})]}),t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 p-0`,onClick:()=>y(void 0),"aria-label":h(`agent.close`),children:t(Ct,{className:`size-4`})})]}),t(x,{className:`mt-2`,value:v.draft,onChange:e=>y(t=>t&&{...t,draft:e.target.value}),rows:4})]}):null,t(ny,{...m,artifactRunId:o,className:p,components:w,preserveSourcePositions:!0,children:e})]})}function Cy(e){return e.split(/(\s+)/).filter(e=>e.length>0)}function wy(e,t,n){if(!n)return;let r=e[e.length-1];r&&r.type===t?r.text+=n:e.push({type:t,text:n})}function Ty(e,t,n){let r=e.length+1,i=t.length+1,a=new Uint32Array(r*i);for(let n=e.length-1;n>=0;n--)for(let r=t.length-1;r>=0;r--)a[n*i+r]=e[n]===t[r]?a[(n+1)*i+r+1]+1:Math.max(a[(n+1)*i+r],a[n*i+r+1]);let o=0,s=0;for(;o<e.length&&s<t.length;)e[o]===t[s]?(wy(n,`equal`,e[o]),o++,s++):a[(o+1)*i+s]>=a[o*i+s+1]?(wy(n,`removed`,e[o]),o++):(wy(n,`added`,t[s]),s++);wy(n,`removed`,e.slice(o).join(``)),wy(n,`added`,t.slice(s).join(``))}function Ey(e,t){if(e===t)return e?[{type:`equal`,text:e}]:[];let n=Cy(e),r=Cy(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)a--,o--;let s=[];wy(s,`equal`,n.slice(0,i).join(``));let c=n.slice(i,a),l=r.slice(i,o);return c.length*l.length>36e4?(wy(s,`removed`,c.join(``)),wy(s,`added`,l.join(``))):Ty(c,l,s),wy(s,`equal`,n.slice(a).join(``)),s}function Dy(e,t){let n=[],r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)n.push({type:`equal`,line:e[r]}),r++;let i=e.length,a=t.length,o=[];for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--,o.unshift({type:`equal`,line:e[i]});let s=e.slice(r,i),c=t.slice(r,a);if(s.length*c.length>36e4){for(let e of s)n.push({type:`removed`,line:e});for(let e of c)n.push({type:`added`,line:e});return[...n,...o]}let l=s.length+1,u=c.length+1,d=new Uint32Array(l*u);for(let e=s.length-1;e>=0;e--)for(let t=c.length-1;t>=0;t--)d[e*u+t]=s[e]===c[t]?d[(e+1)*u+t+1]+1:Math.max(d[(e+1)*u+t],d[e*u+t+1]);let f=0,p=0;for(;f<s.length&&p<c.length;)s[f]===c[p]?(n.push({type:`equal`,line:s[f]}),f++,p++):d[(f+1)*u+p]>=d[f*u+p+1]?(n.push({type:`removed`,line:s[f]}),f++):(n.push({type:`added`,line:c[p]}),p++);for(;f<s.length;)n.push({type:`removed`,line:s[f++]});for(;p<c.length;)n.push({type:`added`,line:c[p++]});return[...n,...o]}function Oy(e){return e.match(/[^\n]*\n|[^\n]+$/g)??[]}function ky(e,t){if(!e.includes(`
329
329
  `)&&!t.includes(`
330
- `))return Cy(e,t);if(e===t)return e?[{type:`equal`,text:e}]:[];let n=[],r=wy(Ty(e),Ty(t)),i=0;for(;i<r.length;){let e=r[i];if(e.type===`equal`){xy(n,`equal`,e.line),i++;continue}let t=``,a=``;for(;i<r.length&&r[i].type!==`equal`;){let e=r[i++];e.type===`removed`&&(t+=e.line),e.type===`added`&&(a+=e.line)}for(let e of Cy(t,a))xy(n,e.type,e.text)}return n}function Dy(e,t){if(e===t)return[];let n=[],r=wy(e.split(`
330
+ `))return Ey(e,t);if(e===t)return e?[{type:`equal`,text:e}]:[];let n=[],r=Dy(Oy(e),Oy(t)),i=0;for(;i<r.length;){let e=r[i];if(e.type===`equal`){wy(n,`equal`,e.line),i++;continue}let t=``,a=``;for(;i<r.length&&r[i].type!==`equal`;){let e=r[i++];e.type===`removed`&&(t+=e.line),e.type===`added`&&(a+=e.line)}for(let e of Ey(t,a))wy(n,e.type,e.text)}return n}function Ay(e,t){if(e===t)return[];let n=[],r=Dy(e.split(`
331
331
  `),t.split(`
332
- `)),i=0,a,o=()=>{a!==void 0&&(n.push({startLine:a,endLine:Math.max(a,i-1)}),a=void 0)};for(let e of r){if(e.type===`equal`){o(),i++;continue}a??=i,e.type===`added`&&i++}return o(),n}function Oy(e,t){let n=[],r=wy(e,t),i=0,a=0;for(;a<r.length;){if(r[a].type===`equal`){i++,a++;continue}let e=i,t=[];for(;a<r.length&&r[a].type!==`equal`;){let e=r[a++];e.type===`removed`&&i++,e.type===`added`&&t.push(e.line)}n.push({start:e,end:i,replacement:t})}return n}function ky(e,t){return e.start===t.start&&e.end===t.end&&e.replacement.length===t.replacement.length&&e.replacement.every((e,n)=>e===t.replacement[n])}function Ay(e,t){let n=e.start===e.end,r=t.start===t.end;return n&&r?e.start===t.start:n?e.start>=t.start&&e.start<=t.end:r?t.start>=e.start&&t.start<=e.end:e.start<t.end&&t.start<e.end}function jy(e,t,n){if(t===n)return{status:`rebased`,content:t};if(t===e)return{status:`rebased`,content:n};if(n===e)return{status:`rebased`,content:t};let r=e.split(`
333
- `),i=Oy(r,t.split(`
334
- `)),a=Oy(r,n.split(`
335
- `)),o=[];for(let e of i){let n=!1;for(let r of a){if(ky(e,r)){n=!0;break}if(Ay(e,r))return{status:`conflict`,content:t}}n||o.push(e)}let s=[...a,...o].sort((e,t)=>e.start-t.start||e.end-t.end),c=[],l=0;for(let e of s)c.push(...r.slice(l,e.start),...e.replacement),l=e.end;return c.push(...r.slice(l)),{status:`rebased`,content:c.join(`
336
- `)}}function My(e,t,n={}){if(e===t)return;let r=n.context??2,i=wy(e.split(`
332
+ `)),i=0,a,o=()=>{a!==void 0&&(n.push({startLine:a,endLine:Math.max(a,i-1)}),a=void 0)};for(let e of r){if(e.type===`equal`){o(),i++;continue}a??=i,e.type===`added`&&i++}return o(),n}function jy(e,t){let n=[],r=Dy(e,t),i=0,a=0;for(;a<r.length;){if(r[a].type===`equal`){i++,a++;continue}let e=i,t=[];for(;a<r.length&&r[a].type!==`equal`;){let e=r[a++];e.type===`removed`&&i++,e.type===`added`&&t.push(e.line)}n.push({start:e,end:i,replacement:t})}return n}function My(e,t){return e.start===t.start&&e.end===t.end&&e.replacement.length===t.replacement.length&&e.replacement.every((e,n)=>e===t.replacement[n])}function Ny(e,t){let n=e.start===e.end,r=t.start===t.end;return n&&r?e.start===t.start:n?e.start>=t.start&&e.start<=t.end:r?t.start>=e.start&&t.start<=e.end:e.start<t.end&&t.start<e.end}function Py(e,t,n){if(t===n)return{status:`rebased`,content:t};if(t===e)return{status:`rebased`,content:n};if(n===e)return{status:`rebased`,content:t};let r=e.split(`
333
+ `),i=jy(r,t.split(`
334
+ `)),a=jy(r,n.split(`
335
+ `)),o=[];for(let e of i){let n=!1;for(let r of a){if(My(e,r)){n=!0;break}if(Ny(e,r))return{status:`conflict`,content:t}}n||o.push(e)}let s=[...a,...o].sort((e,t)=>e.start-t.start||e.end-t.end),c=[],l=0;for(let e of s)c.push(...r.slice(l,e.start),...e.replacement),l=e.end;return c.push(...r.slice(l)),{status:`rebased`,content:c.join(`
336
+ `)}}function Fy(e,t,n={}){if(e===t)return;let r=n.context??2,i=Dy(e.split(`
337
337
  `),t.split(`
338
338
  `)),a=[];for(let e=0;e<i.length;e++){if(i[e].type===`equal`)continue;let t=a[a.length-1];t&&e-t.end<=r*2?t.end=e+1:a.push({start:e,end:e+1})}if(a.length===0)return;let o=[],s=1,c=1,l=0;for(let e of a){let t=Math.max(e.start-r,l===0?0:l);for(;l<t;l++)i[l].type!==`added`&&s++,i[l].type!==`removed`&&c++;let n=Math.min(e.end+r,i.length),a=0,u=0,d=[];for(let e=t;e<n;e++){let t=i[e];t.type===`equal`?(d.push(` ${t.line}`),a++,u++):t.type===`removed`?(d.push(`-${t.line}`),a++):(d.push(`+${t.line}`),u++)}for(o.push(`@@ -${s},${a} +${c},${u} @@`,...d);l<n;l++)i[l].type!==`added`&&s++,i[l].type!==`removed`&&c++}let u=o.join(`
339
- `);if(!(n.maxChars!==void 0&&u.length>n.maxChars))return u}const Ny=ne(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownDocumentEditor})));function Py(e,t){return e?.path===t?e.event_class===`artifact_updated`||e.event_class===`activity`&&e.tool_status===`completed`&&(e.tool===`edit_artifact`||e.tool===`write_artifact`):!1}function Fy(e,t){if(!Array.isArray(t?.changes)||t.changes.length===0)return;let n=e;for(let e of t.changes){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(t.operation!==`replace`||typeof t.before!=`string`||typeof t.after!=`string`||!n.includes(t.before))return;if(t.replace_all===!0)n=n.split(t.before).join(t.after);else{if(n.indexOf(t.before)!==n.lastIndexOf(t.before))return;n=n.replace(t.before,t.after)}}return n}function Iy(e){if(!(!e||typeof e!=`object`||!(`status`in e)))return typeof e.status==`number`?e.status:void 0}function Ly({regions:e,totalLines:n,onNavigate:r}){let{t:i}=B();return e.length===0?null:t(`nav`,{className:`absolute inset-y-12 end-1 z-10 w-3 rounded-full border border-mixer-muted/25 bg-muted/20`,"aria-label":i(`agent.changeRuler`),children:e.map(e=>{let a=e.startLine/Math.max(1,n)*100,o=Math.max(1.5,(e.endLine-e.startLine+1)/Math.max(1,n)*100);return t(S,{description:i(`agent.changedRegion`,{line:e.startLine+1}),asChild:!0,children:t(`button`,{type:`button`,className:`absolute inset-x-0 rounded-full bg-attention transition-colors hover:bg-info focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-info`,style:{top:`${Math.min(98.5,a)}%`,height:`${Math.min(100-a,o)}%`},onClick:()=>r(e.startLine),"aria-label":i(`agent.changedRegion`,{line:e.startLine+1})})},`${e.startLine}:${e.endLine}`)})})}function Ry(e,t){return Dy(e,t)}function zy({runId:e,path:a,initialContent:o=``,refreshKey:s=0,refreshDetails:c,readOnly:l=!1,allowComments:u=!1,viewMode:f=`components`,baselineContent:p,className:m,onAction:h,onSendMessage:g,onSendChangesToAgent:v,hasUnsentChanges:y=!1,isSendingChanges:b=!1,sendChangesDisabled:x=!1,toolbarStatus:S,onContentChange:T,onDocumentEdit:E,onSaveStatusChange:D,flushChangesRef:k}){let{client:A}=ye(),{t:j}=B(),M=O(),[N,te]=z(o),[P,ne]=z(),[re,ie]=z(),[ae,oe]=z(0),[se,ce]=z(!!e),[le,ue]=z(!1),[de,fe]=z(!1),[pe,me]=z(),[he,ge]=z(),[_e,ve]=z(!1),be=!l||u,xe=f!==`document`||he?`idle`:le||de?`saving`:P?`saved`:`idle`;I(()=>{D?.(xe)},[xe,D]);let V=R(N),Se=R(P),Ce=R(0),we=R(void 0),Te=R(void 0),Ee=R(!1),De=R(void 0),Oe=R(()=>Promise.resolve(!1)),ke=R(!1),Ae=R(!1),je=R(null),Me=R(P),Ne=R(o),Pe=R(void 0),Fe=R(o),Ie=R(null),Le=L(()=>Ry(p??N,N),[p,N]),Re=L(()=>N.split(`
340
- `).length,[N]),ze=F(e=>{Pe.current=e,ge(e)},[]);I(()=>{V.current=N},[N]),I(()=>{Se.current=P},[P]),I(()=>{f===`document`&&(Ae.current=!1,ke.current=!1)},[f]);let Be=F(async t=>{if(!e)return;let n=++Ce.current;ce(!0),me(void 0);for(let r=0;r<=60;r++)try{let t=await A.agents.getArtifactContent(e,a);if(Ce.current!==n)return;let r=V.current;r&&r!==t.content&&(ie(r),oe(e=>e+1)),V.current=t.content,Se.current=t.generation,Fe.current=t.content,!ke.current&&Te.current===void 0&&!Ee.current&&(Me.current=t.generation,Ne.current=t.content),te(t.content),ne(t.generation),me(void 0),ce(!1),T?.(t.content,t.generation);return}catch(e){if(Ce.current!==n||!t||Iy(e)!==404||r===60){if(Ce.current!==n)return;me(w(e,j(`agent.failedToLoadArtifact`))),ce(!1);return}await new Promise(e=>setTimeout(e,500))}},[A,T,a,e,j]);I(()=>(Ce.current++,V.current=o,Se.current=void 0,Fe.current=o,Me.current=void 0,Ne.current=o,Pe.current=void 0,ke.current=!1,Ae.current=!1,te(o),ne(void 0),ie(void 0),me(void 0),ge(void 0),ve(!1),fe(!1),ce(!!e),e&&Be(!0),()=>{Ce.current++}),[o,Be,e]),I(()=>{if(!e||s<=0||Pe.current)return;let t=V.current,n=Fy(t,c);n!==void 0&&n!==t&&(V.current=n,Se.current=void 0,ie(t),oe(e=>e+1),te(n),ne(void 0),T?.(n)),Be(!1)},[Be,T,c,s,e]);let Ve=F((e,t)=>{let n=V.current;V.current=e,Se.current=t,Ne.current=e,Me.current=t,Te.current=void 0,ze(void 0),je.current?.getMarkdown()!==e&&je.current?.commands.setContent(e,{contentType:`markdown`,emitUpdate:!1}),n!==e&&(ie(n),oe(e=>e+1)),te(e),ne(t),fe(!1),T?.(e,t)},[T,ze]),He=F(async(t,n,r)=>{if(!e)return!1;V.current=n,Te.current=void 0,te(n),fe(!1),ve(!0);let i,o;try{let s=await A.agents.getArtifactContent(e,a);i=s.content,o=s.generation,Fe.current=s.content;let c=jy(t,n,s.content);if(c.status===`conflict`)return ze({baseContent:t,localContent:n,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;let l=s.generation;if(c.content!==s.content)try{l=(await A.agents.updateArtifactContent(e,a,{content:c.content,generation:s.generation})).generation}catch(e){if(Iy(e)===412)return ze({baseContent:s.content,localContent:c.content,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;throw e}return Ve(c.content,l),M({status:`success`,title:j(`agent.artifactConflictRebased`),duration:3e3}),{content:c.content,generation:l}}catch(e){return ze({baseContent:t,localContent:n,remoteContent:i,remoteGeneration:o,pendingAction:r}),M({status:`error`,title:j(`agent.artifactConflictTitle`),description:w(e,j(`agent.failedToLoadArtifact`)),duration:5e3}),!1}finally{ve(!1)}},[Ve,A.agents,a,e,j,M,ze]),Ue=F(async t=>{if(t.action===`comment`){await h?.(t);return}if(Pe.current){M({status:`warning`,title:j(`agent.artifactConflictTitle`),duration:3e3});return}if(!e||!Se.current){M({status:`warning`,title:j(`agent.artifactEditingUnavailable`),duration:3e3});return}let n=V.current,r=my(n,t);if(r===void 0){M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:j(`agent.documentEditApplyFailedDescription`),duration:5e3});return}try{let i=await A.agents.updateArtifactContent(e,a,{content:r,generation:Se.current});V.current=r,Se.current=i.generation,Ne.current=r,Me.current=i.generation,ie(n),oe(e=>e+1),te(r),ne(i.generation),T?.(r,i.generation),await h?.({...t,applied:!0,base_version:i.generation}),Fe.current=r}catch(e){if(Iy(e)===412){let e=await He(n,r,t);e&&(await h?.({...t,applied:!0,base_version:e.generation}),Fe.current=e.content);return}M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3})}},[A,h,T,a,He,e,j,M]),We=F(()=>{if(!e)return Promise.resolve(!1);if(De.current)return De.current;let t=(async()=>{Ee.current=!0,ue(!0);try{for(;Te.current!==void 0;){let t=Te.current;Te.current=void 0;let n=Me.current;if(!n)throw Error(j(`agent.artifactEditingUnavailable`));let r=await A.agents.updateArtifactContent(e,a,{content:t,generation:n});Se.current=r.generation,Me.current=r.generation,Ne.current=t,ne(r.generation),T?.(V.current,r.generation)}return fe(!1),!0}catch(e){return Iy(e)===412?!!await He(Ne.current,V.current):(M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3}),!1)}finally{Ee.current=!1,ue(!1)}})();return De.current=t,t.finally(()=>{De.current===t&&(De.current=void 0)}),t},[A.agents,T,a,He,e,j,M]);Oe.current=We;let H=F(async()=>{we.current!==void 0&&(clearTimeout(we.current),we.current=void 0);let t=je.current?.getMarkdown();t!==void 0&&t!==V.current&&(V.current=t,te(t),T?.(t,Se.current),Te.current=t);let n=Pe.current;if(n&&!await He(n.baseContent,V.current))return!1;for(;Te.current!==void 0||De.current;)if(!await We())return!1;if(!e||!Se.current)return!1;let r=Fe.current;return Fe.current=V.current,{previous:r,current:V.current}},[T,We,He,e]);I(()=>{if(k)return k.current=H,()=>{k.current===H&&(k.current=null)}},[k,H]);let Ge=F(e=>{if(e===V.current||ke.current&&Te.current===void 0&&!Ee.current&&e===Ne.current)return;if(!Ae.current){V.current=e,te(e);return}V.current=e,te(e),E?.(),T?.(e,Se.current);let t=Pe.current;if(t){ze({...t,localContent:e}),fe(!1);return}fe(!0),Te.current=e,we.current!==void 0&&clearTimeout(we.current),we.current=setTimeout(()=>{we.current=void 0,We()},400)},[T,E,We,ze]),qe=F(e=>{ke.current=e,e&&(Ae.current=!0),(e||Te.current===void 0&&!Ee.current)&&(Me.current=Se.current,Ne.current=V.current)},[]),Je=F(async()=>{let e=Pe.current;if(!e||_e)return;let t=await He(e.baseContent,V.current,e.pendingAction);t&&e.pendingAction&&(await h?.({...e.pendingAction,applied:!0,base_version:t.generation}),Fe.current=t.content)},[_e,h,He]),Ye=F(e=>{let t=Ie.current?.querySelector(`.vertesia-markdown-document-editor-content`);if(!t)return;let n=Math.min(1,e/Math.max(1,Re-1));t.scrollTo({top:n*Math.max(0,t.scrollHeight-t.clientHeight),behavior:`smooth`})},[Re]);return I(()=>()=>{we.current!==void 0&&clearTimeout(we.current);let e=je.current?.getMarkdown();e!==void 0&&e!==V.current&&(V.current=e,Te.current=e),Te.current!==void 0&&Oe.current()},[]),n(`div`,{className:m??`relative h-full min-h-0 overflow-y-auto px-4 py-3`,children:[he?t(`div`,{className:`absolute inset-x-4 top-3 z-30`,role:`alert`,children:t(d,{status:`warning`,title:j(`agent.artifactConflictTitle`),className:`shadow-lg`,children:n(`div`,{className:`space-y-3`,children:[t(`p`,{children:j(`agent.artifactConflictDescription`)}),t(`div`,{className:`flex justify-end`,children:n(r,{variant:`outline`,size:`sm`,disabled:_e,onClick:()=>void Je(),children:[_e?t(_,{size:`sm`}):null,j(`agent.artifactConflictRetry`)]})})]})})}):null,se&&!N?t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}):pe&&!N?n(i,{className:`h-full min-h-[200px] flex-col gap-3 text-center text-muted`,children:[t(`span`,{children:pe}),t(r,{variant:`outline`,size:`sm`,onClick:()=>void Be(!1),children:j(`agent.retry`)})]}):f===`document`?t(ee,{fallback:t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}),children:t(`div`,{className:`flex h-full min-h-0 flex-col`,children:n(`div`,{ref:Ie,className:`relative min-h-0 flex-1`,children:[t(Ny,{value:N,onChange:Ge,artifactRunId:e,editable:!l&&!!e,externalValueSync:`when-blurred`,onFocusChange:qe,onEditor:e=>{je.current=e},onSendComment:g&&e&&!he&&be?g:void 0,onSendChangesToAgent:v,hasUnsentChanges:y,isSendingChanges:b,sendChangesDisabled:x||!e||!!he,toolbarStatus:S,contentClassName:`pe-5`}),t(Ly,{regions:Le,totalLines:Re,onNavigate:Ye}),!D&&xe!==`idle`?n(`div`,{className:C(`pointer-events-none absolute bottom-3 end-6 flex items-center gap-1.5 rounded-full`,`border border-mixer-muted/25 bg-background/90 px-2.5 py-1 text-[11px] shadow-sm`,le||de?`text-muted`:`text-success`),children:[le||de?t(_,{size:`sm`}):t(Ke,{className:`size-3`}),j(le||de?`agent.savingWorkingCopy`:`agent.savedToWorkingCopy`)]}):null]})})}):t(`div`,{className:`vprose prose-sm mx-auto max-w-5xl`,children:t(yy,{artifactRunId:e,resource:{kind:`agent_artifact`,run_id:e??`pending`,path:a},baseVersion:P,readOnly:l||!e||!!he,allowComments:be&&!!e&&!he,highlightChangesFrom:re,highlightVersion:ae,onAction:Ue,children:N})}),se&&N?t(`div`,{className:`absolute end-3 top-3 rounded-full bg-background/80 p-2 shadow-sm`,children:t(it,{className:`size-4 animate-pulse text-muted`})}):null]})}function By({percent:e}){return t(`div`,{className:`w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700`,children:t(`div`,{className:`bg-blue-600 h-2.5 rounded-full`,style:{width:`${e}%`}})})}function Vy({className:e,properties:r}){return t(b,{className:e,children:t(`tbody`,{children:r.map(e=>n(`tr`,{children:[n(`td`,{className:`w-1/3 font-semibold gap-2`,children:[t(`span`,{children:e.name}),e.description&&t(S,{description:e.description,placement:`top`,children:t(st,{className:`size-3 ms-2 text-muted-foreground`})})]}),t(`td`,{className:`w-2/3`,children:e.value??`undefined`})]},e.name))})})}function Hy({content:e,...n}){let r=R(null);return I(()=>{if(!r.current)return;let t=new DOMParser().parseFromString(e,`image/svg+xml`).querySelector(`svg`);if(!t){console.warn(`SvgIcon: No <svg> element found in provided string`),r.current.innerHTML=``;return}Object.entries(n).forEach(([e,n])=>{if(n==null)return;let r=e===`className`?`class`:e;t.setAttribute(r,String(n))}),r.current.innerHTML=``,r.current.appendChild(t)}),t(`span`,{ref:r})}function Uy(e){return n=>t(Hy,{content:e,...n})}function Wy(e){return{name:e.getNameSignature(),type:e.getTypeSignature(),description:e.description,extractable:e.extractable}}var Gy;(function(e){e.string=`string`,e.number=`number`,e.integer=`integer`,e.boolean=`boolean`,e.object=`object`,e.any=`any`,e.text=`text`,e.media=`media`,e.document=`document`})(Gy||={});function Ky(e){e=e.trim();let t=!1,n=!1;e.endsWith(`?`)&&(n=!0,e=e.substring(0,e.length-1).trim()),e.endsWith(`[]`)&&(t=!0,e=e.substring(0,e.length-2).trim());let r=Gy[e];if(!r)throw Error(`Unknown type "${e}"`);return{name:r,isArray:t,isNullable:n,isObject:r===Gy.object}}function qy(){let e=Object.values(Gy),t=[...e];for(let n of e)t.push(`${n}[]`);return e.sort(),t}const Jy=qy();function Yy({value:e,onChange:i,onCancel:a,onSave:o}){let{t:s}=B(),[c,l]=z(!1);return e?n(`div`,{className:`flex items-center`,children:[t(`div`,{className:`flex-1`,children:t(Xy,{value:e.name,onChange:t=>{i({...e,name:t})},onCancel:a,onSave:o})}),t(`div`,{className:`px-1 font-semibold`,children:`:`}),t(`div`,{className:`flex-1`,children:t(Zy,{value:e.type,onChange:t=>{i({...e,type:t})},onCancel:a,onSave:o})}),n(`div`,{children:[t(r,{variant:`ghost`,size:`xs`,onClick:()=>l(!0),title:s(`widgets.schema.editDescription`),children:t(St,{className:`size-4`})}),t(Qy,{value:e.description,isOpen:c,onClose:t=>{t!==void 0&&typeof t==`string`&&i({...e,description:t},!0),l(!1)}})]})]}):null}function Xy({value:e,onChange:n,onCancel:r,onSave:i}){let a=R(null);return I(()=>{a.current?.focus()},[]),t(`input`,{onKeyUp:e=>{switch(e.key){case`Enter`:i?.();break;case`Escape`:r?.()}},ref:a,value:e,onChange:e=>{n(e.target.value)},className:v.INPUT_UNSTYLED,style:{fontSize:`inherit`,width:``,display:`inline`}})}function Zy({value:e,onChange:n,onCancel:r,onSave:i}){return t(g,{className:v.INPUT_UNSTYLED,options:Jy,value:e||``,onBlur:()=>{i?.()},onChange:n,onKeyDown:(e,t)=>{t||(e.key===`Enter`?i?.():e.key===`Escape`&&r?.())},popupClass:`schema-type-suggest-popup z-90`})}function Qy({value:e,isOpen:r,onClose:i}){let{t:a}=B();return n(f,{isOpen:r,onClose:i,children:[t(h,{children:a(`widgets.schema.editDescription`)}),t($y,{value:e,onSave:i})]})}function $y({value:i,onSave:a}){let{t:o}=B(),s=R(null),[c,l]=z(i||``);return I(()=>{s.current?.focus()},[]),n(e,{children:[t(p,{className:`h-max`,children:t(`textarea`,{ref:s,className:`dark:bg-gray-800 w-full h-full dark:text-white`,value:c,onChange:e=>l(e.target.value)})}),t(m,{children:t(r,{onClick:()=>a(c),children:o(`store.saveChanges`)})})]})}function eb({value:e}){let{t:r}=B();if(!e)return null;let i=e.extractable===!1;return n(`div`,{className:`w-full flex items-baseline gap-2 min-w-0`,children:[t(`div`,{className:`truncate`,children:e.name||``}),t(`div`,{className:`text-sm text-muted shrink-0`,children:e.type||``}),i&&t(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:r(`widgets.schema.extractFromDocumentHint`),children:r(`widgets.schema.noExtract`)})]})}function tb(e,t,n){if(e.properties){let r=e.properties,i={};for(let e of Object.keys(r)){let a=r[e];e===t?i[n]=a:i[e]=a}e.properties=i}e.required&&=e.required.map(e=>e===t?n:e)}function nb(e,t,n){if(Array.isArray(e.required)){let r=e.required.indexOf(t);n?r<0&&e.required.push(t):r>-1&&e.required.splice(r,1)}else n&&(e.required=[t])}function rb(e,t){let n=t.name===`any`?void 0:t.isNullable?[t.name,`null`]:t.name;if(t.isArray){if(e.type=`array`,e.properties=void 0,!e.items||Array.isArray(e.items))e.items={type:n,properties:t.isObject?{}:void 0};else{let r=e.items;r.type=n,t.isObject&&!r.properties&&(r.properties={})}}else e.type=n,e.items=void 0,t.isObject?e.properties||={}:e.properties=void 0}function ib(e,t){e.properties&&(delete e.properties[t],Array.isArray(e.required)&&(e.required=e.required.filter(e=>e!==t)))}function ab(e,t,n,r=!1){if(e.type!==`object`)throw Error(`Cannot add property to a non-object schema`);e.properties||={};let i={};return rb(i,n),e.properties[t]=i,r&&(Array.isArray(e.required)?lb(e.required,t):e.required=[t]),i}function ob(e){let t=!1,n=!1,r,i=e.type;if(Array.isArray(i))for(let e of i)e===`null`?t=!0:r||=e;else r=i;r||=`any`,r===`array`&&(n=!0,r=sb(e.items));let a=r;switch(e.editor){case`textarea`:a=`text`;break;case`media`:a=`media`;break;case`document`:a=`document`}return{isNullable:t,isArray:n,isObject:r===`object`,name:a}}function sb(e){if(!e)return`any`;let t;return t=cb(Array.isArray(e)?e[0].type:e.type),(t===`array`||t===`null`)&&(t=`any`),t}function cb(e){return e?Array.isArray(e)?e.find(e=>e!==`null`)||`any`:e:`any`}function lb(e,t){e.includes(t)||e.push(t)}let ub=0;var db=class e{source;onChange=()=>{};schema;root;constructor(e,t){this.schema=e?typeof e==`string`?JSON.parse(e):e:{title:t,type:`object`,properties:{}},this.schema.properties||(this.schema.properties={}),this.root=new fb(``,this.schema,this),this.root.loadChildren()}get isEmpty(){return!this.root.children||this.root.children.length===0}get children(){return this.root.children??[]}reload(){return this.root=new fb(``,this.schema,this),this.root.loadChildren(),this.onChange?.(this),this}withSource(e,t){return this.source={uri:t,name:e},this}withChangeListener(e){return this.onChange=e,this}replaceSchema(e){this.schema=e||{title:this.schema.title,type:`object`,properties:{}},this.reload()}clone(){let t=new e(this.schema);return t.source=this.source,this.onChange&&t.withChangeListener(this.onChange),t}},fb=class e{schema;loader;parent;name;isRequired=!1;type;children;constructor(e,t,n,r){if(this.schema=t,this.loader=n,this.parent=r,this.name=e,this.type=ob(t),this.parent){let t=this.parent._getPropertiesSchema().required;this.isRequired=t&&Array.isArray(t)?t.includes(e):!1}}get title(){return typeof this.schema.title==`string`?this.schema.title:void 0}set title(e){this.schema.title=e}get description(){return this.schema.description}set description(e){this.schema.description=e}get extractable(){return this.schema[`x-extract`]!==!1}set extractable(e){e?delete this.schema[`x-extract`]:this.schema[`x-extract`]=!1}get isParent(){return this.type.isObject}get isNew(){return!!this.schema.isNew}set isNew(e){e?this.schema.isNew=!0:delete this.schema.isNew}resetIsNew(){let e=this.isNew;return this.isNew=!1,e}getNameSignature(){return`${this.name}${this.isRequired?``:`?`}`}getTypeSignature(){return`${this.type.name}${this.type.isArray?`[]`:``}${this.type.isNullable?`?`:``}`}getSignature(){return`${this.getNameSignature()}: ${this.getTypeSignature()}`}reloadTree(){this.loader.reload()}loadChildren(){this.children=[];let e=this.schema.items?.properties;this.schema.items&&e?this._loadChildren(e,this.children):this.schema.properties&&this._loadChildren(this.schema.properties,this.children)}_loadChildren(t,n){for(let r of Object.keys(t)){let i=t[r],a=new e(r,i,this.loader,this);n.push(a),a.isParent&&a.loadChildren()}}_getPropertiesSchema(){return this.type.isArray&&this.type.isObject?this.schema.items:this.schema}findAvailableChildName(e){let t=this._getPropertiesSchema().properties||{},n;do n=e+ ++ub;while(t[n]);return n}addChild(t,n,r=!1){if(!this.type.isObject)throw Error(`Cannot add child to a non object node`);this.children||=[];let i=ab(this._getPropertiesSchema(),t,n,r),a=new e(t,i,this.loader,this);return this.children.push(a),a}remove(){return this.parent?.type.isObject?(ib(this.parent._getPropertiesSchema(),this.name),this.parent.children&&(this.parent.children=this.parent.children.filter(e=>e.name!==this.name)),!0):!1}update(e){let t=!1;e.name!=null&&this.name!==e.name&&(this.parent&&tb(this.parent._getPropertiesSchema(),this.name,e.name),this.name=e.name,t=!0),e.isRequired!=null&&this.isRequired!==e.isRequired&&(this.parent&&nb(this.parent._getPropertiesSchema(),this.name,e.isRequired),this.isRequired=e.isRequired,t=!0);let n=e.type?.name;n===`any`&&(n=void 0);let r=n!==this.schema.type;return e.type&&(rb(this.schema,e.type),this.type=e.type,this.type.isObject?this.children||=[]:this.children=void 0,t=!0),this.schema.editor&&e.editor===null?(this.schema.editor=void 0,t=!0):e.editor?(this.schema.editor=e.editor,t=!0):r&&(this.schema.editor=void 0,t=!0),e.description!==this.description&&(this.description=e.description,t=!0),e.extractable!=null&&this.extractable!==e.extractable&&(this.extractable=e.extractable,t=!0),t}getUpdateFromNameAndTypeSignature(e,t){let n=e.trim(),r=!0;n.endsWith(`?`)&&(n=n.substring(0,n.length-1).trim(),r=!1);let i=Ky(t),a;return i.name===`text`?(i.name=Gy.string,a=`textarea`):i.name===`media`?(i.name=Gy.any,a=`media`):i.name===`document`?(i.name=Gy.any,a=`document`):a=null,{name:n,type:i,isRequired:r,editor:a}}updateFromNameAndTypeSignature(e,t){return this.update(this.getUpdateFromNameAndTypeSignature(e,t))}updateFromSignature(e){e=e.trim();let t=e.indexOf(`:`);if(t<0)throw Error(`Expecting a name and a type separated by a colon`);let n=e.substring(0,t),r=e.substring(t+1);return this.updateFromNameAndTypeSignature(n,r)}};function pb(e){let[t,n]=z(new db(e||{type:`object`,properties:{}}).withChangeListener(e=>{n(e.clone())}));return t}const mb=`block text-sm sm:leading-6 rounded-md border-0 py-1.5 px-4`,hb=`${mb} hover:shadow-xs hover:ring-1 hover:ring-inset hover:ring-ring`,gb=`${mb} shadow-xs ring-1 ring-inset ring-ring`;function _b({value:e,onChange:r,onDelete:i,outlineOnHover:a=!1,editOnClick:o=!0,placeholder:s,viewer:c,editor:l,skipClickOutside:u,isEditing:d=!1,readonly:f=!1,onValidate:p}){let{on:m,off:h,isOn:g}=E(d),[_,v]=z();return n(`div`,{className:``,children:[g&&!f?t(yb,{value:e,onSave:e=>{if(p){let t=p(e);if(t){v(t);return}v(void 0)}r(e)&&h()},onCancel:h,editor:l,skipClickOutside:e=>u?u(e):!1}):t(vb,{value:e,onEdit:m,viewer:c,placeholder:s,outlineOnHover:a,editOnClick:o,onDelete:i,readonly:f}),_&&t(`div`,{className:`text-red-500 text-sm`,children:_})]})}function vb({viewer:e,value:i,onEdit:a,editOnClick:o,outlineOnHover:s,placeholder:c,onDelete:l,readonly:u}){let d=()=>{o&&a()},f=e=>{e.key===`Enter`&&a()},p=`invisible group-hover:visible`;return n(`div`,{role:o?`button`:void 0,tabIndex:0,onKeyUp:f,onClick:d,className:k(`flex justify-start items-center group`,s?hb:mb,{"cursor-pointer":o}),children:[t(e,{value:i,placeholder:c}),n(`div`,{className:`ms-auto flex gap-2`,children:[!u&&l&&t(r,{variant:`ghost`,size:`sm`,className:p,onClick:l,children:t(Ct,{className:`size-4`})}),u?null:t(r,{variant:`ghost`,size:`sm`,className:p,onClick:a,children:t(yt,{className:`size-4`})})]})]})}function yb({editor:e,value:n,onSave:r,onCancel:i,skipClickOutside:a}){let[o,s]=z(n),c=R(n),[l,u]=z(null),d=()=>{r(c.current)},f=T(d,a);return t(`div`,{ref:f,children:t(`div`,{className:gb,children:t(`div`,{className:`w-full`,onClick:e=>e.stopPropagation(),children:t(e,{value:o,onChange:(e,t=!1)=>{s(e),c.current=e,t&&(l&&clearTimeout(l),u(setTimeout(()=>{r(e)},500)))},onSave:d,onCancel:i})})})})}function bb(e){return!!e.target.closest?.(`.schema-type-suggest-popup`)}function xb({schema:e,readonly:r=!1}){let{t:i}=B();return n(`div`,{className:`space-y-1`,children:[n(`div`,{className:`flex items-center gap-2 px-2 py-1 text-xs font-medium text-muted-foreground border-b border-border`,children:[t(`div`,{className:`flex-1 min-w-0`,children:i(`widgets.schema.propertyColumn`)}),!r&&t(`div`,{className:`shrink-0 w-28 text-end pe-1`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.extractFromDocument`)}),t(`div`,{className:`w-8 shrink-0`})]}),n(`ul`,{className:``,children:[e.children.map(e=>Sb(e,r)),r?null:t(Db,{parent:e.root})]})]})}function Sb(e,n){return e.isParent?t(wb,{property:e,readonly:n},e.name):t(Cb,{node:e,readonly:n},e.name)}function Cb({node:e,readonly:n}){return t(`li`,{className:`border-b border-border/40 last:border-0`,children:t(Eb,{property:e,readonly:n})})}function wb({property:e,readonly:i}){let[a,o]=z(!0),s=a?qe:Je;return n(`li`,{className:`border-b border-border/40 last:border-0`,children:[n(`div`,{className:`flex items-center w-full gap-1`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(Eb,{property:e,readonly:i})}),t(r,{variant:`ghost`,size:`icon`,onClick:()=>o(!a),"aria-label":a?`Collapse ${e.name}`:`Expand ${e.name}`,"aria-expanded":a,className:`shrink-0`,children:t(s,{className:`size-4 cn-rtl-flip`})})]}),a&&n(`ul`,{className:`ms-4 border-s border-gray-400 border-dashed`,children:[(e.children||[]).map(e=>Sb(e,i)),i?null:t(Db,{parent:e})]})]})}function Tb(e){if(!e)return`Name is required`;if(!/^[a-zA-Z0-9_]+[?]?$/.test(e))return`Only letters, numbers, underscores or question mark are allowed (a-zA-Z0-9_?)`}function Eb({property:e,readonly:r}){let{t:i}=B(),a=O(),o=t=>{try{t.description&&typeof t.description!=`string`&&(t.description=void 0);let n=e.getUpdateFromNameAndTypeSignature(t.name,t.type);e.update({...n,description:t.description,extractable:t.extractable})&&e.reloadTree()}catch(e){return a({status:`error`,title:i(`widgets.schema.invalidPropertyDeclaration`),description:w(e),duration:9e3}),!1}return!0},s=t=>{e.update({extractable:t})&&e.reloadTree()},c=e.resetIsNew(),l=Wy(e);return n(`div`,{className:`flex items-center gap-2 w-full min-w-0 py-0.5`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(_b,{value:l,onChange:o,onDelete:()=>{e.remove(),e.reloadTree()},editor:Yy,viewer:eb,outlineOnHover:!0,isEditing:c,skipClickOutside:bb,readonly:r,onValidate:e=>Tb(e.name)})}),r?e.extractable===!1?t(`div`,{className:`shrink-0 w-28 flex justify-end pe-1`,children:t(`span`,{className:`text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.noExtract`)})}):null:t(`div`,{className:`shrink-0 w-28 flex items-center justify-end gap-1.5 pe-1`,children:t(y,{size:`sm`,value:e.extractable,onChange:s,"aria-label":`${i(`widgets.schema.extractFromDocument`)}: ${e.name}`})})]})}function Db({parent:e}){return n(r,{variant:`ghost`,onClick:()=>{let t=e.findAvailableChildName(`new_property_`),n=e.addChild(t,{isObject:!1,isArray:!1,isNullable:!1,name:Gy.string},!0);n.isNew=!0,e.reloadTree()},children:[t(gt,{className:`size-4`}),`Add property`]})}function Ob(e){return e.isFile}function kb(e){return e.isDirectory}function Ab({onDrop:e,message:i,buttonLabel:a,allowFolders:o=!0,className:s=``}){let{t:c}=B(),l=a??c(`upload.uploadFiles`),[u,d]=z(!1),f=R(null),p=e=>{e.preventDefault(),e.dataTransfer.types.includes(`Files`)&&d(!0)},m=e=>{e.preventDefault(),f.current&&!f.current.contains(e.relatedTarget)&&d(!1)},h=async t=>{if(t.preventDefault(),d(!1),t.dataTransfer.items&&t.dataTransfer.items.length>0){let n=Array.from(t.dataTransfer.items),r=[],i=new Set,a=async e=>{if(Ob(e)){let t=await new Promise(t=>{e.file(n=>{Object.defineProperty(n,"webkitRelativePath",{writable:!0,value:e.fullPath.substring(1)}),t(n)})});!t.name.startsWith(`.`)&&t.size>0&&r.push(t);let n=e.fullPath.substring(1).split(`/`).slice(0,-1).join(`/`);n&&i.add(n)}else if(kb(e)){let t=e.createReader(),n=await new Promise(e=>{t.readEntries(t=>{e(t)})});await Promise.all(n.map(a));let r=e.fullPath.substring(1);r&&i.add(r)}};try{if(await Promise.all(n.map(e=>{let t=e.webkitGetAsEntry?e.webkitGetAsEntry():e;return t?a(t):Promise.resolve()})),r.length>0){let t=new Set(Array.from(i).map(e=>e.split(`/`)[0]).filter(Boolean)).size,n=r.length,a=``;a=t>0?c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:n}):c(`upload.preparingFiles`,{count:n}),e(r,{count:r.length,message:a})}}catch(n){console.error(`Error processing dropped files:`,n);let r=Array.from(t.dataTransfer.files);r.length>0&&e(r)}}else t.dataTransfer.files&&t.dataTransfer.files.length>0&&e(Array.from(t.dataTransfer.files))},g=t=>{if(t&&t.length>0){let n=Array.from(t);if(n.some(e=>e.webkitRelativePath?.includes(`/`))){let t=new Set(n.map(e=>e.webkitRelativePath.split(`/`)[0]).filter(Boolean)).size,r=n.length,i=c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:r});e(n,{count:n.length,message:i})}else e(n,{count:n.length,message:c(`upload.preparingFiles`,{count:n.length})})}};return n(`div`,{className:`flex flex-col items-center justify-center py-12 border-2 rounded-lg transition-colors ${u?`border-color-primary bg-color-primary/10`:`border-dashed border-color-border`} ${s}`,onDragOver:p,onDragLeave:m,onDrop:h,children:[t(wt,{className:`h-12 w-12 mb-3 transition-colors ${u?`text-primary`:`text-muted/50`}`}),t(`p`,{className:`text-muted`,children:i}),n(`div`,{className:`flex gap-2 justify-center mt-2`,children:[t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e?.click(),e.onchange=()=>{g(e.files)}},children:l}),o&&t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e.webkitdirectory=!0,e?.click(),e.onchange=()=>{g(e.files)}},children:c(`upload.selectFolder`)})]})]})}function jb({title:e,count:r,icon:i=t(Xe,{className:`h-4 w-4 text-green-500`}),items:a}){let{t:o}=B(),[s,c]=z(!1),l=ae();return n(`div`,{className:`border border-color-border rounded-md overflow-hidden`,children:[n(`button`,{type:`button`,"aria-expanded":s,"aria-controls":l,className:`w-full flex items-center justify-between p-3 bg-color-muted/10 cursor-pointer text-start bg-transparent border-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,onClick:()=>c(!s),children:[n(`span`,{className:`flex items-center`,children:[t(`span`,{className:`me-2`,children:i}),t(`span`,{className:`font-medium`,children:e}),t(`span`,{className:`ms-2 px-2 py-0.5 bg-color-muted/20 rounded-full text-xs`,children:r})]}),t(`span`,{className:`text-muted`,"aria-hidden":`true`,children:t(`svg`,{className:`h-5 w-5 transition-transform ${s?`transform rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})})]}),s&&t(`div`,{id:l,className:`p-3 border-t border-color-border max-h-48 overflow-y-auto`,children:a.length>0?t(`ul`,{className:`space-y-1`,children:a.map(e=>t(`li`,{className:`text-sm py-1 px-2 rounded hover:bg-color-muted/10`,children:e},e))}):t(`div`,{className:`text-sm text-muted py-2`,children:o(`upload.noItems`)})})]})}function Mb({files:e,className:r=``,location:i,collection:a}){let{t:o}=B(),s=e.filter(e=>e.status===`success`),c=e.filter(e=>e.status===`updated`),l=e.filter(e=>e.status===`skipped`),u=e.filter(e=>e.status===`failed`),d=s.length,f=c.length,p=l.length,m=u.length,h=e.length;return n(`div`,{className:`flex flex-col py-2 ${r}`,children:[n(`div`,{className:`flex items-center mb-4`,children:[t(`div`,{className:`size-8 me-4 rounded-full bg-success/10 flex items-center justify-center`,children:t(Xe,{className:`size-4 text-success`})}),t(`div`,{children:n(`p`,{className:`text-muted`,children:[o(`upload.filesProcessed`,{count:h}),a?o(`upload.inCollection`,{collection:a}):``,i?o(`upload.inFolder`,{location:i}):``]})})]}),n(`div`,{className:`space-y-3 mt-2`,children:[d>0&&t(jb,{title:o(`upload.successfullyUploaded`),count:d,icon:t(Xe,{className:`h-4 w-4 text-green-500`}),items:s.map(e=>e.name)}),f>0&&t(jb,{title:o(`upload.successfullyUpdated`),count:f,icon:t(Xe,{className:`h-4 w-4 text-blue-500`}),items:c.map(e=>e.name)}),p>0&&t(jb,{title:o(`upload.skippedAlreadyExisted`),count:p,icon:t(Ye,{className:`h-4 w-4 text-amber-500`}),items:l.map(e=>e.name)}),m>0&&t(jb,{title:o(`upload.failedToUpload`),count:m,icon:t(Ze,{className:`h-4 w-4 text-red-500`}),items:u.map(e=>e.name)})]})]})}const Nb=`#text`,Pb=`#comment`,Fb=`#cdata`,Ib=`DECLARATION_TAG`,Lb={tagColor:`#d43900`,textColor:`#333`,attributeKeyColor:`#2a7ab0`,attributeValueColor:`#008000`,separatorColor:`#333`,commentColor:`#aaa`,cdataColor:`#1d781d`,fontFamily:`monospace`},Rb={attributeKeyColor:`#FFD700`,attributeValueColor:`#FF4500`,tagColor:`#87CEFA`,textColor:`#00FF00`,separatorColor:`#FFD700`,commentColor:`#BEBEBE`,cdataColor:`#33CC66`,fontFamily:`monospace`},zb=N({theme:Lb,collapsible:!1,indentSize:2}),Bb=()=>ie(zb),Vb=new V({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:``,allowBooleanAttributes:!0,commentPropName:Pb,cdataPropName:Fb,parseTagValue:!1});function Hb(e){try{let t=new DOMParser().parseFromString(e,`application/xml`),n=t.documentElement.localName===`parsererror`?t.documentElement:void 0;if(n)throw Error(n.textContent?.trim()||`Invalid XML!`);let r=Vb.parse(e);if(e.trim().length>0&&r.length===0)throw Error(`Invalid XML!`);return{json:r,valid:!0}}catch(e){return{json:null,valid:!1,errorMessage:`Fail to parse: ${e instanceof Error?e.message:String(e)}`}}}function Ub(e){return L(()=>Hb(e),[e])}function Wb(e){let{indentation:r,children:i,isInline:a}=e,{theme:o}=Bb();return n(`div`,{style:{color:o.cdataColor},children:[t(`span`,{children:`${r}<![CDATA[`}),i,t(`span`,{children:`${a?``:r}]]>`})]})}function Gb(e){let{collapsible:n,theme:r}=Bb(),{collapsed:i}=e;return n?t(`span`,{style:{position:`relative`},children:t(`span`,{style:{position:`absolute`,right:`0`,border:0,padding:0,background:`none`},children:t(Kb,{fill:r.separatorColor,style:{transform:`rotate(${i?0:90}deg)`,transition:`transform 0.2s`}})})}):null}function Kb({...e}){return t(`svg`,{width:`16px`,height:`16px`,viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:t(`path`,{d:`M9 17.898C9 18.972 10.2649 19.546 11.0731 18.8388L17.3838 13.3169C18.1806 12.6197 18.1806 11.3801 17.3838 10.6829L11.0731 5.16108C10.2649 4.45388 9 5.02785 9 6.1018V17.898Z`})})}function qb(e){let{collapsible:t,initialCollapsedDepth:n}=Bb(),[r,i]=z(()=>Se(n)||!t?!1:e>=n);return I(()=>{i(Se(n)||!t?!1:e>=n)},[n,e,t]),{collapsed:r,buttonProps:t?{onClick:()=>i(e=>!e),role:`button`,style:{cursor:`pointer`}}:{}}}function Jb(e){let{indentation:r,children:i,isInline:a,level:o}=e,{theme:s}=Bb(),{collapsed:c,buttonProps:l}=qb(o);return n(`div`,{style:{color:s.commentColor},children:[n(`span`,{...l,children:[t(`span`,{children:r}),t(Gb,{collapsed:c}),t(`span`,{children:`<!-- `})]}),!c&&i,c&&`...`,t(`span`,{children:`${a||c?` `:r}-->`})]})}function Yb(e){let{attributes:r}=e,{theme:i}=Bb();return r?t(`span`,{children:Object.entries(r).map(([e,r])=>n(`span`,{children:[t(`span`,{style:{color:i.attributeKeyColor},children:` ${e}`}),t(`span`,{style:{color:i.separatorColor},children:`=`}),t(`span`,{style:{color:i.attributeValueColor},children:`"${r}"`})]},`attribute-${e}`))}):null}function Xb(e){let{indentation:r,tagKey:i,attributes:a}=e,{theme:o}=Bb();return n(`div`,{children:[t(`span`,{style:{color:o.separatorColor},children:`${r}<?`}),t(`span`,{style:{color:o.tagColor},children:`${i.slice(1)}`}),t(Yb,{attributes:a}),t(`span`,{style:{color:o.separatorColor},children:`?>`})]})}function Zb(e,t){return Array(t*e+1).join(` `)}function Qb(e){return typeof e==`string`&&e.includes(`
341
- `)}function $b(e){return typeof e!=`string`&&e.length===1&&`#text`in e[0]&&!Qb(e[0][`#text`])}function ex(e){switch(e){case Nb:case Fb:case Pb:return e;default:return e.startsWith(`?`)?Ib:`TAG`}}function tx(e){let t=e[`:@`],n=Ce(e,`:@`),[[r,i]]=Object.entries(n);return{attributes:t,tagKey:r,subElements:i,type:ex(r)}}function nx(e){return e?Object.keys(e).length>0:!1}function rx(r){let{indentation:i,tagKey:a,attributes:o,children:s,isInline:c,hasChildren:l,level:u}=r,{collapsed:d,buttonProps:f}=qb(u),{theme:p}=Bb();return n(`div`,{children:[n(`span`,{...f,children:[t(`span`,{children:i}),t(Gb,{collapsed:d}),t(`span`,{style:{color:p.separatorColor},children:`<`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),!d&&t(Yb,{attributes:o}),d&&nx(o)&&` ...`,t(`span`,{style:{color:p.separatorColor},children:l?`>`:` />`})]}),l&&n(e,{children:[!d&&s,d&&`...`,t(`span`,{style:{color:p.separatorColor},children:`${c||d?``:i}</`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),t(`span`,{style:{color:p.separatorColor},children:`>`})]})]})}function ix(e){let{hasSiblings:n,text:r,indentation:i,isText:a}=e,{theme:o}=Bb(),s=a?{color:o.textColor}:void 0;return Qb(r)||n?t(`div`,{style:s,children:r.split(`
342
- `).filter(e=>!!e.trim()).map((e,n)=>t(`div`,{children:`${i}${e.trim()}`},`line-${n}`))}):t(`span`,{style:s,children:r})}function ax(n){let{elements:r,level:i=0,isText:a=!0}=n,{indentSize:o}=Bb();return!Array.isArray(r)||r.length===0?null:t(e,{children:r.map((e,n)=>{let{tagKey:s,attributes:c,subElements:l,type:u}=tx(e),d=r.length>1,f=Zb(o,i),p=`${i}-${n}`,m=$b(l);switch(u){case Nb:return t(ix,{text:l,indentation:f,hasSiblings:d,isText:a},p);case Pb:return t(Jb,{isInline:m,indentation:f,level:i,children:t(ax,{elements:l,level:i+1,isText:!1})},p);case Fb:return t(Wb,{indentation:f,isInline:m,children:t(ax,{elements:l,level:i+1,isText:!1})},p);case Ib:return t(Xb,{indentation:f,tagKey:s,attributes:c},p);default:return t(rx,{indentation:f,tagKey:s,attributes:c,isInline:m,hasChildren:l.length>0,level:i,children:t(ax,{elements:l,level:i+1})},p)}})})}function ox(){return t(`div`,{children:`Invalid XML!`})}function sx(e){let{theme:n,xml:r,collapsible:i=!1,indentSize:a=2,invalidXml:o,initalCollapsedDepth:s,initialCollapsedDepth:c}=e,[l,u]=z(()=>document.documentElement.classList.contains(`dark`));I(()=>{let e=document.documentElement,t=new MutationObserver(()=>{u(e.classList.contains(`dark`))});return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let d=L(()=>({...l?Rb:Lb,...n}),[l,n]),{json:f,valid:p}=Ub(r),m=L(()=>({theme:d,collapsible:i,indentSize:a,initialCollapsedDepth:c??s}),[d,i,a,s,c]);return p?t(zb.Provider,{value:m,children:t(`div`,{className:`rxv-container`,style:{whiteSpace:`pre-wrap`,fontFamily:d.fontFamily,overflowWrap:`break-word`},children:t(ax,{elements:f})})}):o||t(ox,{})}export{zn as AgentResourceResolverProvider,Xt as ArrayPropertySchema,da as ArtifactContentRenderer,zy as ArtifactEditingSurface,G_ as ChartCodeBlockHandler,na as CodeBlockErrorBoundary,$i as CodeBlockHandlerProvider,U as CodeBlockPlaceholder,A_ as CodeBlockRendererProvider,yy as CollaborativeMarkdownRenderer,Ab as DropZone,J_ as ExpandCodeBlockHandler,Dt as FieldSetContextProvider,Pt as Form,kt as FormContext,Mt as FormContextProvider,Gt as FormError,Wt as FormHelper,Ut as FormLabel,It as GeneratedForm,Nt as Input,cn as JSONCode,bn as JSONDisplay,Mn as JSONEditor,Pn as JSONSwitcher,Ln as JSONTable,fn as JSONView,on as ManageObjectEntry,an as ManagedListProperty,tn as ManagedObject,en as ManagedObjectBase,nn as ManagedObjectProperty,rn as ManagedProperty,sn as ManagedScalarEntry,db as ManagedSchema,tv as MarkdownFigure,rv as MarkdownImage,av as MarkdownLink,$v as MarkdownRenderer,K_ as MermaidCodeBlockHandler,R_ as MermaidDiagram,jn as MonacoEditor,$t as Node,By as Progress,Vy as PropertiesView,Yy as PropertyEditor,Xy as PropertyNameEditor,Jt as PropertySchema,eb as PropertyViewer,zt as ScalarField,qt as Schema,xb as SchemaEditor,fb as SchemaNode,Hy as SvgIcon,jb as UploadResultCategory,Mb as UploadSummary,An as VEditorApi,sx as XMLViewer,Fy as applyArtifactRefreshChanges,my as applyMarkdownEditingChange,Zt as computeTitleFromName,X_ as createDefaultCodeBlockHandlers,ly as createMarkdownBlockAnchor,Uy as createSvgIcon,My as createUnifiedLineDiff,Ey as diffTextSegments,Cy as diffWordSegments,hy as formatMarkdownEditingAction,Wy as getEditableSchemaProperty,Nn as getJSONEditorValue,Dy as getTextLineChangeRegions,Py as isArtifactRefreshEvent,Y_ as isExpandLanguage,V_ as isIncompleteJson,Hn as parseAgentResourceHref,$_ as parseUrlScheme,jy as rebaseTextChanges,dn as renderJsonLine,Bn as useAgentResourceResolver,B_ as useArtifactContent,M_ as useCodeBlockComponent,ea as useCodeBlockContext,j_ as useCodeBlockRendererRegistry,Ot as useFieldSet,jt as useForm,ev as useResolvedUrl,pb as useSchema,Tb as validatePropertyName};
339
+ `);if(!(n.maxChars!==void 0&&u.length>n.maxChars))return u}const Iy=te(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownDocumentEditor})));function Ly(e,t){return e?.path===t?e.event_class===`artifact_updated`||e.event_class===`activity`&&e.tool_status===`completed`&&(e.tool===`edit_artifact`||e.tool===`write_artifact`):!1}function Ry(e,t){if(!Array.isArray(t?.changes)||t.changes.length===0)return;let n=e;for(let e of t.changes){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(t.operation!==`replace`||typeof t.before!=`string`||typeof t.after!=`string`||!n.includes(t.before))return;if(t.replace_all===!0)n=n.split(t.before).join(t.after);else{if(n.indexOf(t.before)!==n.lastIndexOf(t.before))return;n=n.replace(t.before,t.after)}}return n}function zy(e){if(!(!e||typeof e!=`object`||!(`status`in e)))return typeof e.status==`number`?e.status:void 0}function By({regions:e,totalLines:n,onNavigate:r}){let{t:i}=se();return e.length===0?null:t(`nav`,{className:`absolute inset-y-12 end-1 z-10 w-3 rounded-full border border-mixer-muted/25 bg-muted/20`,"aria-label":i(`agent.changeRuler`),children:e.map(e=>{let a=e.startLine/Math.max(1,n)*100,o=Math.max(1.5,(e.endLine-e.startLine+1)/Math.max(1,n)*100);return t(S,{description:i(`agent.changedRegion`,{line:e.startLine+1}),asChild:!0,children:t(`button`,{type:`button`,className:`absolute inset-x-0 rounded-full bg-attention transition-colors hover:bg-info focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-info`,style:{top:`${Math.min(98.5,a)}%`,height:`${Math.min(100-a,o)}%`},onClick:()=>r(e.startLine),"aria-label":i(`agent.changedRegion`,{line:e.startLine+1})})},`${e.startLine}:${e.endLine}`)})})}function Vy(e,t){return Ay(e,t)}function Hy({runId:e,path:a,initialContent:o=``,refreshKey:s=0,refreshDetails:c,readOnly:l=!1,allowComments:u=!1,viewMode:f=`components`,baselineContent:p,className:m,onAction:h,onSendMessage:g,onSendChangesToAgent:v,hasUnsentChanges:y=!1,isSendingChanges:b=!1,sendChangesDisabled:x=!1,toolbarStatus:S,onContentChange:T,onDocumentEdit:E,onSaveStatusChange:D,flushChangesRef:k}){let{client:A}=ye(),{t:j}=se(),M=O(),[N,P]=B(o),[F,te]=B(),[ne,re]=B(),[ie,ae]=B(0),[oe,ce]=B(!!e),[le,ue]=B(!1),[de,fe]=B(!1),[pe,me]=B(),[he,ge]=B(),[_e,ve]=B(!1),be=!l||u,xe=f!==`document`||he?`idle`:le||de?`saving`:F?`saved`:`idle`;L(()=>{D?.(xe)},[xe,D]);let V=z(N),Se=z(F),Ce=z(0),we=z(void 0),Te=z(void 0),Ee=z(!1),De=z(void 0),Oe=z(()=>Promise.resolve(!1)),ke=z(!1),Ae=z(!1),je=z(null),Me=z(F),Ne=z(o),Pe=z(void 0),Fe=z(o),Ie=z(null),Le=R(()=>Vy(p??N,N),[p,N]),Re=R(()=>N.split(`
340
+ `).length,[N]),ze=I(e=>{Pe.current=e,ge(e)},[]);L(()=>{V.current=N},[N]),L(()=>{Se.current=F},[F]),L(()=>{f===`document`&&(Ae.current=!1,ke.current=!1)},[f]);let Be=I(async t=>{if(!e)return;let n=++Ce.current;ce(!0),me(void 0);for(let r=0;r<=60;r++)try{let t=await A.agents.getArtifactContent(e,a);if(Ce.current!==n)return;let r=V.current;r&&r!==t.content&&(re(r),ae(e=>e+1)),V.current=t.content,Se.current=t.generation,Fe.current=t.content,!ke.current&&Te.current===void 0&&!Ee.current&&(Me.current=t.generation,Ne.current=t.content),P(t.content),te(t.generation),me(void 0),ce(!1),T?.(t.content,t.generation);return}catch(e){if(Ce.current!==n||!t||zy(e)!==404||r===60){if(Ce.current!==n)return;me(w(e,j(`agent.failedToLoadArtifact`))),ce(!1);return}await new Promise(e=>setTimeout(e,500))}},[A,T,a,e,j]);L(()=>(Ce.current++,V.current=o,Se.current=void 0,Fe.current=o,Me.current=void 0,Ne.current=o,Pe.current=void 0,ke.current=!1,Ae.current=!1,P(o),te(void 0),re(void 0),me(void 0),ge(void 0),ve(!1),fe(!1),ce(!!e),e&&Be(!0),()=>{Ce.current++}),[o,Be,e]),L(()=>{if(!e||s<=0||Pe.current)return;let t=V.current,n=Ry(t,c);n!==void 0&&n!==t&&(V.current=n,Se.current=void 0,re(t),ae(e=>e+1),P(n),te(void 0),T?.(n)),Be(!1)},[Be,T,c,s,e]);let Ve=I((e,t)=>{let n=V.current;V.current=e,Se.current=t,Ne.current=e,Me.current=t,Te.current=void 0,ze(void 0),je.current?.getMarkdown()!==e&&je.current?.commands.setContent(e,{contentType:`markdown`,emitUpdate:!1}),n!==e&&(re(n),ae(e=>e+1)),P(e),te(t),fe(!1),T?.(e,t)},[T,ze]),He=I(async(t,n,r)=>{if(!e)return!1;V.current=n,Te.current=void 0,P(n),fe(!1),ve(!0);let i,o;try{let s=await A.agents.getArtifactContent(e,a);i=s.content,o=s.generation,Fe.current=s.content;let c=Py(t,n,s.content);if(c.status===`conflict`)return ze({baseContent:t,localContent:n,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;let l=s.generation;if(c.content!==s.content)try{l=(await A.agents.updateArtifactContent(e,a,{content:c.content,generation:s.generation})).generation}catch(e){if(zy(e)===412)return ze({baseContent:s.content,localContent:c.content,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;throw e}return Ve(c.content,l),M({status:`success`,title:j(`agent.artifactConflictRebased`),duration:3e3}),{content:c.content,generation:l}}catch(e){return ze({baseContent:t,localContent:n,remoteContent:i,remoteGeneration:o,pendingAction:r}),M({status:`error`,title:j(`agent.artifactConflictTitle`),description:w(e,j(`agent.failedToLoadArtifact`)),duration:5e3}),!1}finally{ve(!1)}},[Ve,A.agents,a,e,j,M,ze]),H=I(async t=>{if(t.action===`comment`){await h?.(t);return}if(Pe.current){M({status:`warning`,title:j(`agent.artifactConflictTitle`),duration:3e3});return}if(!e||!Se.current){M({status:`warning`,title:j(`agent.artifactEditingUnavailable`),duration:3e3});return}let n=V.current,r=_y(n,t);if(r===void 0){M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:j(`agent.documentEditApplyFailedDescription`),duration:5e3});return}try{let i=await A.agents.updateArtifactContent(e,a,{content:r,generation:Se.current});V.current=r,Se.current=i.generation,Ne.current=r,Me.current=i.generation,re(n),ae(e=>e+1),P(r),te(i.generation),T?.(r,i.generation),await h?.({...t,applied:!0,base_version:i.generation}),Fe.current=r}catch(e){if(zy(e)===412){let e=await He(n,r,t);e&&(await h?.({...t,applied:!0,base_version:e.generation}),Fe.current=e.content);return}M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3})}},[A,h,T,a,He,e,j,M]),Ue=I(()=>{if(!e)return Promise.resolve(!1);if(De.current)return De.current;let t=(async()=>{Ee.current=!0,ue(!0);try{for(;Te.current!==void 0;){let t=Te.current;Te.current=void 0;let n=Me.current;if(!n)throw Error(j(`agent.artifactEditingUnavailable`));let r=await A.agents.updateArtifactContent(e,a,{content:t,generation:n});Se.current=r.generation,Me.current=r.generation,Ne.current=t,te(r.generation),T?.(V.current,r.generation)}return fe(!1),!0}catch(e){return zy(e)===412?!!await He(Ne.current,V.current):(M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3}),!1)}finally{Ee.current=!1,ue(!1)}})();return De.current=t,t.finally(()=>{De.current===t&&(De.current=void 0)}),t},[A.agents,T,a,He,e,j,M]);Oe.current=Ue;let Ge=I(async()=>{we.current!==void 0&&(clearTimeout(we.current),we.current=void 0);let t=je.current?.getMarkdown();t!==void 0&&t!==V.current&&(V.current=t,P(t),T?.(t,Se.current),Te.current=t);let n=Pe.current;if(n&&!await He(n.baseContent,V.current))return!1;for(;Te.current!==void 0||De.current;)if(!await Ue())return!1;if(!e||!Se.current)return!1;let r=Fe.current;return Fe.current=V.current,{previous:r,current:V.current}},[T,Ue,He,e]);L(()=>{if(k)return k.current=Ge,()=>{k.current===Ge&&(k.current=null)}},[k,Ge]);let Ke=I(e=>{if(e===V.current||ke.current&&Te.current===void 0&&!Ee.current&&e===Ne.current)return;if(!Ae.current){V.current=e,P(e);return}V.current=e,P(e),E?.(),T?.(e,Se.current);let t=Pe.current;if(t){ze({...t,localContent:e}),fe(!1);return}fe(!0),Te.current=e,we.current!==void 0&&clearTimeout(we.current),we.current=setTimeout(()=>{we.current=void 0,Ue()},400)},[T,E,Ue,ze]),qe=I(e=>{ke.current=e,e&&(Ae.current=!0),(e||Te.current===void 0&&!Ee.current)&&(Me.current=Se.current,Ne.current=V.current)},[]),Je=I(async()=>{let e=Pe.current;if(!e||_e)return;let t=await He(e.baseContent,V.current,e.pendingAction);t&&e.pendingAction&&(await h?.({...e.pendingAction,applied:!0,base_version:t.generation}),Fe.current=t.content)},[_e,h,He]),Ye=I(e=>{let t=Ie.current?.querySelector(`.vertesia-markdown-document-editor-content`);if(!t)return;let n=Math.min(1,e/Math.max(1,Re-1));t.scrollTo({top:n*Math.max(0,t.scrollHeight-t.clientHeight),behavior:`smooth`})},[Re]);return L(()=>()=>{we.current!==void 0&&clearTimeout(we.current);let e=je.current?.getMarkdown();e!==void 0&&e!==V.current&&(V.current=e,Te.current=e),Te.current!==void 0&&Oe.current()},[]),n(`div`,{className:m??`relative h-full min-h-0 overflow-y-auto px-4 py-3`,children:[he?t(`div`,{className:`absolute inset-x-4 top-3 z-30`,role:`alert`,children:t(d,{status:`warning`,title:j(`agent.artifactConflictTitle`),className:`shadow-lg`,children:n(`div`,{className:`space-y-3`,children:[t(`p`,{children:j(`agent.artifactConflictDescription`)}),t(`div`,{className:`flex justify-end`,children:n(r,{variant:`outline`,size:`sm`,disabled:_e,onClick:()=>void Je(),children:[_e?t(_,{size:`sm`}):null,j(`agent.artifactConflictRetry`)]})})]})})}):null,oe&&!N?t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}):pe&&!N?n(i,{className:`h-full min-h-[200px] flex-col gap-3 text-center text-muted`,children:[t(`span`,{children:pe}),t(r,{variant:`outline`,size:`sm`,onClick:()=>void Be(!1),children:j(`agent.retry`)})]}):f===`document`?t(ee,{fallback:t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}),children:t(`div`,{className:`flex h-full min-h-0 flex-col`,children:n(`div`,{ref:Ie,className:`relative min-h-0 flex-1`,children:[t(Iy,{value:N,onChange:Ke,artifactRunId:e,editable:!l&&!!e,externalValueSync:`when-blurred`,onFocusChange:qe,onEditor:e=>{je.current=e},onSendComment:g&&e&&!he&&be?g:void 0,onSendChangesToAgent:v,hasUnsentChanges:y,isSendingChanges:b,sendChangesDisabled:x||!e||!!he,toolbarStatus:S,contentClassName:`pe-5`}),t(By,{regions:Le,totalLines:Re,onNavigate:Ye}),!D&&xe!==`idle`?n(`div`,{className:C(`pointer-events-none absolute bottom-3 end-6 flex items-center gap-1.5 rounded-full`,`border border-mixer-muted/25 bg-background/90 px-2.5 py-1 text-[11px] shadow-sm`,le||de?`text-muted`:`text-success`),children:[le||de?t(_,{size:`sm`}):t(We,{className:`size-3`}),j(le||de?`agent.savingWorkingCopy`:`agent.savedToWorkingCopy`)]}):null]})})}):t(`div`,{className:`vprose prose-sm mx-auto max-w-5xl`,children:t(Sy,{artifactRunId:e,resource:{kind:`agent_artifact`,run_id:e??`pending`,path:a},baseVersion:F,readOnly:l||!e||!!he,allowComments:be&&!!e&&!he,highlightChangesFrom:ne,highlightVersion:ie,onAction:H,children:N})}),oe&&N?t(`div`,{className:`absolute end-3 top-3 rounded-full bg-background/80 p-2 shadow-sm`,children:t(nt,{className:`size-4 animate-pulse text-muted`})}):null]})}function Uy({percent:e}){return t(`div`,{className:`w-full bg-muted rounded-full h-2.5`,children:t(`div`,{className:`bg-primary h-2.5 rounded-full`,style:{width:`${e}%`}})})}function Wy({className:e,properties:r}){return t(b,{className:e,children:t(`tbody`,{children:r.map(e=>n(`tr`,{children:[n(`td`,{className:`w-1/3 font-semibold gap-2`,children:[t(`span`,{children:e.name}),e.description&&t(S,{description:e.description,placement:`top`,children:t(at,{className:`size-3 ms-2 text-muted`})})]}),t(`td`,{className:`w-2/3`,children:e.value??`undefined`})]},e.name))})})}function Gy({content:e,...n}){let r=z(null);return L(()=>{if(!r.current)return;let t=new DOMParser().parseFromString(e,`image/svg+xml`).querySelector(`svg`);if(!t){console.warn(`SvgIcon: No <svg> element found in provided string`),r.current.innerHTML=``;return}Object.entries(n).forEach(([e,n])=>{if(n==null)return;let r=e===`className`?`class`:e;t.setAttribute(r,String(n))}),r.current.innerHTML=``,r.current.appendChild(t)}),t(`span`,{ref:r})}function Ky(e){return n=>t(Gy,{content:e,...n})}function qy(e){return{name:e.getNameSignature(),type:e.getTypeSignature(),description:e.description,extractable:e.extractable}}var Jy;(function(e){e.string=`string`,e.number=`number`,e.integer=`integer`,e.boolean=`boolean`,e.object=`object`,e.any=`any`,e.text=`text`,e.media=`media`,e.document=`document`})(Jy||={});function Yy(e){e=e.trim();let t=!1,n=!1;e.endsWith(`?`)&&(n=!0,e=e.substring(0,e.length-1).trim()),e.endsWith(`[]`)&&(t=!0,e=e.substring(0,e.length-2).trim());let r=Jy[e];if(!r)throw Error(`Unknown type "${e}"`);return{name:r,isArray:t,isNullable:n,isObject:r===Jy.object}}function Xy(){let e=Object.values(Jy),t=[...e];for(let n of e)t.push(`${n}[]`);return e.sort(),t}const Zy=Xy();function Qy({value:e,onChange:i,onCancel:a,onSave:o}){let{t:s}=se(),[c,l]=B(!1);return e?n(`div`,{className:`flex items-center`,children:[t(`div`,{className:`flex-1`,children:t($y,{value:e.name,onChange:t=>{i({...e,name:t})},onCancel:a,onSave:o})}),t(`div`,{className:`px-1 font-semibold`,children:`:`}),t(`div`,{className:`flex-1`,children:t(eb,{value:e.type,onChange:t=>{i({...e,type:t})},onCancel:a,onSave:o})}),n(`div`,{children:[t(r,{variant:`ghost`,size:`xs`,onClick:()=>l(!0),title:s(`widgets.schema.editDescription`),children:t(bt,{className:`size-4`})}),t(tb,{value:e.description,isOpen:c,onClose:t=>{t!==void 0&&typeof t==`string`&&i({...e,description:t},!0),l(!1)}})]})]}):null}function $y({value:e,onChange:n,onCancel:r,onSave:i}){let a=z(null);return L(()=>{a.current?.focus()},[]),t(`input`,{onKeyUp:e=>{switch(e.key){case`Enter`:i?.();break;case`Escape`:r?.()}},ref:a,value:e,onChange:e=>{n(e.target.value)},className:v.INPUT_UNSTYLED,style:{fontSize:`inherit`,width:``,display:`inline`}})}function eb({value:e,onChange:n,onCancel:r,onSave:i}){return t(g,{className:v.INPUT_UNSTYLED,options:Zy,value:e||``,onBlur:()=>{i?.()},onChange:n,onKeyDown:(e,t)=>{t||(e.key===`Enter`?i?.():e.key===`Escape`&&r?.())},popupClass:`schema-type-suggest-popup z-90`})}function tb({value:e,isOpen:r,onClose:i}){let{t:a}=se();return n(f,{isOpen:r,onClose:i,children:[t(h,{children:a(`widgets.schema.editDescription`)}),t(nb,{value:e,onSave:i})]})}function nb({value:i,onSave:a}){let{t:o}=se(),s=z(null),[c,l]=B(i||``);return L(()=>{s.current?.focus()},[]),n(e,{children:[t(p,{className:`h-max`,children:t(`textarea`,{ref:s,className:`dark:bg-muted w-full h-full dark:text-white`,value:c,onChange:e=>l(e.target.value)})}),t(m,{children:t(r,{onClick:()=>a(c),children:o(`store.saveChanges`)})})]})}function rb({value:e}){let{t:r}=se();if(!e)return null;let i=e.extractable===!1;return n(`div`,{className:`w-full flex items-baseline gap-2 min-w-0`,children:[t(`div`,{className:`truncate`,children:e.name||``}),t(`div`,{className:`text-sm text-muted shrink-0`,children:e.type||``}),i&&t(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:r(`widgets.schema.extractFromDocumentHint`),children:r(`widgets.schema.noExtract`)})]})}function ib(e,t,n){if(e.properties){let r=e.properties,i={};for(let e of Object.keys(r)){let a=r[e];e===t?i[n]=a:i[e]=a}e.properties=i}e.required&&=e.required.map(e=>e===t?n:e)}function ab(e,t,n){if(Array.isArray(e.required)){let r=e.required.indexOf(t);n?r<0&&e.required.push(t):r>-1&&e.required.splice(r,1)}else n&&(e.required=[t])}function ob(e,t){let n=t.name===`any`?void 0:t.isNullable?[t.name,`null`]:t.name;if(t.isArray){if(e.type=`array`,e.properties=void 0,!e.items||Array.isArray(e.items))e.items={type:n,properties:t.isObject?{}:void 0};else{let r=e.items;r.type=n,t.isObject&&!r.properties&&(r.properties={})}}else e.type=n,e.items=void 0,t.isObject?e.properties||={}:e.properties=void 0}function sb(e,t){e.properties&&(delete e.properties[t],Array.isArray(e.required)&&(e.required=e.required.filter(e=>e!==t)))}function cb(e,t,n,r=!1){if(e.type!==`object`)throw Error(`Cannot add property to a non-object schema`);e.properties||={};let i={};return ob(i,n),e.properties[t]=i,r&&(Array.isArray(e.required)?fb(e.required,t):e.required=[t]),i}function lb(e){let t=!1,n=!1,r,i=e.type;if(Array.isArray(i))for(let e of i)e===`null`?t=!0:r||=e;else r=i;r||=`any`,r===`array`&&(n=!0,r=ub(e.items));let a=r;switch(e.editor){case`textarea`:a=`text`;break;case`media`:a=`media`;break;case`document`:a=`document`}return{isNullable:t,isArray:n,isObject:r===`object`,name:a}}function ub(e){if(!e)return`any`;let t;return t=db(Array.isArray(e)?e[0].type:e.type),(t===`array`||t===`null`)&&(t=`any`),t}function db(e){return e?Array.isArray(e)?e.find(e=>e!==`null`)||`any`:e:`any`}function fb(e,t){e.includes(t)||e.push(t)}let pb=0;var mb=class e{source;onChange=()=>{};schema;root;constructor(e,t){this.schema=e?typeof e==`string`?JSON.parse(e):e:{title:t,type:`object`,properties:{}},this.schema.properties||(this.schema.properties={}),this.root=new hb(``,this.schema,this),this.root.loadChildren()}get isEmpty(){return!this.root.children||this.root.children.length===0}get children(){return this.root.children??[]}reload(){return this.root=new hb(``,this.schema,this),this.root.loadChildren(),this.onChange?.(this),this}withSource(e,t){return this.source={uri:t,name:e},this}withChangeListener(e){return this.onChange=e,this}replaceSchema(e){this.schema=e||{title:this.schema.title,type:`object`,properties:{}},this.reload()}clone(){let t=new e(this.schema);return t.source=this.source,this.onChange&&t.withChangeListener(this.onChange),t}},hb=class e{schema;loader;parent;name;isRequired=!1;type;children;constructor(e,t,n,r){if(this.schema=t,this.loader=n,this.parent=r,this.name=e,this.type=lb(t),this.parent){let t=this.parent._getPropertiesSchema().required;this.isRequired=t&&Array.isArray(t)?t.includes(e):!1}}get title(){return typeof this.schema.title==`string`?this.schema.title:void 0}set title(e){this.schema.title=e}get description(){return this.schema.description}set description(e){this.schema.description=e}get extractable(){return this.schema[`x-extract`]!==!1}set extractable(e){e?delete this.schema[`x-extract`]:this.schema[`x-extract`]=!1}get isParent(){return this.type.isObject}get isNew(){return!!this.schema.isNew}set isNew(e){e?this.schema.isNew=!0:delete this.schema.isNew}resetIsNew(){let e=this.isNew;return this.isNew=!1,e}getNameSignature(){return`${this.name}${this.isRequired?``:`?`}`}getTypeSignature(){return`${this.type.name}${this.type.isArray?`[]`:``}${this.type.isNullable?`?`:``}`}getSignature(){return`${this.getNameSignature()}: ${this.getTypeSignature()}`}reloadTree(){this.loader.reload()}loadChildren(){this.children=[];let e=this.schema.items?.properties;this.schema.items&&e?this._loadChildren(e,this.children):this.schema.properties&&this._loadChildren(this.schema.properties,this.children)}_loadChildren(t,n){for(let r of Object.keys(t)){let i=t[r],a=new e(r,i,this.loader,this);n.push(a),a.isParent&&a.loadChildren()}}_getPropertiesSchema(){return this.type.isArray&&this.type.isObject?this.schema.items:this.schema}findAvailableChildName(e){let t=this._getPropertiesSchema().properties||{},n;do n=e+ ++pb;while(t[n]);return n}addChild(t,n,r=!1){if(!this.type.isObject)throw Error(`Cannot add child to a non object node`);this.children||=[];let i=cb(this._getPropertiesSchema(),t,n,r),a=new e(t,i,this.loader,this);return this.children.push(a),a}remove(){return this.parent?.type.isObject?(sb(this.parent._getPropertiesSchema(),this.name),this.parent.children&&(this.parent.children=this.parent.children.filter(e=>e.name!==this.name)),!0):!1}update(e){let t=!1;e.name!=null&&this.name!==e.name&&(this.parent&&ib(this.parent._getPropertiesSchema(),this.name,e.name),this.name=e.name,t=!0),e.isRequired!=null&&this.isRequired!==e.isRequired&&(this.parent&&ab(this.parent._getPropertiesSchema(),this.name,e.isRequired),this.isRequired=e.isRequired,t=!0);let n=e.type?.name;n===`any`&&(n=void 0);let r=n!==this.schema.type;return e.type&&(ob(this.schema,e.type),this.type=e.type,this.type.isObject?this.children||=[]:this.children=void 0,t=!0),this.schema.editor&&e.editor===null?(this.schema.editor=void 0,t=!0):e.editor?(this.schema.editor=e.editor,t=!0):r&&(this.schema.editor=void 0,t=!0),e.description!==this.description&&(this.description=e.description,t=!0),e.extractable!=null&&this.extractable!==e.extractable&&(this.extractable=e.extractable,t=!0),t}getUpdateFromNameAndTypeSignature(e,t){let n=e.trim(),r=!0;n.endsWith(`?`)&&(n=n.substring(0,n.length-1).trim(),r=!1);let i=Yy(t),a;return i.name===`text`?(i.name=Jy.string,a=`textarea`):i.name===`media`?(i.name=Jy.any,a=`media`):i.name===`document`?(i.name=Jy.any,a=`document`):a=null,{name:n,type:i,isRequired:r,editor:a}}updateFromNameAndTypeSignature(e,t){return this.update(this.getUpdateFromNameAndTypeSignature(e,t))}updateFromSignature(e){e=e.trim();let t=e.indexOf(`:`);if(t<0)throw Error(`Expecting a name and a type separated by a colon`);let n=e.substring(0,t),r=e.substring(t+1);return this.updateFromNameAndTypeSignature(n,r)}};function gb(e){let[t,n]=B(new mb(e||{type:`object`,properties:{}}).withChangeListener(e=>{n(e.clone())}));return t}const _b=`block text-sm sm:leading-6 rounded-md border-0 py-1.5 px-4`,vb=`${_b} hover:shadow-xs hover:ring-1 hover:ring-inset hover:ring-ring`,yb=`${_b} shadow-xs ring-1 ring-inset ring-ring`;function bb({value:e,onChange:r,onDelete:i,outlineOnHover:a=!1,editOnClick:o=!0,placeholder:s,viewer:c,editor:l,skipClickOutside:u,isEditing:d=!1,readonly:f=!1,onValidate:p}){let{on:m,off:h,isOn:g}=E(d),[_,v]=B();return n(`div`,{className:``,children:[g&&!f?t(Sb,{value:e,onSave:e=>{if(p){let t=p(e);if(t){v(t);return}v(void 0)}r(e)&&h()},onCancel:h,editor:l,skipClickOutside:e=>u?u(e):!1}):t(xb,{value:e,onEdit:m,viewer:c,placeholder:s,outlineOnHover:a,editOnClick:o,onDelete:i,readonly:f}),_&&t(`div`,{className:`text-destructive text-sm`,children:_})]})}function xb({viewer:e,value:i,onEdit:a,editOnClick:o,outlineOnHover:s,placeholder:c,onDelete:l,readonly:u}){let d=()=>{o&&a()},f=e=>{e.key===`Enter`&&a()},p=`invisible group-hover:visible`;return n(`div`,{role:o?`button`:void 0,tabIndex:0,onKeyUp:f,onClick:d,className:k(`flex justify-start items-center group`,s?vb:_b,{"cursor-pointer":o}),children:[t(e,{value:i,placeholder:c}),n(`div`,{className:`ms-auto flex gap-2`,children:[!u&&l&&t(r,{variant:`ghost`,size:`sm`,className:p,onClick:l,children:t(xt,{className:`size-4`})}),u?null:t(r,{variant:`ghost`,size:`sm`,className:p,onClick:a,children:t(_t,{className:`size-4`})})]})]})}function Sb({editor:e,value:n,onSave:r,onCancel:i,skipClickOutside:a}){let[o,s]=B(n),c=z(n),[l,u]=B(null),d=()=>{r(c.current)},f=T(d,a);return t(`div`,{ref:f,children:t(`div`,{className:yb,children:t(`div`,{className:`w-full`,onClick:e=>e.stopPropagation(),children:t(e,{value:o,onChange:(e,t=!1)=>{s(e),c.current=e,t&&(l&&clearTimeout(l),u(setTimeout(()=>{r(e)},500)))},onSave:d,onCancel:i})})})})}function Cb(e){return!!e.target.closest?.(`.schema-type-suggest-popup`)}function wb({schema:e,readonly:r=!1}){let{t:i}=se();return n(`div`,{className:`space-y-1`,children:[n(`div`,{className:`flex items-center gap-2 px-2 py-1 text-xs font-medium text-muted border-b border-border`,children:[t(`div`,{className:`flex-1 min-w-0`,children:i(`widgets.schema.propertyColumn`)}),!r&&t(`div`,{className:`shrink-0 w-28 text-end pe-1`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.extractFromDocument`)}),t(`div`,{className:`w-8 shrink-0`})]}),n(`ul`,{className:``,children:[e.children.map(e=>Tb(e,r)),r?null:t(Ab,{parent:e.root})]})]})}function Tb(e,n){return e.isParent?t(Db,{property:e,readonly:n},e.name):t(Eb,{node:e,readonly:n},e.name)}function Eb({node:e,readonly:n}){return t(`li`,{className:`border-b border-border/40 last:border-0`,children:t(kb,{property:e,readonly:n})})}function Db({property:e,readonly:i}){let[a,o]=B(!0),s=a?Ge:Ke;return n(`li`,{className:`border-b border-border/40 last:border-0`,children:[n(`div`,{className:`flex items-center w-full gap-1`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(kb,{property:e,readonly:i})}),t(r,{variant:`ghost`,size:`icon`,onClick:()=>o(!a),"aria-label":a?`Collapse ${e.name}`:`Expand ${e.name}`,"aria-expanded":a,className:`shrink-0`,children:t(s,{className:`size-4 cn-rtl-flip`})})]}),a&&n(`ul`,{className:`ms-4 border-s border-border border-dashed`,children:[(e.children||[]).map(e=>Tb(e,i)),i?null:t(Ab,{parent:e})]})]})}function Ob(e){if(!e)return`Name is required`;if(!/^[a-zA-Z0-9_]+[?]?$/.test(e))return`Only letters, numbers, underscores or question mark are allowed (a-zA-Z0-9_?)`}function kb({property:e,readonly:r}){let{t:i}=se(),a=O(),o=t=>{try{t.description&&typeof t.description!=`string`&&(t.description=void 0);let n=e.getUpdateFromNameAndTypeSignature(t.name,t.type);e.update({...n,description:t.description,extractable:t.extractable})&&e.reloadTree()}catch(e){return a({status:`error`,title:i(`widgets.schema.invalidPropertyDeclaration`),description:w(e),duration:9e3}),!1}return!0},s=t=>{e.update({extractable:t})&&e.reloadTree()},c=e.resetIsNew(),l=qy(e);return n(`div`,{className:`flex items-center gap-2 w-full min-w-0 py-0.5`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(bb,{value:l,onChange:o,onDelete:()=>{e.remove(),e.reloadTree()},editor:Qy,viewer:rb,outlineOnHover:!0,isEditing:c,skipClickOutside:Cb,readonly:r,onValidate:e=>Ob(e.name)})}),r?e.extractable===!1?t(`div`,{className:`shrink-0 w-28 flex justify-end pe-1`,children:t(`span`,{className:`text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.noExtract`)})}):null:t(`div`,{className:`shrink-0 w-28 flex items-center justify-end gap-1.5 pe-1`,children:t(y,{size:`sm`,value:e.extractable,onChange:s,"aria-label":`${i(`widgets.schema.extractFromDocument`)}: ${e.name}`})})]})}function Ab({parent:e}){return n(r,{variant:`ghost`,onClick:()=>{let t=e.findAvailableChildName(`new_property_`),n=e.addChild(t,{isObject:!1,isArray:!1,isNullable:!1,name:Jy.string},!0);n.isNew=!0,e.reloadTree()},children:[t(mt,{className:`size-4`}),`Add property`]})}function jb(e){return e.isFile}function Mb(e){return e.isDirectory}function Nb({onDrop:e,message:i,buttonLabel:a,allowFolders:o=!0,className:s=``}){let{t:c}=se(),l=a??c(`upload.uploadFiles`),[u,d]=B(!1),f=z(null),p=e=>{e.preventDefault(),e.dataTransfer.types.includes(`Files`)&&d(!0)},m=e=>{e.preventDefault(),f.current&&!f.current.contains(e.relatedTarget)&&d(!1)},h=async t=>{if(t.preventDefault(),d(!1),t.dataTransfer.items&&t.dataTransfer.items.length>0){let n=Array.from(t.dataTransfer.items),r=[],i=new Set,a=async e=>{if(jb(e)){let t=await new Promise(t=>{e.file(n=>{Object.defineProperty(n,"webkitRelativePath",{writable:!0,value:e.fullPath.substring(1)}),t(n)})});!t.name.startsWith(`.`)&&t.size>0&&r.push(t);let n=e.fullPath.substring(1).split(`/`).slice(0,-1).join(`/`);n&&i.add(n)}else if(Mb(e)){let t=e.createReader(),n=await new Promise(e=>{t.readEntries(t=>{e(t)})});await Promise.all(n.map(a));let r=e.fullPath.substring(1);r&&i.add(r)}};try{if(await Promise.all(n.map(e=>{let t=e.webkitGetAsEntry?e.webkitGetAsEntry():e;return t?a(t):Promise.resolve()})),r.length>0){let t=new Set(Array.from(i).map(e=>e.split(`/`)[0]).filter(Boolean)).size,n=r.length,a=``;a=t>0?c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:n}):c(`upload.preparingFiles`,{count:n}),e(r,{count:r.length,message:a})}}catch(n){console.error(`Error processing dropped files:`,n);let r=Array.from(t.dataTransfer.files);r.length>0&&e(r)}}else t.dataTransfer.files&&t.dataTransfer.files.length>0&&e(Array.from(t.dataTransfer.files))},g=t=>{if(t&&t.length>0){let n=Array.from(t);if(n.some(e=>e.webkitRelativePath?.includes(`/`))){let t=new Set(n.map(e=>e.webkitRelativePath.split(`/`)[0]).filter(Boolean)).size,r=n.length,i=c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:r});e(n,{count:n.length,message:i})}else e(n,{count:n.length,message:c(`upload.preparingFiles`,{count:n.length})})}};return n(`div`,{className:`flex flex-col items-center justify-center py-12 border-2 rounded-lg transition-colors ${u?`border-primary bg-primary/10`:`border-dashed border-border`} ${s}`,onDragOver:p,onDragLeave:m,onDrop:h,children:[t(St,{className:`h-12 w-12 mb-3 transition-colors ${u?`text-primary`:`text-muted/50`}`}),t(`p`,{className:`text-muted`,children:i}),n(`div`,{className:`flex gap-2 justify-center mt-2`,children:[t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e?.click(),e.onchange=()=>{g(e.files)}},children:l}),o&&t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e.webkitdirectory=!0,e?.click(),e.onchange=()=>{g(e.files)}},children:c(`upload.selectFolder`)})]})]})}function Pb({title:e,count:r,icon:i=t(Je,{className:`h-4 w-4 text-success`}),items:a}){let{t:o}=se(),[s,c]=B(!1),l=ie();return n(`div`,{className:`border border-border rounded-md overflow-hidden`,children:[n(`button`,{type:`button`,"aria-expanded":s,"aria-controls":l,className:`w-full flex items-center justify-between p-3 bg-muted/10 cursor-pointer text-start bg-transparent border-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,onClick:()=>c(!s),children:[n(`span`,{className:`flex items-center`,children:[t(`span`,{className:`me-2`,children:i}),t(`span`,{className:`font-medium`,children:e}),t(`span`,{className:`ms-2 px-2 py-0.5 bg-muted/20 rounded-full text-xs`,children:r})]}),t(`span`,{className:`text-muted`,"aria-hidden":`true`,children:t(`svg`,{className:`h-5 w-5 transition-transform ${s?`transform rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})})]}),s&&t(`div`,{id:l,className:`p-3 border-t border-border max-h-48 overflow-y-auto`,children:a.length>0?t(`ul`,{className:`space-y-1`,children:a.map(e=>t(`li`,{className:`text-sm py-1 px-2 rounded hover:bg-muted/10`,children:e},e))}):t(`div`,{className:`text-sm text-muted py-2`,children:o(`upload.noItems`)})})]})}function Fb({files:e,className:r=``,location:i,collection:a}){let{t:o}=se(),s=e.filter(e=>e.status===`success`),c=e.filter(e=>e.status===`updated`),l=e.filter(e=>e.status===`skipped`),u=e.filter(e=>e.status===`failed`),d=s.length,f=c.length,p=l.length,m=u.length,h=e.length;return n(`div`,{className:`flex flex-col py-2 ${r}`,children:[n(`div`,{className:`flex items-center mb-4`,children:[t(`div`,{className:`size-8 me-4 rounded-full bg-success/10 flex items-center justify-center`,children:t(Je,{className:`size-4 text-success`})}),t(`div`,{children:n(`p`,{className:`text-muted`,children:[o(`upload.filesProcessed`,{count:h}),a?o(`upload.inCollection`,{collection:a}):``,i?o(`upload.inFolder`,{location:i}):``]})})]}),n(`div`,{className:`space-y-3 mt-2`,children:[d>0&&t(Pb,{title:o(`upload.successfullyUploaded`),count:d,icon:t(Je,{className:`h-4 w-4 text-success`}),items:s.map(e=>e.name)}),f>0&&t(Pb,{title:o(`upload.successfullyUpdated`),count:f,icon:t(Je,{className:`h-4 w-4 text-info`}),items:c.map(e=>e.name)}),p>0&&t(Pb,{title:o(`upload.skippedAlreadyExisted`),count:p,icon:t(qe,{className:`h-4 w-4 text-attention`}),items:l.map(e=>e.name)}),m>0&&t(Pb,{title:o(`upload.failedToUpload`),count:m,icon:t(Ye,{className:`h-4 w-4 text-destructive`}),items:u.map(e=>e.name)})]})]})}const Ib=`#text`,Lb=`#comment`,Rb=`#cdata`,zb=`DECLARATION_TAG`,Bb={tagColor:`#d43900`,textColor:`#333`,attributeKeyColor:`#2a7ab0`,attributeValueColor:`#008000`,separatorColor:`#333`,commentColor:`#aaa`,cdataColor:`#1d781d`,fontFamily:`monospace`},Vb={attributeKeyColor:`#FFD700`,attributeValueColor:`#FF4500`,tagColor:`#87CEFA`,textColor:`#00FF00`,separatorColor:`#FFD700`,commentColor:`#BEBEBE`,cdataColor:`#33CC66`,fontFamily:`monospace`},Hb=N({theme:Bb,collapsible:!1,indentSize:2}),Ub=()=>re(Hb);let Wb;function Gb(){return Wb??=import(`fast-xml-parser`).then(({XMLParser:e})=>new e({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:``,allowBooleanAttributes:!0,commentPropName:Lb,cdataPropName:Rb,parseTagValue:!1})).catch(e=>{throw Wb=void 0,e}),Wb}async function Kb(e){try{let t=new DOMParser().parseFromString(e,`application/xml`),n=t.documentElement.localName===`parsererror`?t.documentElement:void 0;if(n)throw Error(n.textContent?.trim()||`Invalid XML!`);let r=(await Gb()).parse(e);if(e.trim().length>0&&r.length===0)throw Error(`Invalid XML!`);return{json:r,valid:!0}}catch(e){return{json:null,valid:!1,errorMessage:`Fail to parse: ${e instanceof Error?e.message:String(e)}`}}}function qb(e){let[t,n]=B(void 0);return L(()=>{let t=!1;return n(void 0),Kb(e).then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}function Jb(e){let{indentation:r,children:i,isInline:a}=e,{theme:o}=Ub();return n(`div`,{style:{color:o.cdataColor},children:[t(`span`,{children:`${r}<![CDATA[`}),i,t(`span`,{children:`${a?``:r}]]>`})]})}function Yb(e){let{collapsible:n,theme:r}=Ub(),{collapsed:i}=e;return n?t(`span`,{style:{position:`relative`},children:t(`span`,{style:{position:`absolute`,right:`0`,border:0,padding:0,background:`none`},children:t(Xb,{fill:r.separatorColor,style:{transform:`rotate(${i?0:90}deg)`,transition:`transform 0.2s`}})})}):null}function Xb({...e}){return t(`svg`,{width:`16px`,height:`16px`,viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:t(`path`,{d:`M9 17.898C9 18.972 10.2649 19.546 11.0731 18.8388L17.3838 13.3169C18.1806 12.6197 18.1806 11.3801 17.3838 10.6829L11.0731 5.16108C10.2649 4.45388 9 5.02785 9 6.1018V17.898Z`})})}function Zb(e){let{collapsible:t,initialCollapsedDepth:n}=Ub(),[r,i]=B(()=>xe(n)||!t?!1:e>=n);return L(()=>{i(xe(n)||!t?!1:e>=n)},[n,e,t]),{collapsed:r,buttonProps:t?{onClick:()=>i(e=>!e),role:`button`,style:{cursor:`pointer`}}:{}}}function Qb(e){let{indentation:r,children:i,isInline:a,level:o}=e,{theme:s}=Ub(),{collapsed:c,buttonProps:l}=Zb(o);return n(`div`,{style:{color:s.commentColor},children:[n(`span`,{...l,children:[t(`span`,{children:r}),t(Yb,{collapsed:c}),t(`span`,{children:`<!-- `})]}),!c&&i,c&&`...`,t(`span`,{children:`${a||c?` `:r}-->`})]})}function $b(e){let{attributes:r}=e,{theme:i}=Ub();return r?t(`span`,{children:Object.entries(r).map(([e,r])=>n(`span`,{children:[t(`span`,{style:{color:i.attributeKeyColor},children:` ${e}`}),t(`span`,{style:{color:i.separatorColor},children:`=`}),t(`span`,{style:{color:i.attributeValueColor},children:`"${r}"`})]},`attribute-${e}`))}):null}function ex(e){let{indentation:r,tagKey:i,attributes:a}=e,{theme:o}=Ub();return n(`div`,{children:[t(`span`,{style:{color:o.separatorColor},children:`${r}<?`}),t(`span`,{style:{color:o.tagColor},children:`${i.slice(1)}`}),t($b,{attributes:a}),t(`span`,{style:{color:o.separatorColor},children:`?>`})]})}function tx(e,t){return Array(t*e+1).join(` `)}function nx(e){return typeof e==`string`&&e.includes(`
341
+ `)}function rx(e){return typeof e!=`string`&&e.length===1&&`#text`in e[0]&&!nx(e[0][`#text`])}function ix(e){switch(e){case Ib:case Rb:case Lb:return e;default:return e.startsWith(`?`)?zb:`TAG`}}function ax(e){let t=e[`:@`],n=V(e,`:@`),[[r,i]]=Object.entries(n);return{attributes:t,tagKey:r,subElements:i,type:ix(r)}}function ox(e){return e?Object.keys(e).length>0:!1}function sx(r){let{indentation:i,tagKey:a,attributes:o,children:s,isInline:c,hasChildren:l,level:u}=r,{collapsed:d,buttonProps:f}=Zb(u),{theme:p}=Ub();return n(`div`,{children:[n(`span`,{...f,children:[t(`span`,{children:i}),t(Yb,{collapsed:d}),t(`span`,{style:{color:p.separatorColor},children:`<`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),!d&&t($b,{attributes:o}),d&&ox(o)&&` ...`,t(`span`,{style:{color:p.separatorColor},children:l?`>`:` />`})]}),l&&n(e,{children:[!d&&s,d&&`...`,t(`span`,{style:{color:p.separatorColor},children:`${c||d?``:i}</`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),t(`span`,{style:{color:p.separatorColor},children:`>`})]})]})}function cx(e){let{hasSiblings:n,text:r,indentation:i,isText:a}=e,{theme:o}=Ub(),s=a?{color:o.textColor}:void 0;return nx(r)||n?t(`div`,{style:s,children:r.split(`
342
+ `).filter(e=>!!e.trim()).map((e,n)=>t(`div`,{children:`${i}${e.trim()}`},`line-${n}`))}):t(`span`,{style:s,children:r})}function lx(n){let{elements:r,level:i=0,isText:a=!0}=n,{indentSize:o}=Ub();return!Array.isArray(r)||r.length===0?null:t(e,{children:r.map((e,n)=>{let{tagKey:s,attributes:c,subElements:l,type:u}=ax(e),d=r.length>1,f=tx(o,i),p=`${i}-${n}`,m=rx(l);switch(u){case Ib:return t(cx,{text:l,indentation:f,hasSiblings:d,isText:a},p);case Lb:return t(Qb,{isInline:m,indentation:f,level:i,children:t(lx,{elements:l,level:i+1,isText:!1})},p);case Rb:return t(Jb,{indentation:f,isInline:m,children:t(lx,{elements:l,level:i+1,isText:!1})},p);case zb:return t(ex,{indentation:f,tagKey:s,attributes:c},p);default:return t(sx,{indentation:f,tagKey:s,attributes:c,isInline:m,hasChildren:l.length>0,level:i,children:t(lx,{elements:l,level:i+1})},p)}})})}function ux(){return t(`div`,{children:`Invalid XML!`})}function dx(e){let{theme:n,xml:r,collapsible:i=!1,indentSize:a=2,invalidXml:o,initalCollapsedDepth:s,initialCollapsedDepth:c}=e,[l,u]=B(()=>document.documentElement.classList.contains(`dark`));L(()=>{let e=document.documentElement,t=new MutationObserver(()=>{u(e.classList.contains(`dark`))});return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let d=R(()=>({...l?Vb:Bb,...n}),[l,n]),f=qb(r),p=R(()=>({theme:d,collapsible:i,indentSize:a,initialCollapsedDepth:c??s}),[d,i,a,s,c]);return f?f.valid?t(Hb.Provider,{value:p,children:t(`div`,{className:`rxv-container`,style:{whiteSpace:`pre-wrap`,fontFamily:d.fontFamily,overflowWrap:`break-word`},children:t(lx,{elements:f.json})})}):o||t(ux,{}):null}export{Vn as AgentResourceResolverProvider,Jt as ArrayPropertySchema,pa as ArtifactContentRenderer,Hy as ArtifactEditingSurface,J_ as ChartCodeBlockHandler,ia as CodeBlockErrorBoundary,ta as CodeBlockHandlerProvider,U as CodeBlockPlaceholder,N_ as CodeBlockRendererProvider,Sy as CollaborativeMarkdownRenderer,Nb as DropZone,Z_ as ExpandCodeBlockHandler,Tt as FieldSetContextProvider,Mt as Form,Dt as FormContext,At as FormContextProvider,Ut as FormError,Ht as FormHelper,Vt as FormLabel,Pt as GeneratedForm,jt as Input,on as JSONCode,vn as JSONDisplay,Pn as JSONEditor,In as JSONSwitcher,zn as JSONTable,un as JSONView,rn as ManageObjectEntry,nn as ManagedListProperty,$t as ManagedObject,Qt as ManagedObjectBase,en as ManagedObjectProperty,tn as ManagedProperty,an as ManagedScalarEntry,mb as ManagedSchema,iv as MarkdownFigure,ov as MarkdownImage,cv as MarkdownLink,ny as MarkdownRenderer,Y_ as MermaidCodeBlockHandler,V_ as MermaidDiagram,Nn as MonacoEditor,Zt as Node,Uy as Progress,Wy as PropertiesView,Qy as PropertyEditor,$y as PropertyNameEditor,Kt as PropertySchema,rb as PropertyViewer,Lt as ScalarField,Gt as Schema,wb as SchemaEditor,hb as SchemaNode,Gy as SvgIcon,Pb as UploadResultCategory,Fb as UploadSummary,Mn as VEditorApi,dx as XMLViewer,Ry as applyArtifactRefreshChanges,_y as applyMarkdownEditingChange,Yt as computeTitleFromName,Cn as configureMonacoLoader,$_ as createDefaultCodeBlockHandlers,fy as createMarkdownBlockAnchor,Ky as createSvgIcon,Fy as createUnifiedLineDiff,ky as diffTextSegments,Ey as diffWordSegments,vy as formatMarkdownEditingAction,qy as getEditableSchemaProperty,Fn as getJSONEditorValue,Ay as getTextLineChangeRegions,Ly as isArtifactRefreshEvent,Q_ as isExpandLanguage,W_ as isIncompleteJson,Tn as loadMonacoReact,Wn as parseAgentResourceHref,nv as parseUrlScheme,Py as rebaseTextChanges,ln as renderJsonLine,Hn as useAgentResourceResolver,U_ as useArtifactContent,F_ as useCodeBlockComponent,na as useCodeBlockContext,P_ as useCodeBlockRendererRegistry,Et as useFieldSet,kt as useForm,rv as useResolvedUrl,gb as useSchema,Ob as validatePropertyName};
343
343
  //# sourceMappingURL=vertesia-ui-widgets.js.map