@kitn.ai/ui 0.28.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/README.md +11 -7
  2. package/dist/{Icon-DObhsRtm.js → Icon-BzBET3E-.js} +1 -1
  3. package/dist/{action-icons-CcgNN2oT.js → action-icons-DaW2pU6m.js} +1 -1
  4. package/dist/agent-tooling/construct/public.d.ts +15 -0
  5. package/dist/agent-tooling/construct/schema.d.ts +111 -0
  6. package/dist/arrow-down-D783iMJj.js +1 -0
  7. package/dist/arrow-left-0VLM5kyg.js +1 -0
  8. package/dist/artifact-DGjzHYUT.js +1 -0
  9. package/dist/{attachments-Qr4kg-2b.js → attachments-YvXHlg88.js} +1 -1
  10. package/dist/{audio-visualizer-DToYdfSc.js → audio-visualizer-9lz5IHsL.js} +1 -1
  11. package/dist/{badge-CdEu_jn2.js → badge-Dh_vp8A5.js} +1 -1
  12. package/dist/{bell-DQAAOpDz.js → bell-CT7_WUwS.js} +1 -1
  13. package/dist/{button-DkuOnGLy.js → button-C_3te6fm.js} +1 -1
  14. package/dist/{card-renderer-Jx70m6_l.js → card-renderer-DZVaGH2e.js} +1 -1
  15. package/dist/check-CiEOVnEN.js +1 -0
  16. package/dist/{checkbox-D7iRB3nL.js → checkbox-Bu2T2e0U.js} +1 -1
  17. package/dist/{checkbox-group-B2_rpoPM.js → checkbox-group-BiryEXPQ.js} +1 -1
  18. package/dist/chevron-down-CSobuZRG.js +1 -0
  19. package/dist/chevron-right-DR9ZAP-2.js +1 -0
  20. package/dist/{choice-card-m0BYqqOK.js → choice-card-CM6IjkmL.js} +1 -1
  21. package/dist/circle-BC66EYF7.js +1 -0
  22. package/dist/circle-check-BqmahW0O.js +1 -0
  23. package/dist/{circle-x-BPG0iPst.js → circle-x-Bk-dA5Wf.js} +1 -1
  24. package/dist/{code-block-ClMLKb7C.js → code-block-B26t-Q7q.js} +1 -1
  25. package/dist/{collapsible-B4DlWicL.js → collapsible-Bhc636Cf.js} +1 -1
  26. package/dist/components/builder-composer-triggers.d.ts +62 -0
  27. package/dist/components/builder-layout.d.ts +54 -0
  28. package/dist/components/builder-message-actions.d.ts +72 -0
  29. package/dist/components/builder-panel.d.ts +189 -0
  30. package/dist/components/builder-preview.d.ts +11 -0
  31. package/dist/components/builder-shell-controls.d.ts +69 -0
  32. package/dist/components/builder-skeleton.d.ts +58 -0
  33. package/dist/components/builder-start.d.ts +75 -0
  34. package/dist/components/builder-workspace-variants.d.ts +23 -0
  35. package/dist/components/captions.d.ts +66 -0
  36. package/dist/{composer-sQ0HcvyG.js → composer-DMI85B6j.js} +1 -1
  37. package/dist/{confirm-card-rQWDQsnC.js → confirm-card-B0YIAwXp.js} +1 -1
  38. package/dist/construct-cli.es.js +3 -3
  39. package/dist/construct.d.ts +5 -0
  40. package/dist/construct.js +327 -0
  41. package/dist/{context-0kg4ZX1J.js → context-DWgfhqWp.js} +1 -1
  42. package/dist/controllable-BagRpyHv.js +1 -0
  43. package/dist/{conversation-item-BxwQLaFJ.js → conversation-item-BsOsVGmT.js} +1 -1
  44. package/dist/{conversation-list-BCfGN1JU.js → conversation-list-aX3Vtc7L.js} +1 -1
  45. package/dist/{copy-n9u9rqpi.js → copy-BmEwsNhJ.js} +1 -1
  46. package/dist/core-C8fzo39E.js +1 -12
  47. package/dist/{create-tween-uPkArjIG.js → create-tween-CNOAU3Fx.js} +1 -1
  48. package/dist/{create-tween-C-q-JCM-.js → create-tween-WfqiENls.js} +1 -1
  49. package/dist/{create-tween-CRrJXxBd.js → create-tween-wlFtW9Kh.js} +1 -1
  50. package/dist/{create-tween-DZ3RRDHD.js → create-tween-zt79ba32.js} +1 -1
  51. package/dist/{default-input-CaMrJkgH.js → default-input-DMV5Eaze.js} +1 -1
  52. package/dist/define-CI0y3eE4.js +1 -0
  53. package/dist/define.js +40 -40
  54. package/dist/define.server.js +45 -45
  55. package/dist/{disclosure-WUImBbDv.js → disclosure-NnACBxsC.js} +1 -1
  56. package/dist/{dropdown-wZVeJOMd.js → dropdown-DT7G0RGR.js} +1 -1
  57. package/dist/elements/agent-card.js +1 -1
  58. package/dist/elements/artifact.js +1 -1
  59. package/dist/elements/attachments.js +1 -1
  60. package/dist/elements/audio-visualizer.js +1 -1
  61. package/dist/elements/avatar.js +1 -1
  62. package/dist/elements/badge.js +1 -1
  63. package/dist/elements/button.js +1 -1
  64. package/dist/elements/card.js +1 -1
  65. package/dist/elements/cards.js +1 -1
  66. package/dist/elements/chain-of-thought.js +1 -1
  67. package/dist/elements/chat-scope-picker.js +1 -1
  68. package/dist/elements/chat-workspace.js +1 -1
  69. package/dist/elements/chat.js +1 -1
  70. package/dist/elements/checkbox-group.js +1 -1
  71. package/dist/elements/checkbox.js +1 -1
  72. package/dist/elements/checkpoint.js +1 -1
  73. package/dist/elements/choice.js +1 -1
  74. package/dist/elements/coachmark.js +1 -1
  75. package/dist/elements/code-block.js +1 -1
  76. package/dist/elements/command.js +1 -1
  77. package/dist/elements/compare.js +1 -1
  78. package/dist/elements/composer.js +1 -1
  79. package/dist/elements/confirm-card.js +1 -1
  80. package/dist/elements/context-meter.js +1 -1
  81. package/dist/elements/conversation-item.js +1 -1
  82. package/dist/elements/conversation-list.js +1 -1
  83. package/dist/elements/dialog.js +1 -1
  84. package/dist/elements/dock.js +1 -1
  85. package/dist/elements/dropdown.js +1 -1
  86. package/dist/elements/editable-label.js +1 -1
  87. package/dist/elements/embed.js +1 -1
  88. package/dist/elements/empty.js +1 -1
  89. package/dist/elements/feedback-bar.js +1 -1
  90. package/dist/elements/file-tree.js +1 -1
  91. package/dist/elements/file-upload.js +1 -1
  92. package/dist/elements/form.js +1 -1
  93. package/dist/elements/hover-card.js +1 -1
  94. package/dist/elements/icon.js +1 -1
  95. package/dist/elements/image.js +1 -1
  96. package/dist/elements/input.js +1 -1
  97. package/dist/elements/kbd.js +1 -1
  98. package/dist/elements/link-preview.js +1 -1
  99. package/dist/elements/loader.js +1 -1
  100. package/dist/elements/markdown.js +1 -1
  101. package/dist/elements/menu.js +1 -1
  102. package/dist/elements/message-skills.js +1 -1
  103. package/dist/elements/message.js +1 -1
  104. package/dist/elements/model-switcher.js +1 -1
  105. package/dist/elements/nav.js +1 -1
  106. package/dist/elements/notice.js +1 -1
  107. package/dist/elements/pane-grid.js +1 -1
  108. package/dist/elements/pane-group.js +1 -1
  109. package/dist/elements/pane.js +1 -1
  110. package/dist/elements/popover.js +1 -1
  111. package/dist/elements/progress-bar.js +1 -1
  112. package/dist/elements/prompt-dock.js +1 -1
  113. package/dist/elements/prompt-input.js +1 -1
  114. package/dist/elements/prompt-suggestions.js +1 -1
  115. package/dist/elements/radio-group.js +1 -1
  116. package/dist/elements/reasoning.js +1 -1
  117. package/dist/elements/remote.js +1 -1
  118. package/dist/elements/resizable.js +1 -1
  119. package/dist/elements/response-stream.js +1 -1
  120. package/dist/elements/screen.js +1 -1
  121. package/dist/elements/scroll-area.js +1 -1
  122. package/dist/elements/scroll-button.js +1 -1
  123. package/dist/elements/search.js +1 -1
  124. package/dist/elements/segmented.js +1 -1
  125. package/dist/elements/select.js +1 -1
  126. package/dist/elements/separator.js +1 -1
  127. package/dist/elements/setting-item.js +1 -1
  128. package/dist/elements/settings-group.js +1 -1
  129. package/dist/elements/skeleton.js +1 -1
  130. package/dist/elements/slider.js +1 -1
  131. package/dist/elements/source.js +1 -1
  132. package/dist/elements/status.js +1 -1
  133. package/dist/elements/switch.js +1 -1
  134. package/dist/elements/tabs.js +1 -1
  135. package/dist/elements/tasks.js +1 -1
  136. package/dist/elements/text-shimmer.js +1 -1
  137. package/dist/elements/thinking-bar.js +1 -1
  138. package/dist/elements/thread.js +1 -1
  139. package/dist/elements/toast.js +1 -1
  140. package/dist/elements/tool.js +1 -1
  141. package/dist/elements/tooltip.js +1 -1
  142. package/dist/elements/voice-input.js +1 -1
  143. package/dist/elements/voice-output.js +1 -1
  144. package/dist/{ellipsis-CbOpJnU3.js → ellipsis-6pJ7SxYT.js} +1 -1
  145. package/dist/{embed-CrfjkbUG.js → embed-BMje-nxj.js} +1 -1
  146. package/dist/engine-javascript-C1x7zo1_.js +1 -141
  147. package/dist/{external-link-ByXAwBBQ.js → external-link-Beh9DKeR.js} +1 -1
  148. package/dist/{file-text-DMib2qwt.js → file-text-D1GPfZ8Q.js} +1 -1
  149. package/dist/{file-tree-CJqM2aP7.js → file-tree-Dwj2lqg-.js} +1 -1
  150. package/dist/{folder-_BAb929C.js → folder-b6D8x1DY.js} +1 -1
  151. package/dist/{form-DSZgZQZk.js → form-DWgdxDXu.js} +1 -1
  152. package/dist/{hover-card-BQbul9eq.js → hover-card-CWRkqm40.js} +1 -1
  153. package/dist/{icon-CdcfRhYI.js → icon-CL0jdhsf.js} +1 -1
  154. package/dist/index.js +1741 -1725
  155. package/dist/index.server.js +1582 -1566
  156. package/dist/{info-DsFjGuI_.js → info-0cOUherQ.js} +1 -1
  157. package/dist/{input-DKbmkMos.js → input-BH6Ru91Q.js} +1 -1
  158. package/dist/kai.es.js +1 -1
  159. package/dist/{kbd-PvdGhX4s.js → kbd-DRAnVtNX.js} +1 -1
  160. package/dist/{link-zF8PzWfF.js → link-Dlr0vssB.js} +1 -1
  161. package/dist/{link-preview-DbM1866N.js → link-preview-DODgRyV9.js} +1 -1
  162. package/dist/loader-KvJB6NrT.js +1 -0
  163. package/dist/{markdown-LMvmAyBk.js → markdown-DX9tuJVj.js} +1 -1
  164. package/dist/mcp.es.js +9 -5
  165. package/dist/{message-BYZECyek.js → message-BqQ7Ot5q.js} +1 -1
  166. package/dist/{message-BSsgvHvf.js → message-DkaGfBd8.js} +1 -1
  167. package/dist/message-circle-BPpp5QKv.js +1 -0
  168. package/dist/message-square-BLbsd9BJ.js +1 -0
  169. package/dist/{minimize-2-BQRoBV1V.js → minimize-2-CyOHJwcN.js} +1 -1
  170. package/dist/{model-switcher-CMpCOYcB.js → model-switcher-0hrKDiK2.js} +1 -1
  171. package/dist/{overlay-Cb-MkyDa.js → overlay-DBMFXie6.js} +1 -1
  172. package/dist/{panel-right-i8warFxT.js → panel-right-t8SWJL6e.js} +1 -1
  173. package/dist/{paperclip-ByY3UVO6.js → paperclip-CdzuOjbU.js} +1 -1
  174. package/dist/play-BXy1u7rW.js +1 -0
  175. package/dist/primitives/use-auto-resize.d.ts +11 -0
  176. package/dist/{progress-bar-jVAHvMUf.js → progress-bar-CiBtxMWT.js} +1 -1
  177. package/dist/{prompt-suggestion-CD-qtNgC.js → prompt-suggestion-I_DHP21i.js} +1 -1
  178. package/dist/{radio-BsoBMhkF.js → radio-C_p3n39l.js} +1 -1
  179. package/dist/{reasoning-4kBPtlTx.js → reasoning-BDwy_tIe.js} +1 -1
  180. package/dist/register-impl-DvEnhIxx.js +424 -0
  181. package/dist/{resizable-uPmY9VY-.js → resizable-SYC-fStM.js} +1 -1
  182. package/dist/{rotate-ccw-B2xn93py.js → rotate-ccw-B1nwmwuY.js} +1 -1
  183. package/dist/{rotate-cw-CMVLoCyH.js → rotate-cw-CLAnBcm1.js} +1 -1
  184. package/dist/{scroll-area-BqLUo8ZZ.js → scroll-area-zRyXoLhI.js} +1 -1
  185. package/dist/{scroll-button-DslXiJyL.js → scroll-button-jzrbYCG9.js} +1 -1
  186. package/dist/{select-2cLRtPGT.js → select-DM-0nEe0.js} +1 -1
  187. package/dist/{separator-BWQtNJcM.js → separator-BToOOoOt.js} +1 -1
  188. package/dist/{settings-BBR63jLg.js → settings-PaGo_S4U.js} +1 -1
  189. package/dist/{settings-group-B2ciy-Iw.js → settings-group-BFXGIfXq.js} +1 -1
  190. package/dist/{skeleton-CkHI-HgC.js → skeleton-DYpmFnnm.js} +1 -1
  191. package/dist/{slider-DDR9U-i0.js → slider-ebutAmkQ.js} +1 -1
  192. package/dist/{solid-DruVOXnf.js → solid-15v_3WVL.js} +3563 -3412
  193. package/dist/{solid-BzCFdL25.js → solid-5P-otgdi.js} +4502 -4296
  194. package/dist/solid.d.ts +6 -0
  195. package/dist/solid.js +259 -254
  196. package/dist/solid.server.js +259 -254
  197. package/dist/{source-GEnFF528.js → source-c1gpRl9h.js} +1 -1
  198. package/dist/{star-CilHq8GP.js → star-pcV_3LqF.js} +1 -1
  199. package/dist/{store-Ciyk6eZG.js → store-CSgbFFCg.js} +1 -1
  200. package/dist/{switch-KkeQIbuH.js → switch-Bh2OdLV2.js} +1 -1
  201. package/dist/{tasks-card-BrN4bggJ.js → tasks-card-CbqQAn2S.js} +1 -1
  202. package/dist/text-shimmer-BSzgEnDH.js +1 -0
  203. package/dist/textarea-DrYNt_0z.js +1 -0
  204. package/dist/theme.tokens.css +22 -21
  205. package/dist/{thumbs-up-CsT9Wzb9.js → thumbs-up-BL3-NenK.js} +1 -1
  206. package/dist/{toast-store-tgK6MuMv.js → toast-store-DkOlYczt.js} +1 -1
  207. package/dist/{tool-DzUjIBT8.js → tool-CeIWUVUe.js} +1 -1
  208. package/dist/{tooltip-Bkkg_4t0.js → tooltip-GA-nmg06.js} +1 -1
  209. package/dist/{trash-2-jBKxjGGQ.js → trash-2-CT66QWlm.js} +1 -1
  210. package/dist/{triangle-alert-DlQ68ppf.js → triangle-alert-CeHLWxhD.js} +1 -1
  211. package/dist/ui/color-field.d.ts +48 -0
  212. package/dist/ui/textarea.d.ts +4 -0
  213. package/dist/ui/toggle-chip.d.ts +40 -0
  214. package/dist/{upload-TcAHXv9W.js → upload-9Csb0F0J.js} +1 -1
  215. package/dist/{use-card-resolution-DaZqAdWf.js → use-card-resolution-Zg0a08Z-.js} +1 -1
  216. package/dist/{variant-aurora-DbW_OWL2.js → variant-aurora-4VBQHIKV.js} +1 -1
  217. package/dist/{variant-aurora-CNmfHhcx.js → variant-aurora-DBeCAQNk.js} +2 -2
  218. package/dist/{variant-aurora-D6GsdTPA.js → variant-aurora-FzHVXHby.js} +2 -2
  219. package/dist/{variant-aurora-BhLuYxJR.js → variant-aurora-LE3fqxgw.js} +1 -1
  220. package/dist/{variant-custom-BvYHR62b.js → variant-custom-AFRGcOBS.js} +1 -1
  221. package/dist/{variant-custom-DV2x254s.js → variant-custom-BQkNuPpE.js} +2 -2
  222. package/dist/{variant-custom-BRvaNHSi.js → variant-custom-DI5R0rln.js} +1 -1
  223. package/dist/{variant-custom-DMTrEO5w.js → variant-custom-WWnrrRHS.js} +2 -2
  224. package/dist/{variant-wave-CyBueXj9.js → variant-wave-DUCbH5oI.js} +2 -2
  225. package/dist/{variant-wave-BNMGrDfj.js → variant-wave-DuQV7DhQ.js} +2 -2
  226. package/dist/{variant-wave-BpDd8t3Z.js → variant-wave-nSI2sfII.js} +1 -1
  227. package/dist/{variant-wave-sp-qwsdI.js → variant-wave-wTP5v_jU.js} +1 -1
  228. package/dist/x-eiO9V6J6.js +1 -0
  229. package/{src/elements/styles.css → kit-base.css} +27 -44
  230. package/package.json +32 -17
  231. package/solid.css +33 -0
  232. package/theme.css +39 -23
  233. package/bin/route.test.js +0 -58
  234. package/dist/arrow-down-CjRU3JgV.js +0 -1
  235. package/dist/arrow-left-Bnpb1UEW.js +0 -1
  236. package/dist/artifact-Bwt7OgcR.js +0 -1
  237. package/dist/check-njkVdZu2.js +0 -1
  238. package/dist/chevron-down-B72s6PXR.js +0 -1
  239. package/dist/chevron-right-BatuHzUm.js +0 -1
  240. package/dist/circle-check-B62pODB3.js +0 -1
  241. package/dist/circle-zx0ByzY9.js +0 -1
  242. package/dist/controllable-CnGpMF6r.js +0 -1
  243. package/dist/define-By-uL588.js +0 -1
  244. package/dist/loader-BM4CEz4G.js +0 -1
  245. package/dist/message-circle-DruwObfX.js +0 -1
  246. package/dist/message-square-BG6q6mlm.js +0 -1
  247. package/dist/play-BvKKq3fX.js +0 -1
  248. package/dist/register-impl-B1hLkrI8.js +0 -424
  249. package/dist/text-shimmer-Dcj1MHuq.js +0 -1
  250. package/dist/textarea-Dpvbngbg.js +0 -1
  251. package/dist/x-Z5UntkIJ.js +0 -1
  252. package/src/agent-tooling/README.md +0 -192
  253. package/src/agent-tooling/archetypes.ts +0 -205
  254. package/src/agent-tooling/catalog/README.md +0 -676
  255. package/src/agent-tooling/catalog/catalog-types.ts +0 -231
  256. package/src/agent-tooling/catalog/fabrications.ts +0 -96
  257. package/src/agent-tooling/catalog/invariants.ts +0 -284
  258. package/src/agent-tooling/catalog/labs-titles.ts +0 -114
  259. package/src/agent-tooling/catalog/scenarios.ts +0 -87
  260. package/src/agent-tooling/catalog/surfaces.ts +0 -347
  261. package/src/agent-tooling/construct/cli-entry.ts +0 -8
  262. package/src/agent-tooling/construct/cli.ts +0 -147
  263. package/src/agent-tooling/construct/codegen.ts +0 -1635
  264. package/src/agent-tooling/construct/construct.v1.schema.json +0 -319
  265. package/src/agent-tooling/construct/dev.ts +0 -148
  266. package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +0 -7
  267. package/src/agent-tooling/construct/fixtures/ops-console.construct.json +0 -44
  268. package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +0 -32
  269. package/src/agent-tooling/construct/schema.ts +0 -452
  270. package/src/agent-tooling/integrations/anthropic.ts +0 -442
  271. package/src/agent-tooling/integrations/cloudflare.ts +0 -218
  272. package/src/agent-tooling/integrations/langgraph.ts +0 -133
  273. package/src/agent-tooling/integrations/mastra.ts +0 -182
  274. package/src/agent-tooling/integrations/mock.ts +0 -148
  275. package/src/agent-tooling/integrations/ollama.ts +0 -97
  276. package/src/agent-tooling/integrations/openai.ts +0 -95
  277. package/src/agent-tooling/integrations/openrouter.ts +0 -82
  278. package/src/agent-tooling/integrations/pi.ts +0 -176
  279. package/src/agent-tooling/integrations/pydantic-ai.ts +0 -108
  280. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +0 -398
  281. package/src/agent-tooling/mcp/css-raw.d.ts +0 -12
  282. package/src/agent-tooling/mcp/manifest.ts +0 -422
  283. package/src/agent-tooling/mcp/server.ts +0 -116
  284. package/src/agent-tooling/mcp/stdio.ts +0 -18
  285. package/src/agent-tooling/mcp/tools/construct.ts +0 -130
  286. package/src/agent-tooling/mcp/tools/debug.ts +0 -621
  287. package/src/agent-tooling/mcp/tools/reference.ts +0 -980
  288. package/src/agent-tooling/mcp/tools/scaffold.ts +0 -6708
  289. package/src/agent-tooling/mcp/tools/theme.ts +0 -456
  290. package/src/agent-tooling/mcp/tools/types.ts +0 -14
  291. package/src/agent-tooling/mcp/validate-args.ts +0 -141
  292. package/src/agent-tooling/recipes/composed-thread.ts +0 -714
  293. package/src/agent-tooling/recipes/index.ts +0 -22
  294. package/src/agent-tooling/recipes/types.ts +0 -32
  295. package/src/agent-tooling/registry.ts +0 -132
  296. package/src/agent-tooling/route-emit.ts +0 -305
  297. package/src/agent-tooling/types.ts +0 -390
  298. package/src/components/artifact-card.tsx +0 -120
  299. package/src/components/artifact.tsx +0 -914
  300. package/src/components/attachment-types.ts +0 -66
  301. package/src/components/attachments.tsx +0 -536
  302. package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +0 -257
  303. package/src/components/audio-visualizer/aurora.glsl.ts +0 -330
  304. package/src/components/audio-visualizer/fit-scale.ts +0 -112
  305. package/src/components/audio-visualizer/index.tsx +0 -528
  306. package/src/components/audio-visualizer/labs/lab-choreography.ts +0 -187
  307. package/src/components/audio-visualizer/labs/lab-shaders.ts +0 -363
  308. package/src/components/audio-visualizer/labs/lab-visualizer.tsx +0 -102
  309. package/src/components/audio-visualizer/shader-canvas.tsx +0 -876
  310. package/src/components/audio-visualizer/sizes.ts +0 -54
  311. package/src/components/audio-visualizer/variant-aurora.tsx +0 -305
  312. package/src/components/audio-visualizer/variant-bar.tsx +0 -175
  313. package/src/components/audio-visualizer/variant-custom.tsx +0 -344
  314. package/src/components/audio-visualizer/variant-grid.tsx +0 -175
  315. package/src/components/audio-visualizer/variant-radial.tsx +0 -163
  316. package/src/components/audio-visualizer/variant-wave.tsx +0 -130
  317. package/src/components/audio-visualizer/wave.glsl.ts +0 -130
  318. package/src/components/card-fallback.tsx +0 -60
  319. package/src/components/card-renderer.tsx +0 -220
  320. package/src/components/card.tsx +0 -212
  321. package/src/components/chain-of-thought.tsx +0 -348
  322. package/src/components/chat-container.tsx +0 -89
  323. package/src/components/chat-scope-picker.tsx +0 -57
  324. package/src/components/chat-thread.tsx +0 -1014
  325. package/src/components/checkpoint.tsx +0 -88
  326. package/src/components/choice-card.tsx +0 -743
  327. package/src/components/coachmark.tsx +0 -249
  328. package/src/components/code-block.tsx +0 -181
  329. package/src/components/composer-dom.ts +0 -159
  330. package/src/components/composer-highlight.ts +0 -242
  331. package/src/components/composer-history.ts +0 -82
  332. package/src/components/composer.tsx +0 -1075
  333. package/src/components/confirm-card.tsx +0 -402
  334. package/src/components/context.tsx +0 -377
  335. package/src/components/conversation-item.tsx +0 -241
  336. package/src/components/conversation-list.tsx +0 -429
  337. package/src/components/conversation-panel.tsx +0 -118
  338. package/src/components/dismissed-stub.tsx +0 -80
  339. package/src/components/embed.tsx +0 -200
  340. package/src/components/empty.tsx +0 -177
  341. package/src/components/feedback-bar.tsx +0 -166
  342. package/src/components/file-tree.tsx +0 -530
  343. package/src/components/file-upload.tsx +0 -167
  344. package/src/components/form-widgets.tsx +0 -525
  345. package/src/components/form.tsx +0 -1296
  346. package/src/components/home-panel.tsx +0 -159
  347. package/src/components/image.tsx +0 -65
  348. package/src/components/link-preview.tsx +0 -195
  349. package/src/components/loader.tsx +0 -367
  350. package/src/components/markdown.tsx +0 -162
  351. package/src/components/message-skills.tsx +0 -40
  352. package/src/components/message.tsx +0 -765
  353. package/src/components/model-switcher.tsx +0 -132
  354. package/src/components/prompt-input.tsx +0 -188
  355. package/src/components/prompt-suggestion.tsx +0 -150
  356. package/src/components/reasoning.tsx +0 -293
  357. package/src/components/response-compare-types.ts +0 -152
  358. package/src/components/response-compare.tsx +0 -455
  359. package/src/components/response-stream.tsx +0 -109
  360. package/src/components/screen.tsx +0 -181
  361. package/src/components/scroll-button.tsx +0 -93
  362. package/src/components/source.tsx +0 -192
  363. package/src/components/tasks-card.tsx +0 -801
  364. package/src/components/text-shimmer.tsx +0 -37
  365. package/src/components/thinking-bar.tsx +0 -50
  366. package/src/components/thread.tsx +0 -228
  367. package/src/components/toast.tsx +0 -503
  368. package/src/components/tool-classify.ts +0 -26
  369. package/src/components/tool-types.ts +0 -49
  370. package/src/components/tool.tsx +0 -190
  371. package/src/components/use-card-resolution.ts +0 -44
  372. package/src/components/voice-input.tsx +0 -222
  373. package/src/components/voice-output.tsx +0 -242
  374. package/src/components/widget-tab-bar.tsx +0 -73
  375. package/src/components/workspace-shell.tsx +0 -285
  376. package/src/diagnostics/hook.ts +0 -352
  377. package/src/diagnostics/index.ts +0 -82
  378. package/src/diagnostics/report-request.ts +0 -296
  379. package/src/elements/agent-card.tsx +0 -67
  380. package/src/elements/artifact.tsx +0 -194
  381. package/src/elements/attachments.tsx +0 -140
  382. package/src/elements/audio-visualizer.tsx +0 -227
  383. package/src/elements/autoloader.ts +0 -89
  384. package/src/elements/avatar.tsx +0 -33
  385. package/src/elements/badge.tsx +0 -32
  386. package/src/elements/button.tsx +0 -149
  387. package/src/elements/card.tsx +0 -133
  388. package/src/elements/cards.tsx +0 -266
  389. package/src/elements/chain-of-thought.tsx +0 -141
  390. package/src/elements/chat-scope-picker.tsx +0 -65
  391. package/src/elements/chat-types.ts +0 -102
  392. package/src/elements/chat-workspace.tsx +0 -188
  393. package/src/elements/chat.tsx +0 -304
  394. package/src/elements/checkbox-group.tsx +0 -164
  395. package/src/elements/checkbox.tsx +0 -134
  396. package/src/elements/checkpoint.tsx +0 -47
  397. package/src/elements/choice.tsx +0 -100
  398. package/src/elements/coachmark.tsx +0 -90
  399. package/src/elements/code-block.tsx +0 -60
  400. package/src/elements/command.tsx +0 -197
  401. package/src/elements/compare.tsx +0 -111
  402. package/src/elements/compiled.css +0 -2
  403. package/src/elements/composer.tsx +0 -162
  404. package/src/elements/confirm-card.tsx +0 -76
  405. package/src/elements/context-meter.tsx +0 -107
  406. package/src/elements/conversation-item.tsx +0 -120
  407. package/src/elements/conversation-list.tsx +0 -203
  408. package/src/elements/css.ts +0 -5
  409. package/src/elements/default-input.tsx +0 -392
  410. package/src/elements/define-entry.ts +0 -12
  411. package/src/elements/define.tsx +0 -563
  412. package/src/elements/diagnostic-events.ts +0 -114
  413. package/src/elements/dialog.tsx +0 -145
  414. package/src/elements/disclosure.ts +0 -95
  415. package/src/elements/dock.tsx +0 -215
  416. package/src/elements/dropdown.tsx +0 -123
  417. package/src/elements/editable-label.tsx +0 -140
  418. package/src/elements/element-data-types.ts +0 -152
  419. package/src/elements/element-diagnostics.ts +0 -392
  420. package/src/elements/element-manifest.json +0 -354
  421. package/src/elements/element-nonscalar.json +0 -187
  422. package/src/elements/element-types.d.ts +0 -4353
  423. package/src/elements/embed.tsx +0 -35
  424. package/src/elements/empty.tsx +0 -29
  425. package/src/elements/feedback-bar.tsx +0 -66
  426. package/src/elements/file-tree.tsx +0 -62
  427. package/src/elements/file-upload.tsx +0 -44
  428. package/src/elements/form.tsx +0 -94
  429. package/src/elements/hover-card.tsx +0 -80
  430. package/src/elements/icon.tsx +0 -41
  431. package/src/elements/image.tsx +0 -32
  432. package/src/elements/input.tsx +0 -492
  433. package/src/elements/kbd.tsx +0 -45
  434. package/src/elements/link-preview.tsx +0 -34
  435. package/src/elements/loader.tsx +0 -25
  436. package/src/elements/markdown.tsx +0 -38
  437. package/src/elements/menu.tsx +0 -241
  438. package/src/elements/message-skills.tsx +0 -83
  439. package/src/elements/message.tsx +0 -361
  440. package/src/elements/model-switcher.tsx +0 -121
  441. package/src/elements/nav.tsx +0 -87
  442. package/src/elements/notice.tsx +0 -53
  443. package/src/elements/pane-grid.tsx +0 -111
  444. package/src/elements/pane-group.tsx +0 -119
  445. package/src/elements/pane.tsx +0 -129
  446. package/src/elements/popover.tsx +0 -81
  447. package/src/elements/progress-bar.tsx +0 -39
  448. package/src/elements/prompt-dock.tsx +0 -82
  449. package/src/elements/prompt-input.tsx +0 -240
  450. package/src/elements/prompt-suggestions.tsx +0 -113
  451. package/src/elements/radio-group.tsx +0 -129
  452. package/src/elements/reasoning.tsx +0 -71
  453. package/src/elements/register-impl.ts +0 -148
  454. package/src/elements/register.ts +0 -76
  455. package/src/elements/remote.tsx +0 -225
  456. package/src/elements/resizable.globals.d.ts +0 -36
  457. package/src/elements/resizable.tsx +0 -704
  458. package/src/elements/response-stream.tsx +0 -40
  459. package/src/elements/screen.tsx +0 -90
  460. package/src/elements/scroll-area.tsx +0 -33
  461. package/src/elements/scroll-button.tsx +0 -179
  462. package/src/elements/search.tsx +0 -185
  463. package/src/elements/segmented.tsx +0 -129
  464. package/src/elements/select.tsx +0 -165
  465. package/src/elements/separator.tsx +0 -36
  466. package/src/elements/setting-item.tsx +0 -50
  467. package/src/elements/settings-group.tsx +0 -37
  468. package/src/elements/skeleton.tsx +0 -45
  469. package/src/elements/slider.tsx +0 -171
  470. package/src/elements/slot-text.ts +0 -73
  471. package/src/elements/slots.ts +0 -787
  472. package/src/elements/source.tsx +0 -126
  473. package/src/elements/status.tsx +0 -42
  474. package/src/elements/switch.tsx +0 -118
  475. package/src/elements/tabs.tsx +0 -95
  476. package/src/elements/tasks.tsx +0 -103
  477. package/src/elements/text-shimmer.tsx +0 -28
  478. package/src/elements/thinking-bar.tsx +0 -43
  479. package/src/elements/thread.tsx +0 -139
  480. package/src/elements/toast.tsx +0 -106
  481. package/src/elements/tool.tsx +0 -78
  482. package/src/elements/tooltip.tsx +0 -85
  483. package/src/elements/validate-messages.ts +0 -76
  484. package/src/elements/voice-input.tsx +0 -100
  485. package/src/elements/voice-output.tsx +0 -82
  486. package/src/index.ts +0 -430
  487. package/src/primitives/audio-bands.ts +0 -174
  488. package/src/primitives/card-component-types.ts +0 -63
  489. package/src/primitives/card-contract.ts +0 -80
  490. package/src/primitives/card-data-types.ts +0 -361
  491. package/src/primitives/card-host.tsx +0 -37
  492. package/src/primitives/card-recovery.ts +0 -160
  493. package/src/primitives/card-registry.tsx +0 -78
  494. package/src/primitives/card-resolution.ts +0 -36
  495. package/src/primitives/card-routing.ts +0 -85
  496. package/src/primitives/card-schemas/artifact.schema.json +0 -92
  497. package/src/primitives/card-schemas/card-envelope.schema.json +0 -14
  498. package/src/primitives/card-schemas/card-event.schema.json +0 -12
  499. package/src/primitives/card-schemas/choice.schema.json +0 -75
  500. package/src/primitives/card-schemas/confirm.schema.json +0 -65
  501. package/src/primitives/card-schemas/embed.schema.json +0 -63
  502. package/src/primitives/card-schemas/form.result.schema.json +0 -7
  503. package/src/primitives/card-schemas/form.schema.json +0 -53
  504. package/src/primitives/card-schemas/link.schema.json +0 -54
  505. package/src/primitives/card-schemas/tasks.result.schema.json +0 -16
  506. package/src/primitives/card-schemas/tasks.schema.json +0 -83
  507. package/src/primitives/card-tags.ts +0 -61
  508. package/src/primitives/card-validate-cards.ts +0 -255
  509. package/src/primitives/card-validate-schemas.ts +0 -58
  510. package/src/primitives/card-validate.ts +0 -131
  511. package/src/primitives/chat-config.tsx +0 -103
  512. package/src/primitives/composer-model.ts +0 -49
  513. package/src/primitives/composer-triggers.ts +0 -35
  514. package/src/primitives/controllable.ts +0 -21
  515. package/src/primitives/conversation-store.ts +0 -248
  516. package/src/primitives/create-kai-chat.ts +0 -66
  517. package/src/primitives/create-tween.ts +0 -266
  518. package/src/primitives/embed-providers.ts +0 -254
  519. package/src/primitives/field-mask.ts +0 -256
  520. package/src/primitives/field-semantics.ts +0 -115
  521. package/src/primitives/highlighter.ts +0 -157
  522. package/src/primitives/input-mask.ts +0 -853
  523. package/src/primitives/link-preview.ts +0 -87
  524. package/src/primitives/message-feedback.ts +0 -124
  525. package/src/primitives/pdf-preview.ts +0 -121
  526. package/src/primitives/toast-store.ts +0 -338
  527. package/src/primitives/url-scheme-policy.ts +0 -70
  528. package/src/primitives/use-audio-analysis.ts +0 -340
  529. package/src/primitives/use-auto-resize.ts +0 -31
  530. package/src/primitives/use-resize-observer.ts +0 -45
  531. package/src/primitives/use-sequencer.ts +0 -72
  532. package/src/primitives/use-speech-recognition.ts +0 -146
  533. package/src/primitives/use-stick-to-bottom.ts +0 -75
  534. package/src/primitives/use-text-stream.ts +0 -143
  535. package/src/primitives/use-voice-recorder.ts +0 -62
  536. package/src/primitives/visualizer-sequences.ts +0 -350
  537. package/src/remote/host-embed.ts +0 -345
  538. package/src/remote/index.ts +0 -2
  539. package/src/remote/origin.ts +0 -30
  540. package/src/remote/provider-runtime.ts +0 -262
  541. package/src/remote/provider.ts +0 -2
  542. package/src/remote/validate.ts +0 -22
  543. package/src/remote/version.ts +0 -12
  544. package/src/remote/wire.ts +0 -48
  545. package/src/schemas/from-tool-call.ts +0 -151
  546. package/src/schemas/index.ts +0 -341
  547. package/src/schemas/provider-subsets.ts +0 -538
  548. package/src/schemas/registry.ts +0 -355
  549. package/src/schemas/tool-defs.ts +0 -793
  550. package/src/solid.ts +0 -173
  551. package/src/state/index.ts +0 -44
  552. package/src/state/messages.ts +0 -53
  553. package/src/state/mock.ts +0 -297
  554. package/src/state/parts.ts +0 -295
  555. package/src/state/persistence.ts +0 -180
  556. package/src/state/stream.ts +0 -246
  557. package/src/state/suggestions.ts +0 -9
  558. package/src/state/threads.ts +0 -142
  559. package/src/test-utils/fake-clock.ts +0 -88
  560. package/src/types.ts +0 -95
  561. package/src/ui/action-icons.ts +0 -53
  562. package/src/ui/agent-card.tsx +0 -218
  563. package/src/ui/avatar.tsx +0 -23
  564. package/src/ui/badge.tsx +0 -21
  565. package/src/ui/button.tsx +0 -49
  566. package/src/ui/card.tsx +0 -245
  567. package/src/ui/checkbox-group.tsx +0 -153
  568. package/src/ui/checkbox.tsx +0 -63
  569. package/src/ui/collapsible.tsx +0 -163
  570. package/src/ui/command.tsx +0 -103
  571. package/src/ui/dialog.tsx +0 -223
  572. package/src/ui/dock.tsx +0 -630
  573. package/src/ui/dropdown.tsx +0 -636
  574. package/src/ui/editable-label.tsx +0 -112
  575. package/src/ui/hover-card.tsx +0 -345
  576. package/src/ui/icon.tsx +0 -167
  577. package/src/ui/input.tsx +0 -391
  578. package/src/ui/kbd.tsx +0 -118
  579. package/src/ui/nav.tsx +0 -282
  580. package/src/ui/notice.tsx +0 -84
  581. package/src/ui/overlay.tsx +0 -277
  582. package/src/ui/pane-grid.tsx +0 -117
  583. package/src/ui/pane-group.tsx +0 -291
  584. package/src/ui/pane.tsx +0 -193
  585. package/src/ui/popover.tsx +0 -106
  586. package/src/ui/progress-bar.tsx +0 -83
  587. package/src/ui/prompt-dock.tsx +0 -145
  588. package/src/ui/radio.tsx +0 -150
  589. package/src/ui/resizable.tsx +0 -693
  590. package/src/ui/scroll-area.tsx +0 -26
  591. package/src/ui/segmented.tsx +0 -109
  592. package/src/ui/select.tsx +0 -168
  593. package/src/ui/separator.tsx +0 -10
  594. package/src/ui/settings-group.tsx +0 -67
  595. package/src/ui/skeleton.tsx +0 -73
  596. package/src/ui/slider.tsx +0 -178
  597. package/src/ui/status.tsx +0 -48
  598. package/src/ui/switch.tsx +0 -119
  599. package/src/ui/tabs.tsx +0 -168
  600. package/src/ui/textarea.tsx +0 -21
  601. package/src/ui/tooltip.tsx +0 -118
  602. package/src/utils/cn.ts +0 -30
  603. package/src/wire/chunk.ts +0 -248
  604. package/src/wire/consume.ts +0 -599
  605. package/src/wire/diagnostics.ts +0 -727
  606. package/src/wire/encode-probe.ts +0 -214
  607. package/src/wire/encode.ts +0 -947
  608. package/src/wire/files.ts +0 -342
  609. package/src/wire/formats/anthropic.ts +0 -274
  610. package/src/wire/formats/openai.ts +0 -228
  611. package/src/wire/index.ts +0 -95
  612. package/src/wire/media-types.ts +0 -344
  613. package/src/wire/read.ts +0 -396
  614. package/src/wire/sink-helpers.ts +0 -50
  615. package/src/wire/sse.ts +0 -153
@@ -1,12 +1 @@
1
- var Ln=Object.defineProperty,In=(e,t,n)=>t in e?Ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t,n)=>In(e,typeof t!="symbol"?t+"":t,n),C=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function En(e){return Oe(e)}function Oe(e){return Array.isArray(e)?On(e):e instanceof RegExp?e:typeof e=="object"?Mn(e):e}function On(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Oe(e[n]);return t}function Mn(e){let t={};for(let n in e)t[n]=Oe(e[n]);return t}function ht(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function dt(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?dt(e.substring(0,e.length-1)):e.substr(~t+1)}var Me=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,fe=class{static hasCaptures(e){return e===null?!1:(Me.lastIndex=0,Me.test(e))}static replaceCaptures(e,t,n){return e.replace(Me,(r,o,s,a)=>{let l=n[parseInt(o||s,10)];if(l){let i=t.substring(l.start,l.end);for(;i[0]===".";)i=i.substring(1);switch(a){case"downcase":return i.toLowerCase();case"upcase":return i.toUpperCase();default:return i}}else return r})}};function pt(e,t){return e<t?-1:e>t?1:0}function gt(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let o=0;o<n;o++){let s=pt(e[o],t[o]);if(s!==0)return s}return 0}return n-r}function mt(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ft(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var yt=class{constructor(e){p(this,"cache",new Map),this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},ye=class{constructor(e,t,n){p(this,"_cachedMatchRoot",new yt(r=>this._root.match(r))),this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Dn(e),t)}static createFromParsedTheme(e,t){return jn(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(r=>Bn(e.parent,r.parentScopes));return n?new bt(n.fontStyle,n.foreground,n.background):null}},Be=class Ie{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Ie(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Ie(n,t[r]);return n}push(t){return new Ie(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function Bn(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],o=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],o=!0}for(;e&&!Gn(e.scopeName,r);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Gn(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var bt=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Dn(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let o=0,s=t.length;o<s;o++){let a=t[o];if(!a.settings)continue;let l;if(typeof a.scope=="string"){let u=a.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),l=u.split(",")}else Array.isArray(a.scope)?l=a.scope:l=[""];let i=-1;if(typeof a.settings.fontStyle=="string"){i=0;let u=a.settings.fontStyle.split(" ");for(let d=0,g=u.length;d<g;d++)switch(u[d]){case"italic":i=i|1;break;case"bold":i=i|2;break;case"underline":i=i|4;break;case"strikethrough":i=i|8;break}}let c=null;typeof a.settings.foreground=="string"&&mt(a.settings.foreground)&&(c=a.settings.foreground);let h=null;typeof a.settings.background=="string"&&mt(a.settings.background)&&(h=a.settings.background);for(let u=0,d=l.length;u<d;u++){let g=l[u].trim().split(" "),f=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[r++]=new $n(f,_,o,i,c,h)}}return n}var $n=class{constructor(e,t,n,r,o,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=s}},L=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(L||{});function jn(e,t){e.sort((i,c)=>{let h=pt(i.scope,c.scope);return h!==0||(h=gt(i.parentScopes,c.parentScopes),h!==0)?h:i.index-c.index});let n=0,r="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let i=e.shift();i.fontStyle!==-1&&(n=i.fontStyle),i.foreground!==null&&(r=i.foreground),i.background!==null&&(o=i.background)}let s=new Fn(t),a=new bt(n,s.getId(r),s.getId(o)),l=new Un(new Ge(0,null,-1,0,0),[]);for(let i=0,c=e.length;i<c;i++){let h=e[i];l.insert(0,h.scope,h.parentScopes,h.fontStyle,s.getId(h.foreground),s.getId(h.background))}return new ye(s,a,l)}var Fn=class{constructor(e){if(p(this,"_isFrozen"),p(this,"_lastColorId"),p(this,"_id2color"),p(this,"_color2id"),this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Wn=Object.freeze([]),Ge=class An{constructor(t,n,r,o,s){p(this,"scopeDepth"),p(this,"parentScopes"),p(this,"fontStyle"),p(this,"foreground"),p(this,"background"),this.scopeDepth=t,this.parentScopes=n||Wn,this.fontStyle=r,this.foreground=o,this.background=s}clone(){return new An(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,o=t.length;r<o;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),o!==0&&(this.background=o)}},Un=class ct{constructor(t,n=[],r={}){p(this,"_rulesWithParentScopes"),this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,o=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[o]===">"&&o++,!(r>=t.parentScopes.length||o>=n.parentScopes.length);){const s=n.parentScopes[o].length-t.parentScopes[r].length;if(s!==0)return s;r++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),o,s;if(r===-1?(o=t,s=""):(o=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(o))return this._children[o].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ct._cmpBySpecificity),n}insert(t,n,r,o,s,a){if(n===""){this._doInsertHere(t,r,o,s,a);return}let l=n.indexOf("."),i,c;l===-1?(i=n,c=""):(i=n.substring(0,l),c=n.substring(l+1));let h;this._children.hasOwnProperty(i)?h=this._children[i]:(h=new ct(this._mainRule.clone(),Ge.cloneArr(this._rulesWithParentScopes)),this._children[i]=h),h.insert(t+1,c,r,o,s,a)}_doInsertHere(t,n,r,o,s){if(n===null){this._mainRule.acceptOverwrite(t,r,o,s);return}for(let a=0,l=this._rulesWithParentScopes.length;a<l;a++){let i=this._rulesWithParentScopes[a];if(gt(i.parentScopes,n)===0){i.acceptOverwrite(t,r,o,s);return}}r===-1&&(r=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Ge(t,n,r,o,s))}},Y=class M{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=M.getLanguageId(t),r=M.getTokenType(t),o=M.getFontStyle(t),s=M.getForeground(t),a=M.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:s,background:a})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,o,s,a,l){let i=M.getLanguageId(t),c=M.getTokenType(t),h=M.containsBalancedBrackets(t)?1:0,u=M.getFontStyle(t),d=M.getForeground(t),g=M.getBackground(t);return n!==0&&(i=n),r!==8&&(c=r),o!==null&&(h=o?1:0),s!==-1&&(u=s),a!==0&&(d=a),l!==0&&(g=l),(i<<0|c<<8|h<<10|u<<11|d<<15|g<<24)>>>0}};function be(e,t){const n=[],r=qn(e);let o=r.next();for(;o!==null;){let i=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":i=1;break;case"L":i=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let c=a();if(n.push({matcher:c,priority:i}),o!==",")break;o=r.next()}return n;function s(){if(o==="-"){o=r.next();const i=s();return c=>!!i&&!i(c)}if(o==="("){o=r.next();const i=l();return o===")"&&(o=r.next()),i}if(kt(o)){const i=[];do i.push(o),o=r.next();while(kt(o));return c=>t(i,c)}return null}function a(){const i=[];let c=s();for(;c;)i.push(c),c=s();return h=>i.every(u=>u(h))}function l(){const i=[];let c=a();for(;c&&(i.push(c),o==="|"||o===",");){do o=r.next();while(o==="|"||o===",");c=a()}return h=>i.some(u=>u(h))}}function kt(e){return!!e&&!!e.match(/[\w\.:]+/)}function qn(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function _t(e){typeof e.dispose=="function"&&e.dispose()}var te=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},zn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Hn=class{constructor(){p(this,"_references",[]),p(this,"_seenReferenceKeys",new Set),p(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Yn=class{constructor(e,t){p(this,"seenFullScopeRequests",new Set),p(this,"seenPartialScopeRequests",new Set),p(this,"Q"),this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new te(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new Hn;for(const n of e)Kn(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof te){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Kn(e,t,n,r){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof te?ke({baseGrammar:s,selfGrammar:o},r):De(e.ruleName,{baseGrammar:s,selfGrammar:o,repository:o.repository},r);const a=n.injections(e.scopeName);if(a)for(const l of a)r.add(new te(l))}function De(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];_e([r],t,n)}}function ke(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&_e(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&_e(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function _e(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const o=r.repository?ht({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&_e(r.patterns,{...t,repository:o},n);const s=r.include;if(!s)continue;const a=St(s);switch(a.kind){case 0:ke({...t,selfGrammar:t.baseGrammar},n);break;case 1:ke(t,n);break;case 2:De(a.ruleName,{...t,repository:o},n);break;case 3:case 4:const l=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){const i={baseGrammar:t.baseGrammar,selfGrammar:l,repository:o};a.kind===4?De(a.ruleName,i,n):ke(i,n)}else a.kind===4?n.add(new zn(a.scopeName,a.ruleName)):n.add(new te(a.scopeName));break}}}var Vn=class{constructor(){p(this,"kind",0)}},Xn=class{constructor(){p(this,"kind",1)}},Jn=class{constructor(e){p(this,"kind",2),this.ruleName=e}},Qn=class{constructor(e){p(this,"kind",3),this.scopeName=e}},Zn=class{constructor(e,t){p(this,"kind",4),this.scopeName=e,this.ruleName=t}};function St(e){if(e==="$base")return new Vn;if(e==="$self")return new Xn;const t=e.indexOf("#");if(t===-1)return new Qn(e);if(t===0)return new Jn(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new Zn(n,r)}}var er=/\\(\d+)/,vt=/\\(\d+)/g,ws=Symbol("RuleId"),tr=-1,wt=-2,ne=class{constructor(e,t,n,r){p(this,"$location"),p(this,"id"),p(this,"_nameIsCapturing"),p(this,"_name"),p(this,"_contentNameIsCapturing"),p(this,"_contentName"),this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=fe.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=fe.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${dt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:fe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:fe.replaceCaptures(this._contentName,e,t)}},nr=class extends ne{constructor(e,t,n,r,o){super(e,t,n,r),p(this,"retokenizeCapturedWithRuleId"),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},rr=class extends ne{constructor(e,t,n,r,o){super(e,t,n,null),p(this,"_match"),p(this,"captures"),p(this,"_cachedCompiledPatterns"),this._match=new re(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ct=class extends ne{constructor(e,t,n,r,o){super(e,t,n,r),p(this,"hasMissingPatterns"),p(this,"patterns"),p(this,"_cachedCompiledPatterns"),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},$e=class extends ne{constructor(e,t,n,r,o,s,a,l,i,c){super(e,t,n,r),p(this,"_begin"),p(this,"beginCaptures"),p(this,"_end"),p(this,"endHasBackReferences"),p(this,"endCaptures"),p(this,"applyEndPatternLast"),p(this,"hasMissingPatterns"),p(this,"patterns"),p(this,"_cachedCompiledPatterns"),this._begin=new re(o,this.id),this.beginCaptures=s,this._end=new re(a||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=i||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oe;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Se=class extends ne{constructor(e,t,n,r,o,s,a,l,i){super(e,t,n,r),p(this,"_begin"),p(this,"beginCaptures"),p(this,"whileCaptures"),p(this,"_while"),p(this,"whileHasBackReferences"),p(this,"hasMissingPatterns"),p(this,"patterns"),p(this,"_cachedCompiledPatterns"),p(this,"_cachedCompiledWhilePatterns"),this._begin=new re(o,this.id),this.beginCaptures=s,this.whileCaptures=l,this._while=new re(a,wt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oe;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new oe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},Nt=class I{static createCaptureRule(t,n,r,o,s){return t.registerRule(a=>new nr(n,a,r,o,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new rr(t.$vscodeTextmateLocation,t.id,t.name,t.match,I._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=ht({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Ct(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,I._compilePatterns(s,n,r))}return t.while?new Se(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,I._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,I._compileCaptures(t.whileCaptures||t.captures,n,r),I._compilePatterns(t.patterns,n,r)):new $e(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,I._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,I._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,I._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let o=[];if(t){let s=0;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const l=parseInt(a,10);l>s&&(s=l)}for(let a=0;a<=s;a++)o[a]=null;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const l=parseInt(a,10);let i=0;t[a].patterns&&(i=I.getCompiledRuleId(t[a],n,r)),o[l]=I.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,i)}}return o}static _compilePatterns(t,n,r){let o=[];if(t)for(let s=0,a=t.length;s<a;s++){const l=t[s];let i=-1;if(l.include){const c=St(l.include);switch(c.kind){case 0:case 1:i=I.getCompiledRuleId(r[l.include],n,r);break;case 2:let h=r[c.ruleName];h&&(i=I.getCompiledRuleId(h,n,r));break;case 3:case 4:const u=c.scopeName,d=c.kind===4?c.ruleName:null,g=n.getExternalGrammar(u,r);if(g)if(d){let f=g.repository[d];f&&(i=I.getCompiledRuleId(f,n,g.repository))}else i=I.getCompiledRuleId(g.repository.$self,n,g.repository);break}}else i=I.getCompiledRuleId(l,n,r);if(i!==-1){const c=n.getRule(i);let h=!1;if((c instanceof Ct||c instanceof $e||c instanceof Se)&&c.hasMissingPatterns&&c.patterns.length===0&&(h=!0),h)continue;o.push(i)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},re=class xn{constructor(t,n){if(p(this,"source"),p(this,"ruleId"),p(this,"hasAnchor"),p(this,"hasBackReferences"),p(this,"_anchorCache"),t&&typeof t=="string"){const r=t.length;let o=0,s=[],a=!1;for(let l=0;l<r;l++)if(t.charAt(l)==="\\"&&l+1<r){const i=t.charAt(l+1);i==="z"?(s.push(t.substring(o,l)),s.push("$(?!\\n)(?<!\\n)"),o=l+2):(i==="A"||i==="G")&&(a=!0),l++}this.hasAnchor=a,o===0?this.source=t:(s.push(t.substring(o,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=er.test(this.source):this.hasBackReferences=!1}clone(){return new xn(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(o=>t.substring(o.start,o.end));return vt.lastIndex=0,this.source.replace(vt,(o,s)=>ft(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],o=[],s,a,l,i;for(s=0,a=this.source.length;s<a;s++)l=this.source.charAt(s),t[s]=l,n[s]=l,r[s]=l,o[s]=l,l==="\\"&&s+1<a&&(i=this.source.charAt(s+1),i==="A"?(t[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",o[s+1]="A"):i==="G"?(t[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",o[s+1]="G"):(t[s+1]=i,n[s+1]=i,r[s+1]=i,o[s+1]=i),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},oe=class{constructor(){p(this,"_items"),p(this,"_hasAnchors"),p(this,"_cached"),p(this,"_anchorCache"),this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Tt(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(o=>o.resolveAnchors(t,n));return new Tt(e,r,this._items.map(o=>o.ruleId))}},Tt=class{constructor(e,t,n){p(this,"scanner"),this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
2
- `)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},je=class{constructor(e,t){this.languageId=e,this.tokenType=t}},K,or=(K=class{constructor(e,t){p(this,"_defaultAttributes"),p(this,"_embeddedLanguagesMatcher"),p(this,"_getBasicScopeAttributes",new yt(n=>{const r=this._scopeToLanguage(n),o=this._toStandardTokenType(n);return new je(r,o)})),this._defaultAttributes=new je(e,8),this._embeddedLanguagesMatcher=new sr(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?K._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(K.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},p(K,"_NULL_SCOPE_METADATA",new je(0,0)),p(K,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),K),sr=class{constructor(e){if(p(this,"values"),p(this,"scopesRegExp"),e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>ft(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Cs={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},Pt=!1,At=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function xt(e,t,n,r,o,s,a,l){const i=t.content.length;let c=!1,h=-1;if(a){const g=ar(e,t,n,r,o,s);o=g.stack,r=g.linePos,n=g.isFirstLine,h=g.anchorPosition}const u=Date.now();for(;!c;){if(l!==0&&Date.now()-u>l)return new At(o,!0);d()}return new At(o,!1);function d(){const g=ir(e,t,n,r,o,h);if(!g){s.produce(o,i),c=!0;return}const f=g.captureIndices,_=g.matchedRuleId,S=f&&f.length>0?f[0].end>r:!1;if(_===tr){const b=o.getRule(e);s.produce(o,f[0].start),o=o.withContentNameScopesList(o.nameScopesList),se(e,t,n,o,s,b.endCaptures,f),s.produce(o,f[0].end);const y=o;if(o=o.parent,h=y.getAnchorPos(),!S&&y.getEnterPos()===r){o=y,s.produce(o,i),c=!0;return}}else{const b=e.getRule(_);s.produce(o,f[0].start);const y=o,k=b.getName(t.content,f),w=o.contentNameScopesList.pushAttributed(k,e);if(o=o.push(_,r,h,f[0].end===i,null,w,w),b instanceof $e){const T=b;se(e,t,n,o,s,T.beginCaptures,f),s.produce(o,f[0].end),h=f[0].end;const P=T.getContentName(t.content,f),x=w.pushAttributed(P,e);if(o=o.withContentNameScopesList(x),T.endHasBackReferences&&(o=o.withEndRule(T.getEndWithResolvedBackReferences(t.content,f))),!S&&y.hasSameRuleAs(o)){o=o.pop(),s.produce(o,i),c=!0;return}}else if(b instanceof Se){const T=b;se(e,t,n,o,s,T.beginCaptures,f),s.produce(o,f[0].end),h=f[0].end;const P=T.getContentName(t.content,f),x=w.pushAttributed(P,e);if(o=o.withContentNameScopesList(x),T.whileHasBackReferences&&(o=o.withEndRule(T.getWhileWithResolvedBackReferences(t.content,f))),!S&&y.hasSameRuleAs(o)){o=o.pop(),s.produce(o,i),c=!0;return}}else if(se(e,t,n,o,s,b.captures,f),s.produce(o,f[0].end),o=o.pop(),!S){o=o.safePop(),s.produce(o,i),c=!0;return}}f[0].end>r&&(r=f[0].end,n=!1)}}function ar(e,t,n,r,o,s){let a=o.beginRuleCapturedEOL?0:-1;const l=[];for(let i=o;i;i=i.pop()){const c=i.getRule(e);c instanceof Se&&l.push({rule:c,stack:i})}for(let i=l.pop();i;i=l.pop()){const{ruleScanner:c,findOptions:h}=ur(i.rule,e,i.stack.endRule,n,r===a),u=c.findNextMatchSync(t,r,h);if(u){if(u.ruleId!==wt){o=i.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(s.produce(i.stack,u.captureIndices[0].start),se(e,t,n,i.stack,s,i.rule.whileCaptures,u.captureIndices),s.produce(i.stack,u.captureIndices[0].end),a=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{o=i.stack.pop();break}}return{stack:o,linePos:r,anchorPosition:a,isFirstLine:n}}function ir(e,t,n,r,o,s){const a=lr(e,t,n,r,o,s),l=e.getInjections();if(l.length===0)return a;const i=cr(l,e,t,n,r,o,s);if(!i)return a;if(!a)return i;const c=a.captureIndices[0].start,h=i.captureIndices[0].start;return h<c||i.priorityMatch&&h===c?i:a}function lr(e,t,n,r,o,s){const a=o.getRule(e),{ruleScanner:l,findOptions:i}=Rt(a,e,o.endRule,n,r===s),c=l.findNextMatchSync(t,r,i);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function cr(e,t,n,r,o,s,a){let l=Number.MAX_VALUE,i=null,c,h=0;const u=s.contentNameScopesList.getScopeNames();for(let d=0,g=e.length;d<g;d++){const f=e[d];if(!f.matcher(u))continue;const _=t.getRule(f.ruleId),{ruleScanner:S,findOptions:b}=Rt(_,t,null,r,o===a),y=S.findNextMatchSync(n,o,b);if(!y)continue;const k=y.captureIndices[0].start;if(!(k>=l)&&(l=k,i=y.captureIndices,c=y.ruleId,h=f.priority,l===o))break}return i?{priorityMatch:h===-1,captureIndices:i,matchedRuleId:c}:null}function Rt(e,t,n,r,o){if(Pt){const s=e.compile(t,n),a=Lt(r,o);return{ruleScanner:s,findOptions:a}}return{ruleScanner:e.compileAG(t,n,r,o),findOptions:0}}function ur(e,t,n,r,o){if(Pt){const s=e.compileWhile(t,n),a=Lt(r,o);return{ruleScanner:s,findOptions:a}}return{ruleScanner:e.compileWhileAG(t,n,r,o),findOptions:0}}function Lt(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function se(e,t,n,r,o,s,a){if(s.length===0)return;const l=t.content,i=Math.min(s.length,a.length),c=[],h=a[0].end;for(let u=0;u<i;u++){const d=s[u];if(d===null)continue;const g=a[u];if(g.length===0)continue;if(g.start>h)break;for(;c.length>0&&c[c.length-1].endPos<=g.start;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?o.produceFromScopes(c[c.length-1].scopes,g.start):o.produce(r,g.start),d.retokenizeCapturedWithRuleId){const _=d.getName(l,a),S=r.contentNameScopesList.pushAttributed(_,e),b=d.getContentName(l,a),y=S.pushAttributed(b,e),k=r.push(d.retokenizeCapturedWithRuleId,g.start,-1,!1,null,S,y),w=e.createOnigString(l.substring(0,g.end));xt(e,w,n&&g.start===0,g.start,k,o,!1,0),_t(w);continue}const f=d.getName(l,a);if(f!==null){const _=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);c.push(new hr(_,g.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var hr=class{constructor(e,t){p(this,"scopes"),p(this,"endPos"),this.scopes=e,this.endPos=t}};function dr(e,t,n,r,o,s,a,l){return new gr(e,t,n,r,o,s,a,l)}function It(e,t,n,r,o){const s=be(t,ve),a=Nt.getCompiledRuleId(n,r,o.repository);for(const l of s)e.push({debugSelector:t,matcher:l.matcher,ruleId:a,grammar:o,priority:l.priority})}function ve(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let o=n;o<t.length;o++)if(pr(t[o],r))return n=o+1,!0;return!1})}function pr(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var gr=class{constructor(e,t,n,r,o,s,a,l){if(p(this,"_rootId"),p(this,"_lastRuleId"),p(this,"_ruleId2desc"),p(this,"_includedGrammars"),p(this,"_grammarRepository"),p(this,"_grammar"),p(this,"_injections"),p(this,"_basicScopeAttributesProvider"),p(this,"_tokenTypeMatchers"),this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=l,this._basicScopeAttributesProvider=new or(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=Et(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const i of Object.keys(o)){const c=be(i,ve);for(const h of c)this._tokenTypeMatchers.push({matcher:h.matcher,type:o[i]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const o=r.injections;if(o)for(let a in o)It(t,a,o[a],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(a=>{const l=this.getExternalGrammar(a);if(l){const i=l.injectionSelector;i&&It(t,i,l,this,l)}})}return t.sort((o,s)=>o.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Et(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Nt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Fe.NULL){o=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),h=this.themeProvider.getDefaults(),u=Y.set(0,c.languageId,c.tokenType,null,h.fontStyle,h.foregroundId,h.backgroundId),d=this.getRule(this._rootId).getName(null,null);let g;d?g=ae.createRootAndLookUpScopeName(d,u,this):g=ae.createRoot("unknown",u),t=new Fe(null,this._rootId,-1,-1,!1,null,g,g)}else o=!1,t.reset();e=e+`
3
- `;const s=this.createOnigString(e),a=s.content.length,l=new fr(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),i=xt(this,s,o,0,t,l,!0,r);return _t(s),{lineLength:a,lineTokens:l,ruleStack:i.stack,stoppedEarly:i.stoppedEarly}}};function Et(e,t){return e=En(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var ae=class G{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,o=t?.scopePath??null;for(const s of n)o=Be.push(o,s.scopeNames),r=new G(r,o,s.encodedTokenAttributes);return r}static createRoot(t,n){return new G(null,new Be(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const o=r.getMetadataForScope(t),s=new Be(null,t),a=r.themeProvider.themeMatch(s),l=G.mergeAttributes(n,o,a);return new G(null,s,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return G.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let o=-1,s=0,a=0;return r!==null&&(o=r.fontStyle,s=r.foregroundId,a=r.backgroundId),Y.set(t,n.languageId,n.tokenType,null,o,s,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return G._pushAttributed(this,t,n);const r=t.split(/ /g);let o=this;for(const s of r)o=G._pushAttributed(o,s,n);return o}static _pushAttributed(t,n,r){const o=r.getMetadataForScope(n),s=t.scopePath.push(n),a=r.themeProvider.themeMatch(s),l=G.mergeAttributes(t.tokenAttributes,o,a);return new G(t,s,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var n;const r=[];let o=this;for(;o&&o!==t;)r.push({encodedTokenAttributes:o.tokenAttributes,scopeNames:o.scopePath.getExtensionIfDefined(((n=o.parent)==null?void 0:n.scopePath)??null)}),o=o.parent;return o===t?r.reverse():void 0}},$,Fe=($=class{constructor(e,t,n,r,o,s,a,l){p(this,"_stackElementBrand"),p(this,"_enterPos"),p(this,"_anchorPos"),p(this,"depth"),this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}equals(e){return e===null?!1:$._equals(this,e)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?ae.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){$._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,n,r,o,s,a){return new $(this,e,t,n,r,o,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){var n,r;return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${(n=this.nameScopesList)==null?void 0:n.toString()}, ${(r=this.contentNameScopesList)==null?void 0:r.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new $(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){var e,t,n;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((t=this.nameScopesList)==null?void 0:t.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((n=this.contentNameScopesList)==null?void 0:n.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,t){const n=ae.fromExtension(e?.nameScopesList??null,t.nameScopesList);return new $(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,n,ae.fromExtension(n,t.contentNameScopesList))}},p($,"NULL",new $(null,0,0,0,!1,null,null,null)),$),mr=class{constructor(e,t){p(this,"balancedBracketScopes"),p(this,"unbalancedBracketScopes"),p(this,"allowAny",!1),this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):be(n,ve).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>be(n,ve).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},fr=class{constructor(e,t,n,r){p(this,"_emitBinaryTokens"),p(this,"_lineText"),p(this,"_tokens"),p(this,"_binaryTokens"),p(this,"_lastTokenEndIndex"),p(this,"_tokenTypeOverrides"),this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var n;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let o=e?.tokenAttributes??0,s=!1;if((n=this.balancedBracketSelectors)!=null&&n.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=e?.getScopeNames()??[];for(const l of this._tokenTypeOverrides)l.matcher(a)&&(o=Y.set(o,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(o=Y.set(o,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=t;return}const r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n}},yr=class{constructor(e,t){p(this,"_grammars",new Map),p(this,"_rawGrammars",new Map),p(this,"_injectionGrammars",new Map),p(this,"_theme"),this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,o){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,dr(e,s,t,n,r,o,this,this._onigLib))}return this._grammars.get(e)}},br=class{constructor(e){p(this,"_options"),p(this,"_syncRegistry"),p(this,"_ensureGrammarCache"),this._options=e,this._syncRegistry=new yr(ye.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ye.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new mr(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,o){const s=new Yn(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,o)}},We=Fe.NULL;function ie(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[o,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[o]=s:o===r&&Object.assign(n,s);return n}function j(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Ot(e){return Array.isArray(e)?e:[e]}async function Ue(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function le(e){return!e||["plaintext","txt","text","plain"].includes(e)}function qe(e){return e==="ansi"||le(e)}function ce(e){return e==="none"}function ze(e){return ce(e)}const kr=/(\r?\n)/g;function ue(e,t=!1){var n;if(e.length===0)return[["",0]];const r=e.split(kr);let o=0;const s=[];for(let a=0;a<r.length;a+=2){const l=t?r[a]+(r[a+1]||""):r[a];s.push([l,o]),o+=r[a].length,o+=((n=r[a+1])==null?void 0:n.length)||0}return s}const Mt={light:"#333333",dark:"#bbbbbb"},Bt={light:"#fffffe",dark:"#1e1e1e"},Gt="__shiki_resolved";function we(e){var t,n,r,o,s;if(e!=null&&e[Gt])return e;const a={...e};a.tokenColors&&!a.settings&&(a.settings=a.tokenColors,delete a.tokenColors),a.type||(a.type="dark"),a.colorReplacements={...a.colorReplacements},a.settings||(a.settings=[]);let{bg:l,fg:i}=a;if(!l||!i){const d=a.settings?a.settings.find(g=>!g.name&&!g.scope):void 0;(t=d?.settings)!=null&&t.foreground&&(i=d.settings.foreground),(n=d?.settings)!=null&&n.background&&(l=d.settings.background),!i&&(r=a?.colors)!=null&&r["editor.foreground"]&&(i=a.colors["editor.foreground"]),!l&&(o=a?.colors)!=null&&o["editor.background"]&&(l=a.colors["editor.background"]),i||(i=a.type==="light"?Mt.light:Mt.dark),l||(l=a.type==="light"?Bt.light:Bt.dark),a.fg=i,a.bg=l}a.settings[0]&&a.settings[0].settings&&!a.settings[0].scope||a.settings.unshift({settings:{foreground:a.fg,background:a.bg}});let c=0;const h=new Map;function u(d){var g;if(h.has(d))return h.get(d);c+=1;const f=`#${c.toString(16).padStart(8,"0").toLowerCase()}`;return(g=a.colorReplacements)!=null&&g[`#${f}`]?u(d):(h.set(d,f),f)}a.settings=a.settings.map(d=>{var g,f;const _=((g=d.settings)==null?void 0:g.foreground)&&!d.settings.foreground.startsWith("#"),S=((f=d.settings)==null?void 0:f.background)&&!d.settings.background.startsWith("#");if(!_&&!S)return d;const b={...d,settings:{...d.settings}};if(_){const y=u(d.settings.foreground);a.colorReplacements[y]=d.settings.foreground,b.settings.foreground=y}if(S){const y=u(d.settings.background);a.colorReplacements[y]=d.settings.background,b.settings.background=y}return b});for(const d of Object.keys(a.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!((s=a.colors[d])!=null&&s.startsWith("#"))){const g=u(a.colors[d]);a.colorReplacements[g]=a.colors[d],a.colors[d]=g}return Object.defineProperty(a,Gt,{enumerable:!1,writable:!1,value:!0}),a}async function Dt(e){return[...new Set((await Promise.all(e.filter(t=>!qe(t)).map(async t=>await Ue(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function $t(e){return(await Promise.all(e.map(async t=>ze(t)?null:we(await Ue(t))))).filter(t=>!!t)}function jt(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new C(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var _r=class extends br{constructor(e,t,n,r={}){super(e),p(this,"_resolver"),p(this,"_themes"),p(this,"_langs"),p(this,"_alias"),p(this,"_resolvedThemes",new Map),p(this,"_resolvedGrammars",new Map),p(this,"_langMap",new Map),p(this,"_langGraph",new Map),p(this,"_textmateThemeCache",new WeakMap),p(this,"_loadedThemesCache",null),p(this,"_loadedLanguagesCache",null),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=we(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=ye.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=jt(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){var t,n,r,o;if(this.getGrammar(e.name))return;const s=new Set([...this._langMap.values()].filter(i=>{var c;return(c=i.embeddedLangsLazy)==null?void 0:c.includes(e.name)}));this._resolver.addLanguage(e);const a={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const l=this.loadGrammarWithConfiguration(e.scopeName,1,a);if(l.name=e.name,this._resolvedGrammars.set(e.name,l),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,s.size)for(const i of s)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,(n=(t=this._syncRegistry)==null?void 0:t._injectionGrammars)==null||n.delete(i.scopeName),(o=(r=this._syncRegistry)==null?void 0:r._grammars)==null||o.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,o])=>!o);if(n.length){const r=t.filter(([o,s])=>{var a;return s?(a=s.embeddedLanguages||s.embeddedLangs)==null?void 0:a.some(l=>n.map(([i])=>i).includes(l)):!1}).filter(o=>!n.includes(o));throw new C(`Missing languages ${n.map(([o])=>`\`${o}\``).join(", ")}, required by ${r.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[r,o]of t)this._resolver.addLanguage(o);for(const[r,o]of t)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},Sr=class{constructor(e,t){p(this,"_langs",new Map),p(this,"_scopeToLang",new Map),p(this,"_injections",new Map),p(this,"_onigLib"),this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const o=t.slice(0,r).join(".");n=[...n,...this._injections.get(o)||[]]}return n}};let he=0;function Ce(e){he+=1,e.warnings!==!1&&he>=10&&he%10===0&&console.warn(`[Shiki] ${he} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new C("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(we),o=new _r(new Sr(e.engine,n),r,n,e.langAlias);let s;function a(y){return jt(y,e.langAlias)}function l(y){S();const k=o.getGrammar(typeof y=="string"?y:y.name);if(!k)throw new C(`Language \`${y}\` not found, you may need to load it first`);return k}function i(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};S();const k=o.getTheme(y);if(!k)throw new C(`Theme \`${y}\` not found, you may need to load it first`);return k}function c(y){S();const k=i(y);return s!==y&&(o.setTheme(k),s=y),{theme:k,colorMap:o.getColorMap()}}function h(){return S(),o.getLoadedThemes()}function u(){return S(),o.getLoadedLanguages()}function d(...y){S(),o.loadLanguages(y.flat(1))}async function g(...y){return d(await Dt(y))}function f(...y){S();for(const k of y.flat(1))o.loadTheme(k)}async function _(...y){return S(),f(await $t(y))}function S(){if(t)throw new C("Shiki instance has been disposed")}function b(){t||(t=!0,o.dispose(),he-=1)}return{setTheme:c,getTheme:i,getLanguage:l,getLoadedThemes:h,getLoadedLanguages:u,resolveLangAlias:a,loadLanguage:g,loadLanguageSync:d,loadTheme:_,loadThemeSync:f,dispose:b,[Symbol.dispose]:b}}const vr=Ce;async function He(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([$t(e.themes||[]),Dt(e.langs||[]),e.engine]);return Ce({...e,themes:t,langs:n,engine:r})}const wr=He,Ft=new WeakMap;function Ne(e,t){Ft.set(e,t)}function de(e){return Ft.get(e)}var Te=class Rn{constructor(...t){if(p(this,"_stacks",{}),p(this,"lang"),t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,o]=t;this.lang=r,this._stacks={[o]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Rn(Object.fromEntries(Ot(n).map(r=>[r,We])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Cr(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Cr(e){const t=[],n=new Set;function r(o){var s;if(n.has(o))return;n.add(o);const a=(s=o?.nameScopesList)==null?void 0:s.scopeName;a&&t.push(a),o.parent&&r(o.parent)}return r(e),t}function Nr(e,t){if(!(e instanceof Te))throw new C("Invalid grammar state");return e.getInternalStack(t)}const Tr=/,/,Pr=/ /;function Wt(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(le(e.resolveLangAlias(n.lang||"text"))||ce(r))return ue(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:o,colorMap:s}=e.setTheme(r),a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new C(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(o.name))throw new C(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return Ut(t,a,o,s,n)}function Ye(...e){if(e.length===2)return de(e[1]);const[t,n,r={}]=e,{lang:o="text",theme:s=t.getLoadedThemes()[0]}=r;if(le(o)||ce(s))throw new C("Plain language does not have grammar state");if(o==="ansi")throw new C("ANSI language does not have grammar state");const{theme:a,colorMap:l}=t.setTheme(s),i=t.getLanguage(o);return new Te(Ke(n,i,a,l,r).stateStack,i.name,a.name)}function Ut(e,t,n,r,o){const s=Ke(e,t,n,r,o),a=new Te(s.stateStack,t.name,n.name);return Ne(s.tokens,a),s.tokens}function Ke(e,t,n,r,o){const s=ie(n,o),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:l=500}=o,i=ue(e);let c=o.grammarState?Nr(o.grammarState,n.name)??We:o.grammarContextCode!=null?Ke(o.grammarContextCode,t,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:We,h=[];const u=[];for(let d=0,g=i.length;d<g;d++){const[f,_]=i[d];if(f===""){h=[],u.push([]);continue}if(a>0&&f.length>=a){h=[],u.push([{content:f,offset:_,color:"",fontStyle:0}]);continue}let S,b,y;o.includeExplanation&&(S=t.tokenizeLine(f,c,l),b=S.tokens,y=0);const k=t.tokenizeLine2(f,c,l),w=k.tokens.length/2;for(let T=0;T<w;T++){const P=k.tokens[2*T],x=T+1<w?k.tokens[2*T+2]:f.length;if(P===x)continue;const Z=k.tokens[2*T+1],B=j(r[Y.getForeground(Z)],s),F=Y.getFontStyle(Z),z={content:f.substring(P,x),offset:_+P,color:B,fontStyle:F};if(o.includeExplanation){const ee=[];if(o.includeExplanation!=="scopeName")for(const D of n.settings){let H;switch(typeof D.scope){case"string":H=D.scope.split(Tr).map(Ee=>Ee.trim());break;case"object":H=D.scope;break;default:continue}ee.push({settings:D,selectors:H.map(Ee=>Ee.split(Pr))})}z.explanation=[];let ut=0;for(;P+ut<x;){const D=b[y],H=f.substring(D.startIndex,D.endIndex);ut+=H.length,z.explanation.push({content:H,scopes:o.includeExplanation==="scopeName"?Ar(D.scopes):xr(ee,D.scopes)}),y+=1}}h.push(z)}u.push(h),h=[],c=k.ruleStack}return{tokens:u,stateStack:c}}function Ar(e){return e.map(t=>({scopeName:t}))}function xr(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const s=t[r];n[r]={scopeName:s,themeMatches:Lr(e,s,t.slice(0,r))}}return n}function qt(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Rr(e,t,n){if(!qt(e.at(-1),t))return!1;let r=e.length-2,o=n.length-1;for(;r>=0&&o>=0;)qt(e[r],n[o])&&(r-=1),o-=1;return r===-1}function Lr(e,t,n){const r=[];for(const{selectors:o,settings:s}of e)for(const a of o)if(Rr(a,t,n)){r.push(s);break}return r}function Pe(e,t,n,r=Wt){const o=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=o.map(c=>{const h=r(e,t,{...n,theme:c.theme});return{tokens:h,state:de(h),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),a=Ir(...s.map(c=>c.tokens)),l=a[0].map((c,h)=>c.map((u,d)=>{const g={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=u.explanation),a.forEach((f,_)=>{const{content:S,explanation:b,offset:y,...k}=f[h][d];g.variants[o[_].color]=k}),g})),i=s[0].state?new Te(Object.fromEntries(s.map(c=>{var h;return[c.theme,(h=c.state)==null?void 0:h.getInternalStack(c.theme)]})),s[0].state.lang):void 0;return i&&Ne(l,i),l}function Ir(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const o=e.map(i=>i[r]),s=t.map(()=>[]);t.forEach((i,c)=>i.push(s[c]));const a=o.map(()=>0),l=o.map(i=>i[0]);for(;l.every(i=>i);){const i=Math.min(...l.map(c=>c.content.length));for(let c=0;c<n;c++){const h=l[c];h.content.length===i?(s[c].push(h),a[c]+=1,l[c]=o[c][a[c]]):(s[c].push({...h,content:h.content.slice(0,i)}),l[c]={...h,content:h.content.slice(i),offset:h.offset+i})}}}return t}const Er=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class pe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}pe.prototype.normal={},pe.prototype.property={},pe.prototype.space=void 0;function zt(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new pe(n,r,t)}function Ve(e){return e.toLowerCase()}class E{constructor(t,n){this.attribute=n,this.property=t}}E.prototype.attribute="",E.prototype.booleanish=!1,E.prototype.boolean=!1,E.prototype.commaOrSpaceSeparated=!1,E.prototype.commaSeparated=!1,E.prototype.defined=!1,E.prototype.mustUseProperty=!1,E.prototype.number=!1,E.prototype.overloadedBoolean=!1,E.prototype.property="",E.prototype.spaceSeparated=!1,E.prototype.space=void 0;let Or=0;const v=U(),A=U(),Xe=U(),m=U(),N=U(),W=U(),O=U();function U(){return 2**++Or}const Je=Object.freeze(Object.defineProperty({__proto__:null,boolean:v,booleanish:A,commaOrSpaceSeparated:O,commaSeparated:W,number:m,overloadedBoolean:Xe,spaceSeparated:N},Symbol.toStringTag,{value:"Module"})),Qe=Object.keys(Je);class Ze extends E{constructor(t,n,r,o){let s=-1;if(super(t,n),Ht(this,"space",o),typeof r=="number")for(;++s<Qe.length;){const a=Qe[s];Ht(this,Qe[s],(r&Je[a])===Je[a])}}}Ze.prototype.defined=!0;function Ht(e,t,n){n&&(e[t]=n)}function V(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const s=new Ze(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Ve(r)]=r,n[Ve(s.attribute)]=r}return new pe(t,n,e.space)}const Yt=V({properties:{ariaActiveDescendant:null,ariaAtomic:A,ariaAutoComplete:null,ariaBusy:A,ariaChecked:A,ariaColCount:m,ariaColIndex:m,ariaColSpan:m,ariaControls:N,ariaCurrent:null,ariaDescribedBy:N,ariaDetails:null,ariaDisabled:A,ariaDropEffect:N,ariaErrorMessage:null,ariaExpanded:A,ariaFlowTo:N,ariaGrabbed:A,ariaHasPopup:null,ariaHidden:A,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:N,ariaLevel:m,ariaLive:null,ariaModal:A,ariaMultiLine:A,ariaMultiSelectable:A,ariaOrientation:null,ariaOwns:N,ariaPlaceholder:null,ariaPosInSet:m,ariaPressed:A,ariaReadOnly:A,ariaRelevant:null,ariaRequired:A,ariaRoleDescription:N,ariaRowCount:m,ariaRowIndex:m,ariaRowSpan:m,ariaSelected:A,ariaSetSize:m,ariaSort:null,ariaValueMax:m,ariaValueMin:m,ariaValueNow:m,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kt(e,t){return t in e?e[t]:t}function Vt(e,t){return Kt(e,t.toLowerCase())}const Mr=V({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:W,acceptCharset:N,accessKey:N,action:null,allow:null,allowFullScreen:v,allowPaymentRequest:v,allowUserMedia:v,alpha:v,alt:null,as:null,async:v,autoCapitalize:null,autoComplete:N,autoFocus:v,autoPlay:v,blocking:N,capture:null,charSet:null,checked:v,cite:null,className:N,closedBy:null,colorSpace:null,cols:m,colSpan:m,command:null,commandFor:null,content:null,contentEditable:A,controls:v,controlsList:N,coords:m|W,crossOrigin:null,data:null,dateTime:null,decoding:null,default:v,defer:v,dir:null,dirName:null,disabled:v,download:Xe,draggable:A,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:v,formTarget:null,headers:N,height:m,hidden:Xe,high:m,href:null,hrefLang:null,htmlFor:N,httpEquiv:N,id:null,imageSizes:null,imageSrcSet:null,inert:v,inputMode:null,integrity:null,is:null,isMap:v,itemId:null,itemProp:N,itemRef:N,itemScope:v,itemType:N,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:v,low:m,manifest:null,max:null,maxLength:m,media:null,method:null,min:null,minLength:m,multiple:v,muted:v,name:null,nonce:null,noModule:v,noValidate:v,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:v,optimum:m,pattern:null,ping:N,placeholder:null,playsInline:v,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:v,referrerPolicy:null,rel:N,required:v,reversed:v,rows:m,rowSpan:m,sandbox:N,scope:null,scoped:v,seamless:v,selected:v,shadowRootClonable:v,shadowRootCustomElementRegistry:v,shadowRootDelegatesFocus:v,shadowRootMode:null,shadowRootSerializable:v,shape:null,size:m,sizes:null,slot:null,span:m,spellCheck:A,src:null,srcDoc:null,srcLang:null,srcSet:null,start:m,step:null,style:null,tabIndex:m,target:null,title:null,translate:null,type:null,typeMustMatch:v,useMap:null,value:A,width:m,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:N,axis:null,background:null,bgColor:null,border:m,borderColor:null,bottomMargin:m,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:v,declare:v,event:null,face:null,frame:null,frameBorder:null,hSpace:m,leftMargin:m,link:null,longDesc:null,lowSrc:null,marginHeight:m,marginWidth:m,noResize:v,noHref:v,noShade:v,noWrap:v,object:null,profile:null,prompt:null,rev:null,rightMargin:m,rules:null,scheme:null,scrolling:A,standby:null,summary:null,text:null,topMargin:m,valueType:null,version:null,vAlign:null,vLink:null,vSpace:m,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:v,disablePictureInPicture:v,disableRemotePlayback:v,exportParts:W,part:N,prefix:null,property:null,results:m,security:null,unselectable:null},space:"html",transform:Vt}),Br=V({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",maskType:"mask-type",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:O,accentHeight:m,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:m,amplitude:m,arabicForm:null,ascent:m,attributeName:null,attributeType:null,azimuth:m,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:m,by:null,calcMode:null,capHeight:m,className:N,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:m,diffuseConstant:m,direction:null,display:null,dur:null,divisor:m,dominantBaseline:null,download:v,dx:null,dy:null,edgeMode:null,editable:null,elevation:m,enableBackground:null,end:null,event:null,exponent:m,externalResourcesRequired:null,fill:null,fillOpacity:m,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:W,g2:W,glyphName:W,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:m,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:m,horizOriginX:m,horizOriginY:m,id:null,ideographic:m,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:m,k:m,k1:m,k2:m,k3:m,k4:m,kernelMatrix:O,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:m,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:m,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:m,overlineThickness:m,paintOrder:null,panose1:null,path:null,pathLength:m,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:N,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:m,pointsAtY:m,pointsAtZ:m,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:O,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:O,rev:O,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:O,requiredFeatures:O,requiredFonts:O,requiredFormats:O,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:m,specularExponent:m,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:m,strikethroughThickness:m,string:null,stroke:null,strokeDashArray:O,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:m,strokeOpacity:m,strokeWidth:null,style:null,surfaceScale:m,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:O,tabIndex:m,tableValues:null,target:null,targetX:m,targetY:m,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:O,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:m,underlineThickness:m,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:m,values:null,vAlphabetic:m,vMathematical:m,vectorEffect:null,vHanging:m,vIdeographic:m,version:null,vertAdvY:m,vertOriginX:m,vertOriginY:m,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:m,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kt}),Xt=V({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()}}),Jt=V({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Vt}),Qt=V({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Gr=/[A-Z]/g,Zt=/-[a-z]/g,Dr=/^data[-\w.:]+$/i;function $r(e,t){const n=Ve(t);let r=t,o=E;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Dr.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Zt,Fr);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Zt.test(s)){let a=s.replace(Gr,jr);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=Ze}return new o(r,t)}function jr(e){return"-"+e.toLowerCase()}function Fr(e){return e.charAt(1).toUpperCase()}const Wr=zt([Yt,Mr,Xt,Jt,Qt],"html"),en=zt([Yt,Br,Xt,Jt,Qt],"svg"),tn={}.hasOwnProperty;function Ur(e,t){const n=t||{};function r(o,...s){let a=r.invalid;const l=r.handlers;if(o&&tn.call(o,e)){const i=String(o[e]);a=tn.call(l,i)?l[i]:r.unknown}if(a)return a.call(this,o,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const qr=/["&'<>`]/g,zr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Hr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Yr=/[|\\{}()[\]^$+*?.]/g,nn=new WeakMap;function Kr(e,t){if(e=e.replace(t.subset?Vr(t.subset):qr,r),t.subset||t.escapeOnly)return e;return e.replace(zr,n).replace(Hr,r);function n(o,s,a){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,a.charCodeAt(s+2),t)}function r(o,s,a){return t.format(o.charCodeAt(0),a.charCodeAt(s+1),t)}}function Vr(e){let t=nn.get(e);return t||(t=Xr(e),nn.set(e,t)),t}function Xr(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Yr,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Jr=/[\dA-Fa-f]/;function Qr(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Jr.test(String.fromCharCode(t))?r:r+";"}const Zr=/\d/;function eo(e,t,n){const r="&#"+String(e);return n&&t&&!Zr.test(String.fromCharCode(t))?r:r+";"}const to=["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"],et={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"},no=["cent","copy","divide","gt","lt","not","para","times"],rn={}.hasOwnProperty,tt={};let Ae;for(Ae in et)rn.call(et,Ae)&&(tt[et[Ae]]=Ae);const ro=/[^\dA-Za-z]/;function oo(e,t,n,r){const o=String.fromCharCode(e);if(rn.call(tt,o)){const s=tt[o],a="&"+s;return n&&to.includes(s)&&!no.includes(s)&&(!r||t&&t!==61&&ro.test(String.fromCharCode(t)))?a:a+";"}return""}function so(e,t,n){let r=Qr(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=oo(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const s=eo(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return o&&(!n.useShortestReferences||o.length<r.length)?o:r}function X(e,t){return Kr(e,Object.assign({format:so},t))}const ao=/^>|^->|<!--|-->|--!>|<!-$/g,io=[">"],lo=["<",">"];function co(e,t,n,r){return r.settings.bogusComments?"<?"+X(e.value,Object.assign({},r.settings.characterReferences,{subset:io}))+">":"<!--"+e.value.replace(ao,o)+"-->";function o(s){return X(s,Object.assign({},r.settings.characterReferences,{subset:lo}))}}function uo(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function on(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function ho(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function po(e){return e.join(" ").trim()}const go=/[ \t\n\f\r]/g;function nt(e){return typeof e=="object"?e.type==="text"?sn(e.value):!1:sn(e)}function sn(e){return e.replace(go,"")===""}const R=ln(1),an=ln(-1),mo=[];function ln(e){return t;function t(n,r,o){const s=n?n.children:mo;let a=(r||0)+e,l=s[a];if(!o)for(;l&&nt(l);)a+=e,l=s[a];return l}}const fo={}.hasOwnProperty;function cn(e){return t;function t(n,r,o){return fo.call(e,n.tagName)&&e[n.tagName](n,r,o)}}const rt=cn({body:bo,caption:ot,colgroup:ot,dd:vo,dt:So,head:ot,html:yo,li:_o,optgroup:wo,option:Co,p:ko,rp:un,rt:un,tbody:To,td:hn,tfoot:Po,th:hn,thead:No,tr:Ao});function ot(e,t,n){const r=R(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&nt(r.value.charAt(0)))}function yo(e,t,n){const r=R(n,t);return!r||r.type!=="comment"}function bo(e,t,n){const r=R(n,t);return!r||r.type!=="comment"}function ko(e,t,n){const r=R(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function _o(e,t,n){const r=R(n,t);return!r||r.type==="element"&&r.tagName==="li"}function So(e,t,n){const r=R(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function vo(e,t,n){const r=R(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function un(e,t,n){const r=R(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function wo(e,t,n){const r=R(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Co(e,t,n){const r=R(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function No(e,t,n){const r=R(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function To(e,t,n){const r=R(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Po(e,t,n){return!R(n,t)}function Ao(e,t,n){const r=R(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function hn(e,t,n){const r=R(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const xo=cn({body:Io,colgroup:Eo,head:Lo,html:Ro,tbody:Oo});function Ro(e){const t=R(e,-1);return!t||t.type!=="comment"}function Lo(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function Io(e){const t=R(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&nt(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Eo(e,t,n){const r=an(n,t),o=R(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&rt(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Oo(e,t,n){const r=an(n,t),o=R(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&rt(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const xe={name:[[`
4
- \f\r &/=>`.split(""),`
5
- \f\r "&'/=>\``.split("")],[`\0
6
- \f\r "&'/<=>`.split(""),`\0
7
- \f\r "&'/<=>\``.split("")]],unquoted:[[`
8
- \f\r &>`.split(""),`\0
9
- \f\r "&'<=>\``.split("")],[`\0
10
- \f\r "&'<=>\``.split(""),`\0
11
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Mo(e,t,n,r){const o=r.schema,s=o.space==="svg"?!1:r.settings.omitOptionalTags;let a=o.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const l=[];let i;o.space==="html"&&e.tagName==="svg"&&(r.schema=en);const c=Bo(r,e.properties),h=r.all(o.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=o,h&&(a=!1),(c||!s||!xo(e,t,n))&&(l.push("<",e.tagName,c?" "+c:""),a&&(o.space==="svg"||r.settings.closeSelfClosing)&&(i=c.charAt(c.length-1),(!r.settings.tightSelfClosing||i==="/"||i&&i!=='"'&&i!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(h),!a&&(!s||!rt(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function Bo(e,t){const n=[];let r=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const s=Go(e,o,t[o]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function Go(e,t,n){const r=$r(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let a=e.quote,l;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const i=X(r.attribute,Object.assign({},e.settings.characterReferences,{subset:xe.name[o][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?ho:po)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?i:(e.settings.preferUnquoted&&(l=X(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:xe.unquoted[o][s]}))),l!==n&&(e.settings.quoteSmart&&on(n,a)>on(n,e.alternative)&&(a=e.alternative),l=a+X(n,Object.assign({},e.settings.characterReferences,{subset:(a==="'"?xe.single:xe.double)[o][s],attribute:!0}))+a),i+(l&&"="+l))}const Do=["<","&"];function dn(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:X(e.value,Object.assign({},r.settings.characterReferences,{subset:Do}))}function $o(e,t,n,r){return r.settings.allowDangerousHtml?e.value:dn(e,t,n,r)}function jo(e,t,n,r){return r.all(e)}const Fo=Ur("type",{invalid:Wo,unknown:Uo,handlers:{comment:co,doctype:uo,element:Mo,raw:$o,root:jo,text:dn}});function Wo(e){throw new Error("Expected node, not `"+e+"`")}function Uo(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const qo={},zo={},Ho=[];function Yo(e,t){const n=t||qo,r=n.quote||'"',o=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Ko,all:Vo,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Er,characterReferences:n.characterReferences||zo,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?en:Wr,quote:r,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Ko(e,t,n){return Fo(e,t,n,this)}function Vo(e){const t=[],n=e&&e.children||Ho;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const pn=/\s+/g;function st(e,t){var n;if(!t)return e;e.properties||(e.properties={}),(n=e.properties).class||(n.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(pn)),Array.isArray(e.properties.class)||(e.properties.class=[]);const r=Array.isArray(t)?t:t.split(pn);for(const o of r)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}const Xo=/:?lang=["']([^"']+)["']/g,Jo=/(?:```|~~~)([\w-]+)/g,Qo=/\\begin\{([\w-]+)\}/g,Zo=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function gn(e){const t=ue(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t.at(-1).length};let s=o,a=0;for(const l of t){if(s<l.length)break;s-=l.length,a++}return{line:a,character:s}}function r(o,s){let a=0;for(let l=0;l<o;l++)a+=t[l].length;return a+=s,a}return{lines:t,indexToPos:n,posToIndex:r}}function es(e,t,n){const r=new Set;for(const s of e.matchAll(Xo)){const a=s[1].toLowerCase().trim();a&&r.add(a)}for(const s of e.matchAll(Jo)){const a=s[1].toLowerCase().trim();a&&r.add(a)}for(const s of e.matchAll(Qo)){const a=s[1].toLowerCase().trim();a&&r.add(a)}for(const s of e.matchAll(Zo)){const a=s[1].toLowerCase().trim(),l=a.includes("/")?a.split("/").pop():a;l&&r.add(l)}if(!n)return[...r];const o=n.getBundledLanguages();return[...r].filter(s=>s&&o[s])}const ts=["color","background-color"];function mn(e,t){let n=0;const r=[];for(const o of t)o>n&&r.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function fn(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,o)=>r-o);return n.length?e.map(r=>r.flatMap(o=>{const s=n.filter(a=>o.offset<a&&a<o.offset+o.content.length).map(a=>a-o.offset).sort((a,l)=>a-l);return s.length?mn(o,s):o})):e}function yn(e,t,n,r,o="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(h=>ge(e.variants[h])),l=new Set(a.flatMap(h=>Object.keys(h))),i={},c=(h,u)=>{const d=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+t[h]+(u==="color"?"":d)};return a.forEach((h,u)=>{for(const d of l){const g=h[d]||"inherit";if(u===0&&r&&ts.includes(d))if(r==="light-dark()"&&a.length>1){const f=t.findIndex(S=>S==="light"),_=t.findIndex(S=>S==="dark");if(f===-1||_===-1)throw new C('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');i[d]=`light-dark(${a[f][d]||"inherit"}, ${a[_][d]||"inherit"})`,o==="css-vars"&&(i[c(u,d)]=g)}else i[d]=g;else o==="css-vars"&&(i[c(u,d)]=g)}}),s.htmlStyle=i,s}function ge(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&L.Italic&&(t["font-style"]="italic"),e.fontStyle&L.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&L.Underline&&n.push("underline"),e.fontStyle&L.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Re(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function bn(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(a){if(typeof a=="number"){if(a<0||a>n.source.length)throw new C(`Invalid decoration offset: ${a}. Code length: ${n.source.length}`);return{...o.indexToPos(a),offset:a}}else{const l=o.lines[a.line];if(l===void 0)throw new C(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${o.lines.length}`);let i=a.character;if(i<0&&(i=l.length+i),i<0||i>l.length)throw new C(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${l.length}`);return{...a,character:i,offset:o.posToIndex(a.line,i)}}};const o=gn(n.source),s=(n.options.decorations||[]).map(a=>({...a,start:r(a.start),end:r(a.end)}));ns(s),e.set(n.meta,{decorations:s,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var r;if((r=this.options.decorations)!=null&&r.length)return fn(n,t(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]))},code(n){var r;if(!((r=this.options.decorations)!=null&&r.length))return;const o=t(this),s=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==o.converter.lines.length)throw new C(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${o.converter.lines.length}). Failed to apply decorations.`);function a(u,d,g,f){const _=s[u];let S="",b=-1,y=-1;if(d===0&&(b=0),g===0&&(y=0),g===Number.POSITIVE_INFINITY&&(y=_.children.length),b===-1||y===-1)for(let w=0;w<_.children.length;w++)S+=kn(_.children[w]),b===-1&&S.length===d&&(b=w+1),y===-1&&S.length===g&&(y=w+1);if(b===-1)throw new C(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(y===-1)throw new C(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const k=_.children.slice(b,y);if(!f.alwaysWrap&&k.length===_.children.length)i(_,f,"line");else if(!f.alwaysWrap&&k.length===1&&k[0].type==="element")i(k[0],f,"token");else{const w={type:"element",tagName:"span",properties:{},children:k};i(w,f,"wrapper"),_.children.splice(b,k.length,w)}}function l(u,d){s[u]=i(s[u],d,"line")}function i(u,d,g){var f;const _=d.properties||{},S=d.transform||(b=>b);return u.tagName=d.tagName||"span",u.properties={...u.properties,..._,class:u.properties.class},(f=d.properties)!=null&&f.class&&st(u,d.properties.class),u=S(u,g)||u,u}const c=[],h=o.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(const u of h){const{start:d,end:g}=u;if(d.line===g.line)a(d.line,d.character,g.character,u);else if(d.line<g.line){a(d.line,d.character,Number.POSITIVE_INFINITY,u);for(let f=d.line+1;f<g.line;f++)c.unshift(()=>l(f,u));a(g.line,0,g.character,u)}}c.forEach(u=>u())}}}function ns(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new C(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const o=e[r],s=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,a=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,l=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,i=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(s||a||l||i){if(s&&a||l&&i||l&&n.start.offset===n.end.offset||a&&o.start.offset===o.end.offset)continue;throw new C(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function kn(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(kn).join(""):""}const rs=[bn()];function Le(e){const t=os(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...rs]}function os(e){const t=[],n=[],r=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:r.push(o)}return{pre:t,post:n,normal:r}}var q=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],at={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function ss(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function _n(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function as(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)at[r]&&t.push({type:"setDecoration",value:at[r]});else if(r<=29){const o=at[r-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:q[r-30]}});else if(r===38){const o=_n(e);o&&t.push({type:"setForegroundColor",value:o})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:q[r-40]}});else if(r===48){const o=_n(e);o&&t.push({type:"setBackgroundColor",value:o})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:q[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:q[r-100+8]}})}return t}function is(){let e=null,t=null,n=new Set;return{parse(r){const o=[];let s=0;do{const a=ss(r,s),l=a.sequence?r.substring(s,a.startPosition):r.substring(s);if(l.length>0&&o.push({value:l,foreground:e,background:t,decorations:new Set(n)}),a.sequence){const i=as(a.sequence);for(const c of i)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of i)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=a.position}while(s<r.length);return o}}}var ls={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function cs(e=ls){function t(l){return e[l]}function n(l){return`#${l.map(i=>Math.max(0,Math.min(i,255)).toString(16).padStart(2,"0")).join("")}`}let r;function o(){if(r)return r;r=[];for(let c=0;c<q.length;c++)r.push(t(q[c]));let l=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let h=0;h<6;h++)for(let u=0;u<6;u++)r.push(n([l[c],l[h],l[u]]));let i=8;for(let c=0;c<24;c++,i+=10)r.push(n([i,i,i]));return r}function s(l){return o()[l]}function a(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return s(l.index)}}return{value:a}}const us=/#([0-9a-f]{3,8})/i,hs=/var\((--[\w-]+-ansi-[\w-]+)\)/,ds={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Sn(e,t,n){const r=ie(e,n),o=ue(t),s=cs(Object.fromEntries(q.map(l=>{var i;const c=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`;return[l,((i=e.colors)==null?void 0:i[c])||ds[l]]}))),a=is();return o.map(l=>a.parse(l[0]).map(i=>{let c,h;i.decorations.has("reverse")?(c=i.background?s.value(i.background):e.bg,h=i.foreground?s.value(i.foreground):e.fg):(c=i.foreground?s.value(i.foreground):e.fg,h=i.background?s.value(i.background):void 0),c=j(c,r),h=j(h,r),i.decorations.has("dim")&&(c=ps(c));let u=L.None;return i.decorations.has("bold")&&(u|=L.Bold),i.decorations.has("italic")&&(u|=L.Italic),i.decorations.has("underline")&&(u|=L.Underline),i.decorations.has("strikethrough")&&(u|=L.Strikethrough),{content:i.value,offset:l[1],color:c,bgColor:h,fontStyle:u}}))}function ps(e){const t=e.match(us);if(t){const r=t[1];if(r.length===8){const o=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${o}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const o=r[0],s=r[1],a=r[2],l=r[3];return`#${o}${o}${s}${s}${a}${a}${Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const o=r[0],s=r[1],a=r[2];return`#${o}${o}${s}${s}${a}${a}80`}}}const n=e.match(hs);return n?`var(${n[1]}-dim)`:e}function me(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:o=e.getLoadedThemes()[0]}=n;if(!le(r)&&!ce(o)&&r==="ansi"){const{theme:s}=e.setTheme(o);return Sn(s,t,n)}return Wt(e,t,n)}function J(e,t,n){let r,o,s,a,l,i;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:h="--shiki-",colorsRendering:u="css-vars"}=n,d=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,y)=>b.color===c?-1:y.color===c?1:0);if(d.length===0)throw new C("`themes` option must not be empty");const g=Pe(e,t,n,me);if(i=de(g),c&&c!=="light-dark()"&&!d.some(b=>b.color===c))throw new C(`\`themes\` option must contain the defaultColor key \`${c}\``);const f=d.map(b=>e.getTheme(b.theme)),_=d.map(b=>b.color);s=g.map(b=>b.map(y=>yn(y,_,h,c,u))),i&&Ne(s,i);const S=d.map(b=>ie(b.theme,n));o=vn(d,f,S,h,c,"fg",u),r=vn(d,f,S,h,c,"bg",u),a=`shiki-themes ${f.map(b=>b.name).join(" ")}`,l=c?void 0:[o,r].join(";")}else if("theme"in n){const c=ie(n.theme,n);s=me(e,t,n);const h=e.getTheme(n.theme);r=j(h.bg,c),o=j(h.fg,c),a=h.name,i=de(s)}else throw new C("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:o,bg:r,themeName:a,rootStyle:l,grammarState:i}}function vn(e,t,n,r,o,s,a){return e.map((l,i)=>{const c=j(t[i][s],n[i])||"inherit",h=`${r+l.color}${s==="bg"?"-bg":""}:${c}`;if(i===0&&o){if(o==="light-dark()"&&e.length>1){const u=e.findIndex(g=>g.color==="light"),d=e.findIndex(g=>g.color==="dark");if(u===-1||d===-1)throw new C('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${j(t[u][s],n[u])||"inherit"}, ${j(t[d][s],n[d])||"inherit"});${h}`}return c}return a==="css-vars"?h:null}).filter(l=>!!l).join(";")}const wn=/^\s+$/,gs=/^(\s*)(.*?)(\s*)$/;function Q(e,t,n,r={meta:{},options:n,codeToHast:(o,s)=>Q(e,o,s),codeToTokens:(o,s)=>J(e,o,s)}){var o,s;let a=t;for(const S of Le(n))a=((o=S.preprocess)==null?void 0:o.call(r,a,n))||a;let{tokens:l,fg:i,bg:c,themeName:h,rootStyle:u,grammarState:d}=J(e,a,n);const{mergeWhitespaces:g=!0,mergeSameStyleTokens:f=!1}=n;g===!0?l=ms(l):g==="never"&&(l=fs(l)),f&&(l=ys(l));const _={...r,get source(){return a}};for(const S of Le(n))l=((s=S.tokens)==null?void 0:s.call(_,l))||l;return Cn(l,{...n,fg:i,bg:c,themeName:h,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},_,d)}function Cn(e,t,n,r=de(e)){var o,s,a,l;const i=Le(t),c=[],h={type:"root",children:[]},{structure:u="classic",tabindex:d="0"}=t,g={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?g.style=t.rootStyle:g.style=`background-color:${t.bg};color:${t.fg}`),d!==!1&&d!=null&&(g.tabindex=d.toString());for(const[k,w]of Object.entries(t.meta||{}))k.startsWith("_")||(g[k]=w);let f={type:"element",tagName:"pre",properties:g,children:[],data:t.data},_={type:"element",tagName:"code",properties:{},children:c};const S=[],b={...n,structure:u,addClassToHast:st,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return h},get pre(){return f},get code(){return _},get lines(){return S}};if(e.forEach((k,w)=>{var T,P;w&&(u==="inline"?h.children.push({type:"element",tagName:"br",properties:{},children:[]}):u==="classic"&&c.push({type:"text",value:`
12
- `}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},Z=0;for(const B of k){let F={type:"element",tagName:"span",properties:{...B.htmlAttrs},children:[{type:"text",value:B.content}]};const z=Re(B.htmlStyle||ge(B));z&&(F.properties.style=z);for(const ee of i)F=((T=ee?.span)==null?void 0:T.call(b,F,w+1,Z,x,B))||F;u==="inline"?h.children.push(F):u==="classic"&&x.children.push(F),Z+=B.content.length}if(u==="classic"){for(const B of i)x=((P=B?.line)==null?void 0:P.call(b,x,w+1))||x;S.push(x),c.push(x)}else u==="inline"&&S.push(x)}),u==="classic"){for(const k of i)_=((o=k?.code)==null?void 0:o.call(b,_))||_;f.children.push(_);for(const k of i)f=((s=k?.pre)==null?void 0:s.call(b,f))||f;h.children.push(f)}else if(u==="inline"){const k=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const P of h.children)P.type==="element"&&P.tagName==="br"?(k.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(P.type==="element"||P.type==="text")&&w.children.push(P);k.push(w);let T={type:"element",tagName:"code",properties:{},children:k};for(const P of i)T=((a=P?.code)==null?void 0:a.call(b,T))||T;h.children=[];for(let P=0;P<T.children.length;P++){P>0&&h.children.push({type:"element",tagName:"br",properties:{},children:[]});const x=T.children[P];x.type==="element"&&h.children.push(...x.children)}}let y=h;for(const k of i)y=((l=k?.root)==null?void 0:l.call(b,y))||y;return r&&Ne(y,r),y}function ms(e){return e.map(t=>{const n=[];let r="",o;return t.forEach((s,a)=>{const l=!(s.fontStyle&&(s.fontStyle&L.Underline||s.fontStyle&L.Strikethrough));l&&wn.test(s.content)&&t[a+1]?(o===void 0&&(o=s.offset),r+=s.content):r?(l?n.push({...s,offset:o,content:r+s.content}):n.push({content:r,offset:o},s),o=void 0,r=""):n.push(s)}),n})}function fs(e){return e.map(t=>t.flatMap(n=>{if(wn.test(n.content))return n;const r=n.content.match(gs);if(!r)return n;const[,o,s,a]=r;if(!o&&!a)return n;const l=[{...n,offset:n.offset+o.length,content:s}];return o&&l.unshift({content:o,offset:n.offset}),a&&l.push({content:a,offset:n.offset+o.length+s.length}),l}))}function ys(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const o=n.at(-1),s=Re(o.htmlStyle||ge(o)),a=Re(r.htmlStyle||ge(r)),l=o.fontStyle&&(o.fontStyle&L.Underline||o.fontStyle&L.Strikethrough),i=r.fontStyle&&(r.fontStyle&L.Underline||r.fontStyle&L.Strikethrough);!l&&!i&&s===a?o.content+=r.content:n.push({...r})}return n})}const Nn=Yo;function it(e,t,n){var r;const o={meta:{},options:n,codeToHast:(a,l)=>Q(e,a,l),codeToTokens:(a,l)=>J(e,a,l)};let s=Nn(Q(e,t,n,o));for(const a of Le(n))s=((r=a.postprocess)==null?void 0:r.call(o,s,n))||s;return s}async function lt(e){const t=await He(e);return{getLastGrammarState:(...n)=>Ye(t,...n),codeToTokensBase:(n,r)=>me(t,n,r),codeToTokensWithThemes:(n,r)=>Pe(t,n,r),codeToTokens:(n,r)=>J(t,n,r),codeToHast:(n,r)=>Q(t,n,r),codeToHtml:(n,r)=>it(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function bs(e){const t=Ce(e);return{getLastGrammarState:(...n)=>Ye(t,...n),codeToTokensBase:(n,r)=>me(t,n,r),codeToTokensWithThemes:(n,r)=>Pe(t,n,r),codeToTokens:(n,r)=>J(t,n,r),codeToHast:(n,r)=>Q(t,n,r),codeToHtml:(n,r)=>it(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Tn(e){let t;async function n(r){if(t){const o=await t;return await Promise.all([o.loadTheme(...r.themes||[]),o.loadLanguage(...r.langs||[])]),o}else return t=e({...r,themes:r.themes||[],langs:r.langs||[]}),t}return n}const ks=Tn(lt);function _s(e){const t=e.langs,n=e.themes,r=e.engine;async function o(s){function a(u){var d;if(typeof u=="string"){if(u=((d=s.langAlias)==null?void 0:d[u])||u,qe(u))return[];const g=t[u];if(!g)throw new C(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return g}return u}function l(u){if(ze(u))return"none";if(typeof u=="string"){const d=n[u];if(!d)throw new C(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return d}return u}const i=(s.themes??[]).map(u=>l(u)),c=(s.langs??[]).map(u=>a(u)),h=await lt({engine:s.engine??r(),...s,themes:i,langs:c});return{...h,loadLanguage(...u){return h.loadLanguage(...u.map(a))},loadTheme(...u){return h.loadTheme(...u.map(l))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return o}function Pn(e){let t;async function n(r={}){if(t){const o=await t;return await Promise.all([o.loadTheme(...r.themes||[]),o.loadLanguage(...r.langs||[])]),o}else{t=e({...r,themes:[],langs:[]});const o=await t;return await Promise.all([o.loadTheme(...r.themes||[]),o.loadLanguage(...r.langs||[])]),o}}return n}function Ss(e,t){const n=Pn(e);async function r(o,s){var a;const l=await n({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)}),i=await((a=t?.guessEmbeddedLanguages)==null?void 0:a.call(t,o,s.lang,l));return i&&await l.loadLanguage(...i),l}return{getSingletonHighlighter(o){return n(o)},async codeToHtml(o,s){return(await r(o,s)).codeToHtml(o,s)},async codeToHast(o,s){return(await r(o,s)).codeToHast(o,s)},async codeToTokens(o,s){return(await r(o,s)).codeToTokens(o,s)},async codeToTokensBase(o,s){return(await r(o,s)).codeToTokensBase(o,s)},async codeToTokensWithThemes(o,s){return(await r(o,s)).codeToTokensWithThemes(o,s)},async getLastGrammarState(o,s){return(await n({langs:[s.lang],themes:[s.theme]})).getLastGrammarState(o,s)}}}function vs(e={}){var t;const{name:n="css-variables",variablePrefix:r="--shiki-",fontStyle:o=!0}=e,s=l=>{var i;return(i=e.variableDefaults)!=null&&i[l]?`var(${r}${l}, ${e.variableDefaults[l]})`:`var(${r}${l})`},a={name:n,type:"dark",colors:{"editor.foreground":s("foreground"),"editor.background":s("background"),"terminal.ansiBlack":s("ansi-black"),"terminal.ansiRed":s("ansi-red"),"terminal.ansiGreen":s("ansi-green"),"terminal.ansiYellow":s("ansi-yellow"),"terminal.ansiBlue":s("ansi-blue"),"terminal.ansiMagenta":s("ansi-magenta"),"terminal.ansiCyan":s("ansi-cyan"),"terminal.ansiWhite":s("ansi-white"),"terminal.ansiBrightBlack":s("ansi-bright-black"),"terminal.ansiBrightRed":s("ansi-bright-red"),"terminal.ansiBrightGreen":s("ansi-bright-green"),"terminal.ansiBrightYellow":s("ansi-bright-yellow"),"terminal.ansiBrightBlue":s("ansi-bright-blue"),"terminal.ansiBrightMagenta":s("ansi-bright-magenta"),"terminal.ansiBrightCyan":s("ansi-bright-cyan"),"terminal.ansiBrightWhite":s("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:s("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:s("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:s("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:s("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:s("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:s("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:s("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:s("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:s("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:s("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:s("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:s("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:s("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:s("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:s("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:s("token-changed")}}]};return o||(a.tokenColors=(t=a.tokenColors)==null?void 0:t.map(l=>{var i;return(i=l.settings)!=null&&i.fontStyle&&delete l.settings.fontStyle,l})),a}export{C as ShikiError,st as addClassToHast,j as applyColorReplacements,Q as codeToHast,it as codeToHtml,J as codeToTokens,me as codeToTokensBase,Pe as codeToTokensWithThemes,_s as createBundledHighlighter,vs as createCssVariablesTheme,lt as createHighlighterCore,bs as createHighlighterCoreSync,gn as createPositionConverter,wr as createShikiInternal,vr as createShikiInternalSync,Ce as createShikiPrimitive,He as createShikiPrimitiveAsync,Ss as createSingletonShorthands,yn as flatTokenVariants,Ye as getLastGrammarState,ks as getSingletonHighlighterCore,ge as getTokenStyleObject,es as guessEmbeddedLanguages,Nn as hastToHtml,ce as isNoneTheme,le as isPlainLang,qe as isSpecialLang,ze as isSpecialTheme,Pn as makeSingletonHighlighter,Tn as makeSingletonHighlighterCore,Ue as normalizeGetter,we as normalizeTheme,ie as resolveColorReplacements,ue as splitLines,mn as splitToken,fn as splitTokens,Re as stringifyTokenStyle,Ot as toArray,Sn as tokenizeAnsiWithTheme,Ut as tokenizeWithTheme,Cn as tokensToHast,bn as transformerDecorations};
1
+ export * from "./core-AYMC6_lb.js";
@@ -1,4 +1,4 @@
1
- import{k as N,h as U,j as ce,z as fe,a as ye,b as Le,t as Re,u as Ie,g as ue}from"./define-By-uL588.js";import{c as _e}from"./cn-DN5AWfiS.js";var Pe=Re("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,a,l]=n;return[parseInt(o,16)/255,parseInt(a,16)/255,parseInt(l,16)/255]}const ke={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Ce={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function Te(e){const n=Ce[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??Te(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
1
+ import{k as N,h as U,j as ce,z as fe,a as ye,b as Le,t as Re,u as Ie,g as ue}from"./define-CI0y3eE4.js";import{c as _e}from"./cn-DN5AWfiS.js";var Pe=Re("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,a,l]=n;return[parseInt(o,16)/255,parseInt(a,16)/255,parseInt(l,16)/255]}const ke={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Ce={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function Te(e){const n=Ce[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??Te(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
2
2
  `),De=`
3
3
  attribute vec3 aVertexPosition;
4
4
  void main() { gl_Position = vec4(aVertexPosition, 1.0); }
@@ -1,6 +1,6 @@
1
1
  import { ssr as Le, ssrAttribute as we, escape as ye } from "solid-js/web";
2
2
  import { createMemo as U, onCleanup as G, createEffect as ue, untrack as ve, createSignal as le } from "solid-js";
3
- import { c as Re } from "./solid-DruVOXnf.js";
3
+ import { c as Re } from "./solid-15v_3WVL.js";
4
4
  var _e = ['<canvas part="canvas"', "></canvas>"];
5
5
  const Ce = "#1FD5F9";
6
6
  function Ie(e) {
@@ -1,6 +1,6 @@
1
1
  import { effect as Le, className as ye, template as we, use as Re } from "solid-js/web";
2
2
  import { createMemo as U, onCleanup as z, createEffect as ue, untrack as ve, createSignal as le } from "solid-js";
3
- import { c as _e } from "./solid-BzCFdL25.js";
3
+ import { c as _e } from "./solid-5P-otgdi.js";
4
4
  var Ce = /* @__PURE__ */ we("<canvas part=canvas>");
5
5
  const Ie = "#1FD5F9";
6
6
  function Te(e) {
@@ -1,4 +1,4 @@
1
- import{t as ye,u as Le,c as Re,f as Ie}from"./register-impl-B1hLkrI8.js";import{c as N,o as j,h as ce,u as fe,d as _e,i as ue}from"./kai.es.js";var Pe=ye("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,i,l]=n;return[parseInt(o,16)/255,parseInt(i,16)/255,parseInt(l,16)/255]}const Ce={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Te={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function ke(e){const n=Te[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??ke(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
1
+ import{t as ye,u as Le,c as Re,f as Ie}from"./register-impl-DvEnhIxx.js";import{c as N,o as j,h as ce,u as fe,d as _e,i as ue}from"./kai.es.js";var Pe=ye("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,i,l]=n;return[parseInt(o,16)/255,parseInt(i,16)/255,parseInt(l,16)/255]}const Ce={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Te={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function ke(e){const n=Te[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??ke(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
2
2
  `),De=`
3
3
  attribute vec3 aVertexPosition;
4
4
  void main() { gl_Position = vec4(aVertexPosition, 1.0); }
@@ -1 +1 @@
1
- import{s as L,A as B,c as a,p as V,q as D,i as m,g as N,H as W,Q as M,t as f,G as _,e as q,F as z,S as x,m as E,v as P,a as G,d as Q,u as J}from"./define-By-uL588.js";import{c as F}from"./cn-DN5AWfiS.js";import{C as K,s as X,n as Y}from"./composer-sQ0HcvyG.js";import{P as Z}from"./prompt-suggestion-CD-qtNgC.js";import{B as C}from"./button-DkuOnGLy.js";import{T as ee}from"./tooltip-Bkkg_4t0.js";import{D as te,n as ae,U as ne,A as re,a as ie,d as se,e as oe,i as le,r as de}from"./attachments-Qr4kg-2b.js";import{a as ue}from"./action-icons-CcgNN2oT.js";import{p as ce,g as he}from"./paperclip-ByY3UVO6.js";import{m as ge,s as pe}from"./icon-CdcfRhYI.js";var me=f("<div data-prompt-input>"),fe=f("<div>");const H=_();function be(){const e=W(H);if(!e)throw new Error("PromptInput subcomponents must be used within PromptInput");return e}function ye(e){const[t,r]=L(e,["isLoading","value","onValueChange","maxHeight","onSubmit","children","disabled","class","onClick"]),[s,b]=N(t.value??"");let i;const l=c=>{var p;b(c),(p=t.onValueChange)==null||p.call(t,c)},u=c=>{t.disabled||i==null||i.focus(),typeof t.onClick=="function"&&t.onClick(c)};return a(H.Provider,{get value(){return{isLoading:t.isLoading??!1,value:()=>t.value??s(),setValue:t.onValueChange??l,maxHeight:t.maxHeight??240,onSubmit:t.onSubmit,get disabled(){return t.disabled},get textareaRef(){return i},setTextareaRef:c=>{i=c}}},get children(){var c=me();return c.$$click=u,V(c,D({get class(){return F("bg-surface cursor-text rounded-xl p-2 shadow-xs","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0",t.disabled&&"cursor-not-allowed opacity-60",t.class)}},r),!1,!0),m(c,()=>t.children),c}})}function ve(e){const[t]=L(e,["class","placeholder","aria-label","triggers","kindIcons","onComposerChange"]),r=be(),s=B(),b=()=>F("text-foreground min-h-[44px] w-full bg-transparent text-start shadow-none outline-none focus-visible:ring-0 focus-visible:ring-offset-0 overflow-y-auto whitespace-pre-wrap break-words",M(s.proseSize()),t.class);return a(K,{bare:!0,get value(){return r.value()},get placeholder(){return t.placeholder},get ariaLabel(){return t["aria-label"]},get disabled(){return r.disabled},get maxHeight(){return r.maxHeight},get editableClass(){return b()},editableRef:i=>r.setTextareaRef(i),get triggers(){return t.triggers},get kindIcons(){return t.kindIcons},onChange:i=>{var l;(l=t.onComposerChange)==null||l.call(t,i),r.setValue(i.text.replace(/^\s+/,""))},onSubmit:()=>{var i;r.disabled||(i=r.onSubmit)==null||i.call(r)}})}function we(e){const[t,r]=L(e,["children","class"]);return(()=>{var s=fe();return V(s,D({get class(){return F("flex items-center gap-2",t.class)}},r),!1,!0),m(s,()=>t.children),s})()}q(["click"]);const xe=/^data:([^;,]*);base64,([\s\S]*)$/,Ce=/^([a-z][a-z0-9+.-]*):/i,j=e=>e.map(t=>`"${t}"`).join(", ");function O(e){try{const t=atob(e),r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return{ok:!0,text:new TextDecoder("utf-8",{fatal:!0}).decode(r),bytes:t.length}}catch{return{ok:!1}}}function ke(e,t=te){var r,s,b;if(e.type==="source-document")return{status:"kit-side"};const i=e.url;if(i===void 0||i==="")return{status:"unencodable",reason:"it has no `url`, so there are no bytes and no address to send. Set `url` to a `data:` URI (read the File with FileReader.readAsDataURL before you stage it) or to an https URL the provider can fetch."};let l,u;const c=xe.exec(i);if(c){const d=c[1].toLowerCase();u=ae(d)?((r=e.mediaType)==null?void 0:r.toLowerCase())??d:d,l={type:"base64",mediaType:u,data:c[2],dataUri:i}}else if(/^https?:\/\//i.test(i)){const d=(s=e.mediaType)==null?void 0:s.toLowerCase();if(d===void 0||d==="")return{status:"unencodable",reason:`its \`url\` is remote ("${i}") but it has no \`mediaType\`, so there is no way to tell an image from a document without fetching it -- and this layer does no I/O. Set \`mediaType\` when you stage the attachment.`};u=d,l={type:"remote",url:i}}else{if(i.startsWith("data:"))return{status:"unencodable",reason:"its `url` is a `data:` URI that is not base64-encoded with an explicit media type. Both APIs need `data:<media type>;base64,<data>`."};{const d=(b=Ce.exec(i))==null?void 0:b[1].toLowerCase(),A=d==="blob"?"a `blob:` URL resolves only inside the browser tab that created it, so a model can never fetch it. Read the File with FileReader.readAsDataURL and stage the `data:` URI instead, or upload it and stage the resulting https URL":`a "${d??i}" URL is not something a provider can fetch. Use a \`data:\` URI or an https URL`;return{status:"unencodable",reason:`its \`url\` is "${i}": ${A}.`}}}const p=t.decide(u);if(p.status==="undetermined"){if(l.type!=="base64")return{status:"unencodable",reason:`it is at a remote URL ("${l.url}") and its media type "${u}" says nothing about the bytes -- that is the label for "arbitrary binary", so it separates an image from a document not at all. Settling it by reading the bytes would need a fetch, and this layer does no I/O. Set \`mediaType\` to what the file actually is when you stage it.`};const d=O(l.data);return d.ok?{status:"encodable",file:{kind:"text",mediaType:ne,source:l,filename:e.filename,text:d.text}}:{status:"unencodable",reason:`nothing names it -- ${u===""?"it carries no media type":`its media type is "${u}"`}, so the only way to tell what it is was to read it -- and its bytes are not valid UTF-8, so it is binary of some unidentified kind. Neither API has an arbitrary-file block to carry that. Set \`mediaType\` if you know what it is, or hand the file to the model through a tool.`}}if(p.status==="filtered")return{status:"unencodable",reason:`its media type "${u}" is one this kit can encode, but your \`accept\` filter excludes it. The types you allowed are: ${j(t.types)}. Widen \`accept\` to include it, or stop staging it.`};if(p.status==="unsupported")return{status:"unencodable",reason:`its media type "${u}" is not one either API accepts as message content. Supported: ${j(t.types)}. Extract the content yourself and send it as text, or hand it to the model through a tool.`};if(p.kind==="text"){if(l.type!=="base64")return{status:"unencodable",reason:`it is a text file at a remote URL ("${l.url}"), and text has to ride as text CONTENT -- neither API has an arbitrary-file block to point at a URL with. Reading it here would put I/O in the encoder. Fetch it yourself and stage the \`data:\` URI, or paste the contents as a text part.`};const d=O(l.data);return d.ok?{status:"encodable",file:{kind:"text",mediaType:u,source:l,filename:e.filename,text:d.text}}:{status:"unencodable",reason:`its media type "${u}" says text, but its bytes are not valid UTF-8 -- so it is binary wearing a text label, and inlining it would send the model garbage. Send it under its real media type, or extract the text yourself.`}}return{status:"encodable",file:{kind:p.kind,mediaType:u,source:l,filename:e.filename}}}var Se=f('<div class="mb-2 flex flex-wrap gap-2">'),Re=f('<div class="px-3 pt-3">'),Ue=f("<slot name=input-top>"),$e=f("<input type=file multiple class=hidden>"),Te=f('<div class="flex items-center gap-2"><slot name=toolbar-start style=display:contents>'),Ae=f('<div class="flex items-center gap-2"><slot name=toolbar-end>'),Ie=f('<span class="px-1 text-xs">'),Le=f('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=12 y1=19 x2=12 y2=5></line><polyline points="5 12 12 5 19 12">');const ze=e=>new Promise((t,r)=>{const s=new FileReader;s.onload=()=>t(String(s.result)),s.onerror=()=>r(s.error??new Error(`Could not read ${e.name}`)),s.readAsDataURL(e)});async function Pe(e){return{id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${e.name}-${e.size}-${e.lastModified}`,type:"file",filename:e.name,mediaType:e.type||void 0,url:await ze(e)}}function Fe(e){let t;const r=()=>e.attachments??[],s=()=>!!e.onAttachmentsChange,b=()=>de({accept:e.accept}),i=async n=>{var h,o;if(!(n!=null&&n.length)||!e.onAttachmentsChange)return;const v=b(),w=Array.from(n),k=w.map(g=>e.accept===void 0?void 0:v.decide(g.type)),y=g=>g===void 0||g.status==="allowed"||g.status==="undetermined",I=await Promise.all(w.map((g,$)=>y(k[$])?Pe(g):void 0)),R=[],U=[];w.forEach((g,$)=>{const T=k[$],S=I[$];if(T===void 0||T.status==="allowed"){S&&R.push(S);return}if(T.status==="undetermined"){S&&ke(S,v).status==="encodable"?R.push(S):U.push({filename:g.name,mediaType:g.type,reason:"unsupported"});return}U.push({filename:g.name,mediaType:g.type,reason:T.status})}),U.length>0&&((h=e.onAttachmentsRejected)==null||h.call(e,U)),R.length!==0&&((o=e.onAttachmentsChange)==null||o.call(e,[...r(),...R]))},l=n=>{var h;return(h=e.onAttachmentsChange)==null?void 0:h.call(e,r().filter(o=>o.id!==n))},u=()=>X(Y(e.value)),c=()=>e.disabled||e.loading||!u().trim()&&r().length===0,p=()=>!!e.loading&&!!e.stoppable,d=()=>!!u().trim()||r().length>0,A=()=>{const n=e.submit??"always";return n==="always"||n==="auto"&&d()};return[a(x,{get when(){var n;return(n=e.suggestions)==null?void 0:n.length},get children(){var n=Se();return m(n,a(z,{get each(){return e.suggestions},children:h=>a(Z,{onClick:()=>e.onSuggestionClick(h),children:h})})),n}}),a(ye,{get value(){return e.value},get onValueChange(){return e.onValueChange},get onSubmit(){return e.onSubmit},get isLoading(){return e.loading},get disabled(){return e.disabled},class:"relative",get children(){return[a(x,{get when(){return E(()=>!!s())()&&r().length},get children(){var n=Re();return m(n,a(re,{variant:"inline",get children(){return a(z,{get each(){return r()},children:h=>a(ie,{data:h,onRemove:()=>l(h.id),get children(){return[a(se,{}),a(oe,{}),a(le,{})]}})})}})),n}}),(()=>{var n=Ue();return n._$owner=P(),n})(),a(ve,{get placeholder(){return e.placeholder},get"aria-label"(){return e.placeholder||"Message"},class:"min-h-[44px] pt-3 pl-4",get triggers(){return e.triggers},get kindIcons(){return e.kindIcons},get onComposerChange(){return e.onComposerChange}}),a(we,{class:"mt-2 flex w-full items-center justify-between gap-2 px-3 pb-0",get children(){return[(()=>{var n=Te(),h=n.firstChild;return h._$owner=P(),m(n,a(x,{get when(){return E(()=>!!s())()&&e.attach!==!1},get children(){return[(()=>{var o=$e();o.addEventListener("change",w=>{i(w.currentTarget.files),w.currentTarget.value=""});var v=t;return typeof v=="function"?J(v,o):t=o,G(()=>Q(o,"accept",e.accept===void 0?void 0:b().accept)),o})(),a(C,{type:"button",variant:"outline",size:"icon-sm",class:"rounded-full","aria-label":"Attach files",get disabled(){return e.disabled},onClick:()=>t?.click(),get children(){return a(ce,{class:"size-4"})}})]}}),null),m(n,a(x,{get when(){return e.webSearch},get children(){return a(C,{type:"button",variant:"outline",size:"sm",class:"rounded-full gap-1","aria-label":"Search the web",get disabled(){return e.disabled},onClick:()=>{var o;return(o=e.onWebSearch)==null?void 0:o.call(e)},get children(){return[a(he,{class:"size-4"}),"Search"]}})}}),null),m(n,a(x,{get when(){return e.voice},get children(){return a(C,{type:"button",variant:"outline",size:"icon-sm",class:"rounded-full","aria-label":"Voice input",get disabled(){return e.disabled},onClick:()=>{var o;return(o=e.onVoice)==null?void 0:o.call(e)},get children(){return a(ge,{class:"size-4"})}})}}),null),m(n,a(z,{get each(){return e.toolbarActions??[]},children:o=>{const v=ue(o.icon),w=o.tooltip??o.label,k=a(C,{type:"button",variant:"outline",size:"icon-sm",class:"rounded-full",get"aria-label"(){return o.label},get"data-action"(){return o.id},get disabled(){return e.disabled},onClick:()=>{var y;return(y=e.onAction)==null?void 0:y.call(e,o.id)},get children(){return a(x,{when:v,get fallback(){return(()=>{var y=Ie();return m(y,()=>o.label),y})()},children:y=>{const I=y();return a(I,{class:"size-4"})}})}});return v?a(ee,{content:w,children:k}):k}}),null),n})(),(()=>{var n=Ae(),h=n.firstChild;return h._$owner=P(),m(n,a(x,{get when(){return p()},get fallback(){return a(x,{get when(){return A()},get children(){return a(C,{size:"icon-sm",class:"rounded-full",part:"send","data-testid":"send","aria-label":"Send message",get disabled(){return c()},get onClick(){return e.onSubmit},get children(){return Le()}})}})},get children(){return a(C,{size:"icon-sm",variant:"outline",class:"rounded-full","data-testid":"stop","aria-label":"Stop",get onClick(){return e.onStop},get children(){return a(pe,{class:"size-3"})}})}}),null),n})()]}})]}})]}export{Fe as D};
1
+ import{s as L,A as B,c as a,p as V,q as D,i as m,g as N,H as W,Q as M,t as f,G as _,e as q,F as z,S as x,m as E,v as P,a as G,d as Q,u as J}from"./define-CI0y3eE4.js";import{c as F}from"./cn-DN5AWfiS.js";import{C as K,s as X,n as Y}from"./composer-DMI85B6j.js";import{P as Z}from"./prompt-suggestion-I_DHP21i.js";import{B as C}from"./button-C_3te6fm.js";import{T as ee}from"./tooltip-GA-nmg06.js";import{D as te,n as ae,U as ne,A as re,a as ie,d as se,e as oe,i as le,r as de}from"./attachments-YvXHlg88.js";import{a as ue}from"./action-icons-DaW2pU6m.js";import{p as ce,g as he}from"./paperclip-CdzuOjbU.js";import{m as ge,s as pe}from"./icon-CL0jdhsf.js";var me=f("<div data-prompt-input>"),fe=f("<div>");const H=_();function be(){const e=W(H);if(!e)throw new Error("PromptInput subcomponents must be used within PromptInput");return e}function ye(e){const[t,r]=L(e,["isLoading","value","onValueChange","maxHeight","onSubmit","children","disabled","class","onClick"]),[s,b]=N(t.value??"");let i;const l=c=>{var p;b(c),(p=t.onValueChange)==null||p.call(t,c)},u=c=>{t.disabled||i==null||i.focus(),typeof t.onClick=="function"&&t.onClick(c)};return a(H.Provider,{get value(){return{isLoading:t.isLoading??!1,value:()=>t.value??s(),setValue:t.onValueChange??l,maxHeight:t.maxHeight??240,onSubmit:t.onSubmit,get disabled(){return t.disabled},get textareaRef(){return i},setTextareaRef:c=>{i=c}}},get children(){var c=me();return c.$$click=u,V(c,D({get class(){return F("bg-surface cursor-text rounded-xl p-2 shadow-xs","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0",t.disabled&&"cursor-not-allowed opacity-60",t.class)}},r),!1,!0),m(c,()=>t.children),c}})}function ve(e){const[t]=L(e,["class","placeholder","aria-label","triggers","kindIcons","onComposerChange"]),r=be(),s=B(),b=()=>F("text-foreground min-h-[44px] w-full bg-transparent text-start shadow-none outline-none focus-visible:ring-0 focus-visible:ring-offset-0 overflow-y-auto whitespace-pre-wrap break-words",M(s.proseSize()),t.class);return a(K,{bare:!0,get value(){return r.value()},get placeholder(){return t.placeholder},get ariaLabel(){return t["aria-label"]},get disabled(){return r.disabled},get maxHeight(){return r.maxHeight},get editableClass(){return b()},editableRef:i=>r.setTextareaRef(i),get triggers(){return t.triggers},get kindIcons(){return t.kindIcons},onChange:i=>{var l;(l=t.onComposerChange)==null||l.call(t,i),r.setValue(i.text.replace(/^\s+/,""))},onSubmit:()=>{var i;r.disabled||(i=r.onSubmit)==null||i.call(r)}})}function we(e){const[t,r]=L(e,["children","class"]);return(()=>{var s=fe();return V(s,D({get class(){return F("flex items-center gap-2",t.class)}},r),!1,!0),m(s,()=>t.children),s})()}q(["click"]);const xe=/^data:([^;,]*);base64,([\s\S]*)$/,Ce=/^([a-z][a-z0-9+.-]*):/i,j=e=>e.map(t=>`"${t}"`).join(", ");function O(e){try{const t=atob(e),r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return{ok:!0,text:new TextDecoder("utf-8",{fatal:!0}).decode(r),bytes:t.length}}catch{return{ok:!1}}}function ke(e,t=te){var r,s,b;if(e.type==="source-document")return{status:"kit-side"};const i=e.url;if(i===void 0||i==="")return{status:"unencodable",reason:"it has no `url`, so there are no bytes and no address to send. Set `url` to a `data:` URI (read the File with FileReader.readAsDataURL before you stage it) or to an https URL the provider can fetch."};let l,u;const c=xe.exec(i);if(c){const d=c[1].toLowerCase();u=ae(d)?((r=e.mediaType)==null?void 0:r.toLowerCase())??d:d,l={type:"base64",mediaType:u,data:c[2],dataUri:i}}else if(/^https?:\/\//i.test(i)){const d=(s=e.mediaType)==null?void 0:s.toLowerCase();if(d===void 0||d==="")return{status:"unencodable",reason:`its \`url\` is remote ("${i}") but it has no \`mediaType\`, so there is no way to tell an image from a document without fetching it -- and this layer does no I/O. Set \`mediaType\` when you stage the attachment.`};u=d,l={type:"remote",url:i}}else{if(i.startsWith("data:"))return{status:"unencodable",reason:"its `url` is a `data:` URI that is not base64-encoded with an explicit media type. Both APIs need `data:<media type>;base64,<data>`."};{const d=(b=Ce.exec(i))==null?void 0:b[1].toLowerCase(),A=d==="blob"?"a `blob:` URL resolves only inside the browser tab that created it, so a model can never fetch it. Read the File with FileReader.readAsDataURL and stage the `data:` URI instead, or upload it and stage the resulting https URL":`a "${d??i}" URL is not something a provider can fetch. Use a \`data:\` URI or an https URL`;return{status:"unencodable",reason:`its \`url\` is "${i}": ${A}.`}}}const p=t.decide(u);if(p.status==="undetermined"){if(l.type!=="base64")return{status:"unencodable",reason:`it is at a remote URL ("${l.url}") and its media type "${u}" says nothing about the bytes -- that is the label for "arbitrary binary", so it separates an image from a document not at all. Settling it by reading the bytes would need a fetch, and this layer does no I/O. Set \`mediaType\` to what the file actually is when you stage it.`};const d=O(l.data);return d.ok?{status:"encodable",file:{kind:"text",mediaType:ne,source:l,filename:e.filename,text:d.text}}:{status:"unencodable",reason:`nothing names it -- ${u===""?"it carries no media type":`its media type is "${u}"`}, so the only way to tell what it is was to read it -- and its bytes are not valid UTF-8, so it is binary of some unidentified kind. Neither API has an arbitrary-file block to carry that. Set \`mediaType\` if you know what it is, or hand the file to the model through a tool.`}}if(p.status==="filtered")return{status:"unencodable",reason:`its media type "${u}" is one this kit can encode, but your \`accept\` filter excludes it. The types you allowed are: ${j(t.types)}. Widen \`accept\` to include it, or stop staging it.`};if(p.status==="unsupported")return{status:"unencodable",reason:`its media type "${u}" is not one either API accepts as message content. Supported: ${j(t.types)}. Extract the content yourself and send it as text, or hand it to the model through a tool.`};if(p.kind==="text"){if(l.type!=="base64")return{status:"unencodable",reason:`it is a text file at a remote URL ("${l.url}"), and text has to ride as text CONTENT -- neither API has an arbitrary-file block to point at a URL with. Reading it here would put I/O in the encoder. Fetch it yourself and stage the \`data:\` URI, or paste the contents as a text part.`};const d=O(l.data);return d.ok?{status:"encodable",file:{kind:"text",mediaType:u,source:l,filename:e.filename,text:d.text}}:{status:"unencodable",reason:`its media type "${u}" says text, but its bytes are not valid UTF-8 -- so it is binary wearing a text label, and inlining it would send the model garbage. Send it under its real media type, or extract the text yourself.`}}return{status:"encodable",file:{kind:p.kind,mediaType:u,source:l,filename:e.filename}}}var Se=f('<div class="mb-2 flex flex-wrap gap-2">'),Re=f('<div class="px-3 pt-3">'),Ue=f("<slot name=input-top>"),$e=f("<input type=file multiple class=hidden>"),Te=f('<div class="flex items-center gap-2"><slot name=toolbar-start style=display:contents>'),Ae=f('<div class="flex items-center gap-2"><slot name=toolbar-end>'),Ie=f('<span class="px-1 text-xs">'),Le=f('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=12 y1=19 x2=12 y2=5></line><polyline points="5 12 12 5 19 12">');const ze=e=>new Promise((t,r)=>{const s=new FileReader;s.onload=()=>t(String(s.result)),s.onerror=()=>r(s.error??new Error(`Could not read ${e.name}`)),s.readAsDataURL(e)});async function Pe(e){return{id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${e.name}-${e.size}-${e.lastModified}`,type:"file",filename:e.name,mediaType:e.type||void 0,url:await ze(e)}}function Fe(e){let t;const r=()=>e.attachments??[],s=()=>!!e.onAttachmentsChange,b=()=>de({accept:e.accept}),i=async n=>{var h,o;if(!(n!=null&&n.length)||!e.onAttachmentsChange)return;const v=b(),w=Array.from(n),k=w.map(g=>e.accept===void 0?void 0:v.decide(g.type)),y=g=>g===void 0||g.status==="allowed"||g.status==="undetermined",I=await Promise.all(w.map((g,$)=>y(k[$])?Pe(g):void 0)),R=[],U=[];w.forEach((g,$)=>{const T=k[$],S=I[$];if(T===void 0||T.status==="allowed"){S&&R.push(S);return}if(T.status==="undetermined"){S&&ke(S,v).status==="encodable"?R.push(S):U.push({filename:g.name,mediaType:g.type,reason:"unsupported"});return}U.push({filename:g.name,mediaType:g.type,reason:T.status})}),U.length>0&&((h=e.onAttachmentsRejected)==null||h.call(e,U)),R.length!==0&&((o=e.onAttachmentsChange)==null||o.call(e,[...r(),...R]))},l=n=>{var h;return(h=e.onAttachmentsChange)==null?void 0:h.call(e,r().filter(o=>o.id!==n))},u=()=>X(Y(e.value)),c=()=>e.disabled||e.loading||!u().trim()&&r().length===0,p=()=>!!e.loading&&!!e.stoppable,d=()=>!!u().trim()||r().length>0,A=()=>{const n=e.submit??"always";return n==="always"||n==="auto"&&d()};return[a(x,{get when(){var n;return(n=e.suggestions)==null?void 0:n.length},get children(){var n=Se();return m(n,a(z,{get each(){return e.suggestions},children:h=>a(Z,{onClick:()=>e.onSuggestionClick(h),children:h})})),n}}),a(ye,{get value(){return e.value},get onValueChange(){return e.onValueChange},get onSubmit(){return e.onSubmit},get isLoading(){return e.loading},get disabled(){return e.disabled},class:"relative",get children(){return[a(x,{get when(){return E(()=>!!s())()&&r().length},get children(){var n=Re();return m(n,a(re,{variant:"inline",get children(){return a(z,{get each(){return r()},children:h=>a(ie,{data:h,onRemove:()=>l(h.id),get children(){return[a(se,{}),a(oe,{}),a(le,{})]}})})}})),n}}),(()=>{var n=Ue();return n._$owner=P(),n})(),a(ve,{get placeholder(){return e.placeholder},get"aria-label"(){return e.placeholder||"Message"},class:"min-h-[44px] pt-3 pl-4",get triggers(){return e.triggers},get kindIcons(){return e.kindIcons},get onComposerChange(){return e.onComposerChange}}),a(we,{class:"mt-2 flex w-full items-center justify-between gap-2 px-3 pb-0",get children(){return[(()=>{var n=Te(),h=n.firstChild;return h._$owner=P(),m(n,a(x,{get when(){return E(()=>!!s())()&&e.attach!==!1},get children(){return[(()=>{var o=$e();o.addEventListener("change",w=>{i(w.currentTarget.files),w.currentTarget.value=""});var v=t;return typeof v=="function"?J(v,o):t=o,G(()=>Q(o,"accept",e.accept===void 0?void 0:b().accept)),o})(),a(C,{type:"button",variant:"outline",size:"icon-sm",class:"rounded-full","aria-label":"Attach files",get disabled(){return e.disabled},onClick:()=>t?.click(),get children(){return a(ce,{class:"size-4"})}})]}}),null),m(n,a(x,{get when(){return e.webSearch},get children(){return a(C,{type:"button",variant:"outline",size:"sm",class:"rounded-full gap-1","aria-label":"Search the web",get disabled(){return e.disabled},onClick:()=>{var o;return(o=e.onWebSearch)==null?void 0:o.call(e)},get children(){return[a(he,{class:"size-4"}),"Search"]}})}}),null),m(n,a(x,{get when(){return e.voice},get children(){return a(C,{type:"button",variant:"outline",size:"icon-sm",class:"rounded-full","aria-label":"Voice input",get disabled(){return e.disabled},onClick:()=>{var o;return(o=e.onVoice)==null?void 0:o.call(e)},get children(){return a(ge,{class:"size-4"})}})}}),null),m(n,a(z,{get each(){return e.toolbarActions??[]},children:o=>{const v=ue(o.icon),w=o.tooltip??o.label,k=a(C,{type:"button",variant:"outline",size:"icon-sm",class:"rounded-full",get"aria-label"(){return o.label},get"data-action"(){return o.id},get disabled(){return e.disabled},onClick:()=>{var y;return(y=e.onAction)==null?void 0:y.call(e,o.id)},get children(){return a(x,{when:v,get fallback(){return(()=>{var y=Ie();return m(y,()=>o.label),y})()},children:y=>{const I=y();return a(I,{class:"size-4"})}})}});return v?a(ee,{content:w,children:k}):k}}),null),n})(),(()=>{var n=Ae(),h=n.firstChild;return h._$owner=P(),m(n,a(x,{get when(){return p()},get fallback(){return a(x,{get when(){return A()},get children(){return a(C,{size:"icon-sm",class:"rounded-full",part:"send","data-testid":"send","aria-label":"Send message",get disabled(){return c()},get onClick(){return e.onSubmit},get children(){return Le()}})}})},get children(){return a(C,{size:"icon-sm",variant:"outline",class:"rounded-full","data-testid":"stop","aria-label":"Stop",get onClick(){return e.onStop},get children(){return a(pe,{class:"size-3"})}})}}),null),n})()]}})]}})]}export{Fe as D};