@nextclaw/ui 0.15.3 → 0.15.5

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 (314) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/assets/abnfDiagram-VRR7QNED-BYpK0F5F.js +1 -0
  3. package/dist/assets/aiden0z-pptx-renderer.es-D87ywFdC.js +94 -0
  4. package/dist/assets/api-IlX_CbwU.js +13 -0
  5. package/dist/assets/app-presenter-provider-Bbl_MVbg.js +106 -0
  6. package/dist/assets/app-presenter-provider-D3BuuOyZ.css +1 -0
  7. package/dist/assets/appearance-settings-page-80fLa4-9.js +1 -0
  8. package/dist/assets/arc-DFELHWM2.js +1 -0
  9. package/dist/assets/architecture-TIHT7OUA-ClwVFq-K.js +1 -0
  10. package/dist/assets/architectureDiagram-ZJ3FMSHR-CvRhdovL.js +36 -0
  11. package/dist/assets/array-BqYdCIE6.js +1 -0
  12. package/dist/assets/blockDiagram-677ZJIJ3-DVYNkbR_.js +132 -0
  13. package/dist/assets/{book-open-C3mJGwiy.js → book-open-CN7Shpij.js} +1 -1
  14. package/dist/assets/c4Diagram-LMCZKHZV-B1w-iwRe.js +10 -0
  15. package/dist/assets/channel-BEHOSFc5.js +1 -0
  16. package/dist/assets/channels-list-page-R7M6pzp6.js +8 -0
  17. package/dist/assets/chat-page-152YuwfU.js +1 -0
  18. package/dist/assets/chunk-2Q5K7J3B-DrIhesSX.js +1 -0
  19. package/dist/assets/chunk-32BRIVSS-kG3lg0bC.js +1 -0
  20. package/dist/assets/chunk-52WLFC77-BLeB7iGk.js +10 -0
  21. package/dist/assets/chunk-5FCAYU7R-BQga1Rr7.js +1 -0
  22. package/dist/assets/chunk-5HE753X5-DU81hkcF.js +1 -0
  23. package/dist/assets/chunk-5JV3BV7I-C2bAx0m7.js +1 -0
  24. package/dist/assets/chunk-5TONJI2A-BExIIgWY.js +2 -0
  25. package/dist/assets/chunk-5VM5RSS4-C3XB05yh.js +15 -0
  26. package/dist/assets/chunk-7BUUIJ7U-JiyRtrGu.js +1 -0
  27. package/dist/assets/chunk-BIQX33UG-BZRV20pI.js +1 -0
  28. package/dist/assets/chunk-C7G6YPKG-AsyDSQ9j.js +1 -0
  29. package/dist/assets/chunk-CQNSW5MT-iN-fiXVA.js +1 -0
  30. package/dist/assets/chunk-CYSBUYHQ-DhC_TRzI.js +1 -0
  31. package/dist/assets/chunk-DseTPa7n.js +1 -0
  32. package/dist/assets/chunk-EMLP6XTP-QFLK8R6d.js +1 -0
  33. package/dist/assets/chunk-EX3LRPZG-DzUwhkCz.js +231 -0
  34. package/dist/assets/chunk-FWX5IMBZ-DFelpZBy.js +2 -0
  35. package/dist/assets/chunk-HOUHSVGY-BMPwFEwN.js +1 -0
  36. package/dist/assets/chunk-ICXQ74PX-DH8NJMok.js +2 -0
  37. package/dist/assets/chunk-JG7HCLWE-D-95AsO4.js +2 -0
  38. package/dist/assets/chunk-JWPE2WC7-DIaTv8kx.js +1 -0
  39. package/dist/assets/chunk-KEIR6QF5-A3jEqwzn.js +161 -0
  40. package/dist/assets/chunk-MOJQB5TN-BPFLzWgj.js +88 -0
  41. package/dist/assets/chunk-MOZMSUNE-DR_fzxG0.js +1 -0
  42. package/dist/assets/chunk-OGEWGWER-TIcEoPPH.js +1 -0
  43. package/dist/assets/chunk-OSBZ3O6U-BALNvSfG.js +1 -0
  44. package/dist/assets/chunk-PUDLZKDR-I-EXhf_k.js +156 -0
  45. package/dist/assets/chunk-Q4XR5HBZ-uvIGstBS.js +70 -0
  46. package/dist/assets/chunk-QBLGF6JB-r-TjLdxa.js +1 -0
  47. package/dist/assets/chunk-R7FJI6CG-N-1LDgvy.js +1 -0
  48. package/dist/assets/chunk-RYQCIY6F-jxNASx65.js +1 -0
  49. package/dist/assets/chunk-U6XO7XAA-Cphbuc7q.js +2 -0
  50. package/dist/assets/chunk-V7JOEXUC-BLEuBf1s.js +206 -0
  51. package/dist/assets/chunk-VAUOI2AC-Dpcz6BhT.js +1 -0
  52. package/dist/assets/chunk-VR4S4FIN-BAUbR0ke.js +1 -0
  53. package/dist/assets/chunk-WYO6CB5R-Do6SJrnY.js +127 -0
  54. package/dist/assets/chunk-XXDRQBXY-C2QjjwYX.js +1 -0
  55. package/dist/assets/chunk-Y2CYZVJY-BGrd8tLy.js +1 -0
  56. package/dist/assets/chunk-YOTPTUD7-CQqvMTCr.js +1 -0
  57. package/dist/assets/chunk-ZGVPDNZ5-B7kWWaXv.js +62 -0
  58. package/dist/assets/chunk-ZIRB5QZD-DTU0cDNh.js +32 -0
  59. package/dist/assets/classDiagram-OUVF2IWQ-DESMaY3_.js +1 -0
  60. package/dist/assets/classDiagram-v2-EOCWNBFH-DwOlByYH.js +1 -0
  61. package/dist/assets/config-split-page-BlfvfmTm.js +1 -0
  62. package/dist/assets/confirm-dialog-Dt8Kdbgp.js +5 -0
  63. package/dist/assets/cose-bilkent-JH36ORCC-B9LrtV-q.js +1 -0
  64. package/dist/assets/cynefin-VYW2F7L2-CzjeeOq9.js +1 -0
  65. package/dist/assets/cynefinDiagram-TSTJHNR4-BfjvW4su.js +62 -0
  66. package/dist/assets/cytoscape.esm-CRW8q92n.js +321 -0
  67. package/dist/assets/dagre-DkiXZKkL.js +1 -0
  68. package/dist/assets/dagre-VKFMJZFB-B1pQKQSY.js +4 -0
  69. package/dist/assets/defaultLocale-Cdv9x6q7.js +1 -0
  70. package/dist/assets/desktop-update-config-DreMJu9z.js +1 -0
  71. package/dist/assets/diagram-FQU43EPY-cB4EZdaP.js +3 -0
  72. package/dist/assets/diagram-G47NLZAW-CtW8im1B.js +24 -0
  73. package/dist/assets/diagram-NH7WQ7WH-BDCtrCCm.js +24 -0
  74. package/dist/assets/diagram-OA4YK3LP-DEMJ42Gt.js +30 -0
  75. package/dist/assets/diagram-WEI45ONY-CdCcxSYU.js +41 -0
  76. package/dist/assets/dist-D5ycbwCo.js +41 -0
  77. package/dist/assets/dist-dw-gAfM_.js +1 -0
  78. package/dist/assets/doc-browser-C9u7N9vH.js +1 -0
  79. package/dist/assets/doc-browser-DJQ5XPsi2.js +1 -0
  80. package/dist/assets/doc-browser-context-CCdW9TJf.js +1 -0
  81. package/dist/assets/docx-preview-zis3U0Fa.js +20 -0
  82. package/dist/assets/download-CyPgglKr.js +1 -0
  83. package/dist/assets/ebnfDiagram-CCIWWBDH-DBZETBwE.js +1 -0
  84. package/dist/assets/erDiagram-Q63AITRT-y2zDXprP.js +85 -0
  85. package/dist/assets/eventmodeling-45OFAUF4-C38BqG8w.js +1 -0
  86. package/dist/assets/{external-link-CU0kzzIP.js → external-link-BahW1sl3.js} +1 -1
  87. package/dist/assets/eye-D8gGXMkD.js +1 -0
  88. package/dist/assets/flowDiagram-23GEKE2U-BoKk8RRq.js +1 -0
  89. package/dist/assets/folder-DGWqFDvE.js +1 -0
  90. package/dist/assets/{form-actions-BvCp_0lS.js → form-actions-D2imZLnU.js} +1 -1
  91. package/dist/assets/ganttDiagram-NO4QXBWP-D2DP344e.js +292 -0
  92. package/dist/assets/gitGraph-TEB2WS4Q-IsQHHJuS.js +1 -0
  93. package/dist/assets/gitGraphDiagram-IHSO6WYX-D37uiwA2.js +106 -0
  94. package/dist/assets/graphlib-BcNFQr5y.js +1 -0
  95. package/dist/assets/index-0av6WO9-.css +1 -0
  96. package/dist/assets/index-CT0iYlxV.js +2 -0
  97. package/dist/assets/info-DKCQHKI2-ofy2qlHI.js +1 -0
  98. package/dist/assets/infoDiagram-FWYZ7A6U-CG-WAIRi.js +2 -0
  99. package/dist/assets/init-D8TjIqfm.js +1 -0
  100. package/dist/assets/ishikawaDiagram-FXEZZL3T-WeCTnW0f.js +70 -0
  101. package/dist/assets/journeyDiagram-5HDEW3XC-DUFBW9Td.js +139 -0
  102. package/dist/assets/jszip.min-CP5uPNQa.js +2 -0
  103. package/dist/assets/kanban-definition-HUTT4EX6-B0lxgMpg.js +89 -0
  104. package/dist/assets/katex-wEmrEFTg.js +257 -0
  105. package/dist/assets/line-B78frP_c.js +1 -0
  106. package/dist/assets/linear-C6lVEcb2.js +1 -0
  107. package/dist/assets/loader-circle-DtKek-qG.js +1 -0
  108. package/dist/assets/logo-badge-CuPetu-v.js +1 -0
  109. package/dist/assets/map-Bdri5UL5.js +1 -0
  110. package/dist/assets/mcp-marketplace-page-4qMwFDpz.js +1 -0
  111. package/dist/assets/mcp-marketplace-page-BbxN5aZF.js +9 -0
  112. package/dist/assets/mermaid-parser.core-Cue18vLo.js +4 -0
  113. package/dist/assets/mermaid.core-CXwWRh5i.js +11 -0
  114. package/dist/assets/mindmap-definition-LN4V7U3C-CFxz0P0-.js +96 -0
  115. package/dist/assets/model-config-page-DiJcvBML.js +1 -0
  116. package/dist/assets/ordinal-Cbd8t4LB.js +1 -0
  117. package/dist/assets/packet-7NZHBO7P-Rfopfa1o.js +1 -0
  118. package/dist/assets/path-DzBnMI1r.js +1 -0
  119. package/dist/assets/pegDiagram-2B236MQR-B_Qt9zyT.js +1 -0
  120. package/dist/assets/pie-RZYD4A2V-CJR1xKEv.js +1 -0
  121. package/dist/assets/pieDiagram-ENE6RG2P-CRQdSuwS.js +39 -0
  122. package/dist/assets/plus-BwgE-Zwf.js +1 -0
  123. package/dist/assets/popover-Btp7KVc3.js +1 -0
  124. package/dist/assets/preload-helper-D4M6sveU.js +1 -0
  125. package/dist/assets/provider-models-BoUhFo9R.js +1 -0
  126. package/dist/assets/provider-scoped-model-input-DZMtoAJG.js +1 -0
  127. package/dist/assets/providers-config-page-DfiWveEF.js +1 -0
  128. package/dist/assets/quadrantDiagram-ABIIQ3AL-D5kPpttq.js +7 -0
  129. package/dist/assets/radar-I7S5WNFK-CDg8Z-1r.js +1 -0
  130. package/dist/assets/railroad-3IZDKUUU-BHnNmjxO.js +1 -0
  131. package/dist/assets/railroad-abnf-AHOZXSZD-DGtNcusW.js +1 -0
  132. package/dist/assets/railroad-ebnf-EBAXGLYW-BRFtsQmm.js +1 -0
  133. package/dist/assets/railroad-peg-LSFZ7HO6-Bj5IypCA.js +1 -0
  134. package/dist/assets/railroadDiagram-RFXS5EU6-DGh_TGlQ.js +1 -0
  135. package/dist/assets/react-BY-U3h3t.js +8 -0
  136. package/dist/assets/{refresh-cw-CILd1vAP.js → refresh-cw-Cme5qFej.js} +1 -1
  137. package/dist/assets/remote-BaVECEZw.js +1 -0
  138. package/dist/assets/requirementDiagram-TGXJPOKE-EmFph0H_.js +84 -0
  139. package/dist/assets/rotate-cw-CMRZxIkH.js +1 -0
  140. package/dist/assets/rough.esm-wJ1d3nQl.js +1 -0
  141. package/dist/assets/runtime-config-page-wygwvMB4.js +1 -0
  142. package/dist/assets/sankeyDiagram-HTMAVEWB-BXWB5Ugi.js +40 -0
  143. package/dist/assets/{save-ByJqcPTP.js → save-DNg2yJTS.js} +1 -1
  144. package/dist/assets/{search-DVIV6pfD.js → search-3ykfrAFt.js} +1 -1
  145. package/dist/assets/search-config-page-DrVKa_Ls.js +1 -0
  146. package/dist/assets/secrets-config-page-B39uQ5kF.js +3 -0
  147. package/dist/assets/security-config-BPzet76z.js +1 -0
  148. package/dist/assets/select-B5EecXJt.js +1 -0
  149. package/dist/assets/sequenceDiagram-DBY2YBRQ-ClKnO7v0.js +162 -0
  150. package/dist/assets/setting-row-Qv1Ps79v.js +1 -0
  151. package/dist/assets/{settings-2-CH5shGg_.js → settings-2-D-3um9Az.js} +1 -1
  152. package/dist/assets/sizeCapture-X5ZJPWSS-DSo-t5ou.js +1 -0
  153. package/dist/assets/{skeleton-DeX1FKw7.js → skeleton-BgkzQd4U.js} +1 -1
  154. package/dist/assets/src-Dad2ZbCt.js +1 -0
  155. package/dist/assets/stateDiagram-2N3HPSRC-BvAalBfz.js +1 -0
  156. package/dist/assets/stateDiagram-v2-6OUMAXLB-CfMU38yc.js +1 -0
  157. package/dist/assets/swimlanes-5IMT3BWC-DdVqVa1a.js +2 -0
  158. package/dist/assets/swimlanesDiagram-G3AALYLV-D9Zb9X57.js +8 -0
  159. package/dist/assets/tabs-BVD8gp3y.js +1 -0
  160. package/dist/assets/tag-chip-0qn-f3Bo.js +1 -0
  161. package/dist/assets/timeline-definition-FHXFAJF6-D4ar8IQY.js +120 -0
  162. package/dist/assets/trash-2-cnsMppRC.js +1 -0
  163. package/dist/assets/treeView-QDETBFTQ-Uy7M0WvH.js +1 -0
  164. package/dist/assets/treemap-6X3UGDF4-BJfGV7KX.js +1 -0
  165. package/dist/assets/use-config-D6yx0lb0.js +1 -0
  166. package/dist/assets/use-confirm-dialog-C_o0eQeH.js +1 -0
  167. package/dist/assets/use-viewport-layout-BWav4KCL.js +1 -0
  168. package/dist/assets/vennDiagram-L72KCM5P-CDXJ_i3p.js +34 -0
  169. package/dist/assets/wardley-OPB4EBWU-q263iF3K.js +1 -0
  170. package/dist/assets/wardleyDiagram-EHGQE667-D-dSuT_7.js +78 -0
  171. package/dist/assets/x-B3o1dWR5.js +1 -0
  172. package/dist/assets/xlsx-DUqJhg5u.js +64 -0
  173. package/dist/assets/xychartDiagram-FW5EYKEG-C9JCzsZF.js +7 -0
  174. package/dist/index.html +35 -28
  175. package/package.json +11 -6
  176. package/src/features/chat/components/chat-popover-content.tsx +1 -0
  177. package/src/features/chat/components/conversation/__tests__/chat-conversation-content.test.tsx +13 -0
  178. package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +21 -11
  179. package/src/features/chat/components/conversation/__tests__/chat-conversation-header.test.tsx +2 -2
  180. package/src/features/chat/components/conversation/__tests__/chat-conversation-workspace-section.test.tsx +28 -1
  181. package/src/features/chat/components/conversation/chat-conversation-content.tsx +5 -4
  182. package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +9 -18
  183. package/src/features/chat/components/conversation/chat-conversation-track.tsx +35 -0
  184. package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +2 -0
  185. package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +7 -7
  186. package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +3 -14
  187. package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +20 -1
  188. package/src/features/chat/features/conversation/components/session-conversation-input.tsx +97 -65
  189. package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +43 -0
  190. package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +14 -10
  191. package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +51 -0
  192. package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +61 -21
  193. package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +42 -10
  194. package/src/features/chat/features/message/components/chat-inline-file-preview.tsx +80 -0
  195. package/src/features/chat/features/message/components/chat-message-list.container.tsx +66 -56
  196. package/src/features/chat/features/message/utils/__tests__/chat-message-file-operation.utils.test.ts +30 -0
  197. package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +2 -0
  198. package/src/features/chat/features/session/components/__tests__/chat-sidebar-session-item.test.tsx +37 -0
  199. package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +4 -3
  200. package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +3 -8
  201. package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +65 -20
  202. package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +26 -28
  203. package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +3 -3
  204. package/src/features/chat/features/session/components/session-header/chat-session-title-switcher.tsx +3 -3
  205. package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +3 -3
  206. package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +3 -3
  207. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +424 -129
  208. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +113 -2
  209. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +3 -1
  210. package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +197 -44
  211. package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumb-browser.tsx +9 -3
  212. package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +13 -22
  213. package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +96 -194
  214. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +239 -1
  215. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +61 -7
  216. package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +34 -8
  217. package/src/features/chat/features/workspace/components/file-content-preview/use-workspace-file-buffer.ts +42 -0
  218. package/src/features/chat/features/workspace/components/file-content-preview/workspace-document-preview-state.tsx +18 -0
  219. package/src/features/chat/features/workspace/components/file-content-preview/workspace-docx-preview.css +89 -0
  220. package/src/features/chat/features/workspace/components/file-content-preview/workspace-docx-preview.tsx +87 -0
  221. package/src/features/chat/features/workspace/components/file-content-preview/workspace-presentation-preview.tsx +82 -0
  222. package/src/features/chat/features/workspace/components/file-content-preview/workspace-spreadsheet-preview.tsx +180 -0
  223. package/src/features/chat/features/workspace/components/workspace-file-content-preview.tsx +191 -0
  224. package/src/features/chat/features/workspace/hooks/use-chat-conversation-workspace-state.ts +1 -4
  225. package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +157 -13
  226. package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +151 -2
  227. package/src/features/chat/features/workspace/utils/chat-workspace-file-tab-persistence.utils.ts +17 -0
  228. package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +66 -0
  229. package/src/features/chat/features/workspace/utils/chat-workspace-file-viewer.utils.ts +49 -0
  230. package/src/features/chat/features/workspace/utils/chat-workspace-panel-layout.utils.ts +13 -0
  231. package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +196 -43
  232. package/src/features/chat/index.ts +1 -0
  233. package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +101 -0
  234. package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +48 -60
  235. package/src/features/chat/managers/chat-session-list.manager.ts +1 -0
  236. package/src/features/chat/managers/chat-thread.manager.ts +137 -162
  237. package/src/features/chat/pages/ncp-chat-page.tsx +1 -2
  238. package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +87 -1
  239. package/src/features/chat/stores/chat-message-layout.store.test.ts +37 -0
  240. package/src/features/chat/stores/chat-message-layout.store.ts +41 -0
  241. package/src/features/chat/stores/chat-thread.store.ts +77 -40
  242. package/src/features/chat/types/chat-input-bar.types.ts +2 -0
  243. package/src/features/settings/pages/__tests__/appearance-settings-page.test.tsx +25 -8
  244. package/src/features/settings/pages/appearance-settings-page.tsx +92 -13
  245. package/src/index.css +36 -2
  246. package/src/shared/components/__tests__/file-type-icon.test.tsx +61 -0
  247. package/src/shared/components/common/__tests__/brand-header.test.tsx +17 -7
  248. package/src/shared/components/common/brand-header.tsx +34 -34
  249. package/src/shared/components/doc-browser/__tests__/doc-browser-context.test.tsx +19 -0
  250. package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +16 -0
  251. package/src/shared/components/doc-browser/doc-browser-context.tsx +1 -0
  252. package/src/shared/components/doc-browser/doc-browser.tsx +11 -3
  253. package/src/shared/components/doc-browser/managers/doc-browser.manager.ts +5 -0
  254. package/src/shared/components/doc-browser/stores/doc-browser.store.ts +6 -1
  255. package/src/shared/components/doc-browser/types/doc-browser.types.ts +2 -0
  256. package/src/shared/components/doc-browser/utils/doc-browser-state.utils.ts +11 -0
  257. package/src/shared/components/file-type-icon.tsx +272 -0
  258. package/src/shared/components/resizable-right-panel/__tests__/resizable-right-panel.test.tsx +22 -0
  259. package/src/shared/components/resizable-right-panel/resizable-right-panel.tsx +17 -2
  260. package/src/shared/components/ui/tab-strip/__tests__/compact-tab-strip.test.tsx +38 -0
  261. package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +82 -2
  262. package/src/shared/hooks/use-server-path-read.ts +10 -5
  263. package/src/shared/lib/api/__tests__/server-path.utils.test.ts +28 -0
  264. package/src/shared/lib/api/types.ts +3 -3
  265. package/src/shared/lib/api/utils/server-path.utils.ts +20 -20
  266. package/src/shared/lib/i18n/locales/en-US/chat.json +25 -1
  267. package/src/shared/lib/i18n/locales/en-US/core.json +6 -0
  268. package/src/shared/lib/i18n/locales/zh-CN/chat.json +25 -1
  269. package/src/shared/lib/i18n/locales/zh-CN/core.json +6 -0
  270. package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +1 -4
  271. package/src/shared/lib/session-project/workspace-file-breadcrumb.utils.ts +1 -18
  272. package/dist/assets/api-iNBpppzj.js +0 -13
  273. package/dist/assets/appearance-settings-page-DMffQFR3.js +0 -1
  274. package/dist/assets/channels-list-page-CCtp0BRS.js +0 -8
  275. package/dist/assets/chat-page-H5a0dWvO.js +0 -1
  276. package/dist/assets/config-split-page-CrOJgB-Y.js +0 -1
  277. package/dist/assets/confirm-dialog-Chv50USy.js +0 -5
  278. package/dist/assets/desktop-update-config-KzTuXRf_.js +0 -1
  279. package/dist/assets/dist-BunzmC4B.js +0 -1
  280. package/dist/assets/dist-ChmGwvtK.js +0 -1
  281. package/dist/assets/doc-browser-DNRL4Zvd.js +0 -1
  282. package/dist/assets/doc-browser-Dg0pmkOg.js +0 -1
  283. package/dist/assets/doc-browser-context-BHY-0FSD.js +0 -1
  284. package/dist/assets/es2015-DQZ5JWwK.js +0 -41
  285. package/dist/assets/i18n-provider-Cu8XyZb_.js +0 -1
  286. package/dist/assets/index-CzfBdvK1.css +0 -1
  287. package/dist/assets/index-DGqHne1Q.js +0 -104
  288. package/dist/assets/loader-circle-CDSFuzmk.js +0 -1
  289. package/dist/assets/mcp-marketplace-page-BeEQK0DL.js +0 -9
  290. package/dist/assets/mcp-marketplace-page-D6idOTLp.js +0 -1
  291. package/dist/assets/model-config-page-bNNo-XyG.js +0 -1
  292. package/dist/assets/plus-D4DsdLN-.js +0 -1
  293. package/dist/assets/provider-scoped-model-input-IlgQCsoT.js +0 -1
  294. package/dist/assets/providers-config-page-wLo6CAJw.js +0 -1
  295. package/dist/assets/react-BPIsQIlO.js +0 -8
  296. package/dist/assets/remote-uKEYp7AR.js +0 -1
  297. package/dist/assets/rotate-cw-wPFPg1kH.js +0 -1
  298. package/dist/assets/runtime-config-page-DDn1sP4G.js +0 -1
  299. package/dist/assets/search-config-page-B-Cf4iiB.js +0 -1
  300. package/dist/assets/secrets-config-page-DPKsY8Iw.js +0 -3
  301. package/dist/assets/security-config-e9SSBlKr.js +0 -1
  302. package/dist/assets/select-BdgczSNw.js +0 -1
  303. package/dist/assets/setting-row-BkTVUTKx.js +0 -1
  304. package/dist/assets/side-dock-BsBvcJ9i.js +0 -3
  305. package/dist/assets/switch-Cv8Ekb3x.js +0 -1
  306. package/dist/assets/tag-chip-RB9uKcoC.js +0 -1
  307. package/dist/assets/tooltip-oQlEN-l6.js +0 -1
  308. package/dist/assets/use-config-l3W7y8Qz.js +0 -1
  309. package/dist/assets/use-confirm-dialog-BAxaVOJI.js +0 -1
  310. package/dist/assets/x-BBMffEN0.js +0 -1
  311. package/src/features/chat/components/layout/__tests__/chat-sidebar-utility-menu.test.tsx +0 -55
  312. /package/dist/assets/{config-hints-C_iP1zl_.js → config-hints-LxG80Uj5.js} +0 -0
  313. /package/dist/assets/{host-capabilities-9bB_998Z.js → host-capabilities-CFbAfrrA.js} +0 -0
  314. /package/dist/assets/{middleware-BILWbJE4.js → middleware-CAXxl-af.js} +0 -0
@@ -0,0 +1,106 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CXwWRh5i.js","assets/preload-helper-D4M6sveU.js","assets/chunk-HOUHSVGY-BMPwFEwN.js","assets/src-Dad2ZbCt.js","assets/chunk-DseTPa7n.js","assets/chunk-Y2CYZVJY-BGrd8tLy.js","assets/chunk-WYO6CB5R-Do6SJrnY.js","assets/chunk-ICXQ74PX-DH8NJMok.js","assets/dist-dw-gAfM_.js","assets/chunk-Q4XR5HBZ-uvIGstBS.js","assets/chunk-52WLFC77-BLeB7iGk.js","assets/line-B78frP_c.js","assets/path-DzBnMI1r.js","assets/array-BqYdCIE6.js","assets/chunk-7BUUIJ7U-JiyRtrGu.js","assets/chunk-C7G6YPKG-AsyDSQ9j.js","assets/chunk-OGEWGWER-TIcEoPPH.js","assets/chunk-ZGVPDNZ5-B7kWWaXv.js","assets/rough.esm-wJ1d3nQl.js","assets/chunk-FWX5IMBZ-DFelpZBy.js","assets/chunk-VAUOI2AC-Dpcz6BhT.js","assets/chunk-ZIRB5QZD-DTU0cDNh.js","assets/docx-preview-zis3U0Fa.js","assets/jszip.min-CP5uPNQa.js","assets/aiden0z-pptx-renderer.es-D87ywFdC.js","assets/doc-browser-DJQ5XPsi2.js","assets/doc-browser-C9u7N9vH.js","assets/dist-D5ycbwCo.js","assets/react-BY-U3h3t.js","assets/popover-Btp7KVc3.js","assets/search-3ykfrAFt.js","assets/external-link-BahW1sl3.js","assets/plus-BwgE-Zwf.js","assets/refresh-cw-Cme5qFej.js","assets/x-B3o1dWR5.js","assets/doc-browser-context-CCdW9TJf.js","assets/middleware-CAXxl-af.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t,t as n}from"./chunk-DseTPa7n.js";import{a as r,d as i,f as a,h as o,i as s,m as c,n as l,o as u,p as d,r as f,t as p,u as m}from"./react-BY-U3h3t.js";import{t as h}from"./preload-helper-D4M6sveU.js";import{At as g,B as _,Bt as v,C as y,Ct as b,Dt as x,Ft as S,G as C,Ht as w,It as T,Jt as E,Kt as D,L as O,Lt as k,Nt as A,Ot as ee,Pt as j,Rt as te,S as M,St as ne,Tt as re,Ut as ie,Vt as ae,W as oe,Wt as se,X as ce,Z as le,_ as ue,_t as de,a as fe,an as pe,b as me,bt as he,c as ge,d as _e,dt as ve,ft as ye,g as be,h as xe,i as Se,jt as Ce,kt as we,l as Te,lt as Ee,m as De,n as Oe,o as ke,p as Ae,pt as je,qt as Me,r as Ne,s as Pe,t as Fe,u as Ie,ut as Le,v as Re,vt as ze,x as Be,y as Ve,yt as He,zt as Ue}from"./api-IlX_CbwU.js";import{c as N}from"./dist-D5ycbwCo.js";import{a as We,c as Ge,i as Ke,l as qe,o as Je,r as Ye,s as Xe,t as Ze,u as Qe}from"./popover-Btp7KVc3.js";import{a as $e,i as et,n as tt,o as nt,r as rt,s as it,t as at}from"./confirm-dialog-Dt8Kdbgp.js";import{n as ot,t as st}from"./search-3ykfrAFt.js";import{_ as ct,a as lt,c as ut,d as dt,f as ft,g as pt,h as mt,i as ht,l as gt,m as _t,n as vt,o as yt,p as bt,r as xt,s as St,u as Ct,v as wt}from"./doc-browser-C9u7N9vH.js";import{t as Tt}from"./book-open-CN7Shpij.js";import{C as Et,S as Dt,_ as Ot,a as kt,b as At,c as jt,d as Mt,f as Nt,g as Pt,h as Ft,i as It,l as Lt,m as Rt,n as zt,o as Bt,p as Vt,r as Ht,s as Ut,t as Wt,u as Gt,v as Kt,w as qt,x as Jt,y as Yt}from"./select-B5EecXJt.js";import{a as Xt,o as Zt,r as Qt,s as $t,t as en}from"./use-confirm-dialog-C_o0eQeH.js";import{t as tn}from"./download-CyPgglKr.js";import{t as nn}from"./external-link-BahW1sl3.js";import{t as rn}from"./eye-D8gGXMkD.js";import{t as an}from"./folder-DGWqFDvE.js";import{a as on,c as sn,i as cn,o as ln,r as un,s as dn,t as fn}from"./tabs-BVD8gp3y.js";import{i as pn,n as mn,r as hn,t as gn}from"./use-viewport-layout-BWav4KCL.js";import{t as _n}from"./loader-circle-DtKek-qG.js";import{t as vn}from"./plus-BwgE-Zwf.js";import{t as yn}from"./refresh-cw-Cme5qFej.js";import{n as bn,t as xn}from"./skeleton-BgkzQd4U.js";import{t as Sn}from"./trash-2-cnsMppRC.js";import{t as Cn}from"./x-B3o1dWR5.js";import{n as wn,t as Tn}from"./logo-badge-CuPetu-v.js";import{t as En}from"./host-capabilities-CFbAfrrA.js";import{n as Dn,t as On}from"./middleware-CAXxl-af.js";import{a as kn,c as An,d as jn,g as Mn,h as Nn,i as Pn,l as Fn,m as In,n as Ln,o as Rn,p as zn,r as Bn,s as Vn}from"./doc-browser-context-CCdW9TJf.js";import{c as Hn,n as Un,r as Wn}from"./provider-models-BoUhFo9R.js";var P=e(o(),1),Gn=`popstate`;function Kn(e={}){let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>u(e,typeof e==`string`?null:e.state,t===0?`default`:void 0));let a=c(n??i.length-1),o=`POP`,s=null;function c(e){return Math.min(Math.max(e,0),i.length-1)}function l(){return i[a]}function u(e,t=null,n){let r=Qn(i?l().pathname:`/`,e,t,n);return Yn(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),r}function d(e){return typeof e==`string`?e:$n(e)}return{get index(){return a},get action(){return o},get location(){return l()},createHref:d,createURL(e){return new URL(d(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?er(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=`PUSH`;let n=u(e,t);a+=1,i.splice(a,i.length,n),r&&s&&s({action:o,location:n,delta:1})},replace(e,t){o=`REPLACE`;let n=u(e,t);i[a]=n,r&&s&&s({action:o,location:n,delta:0})},go(e){o=`POP`;let t=c(a+e),n=i[t];a=t,s&&s({action:o,location:n,delta:e})},listen(e){return s=e,()=>{s=null}}}}function qn(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return Qn(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:$n(t)}return tr(t,n,null,e)}function Jn(e,t){if(e===!1||e==null)throw Error(t)}function Yn(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Xn(){return Math.random().toString(36).substring(2,10)}function Zn(e,t){return{usr:e.state,key:e.key,idx:t}}function Qn(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?er(t):t,state:n,key:t&&t.key||r||Xn()}}function $n({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function er(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function tr(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Qn(h.location,e,t);n&&n(r,e),l=u()+1;let d=Zn(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Qn(h.location,e,t);n&&n(r,e),l=u();let i=Zn(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return nr(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Gn,d),c=e,()=>{i.removeEventListener(Gn,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function nr(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),Jn(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:$n(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function rr(e,t,n=`/`){return ir(e,t,n,!1)}function ir(e,t,n,r){let i=Sr((typeof t==`string`?er(t):t).pathname||`/`,n);if(i==null)return null;let a=or(e);cr(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=xr(i);o=vr(a[e],t,r)}return o}function ar(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function or(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Jn(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ar([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Jn(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),or(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:gr(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of sr(e.path))a(e,t,!0,n)}),t}function sr(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=sr(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function cr(e){e.sort((e,t)=>e.score===t.score?_r(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var lr=/^:[\w-]+$/,ur=3,dr=2,fr=1,pr=10,mr=-2,hr=e=>e===`*`;function gr(e,t){let n=e.split(`/`),r=n.length;return n.some(hr)&&(r+=mr),t&&(r+=dr),n.filter(e=>!hr(e)).reduce((e,t)=>e+(lr.test(t)?ur:t===``?fr:pr),r)}function _r(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function vr(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=yr({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=yr({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Ar([a,u.pathname]),pathnameBase:jr(Ar([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Ar([a,u.pathnameBase]))}return o}function yr(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=br(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function br(e,t=!1,n=!0){Yn(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`)).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function xr(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Yn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Sr(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var Cr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function wr(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?er(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?Tr(n.substring(1),`/`):Tr(n,t)):a=t,{pathname:a,search:Mr(r),hash:Nr(i)}}function Tr(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Er(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dr(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Or(e){let t=Dr(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function kr(e,t,n,r=!1){let i;typeof e==`string`?i=er(e):(i={...e},Jn(!i.pathname||!i.pathname.includes(`?`),Er(`?`,`pathname`,`search`,i)),Jn(!i.pathname||!i.pathname.includes(`#`),Er(`#`,`pathname`,`hash`,i)),Jn(!i.search||!i.search.includes(`#`),Er(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=wr(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ar=e=>e.join(`/`).replace(/\/\/+/g,`/`),jr=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Mr=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Nr=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Pr=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Fr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ir(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var Lr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Rr(e,t){let n=e;if(typeof n!=`string`||!Cr.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Lr)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Sr(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Yn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var zr=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(zr);var Br=[`GET`,...zr];new Set(Br);var Vr=P.createContext(null);Vr.displayName=`DataRouter`;var Hr=P.createContext(null);Hr.displayName=`DataRouterState`;var Ur=P.createContext(!1),Wr=P.createContext({isTransitioning:!1});Wr.displayName=`ViewTransition`;var Gr=P.createContext(new Map);Gr.displayName=`Fetchers`;var Kr=P.createContext(null);Kr.displayName=`Await`;var qr=P.createContext(null);qr.displayName=`Navigation`;var Jr=P.createContext(null);Jr.displayName=`Location`;var Yr=P.createContext({outlet:null,matches:[],isDataRoute:!1});Yr.displayName=`Route`;var Xr=P.createContext(null);Xr.displayName=`RouteError`;var Zr=`REACT_ROUTER_ERROR`,Qr=`REDIRECT`,$r=`ROUTE_ERROR_RESPONSE`;function ei(e){if(e.startsWith(`${Zr}:${Qr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ti(e){if(e.startsWith(`${Zr}:${$r}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Pr(t.status,t.statusText,t.data)}catch{}}function ni(e,{relative:t}={}){Jn(ri(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=P.useContext(qr),{hash:i,pathname:a,search:o}=ui(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ar([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ri(){return P.useContext(Jr)!=null}function ii(){return Jn(ri(),`useLocation() may be used only in the context of a <Router> component.`),P.useContext(Jr).location}var ai=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function oi(e){P.useContext(qr).static||P.useLayoutEffect(e)}function si(){let{isDataRoute:e}=P.useContext(Yr);return e?ki():ci()}function ci(){Jn(ri(),`useNavigate() may be used only in the context of a <Router> component.`);let e=P.useContext(Vr),{basename:t,navigator:n}=P.useContext(qr),{matches:r}=P.useContext(Yr),{pathname:i}=ii(),a=JSON.stringify(Or(r)),o=P.useRef(!1);return oi(()=>{o.current=!0}),P.useCallback((r,s={})=>{if(Yn(o.current,ai),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=kr(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ar([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}P.createContext(null);function li(){let{matches:e}=P.useContext(Yr),t=e[e.length-1];return t?t.params:{}}function ui(e,{relative:t}={}){let{matches:n}=P.useContext(Yr),{pathname:r}=ii(),i=JSON.stringify(Or(n));return P.useMemo(()=>kr(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function di(e,t){return fi(e,t)}function fi(e,t,n,r,i){Jn(ri(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=P.useContext(qr),{matches:o}=P.useContext(Yr),s=o[o.length-1],c=s?s.params:{},l=s?s.pathname:`/`,u=s?s.pathnameBase:`/`,d=s&&s.route;{let e=d&&d.path||``;ji(l,!d||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3
+
4
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let f=ii(),p;if(t){let e=typeof t==`string`?er(t):t;Jn(u===`/`||e.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=f;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=rr(e,{pathname:h});Yn(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Yn(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=yi(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:Ar([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:Ar([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?P.createElement(Jr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function pi(){let e=Oi(),t=Fr(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=P.createElement(P.Fragment,null,P.createElement(`p`,null,`💿 Hey developer 👋`),P.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,P.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,P.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),P.createElement(P.Fragment,null,P.createElement(`h2`,null,`Unexpected Application Error!`),P.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?P.createElement(`pre`,{style:i},n):null,o)}var mi=P.createElement(pi,null),hi=class extends P.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ti(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:P.createElement(Yr.Provider,{value:this.props.routeContext},P.createElement(Xr.Provider,{value:e,children:this.props.component}));return this.context?P.createElement(_i,{error:e},t):t}};hi.contextType=Ur;var gi=new WeakMap;function _i({children:e,error:t}){let{basename:n}=P.useContext(qr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ei(t.digest);if(e){let r=gi.get(t);if(r)throw r;let i=Rr(e.location,n);if(Lr&&!gi.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw gi.set(t,n),n}return P.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function vi({routeContext:e,match:t,children:n}){let r=P.useContext(Vr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),P.createElement(Yr.Provider,{value:e},n)}function yi(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);Jn(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}let l=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:Ir(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,i)=>{let u,d=!1,f=null,p=null;n&&(u=o&&r.route.id?o[r.route.id]:void 0,f=r.route.errorElement||mi,s&&(c<0&&i===0?(ji(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):c===i&&(d=!0,p=r.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,i+1)),h=()=>{let t;return t=u?f:d?p:r.route.Component?P.createElement(r.route.Component,null):r.route.element?r.route.element:e,P.createElement(vi,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?P.createElement(hi,{location:n.location,revalidation:n.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function bi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xi(e){let t=P.useContext(Vr);return Jn(t,bi(e)),t}function Si(e){let t=P.useContext(Hr);return Jn(t,bi(e)),t}function Ci(e){let t=P.useContext(Yr);return Jn(t,bi(e)),t}function wi(e){let t=Ci(e),n=t.matches[t.matches.length-1];return Jn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ti(){return wi(`useRouteId`)}function Ei(){return Si(`useNavigation`).navigation}function Di(){let{matches:e,loaderData:t}=Si(`useMatches`);return P.useMemo(()=>e.map(e=>ar(e,t)),[e,t])}function Oi(){let e=P.useContext(Xr),t=Si(`useRouteError`),n=wi(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ki(){let{router:e}=xi(`useNavigate`),t=wi(`useNavigate`),n=P.useRef(!1);return oi(()=>{n.current=!0}),P.useCallback(async(r,i={})=>{Yn(n.current,ai),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ai={};function ji(e,t,n){!t&&!Ai[e]&&(Ai[e]=!0,Yn(!1,n))}P.useOptimistic,P.memo(Mi);function Mi({routes:e,future:t,state:n,onError:r}){return fi(e,void 0,n,r,t)}function Ni({basename:e,children:t,initialEntries:n,initialIndex:r,unstable_useTransitions:i}){let a=P.useRef();a.current??=Kn({initialEntries:n,initialIndex:r,v5Compat:!0});let o=a.current,[s,c]=P.useState({action:o.action,location:o.location}),l=P.useCallback(e=>{i===!1?c(e):P.startTransition(()=>c(e))},[i]);return P.useLayoutEffect(()=>o.listen(l),[o,l]),P.createElement(Ii,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,unstable_useTransitions:i})}function Pi({to:e,replace:t,state:n,relative:r}){Jn(ri(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=P.useContext(qr);Yn(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=P.useContext(Yr),{pathname:o}=ii(),s=si(),c=kr(e,Or(a),o,r===`path`),l=JSON.stringify(c);return P.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Fi(e){Jn(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ii({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){Jn(!ri(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=P.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=er(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`}=n,m=P.useMemo(()=>{let e=Sr(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p},navigationType:r}},[s,l,u,d,f,p,r]);return Yn(m!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:P.createElement(qr.Provider,{value:c},P.createElement(Jr.Provider,{children:t,value:m}))}function Li({children:e,location:t}){return di(Ri(e),t)}P.Component;function Ri(e,t=[]){let n=[];return P.Children.forEach(e,(e,r)=>{if(!P.isValidElement(e))return;let i=[...t,r];if(e.type===P.Fragment){n.push.apply(n,Ri(e.props.children,i));return}Jn(e.type===Fi,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Jn(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Ri(e.props.children,i)),n.push(a)}),n}var zi=`get`,Bi=`application/x-www-form-urlencoded`;function Vi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Hi(e){return Vi(e)&&e.tagName.toLowerCase()===`button`}function Ui(e){return Vi(e)&&e.tagName.toLowerCase()===`form`}function Wi(e){return Vi(e)&&e.tagName.toLowerCase()===`input`}function Gi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ki(e,t){return e.button===0&&(!t||t===`_self`)&&!Gi(e)}var qi=null;function Ji(){if(qi===null)try{new FormData(document.createElement(`form`),0),qi=!1}catch{qi=!0}return qi}var Yi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Xi(e){return e!=null&&!Yi.has(e)?(Yn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bi}"`),null):e}function Zi(e,t){let n,r,i,a,o;if(Ui(e)){let o=e.getAttribute(`action`);r=o?Sr(o,t):null,n=e.getAttribute(`method`)||zi,i=Xi(e.getAttribute(`enctype`))||Bi,a=new FormData(e)}else if(Hi(e)||Wi(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Sr(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||zi,i=Xi(e.getAttribute(`formenctype`))||Xi(o.getAttribute(`enctype`))||Bi,a=new FormData(o,e),!Ji()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Vi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=zi,r=null,i=Bi,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Qi={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},$i=/[&><\u2028\u2029]/g;function ea(e){return e.replace($i,e=>Qi[e])}function ta(e,t){if(e===!1||e==null)throw Error(t)}function na(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Sr(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function ra(e,t){if(e.id in t)return t[e.id];try{let n=await h(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ia(e){return e!=null&&typeof e.page==`string`}function aa(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function oa(e,t,n){return da((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ra(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(aa).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function sa(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ca(e,t,{includeHydrateFallback:n}={}){return la(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function la(e){return[...new Set(e)]}function ua(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function da(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ia(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ua(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function fa(){let e=P.useContext(Vr);return ta(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function pa(){let e=P.useContext(Hr);return ta(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ma=P.createContext(void 0);ma.displayName=`FrameworkContext`;function ha(){let e=P.useContext(ma);return ta(e,`You must render this element inside a <HydratedRouter> element`),e}function ga(e,t){let n=P.useContext(ma),[r,i]=P.useState(!1),[a,o]=P.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=P.useRef(null);P.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),P.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:_a(s,p),onBlur:_a(c,m),onMouseEnter:_a(l,p),onMouseLeave:_a(u,m),onTouchStart:_a(d,p)}]:[a,f,{}]:[!1,f,{}]}function _a(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function va({page:e,...t}){let{router:n}=fa(),r=P.useMemo(()=>rr(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?P.createElement(ba,{page:e,matches:r,...t}):null}function ya(e){let{manifest:t,routeModules:n}=ha(),[r,i]=P.useState([]);return P.useEffect(()=>{let r=!1;return oa(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function ba({page:e,matches:t,...n}){let r=ii(),{future:i,manifest:a,routeModules:o}=ha(),{basename:s}=fa(),{loaderData:c,matches:l}=pa(),u=P.useMemo(()=>sa(e,t,l,a,r,`data`),[e,t,l,a,r]),d=P.useMemo(()=>sa(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=P.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=na(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=P.useMemo(()=>ca(d,a),[d,a]),m=ya(d);return P.createElement(P.Fragment,null,f.map(e=>P.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>P.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>P.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function xa(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}P.Component;var Sa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Sa&&(window.__reactRouterVersion=`7.13.0`)}catch{}function Ca({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=P.useRef();i.current??=qn({window:r,v5Compat:!0});let a=i.current,[o,s]=P.useState({action:a.action,location:a.location}),c=P.useCallback(e=>{n===!1?s(e):P.startTransition(()=>s(e))},[n]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.createElement(Ii,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function wa({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=P.useState({action:n.action,location:n.location}),o=P.useCallback(e=>{r===!1?a(e):P.startTransition(()=>a(e))},[r]);return P.useLayoutEffect(()=>n.listen(o),[n,o]),P.createElement(Ii,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}wa.displayName=`unstable_HistoryRouter`;var Ta=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ea=P.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u,unstable_defaultShouldRevalidate:d,...f},p){let{basename:m,unstable_useTransitions:h}=P.useContext(qr),g=typeof c==`string`&&Ta.test(c),_=Rr(c,m);c=_.to;let v=ni(c,{relative:r}),[y,b,x]=ga(n,f),S=Na(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h});function C(t){e&&e(t),t.defaultPrevented||S(t)}let w=P.createElement(`a`,{...f,...x,href:_.absoluteURL||v,onClick:_.isExternal||i?e:C,ref:xa(p,b),target:s,"data-discover":!g&&t===`render`?`true`:void 0});return y&&!g?P.createElement(P.Fragment,null,w,P.createElement(va,{page:v})):w});Ea.displayName=`Link`;var Da=P.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ui(a,{relative:c.relative}),d=ii(),f=P.useContext(Hr),{navigator:p,basename:m}=P.useContext(qr),h=f!=null&&Ua(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Sr(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return P.createElement(Ea,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Da.displayName=`NavLink`;var Oa=P.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=zi,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=P.useContext(qr),g=Ia(),_=La(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ta.test(s);return P.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?P.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Oa.displayName=`Form`;function ka({getKey:e,storageKey:t,...n}){let r=P.useContext(ma),{basename:i}=P.useContext(qr),a=ii(),o=Di();Va({getKey:e,storageKey:t});let s=P.useMemo(()=>{if(!r||!e)return null;let t=Ba(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return P.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ea(JSON.stringify(t||Ra))}, ${ea(JSON.stringify(s))})`}})}ka.displayName=`ScrollRestoration`;function Aa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ja(e){let t=P.useContext(Vr);return Jn(t,Aa(e)),t}function Ma(e){let t=P.useContext(Hr);return Jn(t,Aa(e)),t}function Na(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s,unstable_useTransitions:c}={}){let l=si(),u=ii(),d=ui(e,{relative:a});return P.useCallback(f=>{if(Ki(f,t)){f.preventDefault();let t=n===void 0?$n(u)===$n(d):n,p=()=>l(e,{replace:t,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s});c?P.startTransition(()=>p()):p()}},[u,l,d,n,r,t,e,i,a,o,s,c])}var Pa=0,Fa=()=>`__${String(++Pa)}__`;function Ia(){let{router:e}=ja(`useSubmit`),{basename:t}=P.useContext(qr),n=Ti(),r=e.fetch,i=e.navigate;return P.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Zi(e,t);a.navigate===!1?await r(a.fetcherKey||Fa(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function La(e,{relative:t}={}){let{basename:n}=P.useContext(qr),r=P.useContext(Yr);Jn(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ui(e||`.`,{relative:t})},o=ii();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ar([n,a.pathname])),$n(a)}var Ra=`react-router-scroll-positions`,za={};function Ba(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Sr(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Va({getKey:e,storageKey:t}={}){let{router:n}=ja(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Ma(`useScrollRestoration`),{basename:a}=P.useContext(qr),o=ii(),s=Di(),c=Ei();P.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ha(P.useCallback(()=>{if(c.state===`idle`){let t=Ba(o,s,a,e);za[t]=window.scrollY}try{sessionStorage.setItem(t||Ra,JSON.stringify(za))}catch(e){Yn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(P.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Ra);e&&(za=JSON.parse(e))}catch{}},[t]),P.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(za,()=>window.scrollY,e?(t,n)=>Ba(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),P.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{Yn(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Ha(e,t){let{capture:n}=t||{};P.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Ua(e,{relative:t}={}){let n=P.useContext(Wr);Jn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ja(`useViewTransitionState`),i=ui(e,{relative:t});if(!n.isTransitioning)return!1;let a=Sr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Sr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yr(i.pathname,o)!=null||yr(i.pathname,a)!=null}var Wa=N(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),Ga=N(`AppWindow`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),Ka=N(`ArrowDown`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),qa=N(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Ja=N(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Ya=N(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Xa=N(`Braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Za=N(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),Qa=N(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),$a=N(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),eo=N(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),to=N(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),no=N(`CircleDashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),ro=N(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),io=N(`CirclePause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),ao=N(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),oo=N(`CodeXml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),so=N(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),co=N(`CornerDownRight`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),lo=N(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),uo=N(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),fo=N(`Expand`,[[`path`,{d:`m21 21-6-6m6 6v-4.8m0 4.8h-4.8`,key:`1c15vz`}],[`path`,{d:`M3 16.2V21m0 0h4.8M3 21l6-6`,key:`1fsnz2`}],[`path`,{d:`M21 7.8V3m0 0h-4.8M21 3l-6 6`,key:`hawz9i`}],[`path`,{d:`M3 7.8V3m0 0h4.8M3 3l6 6`,key:`u9ee12`}]]),po=N(`FileArchive`,[[`path`,{d:`M10 12v-1`,key:`v7bkov`}],[`path`,{d:`M10 18v-2`,key:`1cjy8d`}],[`path`,{d:`M10 7V6`,key:`dljcrl`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01`,key:`gkbcor`}],[`circle`,{cx:`10`,cy:`20`,r:`2`,key:`1xzdoj`}]]),mo=N(`FileAudio2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2`,key:`17k7jt`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`3`,cy:`17`,r:`1`,key:`vo6nti`}],[`path`,{d:`M2 17v-3a4 4 0 0 1 8 0v3`,key:`1ggdre`}],[`circle`,{cx:`9`,cy:`17`,r:`1`,key:`bc1fq4`}]]),ho=N(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),go=N(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),_o=N(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),vo=N(`FileSpreadsheet`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),yo=N(`FileVideo2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`rect`,{width:`8`,height:`6`,x:`2`,y:`12`,rx:`1`,key:`1a6c1e`}],[`path`,{d:`m10 15.5 4 2.5v-6l-4 2.5`,key:`t7cp39`}]]),bo=N(`File`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}]]),xo=N(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),So=N(`FolderTree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Co=N(`FolderUp`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]),wo=N(`FolderX`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]),To=N(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Eo=N(`Github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),Do=N(`Grid3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Oo=N(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),ko=N(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Ao=N(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),jo=N(`Laptop`,[[`path`,{d:`M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16`,key:`tarvll`}]]),Mo=N(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),No=N(`ListChecks`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),Po=N(`ListTodo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),Fo=N(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),Io=N(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),Lo=N(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Ro=N(`MessageSquarePlus`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}]]),zo=N(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),Bo=N(`Minimize2`,[[`polyline`,{points:`4 14 10 14 10 20`,key:`11kfnr`}],[`polyline`,{points:`20 10 14 10 14 4`,key:`rlmsce`}],[`line`,{x1:`14`,x2:`21`,y1:`10`,y2:`3`,key:`o5lafz`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),Vo=N(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Ho=N(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),Uo=N(`PanelLeftClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Wo=N(`PanelLeftOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Go=N(`PanelRightClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Ko=N(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),qo=N(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Jo=N(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Yo=N(`Puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Xo=N(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Zo=N(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Qo=N(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),$o=N(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),es=N(`ShieldAlert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),ts=N(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ns=N(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),rs=N(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),is=N(`SquareArrowOutUpRight`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),as=N(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),os=N(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ss=N(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),cs=N(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ls=N(`Unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),us=N(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),ds=N(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),fs=N(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),ps=N(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]);function ms(){return E({queryKey:_s,queryFn:ke,staleTime:5e3,refetchOnWindowFocus:!0})}var F=d();function hs(e){let{label:t,muted:n,value:r}=e;return(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,F.jsx)(`span`,{className:`text-gray-500`,children:t}),(0,F.jsx)(`span`,{className:n?`text-right text-gray-500`:`text-right text-gray-900`,children:r==null||r===``?`-`:String(r)})]})}function gs(){let e=c2(),t=ms(),n=t.data,r=Ts(e=>e.actionLabel),i=(0,P.useMemo)(()=>js(n),[n]),a=!!r,o=n?.runtime?.deviceName?.trim()||n?.settings.deviceName?.trim()||f(`remoteDeviceNameAuto`),s=!!(n?.account.loggedIn&&ws(n)),{hero:c,issueHint:u}=i;return(0,P.useEffect)(()=>{e.remoteAccessManager.syncStatus(n)},[e,n]),t.isLoading&&!n?(0,F.jsx)(`div`,{className:`p-8 text-gray-400`,children:f(`remoteLoading`)}):(0,F.jsxs)(Ue,{className:`space-y-6`,children:[(0,F.jsx)(te,{title:f(`remotePageTitle`),description:f(`remotePageDescription`)}),(0,F.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[1.2fr_0.8fr]`,children:[(0,F.jsxs)(A,{children:[(0,F.jsxs)(T,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsx)(k,{children:c.title}),(0,F.jsx)(wn,{status:c.badgeStatus,label:c.badgeLabel})]}),(0,F.jsx)(S,{children:c.description})]}),(0,F.jsxs)(j,{className:`space-y-5`,children:[(0,F.jsxs)(Xt,{tone:`neutral`,children:[(0,F.jsx)(hs,{label:f(`remoteSignedInAccount`),value:n?.account.email}),(0,F.jsx)(hs,{label:f(`remoteDeviceName`),value:o}),(0,F.jsx)(hs,{label:f(`remoteConnectionStatus`),value:c.badgeLabel}),(0,F.jsx)(hs,{label:f(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?l(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[i.primaryAction?(0,F.jsxs)(w,{onClick:()=>{if(i.primaryAction?.kind===`reauthorize`){e.remoteAccessManager.reauthorizeRemoteAccess(n);return}if(i.primaryAction?.kind===`repair`){e.remoteAccessManager.repairRemoteAccess(n);return}e.remoteAccessManager.enableRemoteAccess(n)},disabled:a,children:[i.primaryAction.showRefreshIcon?(0,F.jsx)(Zo,{className:`mr-2 h-4 w-4`}):null,r||i.primaryAction.label]}):null,(0,F.jsxs)(w,{variant:`outline`,onClick:()=>void e.accountManager.openNextClawWeb(),disabled:a||!s,children:[(0,F.jsx)(is,{className:`mr-2 h-4 w-4`}),f(`remoteOpenDeviceList`)]}),n?.settings.enabled?(0,F.jsx)(w,{variant:`outline`,onClick:()=>void e.remoteAccessManager.disableRemoteAccess(n),disabled:a,children:f(`remoteDisable`)}):null]}),i.shouldShowIssueHint&&u?(0,F.jsx)(Xt,{tone:`warning`,title:u.title,description:u.body}):null,(0,F.jsx)(`p`,{className:`text-xs text-gray-500`,children:f(`remoteOpenWebHint`)})]})]}),(0,F.jsxs)(A,{children:[(0,F.jsxs)(T,{children:[(0,F.jsxs)(k,{className:`flex items-center gap-2`,children:[(0,F.jsx)(jo,{className:`h-4 w-4 text-primary`}),f(`remoteDeviceSectionTitle`)]}),(0,F.jsx)(S,{children:f(`remoteDeviceSectionDescription`)})]}),(0,F.jsxs)(j,{className:`space-y-5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsx)(wn,{status:n?.account.loggedIn?`ready`:`inactive`,label:n?.account.loggedIn?f(`remoteAccountConnected`):f(`remoteAccountNotConnected`)}),(0,F.jsx)(wn,{status:n?.settings.enabled?`active`:`inactive`,label:n?.settings.enabled?f(`remoteEnabled`):f(`remoteStateDisabled`)}),(0,F.jsx)(wn,{status:n?.service.running?`active`:`inactive`,label:n?.service.running?f(`remoteServiceRunning`):f(`remoteServiceStopped`)})]}),(0,F.jsxs)(Xt,{tone:`neutral`,children:[(0,F.jsx)(hs,{label:f(`remoteDeviceName`),value:o}),(0,F.jsx)(hs,{label:f(`remoteConnectionStatus`),value:c.badgeLabel}),(0,F.jsx)(hs,{label:f(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?l(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,F.jsx)(Xt,{tone:`neutral`,borderStyle:`dashed`,description:n?.account.loggedIn?f(`remoteOpenWebHint`):f(`remoteStatusNeedsSignInDescription`),className:`text-sm`})]})]})]})]})}var _s=[`remote-status`],vs=`https://platform.nextclaw.io`,ys=`https://nextclaw-platform-console.pages.dev`,bs=async()=>await se.fetchQuery({queryKey:_s,queryFn:ke,staleTime:5e3}),xs=async()=>(await se.invalidateQueries({queryKey:_s}),await bs()),Ss=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function Cs(e){let t=e?.trim();if(!t)return;let n;try{n=new URL(t)}catch{return}if(n.hostname===`platform.nextclaw.io`||n.hostname===`nextclaw-platform-console.pages.dev`)return n.origin;if(n.hostname===`ai-gateway-api.nextclaw.io`)return vs;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return ys}var ws=e=>Cs(e?.account.apiBase)||Cs(e?.settings.platformApiBase)||Cs(e?.platformBase)||Cs(e?.account.platformBase)||void 0,Ts=p(e=>({enabled:!1,deviceName:``,platformApiBase:``,advancedOpen:!1,draftTouched:!1,actionLabel:null,doctor:null,setEnabled:t=>e({enabled:t,draftTouched:!0}),setDeviceName:t=>e({deviceName:t,draftTouched:!0}),setPlatformApiBase:t=>e({platformApiBase:t,draftTouched:!0}),setAdvancedOpen:t=>e({advancedOpen:t}),hydrateDraft:({enabled:t,deviceName:n,platformApiBase:r})=>e({enabled:t,deviceName:n,platformApiBase:r,draftTouched:!1}),beginAction:t=>e({actionLabel:t}),finishAction:()=>e({actionLabel:null}),setDoctor:t=>e({doctor:t})})),Es=class{constructor(e){this.params=e,this.syncStatus=e=>{if(!e)return;let t=Ts.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{Ts.getState().setEnabled(e)},this.setDeviceName=e=>{Ts.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{Ts.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{Ts.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await xs(),n=Ts.getState(),r=await this.ensureRemoteAccount(t,n.platformApiBase);await this.applyEnabledState(!0,r)},this.disableRemoteAccess=async e=>{let t=e??await xs();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await xs(),n=(await this.ensureRemoteAccount(t)).service.running?`restart`:`start`;await this.runManagedAction({actionLabel:f(n===`restart`?`remoteActionRestarting`:`remoteActionStarting`),job:async()=>{await Se(n);let e=await xs();this.hydrateDraftFromStatus(e)},successMessage:f(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await xs(),n=await this.params.accountManager.startBrowserSignInAndWait({status:t,apiBase:Ts.getState().platformApiBase});await this.repairRemoteAccess(n)},this.saveAdvancedSettings=async e=>{let t=e??await xs(),n=Ts.getState();await this.runManagedAction({actionLabel:f(`remoteActionSavingAdvanced`),job:async()=>{await _e({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await xs();this.hydrateDraftFromStatus(e)},successMessage:t.settings.enabled===n.enabled?f(`remoteSettingsSaved`):f(`remoteAdvancedSaved`)})},this.runDoctor=async()=>{await this.runManagedAction({actionLabel:f(`remoteDoctorRunning`),job:async()=>{let e=await fe();Ts.getState().setDoctor(e)},successMessage:f(`remoteDoctorCompleted`)})},this.startService=async()=>{await this.runServiceAction(`start`,f(`remoteActionStarting`))},this.restartService=async()=>{await this.runServiceAction(`restart`,f(`remoteActionRestarting`))},this.stopService=async()=>{await this.runServiceAction(`stop`,f(`remoteActionStopping`))},this.applyEnabledState=async(e,t)=>{let n=Ts.getState();await this.runManagedAction({actionLabel:f(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await _e({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await xs();this.hydrateDraftFromStatus(r),e?await Se(r.service.running?`restart`:`start`):t.service.running&&await Se(`restart`);let i=await xs();this.hydrateDraftFromStatus(i)},successMessage:f(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.ensureRemoteAccount=async(e,t)=>e.account.loggedIn?e:await this.params.accountManager.ensureSignedIn({apiBase:t,status:e}),this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await Se(e),n=await xs();this.hydrateDraftFromStatus(n),D.success(t.message)}})},this.hydrateDraftFromStatus=e=>{Ts.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{let{actionLabel:t,job:n,successMessage:r}=e;Ts.getState().beginAction(t);try{await n(),r&&D.success(r)}catch(e){let t=e instanceof Error?e.message:f(`error`);throw D.error(t),e}finally{Ts.getState().finishAction()}}}},Ds=[/invalid or expired token/i,/missing bearer token/i,/token expired/i,/token is invalid/i,/run "nextclaw login"/i,/browser sign-in again/i];function Os(e){return e?.runtime?.lastError?.trim()||``}function ks(e){let t=f(`remoteStatusIssueDetailGeneric`),n=Os(e);return n?`${t} (${n})`:t}function As(e){if(!e?.settings.enabled)return!1;let t=Os(e);return Ds.some(e=>e.test(t))}function js(e){return As(e)?{hero:{badgeStatus:`warning`,badgeLabel:f(`remoteStateReauthorizationRequired`),title:f(`remoteStatusReauthorizationTitle`),description:f(`remoteStatusReauthorizationDescription`)},primaryAction:{kind:`reauthorize`,label:f(`remoteReauthorizeNow`),showRefreshIcon:!1},issueHint:{title:f(`remoteStatusRecoveryTitle`),body:f(`remoteStatusReauthorizationHint`)},shouldShowIssueHint:!0,requiresReauthorization:!0}:e?.account.loggedIn?e.settings.enabled?e.service.running?e.runtime?.state===`connected`?{hero:{badgeStatus:`ready`,badgeLabel:f(`statusReady`),title:f(`remoteStatusReadyTitle`),description:f(`remoteStatusReadyDescription`)},primaryAction:{kind:`repair`,label:f(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:e.runtime?.state===`connecting`?{hero:{badgeStatus:`active`,badgeLabel:f(`connecting`),title:f(`remoteStatusConnectingTitle`),description:f(`remoteStatusConnectingDescription`)},primaryAction:{kind:`repair`,label:f(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:f(`remoteStateDisconnected`),title:f(`remoteStatusIssueTitle`),description:f(`remoteStatusIssueDescription`)},primaryAction:{kind:`repair`,label:f(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:f(`remoteStatusRecoveryTitle`),body:ks(e)},shouldShowIssueHint:!!(e.settings.enabled&&e.account.loggedIn),requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:f(`remoteServiceStopped`),title:f(`remoteStatusNeedsServiceTitle`),description:f(`remoteStatusNeedsServiceDescription`)},primaryAction:{kind:`repair`,label:f(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:f(`remoteStatusRecoveryTitle`),body:f(`remoteStatusIssueDetailServiceStopped`)},shouldShowIssueHint:!0,requiresReauthorization:!1}:{hero:{badgeStatus:`inactive`,badgeLabel:f(`statusInactive`),title:f(`remoteStatusNeedsEnable`),description:f(`remoteStatusNeedsEnableDescription`)},primaryAction:{kind:`enable`,label:f(`remoteEnableNow`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`setup`,badgeLabel:f(`statusSetup`),title:f(`remoteStatusNeedsSignIn`),description:f(`remoteStatusNeedsSignInDescription`)},primaryAction:{kind:`sign-in-enable`,label:f(`remoteSignInAndEnable`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}}var Ms=p(e=>({panelOpen:!1,authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500,openPanel:()=>e({panelOpen:!0}),closePanel:()=>e({panelOpen:!1}),beginBrowserAuth:({sessionId:t,verificationUri:n,expiresAt:r,intervalMs:i,statusMessage:a})=>e({panelOpen:!0,authSessionId:t,authVerificationUri:n,authExpiresAt:r,authPollIntervalMs:i,authStatusMessage:a}),updateBrowserAuth:({statusMessage:t,intervalMs:n})=>e(e=>({authStatusMessage:t??e.authStatusMessage,authPollIntervalMs:n??e.authPollIntervalMs})),clearBrowserAuth:()=>e({authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500}),setAuthStatusMessage:t=>e({authStatusMessage:t})}));function Ns({label:e,value:t}){return(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,F.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,F.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function Ps(e){let{email:t,username:n,role:r,canSubmitUsername:i,savingUsername:a,usernameDraft:o,onUsernameDraftChange:s,onSubmitUsername:c,onOpenDeviceList:l,onLogout:u}=e;return(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsx)(Xt,{tone:`success`,title:f(`accountPanelSignedInTitle`),description:f(`accountPanelSignedInDescription`)}),(0,F.jsxs)(Xt,{tone:`neutral`,children:[(0,F.jsx)(Ns,{label:f(`remoteAccountEmail`),value:t}),(0,F.jsx)(Ns,{label:f(`remoteAccountUsername`),value:n}),(0,F.jsx)(Ns,{label:f(`remoteAccountRole`),value:r})]}),n?(0,F.jsx)(`p`,{className:`text-xs text-gray-500`,children:f(`remoteAccountUsernameLockedHelp`)}):(0,F.jsxs)(Xt,{tone:`warning`,title:f(`remoteAccountUsernameRequiredTitle`),description:f(`remoteAccountUsernameRequiredDescription`),children:[(0,F.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,F.jsx)(v,{htmlFor:`account-panel-username`,children:f(`remoteAccountUsername`)}),(0,F.jsx)(ae,{id:`account-panel-username`,value:o,onChange:e=>s(e.target.value),placeholder:f(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,F.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,F.jsx)(w,{disabled:!i,onClick:()=>void c(),children:f(a?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,F.jsxs)(w,{onClick:()=>void l(),children:[(0,F.jsx)(is,{className:`mr-2 h-4 w-4`}),f(`remoteOpenDeviceList`)]}),(0,F.jsxs)(w,{variant:`outline`,onClick:()=>void u(),children:[(0,F.jsx)(Fo,{className:`mr-2 h-4 w-4`}),f(`remoteLogout`)]})]})]})}function Fs(e){let{authSessionId:t,authExpiresAt:n,authStatusMessage:r,authVerificationUri:i,onStartBrowserSignIn:a,onResumeBrowserSignIn:o}=e;return(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsx)(Xt,{tone:`neutral`,title:f(`accountPanelSignedOutTitle`),description:f(`accountPanelSignedOutDescription`),children:t?(0,F.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,F.jsx)(Ns,{label:f(`remoteBrowserAuthSession`),value:t}),(0,F.jsx)(Ns,{label:f(`remoteBrowserAuthExpiresAt`),value:n?l(n):`-`})]}):null}),r?(0,F.jsx)(`p`,{className:`text-sm text-gray-600`,children:r}):null,(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,F.jsx)(w,{onClick:()=>void a(),children:f(t?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),i?(0,F.jsx)(w,{variant:`outline`,onClick:()=>void o(),children:f(`remoteBrowserAuthResume`)}):null]})]})}function Is(){let e=r2(),t=ms(),n=Ms(e=>e.panelOpen),r=Ms(e=>e.authSessionId),i=Ms(e=>e.authVerificationUri),a=Ms(e=>e.authExpiresAt),o=Ms(e=>e.authStatusMessage),s=t.data,[c,l]=(0,P.useState)(``),[u,d]=(0,P.useState)(!1);(0,P.useEffect)(()=>{e.accountManager.syncRemoteStatus(s)},[e,s]);let p=!u&&c.trim().length>0&&!s?.account.username;return(0,F.jsx)(tt,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,F.jsxs)(rt,{className:`max-w-xl`,children:[(0,F.jsxs)(nt,{children:[(0,F.jsxs)(it,{className:`flex items-center gap-2`,children:[(0,F.jsx)(pn,{className:`h-5 w-5 text-primary`}),f(`accountPanelTitle`)]}),(0,F.jsx)(et,{children:f(`accountPanelDescription`)})]}),s?.account.loggedIn?(0,F.jsx)(Ps,{email:s.account.email,username:s.account.username,role:s.account.role,canSubmitUsername:p,savingUsername:u,usernameDraft:c,onUsernameDraftChange:l,onSubmitUsername:async()=>{d(!0);try{await e.accountManager.updateUsername(c)}finally{d(!1)}},onOpenDeviceList:()=>e.accountManager.openNextClawWeb(`/account`),onLogout:()=>e.accountManager.logout()}):(0,F.jsx)(Fs,{authSessionId:r,authExpiresAt:a,authStatusMessage:o,authVerificationUri:i,onStartBrowserSignIn:()=>e.accountManager.startBrowserSignIn(),onResumeBrowserSignIn:()=>e.accountManager.resumeBrowserSignIn()})]})})}function Ls({username:e}){let t=de(),[n,r]=(0,P.useState)(e??``),[i,a]=(0,P.useState)(``),o=n.trim().length>0&&i.length>0&&!t.isPending;return(0,F.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,F.jsxs)(A,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,F.jsxs)(T,{children:[(0,F.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:f(`authBrand`)}),(0,F.jsx)(k,{className:`text-2xl`,children:f(`authLoginTitle`)}),(0,F.jsx)(S,{children:f(`authLoginDescription`)})]}),(0,F.jsx)(j,{children:(0,F.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),o&&t.mutate({username:n.trim(),password:i})},children:[(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:f(`authUsername`)}),(0,F.jsx)(ae,{value:n,onChange:e=>r(e.target.value),placeholder:f(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:f(`authPassword`)}),(0,F.jsx)(ae,{type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:f(`authPasswordPlaceholder`)})]}),(0,F.jsx)(w,{type:`submit`,className:`w-full`,disabled:!o,children:t.isPending?f(`authLoggingIn`):f(`authLoginAction`)})]})})]})})}var Rs=class{constructor(){this.authPollTimerId=null,this.browserSignInCompletion=null,this.openAccountPanel=()=>{Ms.getState().openPanel()},this.closeAccountPanel=()=>{Ms.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),this.resolveBrowserSignIn(e),Ms.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=e?.status??await bs();return t.account.loggedIn?t:(this.openAccountPanel(),await this.startBrowserSignInAndWait({apiBase:e?.apiBase,status:t}))},this.startBrowserSignInAndWait=async e=>{let t=this.createBrowserSignInCompletion();return await this.startBrowserSignIn(e),await t},this.startBrowserSignIn=async e=>{try{let t=e?.apiBase,n=await Te({apiBase:Ss(e?.status??await bs(),t)});Ms.getState().beginBrowserAuth({sessionId:n.sessionId,verificationUri:n.verificationUri,expiresAt:n.expiresAt,intervalMs:n.intervalMs,statusMessage:f(`remoteBrowserAuthWaiting`)}),(await En.openExternalUrl(n.verificationUri)).opened||Ms.getState().setAuthStatusMessage(f(`remoteBrowserAuthPopupBlocked`)),this.scheduleBrowserAuthPoll()}catch(e){let t=e instanceof Error?e.message:f(`remoteBrowserAuthStartFailed`);this.rejectBrowserSignIn(e),D.error(`${f(`remoteBrowserAuthStartFailed`)}: ${t}`)}},this.resumeBrowserSignIn=async()=>{let e=Ms.getState().authVerificationUri;e&&await En.openExternalUrl(e)},this.logout=async()=>{try{await Pe(),this.rejectBrowserSignIn(Error(`Signed out before browser sign-in completed.`)),Ms.getState().clearBrowserAuth(),await xs(),D.success(f(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:f(`remoteLogoutFailed`);D.error(`${f(`remoteLogoutFailed`)}: ${t}`)}},this.updateUsername=async e=>{try{await Ie({username:e.trim()}),await xs(),D.success(f(`remoteAccountUsernameSetSuccess`))}catch(e){let t=e instanceof Error?e.message:f(`remoteAccountUsernameSetFailed`);D.error(`${f(`remoteAccountUsernameSetFailed`)}: ${t}`)}},this.openNextClawWeb=async(e=`/`)=>{let t=ws(await bs());if(!t){D.error(f(`remoteOpenWebUnavailable`));return}let n=new URL(e,`${t.replace(/\/+$/,``)}/`).toString();await En.openExternalUrl(n)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=Ms.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=Ms.getState();if(e.authSessionId)try{let t=await bs(),n=await ge({sessionId:e.authSessionId,apiBase:Ss(t)});if(n.status===`pending`){Ms.getState().updateBrowserAuth({statusMessage:f(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),this.rejectBrowserSignIn(Error(n.message||f(`remoteBrowserAuthExpired`))),Ms.getState().clearBrowserAuth(),D.error(n.message||f(`remoteBrowserAuthExpired`));return}Ms.getState().setAuthStatusMessage(f(`remoteBrowserAuthCompleted`));let r=await xs();this.clearPollTimer(),this.resolveBrowserSignIn(r),Ms.getState().clearBrowserAuth(),D.success(f(`remoteLoginSuccess`))}catch(e){this.clearPollTimer(),this.rejectBrowserSignIn(e),Ms.getState().clearBrowserAuth();let t=e instanceof Error?e.message:f(`remoteBrowserAuthPollFailed`);D.error(`${f(`remoteBrowserAuthPollFailed`)}: ${t}`)}},this.clearPollTimer=()=>{this.authPollTimerId!==null&&(window.clearTimeout(this.authPollTimerId),this.authPollTimerId=null)},this.createBrowserSignInCompletion=()=>(this.rejectBrowserSignIn(Error(`Browser sign-in was replaced by a newer request.`)),new Promise((e,t)=>{this.browserSignInCompletion={resolve:e,reject:t}})),this.resolveBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.resolve(e))},this.rejectBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.reject(e instanceof Error?e:Error(String(e))))},this.getBrowserAuthSummary=()=>{let e=Ms.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?l(e.authExpiresAt):`-`}}}};function zs({parentSessionLabel:e,onGoToParentSession:t}){if(!e)return null;let n=e.trim();return(0,F.jsx)(`div`,{className:`bg-background/75 px-4 py-2 backdrop-blur-sm sm:px-5`,children:(0,F.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:[(0,F.jsx)(ot,{className:`h-3.5 w-3.5`}),(0,F.jsxs)(`span`,{children:[f(`chatBackToParent`),n?` · ${n}`:``]})]})})}function Bs({layoutMode:e,actions:t,leading:n,onBackToList:r,projectBadge:i,sessionTypeBadge:a,shouldShow:o,title:s,titleContent:c}){let l=e===`mobile`;return(0,F.jsxs)(`div`,{"data-testid":`chat-conversation-header`,className:m(`bg-background/80 backdrop-blur-sm flex items-center justify-between shrink-0 overflow-hidden transition-colors duration-200`,l?`px-3 sm:px-3`:`px-4 sm:px-5`,o?`opacity-100`:`h-0 py-0 opacity-0`,o&&(l?`min-h-12 pb-2 pt-2`:`h-[52px]`)),style:l&&o?{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.5rem)`}:void 0,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-center gap-2`,children:[l&&r?(0,F.jsx)(ht,{icon:(0,F.jsx)(ot,{className:`h-4 w-4`}),label:f(`chat`),onClick:r,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`}):null,n,c??(0,F.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:s}),a,i]}),t]})}function Vs(){let e=pe();return async t=>{let{sessionKey:n,patch:r,successMessage:i}=t;try{De(e,await M(n,r)),await e.invalidateQueries({queryKey:[`ncp-session-skills`,n]}),D.success(i??f(`configSavedApplied`))}catch(e){throw D.error(f(`configSaveFailed`)+`: `+(e instanceof Error?e.message:String(e))),e}}}function Hs(){let e=Vs();return async t=>{await e({sessionKey:t.sessionKey,patch:{label:t.label},successMessage:f(`configSavedApplied`)})}}function Us(){let e=Vs();return async t=>{let{persistToServer:n,projectRoot:r,sessionKey:i}=t,a=f(r?`chatSessionProjectUpdated`:`chatSessionProjectCleared`);if(!n){D.success(a);return}await e({sessionKey:i,patch:{projectRoot:r},successMessage:a})}}function Ws({icon:e,label:t,onClick:n,disabled:r=!1,destructive:i=!1}){return(0,F.jsxs)(`button`,{type:`button`,className:m(`flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,i?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`),onClick:n,disabled:r,children:[(0,F.jsx)(e,{className:`h-4 w-4 shrink-0`}),(0,F.jsx)(`span`,{children:t})]})}function Gs(e){try{return JSON.stringify(e??{},null,2)}catch{return`{}`}}function Ks({open:e,metadata:t,onOpenChange:n}){return(0,F.jsx)(tt,{open:e,onOpenChange:n,children:(0,F.jsxs)(rt,{className:`max-w-2xl gap-0 overflow-hidden p-0`,children:[(0,F.jsxs)(nt,{className:`border-b border-border px-5 py-4 pr-12`,children:[(0,F.jsx)(it,{className:`text-base`,children:f(`chatSessionMetadataDialogTitle`)}),(0,F.jsx)(et,{className:`sr-only`,children:f(`chatSessionMetadataDialogDescription`)})]}),(0,F.jsx)(`div`,{className:`px-5 pb-5 pt-4`,children:(0,F.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border bg-muted/60 p-4 font-mono text-xs leading-6 text-foreground shadow-inner custom-scrollbar`,children:Gs(t)})})]})})}function qs(e){return[`server-path-browse`,e.path?.trim()??``,e.basePath?.trim()??``,e.includeFiles??!1]}function Js(e){let{basePath:t,enabled:n,includeFiles:r,path:i}=e,a=i?.trim()??``,o=t?.trim()??``;return E({queryKey:qs({path:a,basePath:o,includeFiles:r}),queryFn:()=>Oe({path:a,basePath:o,includeFiles:r}),enabled:n??!0,staleTime:0})}var Ys=P.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsx)(`div`,{ref:r,className:m(`overflow-auto`,e),...n,children:t}));Ys.displayName=`ScrollArea`;function Xs({open:e,currentPath:t,isSaving:n,onOpenChange:r,onConfirm:i,title:a,description:o,pathLabel:s,pathPlaceholder:c,confirmLabel:l,hint:u}){let[d,p]=(0,P.useState)(``),[m,h]=(0,P.useState)(null),[g,_]=(0,P.useState)(``);(0,P.useEffect)(()=>{if(!e)return;let n=t?.trim()||null;p(n??``),h(n),_(``)},[t,e]);let y=Js({path:m,enabled:e});(0,P.useEffect)(()=>{!e||!y.data||d.trim().length===0&&p(y.data.currentPath)},[y.data,d,e]);let b=d.trim(),x=b.length===0||n,S=(0,P.useMemo)(()=>y.error?y.error instanceof Error?y.error.message:String(y.error):null,[y.error]),C=g.trim().toLowerCase(),T=(0,P.useMemo)(()=>{let e=y.data?.entries??[];return C.length===0?e:e.filter(e=>{let t=e.name.toLowerCase(),n=e.path.toLowerCase();return t.includes(C)||n.includes(C)})},[y.data?.entries,C]),E=e=>{h(e),_(``),e&&p(e)};return(0,F.jsx)(tt,{open:e,onOpenChange:e=>{n||r(e)},children:(0,F.jsxs)(rt,{className:`max-h-[85vh] overflow-hidden sm:h-[42rem] sm:max-w-2xl sm:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,F.jsxs)(nt,{children:[(0,F.jsx)(it,{children:a}),o?(0,F.jsx)(et,{children:o}):null]}),(0,F.jsxs)(`form`,{className:`flex min-h-0 flex-col gap-4`,onSubmit:e=>{e.preventDefault(),!x&&i(b)},children:[(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(v,{htmlFor:`server-path-picker-input`,children:s}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(ae,{id:`server-path-picker-input`,value:d,onChange:e=>p(e.target.value),placeholder:c,autoFocus:!0,disabled:n}),(0,F.jsx)(w,{type:`button`,variant:`outline`,onClick:()=>E(b||null),disabled:n,children:f(`openPath`)})]})]}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border border-gray-200 bg-gray-50/70`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-gray-200 px-3 py-2`,children:[(0,F.jsxs)(w,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>E(y.data?.homePath??null),disabled:n||y.isLoading,children:[(0,F.jsx)(Oo,{className:`mr-1 h-4 w-4`}),f(`homeDirectory`)]}),(0,F.jsxs)(w,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>E(y.data?.parentPath??null),disabled:!y.data?.parentPath||n||y.isLoading,children:[(0,F.jsx)(Co,{className:`mr-1 h-4 w-4`}),f(`parentDirectory`)]}),(0,F.jsxs)(w,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{y.refetch()},disabled:n||y.isLoading,children:[(0,F.jsx)(Zo,{className:`mr-1 h-4 w-4`}),f(`chatRefresh`)]})]}),(0,F.jsxs)(`div`,{className:`border-b border-gray-200 px-3 py-2`,children:[(0,F.jsx)(`div`,{className:`mb-2 text-xs font-medium text-gray-500`,children:f(`currentDirectory`)}),(0,F.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 text-xs text-gray-600`,children:y.data?.breadcrumbs.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`button`,{type:`button`,className:`rounded px-1.5 py-0.5 hover:bg-gray-200`,onClick:()=>E(e.path),disabled:n,children:e.label}),t<y.data.breadcrumbs.length-1?(0,F.jsx)(eo,{className:`h-3 w-3 text-gray-400`}):null]},e.path))})]}),(0,F.jsx)(`div`,{className:`border-b border-gray-200 px-3 py-2`,children:(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(st,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,F.jsx)(ae,{value:g,onChange:e=>_(e.target.value),placeholder:f(`pathPickerSearchPlaceholder`),disabled:n||y.isLoading,className:`pl-9`})]})}),(0,F.jsx)(Ys,{className:`min-h-0 flex-1 px-2 py-2`,children:y.isLoading?(0,F.jsx)(`div`,{className:`px-2 py-6 text-sm text-gray-500`,children:f(`loading`)}):S?(0,F.jsxs)(`div`,{className:`px-2 py-4 text-sm text-destructive`,children:[f(`pathBrowseFailed`),`: `,S]}):y.data&&T.length>0?(0,F.jsx)(`div`,{className:`space-y-1`,children:T.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm text-gray-700 transition-colors hover:bg-white`,onClick:()=>E(e.path),disabled:n,children:[(0,F.jsx)(an,{className:`h-4 w-4 shrink-0 text-emerald-600`}),(0,F.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path))}):y.data&&y.data.entries.length>0?(0,F.jsx)(`div`,{className:`px-2 py-6 text-sm text-gray-500`,children:f(`pathPickerSearchEmpty`)}):(0,F.jsx)(`div`,{className:`px-2 py-6 text-sm text-gray-500`,children:f(`emptyDirectory`)})})]}),u?(0,F.jsx)(`p`,{className:`text-xs leading-relaxed text-gray-500`,children:u}):null,(0,F.jsxs)($e,{children:[(0,F.jsx)(w,{type:`button`,variant:`outline`,onClick:()=>r(!1),disabled:n,children:f(`cancel`)}),(0,F.jsx)(w,{type:`submit`,disabled:x,children:n?f(`saving`):l})]})]})]})})}function Zs({open:e,currentProjectRoot:t,isSaving:n,onOpenChange:r,onSave:i}){return(0,F.jsx)(Xs,{open:e,currentPath:t,isSaving:n,onOpenChange:r,onConfirm:i,title:f(`chatSessionProjectDialogTitle`),description:f(`chatSessionProjectDialogDescription`),pathLabel:f(`chatSessionProjectPathLabel`),pathPlaceholder:f(`chatSessionProjectPathPlaceholder`),confirmLabel:f(`chatSessionSetProject`),hint:f(`chatSessionProjectUpdateHint`)})}var Qs=`flex shrink-0 items-center gap-1.5`;function $s({sessionKey:e,canDeleteSession:t,isDeletePending:n,projectRoot:r,metadata:i,isWorkspaceOpen:a,onToggleWorkspace:o,onDeleteSession:s}){let c=Us(),[l,u]=(0,P.useState)(!1),[d,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(!1),v=n||g,y=async n=>{let r=t;_(!0);try{await c({sessionKey:e,projectRoot:n,persistToServer:r}),p(!1),u(!1)}finally{_(!1)}};return(0,F.jsxs)(`div`,{className:Qs,children:[(0,F.jsxs)(Ze,{open:l,onOpenChange:u,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(ht,{icon:(0,F.jsx)(pt,{className:`h-4 w-4`}),label:f(`chatSessionMoreActions`),tooltip:!1,disabled:v})}),(0,F.jsx)(Ye,{align:`end`,className:`w-56 p-2`,children:(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(Ws,{icon:xo,label:f(`chatSessionSetProject`),onClick:()=>{u(!1),p(!0)},disabled:v}),(0,F.jsx)(Ws,{icon:Xa,label:f(`chatSessionViewMetadata`),onClick:()=>{u(!1),h(!0)},disabled:v}),(0,F.jsx)(Ws,{icon:Sn,label:f(`chatDeleteSession`),onClick:()=>{u(!1),s()},disabled:!t||v,destructive:!0})]})})]}),(0,F.jsx)(ht,{icon:a?(0,F.jsx)(Go,{className:`h-4 w-4`}):(0,F.jsx)(mt,{className:`h-4 w-4`}),label:f(a?`chatSessionCloseWorkspace`:`chatSessionOpenWorkspace`),"aria-pressed":a,onClick:o,disabled:v}),(0,F.jsx)(Zs,{open:d,currentProjectRoot:r,isSaving:g,onOpenChange:p,onSave:y}),(0,F.jsx)(Ks,{open:m,metadata:i,onOpenChange:h})]})}var ec={maxHeight:We(`18rem`)};function tc({sessionKey:e,projectName:t,projectRoot:n,persistToServer:r}){let i=Us(),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(!1),d=async t=>{u(!0);try{await i({sessionKey:e,projectRoot:t,persistToServer:r}),c(!1),o(!1)}finally{u(!1)}};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Ze,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,title:n??void 0,className:`min-w-0 max-w-[320px] shrink rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:border-primary/35 hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":f(`chatSessionSetProject`),disabled:l,children:(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,F.jsx)(xo,{className:`h-3.5 w-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:t}),(0,F.jsx)(Et,{className:`h-3 w-3 shrink-0 opacity-70`})]})})}),(0,F.jsxs)(Ye,{align:`start`,className:`w-72 p-2`,style:ec,children:[(0,F.jsxs)(`div`,{className:`px-3 pb-2 pt-1`,children:[(0,F.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:t}),n?(0,F.jsx)(`div`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:n}):null]}),(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(Ws,{icon:qo,label:f(`chatSessionSetProject`),onClick:()=>{o(!1),c(!0)},disabled:l}),(0,F.jsx)(Ws,{icon:wo,label:f(`chatSessionClearProject`),onClick:()=>{d(null)},disabled:l})]})]})]}),(0,F.jsx)(Zs,{open:s,currentProjectRoot:n,isSaving:l,onOpenChange:c,onSave:d})]})}var nc=(0,P.createContext)(null);function rc({presenter:e,children:t}){return(0,F.jsx)(nc.Provider,{value:e,children:t})}function ic(){let e=(0,P.useContext)(nc);if(!e)throw Error(`usePresenter must be used inside ChatPresenterProvider`);return e}function ac(e){let t=e.label?.trim();if(t)return t;let n=e.key.split(`:`);return n[n.length-1]||e.key}function oc(e){let t=e.activityPreview;return!t||t.state===`cancelled`?null:t.state===`failed`||t.state===`running`?t.statusText??t.replyText??null:t.state===`completed`?t.replyText??t.statusText??null:t.statusText??t.replyText??null}function sc(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function cc(e,t){return e.getFullYear()===t.getFullYear()}function lc(e,t){let n=`${e.getMonth()+1}月${e.getDate()}日`;return cc(e,t)?n:`${e.getFullYear()}年${n}`}function uc(e,t=r(),n=new Date){if(!e)return`-`;let i=e instanceof Date?e:new Date(e);if(Number.isNaN(i.getTime()))return typeof e==`string`?e:`-`;let a=u(t),o=sc(i),s=sc(n),c=Math.floor((s-o)/864e5);if(c===0)return new Intl.DateTimeFormat(a,{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(i);if(c===1)return f(`chatSidebarYesterday`,t);if(c>1&&c<7)return new Intl.DateTimeFormat(a,{weekday:`long`}).format(i);if(t===`zh`)return lc(i,n);let l=cc(i,n)?{month:`numeric`,day:`numeric`}:{year:`numeric`,month:`numeric`,day:`numeric`};return new Intl.DateTimeFormat(a,l).format(i)}function dc(e){return e.trim().toLowerCase()}function fc(e,t){let n=dc(t);return n?[e.key,ac(e),e.projectRoot??``,e.projectName??``].map(dc).some(e=>e.includes(n)):!0}var pc=function(e){return e.CALL=`call`,e.RESULT=`result`,e.PARTIAL_CALL=`partial-call`,e.ERROR=`error`,e.CANCELLED=`cancelled`,e}({});function mc(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function hc(e){return mc(e)}function gc(e){let t=mc(e);if(!t)return null;let n=t.replace(/[\\/]+$/,``);if(!n)return t;let r=n.split(/[\\/]/).filter(Boolean);return r[r.length-1]??n}function _c(e){return/^[A-Za-z]:[\\/]?$/.test(e)||e===`/`?e:e.replace(/[\\/]+$/,``)}function vc(e){let t=_c(e.trim().replace(/\\/g,`/`));return/^[A-Za-z]:/.test(t)?`${t.slice(0,1).toLowerCase()}${t.slice(1)}`:t}function yc(e,t){if(!e)return t.join(`/`);let n=_c(e.trim().replace(/\\/g,`/`));return t.length===0?n:n===`/`?`/${t.join(`/`)}`:`${n}/${t.join(`/`)}`}function bc(e){let t=_c(e.trim().replace(/\\/g,`/`));if(!t||t===`/`||/^[A-Za-z]:[\\/]?$/.test(t))return null;let n=t.lastIndexOf(`/`);if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}/`:r}function xc(e){let t=e.trim().replace(/\\/g,`/`);return t?/^[A-Za-z]:\//.test(t)?{prefix:t.slice(0,2),segments:t.slice(3).split(`/`).filter(Boolean)}:t.startsWith(`/`)?{prefix:`/`,segments:t.slice(1).split(`/`).filter(Boolean)}:{prefix:null,segments:t.split(`/`).filter(Boolean)}:{prefix:null,segments:[]}}function Sc(e){let t=vc(e.path),n=vc(e.sessionProjectRoot);if(!t||!n)return null;if(!t.startsWith(`/`)&&!/^[A-Za-z]:\//.test(t))return t.split(`/`).filter(Boolean);if(t===n)return[];let r=n.endsWith(`/`)?n:`${n}/`;return t.startsWith(r)?t.slice(r.length).split(`/`).filter(Boolean):null}function Cc(e){let{basePath:t=null,currentKind:n=`file`,labels:r,leading:i=null}=e,a=r.map((e,i)=>{let a=i===r.length-1?n:`directory`,o=yc(t,r.slice(0,i+1));return{key:`${i}:${e}`,label:e,kind:a,path:o,browsePath:a===`file`?bc(o):o,isCurrent:i===r.length-1}});return i?[i,...a]:a}function wc(e){let{kind:t=`file`,path:n,sessionProjectRoot:r,truncated:i}=e,a=n.trim(),o=r?.trim()&&a?Sc({path:a,sessionProjectRoot:r}):null,s;if(r?.trim()&&o){let e=r.trim(),n=gc(e)??e;s=Cc({labels:o,basePath:e,currentKind:t,leading:{key:`workspace:${n}`,label:n,kind:`workspace`,path:e,browsePath:e,isCurrent:o.length===0}})}else{let{prefix:e,segments:n}=xc(a),r=e===`/`?`/`:e?`${e}/`:null;s=Cc({labels:n,basePath:r,currentKind:t,leading:e?{key:`root:${e}`,label:e,kind:`root`,path:r??e,browsePath:r??e,isCurrent:n.length===0}:null})}return s.length===0&&(s=[{key:`file:unknown`,label:a||`file`,kind:t,path:a,browsePath:t===`directory`?a:bc(a),isCurrent:!0}]),{fullPath:a,truncated:i,segments:s}}var Tc=new Set([`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`]),Ec=new Set([`running`,`completed`,`failed`,`cancelled`,`idle`]);function Dc(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??{})}catch{return String(e??``)}}function Oc(e){return`${x}/api/ncp/assets/content?${new URLSearchParams({uri:e}).toString()}`}function kc(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Ac(e){let{metadata:t}=e;return!t||typeof t!=`object`||Array.isArray(t)?null:t}function jc(e){let t=Ac(e)?.last_activity_preview;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,{state:r}=n,i=kc(n.timestamp);if(!Ec.has(r)||!i)return null;let a=kc(n.statusText),o=kc(n.replyText);return{state:r,timestamp:i,...a?{statusText:a}:{},...o?{replyText:o}:{}}}function Mc(e){let t=Ac(e);return t?kc(t.preferred_model)??kc(t.preferredModel)??kc(t.model):null}function Nc(e){let t=Ac(e);if(!t)return null;let n=kc(t.preferred_thinking)??kc(t.thinking)??kc(t.thinking_level)??kc(t.thinkingLevel);if(!n)return null;let r=n.toLowerCase();return Tc.has(r)?r:null}function Pc(e){let t=Ac(e);return t?kc(t.label):null}function Fc(e){let t=Ac(e);return t?hc(t.project_root??t.projectRoot):null}function Ic(e){return kc(e.workingDir)}function Lc(e){let t=Ac(e);return t?kc(t.ui_last_read_at):null}function Rc(e){let t=Ac(e);return t?kc(t.runtime)??kc(t.session_type)??kc(t.sessionType)??`native`:`native`}function zc(e){let t=Ac(e);return t?kc(t.parent_session_id)??kc(t.parentSessionId):null}function Bc(e){let t=Ac(e);return t?kc(t.spawned_by_request_id)??kc(t.spawnedByRequestId):null}function Vc(e){let t=Ac(e);return t?t.child_session_promoted===!0:!1}function Hc(e){if(e.startsWith(`cron:`))return{type:`cron`};if(e.startsWith(`agent:`)){let t=e.split(`:`);if(t.length>=3){let e=t[2];if(e&&e!==`main`&&e!==`direct`)return{channel:e}}}return{}}function Uc(e){return e.state===`cancelled`?pc.CANCELLED:e.state===`result`?pc.RESULT:e.state===`partial-call`?pc.PARTIAL_CALL:pc.CALL}function Wc(e){let t=[];for(let n of e){if(n.type===`text`){t.push({type:`text`,text:n.text});continue}if(n.type===`rich-text`){t.push({type:`text`,text:n.text});continue}if(n.type===`reasoning`){t.push({type:`reasoning`,reasoning:n.text,details:[]});continue}if(n.type===`source`){t.push({type:`source`,source:{sourceType:`url`,id:n.url??n.title??Math.random().toString(36).slice(2,8),url:n.url??``,...n.title?{title:n.title}:{}}});continue}if(n.type===`file`&&n.contentBase64){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:n.contentBase64,...n.url?{url:n.url}:{},...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.url){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:n.url,...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.assetUri){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:Oc(n.assetUri),...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`step-start`){t.push({type:`step-start`});continue}n.type===`tool-invocation`&&t.push({type:`tool-invocation`,toolInvocation:{status:Uc(n),toolCallId:n.toolCallId??`${n.toolName}-${Math.random().toString(36).slice(2,8)}`,toolName:n.toolName,args:Dc(n.args),result:n.result}})}return t}function Gc(e){return e===`service`?`system`:e===`tool`?`assistant`:e}function Kc(e){return{id:e.id,role:Gc(e.role),parts:Wc(e.parts),meta:{source:`stream`,status:e.status,sessionKey:e.sessionId,timestamp:e.timestamp}}}function qc(e){let t=Ac(e),n=Pc(e),r=Mc(e),i=Nc(e),a=Fc(e),o=Ic(e)??a,s=Lc(e),c=kc(e.lastMessageAt),l=gc(a),u=Hc(e.sessionId),d=zc(e),f=Bc(e),p=Vc(e),m=jc(e);return{key:e.sessionId,createdAt:e.createdAt??e.updatedAt,updatedAt:e.updatedAt,...c?{lastMessageAt:c}:{},...s?{readAt:s}:{},...typeof e.agentId==`string`&&e.agentId.trim().length>0?{agentId:e.agentId.trim()}:{},...n?{label:n}:{},...u,...r?{preferredModel:r}:{},...i?{preferredThinking:i}:{},...a?{projectRoot:a}:{},...o?{workingDir:o}:{},...l?{projectName:l}:{},...t?{metadata:t}:{},sessionType:Rc(e),sessionTypeMutable:!1,status:e.status??`idle`,isChildSession:!!d,...p?{isPromotedChildSession:p}:{},...d?{parentSessionId:d}:{},...f?{spawnedByRequestId:f}:{},...m?{activityPreview:m}:{},messageCount:e.messageCount}}function Jc(e){return e.map(qc)}var Yc=`nextclaw.chat.session-list.mode`,Xc=`time-first`;function Zc(e){return e===`time-first`||e===`project-first`}function Qc(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean))]:[]}function $c(e){if(!e||typeof e!=`object`)return null;let{snapshot:t}=e;return!t||typeof t!=`object`?null:Zc(t.listMode)?t.listMode:null}function el(e,t){let n=e?.trim();if(!n)return!1;let r=t?.trim();return r?n.localeCompare(r)>0:!1}function tl(e){let{active:t,readAt:n,runStatus:r,lastMessageAt:i}=e;return t||r===`running`?!1:el(i,n)}var nl={selectedSessionKey:null,selectedAgentId:`main`,query:``,listMode:Xc,pinnedSessionKeys:[],pinnedProjectRoots:[],collapsedProjectRoots:[]};function rl(e){return t=>e(e=>({snapshot:{...e.snapshot,...t}}))}function il(e){return(t,n)=>e(e=>{let r=t.trim(),i=n?.trim();if(!r||!i)return e;let a=e.optimisticReadAtBySessionKey[r];return a&&a.localeCompare(i)>=0?e:{...e,optimisticReadAtBySessionKey:{...e.optimisticReadAtBySessionKey,[r]:i}}})}var I=p()(Dn(e=>({snapshot:nl,optimisticReadAtBySessionKey:{},setSnapshot:rl(e),markSessionRead:il(e)}),{name:Yc,storage:On(()=>window.localStorage),partialize:e=>({snapshot:{listMode:e.snapshot.listMode,pinnedSessionKeys:e.snapshot.pinnedSessionKeys,pinnedProjectRoots:e.snapshot.pinnedProjectRoots,collapsedProjectRoots:e.snapshot.collapsedProjectRoots}}),merge:(e,t)=>{if(!e||typeof e!=`object`)return t;let{snapshot:n}=e,r=$c(e);return{...t,snapshot:{...t.snapshot,...r?{listMode:r}:{},pinnedSessionKeys:Qc(n?.pinnedSessionKeys),pinnedProjectRoots:Qc(n?.pinnedProjectRoots),collapsedProjectRoots:Qc(n?.collapsedProjectRoots)}}}})),al={staleTime:5e3,retry:!1};function ol(e){return E({queryKey:[`ncp-sessions`,e?.limit??null,e?.peerId?.trim()||null],queryFn:()=>Be(e),...al})}function sl(e){return E({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>me(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,...al})}function cl(e,t){return e.filter(e=>fc(e,t))}function ll(e){return e.isChildSession?e.isPromotedChildSession===!0:!0}function ul(e={}){let t=I(e=>e.snapshot.query),n=e.query??t,r=ol({limit:e.limit??200}),i=(0,P.useMemo)(()=>cl(Jc(r.data?.sessions??[]).filter(ll),n).map(e=>({session:e,runStatus:e.status===`running`?`running`:void 0})),[n,r.data?.sessions]);return{isLoading:r.isLoading,items:i}}var dl={wx:`weixin`,lark:`feishu`},fl={cron:{icon:`cron`}},pl={codex:`chatSessionTypeCodex`,claude:`chatSessionTypeClaude`};function ml(e){return e?.trim().toLowerCase()??``}function hl(e){return e.split(/[-_]+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function gl(e,t){let n=ml(e);if(!n||n===`native`)return null;let r=t.find(e=>ml(e.value)===n);return r?.label.trim()?r.label.trim():hl(n)}function _l(e,t){let n=ml(e);return!n||n===`native`?null:t.find(e=>ml(e.value)===n)??null}function vl(e){let t=ml(e);if(!t)return null;let n=dl[t]??t;return on(n)?n:null}function yl(e,t){let n=vl(e.channel??``);if(n)return{icon:{kind:`channel-logo`,channel:n},label:null};let r=fl[ml(e.type)];if(r)return{icon:{kind:`symbol`,icon:r.icon},label:null};let i=ml(e.sessionType),a=_l(i,t);if(a?.icon?.src?.trim())return{icon:{kind:`runtime-image`,src:a.icon.src,alt:a.icon.alt??null,name:a.label},label:null};let o=pl[i];return o?{icon:null,label:f(o)}:{icon:null,label:a?.label?.trim()||gl(e.sessionType,t)}}var bl=`app://`;function xl(e){let t=e.trim().replace(/^\/+/,``);if(!t)return null;let n=t.split(`/`);return n.some(e=>e.trim().length===0||e===`.`||e===`..`)?null:n.join(`/`)}function Sl(e){let t=e.trim();if(!t)return null;if(!t.startsWith(bl))return t;let n=xl(t.slice(6));return n?`/${n}`:null}function Cl({icon:e,className:t}){if(e.kind===`channel-logo`)return(0,F.jsx)(wl,{channel:e.channel,className:t});if(e.kind===`runtime-image`){let n=Sl(e.src);return(0,F.jsx)(Tn,{name:e.name?.trim()||e.alt?.trim()||`runtime`,src:n??void 0,className:m(`h-[1.125rem] w-[1.125rem]`,t),imgClassName:`h-full w-full object-contain`,fallback:(0,F.jsx)(Ya,{className:m(`h-3 w-3 text-muted-foreground`,t)})})}return(0,F.jsx)(Wa,{className:m(`h-3.5 w-3.5`,t)})}function wl({channel:e,className:t}){return(0,F.jsx)(Tn,{name:e,src:on(e),className:m(`h-[1.125rem] w-[1.125rem]`,t),imgClassName:`h-full w-full object-contain`,fallback:(0,F.jsx)(Ya,{className:`h-3 w-3 text-muted-foreground`})})}function Tl({status:e,className:t}){let n=f(e===`running`?`sessionsRunStatusRunning`:`sessionsRunStatusQueued`);return(0,F.jsxs)(`span`,{className:m(`inline-flex h-3.5 w-3.5 items-center justify-center text-muted-foreground/70`,t),title:n,"aria-label":n,children:[(0,F.jsx)(_n,{className:`h-3 w-3 animate-spin`}),(0,F.jsx)(`span`,{className:`sr-only`,children:n})]})}function El(e){return new Date(e.session.lastMessageAt??e.session.createdAt).getTime()}function Dl(e){return[...e].sort((e,t)=>El(t)-El(e))}function Ol(e,t){return[...e].sort((e,n)=>Number(t.has(n.session.key))-Number(t.has(e.session.key))||El(n)-El(e))}function kl(e,t=new Set){let n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),i=r-864e5,a=r-7*864e5,o=[],s=[],c=[],l=[],u=e.filter(e=>!t.has(e.session.key)),d=Ol(e.filter(e=>t.has(e.session.key)),t);for(let e of u){let t=El(e);t>=r?o.push(e):t>=i?s.push(e):t>=a?c.push(e):l.push(e)}let p=[];return d.length>0&&p.push({label:f(`chatSidebarPinned`),items:d}),o.length>0&&p.push({label:f(`chatSidebarToday`),items:o}),s.length>0&&p.push({label:f(`chatSidebarYesterday`),items:s}),c.length>0&&p.push({label:f(`chatSidebarPrevious7Days`),items:c}),l.length>0&&p.push({label:f(`chatSidebarOlder`),items:l}),p}function Al(e,t=new Set,n=new Set){let r=new Map;for(let t of e){let e=t.session.projectRoot?.trim();if(!e)continue;let i=r.get(e),a=El(t);if(i){i.items.push(t),i.latestUpdatedAt=Math.max(i.latestUpdatedAt,a);continue}r.set(e,{projectRoot:e,projectName:t.session.projectName?.trim()||gc(e)||e,items:[t],latestUpdatedAt:a,isPinned:n.has(e)})}return[...r.values()].map(e=>({...e,items:Ol(e.items,t)})).sort((e,t)=>Number(t.isPinned)-Number(e.isPinned)||t.latestUpdatedAt-e.latestUpdatedAt)}function jl(e){let t=new Map;for(let n of e){let e=n.session.parentSessionId?.trim();if(!e)continue;let r=t.get(e)??[];r.push(n),t.set(e,r)}for(let e of t.values())e.sort((e,t)=>El(t)-El(e));return t}function Ml(e){if(e.label&&e.label.trim())return e.label.trim();let t=e.key.split(`:`);return t[t.length-1]||e.key}var Nl=`native`;function Pl(e){return typeof e==`string`?e.trim().toLowerCase()||`native`:Nl}function Fl(e,t=Nl){return Pl(e?.runtime?.trim()||e?.engine?.trim()||t)}function Il(e,t){return e===`native`?f(`chatSessionTypeNative`):t?.trim()||e.trim().split(/[-_]+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)||e}function Ll(e){let t=new Map;for(let n of e){let e=Pl(n.value);t.set(e,{value:e,label:n.label?.trim()||Il(e),icon:n.icon??null,ready:n.ready??!0,reason:n.reason??null,reasonMessage:n.reasonMessage??null,supportedModels:n.supportedModels,recommendedModel:n.recommendedModel??null,modelSelectionMode:n.modelSelectionMode??`nextclaw`,runtimeDefaultThinking:n.runtimeDefaultThinking??null,cta:n.cta??null})}return t.has(`native`)||t.set(Nl,{value:Nl,label:Il(Nl),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}),Array.from(t.values()).sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}var Rl=p(e=>({snapshot:{},setSnapshot:t=>e(({snapshot:e})=>({snapshot:{...e,...t}}))})),zl=`group inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`;function Bl({title:e}){return(0,F.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:e})}function Vl({label:e}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground`,children:[(0,F.jsx)(zo,{className:`h-4 w-4 shrink-0 text-muted-foreground/55`}),(0,F.jsx)(`span`,{children:e})]})}function Hl(){return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground`,children:[(0,F.jsx)(_n,{className:`h-4 w-4 shrink-0 animate-spin`}),(0,F.jsx)(`span`,{children:f(`sessionsLoading`)})]})}function Ul({item:e,selectedSessionKey:t,optimisticReadAtBySessionKey:n,sessionTypeOptions:r,onSelect:i}){let{session:a,runStatus:o}=e,s=t===a.key,c=n[a.key],l=c&&a.readAt?c.localeCompare(a.readAt)>0?c:a.readAt:c??a.readAt,u=tl({active:s,lastMessageAt:a.lastMessageAt,readAt:l,runStatus:o}),d=oc(a)??a.projectName??a.projectRoot??`${a.messageCount}`,p=uc(a.lastMessageAt??a.createdAt),h=yl(a,r);return(0,F.jsxs)(`button`,{type:`button`,"aria-current":s?`page`:void 0,className:m(`flex w-full min-w-0 items-start gap-2 rounded-lg px-2.5 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,s?`bg-accent text-accent-foreground`:`text-popover-foreground hover:bg-accent/70`),onClick:()=>i(a.key),children:[(0,F.jsx)(`span`,{className:`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center`,children:s?(0,F.jsx)(qt,{className:`h-3.5 w-3.5`}):u?(0,F.jsx)(`span`,{"aria-label":f(`chatSessionUnread`),className:`h-2 w-2 rounded-full bg-primary`}):null}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:ac(a)}),h.label?(0,F.jsx)(`span`,{className:`shrink-0 rounded-full border border-border/70 px-1.5 py-0.5 text-[10px] font-semibold leading-none text-muted-foreground`,children:h.label}):null,h.icon?(0,F.jsx)(`span`,{className:`inline-flex h-[1.125rem] w-[1.125rem] shrink-0 items-center justify-center text-muted-foreground`,children:(0,F.jsx)(Cl,{icon:h.icon})}):null]}),(0,F.jsxs)(`span`,{className:`mt-0.5 flex min-w-0 items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:d}),(0,F.jsx)(`span`,{className:`shrink-0`,children:p})]})]}),o?(0,F.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:(0,F.jsx)(Tl,{status:o})}):null]})}function Wl({selectedSessionKey:e,title:t}){let n=ic(),[r,i]=(0,P.useState)(!1),[a,o]=(0,P.useState)(``),s=I(e=>e.optimisticReadAtBySessionKey),c=Rl(e=>e.snapshot.sessionTypesQuery?.data??null),{isLoading:l,items:u}=ul({query:a}),d=(0,P.useMemo)(()=>Dl(u),[u]),p=(0,P.useMemo)(()=>Ll(c?.options??[]),[c?.options]),h=t=>{i(!1),o(``),t!==e&&n.chatSessionListManager.selectSession(t)};return(0,F.jsxs)(Ze,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":`${f(`chatSessionSwitch`)}: ${t}`,"aria-expanded":r,className:zl,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,F.jsx)(Et,{className:m(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-hover:text-accent-foreground`,r?`rotate-180`:null)})]})}),(0,F.jsxs)(Ye,{align:`start`,className:`w-[22rem] max-w-[calc(100vw-2rem)] p-0`,children:[(0,F.jsxs)(`div`,{className:`space-y-2 border-b border-border px-3 py-2`,children:[(0,F.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/75`,children:f(`chatSessionSwitcherTitle`)}),(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(st,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/65`}),(0,F.jsx)(ae,{value:a,onChange:e=>o(e.target.value),placeholder:f(`chatSearchSessionPlaceholder`),"aria-label":f(`chatSearchSessionPlaceholder`),className:`h-8 rounded-lg bg-background pl-8 pr-2 text-xs`,autoFocus:!0})]})]}),(0,F.jsx)(`div`,{className:`max-h-80 overflow-y-auto p-1.5`,children:l?(0,F.jsx)(Hl,{}):d.length>0?(0,F.jsx)(`div`,{className:`space-y-1`,children:d.map(t=>(0,F.jsx)(Ul,{item:t,selectedSessionKey:e,optimisticReadAtBySessionKey:s,sessionTypeOptions:p,onSelect:h},t.session.key))}):(0,F.jsx)(Vl,{label:a.trim()?f(`chatSessionSwitcherNoResults`):f(`sessionsEmpty`)})})]})]})}function Gl({layoutMode:e,selectedSessionKey:t,title:n}){let r=hn(e=>e.isSidebarCollapsed);return e!==`desktop`||!r?(0,F.jsx)(Bl,{title:n}):(0,F.jsx)(Wl,{selectedSessionKey:t,title:n})}var Kl=[];function ql(){let e=Rl(e=>!!(e.snapshot.configQuery?.isFetched||e.snapshot.configQuery?.isSuccess)),t=Rl(e=>!!(e.snapshot.providersQuery?.isFetched||e.snapshot.providersQuery?.isSuccess)),n=Rl(e=>!!(e.snapshot.providerTemplatesQuery?.isFetched||e.snapshot.providerTemplatesQuery?.isSuccess));return e&&t&&n}function Jl(e){let t=Rl(e=>e.snapshot.sessionsQuery?.data?.sessions??Kl),n=(0,P.useMemo)(()=>Jc(t),[t]);return(0,P.useMemo)(()=>n.find(t=>t.key===e)??null,[n,e])}function Yl(e){return!!e&&typeof e==`object`}function Xl(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function Zl(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Ql(e){return typeof e==`string`?e:null}function $l(e){return e===`auto`||e===`source`||e===`rendered`?e:null}function eu(e){if(!Yl(e)||typeof e.key!=`string`||typeof e.path!=`string`||e.viewMode!==`preview`&&e.viewMode!==`diff`)return null;let t=e.key.trim(),n=e.path.trim();return!t||!n?null:{key:t,parentSessionKey:Xl(e.parentSessionKey),path:n,label:Xl(e.label),viewMode:e.viewMode,previewViewer:$l(e.previewViewer),line:Zl(e.line),column:Zl(e.column),rawText:Ql(e.rawText),contentUrl:Xl(e.contentUrl),mimeType:Xl(e.mimeType),beforeText:Ql(e.beforeText),afterText:Ql(e.afterText),patchText:Ql(e.patchText),oldStartLine:Zl(e.oldStartLine),newStartLine:Zl(e.newStartLine)}}function tu(e){return{key:e.key,parentSessionKey:e.parentSessionKey,path:e.path,label:e.label,viewMode:e.viewMode,previewViewer:e.previewViewer,line:e.line,column:e.column,rawText:e.rawText,contentUrl:e.contentUrl,mimeType:e.mimeType,beforeText:e.beforeText,afterText:e.afterText,patchText:e.patchText,oldStartLine:e.oldStartLine,newStartLine:e.newStartLine}}function nu(e,t,n){let r=e.slice(0,n),i=t?e.find(e=>e.key===t):null;return!i||r.some(e=>e.key===i.key)?r:r.length<n?[...r,i]:[...r.slice(0,-1),i]}function ru(e){return typeof e!=`number`||!Number.isFinite(e)?480:Math.max(360,Math.min(860,e))}function iu(e){return e.index>0&&e.entries.length>0}function au(e){return e.index>=0&&e.index<e.entries.length-1}function ou(e,t,n=Object.is){let r=lu(e),i=e.entries[r];if(i&&n(i,t))return{entries:e.entries,index:r};let a=[...e.entries.slice(0,r+1),t];return{entries:a,index:a.length-1}}function su(e,t){let n=lu(e),r=t===`back`?n-1:n+1,i=e.entries[r];return i?{history:{entries:e.entries,index:r},entry:i}:null}function cu(e,t,n){let r=lu(e),i=e.entries.filter(t);if(i.length===0)return n===void 0?{entries:[],index:0}:{entries:[n],index:0};let a=e.entries.slice(0,r+1).filter(t);return{entries:i,index:Math.min(Math.max(0,a.length-1),i.length-1)}}function lu(e){return e.entries.length===0?0:Number.isInteger(e.index)?Math.min(Math.max(0,e.index),e.entries.length-1):e.entries.length-1}function uu(e,t){return e.kind===t.kind?e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`cron`?!0:t.kind!==`overview`&&t.kind!==`child-sessions`&&t.kind!==`project-files`&&t.kind!==`cron`&&e.key===t.key:!1}function du(e){let{activeChildSessionKey:t,activeSideChatDraft:n,activeWorkspaceFileKey:r,activeWorkspacePanelKind:i}=e;return i===`overview`||i===`child-sessions`||i===`project-files`||i===`cron`?{kind:i}:i===`child-session`&&t?{kind:`child-session`,key:t}:i===`side-chat-draft`&&n?{kind:`side-chat-draft`,key:n.draftKey}:i===`file`&&r?{kind:`file`,key:r}:null}function fu(e,t){if(e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`)return{activeWorkspacePanelKind:e.kind,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null};if(e.kind===`cron`)return{activeWorkspacePanelKind:`cron`,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null};if(e.kind===`file`)return t.workspaceFileTabs.some(t=>t.key===e.key)?{activeWorkspacePanelKind:`file`,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:e.key}:null;if(e.kind===`side-chat-draft`){let{activeSideChatDraft:n}=t;return n?.draftKey===e.key?{activeWorkspacePanelKind:`side-chat-draft`,activeChildSessionKey:null,activeSideChatDraft:n,activeWorkspaceFileKey:null}:null}return{activeWorkspacePanelKind:`child-session`,activeChildSessionKey:e.key,activeSideChatDraft:null,activeWorkspaceFileKey:null}}function pu(e,t){if(t.kind===`overview`)return null;let n=cu({entries:e.workspaceNavigationHistory,index:e.workspaceNavigationHistoryIndex},e=>!uu(e,t),{kind:`overview`}),r={closedWorkspaceTabEntries:t.kind!==`file`&&t.kind!==`side-chat-draft`?[...e.closedWorkspaceTabEntries.filter(e=>!uu(e,t)),t]:e.closedWorkspaceTabEntries,childSessionTabs:t.kind===`child-session`?e.childSessionTabs.filter(e=>e.sessionKey!==t.key):e.childSessionTabs,activeSideChatDraft:t.kind===`side-chat-draft`?null:e.activeSideChatDraft,workspaceFileTabs:t.kind===`file`?e.workspaceFileTabs.filter(e=>e.key!==t.key):e.workspaceFileTabs,workspaceNavigationHistory:[...n.entries],workspaceNavigationHistoryIndex:n.index},i=du(e);if(!i||!uu(i,t))return r;let a=fu(n.entries[n.index]??{kind:`overview`},{...e,...r});return{...r,...a??fu({kind:`overview`},e)}}function mu(e){return{draftKey:`side-chat-draft:${e}:${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`,parentSessionKey:e}}function hu(e,t){let n=e.findIndex(e=>e.sessionKey===t.sessionKey);if(n===-1)return[t,...e];let r=e[n],i=[...e];return i[n]={...r,parentSessionKey:r.parentSessionKey??t.parentSessionKey,label:r.label?.trim()?r.label:t.label,agentId:r.agentId?.trim()?r.agentId:t.agentId},i}function gu(e){let{agentId:t,draftKey:n,label:r,sessionKey:i,snapshot:a}=e,o=i.trim(),s=n.trim(),{activeSideChatDraft:c}=a;if(!o||!s||c?.draftKey!==s)return null;let{parentSessionKey:l}=c,u=ou(cu({entries:a.workspaceNavigationHistory,index:a.workspaceNavigationHistoryIndex},e=>e.kind!==`side-chat-draft`||e.key!==s),{kind:`child-session`,key:o},uu);return{parentSessionKey:l,patch:{workspacePanelParentKey:l,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:o,activeSideChatDraft:null,activeWorkspaceFileKey:null,childSessionTabs:hu(a.childSessionTabs,{sessionKey:o,parentSessionKey:l,label:r?.trim()||null,agentId:t?.trim()||null}),workspaceNavigationHistory:[...u.entries],workspaceNavigationHistoryIndex:u.index}}}var _u=`nextclaw.chat.workspace-panel.state`,vu=2,yu=8,bu={sessionTypeLabel:null,sessionTypeIcon:null,sessionKey:null,agentId:null,sessionDisplayName:void 0,sessionProjectRoot:null,sessionWorkingDir:null,sessionProjectName:null,canDeleteSession:!1,isDeletePending:!1,isHistoryLoading:!1,messages:[],isSending:!1,isAwaitingAssistantOutput:!1,hasSubmittedDraftMessage:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,workspaceFileTabs:[],activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0,workspacePanelWidth:480,contextWindow:null};function xu(e){return!!e&&typeof e==`object`}function Su(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function Cu(e,t){return typeof e==`number`&&Number.isInteger(e)?Math.min(Math.max(0,e),t):t}function wu(e){return e===`overview`||e===`child-sessions`||e===`child-session`||e===`project-files`||e===`file`||e===`cron`}function Tu(e){if(!xu(e))return null;if(e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`cron`)return{kind:e.kind};let t=Su(e.key);return!t||e.kind!==`child-session`&&e.kind!==`file`?null:{kind:e.kind,key:t}}function Eu(e){if(!xu(e))return null;let t=Su(e.workspacePanelParentKey),n=Su(e.activeWorkspaceFileKey),r=nu(Array.isArray(e.workspaceFileTabs)?e.workspaceFileTabs.map(eu).filter(e=>e!==null):[],n,yu),i=r.filter(e=>e.parentSessionKey===t),a=n&&i.some(e=>e.key===n)?n:i[0]?.key??null,o=wu(e.activeWorkspacePanelKind)?e.activeWorkspacePanelKind:null,s=o===`file`&&!a?null:o,c=Su(e.activeChildSessionKey),l=Array.isArray(e.closedWorkspaceTabEntries)?e.closedWorkspaceTabEntries.map(Tu).filter(e=>e!==null&&e.kind!==`overview`):[],u=du({activeWorkspacePanelKind:s,activeChildSessionKey:c,activeSideChatDraft:null,activeWorkspaceFileKey:a}),d=Array.isArray(e.workspaceNavigationHistory)?e.workspaceNavigationHistory.map(Tu).filter(e=>e!==null).filter(e=>e.kind!==`file`||r.some(t=>t.key===e.key)):[],f=d.length>0?d:u?[u]:[];return{workspacePanelParentKey:t,activeWorkspacePanelKind:s,activeChildSessionKey:c,workspaceFileTabs:r,activeWorkspaceFileKey:a,closedWorkspaceTabEntries:l,workspaceNavigationHistory:f,workspaceNavigationHistoryIndex:f.length>0?Cu(e.workspaceNavigationHistoryIndex,f.length-1):0,workspacePanelWidth:ru(e.workspacePanelWidth)}}var L=p()(Dn(e=>({snapshot:bu,setSnapshot:t=>e(e=>({snapshot:{...e.snapshot,...t}}))}),{name:_u,version:vu,storage:On(()=>window.localStorage),partialize:e=>{let t=e.snapshot.workspaceNavigationHistory.filter(e=>e.kind!==`side-chat-draft`),n=t.length>0?Math.min(e.snapshot.workspaceNavigationHistoryIndex,t.length-1):0;return{snapshot:{workspacePanelParentKey:e.snapshot.workspacePanelParentKey,activeWorkspacePanelKind:e.snapshot.activeWorkspacePanelKind===`side-chat-draft`?null:e.snapshot.activeWorkspacePanelKind,activeChildSessionKey:e.snapshot.activeChildSessionKey,workspaceFileTabs:nu(e.snapshot.workspaceFileTabs,e.snapshot.activeWorkspaceFileKey,yu).map(tu),activeWorkspaceFileKey:e.snapshot.activeWorkspaceFileKey,closedWorkspaceTabEntries:e.snapshot.closedWorkspaceTabEntries.filter(e=>e.kind!==`overview`&&e.kind!==`side-chat-draft`),workspaceNavigationHistory:t,workspaceNavigationHistoryIndex:n,workspacePanelWidth:e.snapshot.workspacePanelWidth}}},merge:(e,t)=>{let n=Eu(xu(e)?e.snapshot:null);return n?{...t,snapshot:{...t.snapshot,...n}}:t}})),Du=[[`bg-amber-100`,`text-amber-700`],[`bg-emerald-100`,`text-emerald-700`],[`bg-blue-100`,`text-blue-700`],[`bg-rose-100`,`text-rose-700`],[`bg-cyan-100`,`text-cyan-700`],[`bg-violet-100`,`text-violet-700`]];function Ou(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function ku({agentId:e,displayName:t,avatarUrl:n,className:r}){let i=t?.trim()||e,a=e.trim().toLowerCase()===`main`,[o,s]=Du[Ou(e)%Du.length]??Du[0],c=a?`bg-primary`:o,l=a?`text-primary-foreground`:s;return n?.trim()?(0,F.jsx)(`img`,{src:n,alt:t?.trim()||e,className:m(`rounded-full object-cover`,r)}):(0,F.jsx)(`div`,{className:m(`rounded-full flex items-center justify-center font-semibold`,c,l,r),"aria-label":t?.trim()||e,children:a?(0,F.jsx)(Ya,{className:`h-[55%] w-[55%]`,strokeWidth:2.4}):(i.trim()||`A`).slice(0,1).toUpperCase()})}function Au(){return E({queryKey:[`agents`],queryFn:Le,staleTime:3e4})}function ju(){let e=pe();return Me({mutationFn:({agentId:e,data:t})=>ve(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),D.success(f(`configSavedApplied`))},onError:e=>{D.error(f(`configSaveFailed`)+`: `+e.message)}})}function Mu(){let e=pe();return Me({mutationFn:({agentId:e})=>Ee(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),D.success(f(`configSavedApplied`))},onError:e=>{D.error(f(`configSaveFailed`)+`: `+e.message)}})}function Nu(e){return new Map(e.filter(e=>typeof e.id==`string`&&e.id.trim().length>0).map(e=>[e.id,e]))}function Pu(e){let t=e?.trim()??``,n=Au(),r=(0,P.useMemo)(()=>Nu(n.data?.agents??[]),[n.data?.agents]);return(0,P.useMemo)(()=>{if(!t)return null;let e=r.get(t)??null;return{agentId:t,profile:e,displayName:e?.displayName?.trim()||t,avatarUrl:e?.avatarUrl?.trim()||null}},[r,t])}function Fu({agentId:e,className:t}){let n=Pu(e);return n?(0,F.jsx)(ku,{agentId:n.agentId,displayName:n.displayName,avatarUrl:n.avatarUrl,className:t}):null}function Iu({layoutMode:e,onBackToList:t}){let n=ic(),r=L(e=>e.snapshot),i=I(e=>e.snapshot.selectedSessionKey),a=I(e=>e.snapshot.selectedAgentId),o=Rl(e=>e.snapshot.sessionTypesQuery?.data??null),s=Jl(i),c=(0,P.useMemo)(()=>Ll(o?.options??[]),[o?.options]),l=Pl(s?.sessionType??o?.defaultType??`native`),u=c.find(e=>e.value===l)??null,d=u?.label??Il(l),p=l!==`native`&&!!d,m=s?.projectRoot??null,h=s?.projectName??gc(m),g=!!s,_=!!(i||d),v=(s?ac(s):void 0)||(g&&i?i:null)||f(`chatSidebarNewTask`),y=s?.agentId?.trim()??a?.trim()??``,b=y.length>0&&y.toLowerCase()!==`main`,x=!!(i&&r.workspacePanelParentKey===i&&r.activeWorkspacePanelKind);return(0,F.jsx)(Bs,{layoutMode:e,title:v,titleContent:(0,F.jsx)(Gl,{layoutMode:e,selectedSessionKey:i,title:v}),shouldShow:_,onBackToList:t,leading:b?(0,F.jsx)(`div`,{className:`inline-flex shrink-0 items-center`,children:(0,F.jsx)(Fu,{agentId:y,className:`h-5 w-5`})}):null,sessionTypeBadge:p?(0,F.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground`,children:[u?.icon?.src?(0,F.jsx)(`span`,{className:`inline-flex h-[1.125rem] w-[1.125rem] items-center justify-center`,children:(0,F.jsx)(Cl,{icon:{kind:`runtime-image`,src:u.icon.src,alt:u.icon.alt??null,name:d}})}):null,d]}):null,projectBadge:h?(0,F.jsx)(tc,{sessionKey:i??`draft`,projectName:h,projectRoot:m,persistToServer:g}):null,actions:i?(0,F.jsx)($s,{sessionKey:i,canDeleteSession:g,isDeletePending:r.isDeletePending,projectRoot:m,metadata:s?.metadata??null,isWorkspaceOpen:x,onToggleWorkspace:()=>{i&&n.chatThreadManager.toggleWorkspacePanel(i)},onDeleteSession:n.chatThreadManager.deleteSession}):null})}function Lu(){let e=ic(),t=L(e=>e.snapshot);return(0,F.jsx)(zs,{parentSessionLabel:t.parentSessionKey?t.parentSessionLabel??null:null,onGoToParentSession:e.chatThreadManager.goToParentSession})}var Ru=[{key:`hero`,alignmentClassName:`justify-start`,bubbleClassName:`max-w-[78%] h-32 rounded-[30px]`},{key:`follow-up`,alignmentClassName:`justify-start`,bubbleClassName:`max-w-[62%] h-24 rounded-[28px]`},{key:`reply`,alignmentClassName:`justify-end`,bubbleClassName:`max-w-[70%] h-24 rounded-[28px]`},{key:`detail`,alignmentClassName:`justify-start`,bubbleClassName:`max-w-[88%] h-36 rounded-[30px]`}];function zu(){return(0,F.jsxs)(`section`,{"data-testid":`chat-conversation-skeleton`,className:`flex-1 min-h-0 flex flex-col overflow-hidden bg-background`,children:[(0,F.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar`,children:(0,F.jsx)(`div`,{className:`mx-auto flex min-h-full w-full max-w-[min(1120px,100%)] flex-col px-6 py-5`,children:(0,F.jsxs)(`div`,{className:`flex flex-1 flex-col gap-8`,children:[(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(xn,{className:`h-6 w-52 rounded-lg bg-muted`}),(0,F.jsx)(`div`,{className:`space-y-5`,children:Ru.map(e=>(0,F.jsx)(`div`,{className:m(`flex w-full`,e.alignmentClassName),children:(0,F.jsx)(xn,{"data-testid":`chat-conversation-skeleton-bubble`,className:m(`w-full bg-muted`,e.bubbleClassName)})},e.key))})]}),(0,F.jsxs)(`div`,{className:`mt-auto grid gap-4 pb-2 sm:grid-cols-[minmax(0,1fr)_minmax(180px,240px)] sm:items-end`,children:[(0,F.jsxs)(`div`,{className:`space-y-3`,children:[(0,F.jsx)(xn,{className:`h-4 w-40 rounded-full bg-muted`}),(0,F.jsx)(xn,{className:`h-[112px] w-full rounded-[30px] bg-muted`})]}),(0,F.jsx)(`div`,{className:`hidden justify-end sm:flex`,children:(0,F.jsx)(xn,{className:`h-10 w-36 rounded-full bg-muted`})})]})]})})}),(0,F.jsx)(`div`,{className:`bg-background p-4`,children:(0,F.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1120px,100%)]`,children:(0,F.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-card shadow-card`,children:[(0,F.jsx)(`div`,{className:`px-4 py-2.5`,children:(0,F.jsx)(xn,{className:`h-[84px] w-full rounded-[28px] bg-muted`})}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 pb-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(xn,{className:`h-8 w-20 rounded-full bg-muted`}),(0,F.jsx)(xn,{className:`h-8 w-28 rounded-full bg-muted`}),(0,F.jsx)(xn,{className:`hidden h-8 w-24 rounded-full bg-muted sm:block`})]}),(0,F.jsx)(xn,{className:`h-8 w-8 rounded-full bg-muted`})]})]})})})]})}function Bu(e,t){return e.label?.trim()?e.label.trim():t?ac(t):e.sessionKey}function Vu(e){let t=ol({limit:200}),n=(0,P.useMemo)(()=>t.data?.sessions??[],[t.data?.sessions]),r=(0,P.useMemo)(()=>{let e=Jc(n);return new Map(e.map(e=>[e.key,e]))},[n]);return(0,P.useMemo)(()=>e.map(e=>{let t=r.get(e.sessionKey)??null,n=e.agentId?.trim()||t?.agentId||null;return{sessionKey:e.sessionKey,parentSessionKey:e.parentSessionKey,title:Bu(e,t),agentId:n,updatedAt:t?.updatedAt??null,lastMessageAt:t?.lastMessageAt??null,readAt:t?.readAt??null,runStatus:t?.status===`running`?`running`:void 0,sessionTypeLabel:t?.sessionType?Il(t.sessionType):null,preferredModel:t?.preferredModel?.trim()||null,projectName:t?.projectName?.trim()||null,projectRoot:t?.projectRoot?.trim()||null}}),[r,e])}function Hu(e){return/\.html?$/i.test(e)?`html`:/\.mdx?$/i.test(e)?`markdown`:null}function Uu(e,t){let n=Hu(e);return n===`html`?t===`rendered`?`rendered`:`source`:n===`markdown`?t===`source`?`source`:`rendered`:t===`source`||t===`rendered`?t:null}function Wu(e,t){return Uu(e,t)??t??null}function Gu(e,t){return Hu(e)?Uu(e,t)===`source`?`rendered`:`source`:null}function Ku(e){let t=e.path.split(`/`).filter(Boolean).pop();return e.label?.trim()||t||e.path}function qu(e){let{activePanelKind:t,activeChildSessionKey:n,activeSideChatDraft:r,activeWorkspaceFileKey:i,childSessionTabs:a,workspaceFileTabs:o}=e;if(t===`overview`)return{kind:`overview`};if(t===`child-sessions`)return{kind:`child-sessions`};if(t===`project-files`)return{kind:`project-files`};if(t===`cron`)return{kind:`cron`};if(t===`side-chat-draft`&&r)return{kind:`side-chat-draft`,draft:r};if(t!==`child-session`&&i){let e=o.find(e=>e.key===i);if(e)return{kind:`file`,file:e}}if(t!==`file`&&n){let e=a.find(e=>e.sessionKey===n);if(e)return{kind:`child-session`,tab:e}}return a[0]?{kind:`child-session`,tab:a[0]}:r?{kind:`side-chat-draft`,draft:r}:o[0]?{kind:`file`,file:o[0]}:null}function Ju(e){return e===`child-sessions`||e===`cron`||e===`project-files`?{kind:e}:null}function Yu({activeSelection:e,closedWorkspaceTabEntries:t,onCloseTab:n,onSelectChildSessions:r,onSelectCronJobs:i,onSelectOverview:a,onSelectProjectFiles:o}){return[{key:`overview`,kind:`overview`,title:f(`chatWorkspaceOverview`),tooltip:f(`chatWorkspaceOverview`),active:e?.kind===`overview`,onSelect:a},{key:`child-sessions`,kind:`child-sessions`,title:f(`chatWorkspaceChildSessions`),tooltip:f(`chatWorkspaceChildSessions`),active:e?.kind===`child-sessions`,onSelect:r,onClose:()=>n({kind:`child-sessions`})},{key:`cron:session`,kind:`cron`,title:f(`chatWorkspaceSessionCronJobs`),tooltip:f(`chatWorkspaceSessionCronJobs`),active:e?.kind===`cron`,onSelect:i,onClose:()=>n({kind:`cron`})},{key:`project-files`,kind:`project-files`,title:f(`chatWorkspaceProjectFiles`),tooltip:f(`chatWorkspaceProjectFiles`),active:e?.kind===`project-files`,onSelect:o,onClose:()=>n({kind:`project-files`})}].filter(e=>{let n=Ju(e.kind);return!n||!t.some(e=>uu(e,n))})}function Xu(e){let{activeSideChatDraft:t,closedWorkspaceTabEntries:n,resolvedChildTabs:r,workspaceFileTabs:i,activeSelection:a,optimisticReadAtBySessionKey:o,onSelectSession:s,onSelectFile:c,onOpenFileViewer:l,onCloseTab:u,onSelectOverview:d,onSelectChildSessions:p,onSelectProjectFiles:m,onSelectCronJobs:h}=e,g=Yu({activeSelection:a,closedWorkspaceTabEntries:n,onCloseTab:u,onSelectChildSessions:p,onSelectCronJobs:h,onSelectOverview:d,onSelectProjectFiles:m}),_=t?[{key:`side-chat-draft:${t.draftKey}`,kind:`side-chat-draft`,title:f(`chatWorkspaceSideChatDraftTitle`),tooltip:f(`chatWorkspaceSideChatDraftSubtitle`),active:a?.kind===`side-chat-draft`&&a.draft.draftKey===t.draftKey,onSelect:()=>void 0,onClose:()=>u({kind:`side-chat-draft`,key:t.draftKey})}]:[],v=r.filter(e=>!n.some(t=>uu(t,{kind:`child-session`,key:e.sessionKey}))).map(e=>{let t=o[e.sessionKey],n=t&&e.readAt?t.localeCompare(e.readAt)>0?t:e.readAt:t??e.readAt;return{key:`child:${e.sessionKey}`,kind:`child-session`,title:e.title,tooltip:e.title,agentId:e.agentId,active:a?.kind===`child-session`&&a.tab.sessionKey===e.sessionKey,showUnreadDot:tl({active:a?.kind===`child-session`&&a.tab.sessionKey===e.sessionKey,lastMessageAt:e.lastMessageAt,readAt:n,runStatus:e.runStatus}),onSelect:()=>s(e.sessionKey),onClose:()=>u({kind:`child-session`,key:e.sessionKey})}}),y=i.map(e=>{let t=e.viewMode===`preview`?Uu(e.path,e.previewViewer):null,n=e.viewMode===`preview`?Gu(e.path,e.previewViewer):null,r=Ku(e);return{key:`file:${e.key}`,kind:`file`,title:t===`rendered`?`${f(`chatWorkspacePreview`)}: ${r}`:r,tooltip:e.path,fileName:e.path,viewMode:e.viewMode,isRenderedPreview:t===`rendered`,alternateViewerAction:n?{label:f(n===`rendered`?`chatWorkspaceOpenPreview`:`chatWorkspaceOpenSource`),viewer:n,onSelect:()=>l(e.key,n)}:null,active:a?.kind===`file`&&a.file.key===e.key,onSelect:()=>c(e.key),onClose:()=>u({kind:`file`,key:e.key})}});return[...g,..._,...v,...y]}function Zu(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var Qu=Object.freeze({left:0,top:0,width:16,height:16}),$u=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ed=Object.freeze({...Qu,...$u}),td=Object.freeze({...ed,body:``,hidden:!1});function nd(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function rd(e,t){let n=nd(e,t);for(let r in td)r in $u?r in e&&!(r in n)&&(n[r]=$u[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function id(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=rd(r[e]||i[e],a)}return o(t),n.forEach(o),rd(e,a)}function ad(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=Zu(e);for(let i in r){let a=r[i];a&&(t(i,id(e,i,a)),n.push(i))}return n}var od={provider:``,aliases:{},not_found:{},...Qu};function sd(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function cd(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!sd(e,od))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!sd(t,td))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!sd(t,td))return null}return t}var ld=Object.create(null);function ud(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function dd(e,t){let n=ld[e]||(ld[e]=Object.create(null));return n[t]||(n[t]=ud(e,t))}function fd(e,t){return cd(t)?ad(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function pd(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var md=/^[a-z0-9]+(-[a-z0-9]+)*$/,hd=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!gd(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!gd(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!gd(e,n)?null:e}return null},gd=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,_d=!1;function vd(e){return typeof e==`boolean`&&(_d=e),_d}function yd(e){let t=typeof e==`string`?hd(e,!0,_d):e;if(t){let e=dd(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function bd(e,t){let n=hd(e,!0,_d);if(!n)return!1;let r=dd(n.provider,n.prefix);return t?pd(r,n.name,t):(r.missing.add(n.name),!0)}function xd(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),_d&&!t&&!e.prefix){let t=!1;return cd(e)&&(e.prefix=``,ad(e,(e,n)=>{bd(e,n)&&(t=!0)})),t}let n=e.prefix;return gd({prefix:n,name:`a`})?!!fd(dd(t,n),e):!1}var Sd=Object.freeze({width:null,height:null}),Cd=Object.freeze({...Sd,...$u}),wd=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Td=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ed(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(wd);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=Td.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function Dd(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Od(e,t){return e?`<defs>`+e+`</defs>`+t:t}function kd(e,t,n){let r=Dd(e);return Od(r.defs,t+r.content+n)}var Ad=e=>e===`unset`||e===`undefined`||e===`none`;function jd(e,t){let n={...ed,...e},r={...Cd,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=kd(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=Ed(d,c/l)):(u=o===`auto`?c:o,d=s===null?Ed(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Ad(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Md=/\sid="(\S+)"/g,Nd=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Pd=0;function Fd(e,t=Nd){let n=[],r;for(;r=Md.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Pd++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var Id=Object.create(null);function Ld(e,t){Id[e]=t}function Rd(e){return Id[e]||Id[``]}function zd(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var Bd=Object.create(null),Vd=[`https://api.simplesvg.com`,`https://api.unisvg.com`],Hd=[];Vd.length>0;)Vd.length===1||Math.random()>.5?Hd.push(Vd.shift()):Hd.push(Vd.pop());Bd[``]=zd({resources:[`https://api.iconify.design`].concat(Hd)});function Ud(e,t){let n=zd(t);return n===null?!1:(Bd[e]=n,!0)}function Wd(e){return Bd[e]}var Gd=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Kd(e,t){let n=Wd(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function qd(e){return e===404}var Jd=(e,t,n)=>{let r=[],i=Kd(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Yd(e){if(typeof e==`string`){let t=Wd(e);if(t)return t.path}return`/`}var Xd={prepare:Jd,send:(e,t,n)=>{if(!Gd){n(`abort`,424);return}let r=Yd(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;Gd(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(qd(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function Zd(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Qd(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||Zd([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var $d=0;function ef(e,t,n){let r=$d++,i=Zd.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function tf(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=dd(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function nf(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?hd(e,t,n):e;i&&r.push(i)}),r}var rf={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function af(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function of(e){let t={...rf,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=af(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function sf(){}var cf=Object.create(null);function lf(e){if(!cf[e]){let t=Wd(e);if(!t)return;cf[e]={config:t,redundancy:of(t)}}return cf[e]}function uf(e,t,n){let r,i;if(typeof e==`string`){let t=Rd(e);if(!t)return n(void 0,424),sf;i=t.send;let a=lf(e);a&&(r=a.redundancy)}else{let t=zd(e);if(t){r=of(t);let n=Rd(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),sf):r.query(t,i,n)().abort}function df(){}function ff(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Qd(e)}))}function pf(e){let t=[],n=[];return e.forEach(e=>{(e.match(md)?t:n).push(e)}),{valid:t,invalid:n}}function mf(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!fd(e,n).length){r();return}}catch(e){console.error(e)}r(),ff(e)}function hf(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function gf(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){hf(e.loadIcons(r,n,t),t=>{mf(e,r,t)});return}if(i){r.forEach(r=>{hf(i(r,n,t),t=>{mf(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=pf(r);if(o.length&&mf(e,o,null),!a.length)return;let s=n.match(md)?Rd(t):null;if(!s){mf(e,a,null);return}s.prepare(t,n,a).forEach(n=>{uf(t,n,t=>{mf(e,n.icons,t)})})}))}var _f=(e,t)=>{let n=tf(nf(e,!0,vd()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,df)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(dd(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=dd(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&gf(e,t)}),t?ef(t,n,i):df};function vf(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in Sd?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var yf=/[\s,]+/;function bf(e,t){t.split(yf).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function xf(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function Sf(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Cf(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function wf(e){return`data:image/svg+xml,`+Cf(e)}function Tf(e){return`url("`+wf(e)+`")`}var Ef;function Df(){try{Ef=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{Ef=null}}function Of(e){return Ef===void 0&&Df(),Ef?Ef.createHTML(e):e}var kf={...Cd,inline:!1},Af={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},jf={display:`inline-block`},Mf={backgroundColor:`currentColor`},Nf={backgroundColor:`transparent`},Pf={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},Ff={WebkitMask:Mf,mask:Mf,background:Nf};for(let e in Ff){let t=Ff[e];for(let n in Pf)t[e+n]=Pf[n]}var If={...kf,inline:!0};function Lf(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Rf=(e,t,n)=>{let r=t.inline?If:kf,i=vf(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?Af:{}};if(n){let e=hd(n,!1,!0);if(e){let t=[`iconify`];for(let n of[`provider`,`prefix`])e[n]&&t.push(`iconify--`+e[n]);c.className=t.join(` `)}}for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`children`:case`onLoad`:case`mode`:case`ssr`:case`fallback`:break;case`_ref`:c.ref=n;break;case`className`:c[e]=(c[e]?c[e]+` `:``)+n;break;case`inline`:case`hFlip`:case`vFlip`:i[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&bf(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=xf(n):typeof n==`number`&&(i[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete c[`aria-hidden`];break;default:r[e]===void 0&&(c[e]=n)}}let l=jd(e,i),u=l.attributes;if(i.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){c.style={...o,...s},Object.assign(c,u);let e=0,n=t.id;return typeof n==`string`&&(n=n.replace(/-/g,`_`)),c.dangerouslySetInnerHTML={__html:Of(Fd(l.body,n?()=>n+`ID`+ e++:`iconifyReact`))},(0,P.createElement)(`svg`,c)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=Sf(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":Tf(h),width:Lf(u.width),height:Lf(u.height),...jf,...m?Mf:Nf,...s},(0,P.createElement)(`span`,c)};if(vd(!0),Ld(``,Xd),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!xd(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Ud(e,r)||console.error(n)}catch{console.error(n)}}}}function zf(e){let[t,n]=(0,P.useState)(!!e.ssr),[r,i]=(0,P.useState)({});function a(t){if(t){let t=e.icon;if(typeof t==`object`)return{name:``,data:t};let n=yd(t);if(n)return{name:t,data:n}}return{name:``}}let[o,s]=(0,P.useState)(a(!!e.ssr));function c(){let e=r.callback;e&&(e(),i({}))}function l(e){if(JSON.stringify(o)!==JSON.stringify(e))return c(),s(e),!0}function u(){var t;let n=e.icon;if(typeof n==`object`){l({name:``,data:n});return}let r=yd(n);l({name:n,data:r})&&(r===void 0?i({callback:_f([n],u)}):r&&((t=e.onLoad)==null||t.call(e,n)))}(0,P.useEffect)(()=>(n(!0),c),[]),(0,P.useEffect)(()=>{t&&u()},[e.icon,t]);let{name:d,data:f}=o;return f?Rf({...ed,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,P.createElement)(`span`,{})}var Bf=(0,P.forwardRef)((e,t)=>zf({...e,_ref:t}));(0,P.forwardRef)((e,t)=>zf({inline:!0,...e,_ref:t}));var Vf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#c5c5c5" d="M20.414 2H5v28h22V8.586ZM7 28V4h12v6h6v18Z"/>`}})),Hf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#00007f" d="M17.229 4a.9.9 0 0 0-.569.232l-7.6 6.32a1.158 1.158 0 0 1-.955.328H3.208A1.2 1.2 0 0 0 2 12.088v7.826a1.2 1.2 0 0 0 1.208 1.206H8.1a1.158 1.158 0 0 1 .955.328l7.6 6.32c.521.433 1.081.224 1.081-.289V4.522A.494.494 0 0 0 17.229 4ZM27 6.3l-1.791 1.793a14.708 14.708 0 0 1 0 15.844l1.785 1.776A17.19 17.19 0 0 0 27 6.3Zm-4.333 4.323L20.905 12.4a6.035 6.035 0 0 1 0 7.237l1.756 1.756a8.554 8.554 0 0 0 .01-10.769Z"/>`}})),Uf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fbf0df" d="M29 17c0 5.65-5.82 10.23-13 10.23S3 22.61 3 17c0-3.5 2.24-6.6 5.66-8.44S14.21 4.81 16 4.81s3.32 1.54 7.34 3.71C26.76 10.36 29 13.46 29 17Z"/><path fill="none" stroke="#000" d="M16 27.65c7.32 0 13.46-4.65 13.46-10.65c0-3.72-2.37-7-5.89-8.85c-1.39-.75-2.46-1.41-3.37-2l-1.13-.69A6.14 6.14 0 0 0 16 4.35a6.88 6.88 0 0 0-3.3 1.23c-.42.24-.86.51-1.32.8c-.87.54-1.83 1.13-3 1.73C4.91 10 2.54 13.24 2.54 17c0 6 6.14 10.65 13.46 10.65Z"/><ellipse cx="21.65" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28"/><ellipse cx="10.41" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28"/><path fill-rule="evenodd" d="M11.43 18.11a2 2 0 1 0-2-2.05a2.05 2.05 0 0 0 2 2.05Zm9.2 0a2 2 0 1 0-2-2.05a2 2 0 0 0 2 2.05Z"/><path fill="#fff" fill-rule="evenodd" d="M10.79 16.19a.77.77 0 1 0-.76-.77a.76.76 0 0 0 .76.77Zm9.2 0a.77.77 0 1 0 0-1.53a.77.77 0 0 0 0 1.53Z"/><path fill="#b71422" stroke="#000" stroke-width=".75" d="M18.62 19.67a3.3 3.3 0 0 1-1.09 1.75a2.48 2.48 0 0 1-1.5.69a2.53 2.53 0 0 1-1.5-.69a3.28 3.28 0 0 1-1.08-1.75a.26.26 0 0 1 .29-.3h4.58a.27.27 0 0 1 .3.3Z"/><path fill="#ccbea7" fill-rule="evenodd" d="M14.93 5.75a6.09 6.09 0 0 1-2.09 4.62c-.1.09 0 .27.11.22c1.25-.49 2.94-1.94 2.23-4.88c-.03-.15-.25-.11-.25.04Zm.85 0a6 6 0 0 1 .57 5c0 .13.12.24.21.13c.83-1 1.54-3.11-.59-5.31c-.1-.11-.27.04-.19.17Zm1-.06a6.09 6.09 0 0 1 2.53 4.38c0 .14.21.17.24 0c.34-1.3.15-3.51-2.66-4.66c-.12-.02-.21.18-.09.27ZM9.94 9.55a6.27 6.27 0 0 0 3.89-3.33c.07-.13.28-.08.25.07c-.64 3-2.79 3.59-4.13 3.51c-.14-.01-.14-.21-.01-.25Z"/>`}})),Wf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#99b8c4" d="m23.265 24.381l.9-.894c4.164.136 4.228-.01 4.411-.438l1.144-2.785l.085-.264l-.093-.231c-.049-.122-.2-.486-2.8-2.965V15.5c3-2.89 2.936-3.038 2.765-3.461l-1.139-2.814c-.171-.422-.236-.587-4.37-.474l-.9-.93a20.166 20.166 0 0 0-.141-4.106l-.116-.263l-2.974-1.3c-.438-.2-.592-.272-3.4 2.786l-1.262-.019c-2.891-3.086-3.028-3.03-3.461-2.855L9.149 3.182c-.433.175-.586.237-.418 4.437l-.893.89c-4.162-.136-4.226.012-4.407.438l-1.146 2.786l-.09.267l.094.232c.049.12.194.48 2.8 2.962v1.3c-3 2.89-2.935 3.038-2.763 3.462l1.138 2.817c.174.431.236.584 4.369.476l.9.935a20.243 20.243 0 0 0 .137 4.1l.116.265l2.993 1.308c.435.182.586.247 3.386-2.8l1.262.016c2.895 3.09 3.043 3.03 3.466 2.859l2.759-1.115c.436-.173.588-.234.413-4.436Zm-11.858-6.524a4.957 4.957 0 1 1 6.488 2.824a5.014 5.014 0 0 1-6.488-2.824Z"/>`}})),Gf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#984c93" d="M14.742 24.047a10.242 10.242 0 0 1-4.673.919a7.628 7.628 0 0 1-5.914-2.346A8.876 8.876 0 0 1 2 16.369a9.476 9.476 0 0 1 2.422-6.748a8.216 8.216 0 0 1 6.285-2.588a11.151 11.151 0 0 1 4.035.641v3.761A6.839 6.839 0 0 0 11 10.395a4.813 4.813 0 0 0-3.712 1.535a5.9 5.9 0 0 0-1.413 4.159A5.8 5.8 0 0 0 7.209 20.1a4.57 4.57 0 0 0 3.59 1.493a7.319 7.319 0 0 0 3.943-1.113Zm2.37-9.218v-2.344h2.344v2.344H21.8v2.343h-2.344v2.343h-2.344v-2.343H14.77v-2.344l2.342.001zm8.201 0v-2.344h2.344v2.344H30v2.343h-2.343v2.343h-2.344v-2.343h-2.342v-2.344l2.342.001z"/>`}})),Kf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#368832" d="M19.792 7.071h2.553v2.553H24.9V7.071h2.552v2.553H30v2.552h-2.55v2.551H30v2.553h-2.551v2.552H24.9v-2.55h-2.55v2.552h-2.557v-2.55H17.24v-2.559h2.553v-2.546H17.24V9.622h2.554Zm2.553 7.658H24.9v-2.553h-2.555Zm-7.656 9.284a10.2 10.2 0 0 1-4.653.915a7.6 7.6 0 0 1-5.89-2.336A8.839 8.839 0 0 1 2 16.367a9.436 9.436 0 0 1 2.412-6.719a8.181 8.181 0 0 1 6.259-2.577a11.1 11.1 0 0 1 4.018.638v3.745a6.81 6.81 0 0 0-3.723-1.036a4.793 4.793 0 0 0-3.7 1.529a5.879 5.879 0 0 0-1.407 4.142a5.774 5.774 0 0 0 1.328 3.992a4.551 4.551 0 0 0 3.575 1.487a7.288 7.288 0 0 0 3.927-1.108Z"/>`}})),qf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#1572b6" d="M5.902 27.201L3.656 2h24.688l-2.249 25.197L15.985 30L5.902 27.201z"/><path fill="#33a9dc" d="m16 27.858l8.17-2.265l1.922-21.532H16v23.797z"/><path fill="#fff" d="M16 13.191h4.09l.282-3.165H16V6.935h7.75l-.074.829l-.759 8.518H16v-3.091z"/><path fill="#ebebeb" d="m16.019 21.218l-.014.004l-3.442-.93l-.22-2.465H9.24l.433 4.853l6.331 1.758l.015-.004v-3.216z"/><path fill="#fff" d="m19.827 16.151l-.372 4.139l-3.447.93v3.216l6.336-1.756l.047-.522l.537-6.007h-3.101z"/><path fill="#ebebeb" d="M16.011 6.935v3.091H8.545l-.062-.695l-.141-1.567l-.074-.829h7.743zM16 13.191v3.091h-3.399l-.062-.695l-.14-1.567l-.074-.829H16z"/>`}})),Jf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#3a4e55" d="M18.191 13.071H20.7v2.566h1.27a5.5 5.5 0 0 0 1.744-.292a4.462 4.462 0 0 0 .848-.383a3.149 3.149 0 0 1-.589-1.623a3.427 3.427 0 0 1 .616-2.416l.264-.305l.314.253a4 4 0 0 1 1.575 2.538a3.837 3.837 0 0 1 2.913.271l.345.2l-.181.354a3.629 3.629 0 0 1-3.648 1.74c-2.173 5.413-6.9 7.976-12.642 7.976A7.958 7.958 0 0 1 6.3 20.211l-.025-.043l-.226-.459a7.28 7.28 0 0 1-.579-3.693l.035-.38h2.143v-2.565h2.51v-2.51h5.02v-2.51h3.012v5.02Z"/><path fill="#00aada" d="M26.324 14.021a3.311 3.311 0 0 0-1.418-2.821a3.072 3.072 0 0 0 .289 3.821a5.279 5.279 0 0 1-3.225 1.037H5.883a6.779 6.779 0 0 0 .667 3.737l.183.335a6.2 6.2 0 0 0 .379.569q.992.064 1.829.045a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.4 8.4 0 0 1-1.845.3c.044 0-.046.007-.046.007l-.082.007a21.455 21.455 0 0 1-2.008-.006l-.01.007a7.882 7.882 0 0 0 6.063 2.41c5.56 0 10.276-2.465 12.365-8c1.482.152 2.906-.226 3.553-1.49a3.5 3.5 0 0 0-3.122-.022"/><path fill="#27b9ec" d="M26.324 14.021a3.311 3.311 0 0 0-1.418-2.821a3.072 3.072 0 0 0 .289 3.821a5.279 5.279 0 0 1-3.225 1.037H6.836a5.223 5.223 0 0 0 2.106 4.686a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.83 8.83 0 0 1-1.894.314l-.019-.022c1.892.971 4.636.967 7.782-.241a21.868 21.868 0 0 0 9.1-6.889l-.1.048"/><path fill="#088cb9" d="M5.913 17.732a6.431 6.431 0 0 0 .637 2.061l.183.335a6.2 6.2 0 0 0 .379.569q.992.064 1.829.045a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.826 8.826 0 0 1-1.891.307h-.1c-.291.016-.6.026-.922.026c-.351 0-.709-.007-1.1-.026a7.913 7.913 0 0 0 6.076 2.413c4.76 0 8.9-1.807 11.3-5.8Z"/><path fill="#039cc7" d="M6.98 17.732a4.832 4.832 0 0 0 1.961 3.01a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.959 8.959 0 0 1-1.9.307c1.892.971 4.628.957 7.773-.252a20.545 20.545 0 0 0 5.377-3.13Z"/><path fill="#00acd3" d="M9.889 13.671h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H9.23v-1.813Zm-.33 0h.179v1.813H8.9v-1.813Zm-.33 0h.179v1.813H8.57v-1.813Zm-.323 0h.172v1.813h-.17v-1.813Zm-.181-.181h2.175v2.176H8.066V13.49Zm4.335-2.329h.172v1.813H12.4v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.178v1.813h-.178v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175v-2.177Z"/><path fill="#26c2ee" d="M12.4 13.671h.172v1.813H12.4v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.178v1.813h-.178v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175V13.49Z"/><path fill="#00acd3" d="M14.909 13.671h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.181v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.174V13.49Z"/><path fill="#26c2ee" d="M14.909 11.161h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.181v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.174v-2.177Zm4.335 2.691h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H16.1v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.177-.181h2.176v2.176H15.6V13.49Z"/><path fill="#00acd3" d="M17.42 11.161h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H16.1v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176H15.6v-2.177Z"/><path fill="#26c2ee" d="M17.42 8.65h.172v1.813h-.172V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813H16.1V8.65Zm-.323 0h.172v1.813h-.172V8.65Zm-.177-.181h2.176v2.176H15.6V8.469Z"/><path fill="#00acd3" d="M19.93 13.671h.17v1.813h-.17v-1.813Zm-.33 0h.178v1.813H19.6v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175V13.49Z"/><path fill="#d5eef2" d="M12.616 19.193a.6.6 0 1 1-.6.6a.6.6 0 0 1 .6-.6"/><path fill="#3a4e55" d="M12.616 19.363a.431.431 0 0 1 .156.029a.175.175 0 1 0 .241.236a.43.43 0 1 1-.4-.265M2 17.949h27.92c-.608-.154-1.923-.362-1.707-1.159c-1.105 1.279-3.771.9-4.444.267c-.749 1.087-5.111.674-5.415-.173c-.939 1.1-3.85 1.1-4.789 0c-.3.847-4.666 1.26-5.415.173c-.673.631-3.338 1.012-4.444-.267c.217.8-1.1 1.005-1.707 1.159"/><path fill="#c0dbe1" d="M14.211 23.518a5.287 5.287 0 0 1-2.756-2.711a9.2 9.2 0 0 1-1.987.3q-.436.024-.917.025q-.554 0-1.168-.033a7.942 7.942 0 0 0 6.145 2.43q.344 0 .683-.013"/><path fill="#d5eef2" d="M12.007 21.773a5.206 5.206 0 0 1-.552-.966a9.2 9.2 0 0 1-1.987.3a6.325 6.325 0 0 0 2.539.664"/>`}})),Yf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<g fill-rule="evenodd"><path d="M3.167 3.167h25.667v25.667H3.167z"/><path fill="#ecd53f" fill-rule="nonzero" d="M30 2v28H2V2zM14.757 20.539H9.98v6.44h4.898v-1.085h-3.597V24.14h3.232v-1.085H11.28v-1.428h3.475v-1.09zm2.503 0h-1.264v6.44h1.207v-4.2l2.597 4.2h1.305v-6.44h-1.21v4.3l-2.635-4.301zm5.97 0h-1.41l2.303 6.44h1.388l2.306-6.44h-1.38l-1.577 4.766l-1.63-4.767zM8.3 24.96H6.34v1.96H8.3z"/></g>`}})),Xf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#4b32c3" d="m29.832 16.7l-6.354 10.717A1.256 1.256 0 0 1 22.36 28H9.647a1.262 1.262 0 0 1-1.118-.59l-6.356-10.7a1.256 1.256 0 0 1 0-1.272L8.527 4.676A1.344 1.344 0 0 1 9.647 4h12.709a1.344 1.344 0 0 1 1.118.678l6.354 10.786a1.2 1.2 0 0 1 0 1.238Zm-5.262 4.2v-9.614L16 6.466l-8.56 4.82V20.9L16 25.719Z"/><path fill="#8080f2" d="m21.802 19.188l-5.747 3.235l-5.742-3.235v-6.47l5.742-3.236l5.747 3.236v6.47z"/>`}})),Zf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeExcel0" x1="4.494" x2="13.832" y1="-2092.086" y2="-2075.914" gradientTransform="translate(0 2100)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#18884f"/><stop offset=".5" stop-color="#117e43"/><stop offset="1" stop-color="#0b6631"/></linearGradient></defs><path fill="#185c37" d="M19.581 15.35L8.512 13.4v14.409A1.192 1.192 0 0 0 9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5Z"/><path fill="#21a366" d="M19.581 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5L19.581 16l5.861 1.95L30 16V9.5Z"/><path fill="#107c41" d="M8.512 9.5h11.069V16H8.512Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypeExcel0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="m5.7 19.873l2.511-3.884l-2.3-3.862h1.847L9.013 14.6c.116.234.2.408.238.524h.017c.082-.188.169-.369.26-.546l1.342-2.447h1.7l-2.359 3.84l2.419 3.905h-1.809l-1.45-2.711A2.355 2.355 0 0 1 9.2 16.8h-.024a1.688 1.688 0 0 1-.168.351l-1.493 2.722Z"/><path fill="#33c481" d="M28.806 3h-9.225v6.5H30V4.191A1.192 1.192 0 0 0 28.806 3Z"/><path fill="#107c41" d="M19.581 16H30v6.5H19.581Z"/>`}})),Qf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cfcfcf" d="m12.677 17.781l-2.626-6.256l-2.694 6.256Zm6.723 6.511h-7.069v-1.365l.458-.023a1.847 1.847 0 0 0 .972-.2a.313.313 0 0 0 .145-.263a4.158 4.158 0 0 0-.419-1.4l-.812-1.931H7.322L6.4 21.259a3.319 3.319 0 0 0-.349 1.157c0 .036 0 .119.154.241a2.481 2.481 0 0 0 1.191.247l.448.033v1.354H2v-1.31l.4-.07a2.188 2.188 0 0 0 1-.318a6.318 6.318 0 0 0 1.18-2.066l5.575-13.036H11.2l5.512 13.174a5.255 5.255 0 0 0 1.049 1.835a1.959 1.959 0 0 0 1.19.4l.454.027Zm6.441-2.732v-3.985a22.542 22.542 0 0 0-2.226.97a3.845 3.845 0 0 0-1.29 1.05a2.03 2.03 0 0 0-.388 1.2a1.951 1.951 0 0 0 .491 1.362a1.49 1.49 0 0 0 1.13.544a4.142 4.142 0 0 0 2.283-1.141Zm-3.333 2.949a2.833 2.833 0 0 1-2.139-.893a3.206 3.206 0 0 1-.833-2.285a2.959 2.959 0 0 1 .415-1.577a5 5 0 0 1 1.791-1.625a23.876 23.876 0 0 1 3.617-1.588v-.074a2.905 2.905 0 0 0-.383-1.833a1.325 1.325 0 0 0-1.075-.412a1.155 1.155 0 0 0-.816.26a.687.687 0 0 0-.277.536l.023.646a1.62 1.62 0 0 1-.4 1.158a1.481 1.481 0 0 1-2.1-.019a1.634 1.634 0 0 1-.391-1.134a2.8 2.8 0 0 1 1.182-2.177a4.813 4.813 0 0 1 3.125-.932a5.381 5.381 0 0 1 2.508.524a2.628 2.628 0 0 1 1.213 1.346a6.391 6.391 0 0 1 .244 2.2v3.55a14.665 14.665 0 0 0 .051 1.749a.661.661 0 0 0 .054.2c.085-.078.284-.225.864-.806l.819-.828v1.967l-.1.128c-.958 1.283-1.883 1.907-2.83 1.907a1.6 1.6 0 0 1-1.257-.557a1.788 1.788 0 0 1-.358-.74a9.688 9.688 0 0 1-1.433.977a3.579 3.579 0 0 1-1.514.332Z"/>`}})),$f=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#dd4c35" d="M29.472 14.753L17.247 2.528a1.8 1.8 0 0 0-2.55 0l-2.539 2.539l3.22 3.22a2.141 2.141 0 0 1 2.712 2.73l3.1 3.1a2.143 2.143 0 1 1-1.285 1.21l-2.895-2.895v7.617a2.141 2.141 0 1 1-1.764-.062V12.3a2.146 2.146 0 0 1-1.165-2.814l-3.17-3.172L2.528 14.7a1.8 1.8 0 0 0 0 2.551l12.225 12.221a1.8 1.8 0 0 0 2.55 0L29.472 17.3a1.8 1.8 0 0 0 0-2.551"/><path fill="#fff" d="m12.158 5.067l3.22 3.22a2.141 2.141 0 0 1 2.712 2.73l3.1 3.1a2.143 2.143 0 1 1-1.285 1.21l-2.895-2.895v7.617a2.141 2.141 0 1 1-1.764-.062V12.3a2.146 2.146 0 0 1-1.165-2.814l-3.17-3.172"/>`}})),ep=n((e=>{e.__esModule=!0,e.default={width:254.5,height:225,body:`<path fill="#00acd7" d="M-46.926 89c-.621 0-.777-.311-.466-.777l3.262-4.194a2.225 2.225 0 0 1 1.708-.777h55.448c.621 0 .777.466.466.932l-2.64 4.038a2.367 2.367 0 0 1-1.553.932Zm-23.453 14.285c-.621 0-.777-.311-.466-.777l3.262-4.194a2.225 2.225 0 0 1 1.708-.777H4.95a.714.714 0 0 1 .777.932L4.484 102.2a1.358 1.358 0 0 1-1.4.932Zm37.587 14.289c-.621 0-.777-.466-.466-.932l2.174-3.883a2.06 2.06 0 0 1 1.553-.932H1.533c.621 0 .932.466.932 1.087l-.311 3.728a1.167 1.167 0 0 1-1.087 1.087ZM128.426 86.2c-9.785 2.485-16.464 4.349-26.093 6.834c-2.33.621-2.485.777-4.5-1.553c-2.33-2.64-4.038-4.349-7.3-5.9c-9.785-4.815-19.259-3.417-28.112 2.33c-10.561 6.834-16 16.929-15.842 29.51c.155 12.425 8.7 22.676 20.968 24.385c10.561 1.4 19.414-2.33 26.4-10.251c1.4-1.708 2.64-3.572 4.194-5.747H68.163c-3.262 0-4.038-2.019-2.951-4.659c2.019-4.815 5.747-12.891 7.921-16.929a4.194 4.194 0 0 1 3.883-2.485h56.535c-.311 4.194-.311 8.387-.932 12.581a66.239 66.239 0 0 1-12.736 30.442c-11.183 14.752-25.783 23.915-44.265 26.4c-15.221 2.019-29.355-.932-41.78-10.251a48.785 48.785 0 0 1-19.725-34.48c-2.019-16.929 2.951-32.15 13.2-45.508C38.342 66.475 52.942 57.312 70.8 54.05c14.6-2.64 28.578-.932 41.159 7.61a48.686 48.686 0 0 1 18.017 21.9c.935 1.398.313 2.175-1.55 2.64Z"/><path fill="#00acd7" d="M179.835 172.09c-14.134-.311-27.025-4.349-37.9-13.668a48.711 48.711 0 0 1-16.774-29.976c-2.8-17.551 2.019-33.082 12.581-46.905c11.338-14.91 25.006-22.676 43.488-25.938c15.842-2.8 30.753-1.243 44.265 7.921c12.27 8.387 19.88 19.725 21.9 34.635c2.64 20.968-3.417 38.052-17.861 52.652a71.17 71.17 0 0 1-37.276 19.88c-4.191.778-8.384.933-12.423 1.399Zm36.965-62.747a44.7 44.7 0 0 0-.466-5.125c-2.8-15.376-16.929-24.074-31.684-20.657c-14.444 3.262-23.763 12.425-27.18 27.025a25.579 25.579 0 0 0 14.289 29.355c8.542 3.728 17.085 3.262 25.317-.932c12.269-6.369 18.948-16.309 19.724-29.666Z"/>`}})),tp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e10098" d="M4.781 22.746L16.232 2.914l1.028.593L5.81 23.34z"/><path fill="#e10098" d="M4.545 21.162h22.902v1.187H4.545z"/><path fill="#e10098" d="m4.999 21.828l.593-1.028l11.455 6.614l-.594 1.028zM14.95 4.59l.594-1.027l11.455 6.614l-.594 1.028z"/><path fill="#e10098" d="M5.002 10.174L16.456 3.56l.594 1.028l-11.455 6.614z"/><path fill="#e10098" d="m14.743 3.508l1.028-.594l11.45 19.833l-1.027.593zM5.454 9.386h1.187v13.228H5.454z"/><path fill="#e10098" d="M25.36 9.386h1.187v13.228H25.36z"/><path fill="#e10098" d="m15.734 27.042l9.962-5.752l.519.898l-9.963 5.752z"/><path fill="#e10098" d="M28.12 23a2.5 2.5 0 1 1-.915-3.411A2.5 2.5 0 0 1 28.12 23M8.2 11.5a2.5 2.5 0 1 1-.915-3.411A2.5 2.5 0 0 1 8.2 11.5M3.88 23a2.5 2.5 0 1 1 3.411.915A2.5 2.5 0 0 1 3.88 23M23.8 11.5a2.5 2.5 0 1 1 3.411.915A2.5 2.5 0 0 1 23.8 11.5M16 30a2.5 2.5 0 1 1 2.5-2.5A2.493 2.493 0 0 1 16 30m0-23.009a2.5 2.5 0 1 1 2.5-2.5a2.493 2.493 0 0 1-2.5 2.5"/>`}})),np=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e44f26" d="M5.902 27.201L3.655 2h24.69l-2.25 25.197L15.985 30L5.902 27.201z"/><path fill="#f1662a" d="m16 27.858l8.17-2.265l1.922-21.532H16v23.797z"/><path fill="#ebebeb" d="M16 13.407h-4.09l-.282-3.165H16V7.151H8.25l.074.83l.759 8.517H16v-3.091zm0 8.027l-.014.004l-3.442-.929l-.22-2.465H9.221l.433 4.852l6.332 1.758l.014-.004v-3.216z"/><path fill="#fff" d="M15.989 13.407v3.091h3.806l-.358 4.009l-3.448.93v3.216l6.337-1.757l.046-.522l.726-8.137l.076-.83h-7.185zm0-6.256v3.091h7.466l.062-.694l.141-1.567l.074-.83h-7.743z"/>`}})),rp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#2dcc9f" d="M30 5.851v20.298H2V5.851h28"/><path fill="#fff" d="M24.232 8.541a2.2 2.2 0 1 0 1.127.623a2.212 2.212 0 0 0-1.127-.623M18.111 20.1q-2.724-3.788-5.45-7.575L4.579 23.766h10.9q1.316-1.832 2.634-3.663M22.057 16q-2.793 3.882-5.584 7.765h11.169Q24.851 19.882 22.057 16Z"/>`}})),ip=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#5382a1" d="M12.325 23.654s-1.07.622.761.833a16.023 16.023 0 0 0 5.8-.246a10.088 10.088 0 0 0 1.541.752c-5.481 2.349-12.405-.136-8.1-1.339m-.671-3.066s-1.2.888.633 1.078a22.618 22.618 0 0 0 7.481-.359a3.32 3.32 0 0 0 1.152.7c-6.627 1.938-14.009.153-9.266-1.421m5.644-5.198a2.051 2.051 0 0 1-.355 2.954s3.429-1.77 1.854-3.987c-1.471-2.067-2.6-3.095 3.508-6.636c0 0-9.586 2.394-5.007 7.669"/><path fill="#5382a1" d="M24.552 25.921s.792.652-.872 1.157c-3.164.958-13.168 1.248-15.948.038c-1-.435.874-1.038 1.464-1.164a3.8 3.8 0 0 1 .966-.108c-1.111-.783-7.181 1.537-3.083 2.2c11.176 1.812 20.372-.816 17.473-2.124M12.84 17.412s-5.089 1.209-1.8 1.648a38.225 38.225 0 0 0 6.731-.072a53.11 53.11 0 0 0 4.221-.555a8.934 8.934 0 0 0-1.28.685c-5.168 1.359-15.151.727-12.277-.663a9.629 9.629 0 0 1 4.407-1.042m9.127 5.102c5.253-2.73 2.824-5.353 1.129-5a3.932 3.932 0 0 0-.6.161a.957.957 0 0 1 .449-.346c3.354-1.179 5.933 3.478-1.083 5.322a.458.458 0 0 0 .106-.138M18.8 2s2.909 2.91-2.759 7.386c-4.546 3.59-1.037 5.637 0 7.975c-2.653-2.394-4.6-4.5-3.294-6.463C14.664 8.019 19.976 6.623 18.8 2"/><path fill="#5382a1" d="M13.356 29.912c5.042.323 12.786-.179 12.969-2.565c0 0-.353.9-4.167 1.623a41.458 41.458 0 0 1-12.76.2s.645.533 3.959.746"/>`}})),ap=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f5de19" d="M18.774 19.7a3.727 3.727 0 0 0 3.376 2.078c1.418 0 2.324-.709 2.324-1.688c0-1.173-.931-1.589-2.491-2.272l-.856-.367c-2.469-1.052-4.11-2.37-4.11-5.156c0-2.567 1.956-4.52 5.012-4.52A5.058 5.058 0 0 1 26.9 10.52l-2.665 1.711a2.327 2.327 0 0 0-2.2-1.467a1.489 1.489 0 0 0-1.638 1.467c0 1.027.636 1.442 2.1 2.078l.856.366c2.908 1.247 4.549 2.518 4.549 5.376c0 3.081-2.42 4.769-5.671 4.769a6.575 6.575 0 0 1-6.236-3.5ZM6.686 20c.538.954 1.027 1.76 2.2 1.76c1.124 0 1.834-.44 1.834-2.15V7.975h3.422v11.683c0 3.543-2.078 5.156-5.11 5.156A5.312 5.312 0 0 1 3.9 21.688Z"/>`}})),op=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f5de19" d="M4.014 14.976a2.51 2.51 0 0 0 1.567-.518a2.377 2.377 0 0 0 .805-1.358a15.261 15.261 0 0 0 .214-2.944q.012-2.085.075-2.747a5.236 5.236 0 0 1 .418-1.686a3.025 3.025 0 0 1 .755-1.018A3.046 3.046 0 0 1 9 4.125A6.762 6.762 0 0 1 10.544 4h.7v1.96h-.387a2.338 2.338 0 0 0-1.723.468a3.4 3.4 0 0 0-.425 2.092a36.054 36.054 0 0 1-.137 4.133a4.734 4.734 0 0 1-.768 2.06A4.567 4.567 0 0 1 6.1 16a3.809 3.809 0 0 1 1.992 1.754a8.861 8.861 0 0 1 .618 3.865q0 2.435.05 2.9a1.755 1.755 0 0 0 .504 1.181a2.639 2.639 0 0 0 1.592.337h.387V28h-.7a5.655 5.655 0 0 1-1.773-.2a2.97 2.97 0 0 1-1.324-.93a3.353 3.353 0 0 1-.681-1.63a24.175 24.175 0 0 1-.165-3.234a16.469 16.469 0 0 0-.214-3.106a2.408 2.408 0 0 0-.805-1.361a2.489 2.489 0 0 0-1.567-.524Zm23.972 2.035a2.489 2.489 0 0 0-1.567.524a2.408 2.408 0 0 0-.805 1.361a16.469 16.469 0 0 0-.212 3.109a24.175 24.175 0 0 1-.169 3.234a3.353 3.353 0 0 1-.681 1.63a2.97 2.97 0 0 1-1.324.93a5.655 5.655 0 0 1-1.773.2h-.7V26.04h.387a2.639 2.639 0 0 0 1.592-.337a1.755 1.755 0 0 0 .506-1.186q.05-.462.05-2.9a8.861 8.861 0 0 1 .618-3.865A3.809 3.809 0 0 1 25.9 16a4.567 4.567 0 0 1-1.7-1.286a4.734 4.734 0 0 1-.768-2.06a36.054 36.054 0 0 1-.137-4.133a3.4 3.4 0 0 0-.425-2.092a2.338 2.338 0 0 0-1.723-.468h-.387V4h.7a6.762 6.762 0 0 1 1.54.125a3.046 3.046 0 0 1 1.149.581a3.025 3.025 0 0 1 .755 1.018a5.236 5.236 0 0 1 .418 1.686q.062.662.075 2.747a15.261 15.261 0 0 0 .212 2.947a2.377 2.377 0 0 0 .805 1.355a2.51 2.51 0 0 0 1.567.518Z"/>`}})),sp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeKotlin0" x1="311.336" x2="283.342" y1="1452.064" y2="1480.058" gradientTransform="translate(-281.4 -1450)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#e44857"/><stop offset=".47" stop-color="#9d4b9d"/><stop offset="1" stop-color="#6d5faa"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypeKotlin0)" d="M30 30H2V2h28L16 16Z"/>`}})),cp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeLicense0" x1="-264.845" x2="-255.586" y1="181.772" y2="182.061" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#bd6316"/><stop offset="1" stop-color="#4e1500"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense1" x1="-263.276" x2="-256.603" y1="170.205" y2="171.772" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense2" x1="-265.068" x2="-256.777" y1="175.732" y2="178.801" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense3" x1="-655.014" x2="-655.555" y1="147.549" y2="146.948" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffd436"/><stop offset="1" stop-color="#8b3f02"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense4" x1="-258.899" x2="-253.843" y1="170.981" y2="171.325" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff8b7"/><stop offset="1" stop-color="#fcbf0e"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense5" x1="-258.884" x2="-253.896" y1="170.975" y2="171.314" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense6" x1="-257.805" x2="-257.726" y1="172.266" y2="168.648" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense7" x1="-258.935" x2="-256.173" y1="181.92" y2="182.108" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense8" x1="-274.156" x2="-274.512" y1="170.544" y2="173.778" gradientTransform="matrix(-1 0 0 1 -257.657 -155.509)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense9" x1="-645.79" x2="-645.121" y1="-337.938" y2="-334.17" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffef94"/><stop offset="1" stop-color="#ffd200"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicensea" x1="-276.128" x2="-274.754" y1="178.682" y2="178.682" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseb" x1="-274.314" x2="-271.841" y1="178.887" y2="178.987" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensec" x1="-273.817" x2="-274.213" y1="189.281" y2="174.569" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#d89530"/><stop offset="1" stop-color="#772d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicensed" x1="-274.075" x2="-273.917" y1="174.09" y2="181.459" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensee" x1="-272.919" x2="-273.315" y1="189.281" y2="174.57" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensef" x1="-273.177" x2="-273.019" y1="174.071" y2="181.44" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseg" x1="-652.29" x2="-651.867" y1="-335.227" y2="-332.867" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffdb57"/><stop offset="1" stop-color="#b55c13"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicenseh" x1="-665.076" x2="-659.751" y1="157.413" y2="150.922" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensei" x1="-665.161" x2="-664.822" y1="156.114" y2="155.701" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensej" x1="-665.308" x2="-665.836" y1="156.436" y2="155.32" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensek" x1="-655.442" x2="-654.817" y1="147.568" y2="146.776" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensel" x1="-253.999" x2="-254.134" y1="175.1" y2="173.736" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensem" x1="-252.571" x2="-252.785" y1="173.138" y2="170.963" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensen" x1="-257.206" x2="-259.174" y1="169.107" y2="169.787" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicenseo" x1="-260.717" x2="-260.77" y1="170.284" y2="171.228" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensep" x1="-257.835" x2="-257.782" y1="174.993" y2="171.93" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseq" x1="-263.928" x2="-255.721" y1="171.018" y2="171.018" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenser" x1="-514.299" x2="-505.041" y1="-57.926" y2="-57.638" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenses" x1="-512.744" x2="-505.964" y1="-69.496" y2="-67.904" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenset" x1="-514.521" x2="-506.23" y1="-63.966" y2="-60.897" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenseu" x1="-662.221" x2="-662.762" y1="-197.167" y2="-197.768" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensev" x1="-508.354" x2="-503.297" y1="-68.717" y2="-68.373" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicensew" x1="-508.338" x2="-503.351" y1="-68.723" y2="-68.384" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicensex" x1="-507.26" x2="-507.18" y1="-67.432" y2="-71.05" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensey" x1="-508.389" x2="-505.627" y1="-57.779" y2="-57.591" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicensez" x1="-523.609" x2="-523.966" y1="-69.153" y2="-65.918" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense10" x1="-645.333" x2="-642.973" y1="-334.169" y2="-332.091" href="#vscodeIconsFileTypeLicense9"/><linearGradient id="vscodeIconsFileTypeLicense11" x1="-525.581" x2="-524.207" y1="-61.015" y2="-61.015" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense12" x1="-523.768" x2="-521.294" y1="-60.81" y2="-60.71" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense13" x1="-523.27" x2="-523.666" y1="-50.416" y2="-65.127" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense14" x1="-523.528" x2="-523.37" y1="-65.606" y2="-58.238" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense15" x1="-522.372" x2="-522.768" y1="-50.416" y2="-65.127" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense16" x1="-522.631" x2="-522.472" y1="-65.626" y2="-58.257" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense17" x1="-649.116" x2="-646.827" y1="-328.591" y2="-326.795" href="#vscodeIconsFileTypeLicense9"/><linearGradient id="vscodeIconsFileTypeLicense18" x1="-672.284" x2="-666.958" y1="-187.303" y2="-193.795" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense19" x1="-672.369" x2="-672.03" y1="-188.603" y2="-189.016" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1a" x1="-672.516" x2="-673.044" y1="-188.281" y2="-189.397" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1b" x1="-662.648" x2="-662.023" y1="-197.148" y2="-197.94" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1c" x1="-503.367" x2="-503.501" y1="-64.607" y2="-65.971" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1d" x1="-502.006" x2="-502.232" y1="-66.361" y2="-68.654" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1e" x1="-506.661" x2="-508.629" y1="-70.591" y2="-69.911" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1f" x1="-510.172" x2="-510.224" y1="-69.414" y2="-68.47" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1g" x1="-507.289" x2="-507.236" y1="-64.705" y2="-67.768" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1h" x1="-642.337" x2="-640.048" y1="-337.231" y2="-335.435" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffdb57"/><stop offset="1" stop-color="#b66512"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense1i" x1="-628.479" x2="-627.663" y1="-215.005" y2="-209.203" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense1j" x1="-633.006" x2="-622.552" y1="-211.18" y2="-211.18" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense1k" x1="-627.491" x2="-627.755" y1="-215.556" y2="-211.648" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1l" x1="-627.796" x2="-627.057" y1="-210.705" y2="-205.186" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1m" x1="245.815" x2="245.923" y1="139.434" y2="136.367" gradientTransform="rotate(7.312 1187.515 -1764.249)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense1n" x1="-626.269" x2="-627.643" y1="-215.112" y2="-213.078" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/></defs><path fill="url(#vscodeIconsFileTypeLicense0)" d="m13.372 16.416l5.013-2.464l.93 1.893l-.054.238l-2.048 1.007l5.706 11.611l-.221.359l-1.543.758l-.82-.45l-5.459-11.109l-.482.237l-1.022-2.08z"/><path fill="url(#vscodeIconsFileTypeLicense1)" d="m9.24 13.619l1.2 2.44c.072.146.416.252.617.292l2.634.683l4.609-2.268l.867-2.342a.679.679 0 0 0 .036-.674l-1.2-2.44a.546.546 0 0 0-.452-.3l-4.44.136a1.278 1.278 0 0 0-1.018.541l-2.72 3.162a.916.916 0 0 0-.133.77Zm1.932.033a.356.356 0 0 1 .011-.334l1.84-2.215a.829.829 0 0 1 .66-.351l2.877-.088a.355.355 0 0 1 .293.2l.356.725a.242.242 0 0 1-.139.339L11.833 14.5a.224.224 0 0 1-.3-.121Z"/><path fill="url(#vscodeIconsFileTypeLicense2)" d="m9.426 13.209l1.2 2.44c.072.146.416.252.617.292l2.7.547l.782 1.591l.375-.179l5.459 11.109l.82.451l1.541-.76l-.017-.683l.868-1.458l-.241-.49l-.54.1l-.31-.63l.41-.366l-.59-1.199l-.593-.006l-.277-.564l.357-.473l-.3-.607l-.568.043l-.432-.879l.382-.423l-.161-.327a.871.871 0 0 1-.659-1.342l-.345-.7a1.347 1.347 0 0 1-.962-1.956l-.29-.591l.631-.31l-.773-1.546l.843-2.277a.68.68 0 0 0 .035-.674l-1.2-2.44a.546.546 0 0 0-.453-.3l-4.435.131a1.278 1.278 0 0 0-1.018.541l-2.84 3.419a.548.548 0 0 0-.016.516Zm1.932.033a.356.356 0 0 1 .011-.334l1.84-2.215a.828.828 0 0 1 .66-.351l2.877-.088a.354.354 0 0 1 .293.2l.356.725a.242.242 0 0 1-.139.339l-5.238 2.574a.224.224 0 0 1-.3-.121Z"/><path fill="url(#vscodeIconsFileTypeLicense3)" d="m14.47 18.381l.276-.318l.335-.164l-.139.245l-.472.237z"/><path fill="url(#vscodeIconsFileTypeLicense4)" d="m11.259 15.828l2.776.6l4.38-2.152l.865-2.339a.576.576 0 0 0 .024-.567L18.1 8.917a.441.441 0 0 0-.367-.246l-4.438.13a1.169 1.169 0 0 0-.938.5L9.52 12.725a.447.447 0 0 0-.011.414l1.206 2.453a1 1 0 0 0 .544.236Zm.354-1.836l-.358-.729a.463.463 0 0 1 .013-.434v-.008l1.853-2.221a.922.922 0 0 1 .739-.389l2.881-.084a.468.468 0 0 1 .392.257l.358.729c.005.009.19.3-.187.481l-5.244 2.577c-.272.129-.44-.164-.447-.179Z"/><path fill="url(#vscodeIconsFileTypeLicense5)" d="M11.246 15.738c.006 0 2.438.51 2.751.591l4.354-2.139l.878-2.336a.472.472 0 0 0 .015-.458l-1.208-2.458a.337.337 0 0 0-.282-.187l-4.454.141a1.083 1.083 0 0 0-.864.46l-2.863 3.436a.341.341 0 0 0-.008.313l1.206 2.454a1.118 1.118 0 0 0 .475.183Zm.245-1.7l-.355-.723a.568.568 0 0 1 .018-.535v-.008l.01-.015l1.865-2.241a1.033 1.033 0 0 1 .824-.43l2.9-.091a.575.575 0 0 1 .492.316l.359.73a.456.456 0 0 1 .027.338a.484.484 0 0 1-.265.286l-5.287 2.6a.415.415 0 0 1-.331.025a.486.486 0 0 1-.258-.248Z"/><path fill="url(#vscodeIconsFileTypeLicense6)" d="M11.268 15.663c.009 0 2.53.528 2.722.577l4.3-2.113l.878-2.314a.419.419 0 0 0 .01-.4l-1.2-2.436a.282.282 0 0 0-.237-.156l-4.433.149a1.033 1.033 0 0 0-.82.437l-2.353 2.823l-.5.595a.285.285 0 0 0 0 .254l1.193 2.421a1.181 1.181 0 0 0 .44.163Zm.14-1.529l-.351-.715a.575.575 0 0 1-.011-.56l1.959-2.36a1.082 1.082 0 0 1 .86-.447l2.887-.1a.628.628 0 0 1 .538.341l.356.724a.539.539 0 0 1-.309.773l-5.267 2.588a.482.482 0 0 1-.662-.243Z"/><path fill="url(#vscodeIconsFileTypeLicense7)" d="m18.463 14.345l.7 1.433l-.653.321l.319.649a1.428 1.428 0 0 0 1 2.043l.3.619a.958.958 0 0 0 .706 1.436l.107.218l-.39.428l.5 1.011l.577-.047l.239.485l-.366.478l.336.683h.6l.523 1.065l-.419.371l.382.777l.549-.1l.181.368A96.344 96.344 0 0 1 22.8 28v.638l-1.342.659l-.729-.414l-5.488-11.176l-.467.23l-.7-1.433Z"/><path fill="url(#vscodeIconsFileTypeLicense8)" d="M14.289 15.413h4.622v1.4h-4.622z" transform="rotate(-26.171 16.6 16.113)"/><path fill="url(#vscodeIconsFileTypeLicense9)" d="m18.128 14.582l-.8.392l.617 1.256l.8-.392Zm-1.319.648l.617 1.256l.308-.152l-.617-1.256Z"/><path fill="url(#vscodeIconsFileTypeLicensea)" d="m18.4 16.123l.308.628a1.523 1.523 0 0 0 1.037 2.11l.263.535a1.052 1.052 0 0 0 .744 1.513l.054.111l-.381.423l.557 1.134l.567-.043l.177.36l-.357.472l.392.8l.591.006l.456.929l-.409.366l.45.917l.539-.1l.12.243L22.634 28l-1.027.5l-5.525-11.235Z"/><path fill="url(#vscodeIconsFileTypeLicenseb)" d="m17.141 16.745l5.528 11.248l.046.511l-1.247.613l-.613-.349l-5.483-11.154Z"/><path fill="url(#vscodeIconsFileTypeLicensec)" d="m22.287 28.694l.427-.21l-4.794-9.754l-1.028-1.554l.602 1.764l4.793 9.754z"/><path fill="url(#vscodeIconsFileTypeLicensed)" d="M16.892 17.176L22.5 28.589l-.213.105l-4.793-9.754l-.602-1.764z"/><path fill="url(#vscodeIconsFileTypeLicensee)" d="m21.481 29.09l.427-.209l-4.794-9.755l-1.028-1.554l.602 1.764l4.793 9.754z"/><path fill="url(#vscodeIconsFileTypeLicensef)" d="m16.086 17.572l5.608 11.413l-.213.105l-4.793-9.754l-.602-1.764z"/><path fill="url(#vscodeIconsFileTypeLicenseg)" d="m18.27 16.189l-.411.2l5.285 10.755l.279-.47l-.181-.369l-.386.072l-.45-.917l.294-.26l-.508-1.034h-.424l-.392-.8l.256-.338l-.237-.482l-.407.031l-.557-1.134l.273-.3l-.143-.291a1.038 1.038 0 0 1-.619-1.259l-.391-.8a1.505 1.505 0 0 1-.906-1.844Zm-.68.334l5.371 10.929l.108-.182l-5.319-10.825Z"/><path fill="url(#vscodeIconsFileTypeLicenseh)" d="m15.018 18.247l5.356 10.997l.196-.273l-5.391-11.032l-.161.308z"/><path fill="url(#vscodeIconsFileTypeLicensei)" d="m20.436 29.315l.211-.291l.705.361l-.203.294l-.713-.364z"/><path fill="url(#vscodeIconsFileTypeLicensej)" d="m21.446 29.41l-.179.26l1.382-.659l.131-.241l-1.334.64z"/><path fill="url(#vscodeIconsFileTypeLicensek)" d="m14.029 16.673l-.225.388l.601 1.293l.297-.354l-.673-1.327z"/><path fill="url(#vscodeIconsFileTypeLicensel)" d="m13.946 16.506l-.239.432l-2.944-.761l.124-.345l3.059.674z"/><path fill="url(#vscodeIconsFileTypeLicensem)" d="M9.359 13s-.145.444-.087.563l1.212 2.465l.2-.384Z"/><path fill="url(#vscodeIconsFileTypeLicensen)" d="m16.683 10.624l.1-.327l-2.963.095a.914.914 0 0 0-.51.251l-.007.165a1.871 1.871 0 0 1 .394-.1Z"/><path fill="url(#vscodeIconsFileTypeLicenseo)" d="M16.83 10.309a.329.329 0 0 1 .17.137l.382.762l-.164.279l-.341-.693c-.023-.047-.108-.145-.147-.149Z"/><path fill="url(#vscodeIconsFileTypeLicensep)" d="m11.237 13.786l.171.348a.482.482 0 0 0 .661.248l5.267-2.588a.539.539 0 0 0 .309-.773l-.153-.31l1.08-.531l.606 1.232a.419.419 0 0 1-.01.4l-.878 2.314l-4.3 2.113c-.191-.049-2.713-.575-2.722-.577a1.181 1.181 0 0 1-.439-.16l-.6-1.222Z"/><path fill="url(#vscodeIconsFileTypeLicenseq)" d="m13.377 8.968l.532 1.084l.539-.018l-.532-1.084Zm2.306-.077l-1.395.047l.533 1.084l1.4-.046Zm1.471 2.994l-1.142.561l1.106 2.25l1.142-.561Zm-1.447.711l-.441.217l1.106 2.251l.441-.217Z"/><path fill="url(#vscodeIconsFileTypeLicenser)" d="m10.65 14.159l5.287 1.803L15.623 18l-.173.134l-2.16-.737l-1.921 12.501l-.371.102l-1.627-.555l-.395-.913l1.838-11.961l-.508-.173l.344-2.239z"/><path fill="url(#vscodeIconsFileTypeLicenses)" d="m8.951 9.175l-.542 2.747a.567.567 0 0 0 .175.452l1.976 2.461l4.866 1.659l1.969-1.077a.535.535 0 0 0 .4-.463l.4-2.627a.659.659 0 0 0-.188-.544L14.453 8.7a1.313 1.313 0 0 0-1.1-.337l-3.874.345a.707.707 0 0 0-.528.467Zm1.5 1.407a.281.281 0 0 1 .192-.234l2.633-.256a.928.928 0 0 1 .724.315l2.3 2a.426.426 0 0 1 .121.352l-.1.651s-.027.237-.3.146L10.5 11.667a.269.269 0 0 1-.172-.305Z"/><path fill="url(#vscodeIconsFileTypeLicenset)" d="m9.322 9.01l-.4 2.627c-.024.157.188.481.324.653l1.817 2.33l-.263 1.714l.392.134l-1.843 11.959l.395.914l1.627.555l.363-.507l1.483-.436l.081-.528l-.479-.314l.1-.678l.523.028l.2-1.283l-.461-.428l.093-.608l.54-.087l.1-.653l-.469-.375l.145-.946l.532-.034l.054-.352a1.047 1.047 0 0 1-.29-.859a.688.688 0 0 1 .512-.585l.116-.756a1.6 1.6 0 0 1-.364-1.232a1.07 1.07 0 0 1 .688-.874l.1-.636l.666.227l.246-1.674l1.915-1.047a.535.535 0 0 0 .4-.463l.4-2.627a.657.657 0 0 0-.188-.544l-3.556-3.08a1.313 1.313 0 0 0-1.1-.336l-4.109.445a.434.434 0 0 0-.29.356Zm1.5 1.407a.281.281 0 0 1 .192-.234l2.663-.289a.852.852 0 0 1 .711.218l2.3 2a.427.427 0 0 1 .122.352l-.12.781s-.027.237-.3.146L10.871 11.5a.269.269 0 0 1-.171-.3Z"/><path fill="url(#vscodeIconsFileTypeLicenseu)" d="m10.428 16.37l.392-.033l.353.12l-.244.078l-.501-.165z"/><path fill="url(#vscodeIconsFileTypeLicensev)" d="m9.317 12.221l1.846 2.421l4.619 1.575l1.967-1.076a.454.454 0 0 0 .331-.393l.406-2.641a.53.53 0 0 0-.152-.441l-3.552-3.083a1.207 1.207 0 0 0-1.011-.31l-4.109.453a.354.354 0 0 0-.237.292l-.405 2.641a1.261 1.261 0 0 0 .297.562Zm1.289-1.077l.121-.785a.367.367 0 0 1 .25-.305h.008l2.675-.295a.953.953 0 0 1 .794.247l2.3 2a.563.563 0 0 1 .166.467l-.121.785c0 .01-.014.35-.411.215l-5.53-1.886a.423.423 0 0 1-.252-.443Z"/><path fill="url(#vscodeIconsFileTypeLicensew)" d="M9.356 12.146c0 .005 1.63 2.115 1.831 2.4l4.591 1.566l1.974-1.065a.372.372 0 0 0 .264-.321l.406-2.646a.405.405 0 0 0-.118-.338l-3.571-3.091a1.117 1.117 0 0 0-.931-.285l-4.133.444a.271.271 0 0 0-.179.221l-.406 2.642a1.421 1.421 0 0 0 .272.473Zm1.126-1.054l.12-.778a.451.451 0 0 1 .309-.375h.024l2.7-.29a1.07 1.07 0 0 1 .883.278l2.324 2.01a.694.694 0 0 1 .212.581l-.121.786a.38.38 0 0 1-.165.265a.417.417 0 0 1-.365.018l-5.576-1.9a.5.5 0 0 1-.273-.219a.55.55 0 0 1-.072-.377Z"/><path fill="url(#vscodeIconsFileTypeLicensex)" d="M9.415 12.108c.006.008 1.693 2.194 1.816 2.366l4.535 1.546l1.963-1.048a.33.33 0 0 0 .228-.282l.4-2.623a.339.339 0 0 0-.1-.283L14.7 8.719a1.066 1.066 0 0 0-.884-.271l-3.4.359l-.716.076a.226.226 0 0 0-.142.183s-.4 2.594-.4 2.611a1.506 1.506 0 0 0 .257.431Zm.952-1.007l.118-.77a.463.463 0 0 1 .3-.414l2.836-.308a1.12 1.12 0 0 1 .921.292l2.316 2a.758.758 0 0 1 .234.632s-.1.633-.12.779c-.034.219-.191.5-.668.339l-5.555-1.894a.584.584 0 0 1-.383-.657Z"/><path fill="url(#vscodeIconsFileTypeLicensey)" d="m15.781 16.3l-.237 1.543l-.689-.235l-.107.7a1.158 1.158 0 0 0-.7.917a1.723 1.723 0 0 0 .367 1.283l-.1.666a.765.765 0 0 0-.527.634a1.154 1.154 0 0 0 .29.912l-.036.235l-.542.031l-.167 1.088l.479.379l-.08.522l-.55.084l-.113.736l.471.432l-.176 1.146l-.532-.031l-.128.837l.488.317l-.061.4c-.09.027-1.455.411-1.455.411l-.352.462l-1.424-.483l-.343-.822l1.843-12.03l-.493-.168l.237-1.543Z"/><path fill="url(#vscodeIconsFileTypeLicensez)" d="m11.056 16.181l4.374 1.491l.208-1.352l-4.374-1.492l-.208 1.353z"/><path fill="url(#vscodeIconsFileTypeLicense10)" d="m15.388 16.234l-.842-.287l-.207 1.353l.841.287ZM14 15.76l-.208 1.353l.325.111l.208-1.353Z"/><path fill="url(#vscodeIconsFileTypeLicense11)" d="m14.756 17.55l-.1.676a1.251 1.251 0 0 0-.7.957A1.845 1.845 0 0 0 14.3 20.5l-.089.576a.844.844 0 0 0-.525.678a1.256 1.256 0 0 0 .275.95l-.018.119l-.531.034l-.188 1.221l.469.375l-.06.388l-.539.087l-.132.858l.46.427l-.154 1l-.522-.028l-.152.987l.478.314l-.04.262l-1.506.443l-1.083-.369l1.86-12.1Z"/><path fill="url(#vscodeIconsFileTypeLicense12)" d="m13.423 17.1l-1.86 12.1l-.246.4L10 29.16l-.289-.692l1.845-12.009Z"/><path fill="url(#vscodeIconsFileTypeLicense13)" d="m10.877 29.44l.45.154l1.614-10.501l.049-1.863l-.499 1.709l-1.614 10.501z"/><path fill="url(#vscodeIconsFileTypeLicense14)" d="m12.99 17.23l-1.888 12.287l-.225-.077l1.614-10.501l.499-1.709z"/><path fill="url(#vscodeIconsFileTypeLicense15)" d="m10.028 29.151l.449.153l1.614-10.501l.049-1.863l-.499 1.71l-1.613 10.501z"/><path fill="url(#vscodeIconsFileTypeLicense16)" d="m12.14 16.94l-1.887 12.287l-.225-.076l1.613-10.501l.499-1.71z"/><path fill="url(#vscodeIconsFileTypeLicense17)" d="m14.615 17.5l-.433-.148l-1.782 11.58l.478-.14l.061-.4l-.339-.222l.152-.987l.374.02l.171-1.113l-.33-.306l.132-.858l.387-.062l.08-.519l-.336-.268l.188-1.221l.381-.024l.048-.314a1.2 1.2 0 0 1-.154-.766a.85.85 0 0 1 .363-.59l.132-.856a1.79 1.79 0 0 1-.231-1.123a1.261 1.261 0 0 1 .536-.861Zm-.717-.244L12.09 29.024l.185-.054l1.791-11.655Z"/><path fill="url(#vscodeIconsFileTypeLicense18)" d="M10.932 16.665L9.075 28.47l.303-.058l1.85-11.855l-.296.108z"/><path fill="url(#vscodeIconsFileTypeLicense19)" d="m9.085 28.566l.325-.06l.354.766l-.321.068l-.358-.774z"/><path fill="url(#vscodeIconsFileTypeLicense1a)" d="m9.823 29.357l-.283.06l1.447.513l.235-.081l-1.399-.492z"/><path fill="url(#vscodeIconsFileTypeLicense1b)" d="m11.024 14.816l-.391.12l-.241 1.367l.429-.043l.203-1.444z"/><path fill="url(#vscodeIconsFileTypeLicense1c)" d="m11.05 14.636l-.425.141l-2.084-2.606l.483-.214l2.026 2.679z"/><path fill="url(#vscodeIconsFileTypeLicense1d)" d="M9.384 8.813s-.358.218-.378.346l-.546 2.773l.51-.253Z"/><path fill="url(#vscodeIconsFileTypeLicense1e)" d="m16.435 12.332l.256-.168l-2.375-2.052a.962.962 0 0 0-.538-.183l-.1.115a2.143 2.143 0 0 1 .362.211Z"/><path fill="url(#vscodeIconsFileTypeLicense1f)" d="M16.724 12.208a.393.393 0 0 1 .058.221c-.016.1-.112.774-.12.825l-.283.085l.115-.747a.4.4 0 0 0-.033-.213Z"/><path fill="url(#vscodeIconsFileTypeLicense1g)" d="m10.424 10.725l-.058.375a.584.584 0 0 0 .381.653l5.553 1.894c.478.163.634-.12.668-.339l.051-.334l1.139.388l-.2 1.327a.33.33 0 0 1-.228.282l-1.963 1.048l-4.535-1.546a358.09 358.09 0 0 0-1.816-2.366a1.506 1.506 0 0 1-.257-.43l.2-1.315Z"/><path fill="url(#vscodeIconsFileTypeLicense1h)" d="m14.756 8.764l-.179 1.166l.432.373l.179-1.167Zm1.851 1.595l-1.119-.965l-.179 1.167l1.119.965Zm-.5 3.223l-1.2-.411l-.372 2.423l1.2.411Zm-1.526-.52l-.461-.162l-.372 2.423l.465.159Z"/><path fill="url(#vscodeIconsFileTypeLicense1i)" d="M9.936 2.733c2.042-1.441 5.206-.715 7.065 1.8A6.169 6.169 0 0 1 18.27 9.1c-.219-.73-1.023-.427-1.664-.441a4.11 4.11 0 0 0-.763-3.207C14.6 3.778 12.41 3.1 11.07 4.094s-1.382 3.253-.143 4.929a3.68 3.68 0 0 0 3.69 1.742c.521.444 1 .871 1.507 1.329c-1.84 1.134-4.8.334-6.51-1.982c-1.86-2.512-1.93-5.789.322-7.379Z"/><path fill="url(#vscodeIconsFileTypeLicense1j)" d="M9.956 2.841c1.939-1.405 5.111-.606 6.892 1.8a6.587 6.587 0 0 1 1.38 4.159c-.293-.387-1.035-.264-1.466-.211a4.6 4.6 0 0 0-.823-3.272c-1.317-1.78-3.546-2.373-4.97-1.32s-1.442 3.27-.125 5.051a4.034 4.034 0 0 0 3.842 1.905c.4.35.79.715 1.185 1.073c-1.982 1.012-4.528.084-6.123-2.073c-1.782-2.408-1.897-5.587.208-7.112Z"/><path fill="url(#vscodeIconsFileTypeLicense1k)" d="M10.1 2.918c1.855-1.345 4.971-.5 6.675 1.8a6.635 6.635 0 0 1 1.361 3.89a1.872 1.872 0 0 0-1.148-.126a4.555 4.555 0 0 0-.946-3.23c-1.394-1.885-3.6-2.472-5.1-1.357s-1.511 3.279-.171 5.2a4.075 4.075 0 0 0 3.976 1.973c.323.285.639.58.957.871c-1.939.959-4.394-.1-5.893-2.131C8.1 7.511 8.1 4.363 10.1 2.918Z"/><path fill="url(#vscodeIconsFileTypeLicense1l)" d="M9.684 3.412C8.6 4.969 8.825 7.5 10.3 9.494c1.413 1.911 3.466 2.885 5.249 2.443c-1.694.674-4.074-.233-5.554-2.235c-1.54-2.081-1.66-4.783-.311-6.29Z"/><path fill="url(#vscodeIconsFileTypeLicense1m)" d="M9.9 3.511c-.171.291.366.627.547.144a4.29 4.29 0 0 1 2.442-1.222A3.558 3.558 0 0 0 9.9 3.511Zm.077.506a.244.244 0 1 0 .211.273a.243.243 0 0 0-.213-.273Z"/><path fill="url(#vscodeIconsFileTypeLicense1n)" d="M11.035 3.763c1.4-1.181 3.664-.647 5.163 1.132a4.723 4.723 0 0 1 1.2 3.542c-.136.014-.273.03-.411.048a4.555 4.555 0 0 0-.946-3.23c-1.394-1.885-3.6-2.472-5.1-1.357c-.071.053-.136.11-.2.167a2.672 2.672 0 0 1 .294-.302Z"/>`}})),lp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="gray" d="m16.5 30l-.011-.321c.4-.014.8-.045 1.19-.094l.039.319c-.406.048-.818.08-1.218.096Zm-1.222-.011c-.4-.021-.814-.061-1.216-.118l.045-.318c.393.055.793.094 1.188.115Zm3.642-.289l-.067-.314c.387-.083.776-.184 1.155-.3l.094.307c-.388.118-.786.222-1.182.307Zm-6.063-.053c-.4-.091-.791-.2-1.177-.326l.1-.306c.377.122.764.23 1.15.319Zm8.4-.665l-.121-.3c.364-.148.728-.314 1.08-.493h.006l.145.286c-.367.186-.741.356-1.114.507Zm-10.718-.088a13.693 13.693 0 0 1-1.1-.524l.15-.284c.35.186.713.358 1.078.512Zm12.893-1.021l-.17-.273c.337-.21.668-.437.984-.675l.193.257c-.328.243-.667.476-1.011.691Zm-15.053-.122c-.341-.22-.676-.459-1-.708l.2-.253c.312.243.64.476.972.691Zm17-1.346l-.215-.239c.294-.265.58-.546.851-.836l.235.219c-.278.297-.571.585-.872.851Zm-18.925-.153c-.3-.276-.585-.569-.856-.87l.239-.215c.265.294.547.58.836.85Zm20.587-1.632l-.253-.2c.244-.312.476-.639.692-.972l.27.175c-.221.343-.46.677-.709.997ZM4.82 24.439a14.237 14.237 0 0 1-.692-1.007l.272-.17c.21.337.438.668.676.984Zm23.547-1.867l-.284-.151c.186-.35.358-.713.513-1.078l.3.125a14.91 14.91 0 0 1-.528 1.104Zm-24.841-.2l-.006-.012a13.075 13.075 0 0 1-.5-1.1l.3-.121c.147.362.312.724.491 1.074l.006.012Zm25.794-2.047l-.306-.1c.122-.377.23-.764.319-1.15l.313.072c-.091.396-.2.792-.326 1.178Zm-26.712-.218c-.12-.388-.223-.786-.308-1.182l.314-.067c.083.387.184.776.3 1.155Zm27.262-2.161l-.318-.045c.056-.393.094-.793.115-1.188l.321.017a13.78 13.78 0 0 1-.118 1.216ZM2.1 17.72c-.05-.4-.082-.812-.1-1.218l.321-.011c.014.4.046.8.094 1.19Zm27.582-2.2c-.014-.4-.045-.8-.093-1.19l.319-.039c.049.4.082.813.1 1.218ZM2.331 15.3l-.321-.02c.021-.405.061-.814.117-1.216l.318.045c-.055.391-.093.791-.114 1.191Zm27.057-2.144a13.987 13.987 0 0 0-.3-1.155l.312-.101c.119.388.223.786.307 1.183Zm-26.725-.222l-.313-.072c.091-.4.2-.791.326-1.177l.306.1c-.123.376-.23.763-.319 1.149Zm26.026-2.062a12.639 12.639 0 0 0-.5-1.086l.286-.146c.185.363.355.736.507 1.111ZM3.4 10.665l-.3-.125c.158-.374.334-.745.524-1.1l.284.15c-.184.347-.356.71-.508 1.075Zm1.113-2.108l-.27-.174c.22-.341.458-.676.707-1l.254.2c-.243.317-.476.641-.691.974Zm1.464-1.881l-.235-.219c.276-.3.569-.585.87-.857l.215.239c-.294.261-.58.547-.85.837Zm1.77-1.6l-.193-.257c.323-.244.662-.477 1.007-.692l.17.272c-.337.215-.668.442-.984.68Zm15.705-.558l-.018-.012l.175-.27l.018.011Zm-1.047-.616a13.44 13.44 0 0 0-1.078-.512l.125-.3c.374.158.745.334 1.1.524ZM9.769 3.815l-.146-.286l.018-.009c.356-.181.724-.349 1.093-.5l.121.3c-.361.147-.72.311-1.068.488Zm10.44-.838a13.414 13.414 0 0 0-1.151-.317l.072-.313c.4.091.792.2 1.178.325Zm-8.229-.06l-.094-.307a14.25 14.25 0 0 1 1.182-.308l.067.314a13.89 13.89 0 0 0-1.155.301Zm5.9-.473a13.953 13.953 0 0 0-1.188-.113l.016-.321c.405.021.814.059 1.216.115Zm-3.572-.026l-.04-.319c.4-.05.812-.083 1.218-.1l.012.321c-.392.017-.793.049-1.186.098Z"/><circle cx="16" cy="15.998" r="10.708" fill="navy"/><circle cx="20.435" cy="11.562" r="3.136" fill="#fff"/><circle cx="26.708" cy="5.29" r="3.137" fill="navy"/><path fill="#fff" d="M13.1 21.352v-.79H9.629v-6.236h-.9v7.026H13.1m4.816 0V16.3h-.8v2.785c0 1.031-.54 1.706-1.378 1.706A.95.95 0 0 1 14.7 19.8v-3.5h-.8v3.817c0 .838.626 1.378 1.609 1.378a1.863 1.863 0 0 0 1.687-.925v.781h.723m5.872-.018v-.607a.664.664 0 0 1-.173.019c-.279 0-.434-.145-.434-.4v-2.809c0-.9-.655-1.378-1.9-1.378c-1.224 0-1.976.472-2.024 1.638h.81c.067-.617.434-.9 1.185-.9c.723 0 1.128.27 1.128.752v.212c0 .337-.2.482-.838.559a5.763 5.763 0 0 0-1.619.308a1.327 1.327 0 0 0-.887 1.311c0 .916.636 1.455 1.658 1.455a2.363 2.363 0 0 0 1.715-.742a.855.855 0 0 0 .829.665a1.967 1.967 0 0 0 .549-.087m-1.407-1.725a1.366 1.366 0 0 1-1.513 1.185c-.626 0-.993-.222-.993-.771c0-.53.357-.761 1.214-.887a4 4 0 0 0 1.291-.279v.752"/>`}})),up=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fff" d="M7.313 18.654a.548.548 0 0 1-.6.233a.917.917 0 0 0-.869.08c-.306.218-.637.053-.579-.345a1.229 1.229 0 0 1 .583-.971c.833-.479.254-.812.711-1.293s.357-.629.341-1.283a4.648 4.648 0 0 1-3.4-1.9a6.012 6.012 0 0 1-1.46-3.764a6.365 6.365 0 0 1 .649-3.8a5.315 5.315 0 0 1 2.565-2.522a7.022 7.022 0 0 1 3.489-.77a4.96 4.96 0 0 1 2.443.452a5.148 5.148 0 0 0 1.546.8a1.217 1.217 0 0 0 .782-.226c.047 1.189-1.023 1.292-1.98 1.317s-1.546-.371-2.427-.224a4.193 4.193 0 0 0-3.03 1.774A3.783 3.783 0 0 0 5.408 8.9a1.952 1.952 0 0 0 1.441 1.8c.5.008.61-.136 1.047-.421s2.665-3.043 3.426-3.663a3.522 3.522 0 0 1 2.322-.821a3.24 3.24 0 0 1 1.671.286A12.275 12.275 0 0 1 16.9 7.139a8.833 8.833 0 0 0 .684-.576a2.865 2.865 0 0 1 2.393-.718a3.644 3.644 0 0 1 1.819.8a14.312 14.312 0 0 1 2.013 2.425a3.59 3.59 0 0 0 1.621 1.489c.771.237 1.352-.762 1.437-1.316a5.814 5.814 0 0 0 .112-.935a4.413 4.413 0 0 0-.135-1.125a4 4 0 0 0-.455-1.016a3.606 3.606 0 0 0-1.3-1.25A4.129 4.129 0 0 0 23.7 4.5a13.676 13.676 0 0 0-1.4.2c-.584.04-1.628.171-2.086-.28a1.18 1.18 0 0 1-.378-.853a.892.892 0 0 0 .469.19c.366.031.708-.268 1-.441a7.34 7.34 0 0 1 .908-.526a5.856 5.856 0 0 1 2.7-.232a6.308 6.308 0 0 1 2.2.725a6 6 0 0 1 1.634 1.48A4.983 4.983 0 0 1 29.781 6.9a8.981 8.981 0 0 1 .017 3.847a7.577 7.577 0 0 1-1.714 2.819a4.388 4.388 0 0 1-2.317 1.112a4.911 4.911 0 0 0 .086.488c.064.206.188.436.441.363a.236.236 0 0 1 .289.063c.133.116.064.567-.311.769a1.449 1.449 0 0 1-.695.131a6.612 6.612 0 0 1-1.11-.051c-.33-.058-.528-.32-.894-.361a3.572 3.572 0 0 1-1.452-.764a3.048 3.048 0 0 0-.362-.185c.059.18.138.368.177.541s.023.334.043.472s.059.247.082.359c.09.081.119.2.272.243a1.706 1.706 0 0 0 .546-.043c.156-.021.26-.106.383-.083a.85.85 0 0 1 .34.193c.1.082.191.094.274.3a3.333 3.333 0 0 1 .171.9a1.93 1.93 0 0 1-.1.755a1.261 1.261 0 0 1-.381.541a5.937 5.937 0 0 1-.956.769a1.652 1.652 0 0 0 .2.3c.1.109.324.229.421.344a.473.473 0 0 1 .148.324a.686.686 0 0 1-.109.433a1.9 1.9 0 0 1-.937.573a2.477 2.477 0 0 1 .023 1.06c-.037.159-.119.519-.315.612a3.823 3.823 0 0 1-.814.086c-.239.038-.373.074-.56.111a3.3 3.3 0 0 0-.34.492a.4.4 0 0 0 .008.35c.049.15.214.368.261.544a1.091 1.091 0 0 1 .012.541a.943.943 0 0 1-.269.46c-.15.157-.446.28-.593.406s-.294.142-.254.352a1.551 1.551 0 0 0 .781.867a.925.925 0 0 0 .65-.048c-.015.246-.228.412-.367.576a2.2 2.2 0 0 0 1-.588a2.488 2.488 0 0 1-.752.955a2.872 2.872 0 0 1-.6.4a2.652 2.652 0 0 0 .99 0a1.97 1.97 0 0 1-.748.242a2.2 2.2 0 0 1-.85-.064a5.7 5.7 0 0 1-.951-.541a.78.78 0 0 0 .217.442a2.859 2.859 0 0 0 .639.334a9.407 9.407 0 0 1-.963-.116a2.233 2.233 0 0 1-.555-.189a3.647 3.647 0 0 1-.449-.309a1.291 1.291 0 0 0 .215.411a1.963 1.963 0 0 0 .48.232a2.1 2.1 0 0 1-.5-.011a1.408 1.408 0 0 1-.517-.245a3.7 3.7 0 0 1-.52-.463a2.155 2.155 0 0 1-.4-.538c-.058-.154.035-.262.052-.393a1.233 1.233 0 0 0-.318.21a.4.4 0 0 0-.118.37a2.46 2.46 0 0 0 .315.589c-.344-.281-.536-.389-.618-.729a1.143 1.143 0 0 1 .272-.846c.075-.119.187-.23.257-.345a4.668 4.668 0 0 1-.466-.456c-.133-.173-.189-.408-.325-.573a3.412 3.412 0 0 0-.478-.407a6.246 6.246 0 0 1 .42.9a.6.6 0 0 1-.139.5c-.083.126-.216.154-.343.231s-.323.017-.4.131a.392.392 0 0 0-.023.4l.3.466a1.421 1.421 0 0 1-.381-.328c-.084-.114-.214-.218-.232-.371a.541.541 0 0 1 .073-.422c.1-.137.371-.182.493-.287s.19-.173.183-.309s-.14-.232-.253-.318a8.278 8.278 0 0 1-1.088-.815a1.08 1.08 0 0 1-.28-.443a.459.459 0 0 1 .085-.368c.083-.151.367-.352.4-.515s-.109-.2-.238-.256s-.376.029-.5-.071s.035-.311-.1-.427s-.445-.051-.6-.176a.837.837 0 0 1-.281-.459a.974.974 0 0 1-.024-.509c.038-.131.15-.154.217-.222s.127-.124.036-.225s-.385.006-.555-.124s-.066-.44-.186-.572s-.336-.079-.449-.121s-.159.106-.228-.128s-.072-.93-.166-1.189s-.278-.018-.363-.276a7.085 7.085 0 0 1-.043-1.06l-.175-1.061c-.609.409-2.53.935-2.7 1.233"/><path fill="#030303" d="M16.623 8.258a3.733 3.733 0 0 0 .077.942a.909.909 0 0 0 .382.66c.462.343.758.286 1.114.485a1.017 1.017 0 0 1 .446.421a.363.363 0 0 1-.17.422a.361.361 0 0 0 .371-.48c-.052-.128-.3-.185-.373-.314a.488.488 0 0 1-.04-.393c.064-.236.531-.451.7-.637a.772.772 0 0 0 .208-.9a2.831 2.831 0 0 0-1.45-1.141a3.209 3.209 0 0 0-.5-.15a1.65 1.65 0 0 1 .875.807c.144.374.019.515.024.84c0 .151.2.226.289.322s.07.145.009.259a.3.3 0 0 0-.13-.236c-.13-.093-.271-.073-.341-.263c-.106-.289.1-.563-.132-.888a1.029 1.029 0 0 0-.727-.522a1.267 1.267 0 0 0-.423.066l-.219-.258a4.594 4.594 0 0 0-1.34-.995a3.033 3.033 0 0 0-1.607-.3a3.068 3.068 0 0 0-2.2.771c-.808.7-2.892 3.367-3.4 3.7a1.7 1.7 0 0 1-1.248.453a2.124 2.124 0 0 1-1.657-2.002a4.041 4.041 0 0 1 .722-2.857a4.173 4.173 0 0 1 3.224-1.9a12.022 12.022 0 0 1 2.441.23c.771 0 1.534-.132 1.759-.745a1.044 1.044 0 0 1-.672.118A6.739 6.739 0 0 1 11 2.952a5.237 5.237 0 0 0-2.29-.377a6.319 6.319 0 0 0-3.215.669a5.769 5.769 0 0 0-2.582 2.475a5.866 5.866 0 0 0-.654 3.649a6.068 6.068 0 0 0 1.423 3.613a4.457 4.457 0 0 0 3.295 1.785l.329-1.45l-.587.842l.015-.937l-.531.659l-.233-.894l-.43.716l-.214-1l-.623.5l.2-.823l-.825.092l.379-.572l-.752.009l.438-.764l-.667-.106L4 10.35l-.817-.242l.676-.648l-.659-.544l.522-.406l-.492-.65l.521-.607l-.194-.8L4 6.067l.132-.916l.5-.249l.427-.715l.785-.087l.39-.643l.793.04l.749-.407l.778.181l.883-.266l.654.153l.853.125l.824.659L10.5 3.5l-.636.305l-.526-.321l-.362.246l-.64.064l-.574-.037l-.419.511l-.843.013l-.3.688l-.759.266l-.071.791l-.544.426L5 7.2l-.47.773l.361.676l-.355.619l.472.308l-.107.995l.656.166l.148.738l.715-.075l.444.506l.549-.536a6.151 6.151 0 0 0 2.193-1.625a10.282 10.282 0 0 1 2.58-2.506a3.451 3.451 0 0 1 2.493-.477c.895.154 1.194.691 1.853 1.257a.626.626 0 0 1 .2-.253a4.416 4.416 0 0 0-.108.492Zm4.665 5.934a.71.71 0 0 1-.2.143a2.376 2.376 0 0 1-.344.083c.173.27.355.543.521.826s.31.594.469.892a4.909 4.909 0 0 0-.022-.511a5.014 5.014 0 0 0-.168-.537c-.071-.239-.159-.564-.26-.9Zm-.06-1.551a.508.508 0 0 1 .168.092a.646.646 0 0 1 .255.269a1.025 1.025 0 0 1 .048.466c-.056-.016-.132-.005-.191-.055s-.092-.162-.167-.21a.439.439 0 0 0-.219-.048a.694.694 0 0 1 .043.35a.431.431 0 0 1-.409.387a1.336 1.336 0 0 1-.342-.036c.04.089.108.167.147.256a1.842 1.842 0 0 0 .439-.073a3.264 3.264 0 0 1 .345-.2a2.175 2.175 0 0 1 .395-.067c-.113.1-.188.2-.3.295l.25.728c.177.111.344.169.566.306a7.337 7.337 0 0 0 .781.515a2.887 2.887 0 0 0 .767.263c.3.057.545.3.844.343a6.43 6.43 0 0 0 1.087.025c.261-.025.6-.16.631-.447a.6.6 0 0 1-.723-.407c-.075-.183-.038-.52-.153-.737s-.274-.286-.466-.552a8.352 8.352 0 0 1-.679-1.045c-.175-.357-.217-.762-.365-1.082a5.285 5.285 0 0 0-.546-.826a2.918 2.918 0 0 0-1.308-1.18a6.4 6.4 0 0 0-.963-.249c-.131.059-.31.124-.342.276a.622.622 0 0 0 .14.493a2.1 2.1 0 0 1 .568.7a2.753 2.753 0 0 1 .03 1.029a1.146 1.146 0 0 1-.328.42Zm-1.451.173a2.483 2.483 0 0 1 .854-.242c.126-.008.321.012.448.017a1.7 1.7 0 0 0 .3-.466a2.519 2.519 0 0 0-.043-.826c-.172-.423-.34-.441-.577-.683a1.347 1.347 0 0 1-.231-.743c-.019-.11-.073-.249-.1-.363a4.64 4.64 0 0 0-1-.052a1.088 1.088 0 0 0 .39-.567a1.116 1.116 0 0 0-.132-.78a3.032 3.032 0 0 0-.576-.6c-.208-.182-.506-.332-.7-.482a5.781 5.781 0 0 1 .768-.275a2.5 2.5 0 0 1 1.842.448a4.6 4.6 0 0 1 1.053.833c.384.4.859 1.137 1.23 1.574a7.877 7.877 0 0 0 .997 1.043a4.973 4.973 0 0 0 .925.5l.481.51l.389-.481l.625.071l.129-.7l.574-.157l-.093-.947l.413-.293l-.31-.589l.315-.644l-.411-.736l.159-.708l-.476-.405l-.062-.753l-.664-.253l-.266-.655l-.75-.01l-.366-.486l-.5.035l-.56-.061l-.316-.234l-.46.3l-.557-.29l-1.106.42l.721-.627l.747-.119l.569-.138l.773.254l.68-.172l.656.388l.694-.038l.341.612l.691.079l.374.68l.435.237l.115.871l.387.367l-.17.762l.456.577l-.428.619l.457.387l-.585.518l.592.616l-.715.23l.466.661l-.584.1l.383.727l-.658-.009l.331.545l-.722-.087l.173.783l-.546-.48l-.187.949l-.377-.682l-.2.85l-.465-.627l.012.891l-.514-.8a3.638 3.638 0 0 0 .385 1.382a3.518 3.518 0 0 0 2.24-1.041a7.168 7.168 0 0 0 1.627-2.739a9.306 9.306 0 0 0 .011-3.618a5.45 5.45 0 0 0-1.045-2.109A7.963 7.963 0 0 0 26.9 3.405a6.2 6.2 0 0 0-3.2-.694a3.79 3.79 0 0 0-1.338.25c-.617.224-1.11.714-1.737.955a.6.6 0 0 1-.53 0a.989.989 0 0 0 .723.572a5.464 5.464 0 0 0 1.431-.013a9.013 9.013 0 0 1 1.451-.19a3.1 3.1 0 0 1 1.484.428a3.658 3.658 0 0 1 1.4 1.318a4 4 0 0 1 .448 1.079a5.063 5.063 0 0 1 .151 1.174a3.6 3.6 0 0 1-.112 1.035c-.212.781-.68 1.576-1.641 1.454c-.588-.075-1.475-1.18-1.772-1.585a15.7 15.7 0 0 0-1.969-2.4a3.034 3.034 0 0 0-1.705-.757a2.579 2.579 0 0 0-2.384.829a4.609 4.609 0 0 1 .532.17a3.981 3.981 0 0 1 1.094.718a1.19 1.19 0 0 1 .5.968c.008.3-.239.541-.465.758c-.139.133-.322.254-.434.357c-.149.137-.333.286-.147.5a1.883 1.883 0 0 0 .3.22c.163.121.089.572-.127.691a.712.712 0 0 1-.832-.069c.287-.043.469-.081.461-.315c0-.136-.177-.249-.347-.326a4.931 4.931 0 0 1-1.125-.452c-.411-.3-.42-.458-.531-.922a2.623 2.623 0 0 0-.646.113c-.265.087-.558.3-.8.348a1.718 1.718 0 0 1-1.058.006a4.244 4.244 0 0 0-2.1.349a5.917 5.917 0 0 0-.975.121a6.413 6.413 0 0 0-1.7.995a9.083 9.083 0 0 0-1.98 4.059c-.051.57.112.955-.248 1.233s-.349.992-.471 1.193s-.263.111-.525.392s-.4.234-.389.766a1.839 1.839 0 0 1 .845-.332c.256-.009.259.328.916-.322c.352-.348 1.027-.358 1.5-.512A4.732 4.732 0 0 0 11 16.152a5.613 5.613 0 0 0 1.415-3.381a3.984 3.984 0 0 1-.038 1.247a3.473 3.473 0 0 0 .151 2.442l.309.59a5.184 5.184 0 0 1-.652-.953l-.25-.674a5.057 5.057 0 0 1-1.463 1.662a2.916 2.916 0 0 0 .089 1.169c.128.373-.076.8.021 1.049s.321.106.394.355s-.038.741.075.983s.392.1.527.174a.774.774 0 0 1 .251.289c.073.1-.028.346.119.425s.376.012.529.088a.357.357 0 0 1 .139.422c-.036.163-.2.238-.272.4a.427.427 0 0 0 .023.434a.891.891 0 0 0 .466.314c.19.077.457.034.653.14a1.537 1.537 0 0 1 .476.473a.636.636 0 0 1 .127.425a1.19 1.19 0 0 1-.157.505c-.087.157-.278.347.021.647s.287.17.458.364c-.019-.336-.157-.609-.056-.862s.406-.3.566-.411a2.625 2.625 0 0 0 .379-.4a4.487 4.487 0 0 1 0 .491c-.041.266-.119.5.277.544a1.293 1.293 0 0 0 .535-.166c-.1.176-.269.318-.3.528a.918.918 0 0 0 .151.651a2.127 2.127 0 0 0 .582.487a2.227 2.227 0 0 0 .425.2c.007.207-.034.427-.01.621a1.134 1.134 0 0 0 .2.529a1.73 1.73 0 0 0 .465.373c-.094-.218-.283-.424-.281-.653a.734.734 0 0 1 .294-.594c.223-.2.746-.38.992-.577a1.214 1.214 0 0 0 .414-.51a2.23 2.23 0 0 0 .08-.673a2.032 2.032 0 0 1 .119.569a2.006 2.006 0 0 1-.221.794a1.217 1.217 0 0 0 .6-.612c.065.039.032.145.056.349c.109-.108.232-.191.341-.293a.949.949 0 0 0 .284-.334a.765.765 0 0 0-.008-.459a3.091 3.091 0 0 0-.324-.538c-.1-.181.017-.358.01-.576a1.727 1.727 0 0 0-.6-.1c-.229.033-.491.29-.725.293s-.365-.216-.557-.277a3.409 3.409 0 0 0-.579-.08a5.348 5.348 0 0 1 1.84-.451a11.629 11.629 0 0 1 1.715-.155a4.393 4.393 0 0 0 .769.03c.179-.051.141-.174.194-.307a1.73 1.73 0 0 0-.006-1.079A8.378 8.378 0 0 0 20.46 22c-.511.039-1.117.282-1.644.3a3.165 3.165 0 0 1-1.53-.328a3.63 3.63 0 0 1-.986-1.125c-.215-.329-.486-.975-.651-1.27a1.614 1.614 0 0 0-.339-.5a1.512 1.512 0 0 0-.488-.2c.188.019.392-.04.563.058c.256.147.543.756.7 1.021c.169-.566.129-.788.618-1.107a2.153 2.153 0 0 0-.5 1.295c.327.537.782 1.393 1.378 1.63a3.907 3.907 0 0 0 .817.168a5.91 5.91 0 0 0 2.132-.315a5.587 5.587 0 0 1 1.678-.04c.215.012.72-.117.825-.333a.382.382 0 0 0-.033-.386c-.081-.126-.3-.186-.414-.3a2.667 2.667 0 0 1-.274-.368a7.515 7.515 0 0 1-1.238.138c.257-.106.5-.167.771-.271a4.6 4.6 0 0 0 .787-.419a2.522 2.522 0 0 0 .51-.391a3.13 3.13 0 0 0 .471-.539a1.406 1.406 0 0 0 .139-.681a2.03 2.03 0 0 0-.1-.805a.634.634 0 0 0-.433-.311c-.15-.048-.252.073-.408.09s-.3.115-.527.008a1.967 1.967 0 0 1-.72-.642c-.228-.32-.39-.844-.623-1.247a21.2 21.2 0 0 0-1.376-1.986a4.043 4.043 0 0 1-.118-.593a2.861 2.861 0 0 1 .076-1.13a.987.987 0 0 1 .512-.69a.563.563 0 0 1 .371-.026a.25.25 0 0 1 .167.294c-.045.15-.15.155-.221.231a.808.808 0 0 0-.213.384a1.825 1.825 0 0 1 .412.016a.481.481 0 0 1 .339.326a.611.611 0 0 0-.456-.22a2.057 2.057 0 0 0-.316.048a2.271 2.271 0 0 1-.118.383c-.056.1-.163.075-.2.191a1.12 1.12 0 0 0-.022.455Zm.546.2c-.208.013-.258-.014-.424.1l.271.422a.65.65 0 0 1 .153-.525Zm-7.072-1.86a.812.812 0 0 1 .036-.194c-.3-.081-.423.115-.6.479c-.066.136 0 .217-.072.306s-.185.077-.3.163s-.23.251-.338.34a3.758 3.758 0 0 1-.777.418a2.536 2.536 0 0 0 .625-.513c.058-.1.05-.287.14-.377s.123-.152.24-.174s.07-.159.108-.266a1.151 1.151 0 0 1 .193-.293a.848.848 0 0 1 .339-.329c.158-.059.405 0 .525-.029s.051-.121.138-.173s.257-.029.373-.085a1.139 1.139 0 0 0 .429-.442A2.256 2.256 0 0 1 14.187 11a1.478 1.478 0 0 1-.749.89a2.38 2.38 0 0 1-.426.16c.073-.1.177-.143.219-.3a3.762 3.762 0 0 0 .02-.6Zm1.931 1.493c.157-.014.351.028.5.02a2.652 2.652 0 0 0 .377-.07c-.023-.221 0-.627-.205-.774a1.783 1.783 0 0 0-.817.008a7.63 7.63 0 0 0-1.017.385a3.168 3.168 0 0 1 .923-.514a2.428 2.428 0 0 1 .948-.09c.1.028.123.07.185.156a1.811 1.811 0 0 1 .268.9a2.524 2.524 0 0 1 .157.229a1.1 1.1 0 0 1 .081.338c-.056-.081-.022-.183-.177-.243a1.507 1.507 0 0 0-.6.018a.508.508 0 0 1-.231.934a.541.541 0 0 1-.641-.333a.988.988 0 0 1-.021-.4a.794.794 0 0 0-.688.259a1.3 1.3 0 0 0 .523.508a1.681 1.681 0 0 0 .5.186a2.516 2.516 0 0 0 .676.032a.734.734 0 0 0 .444-.216a1.04 1.04 0 0 0 .212-.47a1.369 1.369 0 0 1-.083.431a.786.786 0 0 1-.778.412a2.853 2.853 0 0 1-1.019-.2a1.542 1.542 0 0 1-.73-.624a1.8 1.8 0 0 1-.02-.557c.332-.22.413-.166.806-.231c.164-.027.277-.088.433-.1Zm.9-2.187a1.48 1.48 0 0 0 .524.212c.147 0 .185-.1.272-.154a6.578 6.578 0 0 0 .523 1.333c.1.169.159.09.232.26s.107.514.176.73a5.907 5.907 0 0 0 .242.564a7.727 7.727 0 0 1-.583-.9c-.114-.241-.041-.262-.133-.492s-.279-.588-.418-.882a.829.829 0 0 1-.3.008c-.076-.023-.061-.1-.129-.156s-.184-.032-.28-.115a.592.592 0 0 1-.127-.405Zm-1.964 7.762c.138-.112.511-.023.789 0l-.6.154c-.019.068-.01.147-.056.2s-.132.079-.2.119c.007-.179-.072-.363.066-.475Zm2.574-3.737a2.621 2.621 0 0 0 .205-.6c-.027.252.024.529-.1.712s-.339.151-.518.2c.139-.106.3-.153.411-.312Zm-.252 2.8a1 1 0 0 1 .5-.9a2.14 2.14 0 0 1 .706-.253a2.751 2.751 0 0 1 1.186.155a7.055 7.055 0 0 1 .7.459c.239.141.409.236.637.395c.35.243.554.512.8.673a1.763 1.763 0 0 0 .435.113a.73.73 0 0 1-.407.033a1.823 1.823 0 0 1-.513-.306a3.515 3.515 0 0 0-.579-.42c-.145-.084-.383-.183-.542-.287s-.435-.331-.587-.407a1.892 1.892 0 0 0-.759-.146a1.606 1.606 0 0 0-.959.267a.645.645 0 0 0-.264.66a2.992 2.992 0 0 1 .23-.3a.721.721 0 0 1 .607-.131a.531.531 0 0 1 .459.415a1.1 1.1 0 0 0-.238-.159a.573.573 0 0 0-.51.05c-.21.112-.153.278-.183.463a1.765 1.765 0 0 1-.069.231a.453.453 0 0 1-.211-.113a1.493 1.493 0 0 0 .008.259a3.194 3.194 0 0 0 .1.319a1.872 1.872 0 0 1-.39-.47a1.237 1.237 0 0 1-.148-.6Zm1.889.318a.98.98 0 0 1 .439.114a1.712 1.712 0 0 1 .314.223a1.858 1.858 0 0 1 .5.877a5.274 5.274 0 0 1 .077.745a4.767 4.767 0 0 0-.225-.687a1.682 1.682 0 0 0-.783-.8a.42.42 0 0 0-.252-.032c.028.047.075.086.077.155a.27.27 0 0 1-.13.259a.493.493 0 0 1-.541-.1a.48.48 0 0 1-.12-.535c.091-.224.439-.224.644-.216Zm-10.406.644a.726.726 0 0 0-.6.4a.548.548 0 0 1-.6.233a.917.917 0 0 0-.869.08c-.306.218-.637.053-.579-.344a1.226 1.226 0 0 1 .583-.971c.832-.479.254-.812.71-1.293s.356-.629.342-1.283a4.65 4.65 0 0 1-3.4-1.9A6.013 6.013 0 0 1 2.036 9.4a6.362 6.362 0 0 1 .649-3.8a5.314 5.314 0 0 1 2.569-2.522a7.026 7.026 0 0 1 3.489-.769a4.958 4.958 0 0 1 2.443.452a5.153 5.153 0 0 0 1.545.8a1.218 1.218 0 0 0 .782-.226c.047 1.189-1.023 1.292-1.981 1.317s-1.546-.371-2.427-.223A4.192 4.192 0 0 0 6.078 6.2a3.78 3.78 0 0 0-.669 2.683a1.951 1.951 0 0 0 1.44 1.8c.5.008.61-.136 1.047-.421s2.665-3.041 3.426-3.662a3.518 3.518 0 0 1 2.321-.821a3.236 3.236 0 0 1 1.671.285A12.282 12.282 0 0 1 16.9 7.128a8.515 8.515 0 0 0 .684-.576a2.865 2.865 0 0 1 2.393-.718a3.644 3.644 0 0 1 1.819.8a14.284 14.284 0 0 1 2.014 2.425a3.594 3.594 0 0 0 1.621 1.489c.771.237 1.351-.762 1.437-1.316a5.786 5.786 0 0 0 .112-.932a4.39 4.39 0 0 0-.134-1.125a4.012 4.012 0 0 0-.455-1.016a3.6 3.6 0 0 0-1.3-1.25a4.131 4.131 0 0 0-1.391-.424a13.632 13.632 0 0 0-1.4.2c-.584.04-1.627.171-2.085-.28a1.18 1.18 0 0 1-.378-.854a.891.891 0 0 0 .469.189c.366.031.708-.268 1-.441a7.2 7.2 0 0 1 .907-.526a5.861 5.861 0 0 1 2.7-.233a6.315 6.315 0 0 1 2.2.725a6.005 6.005 0 0 1 1.634 1.48a4.992 4.992 0 0 1 1.037 2.15a8.988 8.988 0 0 1 .017 3.847a7.581 7.581 0 0 1-1.713 2.819a4.391 4.391 0 0 1-2.317 1.112c.034.177.04.342.085.487c.065.206.188.436.442.364a.236.236 0 0 1 .289.062c.133.117.063.567-.312.769a1.444 1.444 0 0 1-.695.131a6.517 6.517 0 0 1-1.11-.051c-.33-.058-.528-.319-.894-.361a3.576 3.576 0 0 1-1.452-.764a3.069 3.069 0 0 0-.362-.185c.059.18.137.368.177.541s.022.334.043.473s.059.246.081.359c.091.081.12.2.272.243a1.688 1.688 0 0 0 .546-.043c.156-.021.261-.105.383-.083a.853.853 0 0 1 .341.193c.1.082.19.094.274.3a3.364 3.364 0 0 1 .17.9a1.922 1.922 0 0 1-.1.755a1.254 1.254 0 0 1-.381.541a5.924 5.924 0 0 1-.957.769a1.691 1.691 0 0 0 .2.3c.1.108.324.229.421.343a.474.474 0 0 1 .148.324a.689.689 0 0 1-.109.434a1.9 1.9 0 0 1-.937.573a2.484 2.484 0 0 1 .023 1.06c-.037.159-.119.519-.315.612a3.808 3.808 0 0 1-.814.086c-.239.038-.373.074-.56.111a3.312 3.312 0 0 0-.34.491a.4.4 0 0 0 .008.35c.049.15.215.369.261.544a1.091 1.091 0 0 1 .012.541a.952.952 0 0 1-.269.461c-.15.157-.446.279-.593.406s-.294.142-.254.352a1.548 1.548 0 0 0 .781.867a.93.93 0 0 0 .65-.047c-.015.246-.228.412-.367.575a2.2 2.2 0 0 0 1-.587a2.486 2.486 0 0 1-.752.954a2.86 2.86 0 0 1-.6.4a2.634 2.634 0 0 0 .991 0a1.964 1.964 0 0 1-.748.242a2.189 2.189 0 0 1-.85-.063a5.72 5.72 0 0 1-.951-.541a.782.782 0 0 0 .216.442a2.849 2.849 0 0 0 .639.334a9.6 9.6 0 0 1-.963-.116a2.274 2.274 0 0 1-.555-.189a3.8 3.8 0 0 1-.449-.309a1.3 1.3 0 0 0 .215.411a1.95 1.95 0 0 0 .481.233a2.1 2.1 0 0 1-.5-.011a1.409 1.409 0 0 1-.517-.245a3.708 3.708 0 0 1-.521-.464a2.146 2.146 0 0 1-.4-.538c-.058-.154.035-.262.052-.393a1.218 1.218 0 0 0-.319.209a.4.4 0 0 0-.118.371a2.45 2.45 0 0 0 .315.589c-.344-.281-.536-.39-.618-.729a1.142 1.142 0 0 1 .272-.846c.075-.119.187-.23.256-.345a4.636 4.636 0 0 1-.466-.456c-.133-.174-.189-.408-.325-.574a3.436 3.436 0 0 0-.478-.406a6.173 6.173 0 0 1 .42.9a.6.6 0 0 1-.139.5c-.083.126-.216.154-.342.231s-.324.016-.4.131a.393.393 0 0 0-.023.4l.3.466a1.418 1.418 0 0 1-.381-.328c-.085-.113-.214-.218-.232-.371a.541.541 0 0 1 .073-.423c.1-.136.371-.182.493-.287s.19-.173.183-.309s-.139-.233-.253-.318a8.319 8.319 0 0 1-1.088-.815a1.091 1.091 0 0 1-.28-.443a.461.461 0 0 1 .085-.368c.083-.151.367-.352.4-.515s-.109-.2-.238-.257s-.375.029-.5-.071s.035-.311-.1-.427s-.445-.051-.6-.176a.84.84 0 0 1-.281-.46a.968.968 0 0 1-.024-.509c.037-.131.149-.153.217-.221s.127-.124.036-.226s-.386.006-.556-.124s-.066-.44-.186-.571s-.336-.08-.449-.122s-.158.106-.228-.127s-.072-.929-.165-1.189s-.278-.017-.364-.276a7.171 7.171 0 0 1-.043-1.061l-.175-1.061a3.741 3.741 0 0 1-1.666.654a10.832 10.832 0 0 0 .338 4.321c.543 1.777 1.643 2.824 3.128 4.328a9.109 9.109 0 0 1-3.478-4.188a9.791 9.791 0 0 1-.414-4.277"/>`}})),dp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="none" stroke="#755838" d="M2.5 7.955h27v16.091h-27z"/><path fill="#755838" d="M5.909 20.636v-9.272h2.727l2.728 3.409l2.727-3.409h2.727v9.272h-2.727v-5.318l-2.727 3.409l-2.728-3.409v5.318H5.909zm17.046 0l-4.091-4.5h2.727v-4.772h2.727v4.772h2.727l-4.09 4.5z"/>`}})),fp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cb3837" d="M2 10.555h28v9.335H16v1.556H9.778v-1.557H2Zm1.556 7.779h3.111v-4.668h1.555v4.667h1.556v-6.222H3.556Zm7.778-6.223v7.779h3.111v-1.556h3.111v-6.223Zm3.111 1.556H16v3.112h-1.556Zm4.667-1.556v6.223h3.111v-4.668h1.556v4.667h1.556v-4.667h1.556v4.667h1.556v-6.222Z"/>`}})),pp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#909090" d="m24.1 2.072l5.564 5.8v22.056H8.879V30h20.856V7.945L24.1 2.072"/><path fill="#f4f4f4" d="M24.031 2H8.808v27.928h20.856V7.873L24.03 2"/><path fill="#7a7b7c" d="M8.655 3.5h-6.39v6.827h20.1V3.5H8.655"/><path fill="#dd2025" d="M22.472 10.211H2.395V3.379h20.077v6.832"/><path fill="#464648" d="M9.052 4.534H7.745v4.8h1.028V7.715L9 7.728a2.042 2.042 0 0 0 .647-.117a1.427 1.427 0 0 0 .493-.291a1.224 1.224 0 0 0 .335-.454a2.13 2.13 0 0 0 .105-.908a2.237 2.237 0 0 0-.114-.644a1.173 1.173 0 0 0-.687-.65a2.149 2.149 0 0 0-.409-.104a2.232 2.232 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.193a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.942.942 0 0 1-.524.114m3.671-2.306c-.111 0-.219.008-.295.011L12 4.538h-.78v4.8h.918a2.677 2.677 0 0 0 1.028-.175a1.71 1.71 0 0 0 .68-.491a1.939 1.939 0 0 0 .373-.749a3.728 3.728 0 0 0 .114-.949a4.416 4.416 0 0 0-.087-1.127a1.777 1.777 0 0 0-.4-.733a1.63 1.63 0 0 0-.535-.4a2.413 2.413 0 0 0-.549-.178a1.282 1.282 0 0 0-.228-.017m-.182 3.937h-.1V5.392h.013a1.062 1.062 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a2.926 2.926 0 0 1-.033.513a1.756 1.756 0 0 1-.169.5a1.13 1.13 0 0 1-.363.36a.673.673 0 0 1-.416.106m5.08-3.915H15v4.8h1.028V7.434h1.3v-.892h-1.3V5.43h1.4v-.892"/><path fill="#dd2025" d="M21.781 20.255s3.188-.578 3.188.511s-1.975.646-3.188-.511Zm-2.357.083a7.543 7.543 0 0 0-1.473.489l.4-.9c.4-.9.815-2.127.815-2.127a14.216 14.216 0 0 0 1.658 2.252a13.033 13.033 0 0 0-1.4.288Zm-1.262-6.5c0-.949.307-1.208.546-1.208s.508.115.517.939a10.787 10.787 0 0 1-.517 2.434a4.426 4.426 0 0 1-.547-2.162Zm-4.649 10.516c-.978-.585 2.051-2.386 2.6-2.444c-.003.001-1.576 3.056-2.6 2.444ZM25.9 20.895c-.01-.1-.1-1.207-2.07-1.16a14.228 14.228 0 0 0-2.453.173a12.542 12.542 0 0 1-2.012-2.655a11.76 11.76 0 0 0 .623-3.1c-.029-1.2-.316-1.888-1.236-1.878s-1.054.815-.933 2.013a9.309 9.309 0 0 0 .665 2.338s-.425 1.323-.987 2.639s-.946 2.006-.946 2.006a9.622 9.622 0 0 0-2.725 1.4c-.824.767-1.159 1.356-.725 1.945c.374.508 1.683.623 2.853-.91a22.549 22.549 0 0 0 1.7-2.492s1.784-.489 2.339-.623s1.226-.24 1.226-.24s1.629 1.639 3.2 1.581s1.495-.939 1.485-1.035"/><path fill="#909090" d="M23.954 2.077V7.95h5.633l-5.633-5.873Z"/><path fill="#f4f4f4" d="M24.031 2v5.873h5.633L24.031 2Z"/><path fill="#fff" d="M8.975 4.457H7.668v4.8H8.7V7.639l.228.013a2.042 2.042 0 0 0 .647-.117a1.428 1.428 0 0 0 .493-.291a1.224 1.224 0 0 0 .332-.454a2.13 2.13 0 0 0 .105-.908a2.237 2.237 0 0 0-.114-.644a1.173 1.173 0 0 0-.687-.65a2.149 2.149 0 0 0-.411-.105a2.232 2.232 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.194a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.942.942 0 0 1-.524.114m3.67-2.306c-.111 0-.219.008-.295.011l-.235.006h-.78v4.8h.918a2.677 2.677 0 0 0 1.028-.175a1.71 1.71 0 0 0 .68-.491a1.939 1.939 0 0 0 .373-.749a3.728 3.728 0 0 0 .114-.949a4.416 4.416 0 0 0-.087-1.127a1.777 1.777 0 0 0-.4-.733a1.63 1.63 0 0 0-.535-.4a2.413 2.413 0 0 0-.549-.178a1.282 1.282 0 0 0-.228-.017m-.182 3.937h-.1V5.315h.013a1.062 1.062 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a2.926 2.926 0 0 1-.033.513a1.756 1.756 0 0 1-.169.5a1.13 1.13 0 0 1-.363.36a.673.673 0 0 1-.416.106m5.077-3.915h-2.43v4.8h1.028V7.357h1.3v-.892h-1.3V5.353h1.4v-.892"/>`}})),mp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><radialGradient id="vscodeIconsFileTypePhp0" cx="-16.114" cy="20.532" r="18.384" gradientTransform="translate(26.52 -9.307)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".5" stop-color="#4c6b96"/><stop offset="1" stop-color="#231f20"/></radialGradient></defs><ellipse cx="16" cy="16" fill="url(#vscodeIconsFileTypePhp0)" rx="14" ry="7.365"/><ellipse cx="16" cy="16" fill="#6280b6" rx="13.453" ry="6.818"/><path fill="#fff" d="m18.725 18.2l.667-3.434a1.752 1.752 0 0 0-.372-1.719a2.929 2.929 0 0 0-2-.525h-1.153l.331-1.7a.219.219 0 0 0-.215-.26h-1.6a.219.219 0 0 0-.215.177l-.709 3.646a2.051 2.051 0 0 0-.477-1.054a2.783 2.783 0 0 0-2.2-.807H7.7a.219.219 0 0 0-.215.177l-1.434 7.38a.219.219 0 0 0 .215.26h1.603a.219.219 0 0 0 .215-.177l.347-1.785h1.2a5.167 5.167 0 0 0 1.568-.2a3.068 3.068 0 0 0 1.15-.689a3.538 3.538 0 0 0 .68-.844l-.287 1.475a.219.219 0 0 0 .215.26h1.6a.219.219 0 0 0 .215-.177l.787-4.051h1.094c.466 0 .6.093.64.133s.1.165.025.569l-.635 3.265a.219.219 0 0 0 .215.26h1.62a.219.219 0 0 0 .207-.18Zm-7.395-2.834a1.749 1.749 0 0 1-.561 1.092a2.171 2.171 0 0 1-1.315.321h-.712l.515-2.651h.921c.677 0 .949.145 1.059.266a1.181 1.181 0 0 1 .093.972Zm14.216-2.034a2.783 2.783 0 0 0-2.2-.807h-3.091a.219.219 0 0 0-.215.177l-1.434 7.38a.219.219 0 0 0 .215.26h1.608a.219.219 0 0 0 .215-.177l.347-1.785h1.2a5.167 5.167 0 0 0 1.568-.2a3.068 3.068 0 0 0 1.15-.689a3.425 3.425 0 0 0 1.076-1.927a2.512 2.512 0 0 0-.439-2.232Zm-1.667 2.034a1.749 1.749 0 0 1-.561 1.092a2.171 2.171 0 0 1-1.318.32h-.71l.515-2.651h.921c.677 0 .949.145 1.059.266a1.181 1.181 0 0 1 .094.973Z"/><path fill="#000004" d="M10.178 13.908a1.645 1.645 0 0 1 1.221.338a1.34 1.34 0 0 1 .145 1.161a1.945 1.945 0 0 1-.642 1.223a2.361 2.361 0 0 1-1.448.37h-.978l.6-3.089Zm-3.917 6.216h1.608l.381-1.962h1.377a4.931 4.931 0 0 0 1.5-.191a2.84 2.84 0 0 0 1.07-.642a3.207 3.207 0 0 0 1.01-1.808a2.3 2.3 0 0 0-.385-2.044a2.568 2.568 0 0 0-2.035-.732H7.7Zm8.126-9.342h1.6l-.387 1.962h1.421a2.767 2.767 0 0 1 1.85.468a1.548 1.548 0 0 1 .305 1.516l-.667 3.434H16.89l.635-3.265a.886.886 0 0 0-.08-.76a1.121 1.121 0 0 0-.8-.2H15.37l-.822 4.228h-1.6Zm8.34 3.126a1.645 1.645 0 0 1 1.221.338a1.34 1.34 0 0 1 .145 1.161a1.945 1.945 0 0 1-.642 1.223A2.361 2.361 0 0 1 22 17h-.978l.6-3.089Zm-3.917 6.216h1.608l.381-1.962h1.377a4.931 4.931 0 0 0 1.5-.191a2.84 2.84 0 0 0 1.07-.642a3.207 3.207 0 0 0 1.01-1.808a2.3 2.3 0 0 0-.385-2.044a2.568 2.568 0 0 0-2.035-.732h-3.092Z"/>`}})),hp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f9ad00" d="M30 10.75h-8.749V2H30Zm-9.626 0h-8.75V2h8.75Zm-9.625 0H2V2h8.749ZM30 20.375h-8.749v-8.75H30Z"/><path fill="#fff" d="M20.374 20.375h-8.75v-8.75h8.75Zm0 9.625h-8.75v-8.75h8.75ZM30 30h-8.749v-8.75H30Zm-19.251 0H2v-8.75h8.749Z"/>`}})),gp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypePowerpoint0" x1="4.494" x2="13.832" y1="-1748.086" y2="-1731.914" gradientTransform="translate(0 1756)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ca4c28"/><stop offset=".5" stop-color="#c5401e"/><stop offset="1" stop-color="#b62f14"/></linearGradient></defs><path fill="#ed6c47" d="M18.93 17.3L16.977 3h-.146A12.9 12.9 0 0 0 3.953 15.854V16Z"/><path fill="#ff8f6b" d="M17.123 3h-.146v13l6.511 2.6L30 16v-.146A12.9 12.9 0 0 0 17.123 3Z"/><path fill="#d35230" d="M30 16v.143A12.905 12.905 0 0 1 17.12 29h-.287a12.907 12.907 0 0 1-12.88-12.857V16Z"/><path d="M17.628 9.389V23.26a1.2 1.2 0 0 1-.742 1.1a1.16 1.16 0 0 1-.45.091H7.027a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85a8.82 8.82 0 0 1 .456-.65h9.93a1.2 1.2 0 0 1 1.192 1.189Z" opacity=".1"/><path d="M16.977 10.04v13.871a1.15 1.15 0 0 1-.091.448a1.2 1.2 0 0 1-1.1.741H7.62q-.309-.314-.593-.65a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path d="M16.977 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path d="M16.326 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.084a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypePowerpoint0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="M9.293 12.028a3.287 3.287 0 0 1 2.174.636a2.27 2.27 0 0 1 .756 1.841a2.555 2.555 0 0 1-.373 1.376a2.49 2.49 0 0 1-1.059.935a3.607 3.607 0 0 1-1.591.334H7.687v2.8H6.141v-7.922ZM7.686 15.94h1.331a1.735 1.735 0 0 0 1.177-.351a1.3 1.3 0 0 0 .4-1.025q0-1.309-1.525-1.31H7.686v2.686Z"/>`}})),_p=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#56b3b4" d="M21.714 8.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M4.571 26.857h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#bf85bf" d="M18.286 17.714h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M11.429 17.714H16a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M4.571 17.714h4.572a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#bf85bf" d="M4.571 22.286h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 22.857a.571.571 0 0 1 .571-.571Zm0-9.143h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 13.714a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M10.286 6.286h11.428a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H10.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M4.571 6.286H8a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.572H4.571A.571.571 0 0 1 4 6.857a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M9.143 24.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M9.143 10.857h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571ZM4.571 24.571h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M4.571 10.857h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.572H4.571A.571.571 0 0 1 4 11.429a.571.571 0 0 1 .571-.572Z"/><path fill="#4d616e" d="M19.429 24.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-6.858 0h4.571a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Zm10.286 0h4.571a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z" opacity=".5"/><path fill="#56b3b4" d="M13.714 15.429h9.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M8 15.429h3.429A.571.571 0 0 1 12 16a.571.571 0 0 1-.571.571H8A.571.571 0 0 1 7.429 16A.571.571 0 0 1 8 15.429Z"/><path fill="#ea5e5e" d="M4.571 15.429h1.143a.571.571 0 0 1 .572.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 16a.571.571 0 0 1 .571-.571Z"/><path fill="#bf85bf" d="M14.857 8.571h4.571a.571.571 0 0 1 .572.572a.571.571 0 0 1-.571.571h-4.572a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Z"/><path fill="#56b3b4" d="M4.571 8.571h8a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-8A.571.571 0 0 1 4 9.143a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M8 20h10.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H8a.571.571 0 0 1-.571-.571A.571.571 0 0 1 8 20Z"/><path fill="#bf85bf" d="M4.571 20h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 20.571A.571.571 0 0 1 4.571 20Z"/><path fill="#ea5e5e" d="M18.286 10.857H24a.571.571 0 0 1 .571.571A.571.571 0 0 1 24 12h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M18.286 13.143H24a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M4.571 4h13.715a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 4.571A.571.571 0 0 1 4.571 4Z"/><path fill="#4d616e" d="M20.571 4h6.857a.571.571 0 0 1 .572.571a.571.571 0 0 1-.571.571h-6.858A.571.571 0 0 1 20 4.571A.571.571 0 0 1 20.571 4Zm0 16h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm4.572 0h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571ZM24 17.714h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H24a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm0-11.428h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H24a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm1.143 9.143h2.286A.571.571 0 0 1 28 16a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.572-.571a.571.571 0 0 1 .572-.571Zm0-6.858h2.286a.571.571 0 0 1 .571.572a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Zm1.143 2.286h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm0 2.286h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-9.143 9.143h10.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H17.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-4.572 0h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm9.143 4.571h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-9.143 0h6.857a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-6.857a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Zm0-16H16a.571.571 0 0 1 .571.571A.571.571 0 0 1 16 12h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Zm0 2.286H16a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z" opacity=".5"/>`}})),vp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypePython0" x1="-133.268" x2="-133.198" y1="-202.91" y2="-202.84" gradientTransform="matrix(189.38 0 0 189.81 25243.061 38519.17)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#387eb8"/><stop offset="1" stop-color="#366994"/></linearGradient><linearGradient id="vscodeIconsFileTypePython1" x1="-133.575" x2="-133.495" y1="-203.203" y2="-203.133" gradientTransform="matrix(189.38 0 0 189.81 25309.061 38583.42)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffe052"/><stop offset="1" stop-color="#ffc331"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypePython0)" d="M15.885 2.1c-7.1 0-6.651 3.07-6.651 3.07v3.19h6.752v1H6.545S2 8.8 2 16.005s4.013 6.912 4.013 6.912H8.33v-3.361s-.13-4.013 3.9-4.013h6.762s3.772.06 3.772-3.652V5.8s.572-3.712-6.842-3.712Zm-3.732 2.137a1.214 1.214 0 1 1-1.183 1.244v-.02a1.214 1.214 0 0 1 1.214-1.214Z"/><path fill="url(#vscodeIconsFileTypePython1)" d="M16.085 29.91c7.1 0 6.651-3.08 6.651-3.08v-3.18h-6.751v-1h9.47S30 23.158 30 15.995s-4.013-6.912-4.013-6.912H23.64V12.4s.13 4.013-3.9 4.013h-6.765S9.2 16.356 9.2 20.068V26.2s-.572 3.712 6.842 3.712h.04Zm3.732-2.147A1.214 1.214 0 1 1 21 26.519v.03a1.214 1.214 0 0 1-1.214 1.214h.03Z"/>`}})),yp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<circle cx="16" cy="15.974" r="2.5" fill="#00d8ff"/><path fill="#00d8ff" d="M16 21.706a28.385 28.385 0 0 1-8.88-1.2a11.3 11.3 0 0 1-3.657-1.958A3.543 3.543 0 0 1 2 15.974c0-1.653 1.816-3.273 4.858-4.333A28.755 28.755 0 0 1 16 10.293a28.674 28.674 0 0 1 9.022 1.324a11.376 11.376 0 0 1 3.538 1.866A3.391 3.391 0 0 1 30 15.974c0 1.718-2.03 3.459-5.3 4.541a28.8 28.8 0 0 1-8.7 1.191Zm0-10.217a27.948 27.948 0 0 0-8.749 1.282c-2.8.977-4.055 2.313-4.055 3.2c0 .928 1.349 2.387 4.311 3.4A27.21 27.21 0 0 0 16 20.51a27.6 27.6 0 0 0 8.325-1.13C27.4 18.361 28.8 16.9 28.8 15.974a2.327 2.327 0 0 0-1.01-1.573a10.194 10.194 0 0 0-3.161-1.654A27.462 27.462 0 0 0 16 11.489Z"/><path fill="#00d8ff" d="M10.32 28.443a2.639 2.639 0 0 1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755 28.755 0 0 1 3.4-8.593a28.676 28.676 0 0 1 5.653-7.154a11.376 11.376 0 0 1 3.384-2.133a3.391 3.391 0 0 1 2.878 0c1.489.858 1.982 3.486 1.287 6.859a28.806 28.806 0 0 1-3.316 8.133a28.385 28.385 0 0 1-5.476 7.093a11.3 11.3 0 0 1-3.523 2.189a4.926 4.926 0 0 1-1.624.307Zm1.773-14.7a27.948 27.948 0 0 0-3.26 8.219c-.553 2.915-.022 4.668.75 5.114c.8.463 2.742.024 5.1-2.036a27.209 27.209 0 0 0 5.227-6.79a27.6 27.6 0 0 0 3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327 2.327 0 0 0-1.868.089A10.194 10.194 0 0 0 17.5 6.9a27.464 27.464 0 0 0-5.4 6.849Z"/><path fill="#00d8ff" d="M21.677 28.456c-1.355 0-3.076-.82-4.868-2.361a28.756 28.756 0 0 1-5.747-7.237a28.676 28.676 0 0 1-3.374-8.471a11.376 11.376 0 0 1-.158-4A3.391 3.391 0 0 1 8.964 3.9c1.487-.861 4.01.024 6.585 2.31a28.8 28.8 0 0 1 5.39 6.934a28.384 28.384 0 0 1 3.41 8.287a11.3 11.3 0 0 1 .137 4.146a3.543 3.543 0 0 1-1.494 2.555a2.59 2.59 0 0 1-1.315.324Zm-9.58-10.2a27.949 27.949 0 0 0 5.492 6.929c2.249 1.935 4.033 2.351 4.8 1.9c.8-.465 1.39-2.363.782-5.434A27.212 27.212 0 0 0 19.9 13.74a27.6 27.6 0 0 0-5.145-6.64c-2.424-2.152-4.39-2.633-5.191-2.169a2.327 2.327 0 0 0-.855 1.662a10.194 10.194 0 0 0 .153 3.565a27.465 27.465 0 0 0 3.236 8.1Z"/>`}})),bp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<circle cx="16" cy="15.974" r="2.5" fill="#007acc"/><path fill="#007acc" d="M16 21.706a28.385 28.385 0 0 1-8.88-1.2a11.3 11.3 0 0 1-3.657-1.958A3.543 3.543 0 0 1 2 15.974c0-1.653 1.816-3.273 4.858-4.333A28.755 28.755 0 0 1 16 10.293a28.674 28.674 0 0 1 9.022 1.324a11.376 11.376 0 0 1 3.538 1.866A3.391 3.391 0 0 1 30 15.974c0 1.718-2.03 3.459-5.3 4.541a28.8 28.8 0 0 1-8.7 1.191Zm0-10.217a27.948 27.948 0 0 0-8.749 1.282c-2.8.977-4.055 2.313-4.055 3.2c0 .928 1.349 2.387 4.311 3.4A27.21 27.21 0 0 0 16 20.51a27.6 27.6 0 0 0 8.325-1.13C27.4 18.361 28.8 16.9 28.8 15.974a2.327 2.327 0 0 0-1.01-1.573a10.194 10.194 0 0 0-3.161-1.654A27.462 27.462 0 0 0 16 11.489Z"/><path fill="#007acc" d="M10.32 28.443a2.639 2.639 0 0 1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755 28.755 0 0 1 3.4-8.593a28.676 28.676 0 0 1 5.653-7.154a11.376 11.376 0 0 1 3.384-2.133a3.391 3.391 0 0 1 2.878 0c1.489.858 1.982 3.486 1.287 6.859a28.806 28.806 0 0 1-3.316 8.133a28.385 28.385 0 0 1-5.476 7.093a11.3 11.3 0 0 1-3.523 2.189a4.926 4.926 0 0 1-1.624.307Zm1.773-14.7a27.948 27.948 0 0 0-3.26 8.219c-.553 2.915-.022 4.668.75 5.114c.8.463 2.742.024 5.1-2.036a27.209 27.209 0 0 0 5.227-6.79a27.6 27.6 0 0 0 3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327 2.327 0 0 0-1.868.089A10.194 10.194 0 0 0 17.5 6.9a27.464 27.464 0 0 0-5.4 6.849Z"/><path fill="#007acc" d="M21.677 28.456c-1.355 0-3.076-.82-4.868-2.361a28.756 28.756 0 0 1-5.747-7.237a28.676 28.676 0 0 1-3.374-8.471a11.376 11.376 0 0 1-.158-4A3.391 3.391 0 0 1 8.964 3.9c1.487-.861 4.01.024 6.585 2.31a28.8 28.8 0 0 1 5.39 6.934a28.384 28.384 0 0 1 3.41 8.287a11.3 11.3 0 0 1 .137 4.146a3.543 3.543 0 0 1-1.494 2.555a2.59 2.59 0 0 1-1.315.324Zm-9.58-10.2a27.949 27.949 0 0 0 5.492 6.929c2.249 1.935 4.033 2.351 4.8 1.9c.8-.465 1.39-2.363.782-5.434A27.212 27.212 0 0 0 19.9 13.74a27.6 27.6 0 0 0-5.145-6.64c-2.424-2.152-4.39-2.633-5.191-2.169a2.327 2.327 0 0 0-.855 1.662a10.194 10.194 0 0 0 .153 3.565a27.465 27.465 0 0 0 3.236 8.1Z"/>`}})),xp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeRuby0" x1="-235.957" x2="-235.986" y1="-308.579" y2="-308.527" gradientTransform="matrix(202.935 0 0 -202.78 47910.461 -62541.16)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fb7655"/><stop offset=".41" stop-color="#e42b1e"/><stop offset=".99" stop-color="#900"/><stop offset="1" stop-color="#900"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby1" x1="-235.571" x2="-235.697" y1="-309.087" y2="-309.041" gradientTransform="matrix(60.308 0 0 -111.778 14236.351 -34525.395)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#871101"/><stop offset=".99" stop-color="#911209"/><stop offset="1" stop-color="#911209"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby2" x1="-235.896" x2="-235.937" y1="-313.362" y2="-313.129" gradientTransform="matrix(188.32 0 0 -21.986 44447.302 -6856.882)" href="#vscodeIconsFileTypeRuby1"/><linearGradient id="vscodeIconsFileTypeRuby3" x1="-233.515" x2="-233.497" y1="-309.082" y2="-309.161" gradientTransform="matrix(65.222 0 0 -97.1 15237.802 -29991.814)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".23" stop-color="#e57252"/><stop offset=".46" stop-color="#de3b20"/><stop offset=".99" stop-color="#a60003"/><stop offset="1" stop-color="#a60003"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby4" x1="-235.314" x2="-235.31" y1="-309.534" y2="-309.607" gradientTransform="matrix(105.32 0 0 -106.825 24798.925 -33053.152)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".23" stop-color="#e4714e"/><stop offset=".56" stop-color="#be1a0d"/><stop offset=".99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby5" x1="-235.882" x2="-235.869" y1="-311.851" y2="-311.935" gradientTransform="matrix(94.321 0 0 -66.418 22271.499 -20707.004)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".18" stop-color="#e46342"/><stop offset=".4" stop-color="#c82410"/><stop offset=".99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby6" x1="-235.412" x2="-235.333" y1="-321.074" y2="-320.958" gradientTransform="matrix(70.767 0 0 -24.301 16678.116 -7798.647)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".54" stop-color="#c81f11"/><stop offset=".99" stop-color="#bf0905"/><stop offset="1" stop-color="#bf0905"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby7" x1="-223.821" x2="-223.796" y1="-310.116" y2="-310.18" gradientTransform="matrix(18.177 0 0 -72.645 4071.017 -22510.233)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".31" stop-color="#de4024"/><stop offset=".99" stop-color="#bf190b"/><stop offset="1" stop-color="#bf190b"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby8" x1="-235.561" x2="-235.424" y1="-309.258" y2="-309.116" gradientTransform="matrix(158.162 0 0 -157.937 37256.313 -48819.382)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#bd0012"/><stop offset=".07" stop-color="#fff"/><stop offset=".17" stop-color="#fff"/><stop offset=".27" stop-color="#c82f1c"/><stop offset=".33" stop-color="#820c01"/><stop offset=".46" stop-color="#a31601"/><stop offset=".72" stop-color="#b31301"/><stop offset=".99" stop-color="#e82609"/><stop offset="1" stop-color="#e82609"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby9" x1="-235.424" x2="-235.476" y1="-309.143" y2="-309.126" gradientTransform="matrix(127.074 0 0 -97.409 29932.229 -30086.947)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8c0c01"/><stop offset=".54" stop-color="#990c00"/><stop offset=".99" stop-color="#a80d0e"/><stop offset="1" stop-color="#a80d0e"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubya" x1="-235.839" x2="-235.901" y1="-309.604" y2="-309.555" gradientTransform="matrix(94.011 0 0 -105.603 22198.743 -32676.856)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7e110b"/><stop offset=".99" stop-color="#9e0c00"/><stop offset="1" stop-color="#9e0c00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyb" x1="-235.854" x2="-235.891" y1="-311.24" y2="-311.202" gradientTransform="matrix(79.702 0 0 -81.791 18827.397 -25447.905)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#79130d"/><stop offset=".99" stop-color="#9e120b"/><stop offset="1" stop-color="#9e120b"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyc" x1="-231.241" x2="-231.299" y1="-309.435" y2="-309.337" gradientTransform="matrix(40.137 0 0 -81.143 9286.998 -25078.589)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8b2114"/><stop offset=".43" stop-color="#9e100a"/><stop offset=".99" stop-color="#b3100c"/><stop offset="1" stop-color="#b3100c"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyd" x1="-235.898" x2="-235.831" y1="-317.466" y2="-317.537" gradientTransform="matrix(78.099 0 0 -32.624 18447.361 -10353.553)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#b31000"/><stop offset=".44" stop-color="#910f08"/><stop offset=".99" stop-color="#791c12"/><stop offset="1" stop-color="#791c12"/></linearGradient><radialGradient id="vscodeIconsFileTypeRubye" cx="-235.882" cy="-312.543" r=".076" gradientTransform="matrix(93.113 0 0 -48.655 21986.073 -15193.61)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a80d00"/><stop offset=".99" stop-color="#7e0e08"/><stop offset="1" stop-color="#7e0e08"/></radialGradient><radialGradient id="vscodeIconsFileTypeRubyf" cx="-235.282" cy="-309.704" r=".097" gradientTransform="matrix(97.434 0 0 -75.848 22937.057 -23467.84)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a30c00"/><stop offset=".99" stop-color="#800e08"/><stop offset="1" stop-color="#800e08"/></radialGradient></defs><path fill="url(#vscodeIconsFileTypeRuby0)" d="M23.693 20.469L7.707 29.961l20.7-1.4L30 7.685Z"/><path fill="url(#vscodeIconsFileTypeRuby1)" d="m28.44 28.542l-1.779-12.279l-4.846 6.4Z"/><path fill="url(#vscodeIconsFileTypeRuby2)" d="M28.464 28.542L15.43 27.519l-7.654 2.415Z"/><path fill="url(#vscodeIconsFileTypeRuby3)" d="M7.794 29.937L11.05 19.27L3.885 20.8Z"/><path fill="url(#vscodeIconsFileTypeRuby4)" d="m21.813 22.7l-3-11.735L10.243 19Z"/><path fill="url(#vscodeIconsFileTypeRuby5)" d="m29.32 11.127l-8.1-6.619l-2.257 7.3Z"/><path fill="url(#vscodeIconsFileTypeRuby6)" d="m25.53 2.148l-4.767 2.634l-3.007-2.67Z"/><path fill="url(#vscodeIconsFileTypeRuby7)" d="m2 24.38l2-3.642L2.382 16.4Z"/><path fill="#fff" d="m2.274 16.263l1.626 4.61l7.062-1.584l8.062-7.489L21.3 4.569l-3.583-2.53l-6.091 2.28C9.706 6.1 5.982 9.635 5.848 9.7s-2.459 4.464-3.574 6.562Z"/><path fill="url(#vscodeIconsFileTypeRuby8)" d="M7.981 7.981C12.14 3.858 17.5 1.421 19.559 3.5s-.124 7.121-4.283 11.244s-9.455 6.69-11.511 4.614s.057-7.258 4.216-11.377Z"/><path fill="url(#vscodeIconsFileTypeRuby9)" d="m7.794 29.933l3.231-10.7l10.729 3.447c-3.879 3.638-8.194 6.713-13.96 7.254Z"/><path fill="url(#vscodeIconsFileTypeRubya)" d="m19.038 11.774l2.754 10.91c3.24-3.407 6.149-7.07 7.573-11.6l-10.328.691Z"/><path fill="url(#vscodeIconsFileTypeRubyb)" d="M29.337 11.139c1.1-3.327 1.357-8.1-3.841-8.985l-4.265 2.355l8.106 6.629Z"/><path fill="#9e1209" d="M2 24.332c.153 5.49 4.114 5.572 5.8 5.62l-3.9-9.1l-1.9 3.48Z"/><path fill="url(#vscodeIconsFileTypeRubye)" d="M19.053 11.791c2.49 1.531 7.509 4.6 7.61 4.661a17.552 17.552 0 0 0 2.619-5.343l-10.229.683Z"/><path fill="url(#vscodeIconsFileTypeRubyf)" d="m11.021 19.232l4.319 8.332a27.924 27.924 0 0 0 6.385-4.88l-10.7-3.452Z"/><path fill="url(#vscodeIconsFileTypeRubyc)" d="m3.887 20.861l-.612 7.287c1.155 1.577 2.743 1.714 4.409 1.591c-1.205-3-3.614-9-3.8-8.878Z"/><path fill="url(#vscodeIconsFileTypeRubyd)" d="m21.206 4.528l8.58 1.2c-.458-1.94-1.864-3.192-4.261-3.584l-4.319 2.38Z"/>`}})),Sp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><radialGradient id="vscodeIconsFileTypeRust0" cx="-492.035" cy="-883.37" r="13.998" gradientTransform="matrix(.866 -.5 -.3 -.52 177.106 -689.033)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7d7d7d"/><stop offset=".267" stop-color="#7e7c7a"/><stop offset=".45" stop-color="#817871"/><stop offset=".608" stop-color="#867162"/><stop offset=".753" stop-color="#8d684c"/><stop offset=".886" stop-color="#965c30"/><stop offset="1" stop-color="#a04f12"/></radialGradient></defs><path fill="url(#vscodeIconsFileTypeRust0)" d="M15.124 5.3a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832M5.2 12.834a.832.832 0 1 1 .832.832a.832.832 0 0 1-.832-.832m19.856.039a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832m-17.451 1.14a.76.76 0 0 0 .386-1l-.369-.835h1.452v6.545h-2.93a10.247 10.247 0 0 1-.332-3.911Zm6.074.161v-1.929h3.458c.179 0 1.261.206 1.261 1.016c0 .672-.83.913-1.513.913ZM8.958 24.561a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832m12.331.039a.832.832 0 1 1 .832.832a.832.832 0 0 1-.832-.832m.257-1.887a.758.758 0 0 0-.9.584l-.418 1.949a10.249 10.249 0 0 1-8.545-.041l-.417-1.949a.759.759 0 0 0-.9-.583l-1.721.37a10.233 10.233 0 0 1-.89-1.049h8.374c.095 0 .158-.017.158-.1v-2.966c0-.086-.063-.1-.158-.1h-2.45v-1.881h2.649a1.665 1.665 0 0 1 1.629 1.412c.105.413.336 1.757.494 2.187c.157.483.8 1.447 1.482 1.447h4.323a10.243 10.243 0 0 1-.949 1.1Zm4.65-7.821a10.261 10.261 0 0 1 .022 1.779h-1.051c-.105 0-.148.069-.148.172v.483c0 1.136-.641 1.384-1.2 1.447c-.535.06-1.128-.224-1.2-.551a3.616 3.616 0 0 0-1.671-2.808c1.03-.654 2.1-1.619 2.1-2.911A3.292 3.292 0 0 0 21.44 9.8a4.559 4.559 0 0 0-2.2-.724H8.367A10.246 10.246 0 0 1 14.1 5.84l1.282 1.344a.758.758 0 0 0 1.072.026l1.434-1.372a10.248 10.248 0 0 1 7.015 5l-.982 2.217a.761.761 0 0 0 .386 1Zm2.448.036l-.033-.343l1.011-.943a.42.42 0 0 0-.013-.595a.428.428 0 0 0-.121-.081l-1.288-.483l-.1-.334l.806-1.12a.422.422 0 0 0-.13-.581a.43.43 0 0 0-.133-.055l-1.363-.222l-.164-.306l.573-1.257a.419.419 0 0 0-.236-.544a.426.426 0 0 0-.146-.029l-1.383.048l-.224-.264l.318-1.347a.421.421 0 0 0-.343-.487a.435.435 0 0 0-.144 0l-1.348.315l-.266-.219l.049-1.381a.421.421 0 0 0-.431-.411a.426.426 0 0 0-.141.028l-1.257.573l-.306-.164l-.222-1.363a.421.421 0 0 0-.5-.318a.43.43 0 0 0-.133.055l-1.121.806l-.333-.1l-.483-1.293a.421.421 0 0 0-.555-.215a.442.442 0 0 0-.12.08l-.946 1.012l-.343-.033l-.728-1.177a.421.421 0 0 0-.688 0l-.728 1.177l-.343.033l-.943-1.012a.421.421 0 0 0-.595.015a.442.442 0 0 0-.08.12L12.483 3.8l-.333.1l-1.12-.8a.422.422 0 0 0-.581.13a.43.43 0 0 0-.055.133l-.222 1.363l-.306.164l-1.258-.573a.421.421 0 0 0-.544.239a.444.444 0 0 0-.028.144l.048 1.383l-.266.217l-1.347-.316a.421.421 0 0 0-.487.343a.435.435 0 0 0 0 .144L6.3 7.819l-.218.265L4.7 8.036a.422.422 0 0 0-.383.573l.573 1.257l-.164.306l-1.363.222a.42.42 0 0 0-.318.5a.43.43 0 0 0 .055.133l.806 1.12l-.1.334l-1.293.483a.421.421 0 0 0-.215.555a.414.414 0 0 0 .081.121l1.011.943l-.033.343l-1.177.728a.421.421 0 0 0 0 .688l1.177.728l.033.343l-1.011.943a.421.421 0 0 0 .015.595a.436.436 0 0 0 .119.08l1.293.483l.1.334l-.806 1.124a.421.421 0 0 0 .131.581a.43.43 0 0 0 .133.055l1.363.222l.164.307l-.573 1.257a.422.422 0 0 0 .24.545a.438.438 0 0 0 .143.028l1.383-.048l.219.266l-.317 1.348a.42.42 0 0 0 .341.486a.4.4 0 0 0 .146 0l1.345-.319l.266.218l-.049 1.382a.419.419 0 0 0 .429.41a.413.413 0 0 0 .143-.028l1.257-.573l.306.164l.222 1.362a.421.421 0 0 0 .5.319a.407.407 0 0 0 .133-.055l1.12-.807l.334.1l.483 1.292a.422.422 0 0 0 .556.214a.436.436 0 0 0 .119-.08l.943-1.011l.343.034l.728 1.177a.422.422 0 0 0 .588.1a.413.413 0 0 0 .1-.1l.728-1.177l.343-.034l.943 1.011a.421.421 0 0 0 .595-.015a.436.436 0 0 0 .08-.119l.483-1.292l.334-.1l1.12.807a.421.421 0 0 0 .581-.131a.43.43 0 0 0 .055-.133l.222-1.362l.306-.164l1.257.573a.421.421 0 0 0 .544-.239a.438.438 0 0 0 .028-.143l-.048-1.384l.265-.218l1.347.317a.421.421 0 0 0 .487-.34a.447.447 0 0 0 0-.146l-.309-1.346l.218-.266l1.383.048a.421.421 0 0 0 .41-.431a.4.4 0 0 0-.028-.142l-.573-1.257l.164-.307l1.363-.222a.421.421 0 0 0 .319-.5a.434.434 0 0 0-.056-.135l-.806-1.12l.1-.334l1.293-.483a.42.42 0 0 0 .215-.554a.414.414 0 0 0-.081-.121l-1.011-.943l.033-.343l1.177-.728a.421.421 0 0 0 0-.688Z"/>`}})),Cp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cd6799" d="M26.11 17.572a5.8 5.8 0 0 0-2.537.588a5.345 5.345 0 0 1-.568-1.314a3.53 3.53 0 0 1-.051-1.1a9.811 9.811 0 0 1 .332-1.192c-.005-.051-.061-.292-.624-.3s-1.048.107-1.1.256a6.171 6.171 0 0 0-.235.834a19.686 19.686 0 0 1-1.713 3.294a3.186 3.186 0 0 1-.44-2.066a9.811 9.811 0 0 1 .332-1.192c-.005-.051-.061-.292-.624-.3s-1.048.107-1.1.256s-.118.5-.235.834s-1.483 3.386-1.841 4.173c-.184.4-.343.726-.455.946a.233.233 0 0 1-.02.041l-.153.292v.005c-.077.138-.159.266-.2.266a1.711 1.711 0 0 1 .01-.869c.2-1.059.69-2.705.685-2.762c0-.031.092-.317-.317-.465a.508.508 0 0 0-.578.1c-.036 0-.061.087-.061.087s.445-1.851-.849-1.851a3.855 3.855 0 0 0-2.475 1.683c-.348.189-1.089.593-1.882 1.028c-.3.169-.614.338-.905.5c-.02-.02-.041-.046-.061-.066C6.87 17.6 3.975 16.416 4.1 14.171c.046-.818.327-2.966 5.559-5.575c4.306-2.122 7.733-1.534 8.326-.23c.849 1.862-1.836 5.319-6.285 5.82a3.351 3.351 0 0 1-2.813-.711c-.235-.256-.271-.271-.358-.22c-.143.077-.051.307 0 .44a2.626 2.626 0 0 0 1.606 1.263a8.55 8.55 0 0 0 5.217-.517c2.7-1.043 4.8-3.943 4.184-6.372c-.619-2.465-4.71-3.278-8.582-1.9a19.5 19.5 0 0 0-6.595 3.783c-2.133 1.995-2.47 3.728-2.332 4.455c.5 2.578 4.051 4.255 5.472 5.5a8.554 8.554 0 0 1-.194.107c-.711.353-3.421 1.77-4.1 3.268c-.767 1.7.123 2.915.711 3.079a4.374 4.374 0 0 0 4.71-1.908a4.725 4.725 0 0 0 .423-4.353a.107.107 0 0 0-.02-.031l.557-.327a27.2 27.2 0 0 1 1.028-.578a6.74 6.74 0 0 0-.363 1.862a3.886 3.886 0 0 0 .834 2.7a.921.921 0 0 0 .675.22c.6 0 .875-.5 1.176-1.094c.368-.726.7-1.57.7-1.57s-.414 2.281.711 2.281c.409 0 .823-.532 1.008-.8v.005l.031-.051l.066-.107v-.01c.164-.286.532-.936 1.079-2.015c.706-1.391 1.386-3.13 1.386-3.13a8.888 8.888 0 0 0 .271 1.13a10.643 10.643 0 0 0 .583 1.309c-.164.23-.266.358-.266.358l.005.005c-.133.174-.276.363-.435.547a16.3 16.3 0 0 0-1.314 1.647a.447.447 0 0 0 .123.6a1.116 1.116 0 0 0 .685.113a3.147 3.147 0 0 0 1.028-.235a3.45 3.45 0 0 0 .885-.465a1.98 1.98 0 0 0 .849-1.744a3.521 3.521 0 0 0-.322-1.233c.051-.072.1-.143.148-.215a23.428 23.428 0 0 0 1.534-2.649a8.888 8.888 0 0 0 .271 1.13a7.57 7.57 0 0 0 .5 1.125a4.861 4.861 0 0 0-1.497 1.922c-.322.931-.072 1.35.4 1.447a1.425 1.425 0 0 0 .747-.153a3.4 3.4 0 0 0 .946-.486a2.126 2.126 0 0 0 1.043-1.729a3.268 3.268 0 0 0-.235-1.023a5.356 5.356 0 0 1 2.716-.312c2.434.286 2.915 1.805 2.823 2.445a1.618 1.618 0 0 1-.772 1.094c-.169.107-.225.143-.21.22c.02.113.1.107.245.087A1.9 1.9 0 0 0 30 20.7c.077-1.5-1.355-3.145-3.887-3.13ZM7.33 23.9c-.808.88-1.933 1.212-2.419.931c-.522-.3-.317-1.6.675-2.532a12.884 12.884 0 0 1 1.9-1.417c.118-.072.292-.174.5-.3l.056-.031l.123-.077A3.493 3.493 0 0 1 7.33 23.9Zm5.881-4c-.281.685-.869 2.44-1.227 2.342c-.307-.082-.5-1.412-.061-2.726a6.193 6.193 0 0 1 .956-1.754c.44-.491.926-.655 1.043-.455a9.062 9.062 0 0 1-.711 2.593Zm4.853 2.322c-.118.061-.23.1-.281.072c-.036-.02.051-.1.051-.1s.609-.655.849-.951c.138-.174.3-.378.476-.609v.066c0 .782-.757 1.309-1.094 1.524Zm3.744-.854c-.087-.061-.072-.266.22-.905a3.408 3.408 0 0 1 .834-1.074a1.448 1.448 0 0 1 .082.471a1.547 1.547 0 0 1-1.135 1.509Z"/>`}})),wp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#d9b400" d="M29.4 27.6H2.5V4.5h26.9Zm-25.9-1h24.9V5.5H3.5Z"/><path fill="#d9b400" d="m6.077 19.316l-.555-.832l4.844-3.229l-4.887-4.071l.641-.768l5.915 4.928l-5.958 3.972zM12.7 18.2h7.8v1h-7.8zM2.5 5.5h26.9v1.9H2.5z"/>`}})),Tp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffda44" d="M8.562 15.256A21.159 21.159 0 0 0 16 16.449a21.159 21.159 0 0 0 7.438-1.194c1.864-.727 2.525-1.535 2.525-2V9.7a10.357 10.357 0 0 1-2.084 1.076A22.293 22.293 0 0 1 16 12.078a22.36 22.36 0 0 1-7.879-1.3A10.28 10.28 0 0 1 6.037 9.7v3.55c0 .474.663 1.278 2.525 2.006Zm0 6.705a15.611 15.611 0 0 0 2.6.741a24.9 24.9 0 0 0 4.838.453a24.9 24.9 0 0 0 4.838-.452a15.614 15.614 0 0 0 2.6-.741c1.864-.727 2.525-1.535 2.525-2v-3.39a10.706 10.706 0 0 1-1.692.825A23.49 23.49 0 0 1 16 18.74a23.49 23.49 0 0 1-8.271-1.348a10.829 10.829 0 0 1-1.692-.825v3.393c0 .466.663 1.271 2.525 2.001ZM16 30c5.5 0 9.963-1.744 9.963-3.894v-2.837a10.5 10.5 0 0 1-1.535.762l-.157.063A23.487 23.487 0 0 1 16 25.445a23.422 23.422 0 0 1-8.271-1.351c-.054-.02-.106-.043-.157-.063a10.5 10.5 0 0 1-1.535-.762v2.837C6.037 28.256 10.5 30 16 30Z"/><ellipse cx="16" cy="5.894" fill="#ffda44" rx="9.963" ry="3.894"/>`}})),Ep=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ff3e00" d="M26.47 5.7a8.973 8.973 0 0 0-11.793-2.454L7.96 7.4a7.461 7.461 0 0 0-3.481 5.009a7.686 7.686 0 0 0 .8 5.058a7.358 7.358 0 0 0-1.151 2.8a7.789 7.789 0 0 0 1.4 6.028a8.977 8.977 0 0 0 11.794 2.458L24.04 24.6a7.468 7.468 0 0 0 3.481-5.009a7.673 7.673 0 0 0-.8-5.062a7.348 7.348 0 0 0 1.152-2.8A7.785 7.785 0 0 0 26.47 5.7"/><path fill="#fff" d="M14.022 26.64A5.413 5.413 0 0 1 8.3 24.581a4.678 4.678 0 0 1-.848-3.625a4.307 4.307 0 0 1 .159-.61l.127-.375l.344.238a8.76 8.76 0 0 0 2.628 1.274l.245.073l-.025.237a1.441 1.441 0 0 0 .271.968a1.63 1.63 0 0 0 1.743.636a1.512 1.512 0 0 0 .411-.175l6.7-4.154a1.366 1.366 0 0 0 .633-.909a1.407 1.407 0 0 0-.244-1.091a1.634 1.634 0 0 0-1.726-.622a1.509 1.509 0 0 0-.413.176l-2.572 1.584a4.934 4.934 0 0 1-1.364.582a5.415 5.415 0 0 1-5.727-2.06a4.678 4.678 0 0 1-.831-3.628A4.507 4.507 0 0 1 9.9 10.09l6.708-4.154a4.932 4.932 0 0 1 1.364-.581A5.413 5.413 0 0 1 23.7 7.414a4.679 4.679 0 0 1 .848 3.625a4.272 4.272 0 0 1-.159.61l-.127.375l-.344-.237a8.713 8.713 0 0 0-2.628-1.274l-.245-.074l.025-.237a1.438 1.438 0 0 0-.272-.968a1.629 1.629 0 0 0-1.725-.622a1.484 1.484 0 0 0-.411.176l-6.722 4.14a1.353 1.353 0 0 0-.631.908a1.394 1.394 0 0 0 .244 1.092a1.634 1.634 0 0 0 1.726.621a1.538 1.538 0 0 0 .413-.175l2.562-1.585a4.9 4.9 0 0 1 1.364-.581a5.417 5.417 0 0 1 5.728 2.059a4.681 4.681 0 0 1 .843 3.625a4.5 4.5 0 0 1-2.089 3.013l-6.707 4.154a4.9 4.9 0 0 1-1.364.581"/>`}})),Dp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M7.674 14.488a2.218 2.218 0 1 0 0 3.137h16.652a2.218 2.218 0 1 0 0-3.137Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M11.222 9.06A2.218 2.218 0 1 0 9 11.278l11.778 11.774A2.218 2.218 0 1 0 23 20.834Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M17.568 7.73a2.218 2.218 0 1 0-3.137 0v16.652a2.218 2.218 0 1 0 3.137 0Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M23 11.278a2.218 2.218 0 1 0-2.222-2.218L9 20.834a2.218 2.218 0 1 0 2.218 2.218Z"/><path fill="#ffb13b" d="M7.674 14.488a2.218 2.218 0 1 0 0 3.137h16.652a2.218 2.218 0 1 0 0-3.137Z"/><path fill="#ffb13b" d="M11.222 9.06A2.218 2.218 0 1 0 9 11.278l11.778 11.774A2.218 2.218 0 1 0 23 20.834Z"/><path fill="#ffb13b" d="M17.568 7.73a2.218 2.218 0 1 0-3.137 0v16.652a2.218 2.218 0 1 0 3.137 0Z"/><path fill="#ffb13b" d="M23 11.278a2.218 2.218 0 1 0-2.222-2.218L9 20.834a2.218 2.218 0 1 0 2.218 2.218Z"/><path d="M2 16.056h28v9.894a4.035 4.035 0 0 1-4.106 4.106H6.106A4.035 4.035 0 0 1 2 25.95Z"/><path fill="#fff" d="M6.2 23.045a3.628 3.628 0 1 1 6.2-2.565h-2.13a1.5 1.5 0 1 0-2.57 1.061a1.6 1.6 0 0 0 1.062.441a4.118 4.118 0 0 1 2.566 1.063a3.628 3.628 0 1 1-6.194 2.565h2.13a1.5 1.5 0 1 0 2.566-1.06a1.948 1.948 0 0 0-1.063-.44A4.465 4.465 0 0 1 6.2 23.045Zm13.451-6.193L17.085 29.24H14.96L12.4 16.852h2.12l1.5 7.255l1.5-7.255Zm3.629 5.131h3.628v3.628a3.628 3.628 0 1 1-7.257 0V20.48a3.628 3.628 0 0 1 7.257 0h-2.125a1.5 1.5 0 1 0-3.005 0v5.13a1.5 1.5 0 0 0 3.005 0v-1.5h-1.5v-2.127Z"/>`}})),Op=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeSwift0" x1="-134.494" x2="-134.497" y1="-171.82" y2="-171.89" gradientTransform="matrix(240 0 0 -205.6 32295 -35312.585)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f88535"/><stop offset="1" stop-color="#fd2221"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypeSwift0)" d="M19.422 4.007s6.217 3.554 7.844 9.2c1.466 5.1.292 7.534.292 7.534a8.915 8.915 0 0 1 1.742 2.8a4.825 4.825 0 0 1 .29 4.453s-.1-2.08-3.2-2.511c-2.841-.4-3.874 2.366-9.3 2.232A18.435 18.435 0 0 1 2 19.354C4.651 20.8 8.124 23.045 12.449 22.7s5.228-1.674 5.228-1.674A66.9 66.9 0 0 1 4.891 7.643c3.4 2.845 11.822 8.507 11.626 8.363A75.826 75.826 0 0 1 8.092 6.24s12.636 10.389 13.653 10.323c.418-.861 2.579-5.318-2.324-12.557Z"/>`}})),kp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#44a8b3" d="M9 13.7q1.4-5.6 7-5.6c5.6 0 6.3 4.2 9.1 4.9q2.8.7 4.9-2.1q-1.4 5.6-7 5.6c-5.6 0-6.3-4.2-9.1-4.9q-2.8-.7-4.9 2.1Zm-7 8.4q1.4-5.6 7-5.6c5.6 0 6.3 4.2 9.1 4.9q2.8.7 4.9-2.1q-1.4 5.6-7 5.6c-5.6 0-6.3-4.2-9.1-4.9q-2.8-.7-4.9 2.1Z"/>`}})),Ap=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#c2c2c2" d="M22.038 2H6.375a1.755 1.755 0 0 0-1.75 1.75v24.5A1.755 1.755 0 0 0 6.375 30h19.25a1.755 1.755 0 0 0 1.75-1.75V6.856Zm.525 2.844l1.663 1.531h-1.663ZM6.375 28.25V3.75h14.438v4.375h4.813V28.25Z"/><path fill="#829ec2" d="M8.125 15.097h13.076v1.75H8.125zm0 9.342h9.762v1.75H8.125zm0-4.676h15.75v1.75H8.125zm0-9.533h15.75v1.75H8.125z"/>`}})),jp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#7f7f7f" d="M22.76 6.83v3.25h-5v15.09h-3.5V10.08h-5V6.83Z"/><path fill="#bfbfbf" d="M2 2h6.2v3.09H5.34v21.8H8.2V30H2Zm28 28h-6.2v-3.09h2.86V5.11H23.8V2H30Z"/>`}})),Mp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#007acc" d="M23.827 8.243a4.424 4.424 0 0 1 2.223 1.281a5.853 5.853 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.014 2.014 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.1 3.636 1.817 4.31 2.843a5.158 5.158 0 0 1 .416 4.333a4.764 4.764 0 0 1-3.932 2.815a10.9 10.9 0 0 1-2.708-.028a6.531 6.531 0 0 1-3.616-1.884a6.278 6.278 0 0 1-.926-1.371a2.655 2.655 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.771 4.771 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.4-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.687 4.687 0 0 1-.976-1.777a7.116 7.116 0 0 1-.062-2.268a4.332 4.332 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084Zm-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a13.986 13.986 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"/><path fill="#99b8c4" d="m27.075 25.107l.363-.361c1.68.055 1.706 0 1.78-.177l.462-1.124l.034-.107l-.038-.093c-.02-.049-.081-.2-1.13-1.2v-.526c1.211-1.166 1.185-1.226 1.116-1.4l-.46-1.136c-.069-.17-.1-.237-1.763-.191l-.364-.367a8.138 8.138 0 0 0-.057-1.657l-.047-.106l-1.2-.525c-.177-.081-.239-.11-1.372 1.124l-.509-.008c-1.167-1.245-1.222-1.223-1.4-1.152l-1.115.452c-.175.071-.236.1-.169 1.79l-.36.359c-1.68-.055-1.7 0-1.778.177L18.606 20l-.036.108l.038.094c.02.048.078.194 1.13 1.2v.525c-1.211 1.166-1.184 1.226-1.115 1.4l.459 1.137c.07.174.1.236 1.763.192l.363.377a8.169 8.169 0 0 0 .055 1.654l.047.107l1.208.528c.176.073.236.1 1.366-1.13l.509.006c1.168 1.247 1.228 1.223 1.4 1.154l1.113-.45c.176-.075.237-.102.169-1.795Zm-4.788-2.632a2 2 0 1 1 2.618 1.14a2.023 2.023 0 0 1-2.618-1.14Z"/>`}})),Np=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#007acc" d="M23.827 8.243a4.424 4.424 0 0 1 2.223 1.281a5.853 5.853 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.014 2.014 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.095 3.636 1.817 4.31 2.843a5.158 5.158 0 0 1 .416 4.333a4.764 4.764 0 0 1-3.932 2.815a10.9 10.9 0 0 1-2.708-.028a6.531 6.531 0 0 1-3.616-1.884a6.278 6.278 0 0 1-.926-1.371a2.655 2.655 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.771 4.771 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.687 4.687 0 0 1-.976-1.777a7.116 7.116 0 0 1-.062-2.268a4.332 4.332 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084Zm-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a13.986 13.986 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"/>`}})),Pp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e75749" d="M4.5 2.375A2.562 2.562 0 0 1 5.861 2h20.366a2.545 2.545 0 0 1 2.423 1.951a3.37 3.37 0 0 1 .072.862v11.176h-1.573a1.814 1.814 0 0 0-.22.022a5.236 5.236 0 0 0-.581-.011c-.3.007-.61-.014-.914.014a2.275 2.275 0 0 0-.4-.02h-4.739c-.2 0-.392.008-.587-.01l.1-.065l-6.353-3.813v3.889c-2.213-.005-4.427 0-6.64 0a2.274 2.274 0 0 0-.251.021c-.212-.032-.427-.016-.642-.016c-.284.006-.57-.015-.853.015a2.052 2.052 0 0 0-.253-.022H3.275c.006-3.635 0-7.27 0-10.9a4.786 4.786 0 0 1 .071-1.131A2.541 2.541 0 0 1 4.5 2.375Zm.54 2.188a.639.639 0 0 0-.489.606v1.316a.639.639 0 0 0 .627.6h1.309a.638.638 0 0 0 .6-.608c.005-.426 0-.853 0-1.279a.644.644 0 0 0-.329-.575a.708.708 0 0 0-.358-.078H5.264a1.081 1.081 0 0 0-.224.018Zm20.341 0a.639.639 0 0 0-.474.607v1.306a.638.638 0 0 0 .6.608c.436.005.872 0 1.308 0a.639.639 0 0 0 .627-.606c.006-.438 0-.876 0-1.314a.638.638 0 0 0-.594-.621c-.348-.009-.7 0-1.045 0a1.98 1.98 0 0 0-.422.024ZM5.042 8.38a.637.637 0 0 0-.452.4a1.078 1.078 0 0 0-.041.386v1.135a.637.637 0 0 0 .6.6c.4.008.795 0 1.192 0a.826.826 0 0 0 .395-.065a.641.641 0 0 0 .36-.574V8.983a.638.638 0 0 0-.6-.624c-.338-.008-.677 0-1.016 0a2.385 2.385 0 0 0-.438.021Zm20.338 0a.637.637 0 0 0-.433.4a1.072 1.072 0 0 0-.041.387v1.131a.638.638 0 0 0 .608.607c.406.006.812 0 1.218 0a.739.739 0 0 0 .38-.078a.64.64 0 0 0 .335-.558V8.985a.637.637 0 0 0-.593-.622c-.349-.009-.7 0-1.047 0a1.928 1.928 0 0 0-.428.022ZM5.041 12.2a.639.639 0 0 0-.491.608c0 .438-.005.877 0 1.315a.638.638 0 0 0 .627.6h1.3a.638.638 0 0 0 .608-.607v-1.307a.638.638 0 0 0-.605-.626c-.348-.007-.7 0-1.045 0a2.12 2.12 0 0 0-.394.017Zm20.335.006a.635.635 0 0 0-.43.394a1.06 1.06 0 0 0-.041.386v1.131a.638.638 0 0 0 .607.608c.435.005.87 0 1.306 0a.639.639 0 0 0 .628-.605c.006-.438 0-.876 0-1.313a.637.637 0 0 0-.592-.622c-.349-.01-.7 0-1.046 0a1.908 1.908 0 0 0-.431.015Z"/><path fill="#fff" d="M13.458 12.1q3.176 1.908 6.353 3.813l-.1.065q-3.127 1.872-6.251 3.748V15.99c-.001-1.295-.004-2.59-.002-3.89Z"/><path fill="#c0392b" d="M3.275 15.988h1.541a2.052 2.052 0 0 1 .253.022a.645.645 0 0 0-.409.273a.883.883 0 0 0-.111.518v1.045a.686.686 0 0 0 .685.689h1.192a.68.68 0 0 0 .657-.569c.008-.447 0-.9 0-1.343a.632.632 0 0 0-.521-.613a2.274 2.274 0 0 1 .251-.021h6.64v3.736q3.127-1.871 6.251-3.748c.2.018.391.007.587.01h4.741a2.275 2.275 0 0 1 .4.02a.637.637 0 0 0-.475.385a.983.983 0 0 0-.045.407v1.014a.677.677 0 0 0 .691.719h1.16a.684.684 0 0 0 .686-.658v-.984a1.074 1.074 0 0 0-.1-.589a.642.642 0 0 0-.42-.292a1.814 1.814 0 0 1 .22-.022h1.573c.011 1.721 0 3.443 0 5.165v6.293a2.567 2.567 0 0 1-.612 1.651a2.539 2.539 0 0 1-1.563.868a7.534 7.534 0 0 1-.981.033H6.724a9.27 9.27 0 0 1-1.368-.048a2.557 2.557 0 0 1-2-1.846a2.825 2.825 0 0 1-.09-.746V16.891c.007-.3-.002-.602.009-.903Zm1.795 3.843a.613.613 0 0 0-.386.234a.761.761 0 0 0-.134.464v1.162a.685.685 0 0 0 .686.658h1.283a.687.687 0 0 0 .568-.716v-1.191a.617.617 0 0 0-.2-.458a.712.712 0 0 0-.487-.17H5.264a1.039 1.039 0 0 0-.194.017Zm20.366 0a.62.62 0 0 0-.522.58v1.222a.676.676 0 0 0 .69.718c.428 0 .857.005 1.285 0a.7.7 0 0 0 .562-.684v-1.013a.9.9 0 0 0-.123-.568a.661.661 0 0 0-.532-.267h-.954a2.246 2.246 0 0 0-.406.011ZM5.071 23.648a.609.609 0 0 0-.4.249a.766.766 0 0 0-.124.448v1.132a.7.7 0 0 0 .6.688h1.376a.687.687 0 0 0 .567-.717v-1.189a.617.617 0 0 0-.2-.459a.71.71 0 0 0-.484-.17H5.265a1.028 1.028 0 0 0-.194.018Zm20.362 0a.616.616 0 0 0-.492.427a.99.99 0 0 0-.029.33V25.6a.681.681 0 0 0 .656.567h1.193a.689.689 0 0 0 .686-.719v-1.164a.657.657 0 0 0-.286-.545a1.461 1.461 0 0 0-.787-.11c-.312.01-.629-.02-.94.018Z"/>`}})),Fp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<g fill="none"><path fill="url(#vscodeIconsFileTypeVite0)" d="m29.884 6.146l-13.142 23.5a.714.714 0 0 1-1.244.005L2.096 6.148a.714.714 0 0 1 .746-1.057l13.156 2.352a.714.714 0 0 0 .253 0l12.881-2.348a.714.714 0 0 1 .752 1.05z"/><path fill="url(#vscodeIconsFileTypeVite1)" d="M22.264 2.007L12.54 3.912a.357.357 0 0 0-.288.33l-.598 10.104a.357.357 0 0 0 .437.369l2.707-.625a.357.357 0 0 1 .43.42l-.804 3.939a.357.357 0 0 0 .454.413l1.672-.508a.357.357 0 0 1 .454.414l-1.279 6.187c-.08.387.435.598.65.267l.143-.222l7.925-15.815a.357.357 0 0 0-.387-.51l-2.787.537a.357.357 0 0 1-.41-.45l1.818-6.306a.357.357 0 0 0-.412-.45z"/><defs><linearGradient id="vscodeIconsFileTypeVite0" x1="6" x2="235" y1="33" y2="344" gradientTransform="translate(1.34 1.894) scale(.07142)" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="vscodeIconsFileTypeVite1" x1="194.651" x2="236.076" y1="8.818" y2="292.989" gradientTransform="translate(1.34 1.894) scale(.07142)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset=".083" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs></g>`}})),Ip=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fcc72b" d="m22.86 11.09l-6.55 9.46a.58.58 0 0 1-.28.21a.55.55 0 0 1-.36 0a.56.56 0 0 1-.29-.21a.59.59 0 0 1-.09-.35l.26-5.2l-4.23-.9a.55.55 0 0 1-.24-.12a.5.5 0 0 1-.16-.22a.5.5 0 0 1 0-.27a.46.46 0 0 1 .1-.25l6.54-9.46a.58.58 0 0 1 .29-.22a.53.53 0 0 1 .35 0a.58.58 0 0 1 .29.22a.52.52 0 0 1 .09.34l-.26 5.22l4.23.9a.58.58 0 0 1 .25.12a.69.69 0 0 1 .16.22a.62.62 0 0 1-.06.53Z"/><path fill="#729b1b" d="M16 28.49a1.44 1.44 0 0 1-.5-.1a1.3 1.3 0 0 1-.43-.29l-6.19-6.19A1.28 1.28 0 0 1 8.5 21a1.3 1.3 0 0 1 1.32-1.32a1.32 1.32 0 0 1 .94.38L16 25.29l11.43-11.43a1.32 1.32 0 0 1 .94-.38a1.31 1.31 0 0 1 .93.39a1.29 1.29 0 0 1 .39.93a1.34 1.34 0 0 1-.38.93L16.94 28.1a1.42 1.42 0 0 1-.43.29a1.45 1.45 0 0 1-.51.1Z"/><path fill="#729b1b" fill-opacity=".5" d="M16 28.49a1.44 1.44 0 0 0 .5-.1a1.3 1.3 0 0 0 .43-.29l6.19-6.19a1.28 1.28 0 0 0 .38-.91a1.3 1.3 0 0 0-1.32-1.32a1.32 1.32 0 0 0-.94.38L16 25.29L4.57 13.86a1.32 1.32 0 0 0-.94-.38a1.31 1.31 0 0 0-.93.39a1.29 1.29 0 0 0-.39.93a1.34 1.34 0 0 0 .38.93L15.06 28.1a1.42 1.42 0 0 0 .43.29a1.45 1.45 0 0 0 .51.1Z"/>`}})),Lp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#41b883" d="M24.4 3.925H30l-14 24.15L2 3.925h10.71l3.29 5.6l3.22-5.6Z"/><path fill="#41b883" d="m2 3.925l14 24.15l14-24.15h-5.6L16 18.415L7.53 3.925Z"/><path fill="#35495e" d="M7.53 3.925L16 18.485l8.4-14.56h-5.18L16 9.525l-3.29-5.6Z"/>`}})),Rp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeWord0" x1="4.494" x2="13.832" y1="-1712.086" y2="-1695.914" gradientTransform="translate(0 1720)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2368c4"/><stop offset=".5" stop-color="#1a5dbe"/><stop offset="1" stop-color="#1146ac"/></linearGradient></defs><path fill="#41a5ee" d="M28.806 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5l11.069 3.25L30 9.5V4.191A1.192 1.192 0 0 0 28.806 3Z"/><path fill="#2b7cd3" d="M30 9.5H8.512V16l11.069 1.95L30 16Z"/><path fill="#185abd" d="M8.512 16v6.5l10.418 1.3L30 22.5V16Z"/><path fill="#103f91" d="M9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5H8.512v5.309A1.192 1.192 0 0 0 9.705 29Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypeWord0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="M6.9 17.988c.023.184.039.344.046.481h.028c.01-.13.032-.287.065-.47s.062-.338.089-.465l1.255-5.407h1.624l1.3 5.326a7.761 7.761 0 0 1 .162 1h.022a7.6 7.6 0 0 1 .135-.975l1.039-5.358h1.477l-1.824 7.748h-1.727l-1.237-5.126q-.054-.222-.122-.578t-.084-.52h-.021q-.021.189-.084.561c-.042.249-.075.432-.1.552L7.78 19.871H6.024L4.19 12.127h1.5l1.131 5.418a4.469 4.469 0 0 1 .079.443Z"/>`}})),zp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f1662a" d="m20.42 21.157l2.211 2.211L30 16l-7.369-7.369l-2.211 2.212L25.58 16Zm-8.84-10.314L9.369 8.631L2 16l7.369 7.369l2.211-2.211L6.42 16Zm5.831-3.166l1.6.437l-4.42 16.209l-1.6-.437l4.42-16.209Z"/>`}})),Bp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffe885" d="M2 12.218c.755 0 1.51-.008 2.264 0l.053.038l2.761 2.758c.891-.906 1.8-1.794 2.7-2.7c.053-.052.11-.113.192-.1h1.823a1.4 1.4 0 0 1 .353.019c-.7.67-1.377 1.369-2.069 2.05L5.545 18.8c-.331.324-.648.663-.989.975c-.754.022-1.511.007-2.266.007c1.223-1.209 2.431-2.433 3.658-3.637c-1.321-1.304-2.63-2.62-3.948-3.927Zm10.7 0h1.839v7.566c-.611 0-1.222.012-1.832-.008v-4.994c-1.6 1.607-3.209 3.2-4.811 4.8c-.089.08-.166.217-.305.194c-.824-.006-1.649 0-2.474 0Q8.916 16 12.7 12.218Zm2.258.002c.47-.009.939 0 1.409 0c.836.853 1.69 1.689 2.536 2.532q1.268-1.267 2.539-2.532h1.4q-.008 3.784 0 7.567c-.471 0-.943.006-1.414 0q.008-2.387 0-4.773c-.844.843-1.676 1.7-2.526 2.536c-.856-.835-1.687-1.695-2.532-2.541c0 1.594-.006 3.188.006 4.781c-.472 0-.943.005-1.415 0q-.003-3.79-.003-7.57Zm8.301-.003c.472 0 .944-.007 1.416 0q-.007 3.083 0 6.166h3.782c.063.006.144-.012.191.045c.448.454.907.9 1.353 1.354q-3.371.007-6.741 0q.007-3.782-.001-7.565Z"/>`}})),Vp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#2188b6" d="M28.208 24.409a10.493 10.493 0 0 0-3.959 1.822a23.743 23.743 0 0 1-5.835 2.642a1.632 1.632 0 0 1-.983.55a62.228 62.228 0 0 1-6.447.577c-1.163.009-1.876-.3-2.074-.776a1.573 1.573 0 0 1 .866-2.074a3.759 3.759 0 0 1-.514-.379c-.171-.171-.352-.514-.406-.388c-.225.55-.343 1.894-.947 2.5c-.83.839-2.4.559-3.328.072c-1.019-.541.072-1.813.072-1.813a.73.73 0 0 1-.992-.343a4.847 4.847 0 0 1-.667-2.949a5.374 5.374 0 0 1 1.749-2.895a9.334 9.334 0 0 1 .658-4.4a10.445 10.445 0 0 1 3.165-3.661S6.628 10.747 7.35 8.817c.469-1.262.658-1.253.812-1.308a3.633 3.633 0 0 0 1.452-.857a5.265 5.265 0 0 1 4.41-1.7S15.2 1.4 16.277 2.09a18.349 18.349 0 0 1 1.533 2.886s1.281-.748 1.425-.469a11.334 11.334 0 0 1 .523 6.132a14.01 14.01 0 0 1-2.6 5.411c-.135.225 1.551.938 2.615 3.887c.983 2.7.108 4.96.262 5.212c.027.045.036.063.036.063s1.127.09 3.391-1.308a8.5 8.5 0 0 1 4.277-1.604a1.081 1.081 0 0 1 .469 2.11Z"/>`}})),Hp=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeZip0" x1="17.65" x2="21.099" y1="26.056" y2="26.056" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#4d4d4d"/><stop offset=".5" stop-color="#fff"/><stop offset="1" stop-color="#4d4d4d"/></linearGradient><linearGradient id="vscodeIconsFileTypeZip1" x1="17.65" x2="21.099" y1="23.756" y2="23.756" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip2" x1="17.65" x2="21.099" y1="21.456" y2="21.456" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip3" x1="17.65" x2="21.099" y1="19.156" y2="19.156" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip4" x1="17.65" x2="21.099" y1="16.857" y2="16.857" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip5" x1="17.65" x2="21.099" y1="14.557" y2="14.557" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip6" x1="17.65" x2="21.099" y1="12.257" y2="12.257" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip7" x1="17.65" x2="21.099" y1="9.957" y2="9.957" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip8" x1="17.65" x2="21.099" y1="7.657" y2="7.657" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip9" x1="16.237" x2="19.686" y1="27.217" y2="27.217" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipa" x1="16.237" x2="19.686" y1="24.918" y2="24.918" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipb" x1="16.237" x2="19.686" y1="22.618" y2="22.618" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipc" x1="16.237" x2="19.686" y1="20.318" y2="20.318" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipd" x1="16.237" x2="19.686" y1="18.018" y2="18.018" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipe" x1="17.65" x2="21.099" y1="28.356" y2="28.356" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipf" x1="16.237" x2="19.686" y1="15.718" y2="15.718" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipg" x1="16.237" x2="19.686" y1="13.419" y2="13.419" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZiph" x1="16.237" x2="19.686" y1="11.119" y2="11.119" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipi" x1="16.237" x2="19.686" y1="8.819" y2="8.819" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipj" x1="16.237" x2="19.686" y1="29.514" y2="29.514" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipk" x1="16.985" x2="20.446" y1="11.196" y2="11.196" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipl" x1="18.096" x2="19.336" y1="5.329" y2="5.329" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipm" x1="16.029" x2="21.403" y1="5.591" y2="5.591" href="#vscodeIconsFileTypeZip0"/></defs><path fill="#c09553" d="M27.667 27.667V17.333L23 15V2H4.333v28h23.334Zm-4.667 0v-9.111l2.333 1.222v7.889Z"/><path fill="url(#vscodeIconsFileTypeZip0)" d="M17.65 25.559h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip1)" d="M17.65 23.26h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip2)" d="M17.65 20.96h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip3)" d="M17.65 18.66h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip4)" d="M17.65 16.36h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip5)" d="M17.65 14.06h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip6)" d="M17.65 11.76h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip7)" d="M17.65 9.461h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip8)" d="M17.65 7.161h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip9)" d="M16.237 26.721h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipa)" d="M16.237 24.421h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipb)" d="M16.237 22.121h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipc)" d="M16.237 19.821h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipd)" d="M16.237 17.522h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipe)" d="M17.65 27.859h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipf)" d="M16.237 15.222h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipg)" d="M16.237 12.922h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZiph)" d="M16.237 10.622h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipi)" d="M16.237 8.322h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipj)" d="M16.237 29.018h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipk)" d="M20.1 5.911a.554.554 0 0 0-.548-.53h-.009v.557h.092l.206 2.514h-2.252l.211-2.514h.094v-.557h-.044a.552.552 0 0 0-.547.53l-.314 10.569a.513.513 0 0 0 .515.531h2.432a.512.512 0 0 0 .513-.531Zm-1.384 10.5a1.171 1.171 0 1 1 1.171-1.171a1.171 1.171 0 0 1-1.171 1.168Z"/><path fill="url(#vscodeIconsFileTypeZipl)" d="M18.096 3.802h1.24v3.054h-1.24z"/><path fill="url(#vscodeIconsFileTypeZipm)" d="M21.4 4.56a2.549 2.549 0 0 0-2.549-2.549h-.276a2.55 2.55 0 0 0-2.436 3.3v.006a7.986 7.986 0 0 1 .261 2.561a1.811 1.811 0 0 0 .641 1.271l.109-3.441a.593.593 0 0 1 .6-.551h.135v-1.57h1.653v1.57h.1a.6.6 0 0 1 .605.551l.121 3.462a1.813 1.813 0 0 0 .666-1.292V7.72a7.693 7.693 0 0 1 .236-2.359a2.543 2.543 0 0 0 .134-.801Z"/>`}})),Up=e(Vf(),1),Wp=e(Hf(),1),Gp=e(Uf(),1),Kp=e(Wf(),1),qp=e(Gf(),1),Jp=e(Kf(),1),Yp=e(qf(),1),Xp=e(Jf(),1),Zp=e(Yf(),1),Qp=e(Xf(),1),$p=e(Zf(),1),em=e(Qf(),1),tm=e($f(),1),nm=e(ep(),1),rm=e(tp(),1),im=e(np(),1),am=e(rp(),1),om=e(ip(),1),sm=e(ap(),1),cm=e(op(),1),lm=e(sp(),1),um=e(cp(),1),dm=e(lp(),1),fm=e(up(),1),pm=e(dp(),1),mm=e(fp(),1),hm=e(pp(),1),gm=e(mp(),1),_m=e(hp(),1),vm=e(gp(),1),ym=e(_p(),1),bm=e(vp(),1),xm=e(yp(),1),Sm=e(bp(),1),Cm=e(xp(),1),wm=e(Sp(),1),Tm=e(Cp(),1),Em=e(wp(),1),Dm=e(Tp(),1),Om=e(Ep(),1),km=e(Dp(),1),Am=e(Op(),1),jm=e(kp(),1),Mm=e(Ap(),1),Nm=e(jp(),1),Pm=e(Mp(),1),Fm=e(Np(),1),Im=e(Pp(),1),Lm=e(Fp(),1),Rm=e(Ip(),1),zm=e(Lp(),1),Bm=e(Rp(),1),Vm=e(zp(),1),Hm=e(Bp(),1),Um=e(Vp(),1),Wm=e(Hp(),1),Gm=[{icon:Xp.default,name:`docker`,pattern:/^(dockerfile|\.dockerignore)$/},{icon:Zp.default,name:`dotenv`,pattern:/^\.env(?:\.|$)/},{icon:tm.default,name:`git`,pattern:/^\.git(?:attributes|ignore|modules)$/},{icon:fm.default,name:`makefile`,pattern:/^makefile$/},{icon:um.default,name:`license`,pattern:/^licen[cs]e(?:\.|$)/},{icon:pm.default,name:`markdown`,pattern:/^readme(?:\.|$)/},{icon:mm.default,name:`npm`,pattern:/^package(?:-lock)?\.json$/},{icon:_m.default,name:`pnpm`,pattern:/^(pnpm-lock\.yaml|pnpm-workspace\.yaml)$/},{icon:Um.default,name:`yarn`,pattern:/^yarn\.lock$/},{icon:Gp.default,name:`bun`,pattern:/^bun\.lockb?$/},{icon:Pm.default,name:`tsconfig`,pattern:/^tsconfig(?:\..+)?\.json$/},{icon:Lm.default,name:`vite`,pattern:/^vite\.config\./},{icon:Rm.default,name:`vitest`,pattern:/^vitest(?:\..+)?\.config\./},{icon:jm.default,name:`tailwind`,pattern:/^tailwind\.config\./},{icon:Qp.default,name:`eslint`,pattern:/^(eslint\.config\.|\.eslintrc)/},{icon:ym.default,name:`prettier`,pattern:/^(prettier\.config\.|\.prettierrc)/}],Km=[{icon:Sm.default,name:`react-typescript`,extensions:[`tsx`]},{icon:xm.default,name:`react-javascript`,extensions:[`jsx`]},{icon:Fm.default,name:`typescript`,extensions:[`ts`,`mts`,`cts`]},{icon:sm.default,name:`javascript`,extensions:[`js`,`mjs`,`cjs`]},{icon:cm.default,name:`json`,extensions:[`json`,`json5`,`jsonc`]},{icon:pm.default,name:`markdown`,extensions:[`md`,`mdx`]},{icon:im.default,name:`html`,extensions:[`html`,`htm`]},{icon:Yp.default,name:`css`,extensions:[`css`,`pcss`,`less`]},{icon:Tm.default,name:`sass`,extensions:[`sass`,`scss`]},{icon:zm.default,name:`vue`,extensions:[`vue`]},{icon:Om.default,name:`svelte`,extensions:[`svelte`]},{icon:bm.default,name:`python`,extensions:[`py`,`pyw`]},{icon:nm.default,name:`go`,extensions:[`go`]},{icon:wm.default,name:`rust`,extensions:[`rs`]},{icon:om.default,name:`java`,extensions:[`java`]},{icon:lm.default,name:`kotlin`,extensions:[`kt`,`kts`]},{icon:Am.default,name:`swift`,extensions:[`swift`]},{icon:qp.default,name:`cpp`,extensions:[`c`,`cc`,`cpp`,`h`,`hpp`]},{icon:Jp.default,name:`csharp`,extensions:[`cs`]},{icon:gm.default,name:`php`,extensions:[`php`]},{icon:Cm.default,name:`ruby`,extensions:[`rb`]},{icon:dm.default,name:`lua`,extensions:[`lua`]},{icon:Em.default,name:`shell`,extensions:[`sh`,`bash`,`zsh`,`fish`,`ps1`]},{icon:rm.default,name:`graphql`,extensions:[`graphql`,`gql`]},{icon:Hm.default,name:`yaml`,extensions:[`yaml`,`yml`]},{icon:Nm.default,name:`toml`,extensions:[`toml`]},{icon:Vm.default,name:`xml`,extensions:[`xml`]},{icon:Dm.default,name:`sql`,extensions:[`sql`,`sqlite`,`db`]},{icon:km.default,name:`svg`,extensions:[`svg`]},{icon:am.default,name:`image`,extensions:[`avif`,`bmp`,`gif`,`heic`,`ico`,`jpeg`,`jpg`,`png`,`tif`,`tiff`,`webp`]},{icon:Wp.default,name:`audio`,extensions:[`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]},{icon:Im.default,name:`video`,extensions:[`avi`,`m4v`,`mkv`,`mov`,`mp4`,`webm`,`wmv`]},{icon:hm.default,name:`pdf`,extensions:[`pdf`]},{icon:Bm.default,name:`word`,extensions:[`doc`,`docx`,`odt`,`rtf`]},{icon:$p.default,name:`excel`,extensions:[`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]},{icon:vm.default,name:`powerpoint`,extensions:[`odp`,`ppt`,`pptx`]},{icon:Wm.default,name:`archive`,extensions:[`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]},{icon:em.default,name:`font`,extensions:[`eot`,`otf`,`ttf`,`woff`,`woff2`]},{icon:Kp.default,name:`config`,extensions:[`cfg`,`conf`,`ini`,`properties`]},{icon:Mm.default,name:`text`,extensions:[`log`,`txt`]}],qm={icon:Up.default,name:`default`};function Jm(e){return e.trim().split(/[\\/]/).filter(Boolean).pop()??e.trim()}function Ym(e){return/\.([a-z0-9]{1,16})$/i.exec(e)?.[1]?.toLowerCase()??``}function Xm(e){let t=Jm(e).toLowerCase(),n=Gm.find(({pattern:e})=>e.test(t));if(n)return n;let r=Ym(t);return Km.find(({extensions:e})=>e.includes(r))??qm}function Zm(e){let t=e;return`body`in t?t:t.default}function Qm({className:e,fileName:t,size:n=`default`}){let r=Xm(t);return(0,F.jsx)(Bf,{"aria-hidden":`true`,"data-file-type-icon":r.name,icon:Zm(r.icon),className:m(`shrink-0`,n===`compact`?`h-3.5 w-3.5`:`h-4 w-4`,e)})}function $m({agentId:e,fileName:t,kind:n}){return n===`overview`?(0,F.jsx)(Mo,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`child-sessions`?(0,F.jsx)(To,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`project-files`?(0,F.jsx)(So,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`cron`?(0,F.jsx)(Wa,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`file`?(0,F.jsx)(Qm,{fileName:t??``,size:`compact`}):n===`side-chat-draft`?(0,F.jsx)(Ro,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):e?(0,F.jsx)(Fu,{agentId:e,className:`h-3.5 w-3.5 shrink-0`}):(0,F.jsx)(zo,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`})}function eh(e){return e.map(e=>({key:e.key,label:e.title,labelClassName:e.isRenderedPreview?`italic font-normal`:void 0,active:e.active,tooltip:e.tooltip,leadingIcon:(0,F.jsx)($m,{kind:e.kind,agentId:e.agentId,fileName:e.fileName}),badge:e.kind===`file`&&e.viewMode===`diff`?(0,F.jsx)(`span`,{className:`shrink-0 rounded border border-amber-200 bg-amber-50 px-1 py-0 text-[9px] font-medium uppercase tracking-[0.08em] text-amber-700`,children:f(`chatWorkspaceDiff`)}):null,unreadIndicator:e.showUnreadDot?(0,F.jsx)(`span`,{"aria-label":f(`chatSessionUnread`),className:`h-2 w-2 shrink-0 rounded-full bg-primary`}):null,closeLabel:`${e.kind===`file`?f(`chatWorkspaceCloseFile`):f(`chatWorkspaceCloseTab`)}: ${e.title}`,closePlacement:`leading-hover`,onSelect:e.onSelect,onClose:e.onClose,menuLabel:f(`chatWorkspaceFileMoreActions`),menuActions:e.kind===`file`?[...e.alternateViewerAction?[{key:`viewer:${e.alternateViewerAction.viewer}`,icon:e.alternateViewerAction.viewer===`rendered`?(0,F.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,F.jsx)(oo,{className:`h-3.5 w-3.5`}),label:e.alternateViewerAction.label,onClick:e.alternateViewerAction.onSelect}]:[],...e.onClose?[{key:`close`,icon:(0,F.jsx)(Cn,{className:`h-3.5 w-3.5`}),label:f(`chatWorkspaceCloseFile`),onClick:e.onClose}]:[]]:void 0}))}function th({canGoBack:e,canGoForward:t,isMaximized:n=!1,onClose:r,onGoBack:i,onGoForward:a,onRefreshFile:o,onToggleMaximize:s,tabs:c}){return(0,F.jsx)(xt,{testId:`workspace-tabs-bar`,scrollTestId:`workspace-tabs-scroll`,tabs:eh(c),actions:[{key:`back`,icon:(0,F.jsx)(ot,{className:`h-4 w-4`}),label:f(`chatWorkspaceBack`),disabled:!e,onClick:i},{key:`forward`,icon:(0,F.jsx)(wt,{className:`h-4 w-4`}),label:f(`chatWorkspaceForward`),disabled:!t,onClick:a},...o?[{key:`refresh-file`,icon:(0,F.jsx)(yn,{className:`h-4 w-4`}),label:f(`chatWorkspaceRefreshFile`),onClick:o}]:[],...s?[{key:`maximize`,icon:n?(0,F.jsx)(Bo,{className:`h-4 w-4`}):(0,F.jsx)(Io,{className:`h-4 w-4`}),label:f(n?`chatWorkspaceRestorePanel`:`chatWorkspaceMaximizePanel`),onClick:s}]:[],{key:`close`,icon:(0,F.jsx)(Cn,{className:`h-4 w-4`}),label:f(`chatWorkspaceClosePanel`),onClick:r}],scrollClassName:`workspace-horizontal-scrollbar`,actionsClassName:`ml-1 mr-1 self-stretch`})}var nh={key:`slash`,marker:`/`};function rh(){return`composer-${Math.random().toString(36).slice(2,10)}`}function ih(e=``){return{id:rh(),type:`text`,text:e}}function ah(e){return{id:rh(),type:`token`,tokenKind:e.tokenKind,tokenKey:e.tokenKey,label:e.label}}function oh(e){return e.type===`text`?e.text.length:1}function sh(){return[ih(``)]}function ch(e){return[ih(e)]}function lh(e){let t=[];for(let n of e){if(n.type===`text`){if(n.text.length===0)continue;let e=t[t.length-1];if(e?.type===`text`){t[t.length-1]={...e,text:e.text+n.text};continue}}t.push(n)}return t.length===0?sh():t}function uh(e){return e.map(e=>e.type===`text`?e.text:``).join(``)}function dh(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function fh(e,t){let n=[],r=new Set;for(let i of e)i.type!==`token`||i.tokenKind!==t||r.has(i.tokenKey)||(r.add(i.tokenKey),n.push(i.tokenKey));return n}function ph(e,t,n,r){let i=Math.max(0,n-t),a=Math.max(0,t+e.text.length-r),o=[];return i>0&&o.push({...e,text:e.text.slice(0,i)}),a>0&&o.push({...e,text:e.text.slice(e.text.length-a)}),o}function mh(e,t,n,r){return t<=n||e>=r}function hh(e,t,n,r,i){return!n&&r>=i?(e.push(...t),!0):n}function gh(e,t,n,r,i,a,o){let s=ph(t,n,r,i);s[0]&&e.push(s[0]);let c=o;return c||=(e.push(...a),!0),s[1]&&e.push(s[1]),c}function _h(e,t,n,r,i,a){return!r&&i<=a?(e.push(...n),!0):(e.push(t),r)}function vh(e,t,n,r){let i=Math.max(0,t),a=Math.max(i,n),o=[],s=0,c=!1;for(let t of e){let e=oh(t),n=s,l=s+e;if(mh(n,l,i,a)){c=hh(o,r,c,n,a),o.push(t),s=l;continue}c=t.type===`text`?gh(o,t,n,i,a,r,c):_h(o,t,r,c,i,n),s=l}return c||o.push(...r),lh(o)}function yh(e,t){return lh(e.filter(e=>e.type!==`token`||!t(e)))}function bh(e,t){return t===0||/\s/.test(e[t-1]??``)}function xh(e,t,n){if(!t||t.start!==t.end)return null;let r=uh(e),i=t.end,a=r.slice(0,i),o=a.lastIndexOf(n.marker);if(o<0||!bh(a,o))return null;let s=a.slice(o+n.marker.length);return/[\s\uFFFC]/.test(s)?null:{key:n.key,marker:n.marker,query:s.trim().toLowerCase(),start:o,end:i}}function Sh(e,t,n=[nh]){let r=null;for(let i of n){let n=xh(e,t,i);n&&(!r||n.start>r.start)&&(r=n)}return r}function Ch(e,t){let n=xh(e,t,nh);return n?{query:n.query,start:n.start,end:n.end}:null}var wh=e=>`[data-item-index="${e}"]`;function Th(e){let{activeIndex:t,containerRef:n,getItemSelector:r,isEnabled:i,itemCount:a}=e,o=r??wh;(0,P.useEffect)(()=>{if(!i||a===0)return;let e=n.current;if(!e)return;let r=e.querySelector(o(t));typeof r?.scrollIntoView==`function`&&r.scrollIntoView({block:`nearest`,inline:`nearest`})},[t,n,o,i,a])}function Eh(){let e=(0,P.useRef)(null),[t,n]=(0,P.useState)(null);return(0,P.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=()=>{n(t.getBoundingClientRect().width)};r();let i=new ResizeObserver(()=>r());return i.observe(t),()=>i.disconnect()},[]),{elementRef:e,width:t}}function R(...e){return i(a(e))}var Dh=P.forwardRef(({className:e,type:t,...n},r)=>(0,F.jsx)(`input`,{type:t,className:R(`flex h-9 w-full rounded-xl border border-border bg-card px-3.5 py-2 text-sm text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/55 placeholder:font-normal focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/40 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));Dh.displayName=`ChatInput`;var Oh=`2rem`;function kh(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${Oh})))`}var Ah=kh(`24rem`),jh=qe,Mh=Qe,Nh=Je,Ph=P.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,collisionPadding:r=12,style:i,...a},o)=>(0,F.jsx)(Ge,{children:(0,F.jsx)(Xe,{ref:o,sideOffset:t,align:n,collisionPadding:r,className:R(`z-[var(--z-popover,50)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=top]:slide-in-from-bottom-2 data-[side=right]:slide-in-from-left-2`,e),style:{maxHeight:Ah,...i},...a})}));Ph.displayName=Xe.displayName;var Fh=Ft,Ih=jt,Lh=At,Rh=`2rem`;function zh(e){return`min(${e}, max(0px, calc(var(--radix-select-content-available-height, 100vh) - ${Rh})))`}var Bh=zh(`24rem`),Vh=P.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(Yt,{ref:r,className:R(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,F.jsx)(Lt,{asChild:!0,children:(0,F.jsx)(Et,{className:`h-4 w-4 opacity-50`})})]}));Vh.displayName=Yt.displayName;var Hh=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Ot,{ref:n,className:R(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(Dt,{className:`h-4 w-4`})}));Hh.displayName=Ot.displayName;var Uh=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Pt,{ref:n,className:R(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(Et,{className:`h-4 w-4`})}));Uh.displayName=Pt.displayName;var Wh=P.forwardRef(({className:e,children:t,collisionPadding:n=12,position:r=`popper`,style:i,viewportClassName:a,...o},s)=>(0,F.jsx)(Rt,{children:(0,F.jsxs)(Ut,{ref:s,className:R(`relative z-50 flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),collisionPadding:n,position:r,style:{maxHeight:Bh,...i},...o,children:[(0,F.jsx)(Hh,{}),(0,F.jsx)(Jt,{className:R(`min-h-0 flex-1 overflow-y-auto overscroll-contain p-1`,r===`popper`&&`w-full min-w-[var(--radix-select-trigger-width)]`,a),children:t}),(0,F.jsx)(Uh,{})]})}));Wh.displayName=Ut.displayName;var Gh=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Vt,{ref:n,className:R(`px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,e),...t}));Gh.displayName=Vt.displayName;var Kh=P.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(Gt,{ref:r,className:R(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-accent hover:text-accent-foreground`,e),...n,children:[(0,F.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,F.jsx)(Mt,{children:(0,F.jsx)(qt,{className:`h-4 w-4`})})}),(0,F.jsx)(Nt,{children:t})]}));Kh.displayName=Gt.displayName;var qh=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Kt,{ref:n,className:R(`-mx-1 my-1 h-px bg-border`,e),...t}));qh.displayName=Kt.displayName;var Jh=dt,Yh=ft,Xh=bt,Zh=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,F.jsx)(Ct,{children:(0,F.jsx)(gt,{ref:r,sideOffset:t,className:R(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));Zh.displayName=gt.displayName;var Qh={Popover:jh,PopoverAnchor:Nh,PopoverContent:Ph,PopoverTrigger:Mh,Input:Dh,Select:Fh,SelectContent:Wh,SelectGroup:Ih,SelectItem:Kh,SelectLabel:Gh,SelectSeparator:qh,SelectTrigger:Vh,SelectValue:Lh,Tooltip:Yh,TooltipContent:Zh,TooltipProvider:Jh,TooltipTrigger:Xh},$h=680,eg=.82,tg=560,ng=kh(`24rem`),rg=kh(`240px`);function ig(e,t){return!t.sectionKeys||t.sectionKeys.length===0?!0:!!(e.sectionKey&&t.sectionKeys.includes(e.sectionKey))}var ag=(0,P.forwardRef)(function(e,t){let{Popover:n,PopoverAnchor:r,PopoverContent:i}=Qh,{elementRef:a,width:o}=Eh(),s=(0,P.useRef)(null),[c,l]=(0,P.useState)({index:0,itemsSignature:``}),{isOpen:u,isLoading:d,filterOptions:f,items:p,texts:m,onSelectItem:h,onOpenChange:g,onDetailsPointerDown:_}=e,[v,y]=(0,P.useState)(f?.[0]?.key??null),b=(0,P.useMemo)(()=>f?.length?f.some(e=>e.key===v)?v:f[0].key:null,[v,f]),x=(0,P.useMemo)(()=>f?.find(e=>e.key===b)??null,[f,b]),S=(0,P.useMemo)(()=>f?.map(e=>({...e,count:p.filter(t=>ig(t,e)).length}))??[],[f,p]),C=(0,P.useMemo)(()=>x?p.filter(e=>ig(e,x)):p,[x,p]),w=(0,P.useMemo)(()=>C.map(e=>e.key).join(``),[C]),T=(0,P.useMemo)(()=>C.some(e=>!!e.sectionLabel?.trim()),[C]),E=c.itemsSignature===w?c.index:0,D=C.length===0?0:Math.min(E,C.length-1),O=C[D]??null,k=(0,P.useCallback)(e=>{y(e),l({index:0,itemsSignature:``})},[]),A=(0,P.useCallback)(e=>{l(t=>{let n=t.itemsSignature===w?t.index:0;return{index:typeof e==`function`?e(n):e,itemsSignature:w}})},[w]),ee=(0,P.useMemo)(()=>{if(o)return Math.min(o>tg?o*eg:o,$h)},[o]);return(0,P.useImperativeHandle)(t,()=>({handleKeyDown:e=>u?e.key===`Escape`?(e.preventDefault(),g(!1),!0):C.length===0?!1:e.key===`ArrowDown`?(e.preventDefault(),A(e=>(e+1)%C.length),!0):e.key===`ArrowUp`?(e.preventDefault(),A(e=>(e-1+C.length)%C.length),!0):e.key===`Enter`&&!e.shiftKey||e.key===`Tab`?(e.preventDefault(),h(C[D]),!0):!1:!1}),[D,u,g,h,A,C]),Th({containerRef:s,activeIndex:D,itemCount:C.length,isEnabled:u&&!d,getItemSelector:e=>`[data-input-surface-index="${e}"]`}),(0,F.jsxs)(n,{open:u,onOpenChange:g,children:[(0,F.jsx)(r,{asChild:!0,children:(0,F.jsx)(`div`,{ref:a,className:`pointer-events-none absolute bottom-0 left-3 right-3 top-0`})}),(0,F.jsx)(i,{side:`top`,align:`start`,sideOffset:10,className:`z-[70] flex max-w-[calc(100vw-1.5rem)] flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white/95 p-0 shadow-2xl backdrop-blur-md`,onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:ng,width:ee?`${ee}px`:void 0},children:(0,F.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[minmax(220px,300px)_minmax(0,1fr)]`,style:{minHeight:rg},children:[(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-col border-r border-gray-200`,children:[!d&&S.length>0?(0,F.jsx)(`div`,{className:`flex shrink-0 gap-0.5 overflow-x-auto px-2 pb-1.5 pt-2`,children:S.map(({count:e,key:t,label:n})=>{let r=t===b;return(0,F.jsxs)(`button`,{type:`button`,"aria-pressed":r,onPointerDown:e=>e.preventDefault(),onClick:()=>k(t),className:`inline-flex h-7 shrink-0 items-center gap-1 rounded-md px-2 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 ${r?`bg-gray-100 text-gray-900`:`text-gray-600 hover:bg-gray-100 hover:text-gray-900`}`,children:[(0,F.jsx)(`span`,{children:n}),(0,F.jsx)(`span`,{className:r?`text-gray-500`:`text-gray-400`,children:e})]},t)})}):null,(0,F.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":m.sectionLabel,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain ${!d&&S.length>0?`px-2 pb-2`:`p-2`}`,children:d?(0,F.jsx)(`div`,{className:`p-2 text-xs text-gray-500`,children:m.loadingLabel}):(0,F.jsxs)(F.Fragment,{children:[T?null:(0,F.jsx)(`div`,{className:`mb-1 px-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:m.sectionLabel}),C.length===0?(0,F.jsx)(`div`,{className:`px-1.5 text-xs text-gray-400`,children:m.emptyLabel}):(0,F.jsx)(`div`,{children:C.map((e,t)=>{let{key:n,sectionKey:r,sectionLabel:i,title:a,subtitle:o}=e,s=t===D,c=C[t-1];return(0,F.jsxs)(`div`,{children:[T&&i?.trim()&&c?.sectionKey!==r?(0,F.jsx)(`div`,{className:`px-1.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:i}):null,(0,F.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":s,"data-input-surface-index":t,onPointerMove:e=>{e.pointerType!==`touch`&&A(t)},onPointerDown:t=>{t.button>0||(t.preventDefault(),h(e))},onClick:t=>{t.detail===0&&h(e)},className:`flex w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-left leading-4 transition-colors ${s?`bg-gray-100 text-gray-900`:`text-gray-700 hover:bg-gray-100`}`,children:[(0,F.jsx)(`span`,{className:`truncate text-xs font-medium`,children:a}),(0,F.jsx)(`span`,{className:`truncate text-xs text-gray-500`,children:o})]})]},n)})})]})})]}),(0,F.jsx)(`div`,{className:`custom-scrollbar min-h-0 min-w-0 select-text overflow-y-auto overscroll-contain p-2.5`,onPointerDown:_,children:O?(0,F.jsxs)(`div`,{className:`space-y-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`inline-flex rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary`,children:O.subtitle}),(0,F.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:O.title})]}),(0,F.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:O.description}),(0,F.jsx)(`div`,{className:`space-y-1`,children:O.detailLines.map(e=>(0,F.jsx)(`div`,{className:`min-w-0 break-all rounded-md bg-gray-50 px-2 py-1 text-[11px] leading-5 text-gray-600`,children:e},e))}),(0,F.jsx)(`div`,{className:`pt-1 text-[11px] text-gray-500`,children:O.hintLabel??m.itemHintLabel})]}):(0,F.jsx)(`div`,{className:`text-xs text-gray-500`,children:m.hintLabel})})]})})]})});function og(e){return`${e.key}:${e.marker}:${e.start}`}function sg(e,t){return t.type===`insert-text`&&t.text===e.marker&&e.query===``&&e.end===e.start+e.marker.length}function cg(e,t,n){if(!t)return null;let r=og(t);return e===r?e:sg(t,n)?r:null}function lg(e){let{children:t,inputSurface:n,onInputSurfaceTriggerChange:r,onSelectItem:i,triggerSpecs:a=[nh]}=e,o=(0,P.useRef)(null),s=(0,P.useRef)(!1),[c,l]=(0,P.useState)(null),u=!!n&&c!==null,d=(0,P.useCallback)((e,t)=>{l(e),r?.(e?t:null)},[r]),f=(0,P.useCallback)((e,t,n)=>{let r=Sh(e,t,a),i=cg(c,r,n);d(i,i?r:null)},[c,d,a]),p=(0,P.useCallback)(e=>o.current?.handleKeyDown(e)??!1,[]),m=(0,P.useCallback)(e=>{!e&&!s.current&&d(null,null)},[d]);return(0,F.jsxs)(F.Fragment,{children:[t((0,P.useMemo)(()=>({onInputSurfaceKeyDown:p,onInputSurfaceOpenChange:m,onInputSurfaceSnapshotChange:f}),[p,m,f])),n&&u?(0,F.jsx)(ag,{ref:o,isOpen:u,isLoading:n.isLoading,filterOptions:n.filterOptions,items:n.items,texts:n.texts,onSelectItem:e=>{d(null,null),i(e)},onOpenChange:m,onDetailsPointerDown:()=>{s.current=!0,requestAnimationFrame(()=>{s.current=!1})}},c):null]})}var ug=ie(`inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-border bg-card text-muted-foreground hover:bg-accent hover:text-accent-foreground`,secondary:`bg-muted text-foreground hover:bg-accent hover:text-accent-foreground`,ghost:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`,primary:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,subtle:`bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground`,"primary-outline":`border border-primary/30 text-primary hover:bg-primary hover:text-primary-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 px-3 text-xs`,lg:`h-11 px-5 text-[14px]`,xl:`h-12 px-6 text-[15px]`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),dg=P.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,F.jsx)(`button`,{className:R(ug({variant:t,size:n,className:e})),ref:i,...r}));dg.displayName=`ChatButton`;function fg(){return(0,F.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`chat-stop-icon`,className:`block h-3 w-3 rounded-[2px] bg-foreground shadow-[inset_0_0_0_1px_hsl(var(--border))]`})}function pg({contextWindow:e}){let{Tooltip:t,TooltipContent:n,TooltipProvider:r,TooltipTrigger:i}=Qh,a=Math.max(0,Math.min(1,e.ratio)),o=Math.round(a*360);return(0,F.jsx)(r,{delayDuration:0,children:(0,F.jsxs)(t,{children:[(0,F.jsx)(i,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,"aria-label":e.label,title:e.label,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[7px] rounded-full`,style:{background:`conic-gradient(hsl(var(--muted-foreground)) ${o}deg, hsl(var(--border)) 0deg)`}}),(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[10px] rounded-full bg-card`})]})}),(0,F.jsx)(n,{side:`top`,className:`max-w-[18rem]`,children:(0,F.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-5 font-semibold text-foreground`,children:[(0,F.jsx)(`span`,{children:e.label}),(0,F.jsx)(`span`,{children:e.percentLabel})]}),e.details.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-5 text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:e.label}),(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:e.value})]},e.label))]})})]})})}function mg({isSending:e,canStopGeneration:t,sendDisabled:n,stopDisabled:r,stopHint:i,sendButtonLabel:a,stopButtonLabel:o,contextWindow:s,onSend:c,onStop:l}){let{Tooltip:u,TooltipContent:d,TooltipProvider:f,TooltipTrigger:p}=Qh;return(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s?(0,F.jsx)(pg,{contextWindow:s}):null,!e||!n?(0,F.jsx)(dg,{size:`icon`,className:`h-8 w-8 rounded-full`,"aria-label":a,onClick:()=>void c(),disabled:n,children:(0,F.jsx)(Ja,{className:`h-5 w-5`})}):t?(0,F.jsx)(dg,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":o,onClick:()=>void l(),disabled:r,children:(0,F.jsx)(fg,{})}):(0,F.jsx)(f,{children:(0,F.jsxs)(u,{children:[(0,F.jsx)(p,{asChild:!0,children:(0,F.jsx)(`span`,{children:(0,F.jsx)(dg,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":o,disabled:!0,children:(0,F.jsx)(fg,{})})})}),(0,F.jsx)(d,{side:`top`,children:(0,F.jsx)(`p`,{className:`text-xs`,children:i})})]})})]})}function hg(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[e.label,e.key,e.description].filter(e=>typeof e==`string`&&e.trim().length>0).join(` `).toLowerCase().includes(n)):e}var gg=kh(`24rem`);function _g(e){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i}=Qh,{picker:a}=e,o=(0,P.useRef)(null),s=(0,P.useId)(),[c,l]=(0,P.useState)(``),[u,d]=(0,P.useState)(0),f=(0,P.useMemo)(()=>new Set(a.selectedKeys),[a.selectedKeys]),p=a.selectedKeys.length,m=c.trim().length>0,h=(0,P.useMemo)(()=>{if(m)return null;let e=a.groups?.filter(e=>e.options.length>0)??[];return e.length>0?e:null},[m,a.groups]),g=(0,P.useMemo)(()=>h?h.flatMap(e=>e.options):hg(a.options,c),[h,a.options,c]);(0,P.useEffect)(()=>{d(0)},[c]),(0,P.useEffect)(()=>{d(e=>g.length===0?0:Math.min(e,g.length-1))},[g.length]),Th({containerRef:o,activeIndex:u,itemCount:g.length,isEnabled:g.length>0,getItemSelector:e=>`[data-skill-index="${e}"]`});let _=e=>{if(f.has(e)){a.onSelectedKeysChange(a.selectedKeys.filter(t=>t!==e));return}a.onSelectedKeysChange([...a.selectedKeys,e])},v=e=>{if(g.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),d(e=>Math.min(e+1,g.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),d(e=>Math.max(e-1,0));return}if(e.key===`Enter`){e.preventDefault();let t=g[u];t&&_(t.key)}}};return(0,F.jsxs)(n,{children:[(0,F.jsx)(i,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-label":a.title,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg px-0 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground sm:w-auto sm:gap-1.5 sm:px-3`,children:[(0,F.jsx)(Za,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{className:`nextclaw-chat-skill-picker-label hidden sm:inline [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:a.title}),p>0?(0,F.jsx)(`span`,{className:`absolute -right-1 -top-1 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-semibold leading-none text-white shadow-sm sm:static sm:ml-0.5 sm:bg-primary/10 sm:text-primary sm:shadow-none`,children:p}):null]})}),(0,F.jsxs)(r,{side:`top`,align:`start`,className:`flex w-[min(360px,calc(100vw-1rem))] flex-col overflow-hidden p-0`,style:{maxHeight:gg},children:[(0,F.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-border px-4 py-3`,children:[(0,F.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:a.title}),(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(st,{className:`pointer-events-none absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground/70`}),(0,F.jsx)(t,{value:c,onChange:e=>l(e.target.value),onKeyDown:v,placeholder:a.searchPlaceholder,role:`combobox`,"aria-controls":s,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-activedescendant":g[u]?`${s}-option-${u}`:void 0,className:`h-8 rounded-lg pl-8 text-xs`})]})]}),(0,F.jsx)(`div`,{ref:o,id:s,role:`listbox`,"aria-multiselectable":`true`,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:a.isLoading?(0,F.jsx)(`div`,{className:`p-4 text-xs text-muted-foreground`,children:a.loadingLabel}):g.length===0?(0,F.jsx)(`div`,{className:`p-4 text-center text-xs text-muted-foreground`,children:a.emptyLabel}):(0,F.jsx)(`div`,{className:`py-1`,children:(()=>{let e=h??[{key:`all-skills`,options:g}],t=0;return e.map(e=>(0,F.jsxs)(`div`,{children:[e.label?(0,F.jsx)(`div`,{className:`px-4 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e.label}):null,e.options.map(e=>{let n=t;t+=1;let r=f.has(e.key),i=n===u;return(0,F.jsxs)(`div`,{id:`${s}-option-${n}`,role:`option`,"aria-selected":r,"data-skill-index":n,onMouseEnter:()=>d(n),className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${i?`bg-accent`:`hover:bg-accent`}`,children:[(0,F.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,F.jsx)(Yo,{className:`h-4 w-4`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1 select-text`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`truncate text-sm text-foreground`,children:e.label}),e.badgeLabel?(0,F.jsx)(`span`,{className:`shrink-0 rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary`,children:e.badgeLabel}):null]}),(0,F.jsx)(`div`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description||e.key})]}),(0,F.jsx)(`div`,{className:`ml-3 shrink-0`,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":`${r?`Remove`:`Add`} ${e.label}`,onClick:()=>_(e.key),className:r?`inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-white`:`inline-flex h-5 w-5 items-center justify-center rounded-full border border-border bg-card`,children:r?(0,F.jsx)(qt,{className:`h-3 w-3`}):null})})]},e.key)})]},e.key))})()})}),a.manageHref&&a.manageLabel?(0,F.jsx)(`div`,{className:`shrink-0 border-t border-border px-4 py-2.5`,children:(0,F.jsxs)(`a`,{href:a.manageHref,className:`inline-flex items-center gap-1.5 text-xs font-medium text-primary transition-colors hover:text-primary/80`,children:[a.manageLabel,(0,F.jsx)(nn,{className:`h-3 w-3`})]})}):null]})]})}function vg({icon:e}){return e===`sparkles`?(0,F.jsx)(bn,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):e===`brain`?(0,F.jsx)(Qa,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):null}function yg({icon:e}){return e===`paperclip`?(0,F.jsx)(Ko,{className:`h-4 w-4`}):(0,F.jsx)(vg,{icon:e})}var bg={model:`min-w-0 max-w-[18rem]`,"session-type":`shrink-0`,thinking:`shrink-0`},xg={model:`w-[min(18rem,calc(100vw-1rem))] sm:w-[320px]`,"session-type":`w-[220px]`,thinking:`w-[180px]`},Sg=kh(`18rem`),Cg=zh(`18rem`);function wg(e){return e.key===`model`&&e.selectedLabel&&e.selectedLabel.split(`/`).slice(1).join(`/`).trim()||e.selectedLabel}function Tg(e){return e.groups?.filter(e=>e.options.length>0)??(e.options.length>0?[{key:`${e.key}-default`,options:e.options}]:[])}function Eg({item:e}){let t=wg(e);return e.selectedLabel?(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,F.jsx)(vg,{icon:e.icon}),(0,F.jsx)(`span`,{className:`nextclaw-chat-toolbar-mobile-label truncate sm:hidden [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:t}),(0,F.jsx)(`span`,{className:`nextclaw-chat-toolbar-label hidden truncate sm:inline [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:e.selectedLabel})]}):e.loading?(0,F.jsx)(`div`,{className:`h-3 w-24 animate-pulse rounded bg-muted`}):(0,F.jsx)(`span`,{className:`truncate`,children:e.placeholder})}function Dg({option:e}){return e.description?(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,F.jsx)(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:e.label}),(0,F.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:e.description})]}):(0,F.jsx)(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:e.label})}function Og({item:e}){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i,Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=Qh,[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(``),p=Tg(e),m=(0,P.useMemo)(()=>{let e=d.trim().toLowerCase();return e?p.map(t=>({...t,options:t.options.filter(t=>[t.label,t.value,t.description].filter(e=>!!e).some(t=>t.toLowerCase().includes(e)))})).filter(e=>e.options.length>0):p},[p,d]),h=p.some(e=>e.options.length>0),g=m.some(e=>e.options.length>0),_=e.optionAction,v=new Set(_?.activeValues??[]);return(0,F.jsxs)(n,{open:l,onOpenChange:u,children:[(0,F.jsx)(i,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,disabled:e.disabled,className:`nextclaw-chat-toolbar-select-trigger inline-flex h-8 w-auto items-center justify-between rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${bg[e.key]??``}`,children:[(0,F.jsx)(Eg,{item:e}),(0,F.jsx)(Et,{className:`ml-1 h-3.5 w-3.5 shrink-0 text-muted-foreground/70 [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`})]})}),(0,F.jsxs)(r,{className:`flex flex-col overflow-hidden p-1.5 ${xg[e.key]??``}`,style:{maxHeight:Sg},children:[(0,F.jsxs)(`div`,{className:`relative mb-1.5 shrink-0`,children:[(0,F.jsx)(st,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,F.jsx)(t,{value:d,onChange:e=>f(e.currentTarget.value),placeholder:e.search?.placeholder??e.placeholder,className:`h-7 rounded-md pl-8 text-xs`})]}),h?null:e.loading?(0,F.jsxs)(`div`,{className:`space-y-2 px-2 py-1`,children:[(0,F.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,F.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,F.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,F.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.emptyLabel}):null,h&&!g?(0,F.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.search?.emptyLabel??e.emptyLabel}):null,(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:m.map((t,n)=>(0,F.jsxs)(`div`,{className:n>0?`border-t border-border pt-0.5`:void 0,children:[t.label?(0,F.jsx)(`div`,{className:`px-2 pb-0.5 pt-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:t.label}):null,t.options.map(t=>{let n=e.value===t.value,r=v.has(t.value),i=r?_?.activeLabel:_?.inactiveLabel;return(0,F.jsxs)(`div`,{className:`group flex items-center gap-1 rounded-md hover:bg-accent`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-left leading-4`,onClick:()=>{e.onValueChange(t.value),u(!1),f(``)},children:[(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(Dg,{option:t})}),n?(0,F.jsx)(qt,{className:`h-4 w-4 shrink-0 text-primary`}):null]}),_&&i?(0,F.jsx)(s,{children:(0,F.jsxs)(a,{children:[(0,F.jsx)(c,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":r,className:`mr-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-card hover:text-foreground focus:outline-none focus:ring-1 focus:ring-primary/40`,onClick:e=>{e.stopPropagation(),_.onToggle(t.value,!r)},children:(0,F.jsx)(os,{className:`h-3.5 w-3.5 ${r?`fill-current text-foreground`:``}`})})}),(0,F.jsx)(o,{side:`left`,children:(0,F.jsx)(`p`,{className:`text-xs`,children:i})})]})}):null]},t.value)})]},t.key))})]})]})}function kg({item:e}){if(e.search)return(0,F.jsx)(Og,{item:e});let{Select:t,SelectContent:n,SelectGroup:r,SelectItem:i,SelectLabel:a,SelectSeparator:o,SelectTrigger:s,SelectValue:c}=Qh,l=Tg(e),u=l.some(e=>e.options.length>0);return(0,F.jsxs)(t,{value:e.value,onValueChange:e.onValueChange,disabled:e.disabled,children:[(0,F.jsx)(s,{"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,title:e.selectedLabel,className:`nextclaw-chat-toolbar-select-trigger h-8 w-auto rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground focus:ring-0 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${bg[e.key]??``}`,children:e.selectedLabel||e.loading?(0,F.jsx)(Eg,{item:e}):(0,F.jsx)(c,{placeholder:e.placeholder})}),(0,F.jsxs)(n,{className:xg[e.key]??``,style:{maxHeight:Cg},children:[u?null:e.loading?(0,F.jsxs)(`div`,{className:`space-y-2 px-3 py-2`,children:[(0,F.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,F.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,F.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,F.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:e.emptyLabel}):null,l.map((e,t)=>(0,F.jsxs)(`div`,{children:[t>0?(0,F.jsx)(o,{}):null,(0,F.jsxs)(r,{children:[e.label?(0,F.jsx)(a,{children:e.label}):null,e.options.map(e=>(0,F.jsx)(i,{value:e.value,className:`py-1.5`,children:(0,F.jsx)(Dg,{option:e})},e.value))]})]},e.key))]})]})}function Ag({actions:e,accessories:t,selects:n,skillPicker:r,trailingSelects:i=[]}){let{Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=Qh;return(0,F.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2 px-3 pb-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-[12rem] flex-1 flex-wrap items-center gap-1 overflow-hidden`,children:[r?(0,F.jsx)(_g,{picker:r}):null,n.map(e=>(0,F.jsx)(kg,{item:e},e.key)),t?.map(e=>{let t=(0,F.jsxs)(`button`,{type:`button`,className:`inline-flex items-center rounded-lg py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:text-muted-foreground/50 ${e.iconOnly?`h-8 w-8 justify-center px-0`:`gap-1.5 px-3`}`,onClick:e.onClick,disabled:e.disabled,"aria-label":e.label,children:[(0,F.jsx)(yg,{icon:e.icon}),e.iconOnly?null:(0,F.jsx)(`span`,{children:e.label})]});return e.tooltip?(0,F.jsx)(s,{children:(0,F.jsxs)(a,{children:[(0,F.jsx)(c,{asChild:!0,children:e.disabled?(0,F.jsx)(`span`,{className:`inline-flex`,children:t}):t}),(0,F.jsx)(o,{side:`top`,children:(0,F.jsx)(`p`,{className:`text-xs`,children:e.tooltip})})]})},e.key):(0,F.jsx)(`div`,{children:t},e.key)})]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 items-end gap-1`,children:[i.length>0?(0,F.jsx)(`div`,{className:`nextclaw-chat-toolbar-trailing-selects flex min-w-0 items-center gap-1`,children:i.map(e=>(0,F.jsx)(kg,{item:e},e.key))}):null,(0,F.jsx)(mg,{...e})]})]})}var jg=(0,P.createContext)(null);function Mg(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function Ng(){let e=(0,P.useContext)(jg);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function z(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Pg(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Fg=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ig=Fg&&`documentMode`in document?document.documentMode:null,Lg=Fg&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Rg=Fg&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),zg=!(!Fg||!(`InputEvent`in window)||Ig)&&`getTargetRanges`in new window.InputEvent(`input`),Bg=Fg&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Vg=Fg&&/Android/.test(navigator.userAgent),Hg=Fg&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Vg,Ug=Fg&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Wg=Fg&&Vg&&Ug,Gg=Fg&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Lg&&!Ug,Kg=0,qg=1,Jg=2,Yg=1,Xg=2,Zg=3,Qg=4,$g=5,e_=6,t_=Hg||Bg||Gg?`\xA0`:`​`,n_=`
5
+
6
+ `,r_=Rg?`\xA0`:t_,i_={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},a_={directionless:1,unmergeable:2},o_={center:2,end:6,justify:4,left:1,right:3,start:5},s_={[Xg]:`center`,[e_]:`end`,[Qg]:`justify`,[Yg]:`left`,[Zg]:`right`,[$g]:`start`},c_={normal:0,segmented:2,token:1},l_={[Kg]:`normal`,[Jg]:`segmented`,[qg]:`token`},u_=`$config`;function d_(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(W(o)&&d_(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var f_=!1,p_=0;function m_(e){p_=e.timeStamp}function h_(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&pS(e,n)!==void 0}function g_(e,t,n){let r=tC(qS(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&ES(t,o,i,a,!1)}function __(e,t,n){if(H(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return nS(t)&&n.isAttached()}function v_(e,t,n,r){for(let i=e;i&&!gC(i);i=VS(i)){let e=pS(i,t);if(e!==void 0){let t=dS(e,n);if(t)return Cx(t)||!rC(i)?void 0:[i,t]}else if(i===r)return[r,vS(n)]}}function y_(e,t,n){f_=!0;let r=performance.now()-p_>100;try{_x(e,()=>{let i=U()||function(e){return e.getEditorState().read(()=>{let e=U();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=v_(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&V(g)&&nS(p)&&__(i,p,g)&&g_(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=fS(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!h_(r,a,e)){if(Rg){let e=(rC(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(h_(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||h_(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&yS(i),Rg&&zS(e)&&i.insertRawText(u))})}finally{f_=!1}}function b_(e){let t=e._observer;t!==null&&y_(e,t.takeRecords(),t)}function x_(e){(function(e){p_===0&&qS(e).addEventListener(`textInput`,m_,!0)})(e),e._observer=new MutationObserver((t,n)=>{y_(e,t,n)})}var S_=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||k_).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function C_(e,t){return new S_(e,t)}function w_(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=vC(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var T_=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState;this.size=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return O_(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=O_(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function E_(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new T_(t,D_(t));return t.__state=n,n}function D_(e){return e.__state?e.__state.sharedNodeState:Gx(lC(),e.getType()).sharedNodeState}function O_(e){if(e)for(let t in e)return e}function k_(e){return e}function A_(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function j_(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function M_(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function N_(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&A_(n,e,t)||t&&A_(n,t,e)||e&&j_(n,e,t)||t&&j_(n,t,e))}(c,l))}function P_(e,t){let n=e.mergeWithSibling(t),r=ix()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function F_(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&V(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(N_(t,r)){r=P_(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&V(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(N_(r,n)){r=P_(r,n);break}break}n.remove()}}else r.remove()}function I_(e){return L_(e.anchor),L_(e.focus),e}function L_(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),V(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!W(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_=``,Y_=null,X_=null,Z_=!1,Q_=!1;function $_(e,t){let n=W_.get(e);if(t!==null){let n=_v(e);n.parentNode===t&&t.removeChild(n)}if(G_.has(e)||z_._keyToDOMMap.delete(e),W(n)){let e=dv(n,W_);ev(e,0,e.length-1,null)}n!==void 0&&IS(q_,B_,V_,n,`destroyed`)}function ev(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&$_(t,r)}}function tv(e,t){e.setProperty(`text-align`,t)}var nv=`40px`;function rv(e,t){let n=R_.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(z_._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||nv;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function iv(e,t){let n=e.style;t===0?tv(n,``):t===1?tv(n,`left`):t===2?tv(n,`center`):t===3?tv(n,`right`):t===4?tv(n,`justify`):t===5?tv(n,`start`):t===6&&tv(n,`end`)}function av(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(Tx(e))return null;let n=e.getParentOrThrow();return Tx(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function ov(e,t){let n=G_.get(e);n===void 0&&z(60);let r=n.createDOM(R_,z_);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,z_),V(n)?r.setAttribute(`data-lexical-text`,`true`):Cx(n)&&r.setAttribute(`data-lexical-decorator`,`true`),W(n)){let e=n.__indent,t=n.__size;if(av(r,n),e!==0&&rv(r,e),t!==0){let e=t-1;sv(dv(n,G_),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&iv(r,i),n.isInline()||lv(null,n,r)}else{let t=n.getTextContent();if(Cx(n)){let t=n.decorate(z_,R_);t!==null&&pv(e,t),r.contentEditable=`false`}J_+=t}return t!==null&&t.insertChild(r),IS(q_,B_,V_,n,`created`),r}function sv(e,t,n,r,i){let a=J_;J_=``;let o=n;for(;o<=r;++o){ov(e[o],i);let t=G_.get(e[o]);t!==null&&V(t)?Y_===null&&(Y_=t.getFormat(),X_=t.getStyle()):W(t)&&o<r&&!t.isInline()&&(J_+=n_)}i.element.__lexicalTextContent=J_,J_=a+J_}function cv(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return Yy(e)?`line-break`:Cx(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function lv(e,t,n){let r=cv(e,W_),i=cv(t,G_);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function uv(e,t,n){var r;Y_=null,X_=null,function(e,t,n){let r=J_,i=e.__size,a=t.__size;J_=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)fv(n,o);else{let e=_v(n),t=ov(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}$_(n,null)}let i=G_.get(r);V(i)&&Y_===null&&(Y_=i.getFormat(),X_=i.getStyle())}else{let r=dv(e,W_),s=dv(t,G_);if(r.length!==i&&z(227),s.length!==a&&z(228),i===0)a!==0&&sv(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;ev(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=mv(fv(r,a.element)),d++,f++;else{if(l===void 0&&(l=hv(n,f)),c===void 0)c=hv(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=mv(_v(e)),$_(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=BS(z_,r);e!==u&&a.withBefore(u).insertChild(e),u=mv(fv(r,a.element)),d++,f++}else ov(r,a.withBefore(u)),f++}let i=G_.get(r);i!==null&&V(i)?Y_===null&&(Y_=i.getFormat(),X_=i.getStyle()):W(i)&&f<=s&&!i.isInline()&&(J_+=n_)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:z_.getElementByKey(e);sv(n,0,f,s,a.withBefore(t))}else m&&!p&&ev(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=J_,J_=r+J_}(e,t,t.getDOMSlot(n)),r=t,Y_==null||Y_===r.__textFormat||Q_||r.setTextFormat(Y_),function(e){X_==null||X_===e.__textStyle||Q_||e.setTextStyle(X_)}(t)}function dv(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&z(101),n.push(r),r=e.__next}return n}function fv(e,t){let n=W_.get(e),r=G_.get(e);n!==void 0&&r!==void 0||z(61);let i=Z_||U_.has(e)||H_.has(e),a=BS(z_,e);if(n===r&&!i){let e;if(W(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return J_+=e,a}if(n!==r&&i&&IS(q_,B_,V_,r,`updated`),r.updateDOM(n,a,R_)){let n=ov(e,null);return t===null&&z(62),t.replaceChild(n,a),$_(e,null),n}if(W(n)){W(r)||z(334,e);let t=r.__indent;(Z_||t!==n.__indent)&&rv(a,t);let o=r.__format;if((Z_||o!==n.__format)&&iv(a,o),i)uv(n,r,a),Tx(r)||r.isInline()||lv(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),J_+=t}if((Z_||r.__dir!==n.__dir)&&(av(a,r),Tx(r)&&!Z_))for(let e of r.getChildren())W(e)&&av(BS(z_,e.getKey()),e)}else{let t=r.getTextContent();if(Cx(r)){let t=r.decorate(z_,R_);t!==null&&pv(e,t)}J_+=t}if(!Q_&&Tx(r)&&r.__cachedText!==J_){let e=r.getWritable();e.__cachedText=J_,r=e}return a}function pv(e,t){let n=z_._pendingDecorators,r=z_._decorators;if(n===null){if(r[e]===t)return;n=hS(z_)}n[e]=t}function mv(e){let t=e.nextSibling;return t!==null&&t===z_._blockCursorElement&&(t=t.nextSibling),t}function hv(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function gv(e,t,n,r,i,a){J_=``,Z_=r===2,z_=n,R_=n._config,B_=n._nodes,V_=z_._listeners.mutation,H_=i,U_=a,W_=e._nodeMap,G_=t._nodeMap,Q_=t._readOnly,K_=new Map(n._keyToDOMMap);let o=new Map;return q_=o,fv(`root`,null),z_=void 0,B_=void 0,H_=void 0,U_=void 0,W_=void 0,G_=void 0,R_=void 0,K_=void 0,q_=void 0,o}function _v(e){let t=K_.get(e);return t===void 0&&z(75,e),t}function B(e){return{type:e}}var vv=B(`SELECTION_CHANGE_COMMAND`),yv=B(`CLICK_COMMAND`),bv=B(`BEFORE_INPUT_COMMAND`),xv=B(`INPUT_COMMAND`),Sv=B(`COMPOSITION_START_COMMAND`),Cv=B(`COMPOSITION_END_COMMAND`),wv=B(`DELETE_CHARACTER_COMMAND`),Tv=B(`INSERT_LINE_BREAK_COMMAND`),Ev=B(`INSERT_PARAGRAPH_COMMAND`),Dv=B(`CONTROLLED_TEXT_INSERTION_COMMAND`),Ov=B(`PASTE_COMMAND`),kv=B(`REMOVE_TEXT_COMMAND`),Av=B(`DELETE_WORD_COMMAND`),jv=B(`DELETE_LINE_COMMAND`),Mv=B(`FORMAT_TEXT_COMMAND`),Nv=B(`UNDO_COMMAND`),Pv=B(`REDO_COMMAND`),Fv=B(`KEYDOWN_COMMAND`),Iv=B(`KEY_ARROW_RIGHT_COMMAND`),Lv=B(`MOVE_TO_END`),Rv=B(`KEY_ARROW_LEFT_COMMAND`),zv=B(`MOVE_TO_START`),Bv=B(`KEY_ARROW_UP_COMMAND`),Vv=B(`KEY_ARROW_DOWN_COMMAND`),Hv=B(`KEY_ENTER_COMMAND`),Uv=B(`KEY_SPACE_COMMAND`),Wv=B(`KEY_BACKSPACE_COMMAND`),Gv=B(`KEY_ESCAPE_COMMAND`),Kv=B(`KEY_DELETE_COMMAND`),qv=B(`KEY_TAB_COMMAND`),Jv=B(`DROP_COMMAND`),Yv=B(`DRAGSTART_COMMAND`),Xv=B(`DRAGOVER_COMMAND`),Zv=B(`DRAGEND_COMMAND`),Qv=B(`COPY_COMMAND`),$v=B(`CUT_COMMAND`),ey=B(`SELECT_ALL_COMMAND`),ty=B(`FOCUS_COMMAND`),ny=B(`BLUR_COMMAND`),ry=B(`KEY_MODIFIER_COMMAND`),iy=Object.freeze({}),ay=[[`keydown`,function(e,t){oy=e.timeStamp,sy=e.key,!t.isComposing()&&K(t,Fv,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;iC(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&_x(t,()=>{Jx(n)||(py=!0)})}],[`compositionstart`,function(e,t){K(t,Sv,e)}],[`compositionend`,function(e,t){Rg?hy=!0:Bg||!Hg&&!Gg?K(t,Cv,e):(gy=!0,_y=e.data)}],[`input`,function(e,t){e.stopPropagation(),_x(t,()=>{t.dispatchCommand(xv,e)},{event:e}),ly=null}],[`click`,function(e,t){_x(t,()=>{let n=U(),r=tC(qS(t)),i=Lb();if(r){if(H(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!Tx(a)&&_S().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=bC(a,e=>W(e)&&!e.isInline());W(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(rC(n)||nS(n))&&yS(Ib(i,r,t,e))}}K(t,yv,e)})}],[`cut`,iy],[`copy`,iy],[`dragstart`,iy],[`dragover`,iy],[`dragend`,iy],[`paste`,iy],[`focus`,iy],[`blur`,iy],[`drop`,iy]];zg&&ay.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||Rg&&zS(t)||n!==`insertCompositionText`&&K(t,bv,e)}(e,t)]);var oy=0,sy=null,cy=0,ly=null,uy=new WeakMap,dy=new WeakMap,fy=!1,py=!1,my=!1,hy=!1,gy=!1,_y=``,vy=null,yy=[0,``,0,`root`,0];function by(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=ix(),l=tC(qS(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!V(s)||(!i&&(!zg||cy<r+50)||s.isDirty()&&p<2||xS(n))&&a.offset!==o.offset&&!s.isComposing()||tS(s)||s.isDirty()&&p>1||(i||!zg)&&f!==null&&!s.isComposing()&&u!==iS(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=eS(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(V(t)||W(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function xy(e,t){return nS(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Sy(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;fy&&(fy=!1,xy(r,i)&&xy(a,o)&&!vy)||_x(t,()=>{if(!n)return void yS(null);if(!Xx(t,r,a))return;let s=U();if(vy&&H(s)&&s.isCollapsed()){let e=s.anchor,t=vy.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=vy.clone(),yS(s))}if(vy=null,H(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=qS(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=yy,f=_S(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)Cy(s,o,c);else if(n.type===`text`)V(r)||z(141),wy(s,r);else if(n.type===`element`&&!p){W(r)||z(259);let e=n.getNode();e.isEmpty()?function(e,t){Cy(e,t.getTextFormat(),t.getTextStyle())}(s,e):Cy(s,s.format,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(V(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}K(t,vv,void 0)})}function Cy(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function wy(e,t){Cy(e,t.getFormat(),t.getStyle())}function Ty(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function Ey(e){let t=e.inputType,n=Ty(e),r=ix(),i=U();if(t===`deleteContentBackward`){if(i===null){let e=Lb();if(!H(e))return!0;yS(e.clone())}if(H(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,sy===`MediaLast`&&a<oy+30&&r.isComposing()&&t){if(lS(null),oy=0,setTimeout(()=>{_x(r,()=>{lS(null)})},30),H(i)){let e=i.anchor.getNode();e.markDirty(),V(e)||z(142),wy(i,e)}}else{lS(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=Wg&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!Cx(RS(i.anchor,!0))),!c){K(r,wv,!0);let e=U();Wg&&H(e)&&e.isCollapsed()&&(vy=e,setTimeout(()=>vy=null))}}return!0}}var a;if(!H(i))return!0;let o=e.data;ly!==null&&TS(!1,r,ly),i.dirty&&ly===null||!i.isCollapsed()||Tx(i.anchor.getNode())||n===null||i.applyDOMRange(n),ly=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
7
+ `)e.preventDefault(),K(r,Tv,!1);else if(o===n_)e.preventDefault(),K(r,Ev,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&by(i,n,o,e.timeStamp,!0)?(e.preventDefault(),K(r,Dv,o)):ly=o;return cy=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:K(r,Dv,e);break;case`insertFromComposition`:lS(null),K(r,Dv,e);break;case`insertLineBreak`:lS(null),K(r,Tv,!1);break;case`insertParagraph`:lS(null),my&&!Bg?(my=!1,K(r,Tv,!1)):K(r,Ev,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:K(r,Ov,e);break;case`deleteByComposition`:(function(e,t){return e!==t||W(e)||W(t)||!eS(e)||!eS(t)})(l,u)&&K(r,kv,e);break;case`deleteByDrag`:case`deleteByCut`:K(r,kv,e);break;case`deleteContent`:K(r,wv,!1);break;case`deleteWordBackward`:K(r,Av,!0);break;case`deleteWordForward`:K(r,Av,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:K(r,jv,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:K(r,jv,!1);break;case`formatStrikeThrough`:K(r,Mv,`strikethrough`);break;case`formatBold`:K(r,Mv,`bold`);break;case`formatItalic`:K(r,Mv,`italic`);break;case`formatUnderline`:K(r,Mv,`underline`);break;case`historyUndo`:K(r,Nv,void 0);break;case`historyRedo`:K(r,Pv,void 0)}return!0}function Dy(e){if(rC(e.target)&&Jx(e.target))return!0;let t=ix(),n=U(),r=e.data,i=Ty(e);if(r!=null&&H(n)&&by(n,i,r,e.timeStamp,!1)){hy&&=(Ay(t,r),!1);let i=n.anchor.getNode(),a=tC(qS(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;zg&&!n.isCollapsed()&&V(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===wS(a.anchorNode)||K(t,Dv,r);let l=r.length;Rg&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),Wg&&t.isComposing()&&(oy=0,lS(null))}else TS(!1,t,r===null?void 0:r),hy&&=(Ay(t,r||void 0),!1);return function(){tx(),b_(ix())}(),!0}function Oy(e){let t=ix(),n=U();if(H(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();lS(r.key),US(Wy),(e.timeStamp<oy+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||V(i)&&i.getStyle()!==n.style)&&K(t,Dv,r_)}return!0}function ky(e){return Ay(ix(),e.data),US(Gy),!0}function Ay(e,t){let n=e._compositionKey;if(lS(null),n!==null&&t!=null){if(t===``){let t=dS(n),r=iS(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&V(t)){let n=tC(qS(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),ES(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
8
+ `){let t=U();if(H(t)||Cb(t)){if(H(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}K(e,Hv,null);return}}}TS(!0,e,t)}function jy(e){let t=ix();if(e.key==null)return!0;if(gy){if(MS(e))return _x(t,()=>{Ay(t,_y)}),gy=!1,_y=``,!0;gy=!1,_y=``}if(function(e){return G(e,`ArrowRight`,{shiftKey:`any`})}(e))K(t,Iv,e);else if(function(e){return G(e,`ArrowRight`,AS)}(e))K(t,Lv,e);else if(function(e){return G(e,`ArrowLeft`,{shiftKey:`any`})}(e))K(t,Rv,e);else if(function(e){return G(e,`ArrowLeft`,AS)}(e))K(t,zv,e);else if(function(e){return G(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))K(t,Bv,e);else if(function(e){return G(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))K(t,Vv,e);else if(function(e){return G(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))my=!0,K(t,Hv,e);else if(function(e){return e.key===` `}(e))K(t,Uv,e);else if(function(e){return Lg&&G(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),my=!0,K(t,Tv,!0);else if(function(e){return G(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))my=!1,K(t,Hv,e);else if(function(e){return G(e,`Backspace`,{shiftKey:`any`})||Lg&&G(e,`h`,{ctrlKey:!0})}(e))MS(e)?K(t,Wv,e):(e.preventDefault(),K(t,wv,!0));else if(function(e){return e.key===`Escape`}(e))K(t,Gv,e);else if(function(e){return G(e,`Delete`,{})||Lg&&G(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?K(t,Kv,e):(e.preventDefault(),K(t,wv,!1));else if(function(e){return G(e,`Backspace`,jS)}(e))e.preventDefault(),K(t,Av,!0);else if(function(e){return G(e,`Delete`,jS)}(e))e.preventDefault(),K(t,Av,!1);else if(function(e){return Lg&&G(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),K(t,jv,!0);else if(function(e){return Lg&&(G(e,`Delete`,{metaKey:!0})||G(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),K(t,jv,!1);else if(function(e){return G(e,`b`,AS)}(e))e.preventDefault(),K(t,Mv,`bold`);else if(function(e){return G(e,`u`,AS)}(e))e.preventDefault(),K(t,Mv,`underline`);else if(function(e){return G(e,`i`,AS)}(e))e.preventDefault(),K(t,Mv,`italic`);else if(function(e){return G(e,`Tab`,{shiftKey:`any`})}(e))K(t,qv,e);else if(function(e){return G(e,`z`,AS)}(e))e.preventDefault(),K(t,Nv,void 0);else if(function(e){return Lg?G(e,`z`,{metaKey:!0,shiftKey:!0}):G(e,`y`,{ctrlKey:!0})||G(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),K(t,Pv,void 0);else{let n=t._editorState._selection;n===null||H(n)?NS(e)&&(e.preventDefault(),K(t,ey,e)):function(e){return G(e,`c`,AS)}(e)?(e.preventDefault(),K(t,Qv,e)):function(e){return G(e,`x`,AS)}(e)?(e.preventDefault(),K(t,$v,e)):NS(e)&&(e.preventDefault(),K(t,ey,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(ry,e),!0}function My(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Ny=new Map;function Py(e){let t=nC(e.target);if(t===null)return;let n=Qx(t.anchorNode);if(n===null)return;py&&(py=!1,_x(n,()=>{let r=Lb(),i=t.anchorNode;(rC(i)||nS(i))&&yS(Ib(r,t,n,e))}));let r=SS(n),i=r[r.length-1],a=i._key,o=Ny.get(a),s=o||i;s!==n&&Sy(t,s,!1),Sy(t,n,!0),n===i?o&&Ny.delete(a):Ny.set(a,n)}function Fy(e){e._lexicalHandled=!0}function Iy(e){return!0===e._lexicalHandled}function Ly(e){let t=uy.get(e);if(t===void 0)return;let n=dy.get(t);if(n===void 0)return;let r=n-1;r>=0||z(164),uy.delete(e),dy.set(t,r),r===0&&t.removeEventListener(`selectionchange`,Py);let i=$x(e);Zx(i)?(function(e){if(e._parentEditor!==null){let t=SS(e),n=t[t.length-1]._key;Ny.get(n)===e&&Ny.delete(n)}else Ny.delete(e._key)}(i),e.__lexicalEditor=null):i&&z(198);let a=My(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function Ry(e,t,n){tx();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=U();if(!H(t)||!W(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return GS(i,e)&&n.set(e.__key,0,`element`),GS(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(H(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Bb(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Bb(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Cb(a)&&t&&e.isSelected()&&e.selectPrevious();if(H(a)&&t&&!o){let t=e.getIndexWithinParent();sS(e),Rb(a,i,t,-1)}else sS(e);n||YS(i)||i.canBeEmpty()||!i.isEmpty()||Ry(i,t),t&&a&&Tx(i)&&i.isEmpty()&&i.selectEnd()}var zy=Symbol.for(`ephemeral`);function By(e){return e[zy]||!1}var Vy=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=vC(this);return e===void 0&&z(64,this.name),e}static clone(e){z(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,`__state`,{configurable:!0,enumerable:!1,value:void 0,writable:!0}),oS(this,e)}getType(){return this.__type}isInline(){z(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=dS(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||U();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(V(this))return n;if(H(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Cx(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:dS(e)}getParentOrThrow(){let e=this.getParent();return e===null&&z(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(YS(t))return W(e)||e===this&&Cx(e)||z(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&z(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:dS(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:dS(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=W(this)?this:this.getParent(),n=W(e)?e:e.getParent(),r=t&&n?QC(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=QC(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?YC(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&z(279),!1)))}isParentOf(e){let t=QC(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=W(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&z(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=ix()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(By(this))return this;let e=dS(this.__key);return e===null&&z(113),e}getWritable(){if(By(this))return this;tx();let e=rx(),t=ix(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=U();if(o!==null&&o.setCachedNodes(null),a.has(r))return cS(i),i;let s=pC(i);return a.add(r),cS(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){z(70)}updateDOM(e,t,n){z(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){z(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of D_(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&E_(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Ry(this,!0,e)}replace(e,t){tx();let n=U();n!==null&&(n=n.clone()),ZS(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;sS(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(Ry(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(W(this)&&W(o)||z(139),this.getChildren().forEach(e=>{o.append(e)})),H(n)){yS(n);let e=n.anchor,t=n.focus;e.key===i&&bb(e,o),t.key===i&&bb(t,o)}return uS()===i&&lS(a),o}insertAfter(e,t=!0){tx(),ZS(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=U(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(sS(r),H(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&H(a)){let e=this.getIndexWithinParent();Rb(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){tx(),ZS(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;sS(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=U();return t&&H(l)&&Rb(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Px()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){tx();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(W(n))return n.select();if(!V(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){tx();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(W(n))return n.select(0,0);if(!V(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},Hy=`history-merge`,Uy=`skip-dom-selection`,Wy=`composition-start`,Gy=`composition-end`,Ky=class e extends Vy{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
9
+ `}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&sC(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Xy(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&Xy(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&sC(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Xy(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&Xy(r))return!0}return!1}(e)?null:{conversion:qy,priority:0}}}static importJSON(e){return Jy().updateFromJSON(e)}};function qy(e){return{node:Jy()}}function Jy(){return XS(new Ky)}function Yy(e){return e instanceof Ky}function Xy(e){return nS(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function Zy(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function Qy(e,t){return 1&t?`strong`:2&t?`em`:`span`}function $y(e,t,n,r,i){let a=r.classList,o=FS(i,`base`);o!==void 0&&a.add(...o),o=FS(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in i_){let r=i_[e];if(o=FS(i,e),o!==void 0)if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}function eb(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?t_:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a)if(i||Rg){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}function tb(e,t,n,r,i,a){eb(i,e,t);let o=a.theme.text;o!==void 0&&$y(0,0,r,e,o)}function nb(e,t){let n=document.createElement(t);return n.appendChild(e),n}var rb=class e extends Vy{__text;__format;__style;__mode;__detail;static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return l_[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===uS()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=i_[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return aS(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Zy(0,n),i=Qy(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),tb(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Zy(0,i),s=Zy(0,a),c=Qy(0,i),l=Qy(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??z(48);let i=document.createElement(l);return tb(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??z(49)),eb(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&$y(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:cb,priority:0}),b:()=>({conversion:ab,priority:0}),code:()=>({conversion:db,priority:0}),em:()=>({conversion:db,priority:0}),i:()=>({conversion:db,priority:0}),mark:()=>({conversion:db,priority:0}),s:()=>({conversion:db,priority:0}),span:()=>({conversion:ib,priority:0}),strong:()=>({conversion:db,priority:0}),sub:()=>({conversion:db,priority:0}),sup:()=>({conversion:db,priority:0}),u:()=>({conversion:db,priority:0})}}static importJSON(e){return fb().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return rC(t)||z(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=nb(t,`b`)),this.hasFormat(`italic`)&&(t=nb(t,`i`)),this.hasFormat(`strikethrough`)&&(t=nb(t,`s`)),this.hasFormat(`underline`)&&(t=nb(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?i_[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?a_[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=aS(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=c_[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){tx();let n=e,r=t,i=U(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!H(i))return Nb(o,n,o,r,`text`,`text`);{let e=uS();e!==i.anchor.key&&e!==i.focus.key||lS(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=U();if(r&&H(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){tx();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=uS(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=U();if(H(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=fb(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=M_(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=fb(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=M_(t,n);let a=n.__key;i===r&&lS(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&cS(t),n!==null&&cS(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),H(v)&&Rb(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||z(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;uS()===r&&lS(n);let o=U();if(H(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Vb(i,t,n,e,a),s!==null&&s.key===r&&Vb(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function ib(e){return{forChild:pb(e.style),node:null}}function ab(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:pb(t.style,n?void 0:`bold`),node:null}}var ob=new WeakMap;function sb(e){if(!rC(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function cb(e){let t=e;e.parentElement===null&&z(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=ob.get(n))===void 0&&!sb(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)ob.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
10
+ `||r===`\r
11
+ `?t.push(Jy()):r===` `?t.push(hb()):r!==``&&t.push(fb(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=lb(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=lb(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:fb(n)}}function lb(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,rC(n)){let e=n.style.display;if(e===``&&!oC(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(nS(n))return n;if(n.nodeName===`BR`)return null}}var ub={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function db(e){let t=ub[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:pb(e.style,t),node:null}}function fb(e=``){return XS(new rb(e))}function V(e){return e instanceof rb}function pb(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>V(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var mb=class e extends rb{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=FS(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return hb().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&Pg(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||z(286),this}setDetail(e){return e!==2&&z(127),this}setMode(e){return e!==`normal`&&z(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function hb(){return XS(new mb)}function gb(e){return e instanceof mb}var _b=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:JC(cw($C(this,`next`)),cw($C(e,`next`)))<0}getNode(){let e=dS(this.key);return e===null&&z(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,ex()||(uS()===a&&lS(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function vb(e,t,n){return new _b(e,t,n)}function yb(e,t){let n=t.__key,r=e.offset,i=`element`;if(V(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!W(t)){let e=t.getNextSibling();if(V(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function bb(e,t){if(W(t)){let n=t.getLastDescendant();W(n)||V(n)?yb(e,n):yb(e,t)}else yb(e,t)}var xb=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Cb(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(V(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=dS(e);t!==null&&n.push(t)}return ex()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((U()||Lb())===this&&e[0]){let t=FC(e[0],`next`);tw(KC(t,t))}for(let t of e)t.remove()}};function H(e){return e instanceof Sb}var Sb=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!H(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(jC(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;W(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),AC(e.focus)&&W(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=zC(e.focus.origin,`previous`);jC(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=VC(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!W(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=cw(e.anchor),r=cw(e.anchor.getFlipped()),i=e=>kC(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(dw(rw(this),`next`));return ex()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Tb(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(W(d)&&!d.isInline())l||(c+=`
12
+ `),l=!d.isEmpty();else if(l=!1,V(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else !Cx(d)&&!Yy(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=ix(),n=t.getEditorState()._selection,r=Mb(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),I_(this)}clone(){let t=this.anchor,n=this.focus;return new e(vb(t.key,t.offset,t.type),vb(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=aS(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=i_[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
13
+ `||r===`\r
14
+ `?n.push(Jy()):r===` `?n.push(hb()):n.push(fb(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=fb();if(o.setFormat(n),o.setStyle(r),Fx(a))a.splice(0,0,[o]);else{let e=Tx(i)?Px().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&ew(o,cw($C(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];V(d)||z(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(tS(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(V(t)&&t.canInsertTextBefore()&&!tS(t)||(t=fb(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(tS(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(V(t)&&!tS(t)||(t=fb(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=fb(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||W(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),jb(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(eS(d)){let t=fb(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(gb(d)){let t=fb(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=fb(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=W(d)?d:d.getParentOrThrow(),r=W(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c)if(V(m)&&!eS(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=fb(m.getTextContent());m.replace(e),m=e}Tx(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||W(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(eS(d))if(s===f)d.select();else{let t=fb(e);t.select(),d.replace(t)}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=U()===this;nw(this,sw(rw(this))),e&&U()!==this&&yS(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void lS(null);let n=this.getNodes(),r=[];for(let e of n)V(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(W(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},a=r.length;if(a===0)return this.toggleFormat(e),lS(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(tS(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||tS(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||tS(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=U();return H(t)||z(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=bC(t,cC),r=e[e.length-1];if(W(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=Gb(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some(e=>(W(e)||Cx(e))&&!e.isInline())){W(n)||z(211,t.constructor.name,t.getType());let i=Gb(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=Px(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=Yy(i);if(a||Cx(i)&&i.isInline()||W(i)&&i.isInline()||V(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!W(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;W(u=l)&&cC(u)&&!u.isEmpty()&&W(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(W(n)||z(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&z(212,t.constructor.name,t.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||z(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(n,l));let d=bC(a,cC);s&&W(d)&&(s.canMergeWhenEmpty()||cC(c))&&(d.append(...s.getChildren()),s.remove()),W(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=W(n)?n.getLastChild():null;Yy(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=Px();return _S().splice(this.anchor.offset,0,[e]),e.select(),e}let e=Gb(this),t=bC(this.anchor.getNode(),cC);W(t)||z(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=Jy();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=Tb(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(V(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(V(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),V(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(qb(this,e,t,n))return;let r=e===`move`,i=ix(),a=tC(qS(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!W(c)||c.isInline()||c.canBeEmpty()||eC(o,i,s),this.dirty){let e=BS(i,this.anchor.key),t=BS(i,this.focus.key);this.anchor.type===`text`&&(e=iS(e)),this.focus.type===`text`&&(t=iS(t)),e&&t&&Hb(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=Tx(n)?n:JS(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];GS(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){let e=r[0];W(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];W(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&qb(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&W(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(W(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=WC($C(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(jC(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(W(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=cw(t);nw(this,KC(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(AC(t)){if(W(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Cx(t.origin)){if(!t.origin.isIsolated())if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&W(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=Fb();e.add(t.origin.getKey()),yS(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return nw(this,KC(!t.origin.isEmpty()&&n.isEmpty()?iw(FC(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&Eb(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Ob(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Ob(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(xS(e)||Db(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&Tx(e.getParent())&&e.getPreviousSibling()===null&&Eb(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Cb(e){return e instanceof xb}function wb(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Tb(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[wb(n),wb(r)]}function Eb(e,t){for(let n=t;n;n=n.getParent()){if(W(n)){if(n.collapseAtStart(e))return!0;if(YS(n))break}if(n.getPreviousSibling())break}return!1}var Db=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Ob(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function kb(e,t,n,r){let i,a=t;if(rC(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=bS(u),V(i))a=LC(i,o?`next`:`previous`);else{let s=bS(e);if(s===null)return null;if(W(s)){let c=r.getElementByKey(s.getKey());c===null&&z(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),W(s)||z(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(W(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=W(u)?u:u.getParentOrThrow()),a=0}V(u)?(i=u,s=null,a=LC(u,o?`next`:`previous`)):u!==s&&o&&!d&&(W(s)||z(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&Cx(s)&&bS(e)===s?n:n+1,s=s.getParentOrThrow()}if(W(s))return vb(s.__key,a,`element`)}}else i=bS(e);return V(i)?vb(i.__key,LC(i,a,`clamp`),`text`):null}function Ab(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&W(a)&&a.isInline()){let t=a.getPreviousSibling();V(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else W(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):V(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&W(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&W(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();V(t)&&e.set(t.__key,0,`text`)}}}function jb(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Ab(e,n,r),Ab(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function Mb(e,t,n,r,i,a){if(e===null||n===null||!Xx(i,e,n))return null;let o=kb(e,t,H(a)?a.anchor:null,i);if(o===null)return null;let s=kb(n,r,H(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=bS(e),r=bS(n);if(Cx(t)&&Cx(r))return null}return jb(o,s),[o,s]}function Nb(e,t,n,r,i,a){let o=rx(),s=new Sb(vb(e,t,i),vb(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Pb(){return new Sb(vb(`root`,0,`element`),vb(`root`,0,`element`),0,``)}function Fb(){return new xb(new Set)}function Ib(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!f_&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(H(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,(s||o===void 0)&&H(e)&&!Xx(n,l,u))return e.clone();let p=Mb(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p,g=0,_=``;if(H(e)){let t=e.anchor;if(m.key===t.key)g=e.format,_=e.style;else{let e=m.getNode();V(e)?(g=e.getFormat(),_=e.getStyle()):W(e)&&(g=e.getTextFormat(),_=e.getTextStyle())}}return new Sb(m,h,g,_)}function U(){return rx()._selection}function Lb(){return ix()._editorState._selection}function Rb(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),zb(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}zb(e)}function zb(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!W(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(V(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if(W(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(V(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(W(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(V(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function Bb(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,V(i)?s=`text`:W(i)&&(s=`element`)):(a=r.__key,V(r)?(o=r.getTextContentSize(),s=`text`):W(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function Vb(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function Hb(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Ub(e,t,n){let r=BS(e,t.getKey());if(W(t)){let e=t.getDOMSlot(r);return[e.element,n+e.getFirstChildOffset()]}return[r,n]}function Wb(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&Yx(d))return;if(!H(t))return void(e!==null&&Xx(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.getNode(),h=p.getNode(),[g,_]=Ub(n,m,f.offset),[v,y]=Ub(n,h,p.offset),b=t.format,x=t.style,S=t.isCollapsed(),C=g,w=v,T=!1;var E,D,O,k,A;if((f.type===`text`?(C=iS(g),T=m.getFormat()!==b||m.getStyle()!==x):H(e)&&e.anchor.type===`text`&&(T=!0),p.type===`text`&&(w=iS(v)),C!==null&&w!==null)&&(S&&(e===null||T||H(e)&&(e.format!==b||e.style!==x))&&(E=b,D=x,O=_,k=f.key,A=performance.now(),yy=[E,D,O,k,A]),l!==_||u!==y||s!==C||c!==w||r.type===`Range`&&S||(d!==null&&a.contains(d)||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0}),f.type===`element`))){if(Hb(r,C,_,w,y),!Rg||!t.isCollapsed()||a===null||i.has(`skip-selection-focus`)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=H(t)&&t.anchor.type===`element`?C.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=HS(n),i=KS(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t){s=0,c=qS(e).innerHeight;let t=i.getComputedStyle(r.documentElement),n=parseFloat(t.scrollPaddingTop),a=parseFloat(t.scrollPaddingBottom);isFinite(n)&&(s+=n),isFinite(a)&&(c-=a)}else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0)if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}if(t)break;l=VS(l)}})(n,t,a)}}fy=!0}}function Gb(e){let t=e;e.isCollapsed()||t.removeText();let n=U();H(n)&&(t=n),H(t)||z(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!cC(i);){let e=i;if([i,a]=Kb(i,a),e.is(i))break}return a}function Kb(e,t){let n=e.getParent();if(!n){let e=Px();return _S().append(e),e.select(),[_S(),0]}if(V(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!W(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Sb(vb(e.__key,t,`element`),vb(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function qb(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=$C(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!lw(c)){for(let e of c){l=!1;let{origin:t}=e;if(!Cx(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of WC(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(jC(e))e.origin.isInline()||(c=e);else{if(W(e.origin))continue;Cx(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Cx(c.origin)&&c.origin.isKeyboardSelectable()){let e=Fb();return e.add(c.origin.getKey()),yS(e),!0}return c=cw(c),s&&ew(e.anchor,c),ew(e.focus,c),l||!o}var Jb=null,Yb=null,Xb=!1,Zb=!1,Qb=0,$b={characterData:!0,childList:!0,subtree:!0};function ex(){return Xb||Jb!==null&&Jb._readOnly}function tx(){Xb&&z(13)}function nx(){Qb>99&&z(14)}function rx(){return Jb===null&&z(195,ax()),Jb}function ix(){return Yb===null&&z(196,ax()),Yb}function ax(){let e=0,t=new Set,n=Vx.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=$x(r);if(Zx(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function ox(){return Yb}function sx(e,t,n){let r=t.__type,i=Gx(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function cx(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function lx(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function ux(e,t){let n=e.type,r=t.get(n);r===void 0&&z(17,n);let i=r.klass;e.type!==i.getType()&&z(18,i.name);let a=i.importJSON(e),o=e.children;if(W(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=ux(o[e],t);a.append(n)}return a}function dx(e,t,n){let r=Jb,i=Xb,a=Yb;Jb=t,Xb=!0,Yb=e;try{return n()}finally{Jb=r,Xb=i,Yb=a}}function fx(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=Jb,u=Xb,d=Yb,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){Yb=e,Jb=n,Xb=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=gv(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),Zb)throw t;Ix(e,null,r,n),x_(e),e._dirtyType=2,Zb=!0,fx(e,a),Zb=!1;return}finally{p.observe(r,$b),e._updating=f,Jb=l,Xb=u,Yb=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=hS(e)),delete r[a])}(e,n);let b=i?null:tC(qS(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){Yb=e,Jb=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&eC(t,e,r),Wb(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(H(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())$S(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&$S(t)){let n=t.getPreviousSibling();(n===null||$S(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=gw(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&eC(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,$b),Yb=d,Jb=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),H(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(vv,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,px(`decorator`,e,!0,x)),function(e,t,n){let r=gS(t),i=gS(n);r!==i&&px(`textcontent`,e,!0,i)}(e,t||a,n),px(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;gx(e,t,r)}}}(e)}function px(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function mx(e,t,n,r){let i=SS(e),a;for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t!==void 0){let e=Array.from(t),i=e.length,a=!1;if(_x(s,()=>{for(let t=0;t<i;t++)if(e[t](n,r))return void(a=!0)}),a)return a}}}return a&&a.update(()=>{mx(a,t,n,r)}),!1}function hx(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&z(191),a._flushSync=!0),o&&e._deferred.push(o),lx(e,i.tag)),a==null?gx(e,n,i):n()}}return r}function gx(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,lx(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=Ex(c||s),l=!0),c._flushSync=o;let u=Jb,d=Xb,f=Yb,p=e._updating;Jb=c,Xb=!1,e._updating=!0,Yb=e;let m=e._headless||e.getRootElement()===null;Ux(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=tC(qS(e));return H(n)||n==null?Ib(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=hx(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(H(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);V(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&F_(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=uS(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);V(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&F_(r),r!==void 0&&cx(r,a)&&sx(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){Qb++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&cx(c,a)&&sx(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,Qb++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),hx(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(W(t)&&d_(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(H(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||z(19)}else Cb(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),fx(e);return}finally{Jb=u,Xb=d,Yb=f,e._updating=p,Qb=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,fx(e)):l&&qx(()=>{fx(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function _x(e,t,n){Yb===e&&n===void 0?t():gx(e,t,n)}var vx=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&z(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&z(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&z(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(Gg||Bg||Hg);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=yx(t,n);i.push(r);let a=yx(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function yx(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&z(225),n.reverse()}var bx=class extends Vy{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return s_[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=ix()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(V(t)&&e.push(t),W(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;W(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;W(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return W(e)&&e.getLastDescendant()||e||null}let r=t[e];return W(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:dS(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&z(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:dS(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&z(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),W(i)&&r!==n-1&&!i.isInline()&&(e+=n_)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),W(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=o_[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=i_[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return aS(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){tx();let n=U(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(V(e)||W(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(V(e)||W(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return H(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):Nb(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:o_[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){By(this)&&z(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||z(226,String(e),String(t),String(r));let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0)if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&z(100);let t=e.getNextSibling(),n=e.__key;sS(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,sS(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&z(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=U();if(H(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;xx(r,t,n)&&Bb(r,r.getNode(),this,l,c),xx(i,t,n)&&Bb(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||YS(this)||this.remove()}}return i}getDOMSlot(e){return new vx(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(rC(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||YS(this)||this.getChildren().some(V)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function W(e){return e instanceof bx}function xx(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Sx=class extends Vy{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Cx(e){return e instanceof Sx}var wx=class e extends bx{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){z(51)}getTextContent(){let e=this.__cachedText;return!ex()&&ix()._dirtyType!==0||e===null?super.getTextContent():e}remove(){z(52)}replace(e){z(53)}insertBefore(e){z(54)}insertAfter(e){z(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)W(e)||Cx(e)||z(282);return super.splice(e,t,n)}static importJSON(e){return _S().updateFromJSON(e)}collapseAtStart(){return!0}};function Tx(e){return e instanceof wx}function Ex(e){return new Ax(new Map(e._nodeMap))}function Dx(){return new Ax(new Map([[`root`,new wx]]))}function Ox(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&z(130,n.name),W(e)){let r=t.children;Array.isArray(r)||z(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=Ox(i[e]);r.push(t)}}return t}function kx(e){return e instanceof Ax}var Ax=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return dx(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return dx(null,this,()=>({root:Ox(_S())}))}},jx=class extends bx{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},Mx=class e extends bx{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=FS(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Nx,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(rC(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return Px().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(V);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=Px();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||V(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function Nx(e){let t=Px();if(e.style&&(t.setFormat(e.style.textAlign),hC(e,t)),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in o_&&t.setFormat(n)}return{node:t}}function Px(){return XS(new Mx)}function Fx(e){return e instanceof Mx}function Ix(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=Dx(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function Lx(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=vC(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof Vy&&e!==Vy?e:void 0}}return t}function Rx(e){let t=e||{},n=ox(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Dx(),s=t.namespace||(i===null?CS():i._config.namespace),c=t.editorState,l=[wx,rb,Ky,mb,Mx,jx,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}vC(t);let i=t.getType(),a=Lx(t);p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:w_(l[e]),transforms:a})}}let m=new Vx(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=2),function(e){e.registerCommand(bv,Ey,0),e.registerCommand(xv,Dy,0),e.registerCommand(Sv,Oy,0),e.registerCommand(Cv,ky,0),e.registerCommand(Fv,jy,0)}(m),m}function zx(e,t){let n=e.get(t);e.delete(t),n&&n()}function Bx(e,t,n){return e.set(t,n),zx.bind(null,e,t)}var Vx=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=CS(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return Bx(this._listeners.update,e)}registerEditableListener(e){return Bx(this._listeners.editable,e)}registerDecoratorListener(e){return Bx(this._listeners.decorator,e)}registerTextContentListener(e){return Bx(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return vw(Bx(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&z(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&z(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&z(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=fC(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=fC(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=dS(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:Hy}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return K(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=FS(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Ix(this,t,e,r),t!==null&&(this._config.disableEvents||Ly(t),n!=null&&t.classList.remove(...n)),e!==null){let t=KS(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,x_(this),this._updateTags.add(Hy),fx(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;uy.set(e,n);let r=dy.get(n)??0;r<1&&n.addEventListener(`selectionchange`,Py),dy.set(n,r+1),e.__lexicalEditor=t;let i=My(e);for(let n=0;n<ay.length;n++){let[r,a]=ay[n],o=typeof a==`function`?e=>{Iy(e)||(Fy(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(Iy(e))return;Fy(e);let n=t.isEditable();switch(r){case`cut`:return n&&K(t,$v,e);case`copy`:return K(t,Qv,e);case`paste`:return n&&K(t,Ov,e);case`dragstart`:return n&&K(t,Yv,e);case`dragover`:return n&&K(t,Xv,e);case`dragend`:return n&&K(t,Zv,e);case`focus`:return n&&K(t,ty,e);case`blur`:return n&&K(t,ny,e);case`drop`:return n&&K(t,Jv,e)}};e.addEventListener(r,o),i.push(()=>{e.removeEventListener(r,o)})}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Hy),fx(this);px(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&z(38);let n=e;n._readOnly&&(n=Ex(e),n._selection=e._selection?e._selection.clone():null),b_(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),fx(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||fx(this)}parseEditorState(e,t){return function(e,t,n){let r=Dx(),i=Jb,a=Xb,o=Yb,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Jb=r,Xb=!1,Yb=t,Ux(null);try{let i=t._nodes;ux(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,Jb=i,Xb=a,Yb=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return fx(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):gx(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),_x(this,()=>{let r=U(),i=_S();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||yS(r.clone()),US(`focus`),WS(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=tC(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,px(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};Vx.version=`0.43.0+prod.esm`;var Hx=null;function Ux(e){Hx=e}var Wx=1;function Gx(e,t){let n=Kx(e,t);return n===void 0&&z(30,t),n}function Kx(e,t){return e._nodes.get(t)}var qx=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function Jx(e){return Cx(mS(e))}function Yx(e){let t=document.activeElement;if(!rC(t))return!1;let n=t.nodeName;return Cx(mS(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&$x(t)==null)}function Xx(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Yx(t)&&Qx(t)===e}catch{return!1}}function Zx(e){return e instanceof Vx}function Qx(e){let t=e;for(;t!=null;){let e=$x(t);if(Zx(e))return e;t=VS(t)}return null}function $x(e){return e?e.__lexicalEditor:null}function eS(e){return gb(e)||e.isToken()}function tS(e){return eS(e)||e.isSegmented()}function nS(e){return iC(e)&&e.nodeType===3}function rS(e){return iC(e)&&e.nodeType===9}function iS(e){let t=e;for(;t!=null;){if(nS(t))return t;t=t.firstChild}return null}function aS(e,t,n){let r=i_[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~i_.superscript:t===`superscript`?i&=~i_.subscript:t===`lowercase`?(i&=~i_.uppercase,i&=~i_.capitalize):t===`uppercase`?(i&=~i_.lowercase,i&=~i_.capitalize):t===`capitalize`&&(i&=~i_.lowercase,i&=~i_.uppercase),i}function oS(e,t){let n=function(){let e=Hx;return Hx=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);tx(),nx();let r=ix(),i=rx(),a=``+ Wx++;i._nodeMap.set(a,e),W(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=1,e.__key=a}function sS(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function cS(e){nx(),By(e)&&z(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=rx(),i=ix(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=1,W(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function lS(e){tx();let t=ix(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=dS(n);e!==null&&e.getWritable()}if(e!==null){let t=dS(e);t!==null&&t.getWritable()}}}function uS(){return ex()?null:ix()._compositionKey}function dS(e,t){let n=(t||rx())._nodeMap.get(e);return n===void 0?null:n}function fS(e,t){let n=pS(e,ix());return n===void 0?null:dS(n,t)}function pS(e,t){return e[`__lexicalKey_${t._key}`]}function mS(e,t){let n=e;for(;n!=null;){let e=fS(n,t);if(e!==null)return e;n=VS(n)}return null}function hS(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function gS(e){return e.read(()=>_S().getTextContent())}function _S(){return vS(rx())}function vS(e){return e._nodeMap.get(`root`)}function yS(e){tx();let t=rx();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function bS(e){let t=ix(),n=function(e,t){let n=e;for(;n!=null;){let e=pS(n,t);if(e!==void 0)return e;n=VS(n)}return null}(e,t);return n===null?e===t.getRootElement()?dS(`root`):null:dS(n)}function xS(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function SS(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function CS(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function wS(e){return nS(e)?e.nodeValue:null}function TS(e,t,n){let r=tC(qS(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=wS(i),r=mS(i);if(t!==null&&V(r)){if((t===t_||t===r_)&&n){let e=n.length;t=n,a=e,o=e}t!==null&&ES(r,t,a,o,e)}}}function ES(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;if((o||i)&&(t.endsWith(t_)&&(s=t.slice(0,-t_.length)),i)){let e=r_,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){if(s===``){if(lS(null),Hg||Bg||Gg)a.remove();else{let e=ix();setTimeout(()=>{e.update(()=>{a.isAttached()&&a.remove()})},20)}return}let t=a.getParent(),i=Lb(),c=a.getTextContentSize(),l=uS(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||H(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=U();if(!H(d)||n===null||r===null)return void DS(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=fb(a.getTextContent());a.replace(e),a=e}DS(a,s,d)}}}function DS(e,t,n){if(e.setTextContent(t),H(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=LC(e,i.offset,`clamp`))}}}function OS(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function kS(e,t){return OS(e,t,`altKey`)&&OS(e,t,`ctrlKey`)&&OS(e,t,`shiftKey`)&&OS(e,t,`metaKey`)}function G(e,t,n){if(!kS(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let r=`Key`+t.toUpperCase();return e.code===r}var AS={ctrlKey:!Lg,metaKey:Lg},jS={altKey:Lg,ctrlKey:!Lg};function MS(e){return e.key===`Backspace`}function NS(e){return G(e,`a`,AS)}function PS(e){let t=_S();if(H(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),I_(e),e}{let e=t.select(0,t.getChildrenSize());return yS(I_(e)),e}}function FS(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=gw(i);return n[t]=e,e}return i}function IS(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&z(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function LS(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function RS(e,t){let n=e.offset;if(e.type===`element`)return LS(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?LS(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function zS(e){let t=qS(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function K(e,t,n){return mx(e,t,n,e)}function BS(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&z(75,t),n}function VS(e){let t=e.assignedSlot||e.parentElement;return aC(t)?t.host:t}function HS(e){return rS(e)?e:rC(e)?e.ownerDocument:null}function US(e){tx(),ix()._updateTags.add(e)}function WS(e){tx(),ix()._deferred.push(e)}function GS(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function KS(e){let t=HS(e);return t?t.defaultView:null}function qS(e){let t=e._window;return t===null&&z(78),t}function JS(e){let t=e.getParentOrThrow();for(;t!==null;){if(YS(t))return t;t=t.getParentOrThrow()}return t}function YS(e){return Tx(e)||W(e)&&e.isShadowRoot()}function XS(e){let t=ix(),n=e.getType(),r=Kx(t,n);r===void 0&&z(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||z(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||z(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&z(203,e.constructor.name,n,r.name,r.getType()),t}return e}function ZS(e,t){!Tx(e.getParent())||W(t)||Cx(t)||z(99)}function QS(e){let t=dS(e);return t===null&&z(63,e),t}function $S(e){return(Cx(e)||W(e)&&!e.canBeEmpty())&&!e.isInline()}function eC(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function tC(e){return Fg?(e||window).getSelection():null}function nC(e){let t=KS(e);return t?t.getSelection():null}function rC(e){return iC(e)&&e.nodeType===1}function iC(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function aC(e){return iC(e)&&e.nodeType===11}function oC(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function sC(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function cC(e){if(Cx(e)&&!e.isInline())return!0;if(!W(e)||YS(e))return!1;let t=e.getFirstChild(),n=t===null||Yy(t)||V(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function lC(){return ix()}var uC=new WeakMap,dC=new Map;function fC(e){if(!e._readOnly&&e.isEmpty())return dC;e._readOnly||z(192);let t=uC.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),uC.set(e,t)),t}function pC(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function mC(e){return(t=pC(e))[zy]=!0,t;var t}function hC(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function gC(e){return!0===e.__lexicalUnmanaged}function _C(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==Vy[t]}function vC(e){let t=u_ in e.prototype?e.prototype[u_]():void 0,n=function(e){if(!(e===Vy||e.prototype instanceof Vy)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{Vx.version&&(n=JSON.parse(Vx.version))}catch{}z(290,e.name,t,n)}return e===Sx||e===bx||e===Vy}(e),r=!n&&_C(e,`getType`)?e.getType():void 0,i,a=r;if(t)if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n;if(!n&&a&&(_C(e,`getType`)||(e.getType=()=>a),_C(e,`clone`)||(e.clone=t=>(Ux(t),new e)),_C(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!_C(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function yC(e){let t=lC();return tx(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var bC=(e,t)=>{let n=e;for(;n!=null&&!Tx(n);){if(t(n))return n;n=n.getParent()}return null},xC={next:`previous`,previous:`next`},SC=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return qC({hasNext:AC,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return FC(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return FC(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&z(263,Array.from(o).join(` `))}else i.insert(e);i=FC(e,this.direction)}for(let e of o.values())e.remove();return this}},CC=class e extends SC{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:zC(e,this.direction)}getParentCaret(e=`root`){return FC(EC(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=TC(this.direction);return FC(this.getNodeAtCaret(),e)||zC(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},wC={root:Tx,shadowRoot:YS};function TC(e){return xC[e]}function EC(e,t=`root`){return wC[t](e)?null:e}var DC=class e extends SC{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:FC(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return W(this.origin)?zC(this.origin,this.direction):null}getParentCaret(e=`root`){return FC(EC(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=TC(this.direction);return FC(this.getNodeAtCaret(),e)||zC(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof OC)&&this.direction===t.direction&&this.origin.is(t.origin)}},OC=class e extends SC{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:IC(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return FC(EC(this.getParentAtCaret(),e),this.direction)}getFlipped(){return IC(this.origin,TC(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof DC||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return FC(this.origin,this.direction)}};function kC(e){return e instanceof OC}function AC(e){return e instanceof DC}function jC(e){return e instanceof CC}var MC={next:class extends OC{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends OC{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},NC={next:class extends DC{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends DC{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},PC={next:class extends CC{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends CC{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function FC(e,t){return e?new NC[t](e):null}function IC(e,t,n){return e?new MC[t](e,LC(e,n)):null}function LC(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Pg(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function RC(e,t){return new UC(e,t)}function zC(e,t){return W(e)?new PC[t](e):null}function BC(e){return e&&e.getChildCaret()||e}function VC(e){return e&&BC(e.getAdjacentCaret())}var HC=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return kC(t)?function(e,t){let{direction:n,origin:r}=e;return RC(e,LC(r,t===`focus`?TC(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[RC(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=kC(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=kC(n),i=t=>t.isSameNodeCaret(n)?null:VC(t)||t.getParentCaret(e);return qC({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},UC=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return IC(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function WC(e){return KC(e,FC(_S(),e.direction))}function GC(e){return KC(e,e)}function KC(e,t){return e.direction!==t.direction&&z(265),new HC(e,t,e.direction)}function qC(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function JC(e,t){let n=QC(e.origin,t.origin);switch(n===null&&z(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return YC(n)}}function YC(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function XC(e,t){return t.is(e)}function ZC(e){return W(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function QC(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=ZC(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=ZC(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(XC(e,r)||z(276),{commonAncestor:r,type:`ancestor`}):i===null?(XC(t,r)||z(277),{commonAncestor:r,type:`descendant`}):((W(a)||XC(e,a))&&(W(i)||XC(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||z(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function $C(e,t){let{type:n,key:r,offset:i}=e,a=QS(e.key);return n===`text`?(V(a)||z(266,a.getType(),r),IC(a,t,i)):(W(a)||z(267,a.getType(),r),fw(a,e.offset,t))}function ew(e,t){let{origin:n,direction:r}=t,i=r===`next`;kC(t)?e.set(n.getKey(),t.offset,`text`):AC(t)?V(n)?e.set(n.getKey(),LC(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),`element`):(jC(t)&&W(n)||z(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function tw(e){let t=U(),n=H(t)?t:Pb();return nw(n,e),yS(n),n}function nw(e,t){ew(e.anchor,t.anchor),ew(e.focus,t.focus)}function rw(e){let{anchor:t,focus:n}=e,r=$C(t,`next`),i=$C(n,`next`),a=JC(r,i)<=0?`next`:`previous`;return KC(uw(r,a),uw(i,a))}function iw(e){let{direction:t,origin:n}=e,r=FC(n,TC(t)).getNodeAtCaret();return r?FC(r,t):zC(n.getParentOrThrow(),t)}function aw(e,t=`root`){let n=[e];for(let r=jC(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(iw(r));return n}function ow(e){return!!e&&e.origin.isAttached()}function sw(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=dw(e,r),o=aw(a.anchor,n),s=aw(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(jC(e))c.add(e.origin.getKey());else if(AC(e)){let{origin:t}=e;W(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=iw(FC(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=fb(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=IC(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(ow(e)){u=cw(e);break}for(let e of s)if(ow(e)){d=cw(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(YS(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,cC),d=u&&l(o,e=>n.has(e.getKey())&&cC(e));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;zC(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}let p=[u,d,...o,...s].find(ow);if(p)return GC(uw(cw(p),e.direction));z(269,JSON.stringify(o.map(e=>e.origin.__key)))}function cw(e){let t=function(e){let t=e;for(;jC(t);){let e=VC(t);if(!jC(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(V(t.origin))return kC(t)?t:IC(t.origin,n,n);let r=t.getAdjacentCaret();return AC(r)&&V(r.origin)?IC(r.origin,n,TC(n)):t}function lw(e){return kC(e)&&e.offset!==LC(e.origin,e.direction)}function uw(e,t){return e.direction===t?e:e.getFlipped()}function dw(e,t){return e.direction===t?e:KC(uw(e.focus,t),uw(e.anchor,t))}function fw(e,t,n){let r=zC(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return uw(r,n)}function pw(e){return e}function mw(e){return e}function hw(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function gw(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function _w(e,...t){let n=gw(...t);n.length>0&&e.classList.add(...n)}function vw(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function yw(){return _S().getTextContent()}function bw(e,t=!0){if(e)return!1;let n=yw();return t&&(n=n.trim()),n===``}function xw(e){if(!bw(e,!1))return!1;let t=_S().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(Cx(n))return!1;if(W(n)){if(!Fx(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!V(n))return!1}}}return!0}function Sw(e){return()=>xw(e)}function Cw(e){let t=lC().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function ww(e){return Cw(Tx(e)?e:e.getParentOrThrow())}function Tw(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!tS(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=Tb(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=mC(t)),t.__text=p)}}return t}function Ew(e){let t=Dw(e);return t!==null&&t.writingMode===`vertical-rl`}function Dw(e){let t=e.anchor.getNode();return W(t)?Cw(t):ww(t)}function Ow(e,t){let n=Ew(e)?!t:t;Aw(e)&&(n=!n);let r=$C(e.focus,n?`previous`:`next`);if(lw(r))return!1;for(let e of WC(r)){if(jC(e))return!e.origin.isInline();if(!W(e.origin)){if(Cx(e.origin))return!0;break}}return!1}function kw(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Aw(e){let t=Dw(e);return t!==null&&t.direction===`rtl`}function jw(e,t,n){let r=Aw(e),i;i=Ew(e)||r?!n:n,kw(e,t,i,`character`)}var Mw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Nw=Mw&&`documentMode`in document?document.documentMode:null;Mw&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Mw&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!Mw||!(`InputEvent`in window)||Nw)&&`getTargetRanges`in new window.InputEvent(`input`),Mw&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,Mw&&/Android/.test(navigator.userAgent),Mw&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Mw&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Mw&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function Pw(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}var Fw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Iw({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,P.useState)(e.isEditable()),T=(0,P.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),E=(0,P.useMemo)(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,T),[T,S]);return Fw(()=>(w(e.isEditable()),e.registerEditableListener(e=>{w(e)})),[e]),(0,F.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:E,role:g,spellCheck:_,style:v,tabIndex:y,...x})}var Lw=(0,P.forwardRef)(Iw);function Rw(e){return e.getEditorState().read(Sw(e.isComposing()))}var zw=(0,P.forwardRef)(Bw);function Bw(e,t){let{placeholder:n,...r}=e,[i]=Ng();return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Lw,{editor:i,...r,ref:t}),n!=null&&(0,F.jsx)(Vw,{editor:i,content:n})]})}function Vw({content:e,editor:t}){let n=function(e){let[t,n]=(0,P.useState)(()=>Rw(e));return Fw(()=>{function t(){n(Rw(e))}return t(),vw(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=(0,P.useState)(t.isEditable());if((0,P.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,F.jsx)(`div`,{"aria-hidden":!0,children:a})}var Hw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Uw=Hw?P.useLayoutEffect:P.useEffect,Ww={tag:Hy};function Gw({initialConfig:e,children:t}){let n=(0,P.useMemo)(()=>{let{theme:t,namespace:n,nodes:r,onError:i,editorState:a,html:o}=e,s=Mg(null,t),c=Rx({editable:e.editable,html:o,namespace:n,nodes:r,onError:e=>i(e,c),theme:t});return function(e,t){if(t!==null){if(t===void 0)e.update(()=>{let t=_S();if(t.isEmpty()){let n=Px();t.append(n);let r=Hw?document.activeElement:null;(U()!==null||r!==null&&r===e.getRootElement())&&n.select()}},Ww);else if(t!==null)switch(typeof t){case`string`:{let n=e.parseEditorState(t);e.setEditorState(n,Ww);break}case`object`:e.setEditorState(t,Ww);break;case`function`:e.update(()=>{_S().isEmpty()&&t(e)},Ww)}}}(c,a),[c,s]},[]);return Uw(()=>{let t=e.editable,[r]=n;r.setEditable(t===void 0||t)},[]),(0,F.jsx)(jg.Provider,{value:n,children:t})}var Kw=(0,P.createContext)(null),qw={didCatch:!1,error:null},Jw=class extends P.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=qw}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(qw))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&Yw(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(qw))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,P.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,P.createElement)(Kw.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function Yw(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function Xw({children:e,onError:t}){return(0,F.jsx)(Jw,{fallback:(0,F.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}),onError:t,children:e})}var Zw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Qw(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function $w(){return function(e){let[t]=Ng(),n=(0,P.useMemo)(()=>e(t),[t,e]),[r,i]=(0,P.useState)(()=>n.initialValueFn()),a=(0,P.useRef)(r);return Zw(()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t(e=>{a.current=e,i(e)})},[n,e]),r}(Qw)}var eT=Symbol.for(`preact-signals`);function tT(){if(aT>1)return void aT--;let e,t=!1;for(function(){let e=iT;for(iT=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();nT!==void 0;){let n=nT;for(nT=void 0,oT++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&dT(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(oT=0,aT--,t)throw e}var q,nT;function rT(e){let t=q;q=void 0;try{return e()}finally{q=t}}var iT,aT=0,oT=0,sT=0,cT=0;function lT(e){if(q===void 0)return;let t=e.n;return t===void 0||t.t!==q?(t={i:0,S:e,p:q.s,n:void 0,t:q,e:void 0,x:void 0,r:t},q.s!==void 0&&(q.s.n=t),q.s=t,e.n=t,32&q.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=q.s,t.n=void 0,q.s.n=t,q.s=t),t):void 0}function uT(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function dT(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function fT(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function pT(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function mT(e,t){uT.call(this,void 0),this.x=e,this.s=void 0,this.g=cT-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function hT(e){let t=e.m;if(e.m=void 0,typeof t==`function`){aT++;let n=q;q=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,gT(e),t}finally{q=n,tT()}}}function gT(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,hT(e)}function _T(e){if(q!==this)throw Error(`Out-of-order effect`);pT(this),q=e,this.f&=-2,8&this.f&&gT(this),tT()}function vT(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function yT(e,t){let n=new vT(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}uT.prototype.brand=eT,uT.prototype.h=function(){return!0},uT.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?rT(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},uT.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&rT(()=>{var e;(e=this.Z)==null||e.call(this)}))}},uT.prototype.subscribe=function(e){return yT(()=>{let t=this.value,n=q;q=void 0;try{e(t)}finally{q=n}},{name:`sub`})},uT.prototype.valueOf=function(){return this.value},uT.prototype.toString=function(){return this.value+``},uT.prototype.toJSON=function(){return this.value},uT.prototype.peek=function(){let e=q;q=void 0;try{return this.value}finally{q=e}},Object.defineProperty(uT.prototype,`value`,{get(){let e=lT(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(oT>100)throw Error(`Cycle detected`);(function(e){aT!==0&&oT===0&&e.l!==sT&&(e.l=sT,iT={S:e,v:e.v,i:e.i,o:iT})})(this),this.v=e,this.i++,cT++,aT++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{tT()}}}}),mT.prototype=new uT,mT.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===cT))return!0;if(this.g=cT,this.f|=1,this.i>0&&!dT(this))return this.f&=-2,!0;let e=q;try{fT(this),q=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return q=e,pT(this),this.f&=-2,!0},mT.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}uT.prototype.S.call(this,e)},mT.prototype.U=function(e){if(this.t!==void 0&&(uT.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},mT.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(mT.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=lT(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),vT.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},vT.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,hT(this),fT(this),aT++;let e=q;return q=this,_T.bind(this,e)},vT.prototype.N=function(){2&this.f||(this.f|=2,this.u=nT,nT=this)},vT.prototype.d=function(){this.f|=8,1&this.f||gT(this)},vT.prototype.dispose=function(){this.d()};function bT(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}C_(`format`,{parse:e=>typeof e==`number`?e:0});function xT(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ST(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)n[e]=ST(n[e],r[e]);return e}return t}var CT=0,wT=1,TT=2,ET=3,DT=4,OT=5,kT=6,AT=7;function jT(e){return e.id===CT}function MT(e){return e.id===TT}function NT(e){return function(e){return e.id===wT}(e)||xT(305,String(e.id),String(wT)),Object.assign(e,{id:TT})}var PT=new Set,FT=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:CT}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):hw;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;MT(t)||xT(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:ET,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:DT,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==DT&&xT(307,String(t.id),String(OT)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:OT,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==OT&&xT(308,String(n.id),String(OT));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:kT})}(n),()=>{let e=this.state;e.id!==AT&&xT(309,String(n.id),String(AT)),this.state=function(e){return Object.assign(e,{id:OT})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==kT&&xT(310,String(t.id),String(kT)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:AT})}(t),n}getSignal(){return this._signal===void 0&&xT(311),this._signal}getInitResult(){this.extension.init===void 0&&xT(312,this.extension.name);let e=this.state;return function(e){return e.id>=DT}(e)||xT(313,String(e.id),String(DT)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=ET}(e)||xT(314,String(e.id),String(ET)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&xT(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&xT(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=AT}(e)||xT(316,String(e.id),String(AT)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||PT}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=OT})(e)||xT(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},IT={tag:Hy};function LT(){let e=_S();e.isEmpty()&&e.append(Px())}var RT=pw({config:mw({setOptions:IT,updateOptions:IT}),init:({$initialEditorState:e=LT})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(kx(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[wx,rb,Ky,mb,Mx]}),zT=Symbol.for(`@lexical/extension/LexicalBuilder`);function BT(){}function VT(e){throw e}function HT(e){return Array.isArray(e)?e:[e]}var UT=`0.43.0+prod.esm`,WT=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=UT,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[HT(RT)];for(let e of t)n.push(HT(e));return new e(n)}static maybeFromEditor(t){let n=t[zT];return n&&(n.PACKAGE_VERSION!==UT&&xT(292,n.PACKAGE_VERSION,UT),n instanceof e||xT(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&xT(294),n}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign(Rx({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[zT]:this});for(let e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){let e=BT;function t(){try{e()}finally{e=BT}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=vw(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&xT(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&xT(296);let[t]=HT(e);typeof t.name!=`string`&&xT(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&xT(298,t.name),!n){n=new FT(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&xT(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&xT(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=HT(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(MT(i))return;let a=n.extension.name;var o;jT(i)||xT(300,a,r||`[unknown]`),jT(o=i)||xT(304,String(o.id),String(CT)),i=Object.assign(o,{id:wT}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=NT(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())jT(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&xT(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return vw(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of bT(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&xT(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&ST(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=VT,e}},GT=class e extends Sx{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return qT().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:KT,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return _w(t,e.theme.hr),t}getTextContent(){return`
15
+ `}isInline(){return!1}updateDOM(){return!1}};function KT(){return{node:qT()}}function qT(){return yC(GT)}var JT=pw({name:`@lexical/react/ReactProvider`});function YT(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let i=n.data;if(typeof i==`string`){let t;try{t=JSON.parse(i)}catch{return}if(t&&t.protocol===`nuanria_messaging`&&t.type===`request`){let r=t.payload;if(r&&r.functionId===`makeChanges`){let t=r.args;if(t){let[r,i,a,o,s]=t;e.update(()=>{let e=U();if(H(e)){let t=e.anchor,c=t.getNode(),l=0,u=0;if(V(c)&&r>=0&&i>=0&&(l=r,u=r+i,e.setTextNodeRange(c,l,c,u)),l===u&&a===``||(e.insertRawText(a),c=t.getNode()),V(c)){l=o,u=o+s;let t=c.getTextContentSize();l=l>t?t:l,u=u>t?t:u,e.setTextNodeRange(c,l,c,u)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener(`message`,n,!0),()=>{window.removeEventListener(`message`,n,!0)}}function XT(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=_S().getChildren();for(let i=0;i<r.length;i++)ZT(e,r[i],n,t);return n.innerHTML}function ZT(e,t,n,r=null){let i=r===null||t.isSelected(r),a=W(t)&&t.excludeFromCopy(`html`),o=t;r!==null&&V(t)&&(o=Tw(r,t,`clone`));let s=W(o)?o.getChildren():[],c=Kx(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=ZT(e,a,f,r);!i&&W(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((rC(u)||aC(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(aC(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}function QT(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function $T(e,t=U()){return t??QT(166),H(t)&&t.isCollapsed()||t.getNodes().length===0?``:XT(e,t)}function eE(e,t){let n=e.getData(`text/plain`)||e.getData(`text/uri-list`);n!=null&&t.insertRawText(n)}var tE=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,nE=tE&&`documentMode`in document?document.documentMode:null,rE=tE&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),iE=!(!tE||!(`InputEvent`in window)||nE)&&`getTargetRanges`in new window.InputEvent(`input`),aE=tE&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,oE=tE&&/Android/.test(navigator.userAgent),sE=tE&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!oE,cE=tE&&/^(?=.*Chrome).*/i.test(navigator.userAgent),lE=tE&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&rE&&!cE;function uE(e,t){t.update(()=>{if(e!==null){let n=Pw(e,KeyboardEvent)?null:e.clipboardData,r=U();if(r!==null&&!r.isCollapsed()&&n!=null){e.preventDefault();let i=$T(t);i!==null&&n.setData(`text/html`,i),n.setData(`text/plain`,r.getTextContent())}}})}function dE(e){return vw(e.registerCommand(wv,e=>{let t=U();return!!H(t)&&(t.deleteCharacter(e),!0)},0),e.registerCommand(Av,e=>{let t=U();return!!H(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(jv,e=>{let t=U();return!!H(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Dv,e=>{let t=U();if(!H(t))return!1;if(typeof e==`string`)t.insertText(e);else{let n=e.dataTransfer;if(n!=null)eE(n,t);else{let n=e.data;n&&t.insertText(n)}}return!0},0),e.registerCommand(kv,()=>{let e=U();return!!H(e)&&(e.removeText(),!0)},0),e.registerCommand(Tv,e=>{let t=U();return!!H(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Ev,()=>{let e=U();return!!H(e)&&(e.insertLineBreak(),!0)},0),e.registerCommand(Rv,e=>{let t=U();if(!H(t))return!1;let n=e,r=n.shiftKey;return!!Ow(t,!0)&&(n.preventDefault(),jw(t,r,!0),!0)},0),e.registerCommand(Iv,e=>{let t=U();if(!H(t))return!1;let n=e,r=n.shiftKey;return!!Ow(t,!1)&&(n.preventDefault(),jw(t,r,!1),!0)},0),e.registerCommand(Wv,t=>!!H(U())&&(!aE||navigator.language!==`ko-KR`)&&(t.preventDefault(),e.dispatchCommand(wv,!0)),0),e.registerCommand(Kv,t=>!!H(U())&&(t.preventDefault(),e.dispatchCommand(wv,!1)),0),e.registerCommand(Hv,t=>{if(!H(U()))return!1;if(t!==null){if((aE||sE||lE)&&iE)return!1;t.preventDefault()}return e.dispatchCommand(Tv,!1)},0),e.registerCommand(ey,()=>(PS(),!0),0),e.registerCommand(Qv,t=>!!H(U())&&(uE(t,e),!0),0),e.registerCommand($v,t=>!!H(U())&&(function(e,t){uE(e,t),t.update(()=>{let e=U();H(e)&&e.removeText()})}(t,e),!0),0),e.registerCommand(Ov,t=>!!H(U())&&(function(e,t){e.preventDefault(),t.update(()=>{let t=U(),n=Pw(e,ClipboardEvent)?e.clipboardData:null;n!=null&&H(t)&&eE(n,t)},{tag:`paste`})}(t,e),!0),0),e.registerCommand(Jv,e=>!!H(U())&&(e.preventDefault(),!0),0),e.registerCommand(Yv,e=>!!H(U())&&(e.preventDefault(),!0),0))}var fE=e(c(),1);function pE(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var mE=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function hE({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,P.useState)(()=>e.getDecorators());return mE(()=>e.registerDecoratorListener(e=>{(0,fE.flushSync)(()=>{r(e)})}),[e]),(0,P.useEffect)(()=>{r(e.getDecorators())},[e]),(0,P.useMemo)(()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,F.jsx)(t,{onError:t=>e._onError(t),children:(0,F.jsx)(P.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,fE.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function gE({editor:e,ErrorBoundary:t}){return function(e){let t=WT.maybeFromEditor(e);if(t&&t.hasExtensionByName(JT.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&pE(320,e);return!0}return!1}(e)?null:(0,F.jsx)(hE,{editor:e,ErrorBoundary:t})}function _E(e){return e.getEditorState().read(Sw(e.isComposing()))}function vE({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=Ng();return function(e){mE(()=>vw(dE(e),YT(e)),[e])}(r),(0,F.jsxs)(F.Fragment,{children:[e,(0,F.jsx)(yE,{content:t}),(0,F.jsx)(gE,{editor:r,ErrorBoundary:n})]})}function yE({content:e}){let[t]=Ng(),n=function(e){let[t,n]=(0,P.useState)(()=>_E(e));return mE(()=>{function t(){n(_E(e))}return t(),vw(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=$w();return n?typeof e==`function`?e(r):e:null}function bE(e){return e===`file`?[`mx-[2px]`,`inline-flex`,`h-7`,`max-w-[min(100%,17rem)]`,`items-center`,`gap-1.5`,`rounded-lg`,`border`,`border-border`,`bg-muted`,`px-2`,`align-baseline`,`text-foreground`,`transition-[border-color,background-color,box-shadow,color]`,`duration-150`].join(` `):[`mx-[2px]`,`inline-flex`,`h-7`,`max-w-full`,`items-center`,`gap-1.5`,`rounded-lg`,`border`,`border-primary/12`,`bg-primary/8`,`px-2`,`align-baseline`,`text-[11px]`,`font-medium`,`text-primary`,`transition`].join(` `)}function xE({label:e,tokenKind:t}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:t===`file`?`inline-flex h-4.5 w-4.5 shrink-0 items-center justify-center rounded-md bg-card text-muted-foreground ring-1 ring-border`:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-primary/70`,children:t===`file`?(0,F.jsx)(ko,{"aria-hidden":`true`,className:`h-3 w-3`}):t===`panel_app`?(0,F.jsx)(Ga,{"aria-hidden":`true`,className:`h-3 w-3`}):(0,F.jsx)(Yo,{"aria-hidden":`true`,className:`h-3 w-3`})}),(0,F.jsx)(`span`,{className:t===`file`?`min-w-0 flex-1 truncate text-[12px] font-medium text-foreground`:`truncate`,children:e})]})}var SE=class e extends Sx{static getType(){return`chat-composer-token`}static clone(t){return new e(t.__composerId,t.__tokenKind,t.__tokenKey,t.__label,t.__key)}static importJSON(e){return CE({composerId:e.composerId,label:e.label,tokenKey:e.tokenKey,tokenKind:e.tokenKind})}constructor(e,t,n,r,i){super(i),this.applyTokenDom=e=>{e.contentEditable=`false`,e.dataset.composerNodeId=this.__composerId,e.dataset.composerNodeType=`token`,e.dataset.composerTokenKind=this.__tokenKind,e.dataset.composerTokenKey=this.__tokenKey,e.dataset.composerLabel=this.__label,e.title=this.__label,e.className=bE(this.__tokenKind)},this.createDOM=(e,t)=>{let n=document.createElement(`span`);return this.applyTokenDom(n),n},this.updateDOM=(e,t)=>(this.applyTokenDom(t),!1),this.decorate=()=>(0,F.jsx)(xE,{label:this.__label,tokenKind:this.__tokenKind}),this.exportJSON=()=>({composerId:this.__composerId,label:this.__label,tokenKey:this.__tokenKey,tokenKind:this.__tokenKind,type:`chat-composer-token`,version:1}),this.getComposerId=()=>this.getLatest().__composerId,this.getTokenKind=()=>this.getLatest().__tokenKind,this.getTokenKey=()=>this.getLatest().__tokenKey,this.getLabel=()=>this.getLatest().__label,this.getTextContent=()=>``,this.isInline=()=>!0,this.isIsolated=()=>!0,this.isKeyboardSelectable=()=>!1,this.__composerId=e,this.__tokenKind=t,this.__tokenKey=n,this.__label=r}};function CE(e){let{composerId:t,label:n,tokenKey:r,tokenKind:i}=e;return XS(new SE(t,i,r,n))}function wE(e){return e instanceof SE}function TE(){let e=_S(),t=e.getFirstChild();if(!W(t))return{descriptors:[],paragraphKey:e.getKey(),paragraphSize:0,totalLength:0};let n=t.getChildren(),r=[],i=0;for(let[e,t]of n.entries()){if(V(t)){let n=t.getTextContent();r.push({index:e,key:t.getKey(),length:n.length,node:t,start:i,text:n,type:`text`}),i+=n.length;continue}if(wE(t)){r.push({index:e,key:t.getKey(),length:1,node:t,start:i,type:`token`}),i+=1;continue}r.push({index:e,key:t.getKey(),length:t.getTextContent().length,node:t,start:i,type:`linebreak`}),i+=t.getTextContent().length}return{descriptors:r,paragraphKey:t.getKey(),paragraphSize:n.length,totalLength:i}}function EE(e){let{descriptors:t,paragraphKey:n,paragraphSize:r,totalLength:i}=TE(),a=Math.max(0,Math.min(e,i));if(t.length===0)return{key:n,offset:0,type:`element`};for(let e of t){let r=e.start+e.length;if(e.type===`text`&&a>=e.start&&a<=r)return{key:e.key,offset:a-e.start,type:`text`};if(e.type!==`text`){if(a===e.start)return{key:n,offset:e.index,type:`element`};if(a===r){let r=t[e.index+1];return r?.type===`text`&&r.length===0?{key:r.key,offset:0,type:`text`}:{key:n,offset:e.index+1,type:`element`}}}}return{key:n,offset:r,type:`element`}}function DE(e){let{descriptors:t,paragraphKey:n,totalLength:r}=TE();if(e.key===n){let n=t[e.offset-1];return n?n.start+n.length:0}let i=t.find(t=>t.key===e.key);return i?i.start+Math.min(e.offset,i.length):r}function OE(e){if(e.type===`element`)return DE(e);let{descriptors:t,totalLength:n}=TE(),r=t.find(t=>t.key===e.key);return r?r.start+Math.min(e.offset,r.length):n}function kE(){let{descriptors:e}=TE(),t=[],n=``,r=``,i=()=>{n.length!==0&&(t.push({id:r,type:`text`,text:n}),n=``,r=``)};for(let a of e){if(a.type===`text`){n.length===0&&(r=a.key),n+=a.text;continue}if(a.type===`linebreak`){n.length===0&&(r=a.key),n+=`
16
+ `;continue}i();let e=a.node;t.push({id:e.getComposerId(),label:e.getLabel(),tokenKey:e.getTokenKey(),tokenKind:e.getTokenKind(),type:`token`})}return i(),lh(t)}function AE(e){return e.read(()=>{let e=U(),t=kE();return H(e)?{nodes:t,selection:{start:Math.min(OE(e.anchor),OE(e.focus)),end:Math.max(OE(e.anchor),OE(e.focus))}}:{nodes:t,selection:null}})}function jE(e,t){let n=_S();n.clear();let r=Px();n.append(r);for(let t of lh(e)){if(t.type===`token`){r.append(CE({composerId:t.id,label:t.label,tokenKey:t.tokenKey,tokenKind:t.tokenKind}));continue}let e=t.text.split(`
17
+ `);for(let[t,n]of e.entries())n.length>0&&r.append(fb(n)),t<e.length-1&&r.append(Jy())}if(wE(r.getLastChild())&&r.append(fb(``)),!t)return;let i=Pb(),a=EE(t.start),o=EE(t.end);i.anchor.set(a.key,a.offset,a.type),i.focus.set(o.key,o.offset,o.type),yS(i)}function ME(e,t,n,r=!1){e.update(()=>{jE(t,n)},r?{tag:Uy}:void 0)}function NE(e,t,n=!1){e.update(()=>{let e=Pb(),n=EE(t.start),r=EE(t.end);e.anchor.set(n.key,n.offset,n.type),e.focus.set(r.key,r.offset,r.type),yS(e)},n?{tag:Uy}:void 0)}function PE(e){return e.reduce((e,t)=>e+oh(t),0)}function FE(e){let{label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,trigger:o}=e,s=PE(n),[c,l]=r?[Math.min(r.start,r.end),Math.max(r.start,r.end)]:[s,s],u=o?.start??c;return{nodes:vh(n,u,o?.end??l,[ah({label:t,tokenKey:i,tokenKind:a})]),selection:{start:u+1,end:u+1}}}function IE(e){let{label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,triggerSpecs:o}=e;return fh(n,a).includes(i)?{nodes:lh(n),selection:r}:FE({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,trigger:Sh(n,r,o??[nh])})}function LE(e){let{item:t,nodes:n,selection:r,triggerSpecs:i}=e,a=t.tokenKind??(t.value?`skill`:void 0),o=t.tokenKey??t.value;if(!a||!o){let e=Sh(n,r,i??[nh]);return e?{nodes:lh(vh(n,e.start,e.end,[])),selection:{start:e.start,end:e.start}}:{nodes:lh(n),selection:r}}return IE({label:t.title,nodes:n,selection:r,tokenKey:o,tokenKind:a,triggerSpecs:i})}function RE(e){return e.map(e=>e.type===`text`?`text:${e.text}`:`token:${e.tokenKind}:${e.tokenKey}:${e.label}`).join(``)}function zE(e){let{nodes:t,selection:n,text:r}=e,i=PE(t),[a,o]=n?[Math.min(n.start,n.end),Math.max(n.start,n.end)]:[i,i],s=a+r.length;return{nodes:vh(t,a,o,[ih(r)]),selection:{start:s,end:s}}}function BE(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return FE({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`file`})}function VE(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return fh(n,`skill`).includes(i)?{nodes:lh(n),selection:r}:FE({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`skill`,trigger:Ch(n,r)})}function HE(e){let{nextKeys:t,nodes:n,options:r,selection:i}=e,a=fh(n,`skill`),o=new Map(r.map(e=>[e.key,e])),s=t.find(e=>!a.includes(e));if(s)return VE({label:o.get(s)?.label??s,nodes:n,selection:i,tokenKey:s});let c=a.find(e=>!t.includes(e));return c?{nodes:yh(n,e=>e.tokenKind===`skill`&&e.tokenKey===c),selection:i}:{nodes:lh(n),selection:i}}function UE(e){let{direction:t,nodes:n,selection:r}=e,i=PE(n),[a,o]=r?[Math.min(r.start,r.end),Math.max(r.start,r.end)]:[i,i],s=a,c=o;if(s===c)if(t===`backward`&&s>0)--s;else if(t===`forward`&&c<i)c+=1;else return{nodes:lh(n),selection:{start:s,end:c}};return{nodes:vh(n,s,c,[]),selection:{start:s,end:s}}}function WE(e){let{canStopGeneration:t,isComposing:n,isSending:r,key:i,shiftKey:a}=e;return i===`Escape`?r&&t?{type:`stop-generation`}:{type:`noop`}:i===`Enter`&&a?{type:`insert-line-break`}:i===`Enter`?{type:`send-message`}:!n&&(i===`Backspace`||i===`Delete`)?{type:`delete-content`,direction:i===`Backspace`?`backward`:`forward`}:{type:`noop`}}function GE(e){return JSON.stringify(e.map(e=>e.type===`text`?{text:e.text,type:e.type}:{label:e.label,tokenKey:e.tokenKey,tokenKind:e.tokenKind,type:e.type}))}function KE(e){let{disabled:t,event:n,isComposing:r,publishSnapshot:i,snapshotReader:a}=e,o=n.nativeEvent,s=o.inputType===`insertText`||o.inputType===`insertReplacementText`;t||r||o.isComposing||!s||!o.data||(n.preventDefault(),i(zE({nodes:a().nodes,selection:a().selection,text:o.data}),{inputSurfaceReason:{type:`insert-text`,text:o.data}}))}function qE(e){let{compositionStartSnapshot:t,data:n,fallbackSnapshot:r,publishSnapshot:i,snapshotReader:a}=e,o=a(),s=r(),c=t??o;i(GE(s.nodes)===GE(c.nodes)&&n.length>0?zE({nodes:c.nodes,selection:c.selection,text:n}):s,{forcePublish:!0,inputSurfaceReason:{type:`insert-text`,text:n}})}function JE(e){let{actions:t,nativeEvent:n,publishSnapshot:r,snapshot:i}=e,a=WE({canStopGeneration:t.canStopGeneration,isComposing:n.isComposing,isSending:t.isSending,key:n.key,shiftKey:n.shiftKey});switch(a.type!==`noop`&&n.preventDefault(),a.type){case`stop-generation`:return t.onStop(),!0;case`insert-line-break`:return r(zE({nodes:i.nodes,selection:i.selection,text:`
18
+ `}),{inputSurfaceReason:{type:`insert-text`,text:`
19
+ `}}),!0;case`send-message`:return t.onSend(),!0;case`delete-content`:return r(UE({direction:a.direction,nodes:i.nodes,selection:i.selection}),{inputSurfaceReason:{type:`delete-content`}}),!0;case`noop`:return!1}}function YE(e){return{current:e}}function XE(e){return e.reduce((e,t)=>e+(t.type===`text`?t.text.length:1),0)}var ZE=class{constructor(){this.isApplyingExternalUpdateRef=YE(!1),this.isComposingRef=YE(!1),this.pendingOwnerSignatureRef=YE(null),this.pendingSelectionRef=YE(null),this.selectionRef=YE(null),this.shouldFocusAfterSyncRef=YE(!1),this.compositionStartSnapshotRef=YE(null),this.editorSignatureRef=YE(``),this.lastPublishedSignatureRef=YE(``),this.pendingInputSurfaceReasonRef=YE(null),this.editor=null,this.runtime=null,this.configureRuntime=e=>{this.runtime=e},this.bindEditor=e=>(this.editor=e,()=>{this.editor===e&&(this.editor=null)}),this.registerEditorListeners=e=>vw(e.registerUpdateListener(({editorState:e})=>{let t=this.getRuntime();this.handleEditorUpdate(e,t.callbacks)}),e.registerCommand(vv,()=>{let t=this.getRuntime();return this.handleSelectionChange(e,t.callbacks),!1},0),e.registerCommand(ny,()=>(this.getRuntime().callbacks.onInputSurfaceOpenChange?.(!1),!1),0),e.registerCommand(Fv,e=>{let t=this.getRuntime();return this.handleKeyDown({actions:t.actions,callbacks:t.callbacks,event:e,fallbackNodes:t.fallbackNodes})},3)),this.syncExternalState=(e,t)=>{if(this.isComposingRef.current)return;let n=RE(t),r=this.pendingSelectionRef.current,i=this.pendingOwnerSignatureRef.current;if(i){if(n===i)this.pendingOwnerSignatureRef.current=null;else if(n!==this.editorSignatureRef.current)return}let a=n!==this.editorSignatureRef.current;if(!a&&!r)return;this.startApplyingExternalUpdate();let o=e.getRootElement()!==document.activeElement;if(a?(ME(e,t,r,o),this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n):r&&NE(e,r,o),r&&(this.selectionRef.current=r,this.pendingSelectionRef.current=null),this.shouldFocusAfterSyncRef.current){this.shouldFocusAfterSyncRef.current=!1;let t=this.selectionRef.current;e.focus(()=>{t&&NE(e,t)})}},this.publishSnapshot=(e,t,n)=>{this.selectionRef.current=e.selection,this.pendingSelectionRef.current=e.selection,n?.focusAfterSync&&(this.shouldFocusAfterSyncRef.current=!0);let r=RE(e.nodes),{editor:i}=this;this.pendingOwnerSignatureRef.current=r,i&&(this.startApplyingExternalUpdate(),ME(i,e.nodes,e.selection),this.editorSignatureRef.current=r),t.onInputSurfaceSnapshotChange?.(e.nodes,e.selection,n?.inputSurfaceReason??{type:`programmatic`}),(n?.forcePublish||r!==this.lastPublishedSignatureRef.current)&&(this.lastPublishedSignatureRef.current=r,t.onNodesChange(e.nodes))},this.focusComposer=()=>{let{editor:e}=this;if(!e)return;e.getRootElement()?.focus({preventScroll:!0});let t=this.selectionRef.current;t&&NE(e,t),e.focus()},this.focusComposerAtEnd=e=>{let{editor:t}=this;if(!t)return;let n=XE(e??AE(t.getEditorState()).nodes),r={start:n,end:n};if(this.selectionRef.current=r,this.pendingSelectionRef.current=r,t.getRootElement()?.focus({preventScroll:!0}),e){this.startApplyingExternalUpdate();let n=RE(e);ME(t,e,r),this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n}else NE(t,r);t.focus(()=>{NE(t,r)})},this.readComposerSnapshot=e=>{let{editor:t}=this;if(!t)return{nodes:e,selection:this.selectionRef.current};let n=AE(t.getEditorState());return this.selectionRef.current=n.selection,n},this.createHandle=()=>{let e=(e,t=[nh])=>{let{callbacks:n}=this.getRuntime();n.onInputSurfaceItemSelect?.(e),this.publishRuntimeSnapshot(n=>LE({item:e,nodes:n.nodes,selection:n.selection,triggerSpecs:t}),{focusAfterSync:!0})};return{insertInputSurfaceItem:e,insertSlashItem:t=>{e(t)},insertFileToken:(e,t)=>{this.publishRuntimeSnapshot(n=>BE({label:t,nodes:n.nodes,selection:n.selection,tokenKey:e}),{focusAfterSync:!0})},insertFileTokens:e=>{this.publishRuntimeSnapshot(t=>e.reduce((e,t)=>BE({label:t.label,nodes:e.nodes,selection:e.selection,tokenKey:t.tokenKey}),t),{focusAfterSync:!0})},focusComposer:this.focusComposer,focusComposerAtEnd:this.focusComposerAtEnd,syncSelectedSkills:(e,t)=>{this.publishRuntimeSnapshot(n=>HE({nextKeys:e,nodes:n.nodes,options:t,selection:n.selection}),{focusAfterSync:!0})}}},this.handleBeforeInput=e=>{let{disabled:t,event:n}=e,{callbacks:r,fallbackNodes:i}=this.getRuntime();KE({disabled:t,event:n,isComposing:this.isComposingRef.current,publishSnapshot:(e,t)=>this.publishSnapshot(e,r,t),snapshotReader:()=>this.readComposerSnapshot(i)})},this.handleCompositionStart=()=>{let{fallbackNodes:e}=this.getRuntime();this.compositionStartSnapshotRef.current=this.readComposerSnapshot(e),this.isComposingRef.current=!0},this.handleCompositionEnd=e=>{let{data:t}=e,{callbacks:n,fallbackNodes:r}=this.getRuntime();this.isComposingRef.current=!1,qE({compositionStartSnapshot:this.compositionStartSnapshotRef.current,data:t,fallbackSnapshot:()=>this.readComposerSnapshot(r),publishSnapshot:(e,t)=>this.publishSnapshot(e,n,t),snapshotReader:()=>this.readComposerSnapshot(r)}),this.compositionStartSnapshotRef.current=null},this.handleKeyDown=e=>{let{actions:t,callbacks:n,event:r,fallbackNodes:i}=e;r.key.length===1&&!r.isComposing&&!r.altKey&&!r.ctrlKey&&!r.metaKey&&(this.pendingInputSurfaceReasonRef.current={type:`insert-text`,text:r.key});let a=this.readComposerSnapshot(i);return n.onInputSurfaceKeyDown?.(r)?!0:JE({actions:t,nativeEvent:r,publishSnapshot:(e,t)=>this.publishSnapshot(e,n,t),snapshot:a})},this.handleEditorUpdate=(e,t)=>{let n=AE(e),r=RE(n.nodes);this.editorSignatureRef.current=r,!(this.isApplyingExternalUpdateRef.current||this.isComposingRef.current)&&(this.selectionRef.current=n.selection,t.onInputSurfaceSnapshotChange?.(n.nodes,n.selection,this.consumeInputSurfaceReason()??{type:`sync`}),r!==this.lastPublishedSignatureRef.current&&(this.lastPublishedSignatureRef.current=r,t.onNodesChange(n.nodes)))},this.handleSelectionChange=(e,t)=>{let n=AE(e.getEditorState());this.isComposingRef.current||(this.selectionRef.current=n.selection,t.onInputSurfaceSnapshotChange?.(n.nodes,n.selection,{type:`selection`}))},this.consumeInputSurfaceReason=()=>{let e=this.pendingInputSurfaceReasonRef.current;return this.pendingInputSurfaceReasonRef.current=null,e},this.publishRuntimeSnapshot=(e,t)=>{let{callbacks:n,fallbackNodes:r}=this.getRuntime();this.publishSnapshot(e(this.readComposerSnapshot(r)),n,t)},this.startApplyingExternalUpdate=()=>{this.isApplyingExternalUpdateRef.current=!0,requestAnimationFrame(()=>{this.isApplyingExternalUpdateRef.current=!1})},this.getRuntime=()=>{if(!this.runtime)throw Error(`ChatComposerLexicalOwner runtime has not been configured.`);return this.runtime}}};function QE({disabled:e,nodes:t,owner:n}){let[r]=Ng();return(0,P.useLayoutEffect)(()=>n.bindEditor(r),[r,n]),(0,P.useLayoutEffect)(()=>{r.setEditable(!e),n.syncExternalState(r,t)},[e,r,t,n]),(0,P.useEffect)(()=>n.registerEditorListeners(r),[r,n]),null}var $E=(0,P.forwardRef)(function({actions:e,disabled:t,nodes:n,onFilesAdd:r,onInputSurfaceItemSelect:i,onInputSurfaceKeyDown:a,onInputSurfaceOpenChange:o,onInputSurfaceSnapshotChange:s,onNodesChange:c,placeholder:l},u){let[d]=(0,P.useState)(()=>new ZE),f=(0,P.useMemo)(()=>({onInputSurfaceItemSelect:i,onInputSurfaceKeyDown:a,onInputSurfaceOpenChange:o,onInputSurfaceSnapshotChange:s,onNodesChange:c}),[i,a,o,s,c]);return d.configureRuntime({actions:e,callbacks:f,fallbackNodes:n}),(0,P.useImperativeHandle)(u,()=>d.createHandle(),[d]),(0,F.jsxs)(Gw,{initialConfig:(0,P.useMemo)(()=>({editable:!t,editorState:()=>{jE(n,null)},namespace:`NextClawChatComposerLexical`,nodes:[SE],onError:e=>{throw e},theme:{}}),[t,n]),children:[(0,F.jsx)(`div`,{className:`px-3 py-2 sm:px-4 sm:py-2.5`,children:(0,F.jsx)(`div`,{className:`min-h-11 sm:min-h-[60px]`,children:(0,F.jsx)(vE,{contentEditable:(0,F.jsx)(zw,{className:`min-h-7 max-h-[188px] w-full overflow-y-auto whitespace-pre-wrap break-words bg-transparent py-0.5 text-sm leading-6 text-foreground outline-none`,onBeforeInput:e=>{d.handleBeforeInput({disabled:t,event:e})},onCompositionEnd:e=>{let t=e.nativeEvent;d.handleCompositionEnd({data:typeof t.data==`string`?t.data:``})},onCompositionStart:()=>{d.handleCompositionStart()},onPaste:e=>{let t=Array.from(e.clipboardData.files??[]);t.length>0&&r&&(e.preventDefault(),r(t))}}),placeholder:(0,F.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-2 select-none text-sm leading-6 text-muted-foreground/60 sm:left-4 sm:top-2.5`,children:l}),ErrorBoundary:Xw})})}),(0,F.jsx)(QE,{disabled:t,nodes:n,owner:d})]})});$E.displayName=`LexicalChatInputBarTokenizedComposer`;var eD=120;function tD(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=eD?t:`${t.slice(0,eD-1)}…`}function nD({hint:e}){return e?e.loading?(0,F.jsx)(`div`,{className:`px-4 pb-2`,children:(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`h-3 w-28 animate-pulse rounded bg-muted-foreground/20`}),(0,F.jsx)(`span`,{className:`h-3 w-16 animate-pulse rounded bg-muted-foreground/20`})]})}):(0,F.jsx)(`div`,{className:`px-4 pb-2`,children:(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg px-3 py-1.5 text-xs ${e.tone===`warning`?`border-amber-200 bg-amber-50 text-amber-800`:`border-border bg-muted text-muted-foreground`}`,children:[e.text?(0,F.jsx)(`span`,{children:e.text}):null,e.actionLabel&&e.onAction?(0,F.jsx)(`button`,{type:`button`,onClick:e.onAction,className:`font-semibold underline-offset-2 hover:underline`,children:e.actionLabel}):null]})}):null}function rD({sendError:e,sendErrorDetailsLabel:t}){let n=e?.trim()??``;if(!n)return null;let{Popover:r,PopoverContent:i,PopoverTrigger:a}=Qh,o=tD(n),s=t?.trim()||`Details`;return(0,F.jsx)(`div`,{className:`px-3 pb-2 sm:px-4`,children:(0,F.jsxs)(`div`,{"aria-live":`polite`,className:`flex min-w-0 items-start justify-between gap-3 rounded-lg border border-red-200/80 bg-red-50/80 px-3 py-2 text-xs text-red-700`,role:`status`,children:[(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate leading-5`,title:n,children:o}),(0,F.jsxs)(r,{children:[(0,F.jsx)(a,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`inline-flex h-7 shrink-0 items-center rounded-md border border-red-200/80 bg-background px-2 text-xs font-medium text-red-700 transition-colors hover:bg-red-100`,children:s})}),(0,F.jsxs)(i,{align:`end`,className:`w-[min(32rem,calc(100vw-1.5rem))] border-red-100/80 p-0`,children:[(0,F.jsx)(`div`,{className:`border-b border-red-100 bg-red-50/80 px-4 py-2 text-xs font-semibold text-red-700`,children:s}),(0,F.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words px-4 py-3 text-xs leading-relaxed text-red-700`,children:n})]})]})]})})}var iD=(0,P.forwardRef)(function({composer:e,hint:t,inputSurface:n,sendError:r,sendErrorDetailsLabel:i,slashMenu:a,surface:o,toolbar:s,topSlot:c},l){let u=(0,P.useRef)(null),d=n??(a?{isLoading:a.isLoading,filterOptions:a.filterOptions,items:a.items,onSelectItem:a.onSelectItem,texts:{loadingLabel:a.texts.slashLoadingLabel,sectionLabel:a.texts.slashSectionLabel,emptyLabel:a.texts.slashEmptyLabel,hintLabel:a.texts.slashHintLabel,itemHintLabel:a.texts.slashSkillHintLabel}}:null),f=(0,P.useMemo)(()=>s.skillPicker?{...s,skillPicker:{...s.skillPicker,onSelectedKeysChange:e=>{u.current?.syncSelectedSkills(e,s.skillPicker?.options??[]),s.skillPicker?.onSelectedKeysChange(e)}}}:s,[s]);return(0,P.useImperativeHandle)(l,()=>({insertFileToken:(e,t)=>u.current?.insertFileToken(e,t),insertFileTokens:e=>u.current?.insertFileTokens(e),focusComposer:()=>u.current?.focusComposer(),focusComposerAtEnd:e=>u.current?.focusComposerAtEnd(e)}),[]),(0,F.jsx)(`div`,{className:o===`embedded`?`bg-transparent px-0 py-0`:`bg-background px-3 pb-3 pt-2 sm:px-4 sm:pb-4 sm:pt-2`,children:(0,F.jsx)(`div`,{className:`nextclaw-chat-input-bar-shell mx-auto w-full max-w-[min(1120px,100%)] [container:nextclaw-chat-input-bar/inline-size]`,children:(0,F.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-card shadow-card`,children:[c?(0,F.jsx)(`div`,{className:`px-3 pb-0 pt-2 sm:px-4 sm:pt-2.5`,children:c}):null,(0,F.jsx)(`div`,{className:`relative`,children:(0,F.jsx)(lg,{inputSurface:d,onInputSurfaceTriggerChange:e.onInputSurfaceTriggerChange,onSelectItem:t=>u.current?.insertInputSurfaceItem(t,e.inputSurfaceTriggerSpecs),triggerSpecs:e.inputSurfaceTriggerSpecs,children:({onInputSurfaceKeyDown:t,onInputSurfaceOpenChange:n,onInputSurfaceSnapshotChange:r})=>(0,F.jsx)($E,{ref:u,nodes:e.nodes,placeholder:e.placeholder,disabled:e.disabled,onInputSurfaceItemSelect:d?.onSelectItem,actions:s.actions,onNodesChange:e.onNodesChange,onFilesAdd:e.onFilesAdd,onInputSurfaceSnapshotChange:r,onInputSurfaceOpenChange:n,onInputSurfaceKeyDown:t})})}),(0,F.jsx)(nD,{hint:t}),(0,F.jsx)(rD,{sendError:r,sendErrorDetailsLabel:i}),(0,F.jsx)(Ag,{...f})]})})})});iD.displayName=`ChatInputBar`;function aD({role:e,size:t=`default`}){let n=t===`compact`,r=n?`h-7 w-7`:`h-8 w-8`,i=n?`h-3.5 w-3.5`:`h-4 w-4`;return e===`user`?(0,F.jsx)(`div`,{"data-testid":`chat-message-avatar-user`,className:R(`flex shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm`,r),children:(0,F.jsx)(us,{className:i})}):e===`tool`?(0,F.jsx)(`div`,{"data-testid":`chat-message-avatar-tool`,className:R(`flex shrink-0 items-center justify-center rounded-full bg-accent text-accent-foreground shadow-sm ring-1 ring-border`,r),children:(0,F.jsx)(ps,{className:i})}):(0,F.jsx)(`div`,{"data-testid":`chat-message-avatar-assistant`,className:R(`flex shrink-0 items-center justify-center rounded-full bg-muted text-foreground shadow-sm ring-1 ring-border`,r),children:(0,F.jsx)(Ya,{className:R(n?`h-4 w-4`:`h-[18px] w-[18px]`,`text-current`),strokeWidth:2.5})})}function oD(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var sD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lD={};function uD(e,t){return((t||lD).jsx?cD:sD).test(e)}var dD=/[ \t\n\f\r]/g;function fD(e){return typeof e==`object`?e.type===`text`?pD(e.value):!1:pD(e)}function pD(e){return e.replace(dD,``)===``}var mD=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};mD.prototype.normal={},mD.prototype.property={},mD.prototype.space=void 0;function hD(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new mD(n,r,t)}function gD(e){return e.toLowerCase()}var _D=class{constructor(e,t){this.attribute=t,this.property=e}};_D.prototype.attribute=``,_D.prototype.booleanish=!1,_D.prototype.boolean=!1,_D.prototype.commaOrSpaceSeparated=!1,_D.prototype.commaSeparated=!1,_D.prototype.defined=!1,_D.prototype.mustUseProperty=!1,_D.prototype.number=!1,_D.prototype.overloadedBoolean=!1,_D.prototype.property=``,_D.prototype.spaceSeparated=!1,_D.prototype.space=void 0;var vD=t({boolean:()=>J,booleanish:()=>bD,commaOrSpaceSeparated:()=>wD,commaSeparated:()=>CD,number:()=>Y,overloadedBoolean:()=>xD,spaceSeparated:()=>SD}),yD=0,J=TD(),bD=TD(),xD=TD(),Y=TD(),SD=TD(),CD=TD(),wD=TD();function TD(){return 2**++yD}var ED=Object.keys(vD),DD=class extends _D{constructor(e,t,n,r){let i=-1;if(super(e,t),OD(this,`space`,r),typeof n==`number`)for(;++i<ED.length;){let e=ED[i];OD(this,ED[i],(n&vD[e])===vD[e])}}};DD.prototype.defined=!0;function OD(e,t,n){n&&(e[t]=n)}function kD(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new DD(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[gD(r)]=r,n[gD(a.attribute)]=r}return new mD(t,n,e.space)}var AD=kD({properties:{ariaActiveDescendant:null,ariaAtomic:bD,ariaAutoComplete:null,ariaBusy:bD,ariaChecked:bD,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:SD,ariaCurrent:null,ariaDescribedBy:SD,ariaDetails:null,ariaDisabled:bD,ariaDropEffect:SD,ariaErrorMessage:null,ariaExpanded:bD,ariaFlowTo:SD,ariaGrabbed:bD,ariaHasPopup:null,ariaHidden:bD,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:SD,ariaLevel:Y,ariaLive:null,ariaModal:bD,ariaMultiLine:bD,ariaMultiSelectable:bD,ariaOrientation:null,ariaOwns:SD,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:bD,ariaReadOnly:bD,ariaRelevant:null,ariaRequired:bD,ariaRoleDescription:SD,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:bD,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function jD(e,t){return t in e?e[t]:t}function MD(e,t){return jD(e,t.toLowerCase())}var ND=kD({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:CD,acceptCharset:SD,accessKey:SD,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:SD,autoFocus:J,autoPlay:J,blocking:SD,capture:null,charSet:null,checked:J,cite:null,className:SD,cols:Y,colSpan:null,content:null,contentEditable:bD,controls:J,controlsList:SD,coords:Y|CD,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:xD,draggable:bD,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:SD,height:Y,hidden:xD,high:Y,href:null,hrefLang:null,htmlFor:SD,httpEquiv:SD,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:SD,itemRef:SD,itemScope:J,itemType:SD,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,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:J,optimum:Y,pattern:null,ping:SD,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:SD,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:SD,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:bD,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:bD,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:SD,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:bD,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:J,disableRemotePlayback:J,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:MD}),PD=kD({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:wD,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:SD,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:CD,g2:CD,glyphName:CD,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:wD,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:SD,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wD,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wD,rev:wD,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wD,requiredFeatures:wD,requiredFonts:wD,requiredFormats:wD,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:wD,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wD,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wD,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:jD}),FD=kD({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()}}),ID=kD({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:MD}),LD=kD({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),RD={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},zD=/[A-Z]/g,BD=/-[a-z]/g,VD=/^data[-\w.:]+$/i;function HD(e,t){let n=gD(t),r=t,i=_D;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&VD.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(BD,WD);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!BD.test(e)){let n=e.replace(zD,UD);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=DD}return new i(r,t)}function UD(e){return`-`+e.toLowerCase()}function WD(e){return e.charAt(1).toUpperCase()}var GD=hD([AD,ND,FD,ID,LD],`html`),KD=hD([AD,PD,FD,ID,LD],`svg`);function qD(e){return e.join(` `).trim()}var JD=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
20
+ `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),YD=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(JD());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),XD=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ZD=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(YD()),r=XD();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),QD=eO(`end`),$D=eO(`start`);function eO(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function tO(e){let t=$D(e),n=QD(e);if(t&&n)return{start:t,end:n}}function nO(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?iO(e.position):`start`in e||`end`in e?iO(e):`line`in e||`column`in e?rO(e):``}function rO(e){return aO(e&&e.line)+`:`+aO(e&&e.column)}function iO(e){return rO(e&&e.start)+`-`+rO(e&&e.end)}function aO(e){return e&&typeof e==`number`?e:1}var oO=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=nO(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};oO.prototype.file=``,oO.prototype.name=``,oO.prototype.reason=``,oO.prototype.message=``,oO.prototype.stack=``,oO.prototype.column=void 0,oO.prototype.line=void 0,oO.prototype.ancestors=void 0,oO.prototype.cause=void 0,oO.prototype.fatal=void 0,oO.prototype.place=void 0,oO.prototype.ruleId=void 0,oO.prototype.source=void 0;var sO=e(ZD(),1),cO={}.hasOwnProperty,lO=new Map,uO=/[A-Z]/g,dO=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),fO=new Set([`td`,`th`]),pO=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function mO(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=TO(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=wO(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?KD:GD,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=hO(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function hO(e,t,n){if(t.type===`element`)return gO(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return _O(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return yO(e,t,n);if(t.type===`mdxjsEsm`)return vO(e,t);if(t.type===`root`)return bO(e,t,n);if(t.type===`text`)return xO(e,t)}function gO(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=KD,e.schema=i),e.ancestors.push(t);let a=jO(e,t.tagName,!1),o=EO(e,t),s=OO(e,t);return dO.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!fD(e):!0})),SO(e,o,a,t),CO(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function _O(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}MO(e,t.position)}function vO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);MO(e,t.position)}function yO(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=KD,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:jO(e,t.name,!0),o=DO(e,t),s=OO(e,t);return SO(e,o,a,t),CO(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function bO(e,t,n){let r={};return CO(r,OO(e,t)),e.create(t,e.Fragment,r,n)}function xO(e,t){return t.value}function SO(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function CO(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function wO(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function TO(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=$D(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function EO(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&cO.call(t.properties,i)){let a=kO(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&fO.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function DO(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else MO(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else MO(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function OO(e,t){let n=[],r=-1,i=e.passKeys?new Map:lO;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=hO(e,a,o);s!==void 0&&n.push(s)}return n}function kO(e,t,n){let r=HD(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?oD(n):qD(n)),r.property===`style`){let t=typeof n==`object`?n:AO(e,String(n));return e.stylePropertyNameCase===`css`&&(t=NO(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?RD[r.property]||r.property:r.attribute,n]}}function AO(e,t){try{return(0,sO.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new oO("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=pO+`#cannot-parse-style-attribute`,r}}function jO(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=uD(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=uD(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return cO.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);MO(e)}function MO(e,t){let n=new oO("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=pO+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function NO(e){let t={},n;for(n in e)cO.call(e,n)&&(t[PO(n)]=e[n]);return t}function PO(e){let t=e.replace(uO,FO);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function FO(e){return`-`+e.toLowerCase()}var IO={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},LO={};function RO(e,t){let n=t||LO;return zO(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function zO(e,t,n){if(VO(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return BO(e.children,t,n)}return Array.isArray(e)?BO(e,t,n):``}function BO(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=zO(e[i],t,n);return r.join(``)}function VO(e){return!!(e&&typeof e==`object`)}var HO=document.createElement(`i`);function UO(e){let t=`&`+e+`;`;HO.innerHTML=t;let n=HO.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function WO(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function GO(e,t){return e.length>0?(WO(e,e.length,0,t),e):t}var KO={}.hasOwnProperty;function qO(e){let t={},n=-1;for(;++n<e.length;)JO(t,e[n]);return t}function JO(e,t){let n;for(n in t){let r=(KO.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){KO.call(r,a)||(r[a]=[]);let e=i[a];YO(r[a],Array.isArray(e)?e:e?[e]:[])}}}function YO(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);WO(e,0,0,r)}function XO(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function ZO(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var QO=ck(/[A-Za-z]/),$O=ck(/[\dA-Za-z]/),ek=ck(/[#-'*+\--9=?A-Z^-~]/);function tk(e){return e!==null&&(e<32||e===127)}var nk=ck(/\d/),rk=ck(/[\dA-Fa-f]/),ik=ck(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function ak(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var ok=ck(/\p{P}|\p{S}/u),sk=ck(/\s/);function ck(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function lk(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&$O(e.charCodeAt(n+1))&&$O(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var uk={tokenize:dk};function dk(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return X(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var fk={tokenize:mk},pk={tokenize:hk};function mk(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return WO(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pk,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(pk,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return X(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;WO(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hk(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function gk(e){if(e===null||ak(e)||sk(e))return 1;if(ok(e))return 2}function _k(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var vk={name:`attention`,resolveAll:yk,tokenize:bk};function yk(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};xk(d,-c),xk(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=GO(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=GO(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=GO(l,_k(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=GO(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=GO(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,WO(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function bk(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=gk(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=gk(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function xk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Sk={name:`autolink`,tokenize:Ck};function Ck(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return QO(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||$O(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||$O(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||tk(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):ek(t)?(e.consume(t),l):n(t)}function u(e){return $O(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||$O(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var wk={partial:!0,tokenize:Tk};function Tk(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||X(e)?t(e):n(e)}}var Ek={continuation:{tokenize:Ok},exit:kk,name:`blockQuote`,tokenize:Dk};function Dk(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ok(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ek,t,n)(r)}}function kk(e){e.exit(`blockQuote`)}var Ak={name:`characterEscape`,tokenize:jk};function jk(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ik(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Mk={name:`characterReference`,tokenize:Nk};function Nk(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=$O,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=rk,u):(e.enter(`characterReferenceValue`),a=7,o=nk,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===$O&&!UO(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Pk={partial:!0,tokenize:Lk},Fk={concrete:!0,name:`codeFenced`,tokenize:Ik};function Ik(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||X(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Pk,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||X(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||X(t)?e.check(Pk,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||X(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||X(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Lk(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Rk={name:`codeIndented`,tokenize:Bk},zk={partial:!0,tokenize:Vk};function Bk(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):X(t)?e.attempt(zk,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||X(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Vk(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):X(e)?i(e):n(e)}}var Hk={name:`codeText`,previous:Wk,resolve:Uk,tokenize:Gk};function Uk(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Wk(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Gk(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||X(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Kk=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&qk(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),qk(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qk(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);qk(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);qk(this.left,t.reverse())}}};function qk(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Jk(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Kk(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Yk(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return WO(e,0,1/0,u.slice(0)),!l}function Yk(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Xk={resolve:Qk,tokenize:$k},Zk={partial:!0,tokenize:eA};function Qk(e){return Jk(e),e}function $k(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):X(t)?e.check(Zk,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function eA(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||X(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function tA(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||tk(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||X(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||ak(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||tk(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function nA(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):X(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||X(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function rA(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||X(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function iA(e,t){let n;return r;function r(i){return X(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var aA={name:`definition`,tokenize:sA},oA={partial:!0,tokenize:cA};function sA(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return nA.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ZO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return ak(t)?iA(e,l)(t):l(t)}function l(t){return tA(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(oA,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||X(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function cA(e,t,n){return r;function r(t){return ak(t)?iA(e,i)(t):n(t)}function i(t){return rA(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||X(e)?t(e):n(e)}}var lA={name:`hardBreakEscape`,tokenize:uA};function uA(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return X(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var dA={name:`headingAtx`,resolve:fA,tokenize:pA};function fA(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},WO(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function pA(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||ak(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||X(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||ak(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var mA=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),hA=[`pre`,`script`,`style`,`textarea`],gA={concrete:!0,name:`htmlFlow`,resolveTo:yA,tokenize:bA},_A={partial:!0,tokenize:SA},vA={partial:!0,tokenize:xA};function yA(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function bA(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:re):QO(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):QO(a)?(e.consume(a),i=4,r.interrupt?t:re):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:re):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return QO(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||ak(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&hA.includes(l)?(i=1,r.interrupt?t(s):O(s)):mA.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||$O(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||QO(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||$O(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||X(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||ak(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||X(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),te):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),re):t===93&&i===5?(e.consume(t),ne):X(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(_A,ae,k)(t)):t===null||X(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(vA,A,ae)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||X(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),re):O(t)}function te(t){return t===47?(e.consume(t),o=``,M):O(t)}function M(t){if(t===62){let n=o.toLowerCase();return hA.includes(n)?(e.consume(t),ie):O(t)}return QO(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):O(t)}function ne(t){return t===93?(e.consume(t),re):O(t)}function re(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),re):O(t)}function ie(t){return t===null||X(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function xA(e,t,n){let r=this;return i;function i(t){return X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function SA(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(wk,t,n)}}var CA={name:`htmlText`,tokenize:wA};function wA(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):QO(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):QO(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):X(t)?(o=d,te(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):X(t)?(o=h,te(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):X(t)?(o=v,te(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):X(t)?(o=y,te(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return QO(t)?(e.consume(t),S):n(t)}function S(t){return t===45||$O(t)?(e.consume(t),S):C(t)}function C(t){return X(t)?(o=C,te(t)):Z(t)?(e.consume(t),C):j(t)}function w(t){return t===45||$O(t)?(e.consume(t),w):t===47||t===62||ak(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||QO(t)?(e.consume(t),E):X(t)?(o=T,te(t)):Z(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||$O(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):X(t)?(o=D,te(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):X(t)?(o=O,te(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):X(t)?(o=k,te(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||ak(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||ak(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function te(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),M}function M(t){return Z(t)?Q(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var TA={name:`labelEnd`,resolveAll:kA,resolveTo:AA,tokenize:jA},EA={tokenize:MA},DA={tokenize:NA},OA={tokenize:PA};function kA(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&WO(e,0,e.length,n),e}function AA(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=GO(s,e.slice(a+1,a+r+3)),s=GO(s,[[`enter`,u,t]]),s=GO(s,_k(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=GO(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=GO(s,e.slice(o+1)),s=GO(s,[[`exit`,c,t]]),WO(e,a,e.length,s),e}function jA(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(ZO(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(EA,u,o?u:d)(t):t===91?e.attempt(DA,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(OA,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function MA(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return ak(t)?iA(e,a)(t):a(t)}function a(t){return t===41?u(t):tA(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return ak(t)?iA(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?rA(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return ak(t)?iA(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function NA(e,t,n){let r=this;return i;function i(t){return nA.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ZO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function PA(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var FA={name:`labelStartImage`,resolveAll:TA.resolveAll,tokenize:IA};function IA(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var LA={name:`labelStartLink`,resolveAll:TA.resolveAll,tokenize:RA};function RA(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var zA={name:`lineEnding`,tokenize:BA};function BA(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var VA={name:`thematicBreak`,tokenize:HA};function HA(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||X(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var UA={continuation:{tokenize:qA},exit:YA,name:`list`,tokenize:KA},WA={partial:!0,tokenize:XA},GA={partial:!0,tokenize:JA};function KA(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:nk(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(VA,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return nk(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(wk,r.interrupt?n:u,e.attempt(WA,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function qA(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(wk,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(GA,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(UA,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function JA(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function YA(e){e.exit(this.containerState.type)}function XA(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ZA={name:`setextUnderline`,resolveTo:QA,tokenize:$A};function QA(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function $A(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||X(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ej={tokenize:tj};function tj(e){let t=this,n=e.attempt(wk,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Xk,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var nj={resolveAll:oj()},rj=aj(`string`),ij=aj(`text`);function aj(e){return{resolveAll:oj(e===`text`?sj:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function oj(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function sj(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var cj=t({attentionMarkers:()=>gj,contentInitial:()=>uj,disable:()=>_j,document:()=>lj,flow:()=>fj,flowInitial:()=>dj,insideSpan:()=>hj,string:()=>pj,text:()=>mj}),lj={42:UA,43:UA,45:UA,48:UA,49:UA,50:UA,51:UA,52:UA,53:UA,54:UA,55:UA,56:UA,57:UA,62:Ek},uj={91:aA},dj={[-2]:Rk,[-1]:Rk,32:Rk},fj={35:dA,42:VA,45:[ZA,VA],60:gA,61:ZA,95:VA,96:Fk,126:Fk},pj={38:Mk,92:Ak},mj={[-5]:zA,[-4]:zA,[-3]:zA,33:FA,38:Mk,42:vk,60:[Sk,CA],91:LA,92:[lA,Ak],93:TA,95:vk,96:Hk},hj={null:[vk,nj]},gj={null:[42,95]},_j={null:[]};function vj(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=GO(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=_k(a,l.events,l),l.events):[]}function f(e,t){return bj(p(e),t)}function p(e){return yj(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){X(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&WO(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function yj(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function bj(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
21
+ `;break;case-3:o=`\r
22
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function xj(e){let t={constructs:qO([cj,...(e||{}).extensions||[]]),content:n(uk),defined:[],document:n(fk),flow:n(ej),lazy:{},string:n(rj),text:n(ij)};return t;function n(e){return n;function n(n){return vj(t,e,n)}}}function Sj(e){for(;!Jk(e););return e}var Cj=/[\0\t\n\r]/g;function wj(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Cj.lastIndex=u,c=Cj.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Tj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ej(e){return e.replace(Tj,Dj)}function Dj(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return XO(n.slice(t?2:1),t?16:10)}return UO(n)||e}var Oj={}.hasOwnProperty;function kj(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Aj(n)(Sj(xj(n).document().write(wj()(e,t,!0))))}function Aj(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ve),blockQuote:a(pe),characterEscape:T,characterReference:T,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:T,htmlText:a(be,o),htmlTextData:T,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(te),label:ne,labelText:M,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:re,resourceTitleString:ie,resource:ae,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Mj(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Oj.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Pj).call(a,void 0,e[0])}for(r.position={start:jj(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:jj(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:jj(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Pj).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+nO({start:e.start,end:e.end})+`): it’s not open`);n.position.end=jj(e.end)}function u(){return RO(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ZO(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=De(),n.position={start:jj(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=jj(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=jj(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ej(t),n.identifier=ZO(t).toLowerCase()}function ne(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ZO(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=XO(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=UO(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=jj(e.end)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[]}}function me(){return{type:`code`,lang:null,meta:null,value:``}}function he(){return{type:`inlineCode`,value:``}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function _e(){return{type:`emphasis`,children:[]}}function ve(){return{type:`heading`,depth:0,children:[]}}function ye(){return{type:`break`}}function be(){return{type:`html`,value:``}}function xe(){return{type:`image`,title:null,url:``,alt:null}}function Se(){return{type:`link`,title:null,url:``,children:[]}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Te(){return{type:`paragraph`,children:[]}}function Ee(){return{type:`strong`,children:[]}}function De(){return{type:`text`,value:``}}function Oe(){return{type:`thematicBreak`}}}function jj(e){return{line:e.line,column:e.column,offset:e.offset}}function Mj(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Mj(e,r):Nj(e,r)}}function Nj(e,t){let n;for(n in t)if(Oj.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Pj(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+nO({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nO({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+nO({start:t.start,end:t.end})+`) is still open`)}function Fj(e){let t=this;t.parser=n;function n(n){return kj(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Ij(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Lj(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
23
+ `}]}function Rj(e,t){let n=t.value?t.value+`
24
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function zj(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bj(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vj(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=lk(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Hj(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uj(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wj(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Gj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wj(e,t);let i={src:lk(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Kj(e,t){let n={src:lk(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function qj(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Jj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wj(e,t);let i={href:lk(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Yj(e,t){let n={href:lk(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Xj(e,t,n){let r=e.all(t),i=n?Zj(n):Qj(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
25
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
26
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Zj(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Qj(n[r])}return t}function Qj(e){return e.spread??e.children.length>1}function $j(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function eM(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tM(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nM(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rM(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=$D(t.children[1]),o=QD(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function iM(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function aM(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var oM=9,sM=32;function cM(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(lM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(lM(t.slice(i),i>0,!1)),a.join(``)}function lM(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===oM||t===sM;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===oM||t===sM;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function uM(e,t){let n={type:`text`,value:cM(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dM(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var fM={blockquote:Ij,break:Lj,code:Rj,delete:zj,emphasis:Bj,footnoteReference:Vj,heading:Hj,html:Uj,imageReference:Gj,image:Kj,inlineCode:qj,linkReference:Jj,link:Yj,listItem:Xj,list:$j,paragraph:eM,root:tM,strong:nM,table:rM,tableCell:aM,tableRow:iM,text:uM,thematicBreak:dM,toml:pM,yaml:pM,definition:pM,footnoteDefinition:pM};function pM(){}var mM=typeof self==`object`?self:globalThis,hM=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new mM[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new mM[a](o),i)};return r},gM=e=>hM(new Map,e)(0),_M=``,{toString:vM}={},{keys:yM}=Object,bM=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=vM.call(e).slice(8,-1);switch(n){case`Array`:return[1,_M];case`Object`:return[2,_M];case`Date`:return[3,_M];case`RegExp`:return[4,_M];case`Map`:return[5,_M];case`Set`:return[6,_M];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},xM=([e,t])=>e===0&&(t===`function`||t===`symbol`),SM=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=bM(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of yM(r))(e||!xM(bM(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(xM(bM(n))||xM(bM(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!xM(bM(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},CM=(e,{json:t,lossy:n}={})=>{let r=[];return SM(!(t||n),!!t,new Map,r)(e),r},wM=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?gM(CM(e,t)):structuredClone(e):(e,t)=>gM(CM(e,t));function TM(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function EM(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function DM(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||TM,r=e.options.footnoteBackLabel||EM,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=lk(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...wM(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
27
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
28
+ `}]}}var OM=(function(e){if(e==null)return NM;if(typeof e==`function`)return MM(e);if(typeof e==`object`)return Array.isArray(e)?kM(e):AM(e);if(typeof e==`string`)return jM(e);throw Error(`Expected function, string, or object as test`)});function kM(e){let t=[],n=-1;for(;++n<e.length;)t[n]=OM(e[n]);return MM(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function AM(e){let t=e;return MM(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function jM(e){return MM(t);function t(t){return t&&t.type===e}}function MM(e){return t;function t(t,n,r){return!!(PM(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function NM(){return!0}function PM(e){return typeof e==`object`&&!!e&&`type`in e}function FM(e){return e}var IM=[];function LM(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=OM(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+FM(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=IM,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=RM(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function RM(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?IM:[e]}function zM(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),LM(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var BM={}.hasOwnProperty,VM={};function HM(e,t){let n=t||VM,r=new Map,i=new Map,a={all:s,applyData:WM,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...fM,...n.handlers},one:o,options:n,patch:UM,wrap:KM};return zM(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(BM.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=wM(n);return r.children=a.all(e),r}return wM(e)}return(a.options.unknownHandler||GM)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=qM(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=qM(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function UM(e,t){e.position&&(t.position=tO(e))}function WM(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,wM(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function GM(e,t){let n=t.data||{},r=`value`in t&&!(BM.call(n,`hProperties`)||BM.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KM(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
29
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
30
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
31
+ `}),n}function qM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function JM(e,t){let n=HM(e,t),r=n.one(e,void 0),i=DM(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
32
+ `},i)),a}function YM(e,t){return e&&`run`in e?async function(n,r){let i=JM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return JM(n,{file:r,...e||t})}}function XM(e){if(e)throw e}var ZM=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function QM(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $M(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?eN(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function eN(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var tN={basename:nN,dirname:rN,extname:iN,join:aN,sep:`/`};function nN(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);cN(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function rN(e){if(cN(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function iN(e){cN(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function aN(...e){let t=-1,n;for(;++t<e.length;)cN(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:oN(n)}function oN(e){cN(e);let t=e.codePointAt(0)===47,n=sN(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function sN(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function cN(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var lN={cwd:uN};function uN(){return`/`}function dN(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function fN(e){if(typeof e==`string`)e=new URL(e);else if(!dN(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return pN(e)}function pN(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var mN=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],hN=class{constructor(e){let t;t=e?dN(e)?{path:e}:typeof e==`string`||yN(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:lN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<mN.length;){let e=mN[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)mN.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?tN.basename(this.path):void 0}set basename(e){_N(e,`basename`),gN(e,`basename`),this.path=tN.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?tN.dirname(this.path):void 0}set dirname(e){vN(this.basename,`dirname`),this.path=tN.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?tN.extname(this.path):void 0}set extname(e){if(gN(e,`extname`),vN(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=tN.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){dN(e)&&(e=fN(e)),_N(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?tN.basename(this.path,this.extname):void 0}set stem(e){_N(e,`stem`),gN(e,`stem`),this.path=tN.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new oO(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function gN(e,t){if(e&&e.includes(tN.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+tN.sep+"`")}function _N(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function vN(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function yN(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var bN=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),xN=e(ZM(),1),SN={}.hasOwnProperty,CN=new class e extends bN{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$M()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,xN.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(EN(`data`,this.frozen),this.namespace[e]=t,this):SN.call(this.namespace,e)&&this.namespace[e]||void 0:e?(EN(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=kN(e),n=this.parser||this.Parser;return wN(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),wN(`process`,this.parser||this.Parser),TN(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=kN(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);jN(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),wN(`processSync`,this.parser||this.Parser),TN(`processSync`,this.compiler||this.Compiler),this.process(e,r),ON(`processSync`,`process`,t),n;function r(e,r){t=!0,XM(e),n=r}}run(e,t,n){DN(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=kN(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),ON(`runSync`,`run`,n),r;function i(e,t){XM(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=kN(t),r=this.compiler||this.Compiler;return TN(`stringify`,r),DN(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(EN(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,xN.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];QM(o)&&QM(r)&&(r=(0,xN.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function wN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function TN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function EN(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function DN(e){if(!QM(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ON(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function kN(e){return AN(e)?e:new hN(e)}function AN(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function jN(e){return typeof e==`string`||MN(e)}function MN(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var NN=[],PN={allowDangerousHtml:!0},FN=/^(https?|ircs?|mailto|xmpp)$/i,IN=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function LN(e){let t=RN(e),n=zN(e);return BN(t.runSync(t.parse(n),n),e)}function RN(e){let t=e.rehypePlugins||NN,n=e.remarkPlugins||NN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...PN}:PN;return CN().use(Fj).use(n).use(YM,r).use(t)}function zN(e){let t=e.children||``,n=new hN;return typeof t==`string`?n.value=t:``+t,n}function BN(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||VN;for(let e of IN)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return zM(e,l),mO(e,{Fragment:F.Fragment,components:i,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in IO)if(Object.hasOwn(IO,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=IO[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function VN(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||FN.test(e.slice(0,t))?e:``}function HN(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function UN(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function WN(e,t,n){let r=OM((n||{}).ignore||[]),i=GN(t),a=-1;for(;++a<i.length;)LM(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function GN(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([KN(e[0]),qN(e[1])])}return t}function KN(e){return typeof e==`string`?new RegExp(UN(e),`g`):e}function qN(e){return typeof e==`function`?e:function(){return e}}var JN=`phrasing`,YN=[`autolink`,`link`,`image`,`label`];function XN(){return{transforms:[iP],enter:{literalAutolink:QN,literalAutolinkEmail:$N,literalAutolinkHttp:$N,literalAutolinkWww:$N},exit:{literalAutolink:rP,literalAutolinkEmail:nP,literalAutolinkHttp:eP,literalAutolinkWww:tP}}}function ZN(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:JN,notInConstruct:YN},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:JN,notInConstruct:YN},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:JN,notInConstruct:YN}]}}function QN(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function $N(e){this.config.enter.autolinkProtocol.call(this,e)}function eP(e){this.config.exit.autolinkProtocol.call(this,e)}function tP(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function nP(e){this.config.exit.autolinkEmail.call(this,e)}function rP(e){this.exit(e)}function iP(e){WN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aP],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,oP]],{ignore:[`link`,`linkReference`]})}function aP(e,t,n,r,i){let a=``;if(!lP(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!sP(n)))return!1;let o=cP(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function oP(e,t,n,r){return!lP(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function sP(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function cP(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=HN(e,`(`),a=HN(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function lP(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||sk(n)||ok(n))&&(!t||n!==47)}yP.peek=vP;function uP(){this.buffer()}function dP(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function fP(){this.buffer()}function pP(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function mP(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ZO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hP(e){this.exit(e)}function gP(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ZO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _P(e){this.exit(e)}function vP(){return`[`}function yP(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function bP(){return{enter:{gfmFootnoteCallString:uP,gfmFootnoteCall:dP,gfmFootnoteDefinitionLabelString:fP,gfmFootnoteDefinition:pP},exit:{gfmFootnoteCallString:mP,gfmFootnoteCall:hP,gfmFootnoteDefinitionLabelString:gP,gfmFootnoteDefinition:_P}}}function xP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yP},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
33
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?CP:SP))),s(),o}}function SP(e,t,n){return t===0?e:CP(e,t,n)}function CP(e,t,n){return(n?``:` `)+e}var wP=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];kP.peek=AP;function TP(){return{canContainEols:[`delete`],enter:{strikethrough:DP},exit:{strikethrough:OP}}}function EP(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:wP}],handlers:{delete:kP}}}function DP(e){this.enter({type:`delete`,children:[]},e)}function OP(e){this.exit(e)}function kP(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function AP(){return`~`}function jP(e){return e.length}function MP(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||jP,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=NP(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=PP(r[d]);else{let e=PP(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
34
+ `)}function NP(e){return e==null?``:String(e)}function PP(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function FP(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),IP);return i(),o}function IP(e,t,n){return`>`+(n?``:` `)+e}function LP(e,t){return RP(e,t.inConstruct,!0)&&!RP(e,t.notInConstruct,!1)}function RP(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zP(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
35
+ `&&LP(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
36
+ `}function BP(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function VP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function HP(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function UP(e,t,n,r){let i=HP(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(VP(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,WP);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(BP(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
37
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
38
+ `),a&&(u+=s.move(a+`
39
+ `)),u+=s.move(c),l(),u}function WP(e,t,n){return(n?``:` `)+e}function GP(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function KP(e,t,n,r){let i=GP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
40
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function qP(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function JP(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function YP(e,t,n){let r=gk(e),i=gk(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}XP.peek=ZP;function XP(e,t,n,r){let i=qP(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=YP(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=JP(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=YP(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+JP(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ZP(e,t,n){return n.options.emphasis||`*`}function QP(e,t){let n=!1;return zM(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&RO(e)&&(t.options.setext||n))}function $P(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(QP(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
41
+ `,after:`
42
+ `});return r(),t(),o+`
43
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
44
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
45
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=JP(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}eF.peek=tF;function eF(e){return e.value||``}function tF(){return`<`}nF.peek=rF;function nF(e,t,n,r){let i=GP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function rF(){return`!`}iF.peek=aF;function iF(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function aF(){return`!`}oF.peek=sF;function oF(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function sF(){return"`"}function cF(e,t){let n=RO(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}lF.peek=uF;function lF(e,t,n,r){let i=GP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(cF(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function uF(e,t,n){return cF(e,n)?`<`:`[`}dF.peek=fF;function dF(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function fF(){return`[`}function pF(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function mF(e){let t=pF(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function hF(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function gF(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _F(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?hF(n):pF(n),s=e.ordered?o===`.`?`)`:`.`:mF(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),gF(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function vF(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function yF(e,t,n,r){let i=vF(n),a=n.bulletCurrent||pF(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function bF(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var xF=OM([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function SF(e,t,n,r){return(e.children.some(function(e){return xF(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function CF(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wF.peek=TF;function wF(e,t,n,r){let i=CF(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=YP(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=JP(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=YP(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+JP(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function TF(e,t,n){return n.options.strong||`*`}function EF(e,t,n,r){return n.safe(e.value,r)}function DF(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function OF(e,t,n){let r=(gF(n)+(n.options.ruleSpaces?` `:``)).repeat(DF(n));return n.options.ruleSpaces?r.slice(0,-1):r}var kF={blockquote:FP,break:zP,code:UP,definition:KP,emphasis:XP,hardBreak:zP,heading:$P,html:eF,image:nF,imageReference:iF,inlineCode:oF,link:lF,linkReference:dF,list:_F,listItem:yF,paragraph:bF,root:SF,strong:wF,text:EF,thematicBreak:OF};function AF(){return{enter:{table:jF,tableData:FF,tableHeader:FF,tableRow:NF},exit:{codeText:IF,table:MF,tableData:PF,tableHeader:PF,tableRow:PF}}}function jF(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function MF(e){this.exit(e),this.data.inTable=void 0}function NF(e){this.enter({type:`tableRow`,children:[]},e)}function PF(e){this.exit(e)}function FF(e){this.enter({type:`tableCell`,children:[]},e)}function IF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,LF));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function LF(e,t){return t===`|`?t:e}function RF(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
46
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
47
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return MP(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=kF.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function zF(){return{exit:{taskListCheckValueChecked:VF,taskListCheckValueUnchecked:VF,paragraph:HF}}}function BF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:UF}}}function VF(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function HF(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function UF(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=kF.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function WF(){return[XN(),bP(),TP(),AF(),zF()]}function GF(e){return{extensions:[ZN(),xP(e),EP(),RF(e),BF()]}}var KF={tokenize:oI,partial:!0},qF={tokenize:sI,partial:!0},JF={tokenize:cI,partial:!0},YF={tokenize:lI,partial:!0},XF={tokenize:uI,partial:!0},ZF={name:`wwwAutolink`,tokenize:iI,previous:dI},QF={name:`protocolAutolink`,tokenize:aI,previous:fI},$F={name:`emailAutolink`,tokenize:rI,previous:pI},eI={};function tI(){return{text:eI}}for(var nI=48;nI<123;)eI[nI]=$F,nI++,nI===58?nI=65:nI===91&&(nI=97);eI[43]=$F,eI[45]=$F,eI[46]=$F,eI[95]=$F,eI[72]=[$F,QF],eI[104]=[$F,QF],eI[87]=[$F,ZF],eI[119]=[$F,ZF];function rI(e,t,n){let r=this,i,a;return o;function o(t){return!mI(t)||!pI.call(r,r.previous)||hI(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return mI(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(XF,u,l)(t):t===45||t===95||$O(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&QO(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function iI(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!dI.call(r,r.previous)||hI(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(KF,e.attempt(qF,e.attempt(JF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function aI(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&fI.call(r,r.previous)&&!hI(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(QO(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||tk(t)||ak(t)||sk(t)||ok(t)?n(t):e.attempt(qF,e.attempt(JF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function oI(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function sI(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(YF,c,s)(t):t===null||ak(t)||sk(t)||t!==45&&ok(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function cI(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(YF,t,a)(o):o===null||ak(o)||sk(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function lI(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ak(o)||sk(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||ak(e)||sk(e)?t(e):r(e)}function a(e){return QO(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):QO(t)?(e.consume(t),o):n(t)}}function uI(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return $O(e)?n(e):t(e)}}function dI(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ak(e)}function fI(e){return!QO(e)}function pI(e){return!(e===47||mI(e))}function mI(e){return e===43||e===45||e===46||e===95||$O(e)}function hI(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var gI={tokenize:wI,partial:!0};function _I(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:xI,continuation:{tokenize:SI},exit:CI}},text:{91:{name:`gfmFootnoteCall`,tokenize:bI},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:vI,resolveTo:yI}}}}function vI(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=ZO(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function yI(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function bI(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||ak(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ZO(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return ak(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function xI(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||ak(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ZO(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return ak(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function SI(e,t,n){return e.check(wk,t,e.attempt(gI,t,n))}function CI(e){e.exit(`gfmFootnoteDefinition`)}function wI(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function TI(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&WO(o,o.length,0,_k(s,e.slice(r+1,n),t)),WO(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),WO(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=gk(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=gk(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var EI=class{constructor(){this.map=[]}add(e,t,n){DI(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function DI(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function OI(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function kI(){return{flow:{null:{name:`table`,tokenize:AI,resolveAll:jI}}}}function AI(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):X(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||ak(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||X(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||X(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||X(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||ak(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function jI(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new EI;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(NI(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=MI(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=MI(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=MI(f,t,o,i,n,d)):(o[0]=o[1],d=MI(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&NI(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=OI(t.events,n))}return e}function MI(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},PI(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=PI(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=PI(t.events,n[2]),a=PI(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},PI(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function NI(e,t,n,r,i){let a=[],o=PI(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function PI(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var FI={name:`tasklistCheck`,tokenize:LI};function II(){return{text:{91:FI}}}function LI(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return ak(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return X(r)?t(r):Z(r)?e.check({tokenize:RI},t,n)(r):n(r)}}function RI(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function zI(e){return qO([tI(),_I(),TI(e),kI(),II()])}var BI={};function VI(e){let t=this,n=e||BI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(zI(n)),a.push(WF()),o.push(GF(n))}function HI(e){return e===`skill`?`skill`:e===`panel_app`?`panel_app`:`default`}function UI(e,t,n){return e===`skill`?R(`border-transparent bg-transparent text-[color:var(--md-link)]`,n&&`cursor-pointer underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[color:var(--md-link)]/30`,!n&&`cursor-default`):e===`panel_app`?t?`border-primary-foreground/40 bg-primary-foreground/22 text-primary-foreground`:`border-border bg-muted text-foreground`:t?`border-primary-foreground/40 bg-primary-foreground/22 text-primary-foreground`:`border-border bg-muted text-muted-foreground`}function WI(e,t){return e===`skill`?`text-current opacity-80`:t?`text-primary-foreground/80`:`text-muted-foreground`}function GI(e){return e===`panel_app`?(0,F.jsx)(Ga,{"aria-hidden":`true`,className:`h-3 w-3`}):(0,F.jsx)(Yo,{"aria-hidden":`true`,className:`h-3 w-3`})}function KI({kind:e,label:t,isUser:n,onClick:r}){let i=HI(e),a=!!r,o=R(`nextclaw-chat-inline-token mx-[2px] inline-flex max-w-full items-center gap-1 align-baseline text-[11px] font-medium`,i===`skill`?`h-auto rounded-none px-0 py-0`:`h-7 rounded-xl border px-2.5`,UI(i,n,a)),s=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:R(`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center`,WI(i,n)),children:GI(i)}),(0,F.jsx)(`span`,{className:`truncate`,children:t})]});return a?(0,F.jsx)(`button`,{type:`button`,className:o,title:t,onClick:e=>{e.preventDefault(),e.stopPropagation(),r?.()},children:s}):(0,F.jsx)(`span`,{className:o,title:t,children:s})}function qI(){return typeof navigator<`u`&&typeof navigator.clipboard?.writeText==`function`}function JI(e){if(typeof document>`u`)return;let t=document.getSelection();t&&(t.removeAllRanges(),e.forEach(e=>t.addRange(e)))}function YI(){let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:null,n=t?{input:t,start:t.selectionStart,end:t.selectionEnd}:null,r=document.getSelection();return{activeElement:e,activeInputSelection:n,ranges:r?Array.from({length:r.rangeCount},(e,t)=>r.getRangeAt(t).cloneRange()):[]}}function XI(e){let t=document.createElement(`textarea`);return t.value=e,t.setAttribute(`readonly`,``),t.setAttribute(`aria-hidden`,`true`),Object.assign(t.style,{fontSize:`12pt`,left:`-9999px`,opacity:`0`,pointerEvents:`none`,position:`fixed`,top:`0`}),t}function ZI(e){try{e.focus({preventScroll:!0})}catch{e.focus()}}function QI(e){ZI(e),e.select(),e.setSelectionRange(0,e.value.length)}function $I(){try{return typeof document.execCommand==`function`&&document.execCommand(`copy`)}catch{return!1}}function eL(e){if(!e.activeInputSelection)return!1;let{input:t,start:n,end:r}=e.activeInputSelection;return n===null||r===null?!1:(t.setSelectionRange(n,r),!0)}function tL(e){e.activeElement&&ZI(e.activeElement),eL(e)||JI(e.ranges)}function nL(e){if(typeof document>`u`||!document.body)return!1;let t=YI(),n=XI(e);document.body.appendChild(n),QI(n);let r=$I();return n.remove(),tL(t),r}async function rL(e){if(!e)return!1;if(qI())try{return await navigator.clipboard.writeText(e),!0}catch{return nL(e)}return nL(e)}var iL=1300;function aL(e){let[t,n]=(0,P.useState)(!1),r=(0,P.useCallback)(async()=>{e.text&&(await rL(e.text)?n(!0):n(!1))},[e.text]);return(0,P.useEffect)(()=>{if(!t||typeof window>`u`)return;let r=window.setTimeout(()=>n(!1),e.resetDelayMs??iL);return()=>window.clearTimeout(r)},[t,e.resetDelayMs]),{copied:t,copy:r}}var oL=e(n(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,ee=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:`\\\\[\\s\\S]`,relevance:0},te={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[j]},M={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[j]},ne={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},re=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},ie=re(`//`,`$`),ae=re(`/\\*`,`\\*/`),oe=re(`#`,`$`),se={scope:`number`,begin:D,relevance:0},ce={scope:`number`,begin:O,relevance:0},le={scope:`number`,begin:k,relevance:0},ue={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},de={scope:`title`,begin:T,relevance:0},fe={scope:`title`,begin:E,relevance:0},pe={begin:`\\.\\s*`+E,relevance:0},me=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:k,COMMENT:re,C_BLOCK_COMMENT_MODE:ae,C_LINE_COMMENT_MODE:ie,C_NUMBER_MODE:ce,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:oe,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:pe,NUMBER_MODE:se,NUMBER_RE:D,PHRASAL_WORDS_MODE:ne,QUOTE_STRING_MODE:M,REGEXP_MODE:ue,RE_STARTERS_RE:A,SHEBANG:ee,TITLE_MODE:de,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:fe});function he(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ge(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function _e(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=he,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ve(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function ye(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function be(e,t){e.relevance===void 0&&(e.relevance=1)}var xe=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Se=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],Ce=`keyword`;function we(e,t,n=Ce){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,we(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,Te(n[0],n[1])]})}}function Te(e,t){return t?Number(t):Ee(e)?0:1}function Ee(e){return Se.includes(e.toLowerCase())}var De={},Oe=e=>{console.error(e)},ke=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ae=(e,t)=>{De[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),De[`${e}/${t}`]=!0)},je=Error();function Me(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Ne(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Oe(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),je;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Oe(`beginScope must be object`),je;Me(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Pe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Oe(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),je;if(typeof e.endScope!=`object`||e.endScope===null)throw Oe(`endScope must be object`),je;Me(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Fe(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ie(e){Fe(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Ne(e),Pe(e)}function Le(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ge,ye,Ie,xe].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[_e,ve,be].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=we(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return ze(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Re(e){return e?e.endsWithParent||Re(e.starts):!1}function ze(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Re(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Be=`11.11.1`,Ve=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},He=i,Ue=a,N=Symbol(`nomatch`),We=7,Ge=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=te(n[1]);return t||(ke(s.replace(`{}`,n[1])),ke(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||te(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Ae(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Ae(`10.7.0`,`Please use highlight(code, options) instead.
48
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};oe(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,oe(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){j.addText(M);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(M),n=``;for(;t;){n+=M.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=We&&(ne+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(M)}n+=M.substring(e),j.addText(n)}function f(){if(M===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){j.addText(M);return}e=v(A.subLanguage,M,!0,ee[A.subLanguage]),ee[A.subLanguage]=e._top}else e=S(M,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(ne+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),M=``}function m(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(M=i,d(),M=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(M,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=``):e.beginScope._multi&&(h(e.beginScope,t),M=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(M+=e[0],1):(ae=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),p(),!n.returnBegin&&!n.excludeBegin&&(M=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return N;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?M+=t:(a.returnEnd||a.excludeEnd||(M+=t),p(),a.excludeEnd&&(M=t));do A.scope&&j.closeNode(),!A.skip&&!A.subLanguage&&(ne+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(M+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(M+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==N)return e}if(r.type===`illegal`&&a===``)return M+=`
49
+ `,1;if(ie>1e5&&ie>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return M+=a,a.length}let D=te(e);if(!D)throw Oe(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Le(D),k=``,A=a||O,ee={},j=new l.__emitter(l);w();let M=``,ne=0,re=0,ie=0,ae=!1;try{if(D.__emitTokens)D.__emitTokens(n,j);else{for(A.matcher.considerAll();;){ie++,ae?ae=!1:A.matcher.considerAll(),A.matcher.lastIndex=re;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(re,e.index),e);re=e.index+t}E(n.substring(re))}return j.finalize(),k=j.toHTML(),{language:e,value:k,relevance:ne,illegal:!1,_emitter:j,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:He(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:re,context:n.slice(re-100,re+100),mode:t.mode,resultSoFar:k},_emitter:j};if(o)return{language:e,value:He(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:A};throw t}}function b(e){let t={value:He(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(te).filter(ne).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(te(e.language).supersetOf===t.language)return 1;if(te(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(oe(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ve(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),oe(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ue(l,e)}let E=()=>{k(),Ae(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),Ae(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(Oe(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Oe(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&M(i.aliases,{languageName:n})}function ee(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function te(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function M(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function ne(e){let t=te(e);return t&&!t.disableAutodetect}function re(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function ie(e){re(e),a.push(e)}function ae(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function oe(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function se(e){return Ae(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Ae(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:se,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:ee,listLanguages:j,getLanguage:te,registerAliases:M,autoDetection:ne,inherit:Ue,addPlugin:ie,removePlugin:ae}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Be,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in me)typeof me[e]==`object`&&n(me[e]);return Object.assign(e,me),e},Ke=Ge({});Ke.newInstance=()=>Ge({}),t.exports=Ke,Ke.HighlightJS=Ke,Ke.default=Ke}))()).default;function sL(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var cL=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),lL=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),uL=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),dL=[...lL,...uL],fL=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),pL=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),mL=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),hL=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function gL(e){let t=e.regex,n=cL(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+pL.join(`|`)+`)`},{begin:`:(:)?(`+mL.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+hL.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:fL.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+dL.join(`|`)+`)\\b`}]}}function _L(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}var vL=`[A-Za-z$_][0-9A-Za-z$_]*`,yL=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),bL=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],xL=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),SL=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],CL=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],wL=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],TL=[].concat(CL,xL,SL);function EL(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=vL,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:vL,keyword:yL,literal:bL,built_in:TL,"variable.language":wL},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...xL,...SL]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...CL,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function DL(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function OL(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function kL(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function AL(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function jL(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var ML=`[A-Za-z$_][0-9A-Za-z$_]*`,NL=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),PL=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],FL=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),IL=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],LL=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],RL=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],zL=[].concat(LL,FL,IL);function BL(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=ML,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:ML,keyword:NL,literal:PL,built_in:zL,"variable.language":RL},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...FL,...IL]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...LL,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function VL(e){let t=e.regex,n=BL(e),r=ML,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:ML,keyword:NL.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:PL,built_in:zL.concat(i),"variable.language":RL},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function HL(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function UL(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var WL=new Set([`text`,`txt`,`plain`,`plaintext`,`none`,`output`]),GL=[`typescript`,`javascript`,`json`,`bash`,`shell`,`python`,`css`,`xml`,`markdown`,`yaml`,`sql`,`diff`],KL=4,qL=[{name:`typescript`,language:VL,aliases:[`ts`,`tsx`]},{name:`javascript`,language:EL,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{name:`json`,language:DL,aliases:[`jsonc`]},{name:`bash`,language:sL,aliases:[`sh`,`zsh`]},{name:`shell`,language:AL,aliases:[`console`,`terminal`]},{name:`python`,language:kL,aliases:[`py`]},{name:`css`,language:gL},{name:`xml`,language:HL,aliases:[`html`,`svg`]},{name:`markdown`,language:OL,aliases:[`md`,`mdx`]},{name:`yaml`,language:UL,aliases:[`yml`]},{name:`sql`,language:jL},{name:`diff`,language:_L,aliases:[`patch`]}];function JL(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function YL(e){return e.trim().toLowerCase()}var XL=new class{constructor(){this.highlight=(e,t)=>{let n=YL(t);if(!e||WL.has(n))return this.createPlainTextResult(e,n||`text`);if(this.engine.getLanguage(n)){let t=this.engine.highlight(e,{language:n,ignoreIllegals:!0});return{html:t.value,language:t.language??n,highlighted:!0}}let r=this.engine.highlightAuto(e,GL);return r.language&&r.relevance>=KL?{html:r.value,language:r.language,highlighted:!0}:this.createPlainTextResult(e,n||`text`)},this.createPlainTextResult=(e,t)=>({html:JL(e),language:t,highlighted:!1}),this.engine=oL.newInstance(),qL.forEach(e=>{this.engine.registerLanguage(e.name,e.language),e.aliases&&this.engine.registerAliases(e.aliases,{languageName:e.name})})}},ZL=/language-([a-z0-9-]+)/i;function QL(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(QL).join(``):``}function $L(e){let t=QL(e);return t.endsWith(`
50
+ `)?t.slice(0,-1):t}function eR(e){return(e?ZL.exec(e):null)?.[1]?.toLowerCase()||`text`}function tR({className:e,children:t,texts:n}){let r=(0,P.useMemo)(()=>eR(e),[e]),i=(0,P.useMemo)(()=>$L(t),[t]),a=(0,P.useMemo)(()=>XL.highlight(i,r),[i,r]),o=(0,P.useMemo)(()=>{let t=`language-${a.language}`;return R(`hljs`,e,e?.includes(`language-`)?void 0:t)},[e,a.language]),{copied:s,copy:c}=aL({text:i});return(0,F.jsxs)(`div`,{className:`chat-codeblock`,children:[(0,F.jsxs)(`div`,{className:`chat-codeblock-toolbar`,children:[(0,F.jsx)(`span`,{className:`chat-codeblock-language`,children:r}),(0,F.jsxs)(`button`,{type:`button`,className:`chat-codeblock-copy`,onClick:()=>void c(),"aria-label":s?n.copiedCodeLabel:n.copyCodeLabel,children:[s?(0,F.jsx)(qt,{className:`h-3.5 w-3.5`}):(0,F.jsx)(so,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:s?n.copiedCodeLabel:n.copyCodeLabel})]})]}),(0,F.jsx)(`pre`,{children:(0,F.jsx)(`code`,{className:o,"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})})]})}var nR=`nextclaw-inline`,rR=/language-([a-z0-9-]+)/i,iR=new Set([`auto`,`source`,`rendered`]);function aR(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function oR(e){return typeof e==`string`&&e.trim().length>0?e.trim():void 0}function sR(e){return Number.isInteger(e)&&Number(e)>0?Number(e):void 0}function cR(e){let t=oR(e);return t&&iR.has(t)?t:void 0}function lR(e){let{payload:t}=e;return aR(t)?t:null}function uR(e){let t=lR(e);if(!t)return null;let n=oR(t.path);return n?{type:`file`,payload:{path:n,line:sR(t.line),column:sR(t.column),viewer:cR(t.viewer)}}:null}function dR(e){let t=lR(e);if(!t)return null;let n=oR(t.url);return n?{type:`url`,payload:{url:n}}:null}function fR(e){let t=lR(e);if(!t)return null;let n=oR(t.appId);return n?{type:`panel_app`,payload:{appId:n}}:null}function pR(e){let t=lR(e);return!t||!(`value`in t)?null:{type:`json`,payload:{value:t.value}}}function mR(e){if(!aR(e))return null;let t=oR(e.type);return t===`file`?uR(e):t===`url`?dR(e):t===`panel_app`?fR(e):t===`json`?pR(e):null}function hR(e){return(e?rR.exec(e):null)?.[1]?.toLowerCase()===nR}function gR(e){let t=e.endsWith(`
51
+ `)?e.slice(0,-1):e,n;try{n=JSON.parse(t)}catch{return null}if(!aR(n))return null;let r=mR(n.target);return r?{target:r,title:oR(n.title),description:oR(n.description)}:null}function _R(e){if(e.title)return e.title;if(e.target.type===`file`){let t=e.target.payload.path.split(`/`).filter(Boolean);return t[t.length-1]??e.target.payload.path}return e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:`JSON`}function vR(e){return e.target.type===`file`?e.target.payload.path:e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:JSON.stringify(e.target.payload.value,null,2)}function yR({display:e}){let t=`h-3.5 w-3.5 shrink-0 text-muted-foreground`;return e.target.type===`file`?(0,F.jsx)(Zt,{className:t,"aria-hidden":!0}):e.target.type===`url`?(0,F.jsx)(sn,{className:t,"aria-hidden":!0}):e.target.type===`panel_app`?(0,F.jsx)(Ga,{className:t,"aria-hidden":!0}):(0,F.jsx)(oo,{className:t,"aria-hidden":!0})}function bR(e){return e.length>1200?`${e.slice(0,1200)}\n...`:e}function xR({display:e}){let t=_R(e),n=vR(e),r=e.target.type===`json`?bR(n):n;return(0,F.jsxs)(`section`,{className:R(`my-2 max-w-full border-l-2 border-border bg-muted/30 px-3 py-2`,`text-xs leading-relaxed text-foreground`),"data-nextclaw-inline-display":`true`,"data-nextclaw-inline-display-type":e.target.type,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(yR,{display:e}),(0,F.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:t})]}),e.description?(0,F.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[12px] text-muted-foreground`,children:e.description}):null,(0,F.jsx)(`pre`,{className:R(`mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words`,`font-mono text-[11px] leading-relaxed text-muted-foreground`),children:r})]})}function SR({display:e,renderInlineDisplay:t}){let n=t?.(e);return n==null?(0,F.jsx)(xR,{display:e}):(0,F.jsx)(F.Fragment,{children:n})}var CR=300,wR=null;function TR(){return wR??=h(()=>import(`./mermaid.core-CXwWRh5i.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),wR}function ER(){if(typeof document>`u`)return`default`;let e=document.documentElement;return e.getAttribute(`data-theme-appearance`)===`dark`||e.classList.contains(`dark`)?`dark`:`default`}function DR(){let[e,t]=(0,P.useState)(ER);return(0,P.useEffect)(()=>{let e=document.documentElement,n=new MutationObserver(()=>t(ER()));return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme-appearance`]}),()=>n.disconnect()},[]),e}function OR({isStreaming:e,source:t,texts:n}){let r=(0,P.useId)().replace(/[^a-zA-Z0-9_-]/g,``),i=(0,P.useRef)(0),a=DR(),o=t.trim(),s=`${a}:${o}`,[c,l]=(0,P.useState)(null),u=n.mermaidDiagramLabel??`Mermaid diagram`,d=n.mermaidRenderErrorLabel??`Diagram could not be rendered`;(0,P.useEffect)(()=>{let t=!0,n=async()=>{try{let e=await TR();if(!t)return;i.current+=1;let n=`nextclaw-mermaid-${r}-${i.current}`;e.initialize({securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:a});let c=await e.parse(o,{suppressErrors:!0});if(!t)return;if(!c)throw Error(`Invalid Mermaid diagram`);let{svg:u}=await e.render(n,o);t&&l({key:s,status:`rendered`,svg:u})}catch{t&&!e&&l({key:s,status:`error`})}},c=window.setTimeout(()=>void n(),e?CR:0);return()=>{t=!1,window.clearTimeout(c)}},[e,o,r,s,a]);let f=c?.key===s?c:null;if(f?.status===`error`)return(0,F.jsxs)(`div`,{"data-chat-mermaid-error":`true`,className:`my-3 overflow-hidden rounded-xl border border-border bg-muted/25`,children:[(0,F.jsx)(`div`,{className:`border-b border-border px-3 py-2 text-xs text-muted-foreground`,children:d}),(0,F.jsx)(tR,{className:`language-mermaid`,texts:n,children:o})]});let p=c?.status===`rendered`?c:null;return p?(0,F.jsx)(`figure`,{"aria-label":u,"aria-busy":!f,"data-chat-mermaid-diagram":`true`,"data-chat-mermaid-updating":!f||void 0,className:`my-3 min-h-24 overflow-auto rounded-xl border border-border bg-muted/20 p-3`,children:(0,F.jsx)(`div`,{className:`min-w-fit [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:p.svg}})}):(0,F.jsx)(tR,{className:`language-mermaid`,texts:n,children:o})}function kR({alt:e,closeLabel:t,onClose:n,src:r}){let i=(0,P.useId)();return(0,P.useEffect)(()=>{let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=e=>{e.key===`Escape`&&(e.preventDefault(),n())};return window.addEventListener(`keydown`,t),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,t)}},[n]),(0,fE.createPortal)((0,F.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":i,className:`fixed inset-0 z-[var(--z-modal,10050)] flex items-center justify-center bg-black/80 p-4 backdrop-blur-[2px]`,"data-testid":`chat-message-image-lightbox`,onClick:n,children:[(0,F.jsx)(`span`,{id:i,className:`sr-only`,children:e}),(0,F.jsx)(`button`,{type:`button`,"aria-label":t,className:`absolute right-4 top-4 inline-flex h-9 w-9 items-center justify-center rounded-full bg-black/55 text-white transition-colors hover:bg-black/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/70`,onClick:e=>{e.stopPropagation(),n()},children:(0,F.jsx)(Cn,{className:`h-4 w-4`,strokeWidth:2})}),(0,F.jsx)(`img`,{src:r,alt:e,className:`max-h-[min(92vh,100%)] max-w-[min(96vw,100%)] object-contain shadow-2xl`,onClick:e=>e.stopPropagation()})]}),document.body)}function AR({alt:e,expandLabel:t,closeLabel:n,sizeLabel:r,src:i}){let[a,o]=(0,P.useState)(!1),s=()=>o(!0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{"data-chat-message-image-preview":!0,className:`group/image relative block w-fit max-w-[min(100%,32rem)] overflow-hidden rounded-lg`,children:[(0,F.jsx)(`button`,{type:`button`,className:`block w-fit max-w-[min(100%,32rem)] text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:s,onDoubleClick:e=>{e.preventDefault(),s()},"aria-label":t,children:(0,F.jsx)(`img`,{src:i,alt:e,className:`block h-auto w-auto max-h-[26rem] max-w-full rounded-lg bg-transparent object-contain`})}),(0,F.jsx)(`button`,{type:`button`,"aria-label":t,className:`absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-md bg-black/45 text-white opacity-0 transition-opacity duration-150 hover:bg-black/60 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/70 group-hover/image:opacity-100`,onClick:e=>{e.preventDefault(),e.stopPropagation(),s()},children:(0,F.jsx)(fo,{className:`h-3.5 w-3.5`,strokeWidth:2})}),r?(0,F.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-start bg-gradient-to-t from-black/50 via-black/15 to-transparent px-2.5 pb-2 pt-8 opacity-0 transition-opacity duration-150 group-hover/image:opacity-100 group-focus-within/image:opacity-100`,children:(0,F.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-black/40 px-1.5 py-0.5 text-[10px] font-medium text-white/95 backdrop-blur-sm`,children:r})}):null]}),a?(0,F.jsx)(kR,{alt:e,closeLabel:n,onClose:()=>o(!1),src:i}):null]})}var jR=new Set([`http:`,`https:`,`mailto:`,`tel:`]),MR=/^[a-zA-Z][a-zA-Z\d+.-]*:/,NR=/^[a-z]:[\\/]/i,PR=/^\/[a-z]:[\\/]/i,FR=`file:`;function IR(e){return!e.startsWith(`//`)&&!MR.test(e)}function LR(e){let t=Number(e);return Number.isSafeInteger(t)&&t>0?t:void 0}function RR(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==FR||t.hostname&&t.hostname.toLowerCase()!==`localhost`)return null;let n;try{n=decodeURIComponent(t.pathname)}catch{return null}return PR.test(n)&&(n=n.slice(1)),n?{path:n,query:t.searchParams,fragment:t.hash.slice(1)}:null}function zR(e){let t=e.indexOf(`#`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):``,i=n.indexOf(`?`),a=i>=0?n.slice(0,i):n,o=i>=0?n.slice(i+1):``,s;try{s=decodeURIComponent(a)}catch{return null}return s?{path:s,query:new URLSearchParams(o),fragment:r}:null}function BR(e){let t=/^L(\d+)(?:C(\d+))?(?:-L\d+(?:C\d+)?)?$/i.exec(e),n=LR(t?.[1]);return{line:n,column:n?LR(t?.[2]):void 0}}function VR(e){if(NR.test(e)||IR(e))return e;try{let t=new URL(e);return jR.has(t.protocol)||t.protocol===FR&&RR(e)?e:``}catch{return``}}function HR(e){return e&&VR(e)||null}function UR(e){return/^https?:\/\//i.test(e)}function WR(e){let t=e.toLowerCase().startsWith(FR)?RR(e):zR(e),n=t?.path;if(!n||n.startsWith(`#`)||n.startsWith(`//`)||!NR.test(n)&&MR.test(n))return null;let r=t.query.get(`viewer`),i=BR(t.fragment),a=/^(.*?)(?::(\d+)(?::(\d+))?)$/.exec(n),o=a?.[1]??n,s=i.line??LR(a?.[2]),c=i.column??(s?LR(a?.[3]):void 0);return{path:o,label:o.split(/[\\/]/).filter(Boolean).pop()??o,viewMode:`preview`,...r===`source`||r===`rendered`?{previewViewer:r}:{},...typeof s==`number`?{line:s}:{},...typeof c==`number`?{column:c}:{}}}var GR=14e4,KR=`data-chat-inline-token-kind`,qR=`data-chat-inline-token-key`,JR=`data-chat-inline-token-label`,YR=`data-chat-inline-token-raw-text`;function XR(e){return e.length<=GR?e:`${e.slice(0,GR)}\n\n...`}function ZR(e){let t=0;for(let n of e?.children??[]){if(n.type===`text`){let e=n.value??``;if(e.trim().length>0||e.includes(`
52
+ `)||e.includes(`\r`))return!1;continue}if(n.tagName!==`img`)return!1;t+=1}return t>=3}function QR(e){if(!e||e.length===0)return[];let t=new Set,n=[];for(let r of e)!r.rawText||t.has(r.rawText)||(t.add(r.rawText),n.push(r));return n.sort((e,t)=>t.rawText.length-e.rawText.length)}function $R(e){return{type:`chatInlineToken`,data:{hName:`span`,hProperties:{[KR]:e.kind,[qR]:e.key,[JR]:e.label,[YR]:e.rawText},hChildren:[{type:`text`,value:e.label}]}}}function ez(e,t,n){let r=null;for(let i of n){let n=e.indexOf(i.rawText,t);n<0||(!r||n<r.index||n===r.index&&i.rawText.length>r.token.rawText.length)&&(r={index:n,token:i})}return r}function tz(e,t){let n=[],r=0;for(;r<e.length;){let i=ez(e,r,t);if(!i){n.push({type:`text`,value:e.slice(r)});break}i.index>r&&n.push({type:`text`,value:e.slice(r,i.index)}),n.push($R(i.token)),r=i.index+i.token.rawText.length}return n.length>0?n:[{type:`text`,value:e}]}function nz(e,t){return e.type===`code`||e.type===`inlineCode`||!e.children?e:{...e,children:e.children.flatMap(e=>e.type===`text`&&typeof e.value==`string`?tz(e.value,t):[nz(e,t)])}}function rz(e){let t=QR(e);return()=>e=>t.length>0?nz(e,t):e}function iz(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:null}var az=(0,P.createContext)(null);function oz(){let e=(0,P.useContext)(az);if(!e)throw Error(`Chat message Markdown renderer requires its runtime context`);return e}var sz={p:function({node:e,children:t}){let{inline:n}=oz();return n?(0,F.jsx)(F.Fragment,{children:t}):(0,F.jsx)(`p`,{"data-chat-image-row":ZR(e)?`three-column`:void 0,children:t})},span:function({node:e,children:t,...n}){let{isUser:r,onInlineTokenClick:i}=oz(),a=n,o=iz(a,KR),s=iz(a,qR),c=iz(a,JR),l=iz(a,YR);return o&&s&&c&&l?(0,F.jsx)(KI,{kind:o,label:c,isUser:r,onClick:i?()=>i({kind:o,key:s,label:c,rawText:l}):void 0}):(0,F.jsx)(`span`,{...n,children:t})},a:function({node:e,href:t,children:n,...r}){let{onFileOpen:i}=oz(),a=HR(t),o=a?UR(a):!1,s=o?null:a?WR(a):null,c=e=>{if(!a){e.preventDefault();return}!i||!s||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),i(s))};return(0,F.jsx)(`a`,{...r,className:R(r.className,!a&&`chat-link-invalid`),href:a??`#`,"aria-disabled":!a||void 0,onClick:c,target:o?`_blank`:void 0,rel:o?`noreferrer noopener`:void 0,children:n})},table:function({node:e,children:t,...n}){return(0,F.jsx)(`div`,{className:`chat-table-wrap`,children:(0,F.jsx)(`table`,{...n,children:t})})},input:function({node:e,type:t,checked:n,...r}){return t===`checkbox`?(0,F.jsx)(`input`,{...r,type:`checkbox`,checked:n,readOnly:!0,disabled:!0,className:`chat-task-checkbox`}):(0,F.jsx)(`input`,{...r,type:t})},img:function({node:e,src:t,alt:n}){let{resolveFileContentUrl:r,texts:i}=oz(),a=HR(t);if(!a)return null;let o=WR(a),s=o&&r?r(o):a;return s?(0,F.jsx)(AR,{alt:n||``,closeLabel:i.attachmentCloseLabel??`Close preview`,expandLabel:i.attachmentExpandLabel??`Expand image`,sizeLabel:null,src:s}):null},code:function({node:e,className:t,children:n,...r}){let{isStreaming:i,renderInlineDisplay:a,texts:o}=oz(),s=String(n??``);if(!t&&!s.includes(`
53
+ `))return(0,F.jsx)(`code`,{...r,className:R(`chat-inline-code`,t),children:n});let c=hR(t)?gR(s):null;return c?(0,F.jsx)(SR,{display:c,renderInlineDisplay:a}):t?.split(` `).includes(`language-mermaid`)?(0,F.jsx)(OR,{isStreaming:i,source:s,texts:o}):(0,F.jsx)(tR,{className:t,texts:o,children:n})}};function cz({text:e,role:t,texts:n,inline:r=!1,isStreaming:i=!1,inlineTokens:a,onFileOpen:o,onInlineTokenClick:s,resolveFileContentUrl:c,renderInlineDisplay:l}){let u=t===`user`,d=a?.length?[VI,rz(a)]:[VI],f=r?`span`:`div`;return(0,F.jsx)(az.Provider,{value:{inline:r,isStreaming:i,isUser:u,onFileOpen:o,onInlineTokenClick:s,renderInlineDisplay:l,resolveFileContentUrl:c,texts:n},children:(0,F.jsx)(f,{className:R(`chat-markdown`,u?`chat-markdown-user`:`chat-markdown-assistant`),children:(0,F.jsx)(LN,{skipHtml:!0,remarkPlugins:d,components:sz,urlTransform:VR,children:XR(e)})})})}var lz={archive:`bg-muted text-muted-foreground`,audio:`bg-muted text-muted-foreground`,code:`bg-muted text-muted-foreground`,data:`bg-muted text-muted-foreground`,document:`bg-muted text-muted-foreground`,generic:`bg-muted text-muted-foreground`,image:`bg-muted text-muted-foreground`,pdf:`bg-muted text-muted-foreground`,sheet:`bg-muted text-muted-foreground`,video:`bg-muted text-muted-foreground`},uz=new Set([`c`,`cpp`,`css`,`go`,`html`,`java`,`js`,`jsx`,`md`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`svg`,`ts`,`tsx`]),dz=new Set([`graphql`,`json`,`toml`,`xml`,`yaml`,`yml`]),fz=new Set([`avif`,`bmp`,`gif`,`heic`,`heif`,`ico`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`]),pz=new Set([`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]),mz=new Set([`avi`,`m4v`,`mov`,`mp4`,`mkv`,`webm`,`wmv`]),hz=new Set([`doc`,`docx`,`odt`,`pages`,`rtf`,`txt`]),gz=new Set([`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]),_z=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]);function vz(e){if(!Number.isFinite(e)||e==null||e<0)return null;if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=10||r===0?0:1;return`${n.toFixed(i).replace(/\.0$/,``)} ${t[r]}`}function yz(e,t){let n=bz(e);if(n)return n.toUpperCase();let r=(t.split(`/`)[1]??``).split(/[+.;-]/)[0]?.trim();return r?r.slice(0,6).toUpperCase():`FILE`}function bz(e){return/\.([a-z0-9]{1,12})$/i.exec(e.trim())?.[1]?.toLowerCase()??``}function xz(e){return typeof e==`string`&&/^data:image\//i.test(e.trim())}function Sz(e){return fz.has(e)?e===`jpg`||e===`jpeg`?`image/jpeg`:e===`svg`?`image/svg+xml`:`image/${e}`:pz.has(e)?e===`mp3`?`audio/mpeg`:e===`m4a`?`audio/mp4`:e===`weba`?`audio/webm`:`audio/${e}`:mz.has(e)?e===`mov`?`video/quicktime`:e===`m4v`?`video/mp4`:`video/${e}`:e===`pdf`?`application/pdf`:null}function Cz(e){let t=bz(e);return t?Sz(t):null}function wz(e){let t=e.mimeType.trim().toLowerCase();return t.length>0&&t!==`application/octet-stream`?t:Cz(e.label)}function Tz(e){let t=e.mimeType.trim().toLowerCase(),n=bz(e.label);return e.isImage||t.startsWith(`image/`)||fz.has(n)||xz(e.dataUrl)}function Ez(e,t){let n=bz(e),r=t.toLowerCase();return r.startsWith(`image/`)||fz.has(n)?`image`:r.startsWith(`audio/`)||pz.has(n)?`audio`:r.startsWith(`video/`)||mz.has(n)?`video`:r.includes(`pdf`)||n===`pdf`?`pdf`:_z.has(n)||/(zip|tar|gzip|rar|compressed|archive)/.test(r)?`archive`:gz.has(n)||/(spreadsheet|sheet|excel|csv)/.test(r)?`sheet`:dz.has(n)||/(json|xml|yaml|toml)/.test(r)?`data`:uz.has(n)||/(javascript|typescript|jsx|tsx|css|html)/.test(r)?`code`:hz.has(n)||/(msword|document|opendocument|rtf|text\/)/.test(r)?`document`:`generic`}function Dz(e){let t=Ez(e.label,e.mimeType),n=vz(e.sizeBytes);return{category:t,extension:yz(e.label,e.mimeType),sizeLabel:n}}var Oz={archive:`Archive`,audio:`Audio`,code:`Code file`,data:`Data file`,document:`Document`,generic:`File`,image:`Image`,pdf:`PDF document`,sheet:`Spreadsheet`,video:`Video`},kz={archive:po,audio:mo,code:ho,data:_o,document:Zt,generic:bo,image:go,pdf:Zt,sheet:vo,video:yo};function Az(e,t){return t?.attachmentCategoryLabels?.[e]??Oz[e]}function jz(e,t,n){return(0,F.jsx)(`div`,{className:R(`mt-0.5 text-[11px] leading-4`,n?`text-foreground/55`:`text-muted-foreground`),children:t?`${e} · ${t}`:e})}function Mz(e,t,n){return(0,F.jsx)(`span`,{className:R(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium`,n?t?`bg-black/5 text-foreground/75`:`bg-muted text-muted-foreground`:t?`bg-black/[0.03] text-foreground/45`:`bg-muted/70 text-muted-foreground/70`),children:e})}function Nz(e){let{label:t,href:n,isUser:r,onOpen:i}=e,a=R(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors`,r?`bg-black/5 text-foreground/75 hover:bg-black/10 hover:text-foreground`:`bg-muted text-muted-foreground hover:bg-accent hover:text-foreground`);return i?(0,F.jsx)(`button`,{type:`button`,className:a,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:t}):n?(0,F.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:a,children:t}):Mz(t,r,!1)}function Pz({category:e,isUser:t}){let n=kz[e];return(0,F.jsx)(`div`,{className:R(`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,t?`bg-black/5 text-foreground/70`:lz[e]),children:(0,F.jsx)(n,{className:R(`h-4 w-4`,t?`text-foreground/70`:`text-current`),strokeWidth:2})})}function Fz(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:o}=e;return(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5 px-2.5 py-2`,children:[(0,F.jsx)(Pz,{category:t,isUser:a}),(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`truncate text-[13px] font-medium leading-5`,children:n.label}),jz(r,i,a)]}),o]})})]})}function Iz(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,shellClasses:o,actionLabel:s,onOpen:c}=e;if(!n.dataUrl||t!==`audio`&&t!==`video`)return null;let l=wz(n);return(0,F.jsxs)(`div`,{className:o,children:[Fz({category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:Nz({label:s,href:n.dataUrl,isUser:a,onOpen:c?()=>c(n):void 0})}),(0,F.jsx)(`div`,{className:`px-2.5 pb-2.5`,children:t===`audio`?(0,F.jsx)(`audio`,{controls:!0,preload:`metadata`,"aria-label":n.label,className:`block w-full`,children:(0,F.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})}):(0,F.jsx)(`div`,{className:R(`overflow-hidden rounded-lg`,a?`bg-black/10`:`bg-muted ring-1 ring-border/70`),children:(0,F.jsx)(`video`,{controls:!0,preload:`metadata`,playsInline:!0,"aria-label":n.label,className:`block max-h-[28rem] w-full bg-black`,children:(0,F.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})})})})]})}function Lz({file:e,isUser:t=!1,texts:n,onOpen:r}){let{category:i,sizeLabel:a}=Dz(e),o=Tz(e)&&!!e.dataUrl,s=i===`audio`&&!!e.dataUrl,c=i===`video`&&!!e.dataUrl,l=!!e.dataUrl,u=l?n?.attachmentOpenLabel??`Open`:n?.attachmentAttachedLabel??`Attached`,d=n?.attachmentExpandLabel??`Expand image`,f=n?.attachmentCloseLabel??`Close preview`,p=Az(i,n),m=R(`block overflow-hidden rounded-xl border transition-colors`,t?`border-black/8 bg-black/[0.03] text-foreground`:`border-border/70 bg-card text-card-foreground`,l&&(t?`hover:bg-black/[0.05]`:`hover:bg-muted/50`));if(o&&e.dataUrl)return(0,F.jsx)(AR,{alt:e.label,expandLabel:d,closeLabel:f,sizeLabel:a,src:e.dataUrl});if(s||c)return Iz({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,shellClasses:m,actionLabel:u,onOpen:r});let h=Fz({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,action:Mz(u,t,l)});return!l||!e.dataUrl?(0,F.jsx)(`div`,{className:m,children:h}):r?(0,F.jsx)(`button`,{type:`button`,className:R(m,`group w-full text-left`),onClick:()=>r(e),children:h}):(0,F.jsx)(`a`,{href:e.dataUrl,target:`_blank`,rel:`noreferrer`,className:R(m,`group`),children:h})}function Rz({group:e,indexOffset:t,isUser:n,texts:r,onOpen:i}){return(0,F.jsx)(`div`,{"data-chat-message-image-row":`three-column`,"data-chat-message-wide-content":`true`,className:`grid w-full grid-cols-3 items-start gap-3`,children:e.items.map(({index:e,part:a})=>(0,F.jsx)(Lz,{file:a.file,isUser:n,texts:r,onOpen:i},`file-${t+e}`))})}function zz(e){return!!(e?.kind===`part`&&e.part.type===`file`&&e.part.file.isImage&&e.part.file.dataUrl)}function Bz(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!zz(r)){r&&t.push(r),n+=1;continue}let i=n,a=[];for(;zz(e[n]);)a.push(e[n]),n+=1;if(a.length<3){t.push(...a);continue}t.push({kind:`image-group`,key:`image-group-${i}`,items:a})}return t}function Vz(e){let{isInProgress:t}=e,[n,r]=(0,P.useState)(t),[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(t);(0,P.useEffect)(()=>{let e=o.current;!e&&t?(r(!0),a(!1)):e&&!t&&!i&&r(!1),o.current=t},[t,i]);function s(e){e.preventDefault();let i=!n;if(r(i),!i){a(!1);return}t&&a(!0)}return{isOpen:n,onSummaryClick:s}}var Hz=10;function Uz({contentVersion:e,hasContent:t,isLoading:n,resetKey:r,scrollRef:i,stickyThresholdPx:a}){let[o,s]=(0,P.useState)(!0),c=(0,P.useRef)(!0),l=(0,P.useRef)(null),u=(0,P.useRef)(!1),d=(0,P.useRef)(null),f=(0,P.useCallback)(e=>{c.current=e,s(e)},[]),p=(0,P.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=(a??Hz),[a]),m=(0,P.useCallback)((e=`auto`)=>{i.current&&(d.current!==null&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{d.current=null;let t=i.current;t&&(typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight)}))},[i]),h=(0,P.useCallback)(()=>{f(!0),m()},[m,f]),g=(0,P.useCallback)(()=>{let e=i.current;e&&f(p(e))},[p,i,f]);return(0,P.useEffect)(()=>{l.current!==r&&(l.current=r,f(!0),u.current=!0)},[r,f]),(0,P.useEffect)(()=>()=>{let e=d.current;e!==null&&(cancelAnimationFrame(e),d.current=null)},[]),(0,P.useLayoutEffect)(()=>{!u.current||n||!t||i.current&&(u.current=!1,m())},[t,n,m,i]),(0,P.useLayoutEffect)(()=>{!c.current||!t||i.current&&m()},[e,t,m,i]),{isAtBottom:o,onScroll:g,scrollToBottom:h}}var Wz=`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-current`,Gz=`group/process-row flex w-full min-w-0 items-center gap-1.5 py-0 text-[0.925rem] font-normal leading-[1.72] text-muted-foreground/80`;function Kz({children:e,className:t}){return(0,F.jsx)(`span`,{className:R(Wz,t),children:e})}function qz({position:e}){return(0,F.jsx)(`span`,{"aria-hidden":`true`,"data-tool-workflow-rail":`true`,className:R(`pointer-events-none absolute left-[0.575em] w-px -translate-x-1/2 bg-border/70`,e===`first`?`bottom-0 top-[0.86em]`:e===`last`?`top-0 h-[0.86em]`:`inset-y-0`)})}function Jz({children:e,className:t,interactive:n=!1,onClick:r,role:i,tabIndex:a,onKeyDown:o}){return(0,F.jsx)(`div`,{"data-chat-process-meta-row":`true`,className:R(Gz,n?`cursor-pointer transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`:null,t),onClick:r,role:i,tabIndex:a,onKeyDown:o,children:e})}function Yz({label:e,openGroup:t,open:n=!1,icon:r,className:i,leadingIconClassName:a,labelClassName:o,onClick:s}){return(0,F.jsxs)(`button`,{type:`button`,"data-chat-process-meta-row":`true`,className:R(Gz,`m-0 w-full border-0 bg-transparent p-0 text-left shadow-none transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,i),"aria-expanded":n,onClick:s,children:[r?(0,F.jsx)(Kz,{className:R(`relative z-[1] rounded-sm`,a),children:(0,F.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}):null,(0,F.jsx)(`span`,{className:R(`min-w-0 shrink truncate`,o),children:e}),(0,F.jsx)(`span`,{className:R(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,n?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 focus-visible:opacity-100`),children:(0,F.jsx)(eo,{className:R(`h-[1.05em] w-[1.05em] transition-transform`,n&&`rotate-90`),strokeWidth:2.25})})]})}function Xz(e,t,n){let r=Array.from(t).length;return(n??`${e} · {count}`).split(`{count}`).join(String(r))}function Zz({label:e,text:t,characterCountTemplates:n,isUser:r,isInProgress:i}){let{isOpen:a,onSummaryClick:o}=Vz({isInProgress:i}),s=(0,P.useRef)(null),c=Xz(e,t,i?n?.inProgress:n?.completed),{onScroll:l}=Uz({scrollRef:s,resetKey:`reasoning`,isLoading:!1,hasContent:t.length>0,contentVersion:t,stickyThresholdPx:20});return(0,F.jsxs)(`div`,{className:`group/reasoning`,children:[(0,F.jsx)(Yz,{openGroup:`reasoning`,open:a,icon:Qa,leadingIconClassName:r?`bg-primary`:`bg-card`,label:c,labelClassName:r?`text-primary-100`:void 0,onClick:o}),a?(0,F.jsx)(`div`,{ref:s,onScroll:l,"data-reasoning-scroll":`true`,className:R(`mt-1 w-fit max-w-[500px] max-h-56 overflow-y-auto rounded-lg custom-scrollbar`,r?`bg-primary/70`:`bg-muted`),children:(0,F.jsx)(`pre`,{className:`min-w-0 whitespace-pre-wrap break-all p-2 text-[11px]`,children:t})}):null]})}function Qz({children:e,className:t}){return(0,F.jsx)(`div`,{className:R(`relative my-0 flex w-full min-w-0 max-w-full flex-col text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function $z({children:e,className:t}){return(0,F.jsx)(`div`,{className:R(`mt-0.5 w-full max-w-full min-w-0 overflow-hidden pl-[calc(1.15em+0.375rem)] text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function eB({label:e,tone:t,children:n}){let r={input:{dot:`bg-muted-foreground/60`,body:`text-foreground`},output:{dot:`bg-primary/70`,body:`text-foreground`},error:{dot:`bg-rose-500/80`,body:`text-rose-950/85`}}[t];return(0,F.jsxs)(`section`,{className:`overflow-hidden rounded-md border border-border/70 bg-muted/20`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 px-2.5 py-1.5 text-[10px] font-medium tracking-wide text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:R(`h-1.5 w-1.5 rounded-full`,r.dot)}),(0,F.jsx)(`span`,{className:`normal-case tracking-normal`,children:e})]}),(0,F.jsx)(`div`,{className:`w-full overflow-hidden`,children:(0,F.jsx)(`pre`,{className:R(`w-full max-w-full min-w-0 max-h-64 overflow-x-auto overflow-y-auto px-2.5 py-2 font-mono text-[12px] leading-relaxed whitespace-pre custom-scrollbar`,r.body),children:n})})]})}var tB={running:{text:`text-muted-foreground`,icon:_n,spin:!0},success:{text:`text-muted-foreground/75`,icon:qt,spin:!1},error:{text:`text-destructive`,icon:cs,spin:!1},cancelled:{text:`text-muted-foreground/70`,icon:Vo,spin:!1}};function nB({card:e,iconOnly:t=!1}){let n=tB[e.statusTone]||tB.cancelled,r=n.icon,i=!t&&(e.statusTone===`running`||e.statusTone===`error`);return(0,F.jsxs)(`span`,{className:R(`inline-flex shrink-0 items-center gap-1 text-[0.925rem] font-normal leading-[1.72]`,n.text),"aria-label":t?e.statusLabel:void 0,children:[(0,F.jsx)(r,{"aria-hidden":`true`,className:R(`h-[1.05em] w-[1.05em]`,n.spin&&`animate-spin`),strokeWidth:2.25}),i?e.statusLabel:null]})}function rB(e){return e.kind===`show-content`?{icon:rn,label:e.label,toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}:{icon:qa,label:e.label??(e.sessionKind===`child`?`Open child session`:`Open session`),toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}}function iB({action:e,onAction:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=Qh,o=rB(e),s=o.icon;return(0,F.jsx)(i,{delayDuration:250,children:(0,F.jsxs)(n,{children:[(0,F.jsx)(a,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e)},className:R(`inline-flex h-6 w-6 items-center justify-center rounded-md border transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1`,o.toneClassName),"aria-label":o.label,title:o.label,children:(0,F.jsx)(s,{className:`h-3.5 w-3.5`,strokeWidth:2.25})})}),(0,F.jsx)(r,{side:`top`,className:`text-xs`,children:o.label})]})})}function aB(e){return e.replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim()}function oB(e,t){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),t())}function sB({label:e,summary:t}){return(0,F.jsxs)(`span`,{className:`min-w-0 shrink truncate`,children:[e,t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`mx-1.5 select-none text-muted-foreground/45`,children:`·`}),(0,F.jsx)(`span`,{title:t,children:t})]}):null]})}function cB({expanded:e}){return(0,F.jsx)(`span`,{className:R(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,e?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`),children:(0,F.jsx)(eo,{className:R(`h-[1.05em] w-[1.05em] transition-transform`,e&&`rotate-90`),strokeWidth:2.25})})}function lB({additions:e,deletions:t}){if(e===0&&t===0)return null;let n=[e>0?`+${e}`:null,t>0?`-${t}`:null].filter(Boolean).join(` `);return(0,F.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 tabular-nums text-muted-foreground/75`,"aria-label":n,children:[e>0?(0,F.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-emerald-600`,children:[`+`,e]}):null,t>0?(0,F.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-rose-600`,children:[`-`,t]}):null]})}function uB({card:e,toolLabel:t,changeSummary:n,icon:r,expanded:i,canExpand:a,hideSummary:o=!1,actionSlot:s,onToggle:c}){let l=o?``:e.summary?.replace(/^(command|path|args|query|input):\s*/i,``)??``,u=t??aB(e.toolName);return(0,F.jsxs)(Jz,{interactive:a,onClick:a?()=>c():void 0,role:a?`button`:void 0,tabIndex:a?0:void 0,onKeyDown:a?e=>oB(e,c):void 0,children:[(0,F.jsx)(Kz,{className:`relative z-[1] rounded-sm bg-card`,children:(0,F.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}),(0,F.jsx)(sB,{label:u,summary:l}),n?(0,F.jsx)(lB,{...n}):null,(0,F.jsx)(nB,{card:e,iconOnly:!!t}),a?(0,F.jsx)(cB,{expanded:i}):null,s?(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`,children:s}):null]})}function dB({action:e,onAction:t}){return(0,F.jsx)(iB,{action:e,onAction:t})}var fB=`font-mono text-[11px] leading-5`,pB=`flex h-5 w-full ${fB}`,mB=`flex h-5 items-center justify-center px-2.5 tabular-nums select-none`;function hB(e){let t=e.newLineNumber??e.oldLineNumber;return typeof t==`number`?String(t):``}function gB(e,t){return typeof t==`number`&&(e.newLineNumber??e.oldLineNumber)===t}function _B(e,t,n){return`${e}-${n}-${t.oldLineNumber??`x`}-${t.newLineNumber??`x`}`}function vB(e){return typeof e.newLineNumber==`number`||typeof e.oldLineNumber==`number`}function yB(e){return e.lines.some(vB)}function bB(e){let t=e.lines.reduce((e,t)=>vB(t)?Math.max(e,hB(t).length):e,0);return`${Math.max(6.5,Math.min(8,t+3.5))}ch`}function xB(e){return`calc(${e.lines.reduce((e,t)=>Math.max(e,Math.max(1,t.text.length)),1)}ch + 1.25rem)`}function SB(e){let t=e.split(/[\\/]/).filter(Boolean).pop()??e,n=t.split(/[?#]/)[0]??t,r=n.lastIndexOf(`.`);return r<=0||r===n.length-1?null:n.slice(r+1).toLowerCase()}function CB(e){return e.languageHint?.trim()||SB(e.path)||`text`}function wB(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?`language-${t}`:`language-text`}function TB(e){return e.kind===`remove`?`border-r border-rose-200 bg-rose-50 text-rose-700`:e.kind===`add`?`border-r border-emerald-200 bg-emerald-50 text-emerald-700`:`border-r border-border bg-muted text-muted-foreground`}function EB(e){return e.kind===`remove`?`bg-rose-50 text-rose-950`:e.kind===`add`?`bg-emerald-50 text-emerald-950`:`bg-card text-foreground`}function DB({layout:e,line:t,lineNumberColumnWidth:n,target:r}){return(0,F.jsx)(`span`,{"data-file-line-number-cell":`true`,style:e===`compact`?{width:n,minWidth:n}:void 0,className:R(mB,e===`compact`?`sticky left-0 z-[1]`:`w-full shrink-0`,TB(t),r?`bg-gray-200 font-medium text-gray-950`:null),children:hB(t)})}function OB({language:e,line:t,target:n,targetColumn:r,targetRef:i}){let a=(0,P.useMemo)(()=>XL.highlight(t.text||` `,e),[e,t.text]),o=typeof r==`number`&&Number.isSafeInteger(r)&&r>0?Math.min(r,t.text.length+1):null;return(0,F.jsxs)(`span`,{ref:o?void 0:i,"data-file-code-row":`true`,"data-file-code-language":a.language,"data-highlighted":a.highlighted?`true`:`false`,"data-file-target-column":o??void 0,className:R(`chat-file-code-syntax hljs relative block min-w-0 flex-1 whitespace-pre px-2.5`,wB(a.language),EB(t),n?`bg-gray-100/90`:null),children:[(0,F.jsx)(`span`,{dangerouslySetInnerHTML:{__html:a.html}}),o?(0,F.jsx)(`span`,{ref:i,"aria-hidden":`true`,"data-file-target-caret":`true`,className:`pointer-events-none absolute inset-y-0 w-px bg-primary`,style:{left:`calc(0.625rem + ${o-1}ch)`}}):null]})}function kB({language:e,line:t,showLineNumbers:n,lineNumberColumnWidth:r}){return(0,F.jsxs)(`div`,{"data-file-line-row":`true`,className:pB,children:[n?(0,F.jsx)(DB,{layout:`compact`,line:t,lineNumberColumnWidth:r}):null,(0,F.jsx)(OB,{language:e,line:t})]})}function AB({block:e,targetColumn:t,targetLine:n}){let r=yB(e),i=bB(e),a=xB(e),o=CB(e),s=(0,P.useRef)(null);return(0,P.useLayoutEffect)(()=>{s.current?.scrollIntoView({block:`center`,inline:t?`center`:`nearest`})},[e,t,n]),(0,F.jsxs)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`workspace`,className:`flex h-full min-h-full min-w-full bg-card`,children:[r?(0,F.jsxs)(`div`,{"data-file-code-gutter":`true`,style:{width:i,minWidth:i},className:R(`flex h-full min-h-full shrink-0 flex-col`,fB),children:[e.lines.map((e,t)=>(0,F.jsx)(DB,{layout:`workspace`,line:e,lineNumberColumnWidth:i,target:gB(e,n)},_B(`gutter`,e,t))),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 border-r border-border bg-muted`})]}):null,(0,F.jsxs)(`div`,{"data-file-code-canvas":`true`,className:`flex h-full min-h-full min-w-0 flex-1 flex-col bg-card`,children:[(0,F.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:a},children:e.lines.map((e,r)=>{let i=gB(e,n);return(0,F.jsx)(`div`,{"data-file-code-canvas-row":`true`,"data-file-target-line":i?`true`:void 0,"aria-current":i?`location`:void 0,className:pB,children:(0,F.jsx)(OB,{language:o,line:e,target:i,targetColumn:i?t:null,targetRef:i?s:void 0})},_B(`code`,e,r))})}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 bg-card`})]})]})}function jB({block:e,layout:t=`compact`,targetColumn:n,targetLine:r}){if(t===`workspace`)return(0,F.jsx)(AB,{block:e,targetColumn:n,targetLine:r});let i=yB(e),a=bB(e),o=xB(e),s=i?`calc(${a} + ${o})`:o,c=CB(e);return(0,F.jsx)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`compact`,className:`overflow-x-auto custom-scrollbar bg-card`,children:(0,F.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:s},children:e.lines.map((e,t)=>(0,F.jsx)(kB,{language:c,line:e,showLineNumbers:i,lineNumberColumnWidth:a},_B(`row`,e,t)))})})}function MB({block:e}){return(0,F.jsx)(jB,{block:e,layout:`compact`})}function NB(e){return e.display===`preview`}function PB(e){return e.rawText?e.rawText:e.lines.map(e=>[e.kind,e.oldLineNumber??``,e.newLineNumber??``,e.text].join(`:`)).join(`
54
+ `)}function FB(e){return/^\+\d+$/.test(e)?`text-emerald-700`:/^-\d+$/.test(e)?`text-rose-700`:`text-muted-foreground`}function IB(e){let t=e.split(`·`).map(e=>e.trim()).filter(e=>/^\+\d+$/.test(e)||/^-\d+$/.test(e));return t.length===0?null:(0,F.jsx)(`div`,{className:`flex shrink-0 items-center gap-x-1 whitespace-nowrap text-[10px] font-medium uppercase tracking-[0.08em]`,children:t.map((e,t)=>(0,F.jsxs)(P.Fragment,{children:[t>0?(0,F.jsx)(`span`,{className:`text-muted-foreground/45`,children:`·`}):null,(0,F.jsx)(`span`,{className:R(FB(e)),children:e})]},`${e}-${t}`))})}function LB(e){return{path:e.path,label:e.path.split(`/`).filter(Boolean).pop()??e.path,viewMode:e.display===`diff`?`diff`:`preview`,...e.rawText?{rawText:e.rawText}:{},...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...e.patchText?{patchText:e.patchText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{},fullLines:e.fullLines??e.lines}}function RB({children:e,contentVersion:t,resetKey:n,className:r,scrollKind:i}){let a=(0,P.useRef)(null),{onScroll:o}=Uz({scrollRef:a,resetKey:n,isLoading:!1,hasContent:!0,contentVersion:t,stickyThresholdPx:20});return(0,F.jsx)(`div`,{ref:a,onScroll:o,"data-file-scroll-kind":i,className:R(`overflow-y-auto bg-card custom-scrollbar`,r),children:e})}function zB({block:e,showPathRow:t,isFirst:n,onFileOpen:r}){let{Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=Qh,c=NB(e),l=t||!!e.caption;return(0,F.jsxs)(`section`,{className:R(`overflow-hidden bg-card`,!n&&`border-t border-border`),children:[l?(0,F.jsxs)(`div`,{className:R(`flex min-h-9 items-center justify-between gap-4 border-b border-border px-3 text-muted-foreground`,t?`py-2`:`py-1.5`),children:[(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,F.jsx)(o,{delayDuration:250,children:(0,F.jsxs)(i,{children:[(0,F.jsx)(s,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>{r&&r(LB(e))},className:R(`w-full truncate whitespace-nowrap text-left font-mono text-[12px] font-medium leading-5 text-foreground`,r&&`transition-colors hover:text-primary hover:underline`),title:e.path,children:e.path})}),(0,F.jsx)(a,{side:`top`,className:`max-w-[420px] text-xs font-mono break-all`,children:e.path})]})}):null}),e.caption?IB(e.caption):null]}):null,e.lines.length>0?(0,F.jsx)(RB,{resetKey:`block:${e.key}`,contentVersion:PB(e),className:`max-h-72`,scrollKind:`block`,children:(0,F.jsx)(MB,{block:e})}):e.rawText?(0,F.jsx)(RB,{resetKey:`raw:${e.key}`,contentVersion:e.rawText,className:`max-h-72`,scrollKind:`raw`,children:(0,F.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,F.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:e.rawText})})}):null,e.truncated&&!c?(0,F.jsx)(`div`,{className:`border-t border-border bg-muted px-3 py-2 text-[10px] text-muted-foreground`,children:`Showing a shortened diff preview.`}):null]})}function BB({card:e,className:t,onFileOpen:n,showPathRow:r=!0}){let i=e.fileOperation?.blocks??[],a=e.output?.trim()??``;return i.length===0&&!a?null:(0,F.jsxs)(`div`,{className:R(`overflow-hidden rounded-md border border-border/70 bg-card`,t),children:[i.map((e,t)=>(0,F.jsx)(zB,{block:e,showPathRow:r,isFirst:t===0,onFileOpen:n},e.key)),a?(0,F.jsx)(RB,{resetKey:`output:${e.toolName}:${e.summary??`none`}`,contentVersion:a,className:R(`max-h-56`,i.length>0&&`border-t border-border`),scrollKind:`output`,children:(0,F.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,F.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:a})})}):null]})}var VB=`\x1B`,HB=RegExp(`${VB}\\[(.*?)([ -/]*[@-~])`,`g`);function UB(e){return e.includes(`${VB}[`)}function WB(e){return e.replace(RegExp(`${VB}\\[[0-?]*[ -/]*[@-~]`,`g`),``)}function GB(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var KB={bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1},qB={1:{bold:!0},2:{dim:!0},3:{italic:!0},4:{underline:!0},7:{inverse:!0},22:{bold:!1,dim:!1},23:{italic:!1},24:{underline:!1},27:{inverse:!1},39:{fg:void 0},49:{bg:void 0}},JB={30:`black`,31:`red`,32:`green`,33:`yellow`,34:`blue`,35:`magenta`,36:`cyan`,37:`white`,90:`bright-black`,91:`bright-red`,92:`bright-green`,93:`bright-yellow`,94:`bright-blue`,95:`bright-magenta`,96:`bright-cyan`,97:`bright-white`},YB={40:`black`,41:`red`,42:`green`,43:`yellow`,44:`blue`,45:`magenta`,46:`cyan`,47:`white`,100:`bright-black`,101:`bright-red`,102:`bright-green`,103:`bright-yellow`,104:`bright-blue`,105:`bright-magenta`,106:`bright-cyan`,107:`bright-white`};function XB(e,t){let n=e[t+1];return n===5&&typeof e[t+2]==`number`?{color:`ansi-256-${e[t+2]}`,consumed:2}:n===2&&typeof e[t+2]==`number`&&typeof e[t+3]==`number`&&typeof e[t+4]==`number`?{color:`rgb(${e[t+2]},${e[t+3]},${e[t+4]})`,consumed:4}:null}function ZB(e,t){let n={...e};for(let e=0;e<t.length;e+=1){let r=t[e];if(r===0)return{...KB};let i=qB[r];if(i){n={...n,...i};continue}if(r===38||r===48){let i=XB(t,e);i&&(n=r===38?{...n,fg:i.color}:{...n,bg:i.color},e+=i.consumed);continue}if(JB[r]){n={...n,fg:JB[r]};continue}YB[r]&&(n={...n,bg:YB[r]})}return n}function QB(e){let t=[`ansi`];return e.bold&&t.push(`ansi-bold`),e.dim&&t.push(`ansi-dim`),e.italic&&t.push(`ansi-italic`),e.underline&&t.push(`ansi-underline`),e.inverse&&t.push(`ansi-inverse`),e.fg&&(e.fg.startsWith(`rgb(`)?t.push(`ansi-fg-custom`):e.fg.startsWith(`ansi-256-`)?(t.push(`ansi-fg-256`),t.push(e.fg)):t.push(`ansi-fg-${e.fg}`)),e.bg&&(e.bg.startsWith(`rgb(`)?t.push(`ansi-bg-custom`):e.bg.startsWith(`ansi-256-`)?(t.push(`ansi-bg-256`),t.push(e.bg)):t.push(`ansi-bg-${e.bg}`)),t.join(` `)}function $B(e){let t=[];return e.fg?.startsWith(`rgb(`)&&t.push(`color:${e.fg}`),e.bg?.startsWith(`rgb(`)&&t.push(`background-color:${e.bg}`),t.length>0?t.join(`;`):void 0}function eV(e){let t=QB(e),n=$B(e);return n?`<span class="${t}" style="${n}">`:`<span class="${t}">`}function tV(e){if(!e)return``;if(!UB(e))return GB(e);let t=``,n=0,r={...KB},i=!1,a=e=>{e&&(i||=(t+=eV(r),!0),t+=GB(e))},o=()=>{i&&=(t+=`</span>`,!1)};return e.replace(HB,(t,i,s,c)=>{if(a(e.slice(n,c)),n=c+t.length,s!==`m`)return t;let l=i.trim().length===0?[0]:i.split(`;`).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e));return o(),r=ZB(r,l.length>0?l:[0]),t}),a(e.slice(n)),o(),t}var nV=12e4;function rV(e){return e.length<=nV?e:`${e.slice(0,nV)}\n…`}function iV({code:e,language:t,preferAnsi:n=!1,className:r}){let i=rV(e),a=(0,P.useMemo)(()=>{if(n&&UB(i))return{html:tV(i),language:`ansi`,highlighted:!0};let e=WB(i);return XL.highlight(e,t)},[t,n,i]);return(0,F.jsx)(`code`,{className:R(`hljs chat-terminal-code`,`language-${a.language}`,r),"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})}function aV({command:e,output:t,emptyLabel:n,isRunning:r,hasOutput:i,isError:a=!1}){return(0,F.jsx)(`div`,{className:R(`chat-terminal-surface`,a?`chat-terminal-surface-error`:void 0),"data-testid":`chat-terminal-surface`,children:(0,F.jsxs)(`div`,{className:`chat-terminal-body custom-scrollbar`,children:[(0,F.jsxs)(`div`,{className:`chat-terminal-line chat-terminal-line-command`,children:[(0,F.jsx)(`span`,{className:`chat-terminal-gutter`,"aria-hidden":`true`,children:`$`}),(0,F.jsx)(`div`,{className:`chat-terminal-line-content`,children:e?(0,F.jsxs)(`pre`,{className:`chat-terminal-pre`,children:[(0,F.jsx)(iV,{code:e,language:`bash`}),r&&!i?(0,F.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,F.jsx)(`div`,{className:`chat-terminal-skeleton`})})]}),(i||!r)&&(0,F.jsx)(`div`,{className:`chat-terminal-output-block`,children:i?(0,F.jsxs)(`pre`,{className:R(`chat-terminal-pre chat-terminal-output`,a?`chat-terminal-pre-error`:void 0),children:[(0,F.jsx)(iV,{code:t,language:a?`text`:`shell`,preferAnsi:!0,className:a?`chat-terminal-code-error`:void 0}),r?(0,F.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,F.jsx)(`div`,{className:`chat-terminal-empty`,children:n})})]})})}var oV=200;function sV(e){return typeof e==`string`&&e.length>0?e:null}function cV(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lV(e){return`command`in e||`workingDir`in e||`exitCode`in e||`durationMs`in e||`stdout`in e||`stderr`in e||`aggregated_output`in e||`combinedOutput`in e}function uV(e){let t=sV(e.aggregated_output)??sV(e.combinedOutput)??sV(e.output);if(t)return t;let n=sV(e.stdout),r=sV(e.stderr);return!n&&!r?null:[n,r].filter(e=>!!e).join(`
55
+ `)}function dV(e,t){if(cV(t)){let e=uV(t);if(e)return e;if(lV(t))return``}if(!e)return``;let n=e.trim();if(!n.startsWith(`{`))return e;try{let t=JSON.parse(n);return cV(t)?uV(t)||(lV(t)?``:e):e}catch{return e}}function fV(e){return e===`write_file`||e===`edit_file`}function pV(e){return e.reduce((e,t)=>({additions:e.additions+t.lines.filter(e=>e.kind===`add`).length,deletions:e.deletions+t.lines.filter(e=>e.kind===`remove`).length}),{additions:0,deletions:0})}function mV({canExpand:e,isRunning:t,autoExpandWhileRunning:n=!0,expandOnError:r=!1,statusTone:i}){let[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(!1),l=(0,P.useRef)(null),u=(0,P.useRef)(t),d=(0,P.useRef)(!0);return(0,P.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]),(0,P.useEffect)(()=>{if(r&&i===`error`&&e&&!s){l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(!0),u.current=t,d.current=!1;return}n&&t&&e&&!s&&!a&&(d.current||!u.current)&&(l.current=window.setTimeout(()=>{o(!0),l.current=null},oV)),t||(l.current!==null&&(window.clearTimeout(l.current),l.current=null),u.current&&!s&&o(!1)),u.current=t,d.current=!1},[n,e,r,a,s,t,i]),{expanded:a,onToggle:()=>{e&&(l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(e=>!e),c(!0))}}}function hV(e){return cV(e)?{exitCode:typeof e.exitCode==`number`?e.exitCode:typeof e.exit_code==`number`?e.exit_code:null,workingDir:sV(e.workingDir)??sV(e.cwd)??sV(e.working_directory)}:{}}function gV({card:e,toolLabel:t}){let n=dV(e.output,e.outputData),r=e.statusTone===`running`,i=e.summary?.replace(/^(command|path|args|query|input):\s*/i,``),a=n.trim().length>0,o=r||a||!!i?.trim(),s=hV(e.outputData),{expanded:c,onToggle:l}=mV({canExpand:o,isRunning:r,autoExpandWhileRunning:!1,expandOnError:o,statusTone:e.statusTone});return(0,F.jsxs)(Qz,{children:[(0,F.jsx)(uB,{card:e,toolLabel:t,icon:ss,expanded:c,canExpand:o,onToggle:l}),c&&(0,F.jsx)($z,{className:`bg-transparent py-0`,children:(0,F.jsx)(aV,{command:i,output:n,emptyLabel:e.emptyLabel,isRunning:r,hasOutput:a,isError:e.statusTone===`error`,exitCode:s.exitCode,workingDir:s.workingDir})})]})}function _V({card:e,toolLabel:t,onFileOpen:n}){let r=e.input?.trim()??``,i=e.output?.trim()??``,a=e.statusTone===`running`,o=!!e.fileOperation?.blocks.length,s=!!r&&!o,c=o||!!r||!!i,l=e.fileOperation?.blocks??[],u=l.reduce((e,t)=>e+t.lines.length,0),d=l.reduce((e,t)=>t.rawText?e+t.rawText.length:e+t.lines.reduce((e,t)=>e+t.text.length+1,0),0),f=fV(e.toolName)&&!(a&&e.toolName===`write_file`&&(u>24||d>1200)),{expanded:p,onToggle:m}=mV({canExpand:c||a,isRunning:a,autoExpandWhileRunning:f,expandOnError:c,statusTone:e.statusTone}),h=e.toolName===`edit_file`||e.toolName===`write_file`||e.toolName===`apply_patch`||e.toolName===`file_change`;return(0,F.jsxs)(Qz,{children:[(0,F.jsx)(uB,{card:e,toolLabel:t,changeSummary:h?pV(l):void 0,icon:h?oo:Zt,expanded:p,canExpand:c||a,hideSummary:!1,onToggle:m}),p&&c?(0,F.jsxs)($z,{className:`bg-transparent py-0`,children:[s?(0,F.jsx)(eB,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:r}):null,s&&i?(0,F.jsx)(`div`,{className:`h-2`}):null,o||i?(0,F.jsx)(BB,{card:e,onFileOpen:n,showPathRow:!0}):null]}):null]})}function vV({card:e,toolLabel:t,icon:n=st}){let r=e.statusTone===`running`,i=e.output?.trim()??``,{expanded:a,onToggle:o}=mV({canExpand:!!i||r,isRunning:r,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,F.jsxs)(Qz,{children:[(0,F.jsx)(uB,{card:e,toolLabel:t,icon:n,expanded:a,canExpand:!!i||r,onToggle:o}),a&&i&&(0,F.jsx)($z,{className:`py-0`,children:(0,F.jsx)(`pre`,{className:`font-mono text-[12px] text-muted-foreground whitespace-pre-wrap break-all w-full max-w-full max-h-64 overflow-y-auto overflow-x-hidden min-w-0 custom-scrollbar leading-relaxed`,children:i})})]})}function yV(e,t,n){let r=e.agentId&&n?n(e.agentId):null,i=e.action&&t?(0,F.jsx)(dB,{action:e.action,onAction:t}):null;return r||i?(0,F.jsxs)(F.Fragment,{children:[r,i]}):void 0}function bV({card:e,toolLabel:t,icon:n=ps,onToolAction:r,renderToolAgent:i}){let a=e.input?.trim()??``,o=e.output?.trim()??``,s=e.statusTone===`running`,c=a.length>0,l=o.length>0,u=c||l,d=yV(e,r,i),{expanded:f,onToggle:p}=mV({canExpand:u||s,isRunning:s,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,F.jsxs)(Qz,{children:[(0,F.jsx)(uB,{card:e,toolLabel:t,icon:n,expanded:f,canExpand:u||s,actionSlot:d,onToggle:p}),f&&u?(0,F.jsxs)($z,{className:`bg-transparent py-0`,children:[c?(0,F.jsx)(eB,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:a}):null,c&&l?(0,F.jsx)(`div`,{className:`h-2`}):null,l?(0,F.jsx)(eB,{label:e.outputLabel?.trim()||`Output`,tone:e.statusTone===`error`?`error`:`output`,children:o}):null]}):null]})}function xV({card:e,onToolAction:t,renderPanelAppCard:n}){let{panelApp:r}=e;return r&&n?n(r):(0,F.jsx)(bV,{card:e,onToolAction:t})}function SV(e){let t=e.toLowerCase();return t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t.includes(`run_`)}function CV(e){let t=e.toLowerCase();return t===`read_file`||t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function wV(e){let t=e.toLowerCase();return t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function TV(e){let t=e.toLowerCase();return t===`grep_search`||t===`find_files`||t.includes(`search`)}var EV={list_dir:{statusKind:`directory`,icon:So},web_fetch:{statusKind:`web`,icon:uo},message:{statusKind:`message`,icon:Qo},sessions_list:{statusKind:`session`,icon:dn},sessions_history:{statusKind:`session`,icon:dn},sessions_request:{statusKind:`session`,icon:dn},spawn:{statusKind:`agent`,icon:Ya},sessions_spawn:{statusKind:`agent`,icon:Ya},subagents:{statusKind:`agent`,icon:Ya},memory_search:{statusKind:`memory`,icon:Qa},memory_get:{statusKind:`memory`,icon:Qa},cron:{statusKind:`schedule`,icon:$a},gateway:{statusKind:`system`,icon:ln},view_image:{statusKind:`image`,icon:ko},show_file:{statusKind:`display`,icon:rn},show_url:{statusKind:`display`,icon:rn},show_panel_app:{statusKind:`display`,icon:rn},show_content:{statusKind:`display`,icon:rn}};function DV(e){return EV[e.toLowerCase()]??null}function OV({card:e,toolStatusLabels:t,onToolAction:n,onFileOpen:r,renderToolAgent:i,renderPanelAppCard:a}){if(e.panelApp)return(0,F.jsx)(xV,{card:e,onToolAction:n,renderPanelAppCard:a});let o=DV(e.toolName),s=o?t?.builtIn?.[o.statusKind]?.[e.statusTone]:void 0;return SV(e.toolName)?(0,F.jsx)(gV,{card:e,toolLabel:t?.terminal[e.statusTone]}):CV(e.toolName)?(0,F.jsx)(_V,{card:e,toolLabel:wV(e.toolName)?t?.fileEdit[e.statusTone]:t?.fileRead[e.statusTone],onFileOpen:r}):TV(e.toolName)?(0,F.jsx)(vV,{card:e,toolLabel:s??t?.search[e.statusTone],icon:o?.icon}):(0,F.jsx)(bV,{card:e,toolLabel:s,icon:o?.icon,onToolAction:n,renderToolAgent:i})}function kV({group:e,open:t,isUser:n,reasoningCharacterCountTemplates:r,toolStatusLabels:i,onToolAction:a,onFileOpen:o,renderToolAgent:s,renderPanelAppCard:c,onOpenChange:l}){let u=e.parts.filter(e=>e.type===`tool-card`).length,d=t&&u>1;return(0,F.jsxs)(`div`,{className:`group/tool-activity`,children:[(0,F.jsx)(Yz,{openGroup:`tool-activity`,open:t,icon:fs,leadingIconClassName:`bg-card`,label:e.label,onClick:()=>l(!t)}),t?(0,F.jsx)(`div`,{className:`text-[0.925rem] leading-[1.72]`,children:e.parts.map((t,l)=>{let u=l===e.parts.length-1;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[d?(0,F.jsx)(qz,{position:l===0?`first`:u?`last`:`middle`}):null,t.type===`tool-card`?(0,F.jsx)(OV,{card:t.card,toolStatusLabels:i,onToolAction:a,onFileOpen:o,renderToolAgent:s,renderPanelAppCard:c}):(0,F.jsx)(Zz,{label:t.label,text:t.text,characterCountTemplates:r,isUser:n,isInProgress:!1})]},`tool-group-item-${e.startIndex+l}`)})}):null]})}var AV=3;function jV(e){return e.type===`tool-card`}function MV(e){return e?.type===`reasoning`||e?.type===`tool-card`&&!e.card.panelApp}function NV(e){let t=e.toLowerCase();return t===`list_dir`?`directory`:t.includes(`show_content`)||t.includes(`panel_app`)||t.includes(`panel`)?`panel`:t===`spawn`||t.includes(`subagent`)||t.includes(`session_request`)||t.includes(`agent`)&&!t.includes(`read`)?`agent`:t.includes(`web_`)||t.includes(`_web`)||t.includes(`url`)||t.includes(`fetch`)||t.includes(`http`)?`web`:t===`grep_search`||t===`find_files`||t===`search_files`||t.includes(`search`)||t.includes(`grep`)?`search`:t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t===`terminal`||t.includes(`run_`)?`bash`:t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`||t===`multi_replace`||t.includes(`write_file`)||t.includes(`edit_file`)||t.includes(`apply_patch`)?`edit`:t===`read_file`||t===`read`||t===`view_file`||t.includes(`read_file`)||t.startsWith(`read_`)?`read`:`other`}function PV(e){return e===`error`?0:e===`cancelled`?1:e===`running`?2:3}function FV(e,t,n){if(t!==`read`&&t!==`edit`&&t!==`directory`)return[`call:${n}`];let r=e.fileOperation?.blocks.map(({path:e})=>e.trim()).filter(Boolean),i=e.summary?.replace(/^(path|file):\s*/i,``).trim();return r?.length?r:[i||`call:${n}`]}function IV(e,t){let n=t.segmentTemplates[e.family],r=e.count===1?n.one:n.other.split(`{count}`).join(String(e.count));return e.tone===`error`?`${r} ${t.failedLabel}`:e.tone===`cancelled`?`${r} ${t.cancelledLabel}`:r}function LV(e){let t=[],n=new Map;for(let[r,i]of e.entries()){let e=NV(i.toolName),a=FV(i,e,r),o=n.get(e);if(!o){t.push(e),n.set(e,{units:new Set(a),tone:i.statusTone});continue}a.forEach(e=>o.units.add(e)),PV(i.statusTone)<PV(o.tone)&&(o.tone=i.statusTone)}let r=t.map(e=>{let t=n.get(e);return{family:e,count:t.units.size,tone:t.tone}});return r.sort((e,n)=>{let r=PV(e.tone)-PV(n.tone);return r===0?t.indexOf(e.family)-t.indexOf(n.family):r}),r}function RV(e){let{labels:t,segments:n}=e;if(n.length===0)return``;let r=n.slice(0,AV),i=n.length-r.length,a=r.map(e=>IV(e,t));return i>0&&a.push(`+${i}`),a.join(` · `)}function zV(e,t){let n=[],r=t,i=-1;for(;;){let t=e[r];if(!MV(t))break;n.push(t),t.type===`tool-card`&&(i=n.length-1),r+=1}return{candidateParts:n,lastToolOffset:i}}function BV(e,t){let n=[],r=0;for(;r<e.length;){let i=e[r];if(i.type!==`tool-card`||i.card.panelApp){n.push({kind:`part`,key:`part-${r}`,index:r,part:i}),r+=1;continue}let a=r,{candidateParts:o,lastToolOffset:s}=zV(e,a),c=o.filter(jV);if(c.length===1){n.push({kind:`part`,key:`part-${a}`,index:a,part:i}),r=a+1;continue}let l=o.slice(0,s+1);r=a+l.length;let u=LV(c.map(e=>e.card)),d=RV({segments:u,labels:t});n.push({kind:`tool-group`,key:`tool-group-${a}`,group:{key:`tool-group-${a}`,startIndex:a,endIndex:r-1,parts:l,segments:u,label:d}})}return n}var VV={segmentTemplates:{read:{one:`Read 1 file`,other:`Read {count} files`},edit:{one:`Edit 1 file`,other:`Edit {count} files`},directory:{one:`View 1 directory`,other:`View {count} directories`},search:{one:`Search 1 time`,other:`Search {count} times`},bash:{one:`Run 1 command`,other:`Run {count} commands`},web:{one:`Open 1 page`,other:`Open {count} pages`},agent:{one:`Start 1 subtask`,other:`Start {count} subtasks`},panel:{one:`Show 1 result`,other:`Show {count} results`},other:{one:`Use 1 tool`,other:`Use {count} tools`}},failedLabel:`failed`,cancelledLabel:`cancelled`};function HV(e){return{segmentTemplates:{...VV.segmentTemplates,...e.toolActivitySegmentTemplates??{}},failedLabel:e.toolActivityFailedLabel??VV.failedLabel,cancelledLabel:e.toolActivityCancelledLabel??VV.cancelledLabel}}function UV(e){return e===`pending`||e===`streaming`}function WV(e){return e.type===`reasoning`||e.type===`tool-card`}function GV(e){if(e.role!==`assistant`||!e.processSummary||UV(e.status))return null;let t=-1;for(let n=e.parts.length-1;n>=0;--n)if(WV(e.parts[n])){t=n;break}return t<0||t>=e.parts.length-1?null:{processParts:e.parts.slice(0,t+1),finalParts:e.parts.slice(t+1)}}function KV({index:e,isInProgress:t,isLastPart:n,isUser:r,onAttachmentOpen:i,onFileOpen:a,onInlineTokenClick:o,onToolAction:s,part:c,renderInlineDisplay:l,renderPanelAppCard:u,renderToolAgent:d,resolveFileContentUrl:f,role:p,texts:m}){let{type:h}=c;if(h===`markdown`){let{inlineTokens:r,text:i}=c;return(0,F.jsx)(cz,{text:i,role:p,texts:m,isStreaming:t&&n,inlineTokens:r,onFileOpen:a,onInlineTokenClick:o,resolveFileContentUrl:f,renderInlineDisplay:l},`markdown-${e}`)}if(h===`reasoning`){let{label:i,text:a}=c;return(0,F.jsx)(Zz,{label:i,text:a,characterCountTemplates:m.reasoningCharacterCountTemplates,isUser:r,isInProgress:t&&n},`reasoning-${e}`)}if(h===`tool-card`){let{card:t}=c;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,F.jsx)(qz,{position:`single`}),(0,F.jsx)(OV,{card:t,toolStatusLabels:m.toolStatusLabels,onToolAction:s,onFileOpen:a,renderToolAgent:d,renderPanelAppCard:u})]},`tool-${e}`)}if(h===`file`){let{file:t}=c;return(0,F.jsx)(Lz,{file:t,isUser:r,texts:m,onOpen:i},`file-${e}`)}if(h===`unknown`){let{label:t,rawType:n,text:r}=c;return(0,F.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/60 px-2.5 py-2 text-xs text-muted-foreground`,children:[(0,F.jsxs)(`div`,{className:`font-semibold text-foreground`,children:[t,`: `,n]}),r?(0,F.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground`,children:r}):null]},`unknown-${e}`)}return null}function qV(e){let{isInProgress:t,isUser:n,onAttachmentOpen:r,onFileOpen:i,onInlineTokenClick:a,onToolActivityOpenChange:o,onToolAction:s,openToolGroupKeys:c,parts:l,renderInlineDisplay:u,renderPanelAppCard:d,renderToolAgent:f,resolveFileContentUrl:p,role:m,texts:h,indexOffset:g=0}=e;return Bz(BV(l,HV(h))).map(e=>e.kind===`image-group`?(0,F.jsx)(Rz,{group:e,indexOffset:g,isUser:n,texts:h,onOpen:r},`${e.key}-${g}`):e.kind===`tool-group`?(0,F.jsx)(kV,{group:e.group,open:c.has(e.group.key),isUser:n,reasoningCharacterCountTemplates:h.reasoningCharacterCountTemplates,toolStatusLabels:h.toolStatusLabels,onToolAction:s,onFileOpen:i,renderToolAgent:f,renderPanelAppCard:d,onOpenChange:t=>o(e.group.key,t)},e.key):KV({part:e.part,index:g+e.index,role:m,isUser:n,isInProgress:t,isLastPart:g+e.index===g+l.length-1,texts:h,onToolAction:s,onFileOpen:i,onAttachmentOpen:r,onInlineTokenClick:a,resolveFileContentUrl:p,renderInlineDisplay:u,renderToolAgent:f,renderPanelAppCard:d}))}var JV=(0,P.memo)(function({layout:e,message:t,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l,resolveFileContentUrl:u}){let{role:d}=t,f=d===`user`,p=e===`flat`&&!f,m=UV(t.status),h=GV(t),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(()=>new Set),b=(e,t)=>{y(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),t&&_(!0)};return(0,F.jsx)(`div`,{"data-chat-message-surface":p?`flat`:`card`,className:R(`max-w-full has-[[data-chat-message-wide-content=true]]:w-full`,p?`block w-full text-foreground`:`inline-block w-fit rounded-2xl border px-4 shadow-sm`,!p&&(f?`nextclaw-chat-message-user rounded-[1.45rem] border-primary bg-primary py-2.5 text-primary-foreground shadow-none`:d===`assistant`?`border-border bg-card pb-3 pt-4 text-card-foreground`:`border-border bg-muted/45 py-3 text-foreground`)),children:(0,F.jsx)(`div`,{className:`space-y-0`,children:h?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`group/process`,children:[(0,F.jsx)(`div`,{className:`mb-2 border-b border-border/60 pb-2`,children:(0,F.jsx)(Yz,{openGroup:`process`,open:g,icon:No,leadingIconClassName:`bg-card`,label:t.processSummary?.label,onClick:()=>_(e=>!e)})}),g?(0,F.jsx)(`div`,{className:`space-y-0`,children:qV({parts:h.processParts,role:d,isUser:f,isInProgress:m,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,resolveFileContentUrl:u,openToolGroupKeys:v,onToolActivityOpenChange:b,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l})}):null]}),qV({parts:h.finalParts,role:d,isUser:f,isInProgress:m,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,resolveFileContentUrl:u,openToolGroupKeys:v,onToolActivityOpenChange:b,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l,indexOffset:h.processParts.length})]}):qV({parts:t.parts,role:d,isUser:f,isInProgress:m,texts:n,onToolAction:r,onFileOpen:i,onAttachmentOpen:a,onInlineTokenClick:o,resolveFileContentUrl:u,openToolGroupKeys:v,onToolActivityOpenChange:b,renderInlineDisplay:s,renderToolAgent:c,renderPanelAppCard:l})})})});function YV({message:e,texts:t}){let n=(0,P.useMemo)(()=>e.parts.map(e=>e.type===`markdown`||e.type===`unknown`?e.text:``).filter(e=>!!e&&e.trim().length>0).join(`
56
+
57
+ `),[e.parts]),{copied:r,copy:i}=aL({text:n}),a=r?t.copiedMessageLabel:t.copyMessageLabel,{Tooltip:o,TooltipContent:s,TooltipProvider:c,TooltipTrigger:l}=Qh;return n?(0,F.jsx)(c,{delayDuration:250,children:(0,F.jsxs)(o,{children:[(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>void i(),className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,"aria-label":a,children:r?(0,F.jsx)(qt,{className:`h-3.5 w-3.5`}):(0,F.jsx)(so,{className:`h-3.5 w-3.5`})})}),(0,F.jsx)(s,{side:`top`,className:`text-xs`,children:a})]})}):null}var XV=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g,ZV=`
58
+ @keyframes nextclaw-chat-typing-text-sheen {
59
+ 0% {
60
+ background-position: 160% 0;
61
+ }
62
+ 100% {
63
+ background-position: -60% 0;
64
+ }
65
+ }
66
+ .nextclaw-chat-typing-indicator__text {
67
+ background-image: linear-gradient(
68
+ 100deg,
69
+ hsl(var(--muted-foreground)) 0%,
70
+ hsl(var(--muted-foreground)) 34%,
71
+ hsl(var(--foreground-tertiary)) 43%,
72
+ hsl(var(--foreground-muted)) 50%,
73
+ hsl(var(--foreground-tertiary)) 57%,
74
+ hsl(var(--muted-foreground)) 66%,
75
+ hsl(var(--muted-foreground)) 100%
76
+ );
77
+ background-size: 240% 100%;
78
+ background-position: 160% 0;
79
+ -webkit-background-clip: text;
80
+ background-clip: text;
81
+ color: transparent;
82
+ -webkit-text-fill-color: transparent;
83
+ animation: nextclaw-chat-typing-text-sheen 2.5s linear infinite;
84
+ }
85
+
86
+ @media (prefers-reduced-motion: reduce) {
87
+ .nextclaw-chat-typing-indicator__text {
88
+ animation: none;
89
+ background-image: none;
90
+ color: hsl(var(--muted-foreground));
91
+ -webkit-text-fill-color: currentColor;
92
+ }
93
+ }
94
+ `;function QV(e){let t=e.trim();return t?t.replace(XV,``).trim().length>0:!1}function $V(e){return e.parts.some(e=>e.type===`markdown`||e.type===`reasoning`?QV(e.text):!0)}function eH(){return(0,F.jsx)(`div`,{className:`flex items-center gap-2 px-1 py-0.5 text-[11px] text-muted-foreground`,children:(0,F.jsxs)(`div`,{className:`flex space-x-1 items-center h-full`,children:[(0,F.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse`}),(0,F.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:200ms]`}),(0,F.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:400ms]`})]})})}function tH({label:e,layout:t}){return(0,F.jsxs)(`div`,{"data-chat-message-surface":t===`flat`?`flat`:`card`,className:R(`text-sm text-muted-foreground`,t===`flat`?`py-1`:`rounded-2xl border border-border bg-card px-4 py-3 shadow-sm`),children:[(0,F.jsx)(`style`,{children:ZV}),(0,F.jsx)(`span`,{className:`nextclaw-chat-typing-indicator__text`,children:e})]})}function nH({className:e,isSending:t,layout:n=`card`,messages:r,onAttachmentOpen:i,onFileOpen:a,onInlineTokenClick:o,onToolAction:s,renderInlineDisplay:c,renderPanelAppCard:l,renderToolAgent:u,resolveFileContentUrl:d,texts:f}){let p=r.filter($V),m=p.some(e=>e.role===`assistant`&&(e.status===`streaming`||e.status===`pending`));return(0,F.jsxs)(`div`,{className:R(`space-y-5`,e),children:[p.map(e=>{let t=e.role===`user`,r=!t&&(e.status===`streaming`||e.status===`pending`),p=(0,F.jsx)(JV,{layout:n,message:e,texts:f,onToolAction:s,onFileOpen:a,onAttachmentOpen:i,onInlineTokenClick:o,resolveFileContentUrl:d,renderInlineDisplay:c,renderToolAgent:u,renderPanelAppCard:l});return n===`flat`&&!t?(0,F.jsxs)(`article`,{"data-chat-message-layout":`flat`,className:`w-full min-w-0 space-y-2`,children:[(0,F.jsxs)(`div`,{"data-chat-message-header":`flat`,className:`flex min-w-0 items-center gap-2.5`,children:[(0,F.jsx)(aD,{role:e.role,size:`compact`}),(0,F.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:e.roleLabel})]}),(0,F.jsx)(`div`,{"data-chat-message-body":`flat`,className:`min-w-0 w-full`,children:p}),r?(0,F.jsx)(`div`,{className:`w-full`,children:(0,F.jsx)(eH,{})}):(0,F.jsxs)(`div`,{"data-chat-message-footer":`flat`,className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`px-1 text-[11px] leading-4 text-muted-foreground`,children:e.timestampLabel}),(0,F.jsx)(YV,{message:e,texts:f})]})]},e.id):(0,F.jsxs)(`div`,{"data-chat-message-layout":`card`,className:R(`flex gap-3`,t?`justify-end`:`justify-start`),children:[t?null:(0,F.jsx)(aD,{role:e.role}),(0,F.jsxs)(`div`,{className:R(`w-fit max-w-[92%] space-y-2 has-[[data-chat-message-wide-content=true]]:w-full`,t&&`flex flex-col items-end`),children:[p,(0,F.jsx)(`div`,{className:R(`flex items-center gap-2`,t&&`justify-end`),children:r?(0,F.jsx)(eH,{}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:R(`px-1 text-[11px] leading-4 text-muted-foreground`,t?`text-right`:`text-left`),children:[e.roleLabel,` · `,e.timestampLabel]}),(0,F.jsx)(YV,{message:e,texts:f})]})})]}),t?(0,F.jsx)(aD,{role:e.role}):null]},e.id)}),t&&!m?(0,F.jsxs)(`div`,{"data-chat-message-layout":n,className:`flex justify-start gap-3`,children:[(0,F.jsx)(aD,{role:`assistant`,size:n===`flat`?`compact`:`default`}),(0,F.jsx)(tH,{label:f.typingLabel,layout:n})]}):null]})}function rH(e){return{key:e.key,triggerSpecs:[e.trigger],resolvePanel:t=>t.trigger.key===e.trigger.key?e.resolvePanel(t):null}}function iH(e){return rH({key:e.key,trigger:e.trigger,resolvePanel:t=>({isLoading:e.getIsLoading?.(t)??!1,items:e.getItems({context:t,records:e.getRecords(t),query:t.trigger.query,tokenKind:e.tokenKind}),onSelectItem:e.onSelectItem,texts:e.texts})})}function aH(e){let{data:t,plugins:n,trigger:r}=e,i=n.flatMap(e=>[...e.triggerSpecs]);if(!r)return{triggerSpecs:i,panel:null};for(let e of n){let n=e.resolvePanel({data:t,trigger:r});if(n)return{triggerSpecs:i,panel:n}}return{triggerSpecs:i,panel:null}}var oH=[`cmd`,`command`,`query`,`q`,`path`,`url`,`to`,`channel`,`agentId`,`sessionKey`];function sH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cH(e,t=2400){return e.length<=t?e:`${e.slice(0,t)}\n…`}function lH(e,t=120){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:t<=1?`…`:`${n.slice(0,t-1)}…`}function uH(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(e==null)return``;try{return cH(JSON.stringify(e,null,2))}catch{return String(e)}}function dH(e){if(sH(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return null;try{let e=JSON.parse(t);return sH(e)?e:null}catch{return null}}function fH(e){let t=dH(e);if(!t){let t=uH(e).trim();return t?lH(t,120):void 0}let n=[];for(let e of oH){let r=t[e];if(typeof r==`string`&&r.trim()?n.push(`${e}: ${r.trim()}`):(typeof r==`number`||typeof r==`boolean`)&&n.push(`${e}: ${String(r)}`),n.length>=2)break}return n.length>0?lH(n.join(` · `),120):lH(uH(t),140)}var pH=`ui_inline_tokens`,mH=`$`,hH=`@panel-app:`,gH=/@panel-app:([A-Za-z0-9_-]+)/g;function _H(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function vH(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function yH(e){let t=new Set,n=[];for(let r of e){let e=`${r.kind}:${r.key}:${r.rawText}`;t.has(e)||(t.add(e),n.push(r))}return n}function bH(e){let t=[];for(let n of e)n.type!==`token`||n.tokenKind!==`skill`||t.push({kind:`skill`,key:n.tokenKey,label:n.label,rawText:`${mH}${n.tokenKey}`});return yH(t)}function xH(e){let t=[];for(let n of e.matchAll(gH)){let e=n[1];e&&t.push({kind:`panel_app`,key:e,label:e,rawText:`${hH}${e}`})}return yH(t)}function SH(e,t){return yH([...t,...xH(e)])}function CH(e){let t=e?.[pH];if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!_H(e))continue;let t=vH(e.kind),r=vH(e.key),i=vH(e.rawText);!t||!r||!i||n.push({kind:t,key:r,rawText:i,label:vH(e.label)??r})}return yH(n)}var wH=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g;function TH(e){let t=e.trim();return t&&t.replace(wH,``).trim()?t:null}function EH(e,t){let n=TH(e.text);if(!n)return null;let r=SH(e.text,t);return{type:`markdown`,text:n,inlineTokens:r.length>0?r:void 0}}function DH(e){return TH(e)}function OH(e){return typeof e==`object`&&!!e}function kH(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function AH(e){if(typeof e==`number`&&Number.isFinite(e)&&e>=0)return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=Number(t);return Number.isFinite(n)&&n>=0?n:null}function jH(e){return OH(e)?`command`in e||`workingDir`in e||`exitCode`in e||`stdout`in e||`stderr`in e||`aggregated_output`in e||`combinedOutput`in e:!1}function MH(e,t){if(!OH(e))return null;let n=OH(e.asset)?e.asset:Array.isArray(e.assets)&&e.assets.length>0&&OH(e.assets[0])?e.assets[0]:null;if(!n)return null;let r=kH(n.url),i=kH(n.mimeType)??`application/octet-stream`,a=AH(n.sizeBytes);return r?{type:`file`,file:{label:kH(n.name)??(i.startsWith(`image/`)?t.imageAttachmentLabel:t.fileAttachmentLabel),mimeType:i,dataUrl:r,...a==null?{}:{sizeBytes:a},isImage:i.startsWith(`image/`)}}:null}function NH(e,t){return{kind:e.kind,toolName:e.name,...`agentId`in e&&e.agentId?{agentId:e.agentId}:{},summary:e.detail,inputLabel:t.toolInputLabel,input:`input`in e&&typeof e.input==`string`?e.input:void 0,output:e.text,outputData:e.outputData,hasResult:!!e.hasResult,statusTone:e.statusTone,statusLabel:e.statusLabel,titleLabel:e.kind===`call`?t.toolCallLabel:t.toolResultLabel,outputLabel:t.toolOutputLabel,emptyLabel:t.toolNoOutputLabel,...`action`in e&&e.action?{action:e.action}:{},...`fileOperation`in e&&e.fileOperation?{fileOperation:e.fileOperation}:{},...`panelApp`in e&&e.panelApp?{panelApp:e.panelApp}:{}}}function PH(e){let{cancelled:t,error:n,result:r,status:i,texts:a}=e,o=typeof i==`string`?i.trim().toLowerCase():``,s=typeof n==`string`&&n.trim().length>0;return t===!0||o===`cancelled`?{kind:`result`,hasResult:!0,statusTone:`cancelled`,statusLabel:a.toolStatusCancelledLabel}:s||o===`error`?{kind:`result`,hasResult:!0,statusTone:`error`,statusLabel:a.toolStatusFailedLabel}:o===`result`||r!=null?{kind:`result`,hasResult:!0,statusTone:`success`,statusLabel:a.toolStatusCompletedLabel}:{kind:`call`,hasResult:!1,statusTone:`running`,statusLabel:a.toolStatusRunningLabel}}function FH(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function IH(e,t){return uH(t??FH(e)).trim()||void 0}function LH(e){return typeof e==`object`&&!!e}function RH(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function zH(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function BH(e){let t=RH(e);return LH(t)?zH(t.agentId):null}function VH(e){return BH(e.parsedArgs)??BH(e.args)??BH(e.result)}var HH=12e3,UH=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function WH(e){let t=e.replace(/\r\n/g,`
95
+ `).replace(/\r/g,`
96
+ `);return t===``?[]:t.split(`
97
+ `)}function GH(e){return typeof e==`number`?e+1:void 0}function KH(e){let{kind:t,newLineNumber:n,oldLineNumber:r,text:i}=e;return{kind:t,text:i,...typeof r==`number`?{oldLineNumber:r}:{},...typeof n==`number`?{newLineNumber:n}:{}}}function qH(e){let t=UH.exec(e);return t?{oldLineNumber:Number(t[1]),newLineNumber:Number(t[2])}:null}function JH(e){let{kind:t,newStartLine:n,oldStartLine:r,text:i}=e;return WH(i).map((e,i)=>KH(t===`add`?{kind:`add`,text:e,newLineNumber:n+i}:{kind:`context`,text:e,oldLineNumber:r+i,newLineNumber:n+i}))}function YH(e){let{afterLines:t,beforeLines:n,newStartLine:r,oldStartLine:i}=e,a=i,o=r;return[...n.map(e=>{let t=KH({kind:`remove`,text:e,oldLineNumber:a});return a=GH(a),t}),...t.map(e=>{let t=KH({kind:`add`,text:e,newLineNumber:o});return o=GH(o),t})]}function XH(e){let{afterLines:t,beforeLines:n}=e,r=Array.from({length:n.length+1},()=>Array.from({length:t.length+1},()=>0));for(let e=n.length-1;e>=0;--e)for(let i=t.length-1;i>=0;--i)r[e][i]=n[e]===t[i]?(r[e+1][i+1]??0)+1:Math.max(r[e+1][i]??0,r[e][i+1]??0);return r}function ZH(e){let{afterIndex:t,afterLines:n,beforeIndex:r,beforeLines:i,lines:a,newLineNumber:o,oldLineNumber:s}=e,c=s,l=o;for(let e=r;e<i.length;e+=1)a.push(KH({kind:`remove`,text:i[e]??``,oldLineNumber:c})),c=GH(c);for(let e=t;e<n.length;e+=1)a.push(KH({kind:`add`,text:n[e]??``,newLineNumber:l})),l=GH(l)}function QH(e){let{afterText:t,beforeText:n,newStartLine:r,oldStartLine:i}=e,a=WH(n),o=WH(t);if(a.length*o.length>HH)return YH({beforeLines:a,afterLines:o,oldStartLine:i,newStartLine:r});let s=XH({beforeLines:a,afterLines:o}),c=[],l=0,u=0,d=i,f=r;for(;l<a.length&&u<o.length;){if(a[l]===o[u]){c.push(KH({kind:`context`,text:a[l]??``,oldLineNumber:d,newLineNumber:f})),l+=1,u+=1,d=GH(d),f=GH(f);continue}if((s[l+1][u]??0)>=(s[l][u+1]??0)){c.push(KH({kind:`remove`,text:a[l]??``,oldLineNumber:d})),l+=1,d=GH(d);continue}c.push(KH({kind:`add`,text:o[u]??``,newLineNumber:f})),u+=1,f=GH(f)}return ZH({lines:c,beforeLines:a,afterLines:o,beforeIndex:l,afterIndex:u,oldLineNumber:d,newLineNumber:f}),c}var $H=120;function eU(e){let{lines:t,operation:n}=e,r=t.filter(e=>e.kind===`add`).length,i=t.filter(e=>e.kind===`remove`).length,a=[],o=n?.trim().toLowerCase()??``;return o&&o!==`update`&&a.push(o),r>0&&a.push(`+${r}`),i>0&&a.push(`-${i}`),a.length>0?a.join(` · `):void 0}function tU(e){let{afterText:t,beforeText:n,newStartLine:r,oldStartLine:i,operation:a}=e,o=a?.trim().toLowerCase()??``;return{oldStartLine:typeof i==`number`?i:(o===`delete`||o===`remove`)&&n!=null?1:void 0,newStartLine:typeof r==`number`?r:(o===`write`||o===`add`)&&t!=null?1:void 0}}function nU(e){return e.length<=$H?{lines:e,truncated:!1}:{lines:e.slice(0,$H),truncated:!0}}function rU(e){let{lines:t,operation:n,path:r}=e,i=nU(t);return{path:r,display:`diff`,caption:eU({operation:n,lines:t}),lines:i.lines,...i.truncated?{fullLines:t}:{},truncated:i.truncated}}function iU(e){let{newStartLine:t,oldStartLine:n,operation:r,path:i,text:a}=e,o=a.trim();if(!o)return null;let s=r?.trim().toLowerCase()===`write`?`add`:`context`,c=typeof n==`number`?n:1,l=typeof t==`number`?t:1,u=JH({text:o,kind:s,oldStartLine:c,newStartLine:l});return{path:i,display:`preview`,caption:eU({operation:r,lines:u}),lines:u,rawText:o,oldStartLine:c,newStartLine:l}}function aU(e){let{afterText:t,beforeText:n,operation:r,path:i}=e,{oldStartLine:a,newStartLine:o}=tU(e),s=QH({beforeText:n??``,afterText:t??``,oldStartLine:a,newStartLine:o}),c=nU(s);return c.lines.length===0?null:{path:i,display:`diff`,caption:eU({operation:r,lines:s}),lines:c.lines,...c.truncated?{fullLines:s}:{},...n==null?{}:{beforeText:n},...t==null?{}:{afterText:t},...typeof a==`number`?{oldStartLine:a}:{},...typeof o==`number`?{newStartLine:o}:{},truncated:c.truncated}}function oU(e){let{flushCurrent:t,line:n,setCurrent:r}=e;return n.startsWith(`*** Update File: `)?(t(),r(n.slice(17).trim(),`update`),!0):n.startsWith(`*** Add File: `)?(t(),r(n.slice(14).trim(),`add`),!0):n.startsWith(`*** Delete File: `)?(t(),r(n.slice(17).trim(),`delete`),!0):!1}function sU(e){let{currentLines:t,line:n,newLineNumber:r,oldLineNumber:i}=e;return n.startsWith(`+`)?(t.push(KH({kind:`add`,text:n.slice(1),newLineNumber:r})),{oldLineNumber:i,newLineNumber:GH(r)}):n.startsWith(`-`)?(t.push(KH({kind:`remove`,text:n.slice(1),oldLineNumber:i})),{oldLineNumber:GH(i),newLineNumber:r}):n.startsWith(` `)?(t.push(KH({kind:`context`,text:n.slice(1),oldLineNumber:i,newLineNumber:r})),{oldLineNumber:GH(i),newLineNumber:GH(r)}):{oldLineNumber:i,newLineNumber:r}}function cU(e){let t=[],n=null,r=null,i=[],a,o,s=()=>{if(!n){i=[],r=null,a=void 0,o=void 0;return}t.push(rU({path:n,operation:r,lines:i})),n=null,r=null,i=[],a=void 0,o=void 0};for(let t of WH(e)){if(oU({line:t,flushCurrent:s,setCurrent:(e,t)=>{n=e,r=t}})||t.startsWith(`*** Move to: `)||t.startsWith(`*** Begin Patch`)||t.startsWith(`*** End Patch`))continue;if(t.startsWith(`@@`)){let e=qH(t);a=e?.oldLineNumber,o=e?.newLineNumber;continue}if(!n)continue;let e=sU({currentLines:i,line:t,oldLineNumber:a,newLineNumber:o});a=e.oldLineNumber,o=e.newLineNumber}return s(),t}function lU(e){let t=[],n=null,r=[],i,a,o=()=>{if(!n){r=[],i=void 0,a=void 0;return}t.push(rU({path:n,operation:`update`,lines:r})),n=null,r=[],i=void 0,a=void 0};for(let t of WH(e)){if(t.startsWith(`+++ `)){o(),n=t.slice(4).trim().replace(/^b\//,``).replace(/^a\//,``);continue}if(t.startsWith(`--- `))continue;if(t.startsWith(`@@`)){let e=qH(t);i=e?.oldLineNumber,a=e?.newLineNumber;continue}if(!n)continue;let e=sU({currentLines:r,line:t,oldLineNumber:i,newLineNumber:a});i=e.oldLineNumber,a=e.newLineNumber}return o(),t}function uU(e){return e.includes(`*** Begin Patch`)?cU(e):e.includes(`--- `)&&e.includes(`+++ `)?lU(e):[]}function dU(e){switch(e){case`"`:case`\\`:case`/`:return e;case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
98
+ `;case`r`:return`\r`;case`t`:return` `;default:return e}}function fU(e,t){let n=`"${t}"`,r=e.indexOf(n);if(r<0)return null;let i=e.indexOf(`:`,r+n.length);if(i<0)return null;let a=i+1;for(;a<e.length&&/\s/.test(e[a]??``);)a+=1;return e[a]===`"`?a+1:null}function pU(e,t,n=1/0){let r=``,i=!1;for(let a=t;a<e.length;a+=1){let t=e[a];if(t==null)break;if(i){r+=dU(t),i=!1;continue}if(t===`\\`){i=!0;continue}if(t===`"`)return{value:r,truncated:!1};if(r+=t,r.length>=n)return{value:r,truncated:!0}}return r.length>0?{value:r,truncated:!1}:null}function mU(e,t,n=1/0){for(let r of t){let t=fU(e,r);if(t!=null)return pU(e,t,n)}return null}function hU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function gU(e){return typeof e==`string`&&e.trim()?e.trim():null}function _U(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:typeof e==`string`&&/^\d+$/.test(e.trim())?Number(e.trim()):null}function vU(e){if(hU(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`))return null;try{let e=JSON.parse(t);return hU(e)?e:null}catch{return null}}function yU(e){if(hU(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`))return null;let n=mU(t,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`])?.value??null,r=mU(t,[`content`,`text`,`afterText`,`after_text`])?.value??null,i=mU(t,[`oldText`,`beforeText`,`before_text`])?.value??null,a=mU(t,[`newText`,`afterText`,`after_text`])?.value??null,o=mU(t,[`patch`,`diff`,`unifiedDiff`,`unified_diff`])?.value??null,s={};return n&&(s.path=n),r&&(s.content=r),i&&(s.oldText=i),a&&(s.newText=a),o&&(s.patch=o),Object.keys(s).length>0?s:null}function bU(e){return gU(e.path)??gU(e.filePath)??gU(e.file_path)??gU(e.targetPath)??gU(e.target_path)??gU(e.filename)??gU(e.name)}function xU(e){return $(e.operation)??$(e.op)??$(e.action)??$(e.kind)??$(e.type)??$(e.status)}function SU(e,t){for(let n of t){let t=_U(e[n]);if(t!==null)return t}return null}function CU(e){return SU(e,[`oldStartLine`,`old_start_line`,`startOldLine`,`start_old_line`,`oldLineStart`,`old_line_start`,`oldLineNumber`,`old_line_number`,`lineStart`,`line_start`,`startLine`,`start_line`,`lineNumber`,`line_number`])}function wU(e){return SU(e,[`newStartLine`,`new_start_line`,`startNewLine`,`start_new_line`,`newLineStart`,`new_line_start`,`newLineNumber`,`new_line_number`,`lineStart`,`line_start`,`startLine`,`start_line`,`lineNumber`,`line_number`])}function TU(e){return $(e.patch)??$(e.diff)??$(e.unifiedDiff)??$(e.unified_diff)}function EU(e){return $(e.beforeText)??$(e.before_text)??$(e.oldText)??$(e.old_text)??$(e.oldContent)??$(e.old_content)??$(e.before)??$(e.previous)}function DU(e){return $(e.afterText)??$(e.after_text)??$(e.newText)??$(e.new_text)??$(e.newContent)??$(e.new_content)??$(e.content)??$(e.text)??$(e.after)??$(e.updated)}var OU=new Set([`file_change`,`read_file`,`write_file`,`edit_file`,`apply_patch`]);function kU(e){let t=e.map((e,t)=>({key:`${e.path}-${t+1}`,path:e.path,display:e.display,...e.caption?{caption:e.caption}:{},lines:e.lines,...e.fullLines?{fullLines:e.fullLines}:{},...e.rawText?{rawText:e.rawText}:{},...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{},...e.truncated?{truncated:!0}:{}})).filter(e=>e.lines.length>0||!!e.rawText);if(t.length===0)return null;let n=t.map(e=>e.path);return{summary:n.length===1?n[0]:`${n.length} files · ${n.slice(0,2).join(` · `)}${n.length>2?` …`:``}`,fileOperation:{blocks:t}}}function AU(e,t){let n=bU(e)??t,r=xU(e),i=CU(e),a=wU(e),o=TU(e);if(o){let e=uU(o);if(e.length>0)return e[0]??null}let s=EU(e),c=DU(e);if(s!=null||c!=null)return aU({path:n,beforeText:s,afterText:c,operation:r,oldStartLine:i,newStartLine:a});let l=$(e.preview);return l?iU({path:n,text:l,operation:r,oldStartLine:i,newStartLine:a}):null}function jU(e){if(!Array.isArray(e))return[];let t=[];return e.forEach((e,n)=>{if(typeof e==`string`){let n=uU(e);n.length>0&&t.push(...n);return}if(!hU(e))return;let r=AU(e,bU(e)??`file-${n+1}`);if(r){t.push(r);return}let i=Array.isArray(e.changes)?jU(e.changes):[];i.length>0&&t.push(...i)}),t}function MU(e){let t=vU(e.result)??vU(e.parsedArgs)??vU(e.args);return t?kU(jU(t.changes)):null}function NU(e){let t=vU(e.parsedArgs)??vU(e.args)??yU(e.args),n=t&&bU(t),r=$(e.result);return!n||!r?null:kU([iU({path:n,text:r,operation:`read`})].filter(e=>!!e))}function PU(e){if(e.status===`partial-call`&&typeof e.args==`string`){let t=mU(e.args,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`]),n=mU(e.args,[`content`,`text`,`afterText`,`after_text`]);if(t?.value&&n?.value){let e=iU({path:t.value,text:n.value,operation:`write`});if(e)return kU([e])}}let t=vU(e.parsedArgs)??vU(e.args)??yU(e.args);if(!t)return null;let n=bU(t),r=$(t.content);return!n||!r?null:kU([iU({path:n,text:r,operation:`write`})].filter(e=>!!e))}function FU(e){let t=vU(e.result),n=vU(e.parsedArgs)??vU(e.args)??yU(e.args);if(!t&&!n)return null;let r=(t?bU(t):null)??(n?bU(n):null),i=(t?EU(t):null)??(n?EU(n):null),a=(t?DU(t):null)??(n?DU(n):null),o=(t?CU(t):null)??(n?CU(n):null),s=(t?wU(t):null)??(n?wU(n):null);return!r||i==null&&a==null?null:kU([aU({path:r,beforeText:i,afterText:a,operation:`edit`,oldStartLine:o,newStartLine:s})].filter(e=>!!e))}function IU(e){let t=vU(e.parsedArgs),n=vU(e.args)??yU(e.args),r=$(e.args)??(t?$(t.patch):null)??(n?$(n.patch):null);return r?kU(uU(r)):null}function LU(e){return OU.has(e.toolName)?e.toolName===`file_change`?MU(e):e.toolName===`read_file`?NU(e):e.toolName===`write_file`?PU(e):e.toolName===`edit_file`?FU(e):e.toolName===`apply_patch`?IU(e):null:null}var RU=[`show_content`,`show_file`,`show_url`,`show_panel_app`];function zU(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function BU(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function VU(e){return Number.isInteger(e)&&typeof e==`number`&&e>0?e:void 0}function HU(e){return e===`file`||e===`url`||e===`panel_app`?e:null}function UU(e){return e===`read`||e===`preview`||e===`edit`||e===`interact`?e:void 0}function WU(e){return e===`inline`||e===`side_panel`?e:void 0}function GU(e){return e===`auto`||e===`source`||e===`rendered`?e:void 0}function KU(e){if(!zU(e)||!zU(e.target))return null;let{target:t}=e,{payload:n,type:r}=t,i=HU(r);if(!i||!zU(n))return null;let a=BU(e.title),o=UU(e.purpose),s=WU(e.placement);if(i===`file`){let e=BU(n.path);return e?{target:{type:`file`,payload:{path:e,line:VU(n.line),column:VU(n.column),viewer:GU(n.viewer)}},title:a,purpose:o,placement:s}:null}if(i===`url`){let e=BU(n.url);return e?{target:{type:`url`,payload:{url:e}},title:a,purpose:o,placement:s}:null}let c=BU(n.appId);return c?{target:{type:`panel_app`,payload:{appId:c}},title:a,purpose:o,placement:s}:null}function qU(e){return!zU(e)||e.action!==`showContent`?null:KU(e.request)}function JU(e){return e.title?e.title:e.target.type===`file`?e.target.payload.path:e.target.type===`url`?e.target.payload.url:e.target.payload.appId}function YU(e){let{actionLabel:t,invocation:n,statusLabel:r}=e;if(!RU.includes(n.toolName))return null;let i=qU(n.result);if(!i)return null;let a={kind:`show-content`,label:t,request:{...i,placement:`side_panel`}},o=i.target.type===`panel_app`&&i.placement===`inline`?{appId:i.target.payload.appId,title:i.title,action:a}:void 0;return{kind:`result`,name:n.toolName,detail:JU(i),text:void 0,outputData:n.result,hasResult:!0,statusTone:`success`,statusLabel:r,action:a,...o?{panelApp:o}:{}}}function XU(e){return typeof e==`object`&&!!e}function ZU(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function QU(e){return!XU(e)||e.kind!==`nextclaw.session_request`?null:e}function $U(e){return!XU(e)||e.kind!==`nextclaw.session`?null:e}function eW(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function tW(e){return uH(eW(e)).trim()||void 0}function nW(e,t){return[ZU(e.title)?`title: ${e.title?.trim()}`:null,ZU(e.sessionId)?`session: ${e.sessionId?.trim()}`:null,ZU(e.task)?`task: ${e.task?.trim()}`:null].filter(e=>!!e).join(` · `)||fH(t)}function rW(e,t){return[ZU(e.title)?`title: ${e.title?.trim()}`:null,ZU(e.sessionId)?`session: ${e.sessionId?.trim()}`:null].filter(e=>!!e).join(` · `)||fH(t)}function iW(e){let t=ZU(e.requestId),n=ZU(e.sessionId),r=ZU(e.title),i=ZU(e.task),a=ZU(e.status),o=ZU(e.notify),s=ZU(e.lifecycle),c=ZU(e.parentSessionId),l=ZU(e.spawnedByRequestId),u=e.message===void 0?``:uH(e.message).trim(),d=e.finalResponseText===void 0?``:uH(e.finalResponseText).trim(),f=e.error===void 0?``:uH(e.error).trim(),p=[t?`Request ID: ${t}`:null,n?`Session ID: ${n}`:null,typeof e.isChildSession==`boolean`?`Target: ${e.isChildSession?`child`:`session`}`:null,a?`Status: ${a}`:null,o?`Notify: ${o}`:null,s?`Lifecycle: ${s}`:null,c?`Parent Session ID: ${c}`:null,l?`Spawned By Request ID: ${l}`:null,r?`Title: ${r}`:null,i?`Task:\n${i}`:null,d?`Final Response:\n${d}`:f?`Error:\n${f}`:u?`Status:\n${u}`:null].filter(e=>!!e);return p.length>0?p.join(`
99
+
100
+ `):void 0}function aW(e){let t=ZU(e.sessionId),n=ZU(e.title),r=ZU(e.sessionType),i=ZU(e.lifecycle),a=ZU(e.parentSessionId),o=ZU(e.createdAt),s=[t?`Session ID: ${t}`:null,typeof e.isChildSession==`boolean`?`Target: ${e.isChildSession?`child`:`session`}`:null,n?`Title: ${n}`:null,r?`Session Type: ${r}`:null,i?`Lifecycle: ${i}`:null,a?`Parent Session ID: ${a}`:null,o?`Created At: ${o}`:null].filter(e=>!!e);return s.length>0?s.join(`
101
+
102
+ `):void 0}function oW(e){let{invocation:t,texts:n}=e,{toolName:r,toolCallId:i,args:a,result:o}=t;if(r!==`spawn`&&r!==`sessions_request`&&r!==`sessions_spawn`)return null;let s=QU(o);if(s){let e=ZU(s.status)?.toLowerCase(),t=nW(s,a),o=iW(s),c=ZU(s.sessionId),l=VH({args:a,result:s}),u=c?{kind:`open-session`,sessionId:c,sessionKind:s.isChildSession===!0?`child`:`session`,...l?{agentId:l}:{},...ZU(s.title)?{label:s.title.trim()}:{},...ZU(s.parentSessionId)?{parentSessionId:s.parentSessionId.trim()}:{}}:void 0;return e===`failed`?{kind:`result`,name:r,detail:t,input:tW(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`error`,statusLabel:n.toolStatusFailedLabel,...l?{agentId:l}:{},...u?{action:u}:{}}:e===`completed`?{kind:`result`,name:r,detail:t,input:tW(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`success`,statusLabel:n.toolStatusCompletedLabel,...l?{agentId:l}:{},...u?{action:u}:{}}:{kind:`result`,name:r,detail:t,input:tW(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`running`,statusLabel:n.toolStatusRunningLabel,...l?{agentId:l}:{},...u?{action:u}:{}}}let c=$U(o);if(!c)return null;let l=rW(c,a),u=aW(c),d=ZU(c.sessionId),f=VH({args:a,result:c}),p=d?{kind:`open-session`,sessionId:d,sessionKind:c.isChildSession===!0?`child`:`session`,...f?{agentId:f}:{},...ZU(c.title)?{label:c.title.trim()}:{},...ZU(c.parentSessionId)?{parentSessionId:c.parentSessionId.trim()}:{}}:void 0;return{kind:`result`,name:r,detail:l,input:tW(a),text:u,callId:i||void 0,hasResult:!!u,statusTone:`success`,statusLabel:n.toolStatusCompletedLabel,...f?{agentId:f}:{},...p?{action:p}:{}}}function sW(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e.error:null;return typeof t==`object`&&t&&!Array.isArray(t)&&t.code===`invalid_tool_arguments`?t:null}function cW(e,t){let n=DH(e.reasoning);return n?{type:`reasoning`,text:n,label:t.reasoningLabel}:null}function lW(e,t){let n=e.mimeType.startsWith(`image/`),r=AH(e.sizeBytes);return{type:`file`,file:{label:typeof e.name==`string`&&e.name.trim()?e.name.trim():n?t.imageAttachmentLabel:t.fileAttachmentLabel,mimeType:e.mimeType,dataUrl:typeof e.url==`string`&&e.url.trim().length>0?e.url.trim():`data:${e.mimeType};base64,${e.data}`,...r==null?{}:{sizeBytes:r},isImage:n}}}function uW(e,t){let n=e.toolInvocation,r=MH(n.result,t);if(r)return r;let i=oW({invocation:n,texts:{toolStatusRunningLabel:t.toolStatusRunningLabel,toolStatusCompletedLabel:t.toolStatusCompletedLabel,toolStatusFailedLabel:t.toolStatusFailedLabel}});if(i)return{type:`tool-card`,card:NH(i,t)};let a=YU({invocation:n,actionLabel:t.showContentActionLabel??`Show content`,statusLabel:t.toolStatusCompletedLabel});if(a)return{type:`tool-card`,card:NH(a,t)};let o=PH({status:n.status,error:n.error,cancelled:n.cancelled,result:n.result,texts:t}),s=sW(n.result),c=Array.isArray(s?.issues)?s.issues.find(e=>typeof e==`string`&&e.trim().length>0):void 0,l=LU({toolName:n.toolName,status:n.status,toolCallId:n.toolCallId,args:n.args,parsedArgs:n.parsedArgs,result:n.result}),u=c?`Invalid arguments: ${c}`:l?.summary??fH(n.parsedArgs??n.args),d=l?void 0:IH(n.args,n.parsedArgs),f=c||(typeof n.error==`string`&&n.error.trim()?n.error.trim():n.result==null?``:uH(n.result).trim()),p=!n.error&&jH(n.result),m=(!l?.fileOperation||!!n.error)&&!p,h=VH(n);return{type:`tool-card`,card:NH({kind:o.kind,name:n.toolName,...h?{agentId:h}:{},detail:u,...d?{input:d}:{},text:m&&f?f:void 0,outputData:n.result,callId:n.toolCallId||void 0,hasResult:o.hasResult,statusTone:s?`error`:o.statusTone,statusLabel:s?t.toolStatusFailedLabel:o.statusLabel,...l?.fileOperation?{fileOperation:l.fileOperation}:{}},t)}}function dW(e,t){return{type:`unknown`,label:t.unknownPartLabel,rawType:typeof e.type==`string`?e.type:`unknown`,text:uH(e)}}function fW(e){return e.type===`text`&&typeof e.text==`string`}function pW(e){return e.type===`reasoning`&&typeof e.reasoning==`string`}function mW(e){return e.type===`file`&&typeof e.mimeType==`string`&&typeof e.data==`string`}function hW(e){return e.type!==`tool-invocation`||typeof e.toolInvocation!=`object`||e.toolInvocation===null||Array.isArray(e.toolInvocation)?!1:`toolName`in e.toolInvocation&&typeof e.toolInvocation.toolName==`string`}function gW(e){let{inlineTokens:t,part:n,texts:r}=e;return fW(n)?EH(n,t):pW(n)?cW(n,r):mW(n)?lW(n,r):hW(n)?uW(n,r):dW(n,r)}function _W(e){let t=e.meta?.timestamp;return t&&Number.isFinite(Date.parse(t))?t:new Date().toISOString()}function vW(e,t){return e===`user`?t.user:e===`assistant`?t.assistant:e===`tool`?t.tool:e===`system`?t.system:t.fallback}function yW(e){return e===`user`||e===`assistant`||e===`tool`||e===`system`?e:`message`}function bW(e,t){return{id:e.id,role:yW(e.role),roleLabel:vW(e.role,t.texts.roleLabels),timestampLabel:t.formatTimestamp(_W(e)),status:e.meta?.status,processSummary:e.meta?.processSummary,parts:e.parts.map(n=>gW({part:n,inlineTokens:e.meta?.inlineTokens??[],texts:t.texts})).filter(e=>e!==null)}}function xW(e){return e.type===`reasoning`||e.type===`tool-invocation`}function SW(e){return e.type===`text`||e.type===`rich-text`?e.text.trim().length>0:e.type===`file`||e.type===`source`||e.type===`card`}function CW(e){if(e.role!==`assistant`||e.status===`pending`||e.status===`streaming`)return!1;let t=-1;for(let n=e.parts.length-1;n>=0;--n){let r=e.parts[n];if(r&&xW(r)){t=n;break}}return t>=0&&t<e.parts.length-1&&e.parts.slice(t+1).some(SW)}function wW(e){let t=e.lifecycle?.startedAt,n=e.lifecycle?.endedAt;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=Math.round((i-r)/1e3),o=Math.floor(a/3600),s=Math.floor(a%3600/60),c=a%60;return o>0?s>0?`${o}h ${s}m`:`${o}h`:s>0?`${s}m ${c}s`:`${c}s`}function TW({message:e,processedLabel:t}){if(!CW(e))return;let n=wW(e);return{label:n?`${t} ${n}`:t}}function EW(e){return{roleLabels:{user:f(`chatRoleUser`),assistant:f(`chatRoleAssistant`),tool:f(`chatRoleTool`),system:f(`chatRoleSystem`),fallback:f(`chatRoleMessage`)},reasoningLabel:f(`chatReasoning`),toolCallLabel:f(`chatToolCall`),toolResultLabel:f(`chatToolResult`),toolInputLabel:f(`chatToolInput`),toolNoOutputLabel:f(`chatToolNoOutput`),toolOutputLabel:f(`chatToolOutput`),toolStatusPreparingLabel:f(`chatToolStatusPreparing`),toolStatusRunningLabel:f(`chatToolStatusRunning`),toolStatusCompletedLabel:f(`chatToolStatusCompleted`),toolStatusFailedLabel:f(`chatToolStatusFailed`),toolStatusCancelledLabel:f(`chatToolStatusCancelled`),showContentActionLabel:f(`chatShowContentAction`),imageAttachmentLabel:f(`chatImageAttachment`),fileAttachmentLabel:f(`chatFileAttachment`),unknownPartLabel:f(`chatUnknownPart`)}}function DW(){return{directory:{running:f(`chatToolDirectoryRunning`),success:f(`chatToolDirectorySuccess`),error:f(`chatToolDirectoryError`),cancelled:f(`chatToolDirectoryCancelled`)},web:{running:f(`chatToolWebRunning`),success:f(`chatToolWebSuccess`),error:f(`chatToolWebError`),cancelled:f(`chatToolWebCancelled`)},message:{running:f(`chatToolMessageRunning`),success:f(`chatToolMessageSuccess`),error:f(`chatToolMessageError`),cancelled:f(`chatToolMessageCancelled`)},session:{running:f(`chatToolSessionRunning`),success:f(`chatToolSessionSuccess`),error:f(`chatToolSessionError`),cancelled:f(`chatToolSessionCancelled`)},agent:{running:f(`chatToolAgentRunning`),success:f(`chatToolAgentSuccess`),error:f(`chatToolAgentError`),cancelled:f(`chatToolAgentCancelled`)},memory:{running:f(`chatToolMemoryRunning`),success:f(`chatToolMemorySuccess`),error:f(`chatToolMemoryError`),cancelled:f(`chatToolMemoryCancelled`)},schedule:{running:f(`chatToolScheduleRunning`),success:f(`chatToolScheduleSuccess`),error:f(`chatToolScheduleError`),cancelled:f(`chatToolScheduleCancelled`)},system:{running:f(`chatToolSystemRunning`),success:f(`chatToolSystemSuccess`),error:f(`chatToolSystemError`),cancelled:f(`chatToolSystemCancelled`)},image:{running:f(`chatToolImageRunning`),success:f(`chatToolImageSuccess`),error:f(`chatToolImageError`),cancelled:f(`chatToolImageCancelled`)},display:{running:f(`chatToolDisplayRunning`),success:f(`chatToolDisplaySuccess`),error:f(`chatToolDisplayError`),cancelled:f(`chatToolDisplayCancelled`)}}}function OW(e){return{copyCodeLabel:f(`chatCodeCopy`),copiedCodeLabel:f(`chatCodeCopied`),copyMessageLabel:f(`chatMessageCopy`),copiedMessageLabel:f(`chatMessageCopied`),mermaidDiagramLabel:f(`chatMermaidDiagram`),mermaidRenderErrorLabel:f(`chatMermaidRenderError`),typingLabel:f(`chatTyping`),reasoningCharacterCountTemplates:{inProgress:f(`chatReasoningInProgressCharacterCount`),completed:f(`chatReasoningCompletedCharacterCount`)},toolStatusLabels:{terminal:{running:f(`chatToolTerminalRunning`),success:f(`chatToolTerminalSuccess`),error:f(`chatToolTerminalError`),cancelled:f(`chatToolTerminalCancelled`)},fileRead:{running:f(`chatToolFileReadRunning`),success:f(`chatToolFileReadSuccess`),error:f(`chatToolFileReadError`),cancelled:f(`chatToolFileReadCancelled`)},fileEdit:{running:f(`chatToolFileEditRunning`),success:f(`chatToolFileEditSuccess`),error:f(`chatToolFileEditError`),cancelled:f(`chatToolFileEditCancelled`)},search:{running:f(`chatToolSearchRunning`),success:f(`chatToolSearchSuccess`),error:f(`chatToolSearchError`),cancelled:f(`chatToolSearchCancelled`)},builtIn:DW()},attachmentOpenLabel:f(`chatAttachmentOpen`),attachmentAttachedLabel:f(`chatAttachmentAttached`),attachmentExpandLabel:f(`chatAttachmentExpand`),attachmentCloseLabel:f(`chatAttachmentClosePreview`),attachmentCategoryLabels:{archive:f(`chatAttachmentCategoryArchive`),audio:f(`chatAttachmentCategoryAudio`),code:f(`chatAttachmentCategoryCode`),data:f(`chatAttachmentCategoryData`),document:f(`chatAttachmentCategoryDocument`),generic:f(`chatAttachmentCategoryGeneric`),image:f(`chatAttachmentCategoryImage`),pdf:f(`chatAttachmentCategoryPdf`),sheet:f(`chatAttachmentCategorySheet`),video:f(`chatAttachmentCategoryVideo`)},toolActivitySegmentTemplates:{read:{one:f(`chatToolActivityReadOne`),other:f(`chatToolActivityReadOther`)},edit:{one:f(`chatToolActivityEditOne`),other:f(`chatToolActivityEditOther`)},directory:{one:f(`chatToolActivityDirectoryOne`),other:f(`chatToolActivityDirectoryOther`)},search:{one:f(`chatToolActivitySearchOne`),other:f(`chatToolActivitySearchOther`)},bash:{one:f(`chatToolActivityBashOne`),other:f(`chatToolActivityBashOther`)},web:{one:f(`chatToolActivityWebOne`),other:f(`chatToolActivityWebOther`)},agent:{one:f(`chatToolActivityAgentOne`),other:f(`chatToolActivityAgentOther`)},panel:{one:f(`chatToolActivityPanelOne`),other:f(`chatToolActivityPanelOther`)},other:{one:f(`chatToolActivityOtherOne`),other:f(`chatToolActivityOtherOther`)}},toolActivityFailedLabel:f(`chatProcessSummaryFailed`),toolActivityCancelledLabel:f(`chatProcessSummaryCancelled`)}}function kW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function AW(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=Math.trunc(e);return t>=0?t:null}function jW(e){return e===!0}function MW(e){let t=e;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,r=AW(n.usedContextTokens),i=AW(n.totalContextTokens),a=AW(n.prunedUsedContextTokens),o=kW(n.updatedAt);if(r===null||i===null||a===null||!o)return null;let s=AW(n.compactedUsedContextTokens);return{usedContextTokens:r,totalContextTokens:i,prunedUsedContextTokens:a,availableContextTokens:AW(n.availableContextTokens)??Math.max(0,i-r),droppedHistoryCount:AW(n.droppedHistoryCount)??0,truncatedToolResultCount:AW(n.truncatedToolResultCount)??0,truncatedSystemPrompt:jW(n.truncatedSystemPrompt),truncatedUserMessage:jW(n.truncatedUserMessage),compacted:jW(n.compacted),...kW(n.checkpointId)?{checkpointId:kW(n.checkpointId)??void 0}:{},compactedMessageCount:AW(n.compactedMessageCount)??0,...s===null?{}:{compactedUsedContextTokens:s},updatedAt:o}}function NW(e){let{metadata:t}=e;if(!t||t.nextclaw_timeline_kind!==`context_compaction`)return null;let n=t.checkpoint&&typeof t.checkpoint==`object`&&!Array.isArray(t.checkpoint)?t.checkpoint:null;if(!n)return null;let r=kW(n.id),i=n.status===`compressing`?`compressing`:n.status===`compressed`?`compressed`:null,a=kW(n.summary),o=AW(n.coveredMessageCount),s=AW(n.coveredSessionMessageCount),c=AW(n.originalEstimatedTokens),l=AW(n.projectedEstimatedTokens),u=kW(n.createdAt),d=kW(n.updatedAt);return!r||!i||!a||o===null||s===null||c===null||l===null||!u||!d?null:{id:r,status:i,summary:a,coveredMessageCount:o,coveredSessionMessageCount:s,originalEstimatedTokens:c,projectedEstimatedTokens:l,createdAt:u,updatedAt:d}}function PW(e){return`${e.kind===`directory`?f(`chatWorkspaceOpenDirectory`):f(`chatWorkspaceOpenFile`)}: ${e.name}`}function FW(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function IW(e){return e.error?e.error instanceof Error?e.error.message:String(e.error):null}function LW({fileName:e,isDirectory:t,isExpanded:n}){return t?n?(0,F.jsx)(xo,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,F.jsx)(an,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,F.jsx)(Qm,{fileName:e})}function RW({browseQuery:e,level:t,onFileOpen:n}){let r=e.data?.entries??[],i=IW(e),a={paddingLeft:`${36+t*14}px`};return e.isLoading&&!e.data?(0,F.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-gray-400`,style:a,children:f(`chatWorkspaceLoadingDirectory`)}):i&&!e.data?(0,F.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-rose-600`,style:a,title:i,children:f(`chatWorkspaceDirectoryLoadFailed`)}):r.length===0?(0,F.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-gray-400`,style:a,children:f(`chatWorkspaceDirectoryEmpty`)}):r.map(e=>(0,F.jsx)(zW,{entry:e,level:t+1,onFileOpen:n},e.path))}function zW({entry:e,level:t,onFileOpen:n}){let r=e.kind===`directory`,[i,a]=(0,P.useState)(!1),o=Js({path:e.path,includeFiles:!0,enabled:r&&i}),s=()=>{if(r){a(e=>!e);return}n({path:e.path,label:e.name,viewMode:`preview`})};return(0,F.jsxs)(`div`,{role:`treeitem`,"aria-expanded":r?i:void 0,"aria-label":PW(e),children:[(0,F.jsxs)(`button`,{type:`button`,className:m(`flex h-7 w-full min-w-0 items-center gap-1.5 pr-2 text-left text-[13px] text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border`,e.hidden?`opacity-65`:null),style:{paddingLeft:`${8+t*14}px`},onClick:s,children:[(0,F.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-gray-400`,children:r?i?(0,F.jsx)(Et,{className:`h-3.5 w-3.5`}):(0,F.jsx)(eo,{className:`h-3.5 w-3.5`}):null}),(0,F.jsx)(LW,{fileName:e.name,isDirectory:r,isExpanded:i}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]}),r&&i?(0,F.jsx)(`div`,{role:`group`,children:(0,F.jsx)(RW,{browseQuery:o,level:t,onFileOpen:n})}):null]})}function BW({browseQuery:e,onFileOpen:t,renderStatus:n,showRoot:r=!1}){let i=e.data?.entries??[],a=IW(e);return e.isLoading&&!e.data?n({text:f(`chatWorkspaceLoadingDirectory`)}):a&&!e.data?n({tone:`error`,text:`${f(`chatWorkspaceDirectoryLoadFailed`)}: ${a}`}):i.length===0?n({text:f(`chatWorkspaceDirectoryEmpty`)}):(0,F.jsx)(`div`,{"data-testid":`workspace-directory-browser`,role:`tree`,"aria-label":f(`chatWorkspaceProjectFiles`),className:`h-full overflow-auto bg-white py-2 custom-scrollbar`,children:r&&e.data?(0,F.jsxs)(`div`,{role:`treeitem`,"aria-expanded":`true`,children:[(0,F.jsxs)(`div`,{className:`flex h-8 items-center gap-1.5 border-b border-gray-100 px-2 text-xs font-semibold text-gray-700`,children:[(0,F.jsx)(Et,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}),(0,F.jsx)(xo,{className:`h-4 w-4 shrink-0 text-amber-500`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.data.currentPath,children:FW(e.data.currentPath)})]}),(0,F.jsx)(`div`,{role:`group`,className:`pt-1`,children:i.map(e=>(0,F.jsx)(zW,{entry:e,level:1,onFileOpen:t},e.path))})]}):i.map(e=>(0,F.jsx)(zW,{entry:e,level:0,onFileOpen:t},e.path))})}function VW({name:e,kind:t}){return t===`directory`?(0,F.jsx)(an,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600`}):(0,F.jsx)(Qm,{fileName:e,size:`compact`})}function HW({browsePath:e,onBrowsePathChange:t,onClose:n,onFileOpen:r}){let i=Js({path:e,includeFiles:!0,enabled:!!e}),a=i.error?i.error instanceof Error?i.error.message:String(i.error):null,o=i.data?.entries??[],s=e=>{if(e.kind===`directory`){t(e.path);return}r({path:e.path,label:e.name,viewMode:`preview`}),n()};return(0,F.jsxs)(`div`,{"data-testid":`workspace-breadcrumb-browser`,className:`flex max-h-72 flex-col overflow-hidden`,children:[(0,F.jsx)(`div`,{className:`border-b border-gray-200 px-2 py-1`,children:(0,F.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-0.5 text-[11px] leading-none text-gray-600`,children:i.data?.breadcrumbs.map((e,n)=>(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(`button`,{type:`button`,className:`h-5 rounded-sm px-1 text-left hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>t(e.path),children:e.label}),n<i.data.breadcrumbs.length-1?(0,F.jsx)(eo,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},e.path))})}),(0,F.jsx)(Ys,{className:`min-h-0 flex-1 px-1 py-1`,children:i.isLoading?(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-4 text-[11px] text-gray-500`,children:[(0,F.jsx)(_n,{className:`h-3.5 w-3.5 animate-spin`}),f(`loading`)]}):a?(0,F.jsxs)(`div`,{className:`px-2 py-3 text-[11px] text-rose-600`,children:[f(`pathBrowseFailed`),`: `,a]}):o.length>0?(0,F.jsx)(`div`,{className:`space-y-0.5`,children:o.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:m(`flex h-6 w-full items-center gap-1.5 rounded-sm px-1.5 text-left text-[11px] text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e.hidden?`opacity-65`:null),onClick:()=>s(e),children:[(0,F.jsx)(VW,{kind:e.kind,name:e.name}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.kind===`directory`?(0,F.jsx)(eo,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},e.path))}):(0,F.jsx)(`div`,{className:`px-2 py-4 text-[11px] text-gray-500`,children:f(`emptyDirectory`)})})]})}function UW({value:e}){return(0,F.jsx)(`span`,{className:`inline-flex h-5 items-center rounded-sm border border-amber-200 bg-amber-50 px-1.5 text-[10px] font-medium leading-none text-amber-700`,children:e})}function WW({onFileOpen:e,segment:t}){let[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(t.browsePath);return(0,F.jsxs)(Ze,{open:n,onOpenChange:e=>{e&&a(t.browsePath),r(e)},children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-current":t.isCurrent?`page`:void 0,className:m(`inline-flex h-5 items-center gap-1 rounded-sm px-1 text-[11px] leading-none transition-colors hover:bg-gray-200/80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,t.kind===`workspace`?`bg-primary/8 text-primary hover:bg-primary/12`:t.isCurrent?`bg-gray-200/70 text-gray-900`:`text-gray-500`),disabled:!t.browsePath,children:[t.kind===`workspace`?(0,F.jsx)(So,{className:`h-3 w-3 shrink-0`}):t.kind===`directory`&&t.isCurrent?(0,F.jsx)(an,{className:`h-3 w-3 shrink-0`}):t.isCurrent?(0,F.jsx)(Qm,{fileName:t.label,size:`compact`}):null,(0,F.jsx)(`span`,{children:t.label})]})}),(0,F.jsx)(Ye,{"data-testid":`workspace-breadcrumb-popover`,className:`w-[22rem] rounded-md p-0`,align:`start`,children:(0,F.jsx)(HW,{browsePath:i,onBrowsePathChange:a,onClose:()=>r(!1),onFileOpen:e})})]})}function GW({breadcrumb:e,onFileOpen:t}){return(0,F.jsx)(`div`,{"data-testid":`workspace-file-breadcrumbs`,title:e.fullPath,className:`workspace-horizontal-scrollbar overflow-x-auto overflow-y-hidden border-b border-gray-200/80 bg-gray-50/55`,children:(0,F.jsxs)(`div`,{"data-testid":`workspace-file-breadcrumb-scroll`,className:`flex min-w-max items-center gap-2.5 px-3 py-1.5`,children:[(0,F.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 pr-1`,children:e.segments.map((n,r)=>(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(WW,{segment:n,onFileOpen:t}),r<e.segments.length-1?(0,F.jsx)(eo,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},n.key))}),e.truncated?(0,F.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:(0,F.jsx)(UW,{value:f(`chatWorkspacePreviewTruncated`)})}):null]})})}function KW(e){let[t,n]=(0,P.useState)(null),r=t?.contentUrl===e?t:null;return(0,P.useEffect)(()=>{let t=new AbortController;return fetch(e,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`Unable to load document (${e.status}).`);return e.arrayBuffer()}).then(r=>{t.signal.aborted||n({contentUrl:e,status:`ready`,data:r})}).catch(r=>{t.signal.aborted||(console.error(`Failed to load workspace document`,r),n({contentUrl:e,status:`error`,data:null}))}),()=>t.abort()},[e]),{status:r?.status??`loading`,data:r?.data??null}}function qW({status:e}){return e===`ready`?null:(0,F.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-background/90 px-6 text-center text-sm text-muted-foreground`,children:f(e===`loading`?`chatWorkspaceLoadingPreview`:`chatWorkspacePreviewFailed`)})}function JW(e){let t=Array.from(e.querySelectorAll(`.docx-wrapper > section.docx`)).some(e=>!e.style.width&&!e.style.padding);if(e.classList.toggle(`workspace-docx-preview--reflow`,t),t)for(let t of e.querySelectorAll(`table`)){if(t.querySelectorAll(`col`).length<5)continue;let e=document.createElement(`div`);e.className=`workspace-docx-wide-table`,t.before(e),e.append(t)}}function YW({contentUrl:e}){let t=(0,P.useRef)(null),n=KW(e),[r,i]=(0,P.useState)(null),a=r?.contentUrl===e?r.status:`loading`,o=n.status===`ready`?a:n.status;return(0,P.useEffect)(()=>{let r=t.current;if(!r||!n.data)return;let a=!1;return r.replaceChildren(),h(()=>import(`./docx-preview-zis3U0Fa.js`).then(async t=>{await t.renderAsync(n.data,r,r,{breakPages:!0,inWrapper:!0,ignoreLastRenderedPageBreak:!1}),a||(JW(r),i({contentUrl:e,status:`ready`}))}),__vite__mapDeps([22,4,23])).catch(t=>{a||(console.error(`Failed to render DOCX preview`,t),i({contentUrl:e,status:`error`}))}),()=>{a=!0,r.replaceChildren()}},[e,n.data]),(0,F.jsxs)(`div`,{className:`relative h-full overflow-auto bg-muted/40 p-4 custom-scrollbar`,children:[(0,F.jsx)(qW,{status:o}),(0,F.jsx)(`div`,{ref:t,className:`workspace-docx-preview min-h-full`,"data-testid":`workspace-content-docx`})]})}function XW({contentUrl:e}){let t=(0,P.useRef)(null),n=KW(e),[r,i]=(0,P.useState)(null),a=r?.contentUrl===e?r.status:`loading`,o=n.status===`ready`?a:n.status;return(0,P.useEffect)(()=>{let r=t.current;if(!r||!n.data)return;let a=new AbortController,o=null;return r.replaceChildren(),h(async()=>{let{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}=await import(`./aiden0z-pptx-renderer.es-D87ywFdC.js`);return{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}},__vite__mapDeps([24,4,23])).then(async({PptxViewer:t,RECOMMENDED_ZIP_LIMITS:s})=>{if(o=await t.open(n.data,r,{renderMode:`list`,fitMode:`contain`,lazySlides:!0,lazyMedia:!0,pdfjs:!1,scrollContainer:r,signal:a.signal,zipLimits:s,listOptions:{windowed:!0,batchSize:8,initialSlides:4,overscanViewport:1.5}}),a.signal.aborted){o.destroy(),o=null;return}i({contentUrl:e,status:`ready`})}).catch(t=>{a.signal.aborted||(console.error(`Failed to render presentation preview`,t),i({contentUrl:e,status:`error`}))}),()=>{a.abort(),o?.destroy(),r.replaceChildren()}},[e,n.data]),(0,F.jsxs)(`div`,{className:`relative h-full bg-muted/40`,children:[(0,F.jsx)(qW,{status:o}),(0,F.jsx)(`div`,{ref:t,className:`h-full overflow-auto p-4 custom-scrollbar`,"data-testid":`workspace-content-presentation`})]})}var ZW=500,QW=100;function $W(e){let t=``,n=e+1;for(;n>0;)--n,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}function eG({contentUrl:e}){let t=KW(e),[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(``),o=n?.contentUrl===e?n:null,s=t.status===`ready`?o?.status??`loading`:t.status,c=o?.sheets.find(e=>e.name===i)??o?.sheets[0]??null;return(0,P.useEffect)(()=>{if(!t.data)return;let n=!1;return h(()=>import(`./xlsx-DUqJhg5u.js`).then(i=>{let a=i.read(t.data,{dense:!0,sheetRows:ZW+1}),o=a.SheetNames.map(e=>{let t=a.Sheets[e],n=t?i.utils.sheet_to_json(t,{header:1,raw:!1,defval:``,blankrows:!1}):[],r=n.slice(0,ZW).map(e=>e.slice(0,QW).map(e=>String(e??``)));return{name:e,rows:r,columnCount:Math.min(QW,r.reduce((e,t)=>Math.max(e,t.length),0)),truncated:n.length>ZW||n.some(e=>e.length>QW)}});n||r({contentUrl:e,status:`ready`,sheets:o})}),[]).catch(t=>{n||(console.error(`Failed to render spreadsheet preview`,t),r({contentUrl:e,status:`error`,sheets:[]}))}),()=>{n=!0}},[e,t.data]),(0,F.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col bg-white`,"data-testid":`workspace-content-spreadsheet`,children:[(0,F.jsx)(qW,{status:s}),o&&o.sheets.length>1?(0,F.jsx)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b border-border px-2 py-1.5 custom-scrollbar`,children:o.sheets.map(e=>(0,F.jsx)(`button`,{type:`button`,className:m(`h-7 shrink-0 rounded-md px-2.5 text-xs transition-colors`,e.name===c?.name?`bg-accent font-medium text-accent-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),onClick:()=>a(e.name),children:e.name},e.name))}):null,c?(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto custom-scrollbar`,children:(0,F.jsxs)(`table`,{className:`min-w-full border-collapse text-xs text-foreground`,children:[(0,F.jsx)(`thead`,{className:`sticky top-0 z-[1] bg-muted`,children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`sticky left-0 z-[2] h-7 min-w-10 border border-border bg-muted px-2`}),Array.from({length:c.columnCount},(e,t)=>(0,F.jsx)(`th`,{className:`h-7 min-w-24 border border-border px-2 text-center font-medium text-muted-foreground`,children:$W(t)},t))]})}),(0,F.jsx)(`tbody`,{children:c.rows.map((e,t)=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{className:`sticky left-0 min-w-10 border border-border bg-muted px-2 text-right font-normal text-muted-foreground`,children:t+1}),Array.from({length:c.columnCount},(t,n)=>(0,F.jsx)(`td`,{className:`max-w-80 whitespace-pre-wrap border border-border px-2 py-1.5 align-top`,children:e[n]??``},n))]},t))})]})}):null,c?.truncated?(0,F.jsx)(`div`,{className:`shrink-0 border-t border-border bg-muted/60 px-3 py-1.5 text-xs text-muted-foreground`,children:f(`chatWorkspaceSpreadsheetPreviewTruncated`)}):null]})}function tG(e){let t=e.mimeType?.trim().toLowerCase()??``,n=e.path.trim().toLowerCase();return t.startsWith(`image/`)||/\.(avif|bmp|gif|heic|heif|ico|jpe?g|png|svg|tiff?|webp)$/i.test(n)?`image`:t.startsWith(`audio/`)||/\.(aac|flac|m4a|mp3|ogg|opus|wav|weba)$/i.test(n)?`audio`:t.startsWith(`video/`)||/\.(avi|m4v|mkv|mov|mp4|webm|wmv)$/i.test(n)?`video`:t.includes(`pdf`)||n.endsWith(`.pdf`)?`pdf`:t===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||n.endsWith(`.docx`)?`docx`:t.includes(`spreadsheet`)||t.includes(`excel`)||/\.(ods|xls|xlsb|xlsm|xlsx)$/i.test(n)?`spreadsheet`:t===`application/vnd.openxmlformats-officedocument.presentationml.presentation`||n.endsWith(`.pptx`)?`presentation`:t.includes(`html`)||/\.html?$/i.test(n)?`html`:`other`}function nG({contentUrl:e,label:t}){return(0,F.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-6 text-center`,"data-testid":`workspace-content-unsupported`,children:[(0,F.jsxs)(`div`,{className:`max-w-sm space-y-1.5`,children:[(0,F.jsx)(`p`,{className:`truncate text-sm font-medium text-foreground`,title:t,children:t}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f(`chatWorkspacePreviewUnsupported`)}),(0,F.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground/80`,children:f(`chatWorkspacePreviewUnsupportedHint`)})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,F.jsx)(`a`,{href:e,download:t,className:`inline-flex h-8 items-center rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted`,children:f(`chatWorkspacePreviewDownload`)}),(0,F.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`inline-flex h-8 items-center rounded-lg bg-primary px-3 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:f(`chatWorkspacePreviewOpenExternally`)})]})]})}function rG({contentUrl:e,kind:t,label:n}){return t===`image`?(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center overflow-auto bg-white p-4 custom-scrollbar`,children:(0,F.jsx)(`img`,{src:e,alt:n,className:`max-h-full max-w-full object-contain`,"data-testid":`workspace-content-image`})}):t===`audio`?(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center bg-white px-6`,children:(0,F.jsx)(`audio`,{controls:!0,preload:`metadata`,"aria-label":n,className:`w-full max-w-xl`,"data-testid":`workspace-content-audio`,src:e})}):t===`video`?(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center bg-black`,children:(0,F.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,"aria-label":n,className:`max-h-full max-w-full`,"data-testid":`workspace-content-video`,src:e})}):t===`pdf`||t===`html`?(0,F.jsx)(`iframe`,{allowFullScreen:!0,className:`h-full w-full border-0 bg-white`,"data-testid":t===`pdf`?`workspace-content-pdf`:`workspace-html-preview`,src:e,title:n}):t===`docx`?(0,F.jsx)(YW,{contentUrl:e}):t===`spreadsheet`?(0,F.jsx)(eG,{contentUrl:e}):t===`presentation`?(0,F.jsx)(XW,{contentUrl:e}):(0,F.jsx)(nG,{contentUrl:e,label:n})}function iG(e){return[`server-path-read`,e.path?.trim()??``,e.basePath??null,e.line??null]}function aG(e){let{basePath:t,enabled:n=!0,line:r,path:i}=e,a=i?.trim()??``;return E({queryKey:iG({path:a,basePath:t,line:r}),queryFn:()=>Ne({path:a,basePath:t,line:r}),enabled:n&&a.length>0,staleTime:0})}function oG(e){return e.serverKind?e.serverKind:/\.mdx?$/i.test(e.path)?`markdown`:`text`}function sG(e,t){return t<=0?e:`${e}${e.includes(`?`)?`&`:`?`}refresh=${t}`}function cG(e){let{languageHint:t,path:n,startLine:r,text:i}=e,a=r??1;return{key:`preview:${n}`,path:n,display:`preview`,lines:JH({text:i,kind:`context`,oldStartLine:a,newStartLine:a}),rawText:i,languageHint:t??null,oldStartLine:a,newStartLine:a}}function lG(e){if(Array.isArray(e.fullLines)&&e.fullLines.length>0)return{key:`diff:${e.key}`,path:e.path,display:`diff`,lines:e.fullLines,fullLines:e.fullLines,...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...e.patchText?{patchText:e.patchText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{}};if(e.beforeText==null&&e.afterText==null)return null;let t=QH({beforeText:e.beforeText??``,afterText:e.afterText??``,oldStartLine:e.oldStartLine??void 0,newStartLine:e.newStartLine??void 0});return{key:`diff:${e.key}`,path:e.path,display:`diff`,lines:t,fullLines:t,...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{}}}function uG({text:e,tone:t=`muted`}){return(0,F.jsx)(`div`,{className:m(`flex h-full items-center justify-center px-6 text-center text-sm`,t===`error`?`text-rose-600`:`text-gray-500`),children:e})}function dG({diffBlock:e}){return e?(0,F.jsx)(fG,{block:e}):(0,F.jsx)(uG,{text:f(`chatWorkspaceDiffEmpty`)})}function fG({block:e,targetColumn:t,targetLine:n}){return(0,F.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar bg-white`,children:(0,F.jsx)(jB,{block:e,layout:`workspace`,targetColumn:t,targetLine:n})})}function pG({contentUrl:e,contentUrlKind:t,contentLabel:n,directoryQuery:r,fileBasePath:i,onFileOpen:a,previewBlock:o,previewKind:s,previewViewer:c,previewQuery:l,previewText:u,targetColumn:d,targetLine:p}){return e&&t?(0,F.jsx)(rG,{contentUrl:e,kind:t,label:n}):r?.data?(0,F.jsx)(BW,{browseQuery:r,onFileOpen:a,renderStatus:e=>(0,F.jsx)(uG,{...e})}):r?.isLoading&&l?.error&&!o?(0,F.jsx)(uG,{text:f(`chatWorkspaceLoadingDirectory`)}):(r?.isLoading||l?.isLoading)&&!o?(0,F.jsx)(uG,{text:f(`chatWorkspaceLoadingPreview`)}):l?.data?.kind===`binary`?(0,F.jsx)(uG,{text:f(`chatWorkspacePreviewUnsupported`)}):l?.error&&!o?(0,F.jsx)(uG,{tone:`error`,text:l.error instanceof Error?l.error.message:String(l.error)}):s===`markdown`&&c!==`source`&&u?(0,F.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar px-5 py-4`,children:(0,F.jsx)(cz,{text:u,role:`assistant`,texts:{copyCodeLabel:f(`chatCodeCopy`),copiedCodeLabel:f(`chatCodeCopied`)},onFileOpen:a,resolveFileContentUrl:e=>Fe(e.path,i)})}):o?(0,F.jsx)(fG,{block:o,targetColumn:d,targetLine:p}):(0,F.jsx)(uG,{text:f(`chatWorkspacePreviewEmpty`)})}function mG({file:e,refreshVersion:t=0,sessionProjectRoot:n,sessionWorkingDir:r,showBreadcrumbs:i=!0,onFileOpen:a}){let o=e.viewMode===`preview`,s=e.contentUrl?.trim()||null,c=o&&!s,l=aG({path:e.path,basePath:r,line:e.line,enabled:c}),u=Js({path:e.path,basePath:r,includeFiles:!0,enabled:c}),d=(0,P.useMemo)(()=>e.viewMode===`diff`?lG(e):null,[e]),f=o?l?.data?.text??e.rawText??null:null,p=oG({path:l?.data?.resolvedPath??e.path,serverKind:l?.data?.kind}),m=s?tG({path:e.path,mimeType:e.mimeType}):null,h=u?.data?.currentPath??l?.data?.resolvedPath??e.path,g=u?.data?`directory`:`file`,_=Uu(h,e.previewViewer),v=tG({path:h}),y=Fe(e.path,r),b=!s&&o&&y&&e.previewViewer!==`source`&&v!==`other`&&(v!==`html`||_===`rendered`)&&y?sG(y,t):null,x=s??b,S=m??(b?v:null),C=(0,P.useMemo)(()=>!o||!f||x?null:cG({path:l?.data?.resolvedPath??e.path,text:f,languageHint:l?.data?.languageHint??null,startLine:l?.data?.startLine??1}),[x,e.path,o,l?.data?.languageHint,l?.data?.resolvedPath,l?.data?.startLine,f]),w=!x&&!!l?.data?.truncated,T=n??r,E=(0,P.useMemo)(()=>wc({path:h,kind:g,sessionProjectRoot:T,truncated:w}),[T,w,g,h]);return(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-white`,children:[i?(0,F.jsx)(GW,{breadcrumb:E,onFileOpen:a}):null,(0,F.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:e.viewMode===`diff`?(0,F.jsx)(dG,{diffBlock:d}):(0,F.jsx)(pG,{contentUrl:x,contentUrlKind:S,contentLabel:e.label?.trim()||h,directoryQuery:u,fileBasePath:r,onFileOpen:a,previewBlock:C,previewKind:p,previewViewer:_,previewQuery:l,previewText:f,targetColumn:e.column,targetLine:e.line})})]})}function hG(e,t){let n=e.path.trim();if(!n)return null;let r=t?.trim()||null,i=e.viewMode===`preview`?Wu(n,e.previewViewer??(e.line?`source`:void 0)):e.previewViewer??null,a=e.viewMode===`preview`&&i===`rendered`?`preview:rendered`:e.viewMode;return{key:`${r??`draft`}::${a}::${n}`,parentSessionKey:r,path:n,label:e.label?.trim()||null,viewMode:e.viewMode,previewViewer:i,line:e.line??null,column:e.column??null,rawText:e.rawText??null,contentUrl:e.contentUrl?.trim()||null,mimeType:e.mimeType?.trim()||null,beforeText:e.beforeText??null,afterText:e.afterText??null,patchText:e.patchText??null,oldStartLine:e.oldStartLine??null,newStartLine:e.newStartLine??null,fullLines:e.fullLines}}function gG(e,t,n){let r=e.findIndex(e=>e.key===t.key);if(r!==-1){let n=[...e];return n[r]={...e[r],...t},n}let i=n?e.findIndex(e=>e.key===n):-1;return i===-1?[t,...e]:[...e.slice(0,i+1),t,...e.slice(i+1)]}function _G(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function vG({display:e,parentSessionKey:t,sessionProjectRoot:n,sessionWorkingDir:r,onFileOpen:i}){if(e.target.type!==`file`)return null;let{path:a,line:o,column:s,viewer:c}=e.target.payload,l=hG({path:a,label:e.title,viewMode:`preview`,previewViewer:c,line:o,column:s},t);if(!l)return null;let u=e.title??_G(l.path);return(0,F.jsxs)(`section`,{className:`my-2 w-full max-w-[48rem] overflow-hidden rounded-lg border border-border bg-card shadow-sm`,"data-chat-inline-file-preview":`true`,"data-chat-message-wide-content":`true`,children:[(0,F.jsxs)(`header`,{className:`border-b border-border bg-muted/45 px-3 py-2`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium text-foreground`,children:[(0,F.jsx)(Zt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`truncate`,children:u})]}),(0,F.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] font-normal text-muted-foreground`,title:l.path,children:l.path})]}),(0,F.jsx)(`div`,{className:`h-[420px] min-h-[240px] max-h-[min(60vh,420px)] overflow-hidden`,children:(0,F.jsx)(mG,{file:l,sessionProjectRoot:n,sessionWorkingDir:r,showBreadcrumbs:!1,onFileOpen:i})})]})}function yG({deletePending:e,entry:t,favoritePending:n,onDelete:r,onOpen:i,onToggleFavorite:a}){let[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)(!1),u=t.favorite?f(`panelAppsUnfavorite`):f(`panelAppsFavorite`),d=t.lastOpenedAt?`${f(`panelAppsLastOpened`)} ${xG(t.lastOpenedAt)}`:`${f(`panelAppsUpdated`)} ${xG(t.updatedAt)}`,p=e=>{e.stopPropagation(),a()},m=()=>{s(!1),l(!0)};return(0,F.jsxs)(`div`,{className:`group w-full min-w-0 rounded-lg border border-border/60 bg-card px-2.5 py-2.5 transition-colors hover:bg-muted/40`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:i,className:`min-w-0 flex-1 text-left`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-base text-muted-foreground`,children:(0,F.jsx)(SG,{icon:t.icon,title:t.title})}),(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:t.title})]}),t.description?(0,F.jsx)(`span`,{className:`mt-1.5 block truncate text-xs leading-5 text-muted-foreground`,children:t.description}):null,(0,F.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] leading-4 text-muted-foreground/70`,children:d})]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:p,disabled:n,className:`rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,title:u,"aria-label":u,children:(0,F.jsx)(os,{className:t.favorite?`h-4 w-4 fill-current text-foreground`:`h-4 w-4`})}),(0,F.jsxs)(Ze,{open:o,onOpenChange:s,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground`,"aria-label":f(`panelAppsMoreActions`),disabled:e,children:(0,F.jsx)(pt,{className:`h-4 w-4`})})}),(0,F.jsx)(Ye,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,F.jsx)(bG,{destructive:!0,disabled:e,icon:Sn,label:f(`panelAppsDelete`),onClick:m})})]})]})]}),(0,F.jsx)(at,{open:c,onOpenChange:l,title:f(`panelAppsDeleteConfirmTitle`),description:`${f(`panelAppsDeleteConfirmDescription`)} ${t.fileName}`,confirmLabel:f(`delete`),variant:`destructive`,onConfirm:r,onCancel:()=>void 0})]})}function bG({destructive:e=!1,disabled:t=!1,icon:n,label:r,onClick:i}){return(0,F.jsxs)(`button`,{type:`button`,className:m(`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`),disabled:t,onClick:i,children:[(0,F.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,F.jsx)(`span`,{children:r})]})}function xG(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=u(r()),i=new Date;return t.toDateString()===i.toDateString()?new Intl.DateTimeFormat(n,{hour:`2-digit`,minute:`2-digit`}).format(t):t.getFullYear()===i.getFullYear()?new Intl.DateTimeFormat(n,{month:`numeric`,day:`numeric`}).format(t):new Intl.DateTimeFormat(n,{year:`2-digit`,month:`numeric`,day:`numeric`}).format(t)}function SG({icon:e,title:t}){return e?CG(e)?(0,F.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,className:`h-5 w-5 rounded-sm object-contain`,title:t}):(0,F.jsx)(`span`,{className:`max-w-6 truncate text-center leading-none`,children:e}):(0,F.jsx)(Ga,{className:`h-4 w-4`})}function CG(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}var wG=[`panel-apps`];function TG(e={}){return E({queryKey:wG,queryFn:()=>ye.panelApps.listPanelApps(),enabled:e.enabled??!0,staleTime:0})}function EG(){let e=pe();return Me({mutationFn:({id:e,preferences:t})=>ye.panelApps.updatePanelAppPreferences(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:wG})}})}function DG(){let e=pe();return Me({mutationFn:e=>ye.panelApps.recordPanelAppOpened(e),onSuccess:()=>{e.invalidateQueries({queryKey:wG})}})}function OG(){let e=pe();return Me({mutationFn:e=>ye.panelApps.grantClient(e),onSuccess:()=>{e.invalidateQueries({queryKey:wG})}})}function kG(){let e=pe();return Me({mutationFn:e=>ye.panelApps.deletePanelApp(e),onSuccess:()=>{e.invalidateQueries({queryKey:wG})}})}function AG(e,t){return t===`favorites`?jG(e.filter(e=>e.favorite),`smart`):jG(t===`recent-open`?e.filter(e=>e.lastOpenedAt):e,t)}function jG(e,t){return[...e].sort((e,n)=>MG(e,n,t))}function MG(e,t,n){return n===`recent-open`?IG(e.lastOpenedAt,t.lastOpenedAt)||NG(e,t):n===`updated`?IG(e.updatedAt,t.updatedAt)||NG(e,t):n===`name`?NG(e,t):PG(e,t)||Number(t.favorite)-Number(e.favorite)||NG(e,t)}function NG(e,t){return e.title.localeCompare(t.title)}function PG(e,t){return FG(t)-FG(e)}function FG(e){return Math.max(new Date(e.lastOpenedAt??0).getTime(),new Date(e.createdAt).getTime(),new Date(e.updatedAt).getTime())}function IG(e,t){return new Date(t??0).getTime()-new Date(e??0).getTime()}var LG=[];function RG({headerContent:e,onOpenPanelApp:t}){let n=TG(),r=kG(),i=EG(),a=DG(),o=OG(),s=c2(),c=si(),[l,u]=(0,P.useState)(`smart`),d=n.data?.entries??LG,p=(0,P.useMemo)(()=>AG(d,l),[d,l]),m=async e=>{if(await h(e))try{t(await a.mutateAsync(e.id))}catch{t(e)}},h=async e=>!e.clientDeclared||e.clientGranted?!0:await s.serviceActionAuthorizationManager.requestAuthorization({panelAppId:e.appId,actions:[{actionId:`nextclaw.client`,actionTitle:f(`panelAppsClientGrantTitle`),actionDescription:f(`panelAppsClientGrantDescription`),risk:`dangerous`}]})?(await o.mutateAsync(e.appId),!0):!1,g=e=>{i.mutate({id:e.id,preferences:{favorite:!e.favorite}})},_=e=>{r.mutate(e.id)},v=()=>{c(`/chat`),s.chatDraftIntentManager.requestDraft(f(`panelAppsExamplePrompt`))};return n.isLoading?(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:f(`panelAppsLoading`)}):n.isError?(0,F.jsx)(`div`,{className:`p-4 text-sm text-rose-600`,children:n.error instanceof Error?n.error.message:f(`panelAppsLoadFailed`)}):(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/70 px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e??(0,F.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:f(`panelAppsTitle`)}),n.data?.panelsPath?(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`rounded p-0.5 text-muted-foreground/70 transition-colors hover:bg-accent hover:text-accent-foreground`,"aria-label":f(`panelAppsTitle`),children:(0,F.jsx)(ro,{className:`h-3.5 w-3.5`})})}),(0,F.jsx)(yt,{side:`bottom`,className:`max-w-[320px] break-all font-mono text-xs`,children:n.data.panelsPath})]})}):null]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>void n.refetch(),className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,title:f(`panelAppsRefresh`),"aria-label":f(`panelAppsRefresh`),children:(0,F.jsx)(yn,{className:`h-3.5 w-3.5`})})]}),(0,F.jsx)(`div`,{className:`border-b border-border/70 px-3 py-2`,children:(0,F.jsx)(fn,{value:l,onValueChange:e=>u(e),children:(0,F.jsxs)(un,{className:`grid h-auto w-full grid-cols-5 rounded-lg bg-muted/70 p-0.5`,children:[(0,F.jsx)(cn,{value:`smart`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortSmart`)}),(0,F.jsx)(cn,{value:`favorites`,className:`px-2 py-1 text-xs`,children:f(`panelAppsFavorites`)}),(0,F.jsx)(cn,{value:`recent-open`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortRecentOpen`)}),(0,F.jsx)(cn,{value:`updated`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortUpdated`)}),(0,F.jsx)(cn,{value:`name`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortName`)})]})})}),d.length===0?(0,F.jsx)(zG,{panelsPath:n.data?.panelsPath,onCreateExample:v,onRefresh:()=>void n.refetch()}):p.length===0?(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground`,children:f(`panelAppsEmptyFiltered`)}):(0,F.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto p-3`,children:(0,F.jsx)(`div`,{className:`space-y-1.5`,children:p.map(e=>(0,F.jsx)(yG,{entry:e,deletePending:r.isPending,favoritePending:i.isPending,onDelete:()=>_(e),onOpen:()=>void m(e),onToggleFavorite:()=>g(e)},e.id))})})]})}function zG({onCreateExample:e,panelsPath:t,onRefresh:n}){return(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center overflow-y-auto px-5 py-6 text-center`,children:(0,F.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,F.jsx)(`div`,{className:`mx-auto flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,F.jsx)(Ga,{className:`h-5 w-5`})}),(0,F.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-foreground`,children:f(`panelAppsEmptyTitle`)}),(0,F.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:f(`panelAppsEmptyDescription`)}),(0,F.jsxs)(`div`,{className:`mt-4 space-y-2 text-left`,children:[(0,F.jsx)(BG,{icon:(0,F.jsx)(Ro,{className:`h-4 w-4`}),title:f(`panelAppsEmptyAskTitle`),description:f(`panelAppsEmptyAskDescription`),actionLabel:f(`panelAppsEmptyAskAction`),onAction:e}),(0,F.jsx)(BG,{icon:(0,F.jsx)(ho,{className:`h-4 w-4`}),title:f(`panelAppsEmptyFileTitle`),description:f(`panelAppsEmptyFileDescription`)})]}),t?(0,F.jsxs)(`div`,{className:`mt-4 rounded-md bg-muted/60 px-3 py-2 text-left`,children:[(0,F.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:f(`panelAppsPanelsPath`)}),(0,F.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:t})]}):null,(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`mt-4 inline-flex items-center justify-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,F.jsx)(yn,{className:`h-3.5 w-3.5`}),f(`panelAppsRefresh`)]})]})})}function BG({actionLabel:e,description:t,icon:n,onAction:r,title:i}){let a=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:n}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:i}),(0,F.jsx)(`div`,{className:`mt-0.5 text-xs leading-5 text-muted-foreground`,children:t}),e?(0,F.jsx)(`div`,{className:`mt-2 text-xs font-medium text-primary`,children:e}):null]})]});return r?(0,F.jsx)(`button`,{type:`button`,onClick:r,className:`flex w-full gap-2 rounded-md bg-muted/60 px-3 py-2.5 text-left transition-colors hover:bg-accent/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:a}):(0,F.jsx)(`div`,{className:`flex gap-2 rounded-md bg-muted/60 px-3 py-2.5`,children:a})}var VG=class{constructor(e){this.authorizationManager=e,this.handleIframeMessage=({event:e,iframe:t,iframeInstanceId:n,tab:r})=>{this.isBridgeRequest(e.data)&&(!t?.contentWindow||e.source!==t.contentWindow||this.handleBridgeRequest({event:e,iframe:t,iframeInstanceId:n,tab:r},e.data))},this.handleBridgeRequest=async(e,t)=>{try{let n=this.getBridgeContext(t),r=await this.dispatchRequest(n,t);this.postResponse(e,{type:`nextclaw:panel-app-service-actions:response`,requestId:t.requestId,ok:!0,data:r})}catch(n){this.postResponse(e,{type:`nextclaw:panel-app-service-actions:response`,requestId:t.requestId,ok:!1,error:this.toBridgeError(n)})}},this.dispatchRequest=async(e,t)=>{switch(t.method){case`list`:return await ye.serviceApps.listServiceActions({bridgeSessionToken:e.token});case`requestGrant`:return await this.confirmAndGrant(e,this.requireActionId(t));case`revokeGrant`:return await ye.serviceApps.revokeServiceAction(this.requireActionId(t),{bridgeSessionToken:e.token});case`invoke`:return await this.invokeWithAuthorization(e,t);case`agent.send`:return await this.sendAgentMessageWithAuthorization(e,t);case`agent.generateObject`:return await this.generateAgentObjectWithAuthorization(e,t);default:throw Error(`Unsupported panel bridge method: ${String(t.method)}`)}},this.invokeWithAuthorization=async(e,t)=>{let n=this.requireActionId(t);try{return await ye.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}catch(r){if(!(r instanceof ee)||r.code!==`AUTHORIZATION_REQUIRED`)throw r;return await this.confirmAndGrant(e,n,this.readOptionalRecord(t.payload?.input)),await ye.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}},this.sendAgentMessageWithAuthorization=async(e,t)=>{try{return await ye.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof ee)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:send`),await ye.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}},this.generateAgentObjectWithAuthorization=async(e,t)=>{try{return await ye.panelApps.generateAgentObject(this.readGenerateObjectRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof ee)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:generateObject`),await ye.panelApps.generateAgentObject(this.readGenerateObjectRequest(t),{bridgeSessionToken:e.token})}},this.confirmAndGrantAgentCapability=async(e,t)=>{if(!await this.authorizationManager.requestAuthorization({panelAppId:e.appId,actions:[{actionId:t,actionTitle:t===`agent:send`?`Send agent message`:`Generate object`,actionDescription:t===`agent:send`?`Send a message to a NextClaw Agent session.`:`Send context to a NextClaw Agent session and receive a structured object.`,risk:`write`}]}))throw new ee({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});return await ye.panelApps.grantAgentCapability(t,{bridgeSessionToken:e.token})},this.confirmAndGrant=async(e,t,n)=>{let r=await this.listGrantCandidateActions(e,t);if(!await this.authorizationManager.requestAuthorization({panelAppId:e.appId,actions:r.map(e=>({actionId:e.id,actionTitle:e.title,actionDescription:e.description,risk:e.risk})),inputPreview:this.createInputPreview(n)}))throw new ee({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});let i=await ye.serviceApps.grantServiceActions(r.map(e=>e.id),{bridgeSessionToken:e.token}),a=i.grants.find(e=>e.actionId===t)??i.grants[0];if(!a)throw Error(`No permission grant returned for ${t}.`);return a},this.listGrantCandidateActions=async(e,t)=>{let n=await ye.serviceApps.listServiceActions({bridgeSessionToken:e.token}),r=n.actions.find(e=>e.id===t);if(r&&r.grantState!==`not-granted`)return[r];let i=n.actions.filter(e=>e.grantState===`not-granted`),a=[...i.filter(e=>e.id===t),...i.filter(e=>e.id!==t)];return a.length>0?a:[{appId:r?.appId??t.split(`.`)[0]??t,description:r?.description,id:t,name:r?.name??t,risk:r?.risk??`dangerous`,title:r?.title}]},this.createInputPreview=e=>{if(!(!e||Object.keys(e).length===0))try{let t=JSON.stringify(e,null,2);return t.length>500?`${t.slice(0,500)}...`:t}catch{return`[unserializable input]`}},this.getBridgeContext=e=>({appId:e.appId,token:e.runtimeToken}),this.requireActionId=e=>{let t=e.payload?.actionId?.trim();if(!t)throw Error(`Panel bridge actionId is required.`);return t},this.readOptionalRecord=e=>{if(e!==void 0)return this.requireRecord(e,`input`)},this.readAgentSendRequest=e=>({payload:this.requireRecord(e.payload?.request,`agent.send request`)}),this.readGenerateObjectRequest=e=>({input:this.requireRecord(e.payload?.input,`generateObject input`)}),this.requireRecord=(e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`${t} is required.`);return e},this.postResponse=(e,t)=>{e.iframe?.contentWindow?.postMessage(t,`*`)},this.toBridgeError=e=>e instanceof ee?{code:e.code,message:e.message,details:e.details}:{message:e instanceof Error?e.message:String(e)},this.isBridgeRequest=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`nextclaw:panel-app-service-actions:request`&&typeof t.requestId==`string`&&typeof t.runtimeToken==`string`&&typeof t.appId==`string`&&(t.method===`invoke`||t.method===`agent.send`||t.method===`agent.generateObject`||t.method===`list`||t.method===`requestGrant`||t.method===`revokeGrant`)}}};function HG(e,t){let n=t.trim();return[e.id,e.appId,e.fileName,e.title].some(e=>e.trim()===n)}function UG(e,t){let n=t.trim();return n?e.find(e=>HG(e,n))??null:null}var WG=`allow-scripts allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-downloads allow-pointer-lock allow-presentation`;function GG(e){e?.focus({preventScroll:!0}),e?.contentWindow?.focus()}function KG(){return`service-action-auth-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}var qG=p((e,t)=>({pending:null,requestAuthorization:async n=>await new Promise(r=>{t().pending?.resolve(!1),e({pending:{id:KG(),...n,resolve:r}})}),resolveAuthorization:n=>{let{pending:r}=t();r&&(r.resolve(n),e({pending:null}))}}));function JG(){let e=qG(e=>e.pending),t=qG(e=>e.resolveAuthorization);return(0,F.jsx)(tt,{open:!!e,onOpenChange:e=>{e||t(!1)},children:(0,F.jsxs)(rt,{className:`[&>:last-child]:hidden`,children:[(0,F.jsxs)(nt,{children:[(0,F.jsxs)(it,{className:`flex items-center gap-2`,children:[(0,F.jsx)(es,{className:`h-4 w-4 text-amber-600`}),f(`serviceActionAuthorizationTitle`)]}),(0,F.jsx)(et,{children:f(`serviceActionAuthorizationDescription`)})]}),e?(0,F.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-muted/60 p-3 text-sm`,children:[(0,F.jsx)(XG,{label:f(`serviceActionAuthorizationSource`),value:e.panelAppId}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:f(`serviceActionAuthorizationActions`)}),(0,F.jsx)(`div`,{className:`max-h-64 space-y-2 overflow-auto`,children:e.actions.map(e=>(0,F.jsx)(YG,{action:e},e.actionId))})]}),e.inputPreview?(0,F.jsx)(XG,{label:f(`serviceActionAuthorizationInput`),value:e.inputPreview}):null]}):null,(0,F.jsxs)($e,{className:`gap-2 sm:gap-0`,children:[(0,F.jsx)(w,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:f(`serviceActionAuthorizationReject`)}),(0,F.jsx)(w,{type:`button`,onClick:()=>t(!0),children:f(`serviceActionAuthorizationAllow`)})]})]})})}function YG({action:e}){return(0,F.jsxs)(`div`,{className:`space-y-1 rounded border border-border bg-card px-3 py-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsx)(`div`,{className:`min-w-0 break-words text-xs font-medium text-foreground`,children:e.actionTitle??e.actionId}),(0,F.jsx)(`div`,{className:`shrink-0 rounded bg-amber-50 px-1.5 py-0.5 text-[11px] font-medium text-amber-700`,children:e.risk??`dangerous`})]}),(0,F.jsx)(`div`,{className:`break-words text-[11px] text-muted-foreground`,children:e.actionId}),e.actionDescription?(0,F.jsx)(`div`,{className:`break-words text-xs text-muted-foreground`,children:e.actionDescription}):null]})}function XG({label:e,value:t}){return(0,F.jsxs)(`div`,{className:`grid grid-cols-[5rem_minmax(0,1fr)] gap-3`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,F.jsx)(`div`,{className:`min-w-0 break-words text-xs text-foreground`,children:t})]})}var ZG=class{constructor(){this.requestAuthorization=async e=>await qG.getState().requestAuthorization(e)}},QG=[`service-apps`],$G=[`service-actions`],eK=[`service-action-grants`];function tK(){return E({queryKey:QG,queryFn:()=>ye.serviceApps.listServiceApps()})}function nK(){return E({queryKey:$G,queryFn:()=>ye.serviceApps.listServiceActions()})}function rK(){return E({queryKey:eK,queryFn:()=>ye.serviceApps.listServiceActionGrants()})}function iK(){let e=pe();return Me({mutationFn:e=>ye.serviceApps.restartServiceApp(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:QG}),e.invalidateQueries({queryKey:$G})])}})}function aK(){let e=pe();return Me({mutationFn:e=>ye.serviceApps.deleteServiceApp(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:QG}),e.invalidateQueries({queryKey:$G}),e.invalidateQueries({queryKey:eK})])}})}function oK(){let e=pe();return Me({mutationFn:e=>ye.serviceApps.discoverServiceAppActions(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:QG})}})}function sK(){let e=pe();return Me({mutationFn:e=>ye.serviceApps.revokeServiceActionGrant(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:$G}),e.invalidateQueries({queryKey:eK})])}})}function cK({headerContent:e}){let t=tK(),n=nK(),r=rK(),i=aK(),a=iK(),o=oK(),s=sK(),[c,l]=(0,P.useState)({}),[u,d]=(0,P.useState)({}),p=()=>{t.refetch(),n.refetch(),r.refetch()};if(t.isLoading||n.isLoading||r.isLoading)return(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:f(`serviceAppsLoading`)});if(t.isError||n.isError||r.isError){let e=t.error??n.error??r.error;return(0,F.jsx)(`div`,{className:`p-4 text-sm text-rose-600`,children:e instanceof Error?e.message:f(`serviceAppsLoadFailed`)})}let m=t.data?.entries??[],h=n.data?.actions??[],g=r.data?.grants??[],_=e=>{o.mutateAsync(e).then(t=>{l(n=>({...n,[e]:t.actions})),d(t=>({...t,[e]:!0}))})};return(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/60 px-4 py-3`,children:[(0,F.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:e??(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)($o,{className:`h-4 w-4 text-primary`}),(0,F.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:f(`serviceAppsTitle`)})]})}),(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsx)(fK,{icon:yn,label:f(`serviceAppsRefresh`),onClick:p})})]}),m.length===0?(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 py-8 text-center`,children:(0,F.jsxs)(`div`,{className:`w-full max-w-xs`,children:[(0,F.jsx)(`div`,{className:`mx-auto flex h-10 w-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,F.jsx)($o,{className:`h-5 w-5`})}),(0,F.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-foreground`,children:f(`serviceAppsEmptyTitle`)}),(0,F.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:f(`serviceAppsEmptyDescription`)})]})}):(0,F.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto bg-muted/25 p-3`,children:(0,F.jsx)(`div`,{className:`space-y-2.5`,children:m.map(e=>(0,F.jsx)(lK,{app:e,actions:c[e.id]??h.filter(t=>t.appId===e.id),actionsOpen:!!u[e.id],grants:g,deletePending:i.isPending,isDiscovering:o.isPending,onActionsOpenChange:t=>d(n=>({...n,[e.id]:t})),onDiscover:_,onDelete:e=>void i.mutate(e),onRestart:e=>void a.mutate(e),onRevoke:e=>void s.mutate({actionId:e.actionId,caller:e.caller})},e.id))})})]})}function lK({app:e,actions:t,actionsOpen:n,grants:r,deletePending:i,isDiscovering:a,onActionsOpenChange:o,onDiscover:s,onDelete:c,onRestart:l,onRevoke:u}){let[d,p]=(0,P.useState)(!1),[h,g]=(0,P.useState)(!1),_=e.status!==`starting`&&e.status!==`stopped`,v=e.status===`running`||e.status===`failed`,y=()=>{p(!1),g(!0)};return(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-border/70 bg-card shadow-[0_1px_2px_rgba(30,20,10,0.03)]`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-3 px-3 pt-3`,children:[(0,F.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,F.jsx)($o,{className:`h-4 w-4`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:e.title}),(0,F.jsx)(uK,{status:e.status})]}),e.description?(0,F.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-muted-foreground`,children:e.description}):null]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,F.jsx)(fK,{disabled:a||!_,icon:Xo,label:f(`serviceAppsDiscoverActions`),tooltip:f(`serviceAppsDiscoverActionsHint`),onClick:()=>s(e.id)}),(0,F.jsx)(fK,{disabled:!v,icon:ls,label:f(`serviceAppsDisconnectRuntime`),tooltip:f(`serviceAppsDisconnectRuntimeHint`),onClick:()=>l(e.id)}),(0,F.jsxs)(Ze,{open:d,onOpenChange:p,children:[(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,"aria-label":f(`serviceAppsMoreActions`),disabled:i,children:(0,F.jsx)(pt,{className:`h-3.5 w-3.5`})})})}),(0,F.jsx)(yt,{side:`bottom`,className:`text-xs`,children:f(`serviceAppsMoreActions`)})]}),(0,F.jsx)(Ye,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,F.jsx)(pK,{destructive:!0,disabled:i,icon:Sn,label:f(`serviceAppsDelete`),onClick:y})})]})]})]}),e.lastError?(0,F.jsx)(`div`,{className:`mx-3 mt-3 rounded-lg border border-rose-200/70 bg-rose-50 px-2.5 py-1.5 text-xs text-rose-700`,children:e.lastError}):null,(0,F.jsx)(mK,{app:e}),(0,F.jsxs)(`div`,{className:`mt-3 border-t border-border/50 bg-muted/30`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>o(!n),className:`flex w-full items-start justify-between gap-2 px-3 py-2 text-left transition-colors hover:bg-muted/40`,"aria-expanded":n,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground/80`,children:f(`serviceAppsActionsSection`)}),(0,F.jsx)(`span`,{className:`rounded-full bg-card px-1.5 py-0.5 text-[11px] tabular-nums text-muted-foreground/70`,children:t.length})]}),n?null:t.length===0?(0,F.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground`,children:f(`serviceAppsActionsEmpty`)}):(0,F.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:[t.slice(0,4).map(e=>(0,F.jsx)(`span`,{className:`max-w-[9.5rem] truncate rounded-md border border-border/50 bg-card px-1.5 py-0.5 text-[11px] text-muted-foreground`,title:e.title??e.name,children:e.title??e.name},e.id)),t.length>4?(0,F.jsxs)(`span`,{className:`rounded-md bg-card px-1.5 py-0.5 text-[11px] text-muted-foreground/70`,children:[`+`,t.length-4]}):null]})]}),(0,F.jsx)(Et,{className:m(`mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground/70 transition-transform`,n&&`rotate-180`)})]}),n?(0,F.jsx)(`div`,{className:`px-3 pb-2.5`,children:t.length===0?(0,F.jsx)(`div`,{className:`rounded-lg border border-dashed border-border/70 bg-card/70 px-2.5 py-2 text-[11px] text-muted-foreground`,children:f(`serviceAppsActionsEmpty`)}):(0,F.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,F.jsx)(gK,{action:e,grants:r.filter(t=>t.actionId===e.id),onRevoke:u},e.id))})}):null]}),(0,F.jsx)(at,{open:h,onOpenChange:g,title:f(`serviceAppsDeleteConfirmTitle`),description:`${f(`serviceAppsDeleteConfirmDescription`)} ${e.title}`,confirmLabel:f(`delete`),variant:`destructive`,onConfirm:()=>c(e.id),onCancel:()=>void 0})]})})}function uK({status:e}){let t=dK(e),n=t.icon;return(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsxs)(`span`,{className:m(`inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5 text-[11px] font-medium`,t.className),"aria-label":t.label,children:[(0,F.jsx)(n,{className:m(`h-3 w-3`,t.iconClassName)}),(0,F.jsx)(`span`,{children:t.label})]})}),(0,F.jsx)(yt,{side:`bottom`,className:`text-xs`,children:t.tooltip})]})}function dK(e){switch(e){case`running`:return{className:`bg-emerald-50 text-emerald-700`,icon:to,label:f(`serviceAppsStatus_running`),tooltip:f(`serviceAppsStatusHint_running`)};case`starting`:return{className:`bg-blue-50 text-blue-700`,icon:_n,iconClassName:`animate-spin`,label:f(`serviceAppsStatus_starting`),tooltip:f(`serviceAppsStatusHint_starting`)};case`failed`:return{className:`bg-rose-50 text-rose-700`,icon:cs,label:f(`serviceAppsStatus_failed`),tooltip:f(`serviceAppsStatusHint_failed`)};case`stopped`:return{className:`bg-muted text-muted-foreground`,icon:io,label:f(`serviceAppsStatus_stopped`),tooltip:f(`serviceAppsStatusHint_stopped`)};default:return{className:`bg-muted text-muted-foreground`,icon:no,label:f(`serviceAppsStatus_idle`),tooltip:f(`serviceAppsStatusHint_idle`)}}}function fK({disabled:e=!1,icon:t,label:n,tooltip:r=n,onClick:i}){return(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,onClick:i,disabled:e,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:text-muted-foreground/40 disabled:opacity-60 disabled:hover:bg-transparent`,"aria-label":n,children:(0,F.jsx)(t,{className:`h-3.5 w-3.5`})})}),(0,F.jsx)(yt,{side:`bottom`,className:`max-w-56 text-xs`,children:r})]})}function pK({destructive:e=!1,disabled:t=!1,icon:n,label:r,onClick:i}){return(0,F.jsxs)(`button`,{type:`button`,className:m(`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-accent hover:text-accent-foreground`),disabled:t,onClick:i,children:[(0,F.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,F.jsx)(`span`,{children:r})]})}function mK({app:e}){let[t,n]=(0,P.useState)(!1),r=[e.command,...e.args??[]].filter(e=>!!e?.trim()).join(` `),i=[{label:f(`serviceAppsCommand`),value:r},{label:f(`serviceAppsCwd`),value:e.cwd},{label:f(`serviceAppsManifest`),value:e.manifestPath},{label:f(`serviceAppsLastStarted`),value:e.lastStartedAt},{label:f(`serviceAppsLastReady`),value:e.lastReadyAt},{label:f(`serviceAppsLastFailed`),value:e.lastFailedAt}].filter(e=>e.value);return i.length===0?null:(0,F.jsxs)(`div`,{className:`mx-3 mt-3 overflow-hidden rounded-lg border border-border/50 bg-muted/35`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-muted/50`,"aria-expanded":t,children:[(0,F.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground`,children:f(`serviceAppsDetails`)}),(0,F.jsx)(Et,{className:m(`h-3.5 w-3.5 shrink-0 text-muted-foreground/70 transition-transform`,t&&`rotate-180`)})]}),t?(0,F.jsx)(`dl`,{className:`grid grid-cols-[4.75rem_minmax(0,1fr)] gap-x-2 gap-y-1 border-t border-border/50 px-2.5 py-2 text-[11px]`,children:i.map(e=>(0,F.jsx)(hK,{label:e.label,value:e.value},e.label))}):null]})}function hK({label:e,value:t}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`dt`,{className:`text-muted-foreground/70`,children:e}),(0,F.jsx)(`dd`,{className:`min-w-0 truncate font-mono text-muted-foreground`,title:t,children:t})]})}function gK({action:e,grants:t,onRevoke:n}){return(0,F.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-card px-2.5 py-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,F.jsx)(ps,{className:`h-3.5 w-3.5`})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`truncate text-xs font-medium text-foreground`,children:e.title??e.name}),e.description?(0,F.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:e.description}):null]})]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[e.runtimeState?(0,F.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:f(`serviceAppsRuntimeState_${e.runtimeState}`)}):null,(0,F.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:e.risk})]})]}),t.map(e=>(0,F.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-2 pl-8`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,F.jsx)(ts,{className:`h-3 w-3 shrink-0 text-emerald-500`}),(0,F.jsxs)(`span`,{className:`truncate`,children:[f(`serviceAppsGrantedTo`),` `,e.caller.appId]})]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`rounded-md p-1 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-rose-600`,title:f(`serviceAppsRevokeGrant`),"aria-label":f(`serviceAppsRevokeGrant`),children:(0,F.jsx)(Sn,{className:`h-3 w-3`})})]},`${e.caller.surface}:${e.caller.appId}:${e.actionId}`))]})}function _K({activeTab:e,onActiveTabChange:t,onOpenPanelApp:n}){let r=(0,F.jsx)(fn,{value:e,onValueChange:e=>t(e),children:(0,F.jsxs)(un,{className:`grid h-auto w-[min(340px,100%)] grid-cols-2 rounded-lg bg-gray-100/70 p-0.5`,children:[(0,F.jsxs)(cn,{value:`panel-apps`,className:`gap-1.5 px-2 py-1.5 text-xs`,children:[(0,F.jsx)(Ga,{className:`h-3.5 w-3.5`}),f(`panelAppsTitle`)]}),(0,F.jsxs)(cn,{value:`service-apps`,className:`gap-1.5 px-2 py-1.5 text-xs`,children:[(0,F.jsx)($o,{className:`h-3.5 w-3.5`}),f(`serviceAppsTitle`)]})]})});return(0,F.jsx)(`div`,{className:`h-full min-h-0 bg-white`,children:e===`panel-apps`?(0,F.jsx)(RG,{headerContent:r,onOpenPanelApp:n}):(0,F.jsx)(cK,{headerContent:r})})}function vK({appTitle:e,onOpenApps:t,onRefresh:n}){return(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/70 bg-card px-3.5 py-2 shrink-0`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:t,className:`inline-flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,title:f(`appsTitle`),"aria-label":f(`appsTitle`),children:(0,F.jsx)(ot,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-muted-foreground`,title:e,children:e}),(0,F.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,title:f(`panelAppsRefreshCurrent`),"aria-label":f(`panelAppsRefreshCurrent`),children:(0,F.jsx)(yn,{className:`h-3.5 w-3.5`})})]})}function yK(e){return e.split(`/`).map(e=>e.trim()).filter(e=>e.length>0)}function bK(e){let t=e.trim();try{let e=new URL(t);return{authority:e.hostname,pathSegments:yK(e.pathname),pathname:e.pathname,raw:t,scheme:e.protocol.replace(/:$/,``).toLowerCase(),searchParams:e.searchParams}}catch{return{authority:``,pathSegments:yK(t),pathname:t,raw:t,scheme:``,searchParams:new URLSearchParams}}}var xK=class{constructor(e,t){this.routeDefinitions=e,this.options=t,this.resolve=e=>{let t=bK(e);return this.findDefinition(t).resolve(t)},this.normalize=e=>this.options.getNormalizedUri(this.resolve(e)),this.areEquivalent=(e,t)=>this.findDefinition(bK(e)).areEquivalent?.(e,t)??this.normalize(e)===this.normalize(t),this.findDefinition=e=>{let t=this.routeDefinitions.find(t=>t.match(e));if(!t)throw Error(`Unsupported resource URI: ${e.raw}`);return t}}},SK=`home`,CK=`nextclaw://new-tab`,wK=`apps`,TK=`nextclaw://apps`,EK=`${TK}?tab=service-apps`,DK=`panel-app`,OK=`panel-apps`;function kK(e){return e===`panel-apps`||e===`service-apps`}function AK(e=OK){return e===OK?TK:EK}function jK(e){try{let t=new URL(e).searchParams.get(`tab`);return kK(t)?t:OK}catch{return OK}}function MK(e){return AK(jK(e))}function NK(e){return`nextclaw://panel-app/${encodeURIComponent(e)}`}function PK(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}function FK(e){let t=e.icon?.trim();if(t)return PK(t)?{type:`url`,url:t}:{type:`text`,value:t}}function IK(e){return{dedupeKey:`panel-app:${e.id}`,dockIcon:FK(e),historyPolicy:`managed`,kind:DK,resourceUri:NK(e.id),title:e.title,url:e.contentPath}}function LK(e,t){return e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}/`)}function RK(e){let t=e.pathSegments.join(`/`);return Mn(t?`/${t}`:`/`,`docs`)}function zK(e){let t=e.filter(e=>e.trim().length>0).map(e=>encodeURIComponent(decodeURIComponent(e))).join(`/`);return t?`nextclaw://docs/${t}`:`nextclaw://docs`}function BK(e){let t=Nn(e),n=t.startsWith(`/`)?t:(()=>{try{return new URL(e).pathname}catch{return``}})();return n?zK(n.split(`/`)):`nextclaw://docs`}function VK(e){if(e.scheme===`nextclaw`&&e.authority===`panel-app`)return e.pathSegments[0]??``;let[t,n,r,i]=e.pathSegments;return t===`api`&&n===`panel-apps`&&r!==void 0&&r.length>0&&i===`content`?r:``}function HK(e){return VK(e).length>0}function UK(e){let t=VK(e);return t?`/api/panel-apps/${encodeURIComponent(decodeURIComponent(t))}/content`:`nextclaw://panel-app`}function WK(e){let t=VK(e);return t?`nextclaw://panel-app/${encodeURIComponent(decodeURIComponent(t))}`:`nextclaw://panel-app`}function GK(e,t){let n=bK(e),r=bK(t),i=VK(n),a=VK(r);return i.length>0&&a.length>0?decodeURIComponent(i)===decodeURIComponent(a):e===t}var KK=[{defaultUrl:()=>CK,id:`home`,kind:SK,match:e=>e.raw===CK,resolve:()=>({historyPolicy:`managed`,kind:SK,resourceUri:CK,title:f(`docBrowserHomeTitle`),url:CK}),areEquivalent:(e,t)=>e===t},{defaultUrl:jn,id:`docs-url`,kind:`docs`,match:e=>In(e.raw),resolve:e=>{let t=Mn(e.raw,`docs`);return{historyPolicy:`managed`,kind:`docs`,resourceUri:BK(t),title:f(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>Nn(e)===Nn(t)},{defaultUrl:jn,id:`nextclaw-docs`,kind:`docs`,match:e=>e.scheme===`nextclaw`&&e.authority===`docs`,resolve:e=>{let t=RK(e);return{historyPolicy:`managed`,kind:`docs`,resourceUri:zK(e.pathSegments),title:f(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>Nn(e)===Nn(t)},{defaultUrl:()=>TK,id:`apps`,kind:wK,match:e=>LK(e.raw,TK),resolve:e=>{let t=MK(e.raw);return{dedupeKey:`apps`,historyPolicy:`managed`,kind:wK,resourceUri:t,title:f(t===`nextclaw://apps`?`appsTitle`:`serviceAppsTitle`),url:t}},areEquivalent:(e,t)=>MK(e)===MK(t)},{defaultUrl:()=>`nextclaw://panel-app`,id:`panel-app`,kind:DK,match:e=>e.scheme===`nextclaw`&&e.authority===`panel-app`||HK(e),resolve:e=>{let t=UK(e),n=VK(e);return{dedupeKey:n?`panel-app:${decodeURIComponent(n)}`:void 0,historyPolicy:`managed`,kind:DK,resourceUri:WK(e),title:f(`panelAppsTitle`),url:t}},areEquivalent:GK},{defaultUrl:()=>`about:blank`,id:`content`,kind:`content`,match:()=>!0,resolve:e=>({historyPolicy:`managed`,kind:`content`,resourceUri:e.raw||`about:blank`,title:zn(e.raw,`content`,`Detail`),url:e.raw||`about:blank`}),areEquivalent:(e,t)=>e===t}],qK=KK.map(e=>({areEquivalent:e.areEquivalent,id:e.id,match:e.match,resolve:e.resolve}));function JK(){return[{id:`apps`,label:f(`appsTitle`),target:{type:`right-panel-resource`,uri:TK}},{id:`service-apps`,label:f(`serviceAppsTitle`),target:{type:`right-panel-resource`,uri:EK}},{id:`docs`,label:f(`docBrowserHelp`),target:{options:{newTab:!0},type:`right-panel-resource`,uri:jn()}},{id:`skill-marketplace`,label:f(`marketplaceSkillsPageTitle`),target:{path:`/marketplace/skills`,type:`app-route`}}]}var YK={apps:{accentClassName:`bg-emerald-50 text-emerald-700`,hoverAccentClassName:`group-hover:bg-emerald-100`,icon:(0,F.jsx)(ct,{className:`h-5 w-5`})},"service-apps":{accentClassName:`bg-sky-50 text-sky-700`,hoverAccentClassName:`group-hover:bg-sky-100`,icon:(0,F.jsx)(Do,{className:`h-5 w-5`})},docs:{accentClassName:`bg-amber-50 text-amber-700`,hoverAccentClassName:`group-hover:bg-amber-100`,icon:(0,F.jsx)(Tt,{className:`h-5 w-5`})},"skill-marketplace":{accentClassName:`bg-rose-50 text-rose-700`,hoverAccentClassName:`group-hover:bg-rose-100`,icon:(0,F.jsx)(Za,{className:`h-5 w-5`})}};function XK(e){return YK[e.id]??{accentClassName:`bg-gray-50 text-gray-700`,hoverAccentClassName:`group-hover:bg-gray-100`,icon:(0,F.jsx)(ct,{className:`h-5 w-5`})}}function ZK({open:e}){let t=si(),n=JK(),r=n=>{if(n.type===`app-route`){t(n.path);return}e(n.uri,n.options)};return(0,F.jsx)(`div`,{className:`h-full overflow-auto bg-background px-4 py-5`,children:(0,F.jsx)(`div`,{className:`mx-auto w-full max-w-[520px]`,children:(0,F.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(76px,1fr))] gap-x-2 gap-y-4`,children:n.map(e=>{let t=XK(e);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(e.target),className:`group flex min-h-[68px] flex-col items-center gap-1.5 rounded-md px-1.5 py-1.5 text-center focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,F.jsx)(`span`,{className:m(`flex h-10 w-10 shrink-0 items-center justify-center rounded-md transition-colors`,t.accentClassName,t.hoverAccentClassName),children:t.icon}),(0,F.jsx)(`span`,{className:`line-clamp-2 min-w-0 max-w-full text-xs font-medium leading-snug text-gray-700 transition-colors group-hover:text-gray-900`,children:e.label})]},e.id)})})})})}function QK(e){return e&&In(e)?`docs`:`content`}var $K=class{constructor(){this.resourceUriResolver=new xK(qK,{getNormalizedUri:e=>e.resourceUri??e.url}),this.resolve=e=>this.resourceUriResolver.resolve(e),this.normalize=e=>this.resourceUriResolver.normalize(e),this.areEquivalent=(e,t)=>this.resourceUriResolver.areEquivalent(e,t),this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=this.resolveRouteDefinition(r,n,t),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i.defaultUrl());return i.resolve(bK(a))},this.areUrlsEquivalent=(e,t,n,r)=>n===r?this.resolveRouteDefinition(e,n).areEquivalent?.(e,t)??this.areEquivalent(e,t):!1,this.usesManagedHistory=e=>this.resolveRouteDefinition(e.currentUrl,e.kind).resolve(bK(e.currentUrl)).historyPolicy===`managed`,this.resolveRouteDefinition=(e,t,n)=>{let r=t??(e?void 0:n?.kind),i=r?KK.find(e=>e.kind===r):void 0;if(i)return i;let a=e?bK(e):null,o=a?KK.find(e=>e.match(a)):void 0;if(o)return o;let s=t??n?.kind??QK(e);return KK.find(e=>e.kind===s)??KK[KK.length-1]}}},eq=wK,tq=DK,nq=`panel-apps`;function rq(e){return e===`panel-apps`||e===`service-apps`}function iq(e=nq){return e===nq?TK:EK}function aq(e){try{let t=new URL(e).searchParams.get(`tab`);return rq(t)?t:nq}catch{return nq}}function oq(e){e.open(iq(),{kind:eq,title:f(`appsTitle`),dedupeKey:`apps`})}var sq={[SK]:{getTitle:()=>f(`docBrowserHomeTitle`),renderContent:({open:e})=>(0,F.jsx)(ZK,{open:e})},[eq]:{getTitle:()=>f(`appsTitle`),renderIcon:()=>(0,F.jsx)(ct,{className:`w-4 h-4 text-primary shrink-0`}),renderContent:({currentUrl:e,open:t,openTarget:n})=>(0,F.jsx)(_K,{activeTab:aq(e),onActiveTabChange:e=>t(iq(e),{activate:!1,kind:eq,title:f(`appsTitle`),dedupeKey:`apps`}),onOpenPanelApp:e=>n(IK(e))})},[tq]:{getIframeSandbox:()=>WG,getTitle:e=>e.title||f(`panelAppsTitle`),onIframeMessage:e=>i2().panelAppBridgeManager.handleIframeMessage(e),onIframePointerOver:e=>GG(e.currentTarget),renderIcon:()=>(0,F.jsx)(Ga,{className:`w-4 h-4 text-primary shrink-0`}),renderToolbar:({open:e,refreshIframe:t,tab:n})=>(0,F.jsx)(vK,{appTitle:n.title||f(`panelAppsTitle`),onOpenApps:()=>oq({open:e}),onRefresh:t})}},cq={nextclawDisplayMode:`card`,nextclawPlacement:`inline`};function lq(e){return`/api/panel-apps/${encodeURIComponent(e)}/content`}function uq(e){return`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams(cq).toString()}`}function dq(e){let{appId:t,title:n,url:r}=e;return{currentUrl:r,dedupeKey:`panel-app:${t}`,history:[r],historyIndex:0,id:`inline-panel-app:${t}`,kind:DK,navVersion:0,resourceUri:NK(t),title:n}}function fq({panelApp:e,showExpandAction:t=!0}){let n=Ln(),r=(0,P.useRef)(null),i=(0,P.useId)(),a=TG(),o=(0,P.useMemo)(()=>UG(a.data?.entries??[],e.appId),[e.appId,a.data?.entries]),s=o?IK(o):null,c=e.title??s?.title??e.appId,l=a.isLoading?``:s?.url??lq(e.appId),u=(0,P.useMemo)(()=>l?uq(l):``,[l]),d=(0,P.useMemo)(()=>dq({appId:o?.id??e.appId,title:c,url:l}),[o?.id,e.appId,c,l]),p=`${d.id}:${d.navVersion}:${i}`,m=()=>{if(s){n.openTarget(s);return}n.open(l,{dedupeKey:d.dedupeKey,kind:d.kind,title:c})};return(0,P.useEffect)(()=>{if(!l)return;let e=e=>{i2().panelAppBridgeManager.handleIframeMessage({event:e,iframe:r.current,iframeInstanceId:p,tab:d})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[p,d,l]),l?(0,F.jsxs)(`div`,{className:`w-full max-w-[48rem] overflow-hidden rounded-lg border border-border bg-card shadow-sm`,"data-chat-message-wide-content":`true`,children:[(0,F.jsxs)(`div`,{className:`flex h-9 items-center justify-between gap-2 border-b border-border bg-muted/45 px-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium text-foreground`,children:[(0,F.jsx)(Ga,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,F.jsx)(`span`,{className:`truncate`,children:c})]}),t?(0,F.jsx)(ht,{size:`md`,icon:(0,F.jsx)(Io,{className:`h-3.5 w-3.5`}),label:f(`chatPanelCardExpand`),onClick:m}):null]}),(0,F.jsx)(`div`,{className:`relative h-[420px] min-h-[220px] max-h-[min(60vh,420px)] overflow-hidden bg-card`,children:(0,F.jsx)(`iframe`,{ref:r,src:u,title:c,sandbox:WG,tabIndex:0,onPointerOver:()=>GG(r.current),className:`h-full w-full border-0 bg-card`},p)})]}):(0,F.jsx)(`div`,{className:`h-[320px] min-h-[220px] w-full max-w-[48rem] animate-pulse rounded-lg border border-border bg-muted/45`,"data-chat-message-wide-content":`true`})}var pq=`nextclaw.chat.message-layout`,mq=1,hq=`flat`;function gq(e){if(!e||typeof e!=`object`)return hq;let{layout:t}=e;return t===`flat`||t===`card`?t:hq}var _q=p()(Dn(e=>({layout:hq,setLayout:t=>e({layout:t})}),{name:pq,version:mq,storage:On(()=>window.localStorage),partialize:e=>({layout:e.layout}),merge:(e,t)=>({...t,layout:gq(e)})})),vq=`inherited_from_session_id`,yq=new WeakMap;function bq(e){if(e.target.type===`panel_app`)return(0,F.jsx)(fq,{panelApp:{appId:e.target.payload.appId,title:e.title}})}var xq=e=>(0,F.jsx)(Fu,{agentId:e,className:`h-4 w-4 shrink-0`}),Sq=e=>(0,F.jsx)(fq,{panelApp:e});function Cq({checkpoint:e}){return(0,F.jsxs)(`div`,{className:`my-4 flex items-center gap-3 text-[11px] text-muted-foreground`,title:[`${f(`chatContextCompactionCoveredMessages`)}: ${e.coveredSessionMessageCount}`,`${f(`chatContextCompactionOriginalTokens`)}: ${e.originalEstimatedTokens}`,`${f(`chatContextCompactionProjectedTokens`)}: ${e.projectedEstimatedTokens}`].join(`
103
+ `),children:[(0,F.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-border bg-muted px-3 py-1`,children:[e.status===`compressing`?(0,F.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-muted-foreground`}):(0,F.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground/45`}),(0,F.jsx)(`span`,{children:e.status===`compressing`?f(`chatContextCompactionCompressing`):f(`chatContextCompactionCompressed`)})]}),(0,F.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function wq({inheritance:e}){return(0,F.jsxs)(`div`,{className:`my-4 flex items-center gap-3 text-[11px] text-emerald-700`,title:[`${f(`chatContextInheritanceSourceSession`)}: ${e.sourceSessionId}`,`${f(`chatContextInheritanceMessages`)}: ${e.inheritedMessageCount}`].join(`
104
+ `),children:[(0,F.jsx)(`div`,{className:`h-px flex-1 bg-emerald-100`}),(0,F.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-emerald-50 px-3 py-1`,children:[(0,F.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-400`}),(0,F.jsx)(`span`,{children:f(`chatContextInheritanceInherited`)})]}),(0,F.jsx)(`div`,{className:`h-px flex-1 bg-emerald-100`})]})}function Tq(e){let{rawMessageId:t,rawMessages:n,visibleRawMessages:r}=e,i=n.findIndex(e=>e.id===t);return i<0?r.length-1:n.slice(0,i).filter(Dq).length-1}function Eq(e){let t=e.metadata?.[vq];return typeof t==`string`&&t.trim()?t.trim():null}function Dq(e){return!NW(e)&&!Eq(e)}function Oq(e){let t=e.findIndex(e=>Eq(e));if(t<0)return null;let n=Eq(e[t]);return n?{boundaryIndex:e.slice(0,t).filter(Dq).length,sourceSessionId:n,inheritedMessageCount:e.filter(e=>Eq(e)===n).length}:null}function kq(e){let t=e.rawMessages.filter(Dq),n=e.rawMessages.map(e=>({rawMessageId:e.id,checkpoint:NW(e)})).filter(e=>!!e.checkpoint).map(n=>({key:n.rawMessageId,checkpoint:n.checkpoint,boundaryIndex:Tq({rawMessages:e.rawMessages,visibleRawMessages:t,rawMessageId:n.rawMessageId})})).sort((e,t)=>e.boundaryIndex-t.boundaryIndex),r=Oq(e.rawMessages),i=[],a=[],o=0,s=e=>{a.length!==0&&(i.push({kind:`messages`,key:e,messages:a}),a=[])};for(t.forEach((t,c)=>{r?.boundaryIndex===c&&(s(`messages-before-context-inheritance`),i.push({kind:`context-inheritance`,key:`context-inheritance`,inheritance:r}));let l=e.messages[c];for(l&&a.push(l);o<n.length&&n[o]?.boundaryIndex<=c;){let e=n[o];s(`messages-before-${e.key}`),i.push({kind:`compaction`,key:e.key,checkpoint:e.checkpoint}),o+=1}}),r?.boundaryIndex===t.length&&(s(`messages-before-context-inheritance`),i.push({kind:`context-inheritance`,key:`context-inheritance`,inheritance:r}));o<n.length;){let e=n[o];s(`messages-before-${e.key}`),i.push({kind:`compaction`,key:e.key,checkpoint:e.checkpoint}),o+=1}return s(`messages-final`),i.length===0&&i.push({kind:`messages`,key:`messages-empty`,messages:[]}),i}function Aq({messages:e,isSending:t,className:n}){let r=ic(),{language:i}=Qt(),a=_q(e=>e.layout),o=I(e=>e.snapshot.selectedSessionKey),s=Jl(o),c=s?.workingDir??s?.projectRoot??null,u=(0,P.useCallback)(e=>{let t=bq(e);if(t)return t;if(e.target.type===`file`)return(0,F.jsx)(vG,{display:e,parentSessionKey:o,sessionProjectRoot:s?.projectRoot??null,sessionWorkingDir:c,onFileOpen:r.chatThreadManager.openFilePreview})},[c,r.chatThreadManager,s?.projectRoot,o]),d=(0,P.useCallback)(e=>Fe(e.path,c),[c]),p=(0,P.useMemo)(()=>EW(i),[i]),m=(0,P.useMemo)(()=>{let t=e.filter(Dq),n=f(`chatProcessSummaryProcessed`);return t.flatMap(e=>{let t=TW({message:e,processedLabel:n}),r=t?.label??null,a=yq.get(e);if(a&&a.language===i&&a.processSummaryLabel===r)return[a.viewModel];let o=Kc(e),s=bW({id:o.id,role:o.role,meta:{timestamp:o.meta?.timestamp,status:o.meta?.status,inlineTokens:CH(e.metadata),processSummary:t},parts:o.parts},{formatTimestamp:e=>l(e,i),texts:p});return yq.set(e,{language:i,processSummaryLabel:r,viewModel:s}),[s]})},[i,e,p]),h=(0,P.useMemo)(()=>m.some(e=>e.role===`assistant`&&(e.status===`streaming`||e.status===`pending`)),[m]),g=(0,P.useMemo)(()=>OW(i),[i]),_=(0,P.useMemo)(()=>kq({rawMessages:e,messages:m}),[m,e]),v=Rl(e=>e.snapshot.sessionSkillsQuery),y=(0,P.useCallback)(e=>{if(e.kind!==`skill`)return;let t=e.key.trim();if(!t)return;let n=(v?.data?.records??[]).find(e=>e.ref===t||e.name===t),i=n?.path?.trim();i&&r.chatThreadManager.openFilePreview({path:i,label:e.label||n?.name||t,viewMode:`preview`,previewViewer:`rendered`})},[r.chatThreadManager,v]),b=(0,P.useCallback)(e=>{let t=e.dataUrl?.trim();if(!t)return;let n=e.label.trim()||`attachment`;r.chatThreadManager.openFilePreview({path:n,label:n,viewMode:`preview`,contentUrl:t,mimeType:e.mimeType})},[r.chatThreadManager]);return(0,F.jsx)(`div`,{className:n,children:_.map((e,n)=>e.kind===`compaction`?(0,F.jsx)(Cq,{checkpoint:e.checkpoint},e.key):e.kind===`context-inheritance`?(0,F.jsx)(wq,{inheritance:e.inheritance},e.key):(0,F.jsx)(nH,{layout:a,messages:e.messages,isSending:n===_.length-1?t:!1,hasAssistantDraft:h,texts:g,onToolAction:r.chatThreadManager.handleToolAction,onFileOpen:r.chatThreadManager.openFilePreview,onAttachmentOpen:b,onInlineTokenClick:y,resolveFileContentUrl:d,renderInlineDisplay:u,renderToolAgent:xq,renderPanelAppCard:Sq},e.key))})}function jq({children:e,className:t,width:n=`messages`}){let r=_q(e=>e.layout);return(0,F.jsx)(`div`,{"data-chat-conversation-track":r,"data-chat-conversation-track-width":n,className:m(`mx-auto w-full px-4 sm:px-6`,r===`flat`?n===`composer`?`max-w-[min(54rem,100%)]`:`max-w-[min(52rem,100%)]`:`max-w-[min(1120px,100%)]`,t),children:e})}function Mq({bottomSlot:e,isAwaitingAssistantOutput:t,isHistoryLoading:n,isSending:r,messages:i,sessionKey:a,showWelcome:o,welcomeSlot:s}){let c=(0,P.useRef)(null),l=n&&i.length===0&&!r&&!t,{isAtBottom:u,onScroll:d,scrollToBottom:p}=Uz({scrollRef:c,resetKey:a,isLoading:n,hasContent:i.length>0,contentVersion:i[i.length-1]??null}),m=i.length>0,h=m&&!o&&!u;return(0,F.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,F.jsx)(`div`,{ref:c,onScroll:d,"data-chat-scroll-container":`true`,className:`h-full overflow-y-auto custom-scrollbar`,children:o?s??null:(0,F.jsxs)(F.Fragment,{children:[l||!m?null:(0,F.jsx)(jq,{className:`py-4 sm:py-5`,children:(0,F.jsx)(Aq,{messages:i,isSending:m&&r&&t})}),e?(0,F.jsx)(jq,{className:`pb-4 sm:pb-5`,children:e}):null]})}),h?(0,F.jsx)(ht,{icon:(0,F.jsx)(Ka,{className:`h-4 w-4`}),label:f(`chatScrollToBottom`),onClick:p,tooltipSide:`top`,className:`absolute bottom-4 left-1/2 z-10 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background/90 text-foreground shadow-lg backdrop-blur hover:bg-accent hover:text-accent-foreground`}):null]})}var Nq=function(e){return e.EndpointReady=`endpoint.ready`,e.EndpointError=`endpoint.error`,e.MessageRequest=`message.request`,e.MessageStreamRequest=`message.stream-request`,e.MessageSent=`message.sent`,e.MessageAccepted=`message.accepted`,e.MessageIncoming=`message.incoming`,e.MessageCompleted=`message.completed`,e.MessageFailed=`message.failed`,e.MessageAbort=`message.abort`,e.MessageTextStart=`message.text-start`,e.MessageTextDelta=`message.text-delta`,e.MessageTextEnd=`message.text-end`,e.MessageReasoningStart=`message.reasoning-start`,e.MessageReasoningDelta=`message.reasoning-delta`,e.MessageReasoningEnd=`message.reasoning-end`,e.MessageToolCallStart=`message.tool-call-start`,e.MessageToolCallArgs=`message.tool-call-args`,e.MessageToolCallArgsDelta=`message.tool-call-args-delta`,e.MessageToolCallEnd=`message.tool-call-end`,e.MessageToolCallResult=`message.tool-call-result`,e.MessageRead=`message.read`,e.MessageDelivered=`message.delivered`,e.MessageRecalled=`message.recalled`,e.MessageReaction=`message.reaction`,e.RunStarted=`run.started`,e.RunFinished=`run.finished`,e.RunError=`run.error`,e.RunMetadata=`run.metadata`,e.ContextWindowUpdated=`context-window.updated`,e.TypingStart=`typing.start`,e.TypingEnd=`typing.end`,e.PresenceUpdated=`presence.updated`,e}({});function Pq(e,t=e.occurredAt??new Date().toISOString()){return{...e,occurredAt:t}}var Fq=/\[\[\s*reply_to_current\s*\]\]/gi,Iq=/\[\[\s*reply_to\s*:\s*([^\]]+?)\s*\]\]/i;function Lq(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function Rq(e,t){let n=e,r;Fq.test(n)&&(r=Lq(t),n=n.replace(Fq,``).trim());let i=n.match(Iq)?.[1];return i&&(r=Lq(i),n=n.replace(Iq,``).trim()),r?{content:n,replyTo:r}:{content:n}}function zq(e,t=e.id){if(e.role!==`assistant`)return{...e,parts:[...e.parts],metadata:e.metadata?{...e.metadata}:void 0};let n=e.parts.findIndex(e=>e.type===`text`),r=e.metadata?{...e.metadata}:void 0,i=Lq(r?.reply_to);if(n<0)return{...e,parts:[...e.parts],metadata:r};let a=e.parts[n];if(!a||a.type!==`text`)return{...e,parts:[...e.parts],metadata:r};let{content:o,replyTo:s}=Rq(a.text,t),c=s??i,l=e.parts.flatMap((e,t)=>t!==n||e.type!==`text`?[e]:o.length===0?[]:[{...e,text:o}]);return c?{...e,parts:l,metadata:{...r,reply_to:c}}:{...e,parts:l,metadata:r}}function Bq(e){let t=e.split(/\r?\n/),n=`message`,r=[];for(let e of t){let t=e.trimEnd();if(!(!t||t.startsWith(`:`))){if(t.startsWith(`event:`)){n=t.slice(6).trim()||`message`;continue}t.startsWith(`data:`)&&r.push(t.slice(5).trimStart())}}return r.length===0?null:{event:n,data:r.join(`
105
+ `)}}async function*Vq(e){let t=e.getReader(),n=new TextDecoder,r=``;try{for(;;){let{value:e,done:i}=await t.read();if(i)break;r+=n.decode(e,{stream:!0});let{frames:a,rest:o}=Hq(r);r=o;for(let e of a)yield e}r+=n.decode();let{frames:e}=Hq(r,!0);for(let t of e)yield t}finally{t.releaseLock()}}function Hq(e,t=!1){let n=e.split(/\r?\n\r?\n/),r=n.pop()??``,i=[];for(let e of n){let t=Bq(e);t&&i.push(t)}if(t&&r.trim()){let e=Bq(r);return e&&i.push(e),{frames:i,rest:``}}return{frames:i,rest:r}}var Uq=`/ncp/agent`,Wq=class extends Error{ncpError;alreadyPublished;constructor(e,t=!1){super(e.message),this.name=`NcpHttpAgentClientError(${e.code})`,this.ncpError=e,this.alreadyPublished=t}};function Gq(e){let t=e.trim();if(!t)throw Error(`NcpHttpAgentClient requires a non-empty baseUrl.`);return new URL(t)}function Kq(e){if(e)return e;if(typeof globalThis.fetch==`function`)return globalThis.fetch.bind(globalThis);throw Error(`No fetch implementation found. Pass options.fetchImpl explicitly.`)}function qq(e){let t=(e??`/ncp/agent`).trim();if(!t)return Uq;let n=t.startsWith(`/`)?t:`/${t}`;return n.endsWith(`/`)?n.slice(0,-1):n}async function Jq(e){try{return(await e.text()).trim()}catch{return``}}function Yq(e){if($q(e))return e.ncpError;if(Zq(e))return e;let t=e instanceof Error?e.message:String(e??`Unknown error`);return{code:tJ(void 0),message:t,...e instanceof Error&&e.stack?{details:{stack:e.stack}}:{}}}function Xq(e,t={}){return new Wq(e,t.alreadyPublished??!1)}function Zq(e){return Qq(e)&&typeof e.code==`string`&&typeof e.message==`string`}function Qq(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function $q(e){return e instanceof Wq}var eJ={"config-error":`config-error`,"auth-error":`auth-error`,"runtime-error":`runtime-error`,"timeout-error":`timeout-error`,"abort-error":`abort-error`};function tJ(e){if(!e)return`runtime-error`;let t=eJ[e];if(t)return t;let n=e.toLowerCase();return n.includes(`timeout`)?`timeout-error`:n.includes(`abort`)||n.includes(`cancel`)?`abort-error`:n.includes(`auth`)?`auth-error`:n.includes(`config`)?`config-error`:`runtime-error`}function nJ(e){let t=iJ(e);return!t||typeof t.type!=`string`||!t.type.trim()?null:t}function rJ(e){let t=iJ(e);if(!t)return{code:`runtime-error`,message:e||`Unknown stream error.`};let n=typeof t.code==`string`?t.code:void 0,r=tJ(n),i=Qq(t.details)?t.details:{};return n&&n!==r&&(i.originalCode=n),{code:r,message:typeof t.message==`string`&&t.message?t.message:`Unknown stream error.`,...Object.keys(i).length>0?{details:i}:{}}}function iJ(e){try{let t=JSON.parse(e);return Qq(t)?t:null}catch{return null}}var aJ=[`text`,`file`,`source`,`step-start`,`reasoning`,`tool-invocation`,`card`,`rich-text`,`action`,`extension`],oJ=class{manifest;baseUrl;basePath;fetchImpl;defaultHeaders;subscribers=new Set;activeControllers=new Set;started=!1;constructor(e){this.baseUrl=Gq(e.baseUrl),this.basePath=qq(e.basePath),this.fetchImpl=Kq(e.fetchImpl),this.defaultHeaders=e.headers??{},this.manifest={endpointKind:`custom`,endpointId:e.endpointId?.trim()||`ncp-http-agent-client`,version:`0.1.0`,supportsStreaming:!0,supportsAbort:!0,supportsProactiveMessages:!1,supportsLiveSessionStream:!0,supportedPartTypes:aJ,expectedLatency:`seconds`,metadata:{transport:`http+sse`,scope:`agent`}}}async start(){this.started||(this.started=!0,this.publish(Pq({type:Nq.EndpointReady})))}async stop(){if(this.started){this.started=!1;for(let e of this.activeControllers)e.abort();this.activeControllers.clear()}}async emit(e){switch(e.type){case`message.request`:await this.send(e.payload);return;case`message.stream-request`:await this.stream(e.payload);return;case`message.abort`:await this.abort(e.payload);return;default:this.publish(e);return}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}async send(e){await this.ensureStarted();let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(`/send`),{method:`POST`,headers:{...this.defaultHeaders,accept:`application/json`,"content-type":`application/json`},body:JSON.stringify(e),signal:t.signal});if(!n.ok)throw Error(`NCP send command failed with HTTP ${n.status}: ${await Jq(n)}`);let r=await n.json();if(!r.ok||!r.data)throw Error(r.error?.message??`NCP send command returned an invalid handle.`);return r.data}catch(e){if(t.signal.aborted)throw Error(`NCP send command was cancelled.`);if($q(e))throw e;let n=Yq(e);throw this.publish(Pq({type:Nq.EndpointError,payload:n})),Xq(n)}finally{this.activeControllers.delete(t)}}async stream(e){await this.ensureStarted();let t=new URLSearchParams({sessionId:e.sessionId});await this.streamRequest({path:`/stream?${t.toString()}`,method:`GET`})}async abort(e){await this.ensureStarted();let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(`/abort`),{method:`POST`,headers:{...this.defaultHeaders,"content-type":`application/json`,accept:`application/json`},body:JSON.stringify(e),signal:t.signal});if(!n.ok)throw Error(`Abort request failed with HTTP ${n.status}: ${await Jq(n)}`)}catch(e){if(t.signal.aborted)return;let n=Yq(e);throw this.publish(Pq({type:Nq.EndpointError,payload:n})),Xq(n)}finally{this.activeControllers.delete(t)}}async ensureStarted(){this.started||await this.start()}publish(e){for(let t of this.subscribers)t(e)}resolveUrl(e){return new URL(`${this.basePath}${e}`,this.baseUrl)}async streamRequest(e){let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(e.path),{method:e.method,headers:{...this.defaultHeaders,accept:`text/event-stream`,...e.body===void 0?{}:{"content-type":`application/json`}},body:e.body===void 0?void 0:JSON.stringify(e.body),signal:t.signal});if(!n.ok)throw Error(`NCP stream request failed with HTTP ${n.status}: ${await Jq(n)}`);if(!n.body)throw Error(`NCP stream response has no body.`);for await(let e of Vq(n.body)){if(t.signal.aborted)return;this.handleSseFrame(e)}}catch(e){if(t.signal.aborted)return;if($q(e))throw e;let n=Yq(e);throw this.publish(Pq({type:Nq.EndpointError,payload:n})),Xq(n)}finally{this.activeControllers.delete(t)}}handleSseFrame(e){if(e.event===`ncp-event`){let t=nJ(e.data);if(!t){this.publish(Pq({type:Nq.EndpointError,payload:{code:`runtime-error`,message:`Received malformed ncp-event frame.`}}));return}this.publish(t);return}if(e.event===`error`){let t=rJ(e.data);throw this.publish(Pq({type:Nq.EndpointError,payload:t})),Xq(t,{alreadyPublished:!0})}}};function sJ(e){return{...e,parts:[...e.parts],lifecycle:e.lifecycle?{...e.lifecycle}:void 0,metadata:e.metadata?{...e.metadata}:void 0}}function cJ(e){return sJ(zq(e))}var lJ=`__nextclaw_aborted_tool_call__`;function uJ(e){let t=e.error?.trim();return{code:`runtime-error`,message:t&&t.length>0?t:`Agent run failed.`,details:{sessionId:e.sessionId,messageId:e.messageId,threadId:e.threadId,runId:e.runId}}}function dJ(e){if(!(!e.startedAt&&!e.endedAt))return{startedAt:e.startedAt,endedAt:e.endedAt}}function fJ(e,t,n){return n?{...e,status:t,lifecycle:n}:{...e,status:t}}function pJ(e,t){let n=Date.parse(t.timestamp);if(!Number.isFinite(n))return e.length;let r=e.findIndex(e=>{let t=Date.parse(e.timestamp);return Number.isFinite(t)&&t>n});return r<0?e.length:r}function mJ(e,t){let n=[...e];return n.splice(pJ(e,t),0,t),n}function hJ(e,t){return t.trim()?e.id.startsWith(`tool-`)?!0:e.parts.some(e=>e.type===`tool-invocation`):!1}function gJ(e,t,n){for(let[r,i]of e)i===t&&e.set(r,n)}function _J(e,t,n){for(let[r,i]of e)i===n&&(e.delete(r),t.delete(r))}function vJ(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(r.type===`tool-invocation`&&r.toolCallId===t)return r}return null}function yJ(e,t){return vJ(e,t)?.toolName??null}function bJ(e,t){let n=[...e];for(let e=n.length-1;e>=0;--e){let r=n[e];if(r.type===`tool-invocation`&&r.toolCallId===t.toolCallId)return n[e]={...r,...t},n}return n.push(t),n}function xJ(e){let t=[];return{parts:e.map(e=>e.type!==`tool-invocation`||!e.toolCallId||e.state===`result`||e.state===`cancelled`?e:(t.push(e.toolCallId),{...e,state:`cancelled`})),toolCallIds:t}}var SJ=class{messageIdByCallId=new Map;argsRawByCallId=new Map;constructor(e){this.port=e}isEmpty=()=>this.messageIdByCallId.size===0&&this.argsRawByCallId.size===0;clear=()=>{this.messageIdByCallId.clear(),this.argsRawByCallId.clear()};hydrate=e=>{this.clear(),e.forEach(e=>{e.parts.forEach(t=>{if(t.type!==`tool-invocation`||!t.toolCallId||t.state===`result`||t.state===`cancelled`)return;let n=typeof t.args==`string`?t.args:JSON.stringify(t.args??{});this.messageIdByCallId.set(t.toolCallId,e.id),this.argsRawByCallId.set(t.toolCallId,n)})})};clearByMessageId=e=>{_J(this.messageIdByCallId,this.argsRawByCallId,e)};markAborted=e=>{e.forEach(e=>this.argsRawByCallId.set(e,lJ))};remapMessageId=(e,t)=>{gJ(this.messageIdByCallId,e,t)};handleToolCallStart=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId,e.messageId);this.argsRawByCallId.set(e.toolCallId,``),this.port.replaceStreamingMessage({...t,parts:bJ(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:e.toolName,state:`partial-call`,args:``}),status:`streaming`})};handleToolCallArgs=e=>{this.argsRawByCallId.get(e.toolCallId)!==`__nextclaw_aborted_tool_call__`&&(this.argsRawByCallId.set(e.toolCallId,e.args),this.applyToolCallArgs(e.sessionId,e.toolCallId,e.args))};handleToolCallArgsDelta=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=`${this.argsRawByCallId.get(e.toolCallId)??``}${e.delta}`;this.argsRawByCallId.set(e.toolCallId,t),this.applyToolCallArgs(e.sessionId,e.toolCallId,t,e.messageId)};handleToolCallEnd=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId),n=this.argsRawByCallId.get(e.toolCallId)??``;this.port.replaceStreamingMessage({...t,parts:bJ(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:yJ(t.parts,e.toolCallId)??`unknown`,state:`call`,args:n}),status:`streaming`})};handleToolCallResult=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`||this.port.updateMessageContainingToolCall(e.toolCallId,(t,n)=>bJ(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:n.toolName,state:`result`,args:n.args,result:e.content,resultContentItems:e.contentItems})))return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId);this.port.replaceStreamingMessage({...t,parts:bJ(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:`unknown`,state:`result`,result:e.content,resultContentItems:e.contentItems}),status:`streaming`})};applyToolCallArgs=(e,t,n,r)=>{let i=this.resolveToolCallTargetMessage(e,t,r),a=yJ(i.parts,t)??`unknown`;this.port.replaceStreamingMessage({...i,parts:bJ(i.parts,{type:`tool-invocation`,toolCallId:t,toolName:a,state:`partial-call`,args:n}),status:`streaming`})};resolveToolCallTargetMessage=(e,t,n)=>{let r=n?.trim()||this.messageIdByCallId.get(t)||this.port.readStreamingMessageId()||`tool-${t}`;return this.messageIdByCallId.set(t,r),this.port.ensureStreamingMessage(e,r,`streaming`)}},CJ=`assistant`,wJ=class{messages=[];streamingMessage=null;error=null;activeRun=null;contextWindow=null;listeners=new Set;toolCalls;lastSettledRunId=null;snapshotCache=null;snapshotVersion=-1;stateVersion=0;constructor(){this.toolCalls=new SJ({ensureStreamingMessage:this.ensureStreamingMessage,readStreamingMessageId:()=>this.streamingMessage?.id??null,replaceStreamingMessage:this.replaceStreamingMessage,updateMessageContainingToolCall:this.updateMessageContainingToolCall})}getSnapshot=()=>{if(this.snapshotCache&&this.snapshotVersion===this.stateVersion)return this.snapshotCache;let e={messages:this.messages,streamingMessage:this.streamingMessage,error:this.error?{...this.error,details:this.error.details?{...this.error.details}:void 0}:null,activeRun:this.activeRun?{...this.activeRun}:null,contextWindow:this.contextWindow?{...this.contextWindow}:null};return this.snapshotCache=e,this.snapshotVersion=this.stateVersion,e};subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));reset=()=>{this.messages.length===0&&!this.streamingMessage&&!this.error&&!this.activeRun&&!this.contextWindow&&this.toolCalls.isEmpty()||(this.messages=[],this.streamingMessage=null,this.error=null,this.activeRun=null,this.contextWindow=null,this.toolCalls.clear(),this.lastSettledRunId=null,this.stateVersion+=1,this.notifyListeners())};hydrate=e=>{this.messages=e.messages.map(e=>cJ(e)),this.streamingMessage=null,this.error=null,this.contextWindow=e.contextWindow?{...e.contextWindow}:null,this.activeRun=e.activeRun?{...e.activeRun,sessionId:e.activeRun.sessionId??e.sessionId,abortDisabledReason:e.activeRun.abortDisabledReason??null}:null,this.toolCalls.hydrate(this.messages),this.lastSettledRunId=null,this.stateVersion+=1,this.notifyListeners()};dispatch=e=>this.dispatchBatch([e]);dispatchBatch=async e=>{if(!e.length)return;let t=this.stateVersion;e.forEach(this.applyEvent),this.stateVersion!==t&&this.notifyListeners()};applyEvent=e=>{switch(e.type){case Nq.MessageSent:this.handleMessageSent(e.payload);break;case Nq.MessageAbort:this.handleMessageAbort(e.payload);break;case Nq.MessageTextStart:this.handleMessageTextStart(e.payload);break;case Nq.MessageTextDelta:this.handleMessageTextDelta(e.payload);break;case Nq.MessageTextEnd:this.handleMessageTextEnd(e.payload);break;case Nq.MessageReasoningStart:this.handleMessageReasoningStart(e.payload);break;case Nq.MessageReasoningDelta:this.handleMessageReasoningDelta(e.payload);break;case Nq.MessageReasoningEnd:this.handleMessageReasoningEnd(e.payload);break;case Nq.MessageToolCallStart:this.handleMessageToolCallStart(e.payload);break;case Nq.MessageToolCallArgs:this.handleMessageToolCallArgs(e.payload);break;case Nq.MessageToolCallArgsDelta:this.handleMessageToolCallArgsDelta(e.payload);break;case Nq.MessageToolCallEnd:this.handleMessageToolCallEnd(e.payload);break;case Nq.MessageToolCallResult:this.handleMessageToolCallResult(e.payload);break;case Nq.RunStarted:this.handleRunStarted(e.payload);break;case Nq.RunFinished:this.handleRunFinished(e.payload);break;case Nq.RunError:this.handleRunError(e.payload);break;case Nq.RunMetadata:this.handleRunMetadata(e.payload);break;case Nq.ContextWindowUpdated:this.handleContextWindowUpdated(e.payload);break;case Nq.EndpointError:this.handleEndpointError(e.payload);break;default:break}};handleMessageSent=e=>{this.upsertMessage(e.message),this.setError(null)};handleMessageAbort=e=>{let t=e.messageId?.trim();if(this.clearActiveRun(),this.setError(null),this.streamingMessage&&(!t||this.streamingMessage.id===t)){let e=this.streamingMessage.id,{parts:n,toolCallIds:r}=xJ(this.streamingMessage.parts);this.upsertMessage({...this.streamingMessage,status:`final`,parts:n}),this.replaceStreamingMessage(null),t?this.toolCalls.clearByMessageId(t):this.toolCalls.clearByMessageId(e),this.toolCalls.markAborted(r)}};handleMessageTextStart=e=>{let t=this.streamingMessage?.id===e.messageId,n=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),r=n.parts[n.parts.length-1];t&&r?.type===`text`&&r.text.length>0&&this.replaceStreamingMessage({...n,parts:[...n.parts,{type:`text`,text:``}],status:`streaming`}),this.setError(null)};handleMessageTextDelta=e=>{if(!e.delta)return;let t=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),n=[...t.parts],r=n[n.length-1];r?.type===`text`?n[n.length-1]={type:`text`,text:`${r.text}${e.delta}`}:n.push({type:`text`,text:e.delta}),this.replaceStreamingMessage({...t,parts:n,status:`streaming`})};handleMessageTextEnd=e=>{this.streamingMessage?.id===e.messageId&&this.streamingMessage.status===`streaming`&&this.replaceStreamingMessage({...this.streamingMessage,status:`pending`})};handleMessageReasoningStart=e=>{this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`)};handleMessageReasoningDelta=e=>{if(!e.delta)return;let t=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),n=[...t.parts],r=n[n.length-1];r?.type===`reasoning`?n[n.length-1]={type:`reasoning`,text:`${r.text}${e.delta}`}:n.push({type:`reasoning`,text:e.delta}),this.replaceStreamingMessage({...t,parts:n,status:`streaming`})};handleMessageReasoningEnd=e=>{this.streamingMessage?.id,e.messageId};handleMessageToolCallStart=e=>{this.toolCalls.handleToolCallStart(e),this.setError(null)};handleMessageToolCallArgs=e=>{this.toolCalls.handleToolCallArgs(e)};handleMessageToolCallArgsDelta=e=>{this.toolCalls.handleToolCallArgsDelta(e)};handleMessageToolCallEnd=e=>{this.toolCalls.handleToolCallEnd(e)};handleMessageToolCallResult=e=>{this.toolCalls.handleToolCallResult(e)};handleRunStarted=e=>{this.isSettledRunId(e.runId)||(this.setError(null),this.activeRun={runId:e.runId??null,sessionId:e.sessionId},this.stateVersion+=1)};handleRunFinished=e=>{this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.settleStreamingMessage(`final`,dJ(e)),this.setError(null),this.clearActiveRun()};handleRunError=e=>{this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.settleStreamingMessage(`error`,dJ(e)),this.setError(uJ(e)),this.clearActiveRun()};handleRunMetadata=e=>{let t=e.metadata;if(t?.kind===`ready`){let e=t;if(this.isSettledRunId(e.runId))return;this.activeRun={runId:e.runId??this.activeRun?.runId??null,sessionId:e.sessionId??this.activeRun?.sessionId,abortDisabledReason:e.supportsAbort===!1?e.abortDisabledReason??`Unsupported`:null},this.stateVersion+=1}else t?.kind===`final`&&(this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.clearActiveRun())};handleContextWindowUpdated=e=>{this.contextWindow={...e.contextWindow},this.stateVersion+=1};handleEndpointError=e=>{if(e.code===`abort-error`){this.handleMessageAbort({sessionId:this.activeRun?.sessionId??this.streamingMessage?.sessionId??``,...this.streamingMessage?.id?{messageId:this.streamingMessage.id}:{}});return}this.settleStreamingMessage(`error`),this.clearActiveRun(),this.setError(e)};ensureStreamingMessage=(e,t,n)=>{if(this.streamingMessage?.id===t){if(this.streamingMessage.status===n)return this.streamingMessage;let e={...this.streamingMessage,status:n};return this.replaceStreamingMessage(e),e}let r=this.messages.findIndex(e=>e.id===t);if(r>=0){let t=sJ(this.messages[r]),i=[...this.messages];i.splice(r,1),this.messages=i,this.stateVersion+=1;let a={...t,sessionId:e,status:n};return this.replaceStreamingMessage(a),a}let i=this.streamingMessage;if(i&&i.id!==t&&i.sessionId===e&&hJ(i,t)){let r={...i,id:t,sessionId:e,status:n};return this.toolCalls.remapMessageId(i.id,t),this.replaceStreamingMessage(r),r}let a={id:t,sessionId:e,role:CJ,status:n,parts:[],timestamp:new Date().toISOString()};return this.replaceStreamingMessage(a),a};updateMessageContainingToolCall=(e,t)=>{if(this.streamingMessage){let n=vJ(this.streamingMessage.parts,e);if(n){let e=t(this.streamingMessage,n);return this.replaceStreamingMessage({...this.streamingMessage,parts:e}),!0}}for(let n=this.messages.length-1;n>=0;--n){let r=this.messages[n],i=vJ(r.parts,e);if(!i)continue;let a=[...this.messages];return a[n]={...r,parts:t(r,i)},this.messages=a,this.stateVersion+=1,!0}return!1};upsertMessage=e=>{let t=cJ(e);this.streamingMessage?.id===t.id&&(this.streamingMessage=null);let n=this.messages.findIndex(e=>e.id===t.id);if(n<0){this.messages=mJ(this.messages,t),this.stateVersion+=1;return}let r=[...this.messages];r[n]=t,this.messages=r,this.stateVersion+=1};replaceStreamingMessage=e=>{!e&&!this.streamingMessage||(this.streamingMessage=e?cJ(e):null,this.stateVersion+=1)};setError=e=>{this.error?.code===e?.code&&this.error?.message===e?.message&&this.error?.details===e?.details&&this.error?.cause===e?.cause||(this.error=e?{...e,details:e.details?{...e.details}:void 0}:null,this.stateVersion+=1)};clearActiveRun=()=>{this.activeRun&&(this.activeRun=null,this.stateVersion+=1)};isSettledRunId=e=>!!e?.trim()&&e===this.lastSettledRunId;markRunAsSettled=e=>{this.lastSettledRunId=e?.trim()||null};settleStreamingMessage=(e,t)=>{if(!this.streamingMessage)return;let n=fJ(this.streamingMessage,e,t);this.upsertMessage(n),this.replaceStreamingMessage(null),this.toolCalls.clearByMessageId(n.id)};notifyListeners=()=>{let e=this.getSnapshot();for(let t of this.listeners)t(e)}},TJ=16,EJ={code:`abort-error`,message:`User stopped the current run.`,details:{source:`chat-ui`}},DJ=class{constructor(e){this.dispatchBatch=e,this.queue=[],this.flushTimerId=null,this.isFlushing=!1,this.isDisposed=!1,this.enqueue=e=>{this.isDisposed||(this.queue.push(e),this.scheduleFlush())},this.dispose=()=>{this.isDisposed=!0,this.flushTimerId!==null&&(window.clearTimeout(this.flushTimerId),this.flushTimerId=null),this.queue.length=0},this.scheduleFlush=()=>{this.flushTimerId!==null||this.isFlushing||this.queue.length===0||(this.flushTimerId=window.setTimeout(()=>{this.flushTimerId=null,this.flush()},TJ))},this.flush=async()=>{if(!(this.isDisposed||this.isFlushing||this.queue.length===0)){this.isFlushing=!0;try{for(;this.queue.length>0;){let e=this.queue.splice(0);await this.dispatchBatch(e)}}finally{this.isFlushing=!1,this.scheduleFlush()}}}}};function OJ(e,t){let n=e.dispatchBatch;return typeof n==`function`?n.call(e,t):t.reduce((t,n)=>t.then(()=>e.dispatch(n)),Promise.resolve())}function kJ(e,t){if(!t)return!0;let n=`payload`in e?e.payload:null;return!n||typeof n!=`object`||!(`sessionId`in n)||typeof n.sessionId!=`string`?!0:n.sessionId===t}function AJ(e){return e.parts.some(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?e.text.trim().length>0:!0)}function jJ(e,t){if(typeof e==`string`){let n=e.trim();return n?{...t?{sessionId:t}:{},message:{id:`user-${Date.now().toString(36)}`,...t?{sessionId:t}:{},role:`user`,status:`final`,parts:[{type:`text`,text:n}],timestamp:new Date().toISOString()}}:null}if(!AJ(e.message))return null;let n=e.sessionId||e.message.sessionId||t;return{...e,...n?{sessionId:n}:{},message:{...e.message,...n?{sessionId:n}:{}}}}function MJ(e){let t=(0,P.useRef)();return t.current?e&&t.current.sessionId===null?t.current.sessionId=e:t.current.sessionId!==(e??null)&&(t.current={sessionId:e??null,manager:new wJ}):t.current={sessionId:e??null,manager:new wJ},t.current.manager}function NJ({sessionId:e,client:t,manager:n}){let r=(0,P.useRef)(e),i=(0,P.useSyncExternalStore)(e=>n.subscribe(()=>e()),()=>n.getSnapshot(),()=>n.getSnapshot()),[a,o]=(0,P.useState)(!1);(0,P.useEffect)(()=>{r.current=e},[e]),(0,P.useEffect)(()=>{o(!1)},[e]),(0,P.useEffect)(()=>{let e=new DJ(e=>OJ(n,e)),i=t.subscribe(t=>{kJ(t,r.current)&&e.enqueue(t)});return()=>{i(),e.dispose(),t.stop()}},[t,n]);let s=i.streamingMessage?[...i.messages,i.streamingMessage]:i.messages,c=i.activeRun?.runId??null,l=!!i.activeRun;return{snapshot:i,visibleMessages:s,activeRunId:c,isRunning:l,isSending:a,send:async r=>{if(a||l)return null;let i=jJ(r,e);if(!i)return null;o(!0),e&&await n.dispatch({occurredAt:new Date().toISOString(),type:Nq.MessageSent,payload:{sessionId:e,message:{...i.message,sessionId:e},metadata:i.metadata}});try{return await t.send(i)}finally{o(!1)}},abort:async()=>{e&&await t.abort({sessionId:e,runId:c??void 0,reason:EJ})},streamRun:async()=>{e&&(await t.stop(),await t.stream({sessionId:e}))}}}function PJ(e){return e instanceof Error?e:Error(String(e))}function FJ(e){let{hydratedSessionId:t,isHydrating:n,sessionId:r}=e;return r?n||t!==r:!1}function IJ(e,t){let n=e.getSnapshot();return n.activeRun?.sessionId===t||n.streamingMessage?.sessionId===t||n.messages.some(e=>e.sessionId===t)}function LJ(e,t){return e.status===`running`?{runId:null,sessionId:t,abortDisabledReason:null}:null}function RJ(e,t,n){return n.signal.aborted||e.requestId!==t}function zJ({sessionId:e,client:t,loadSeed:n}){let r=MJ(e),i=NJ({sessionId:e,client:t,manager:r}),[a,o]=(0,P.useState)(!0),[s,c]=(0,P.useState)(null),[l,u]=(0,P.useState)(null),d=(0,P.useRef)({requestId:0,controller:null}),f=(0,P.useCallback)(async()=>{await t.stop(),r.reset(),c(null),u(null),o(!1),d.current={requestId:d.current.requestId+1,controller:null}},[t,r]),p=(0,P.useCallback)(e=>{c(null),u(e),o(!1)},[]),m=(0,P.useCallback)(async()=>{if(d.current.controller?.abort(),!e){await f();return}let i=new AbortController,a=d.current.requestId+1;if(d.current={requestId:a,controller:i},IJ(r,e)){p(e),d.current.controller===i&&(d.current.controller=null);return}await t.stop(),r.reset(),c(null),o(!0);try{let o=await n(e,i.signal);if(RJ(d.current,a,i))return;r.hydrate({sessionId:e,messages:o.messages,activeRun:LJ(o,e)}),p(e),t.stream({sessionId:e}).catch(e=>{d.current.requestId===a&&c(PJ(e))})}catch(t){if(RJ(d.current,a,i))return;c(PJ(t)),u(e),o(!1)}finally{d.current.controller===i&&(d.current.controller=null)}},[t,n,r,p,f,e]);return(0,P.useEffect)(()=>(m(),()=>{d.current.controller?.abort(),d.current.controller=null}),[m]),{...i,isHydrating:FJ({sessionId:e,hydratedSessionId:l,isHydrating:a}),hydrateError:s}}var BJ=200*1024*1024,VJ=`application/octet-stream`;function HJ(e){let t=e.type.trim().toLowerCase();return t.length>0?t:VJ}function UJ(e,t){let n=t.acceptedMimeTypes&&t.acceptedMimeTypes.length>0?new Set(t.acceptedMimeTypes.map(e=>e.trim().toLowerCase())):null,r=t.maxBytes??209715200,i=HJ(e);return n&&!n.has(i)?{ok:!1,rejected:{fileName:e.name,mimeType:i,sizeBytes:e.size,reason:`unsupported-type`}}:e.size>r?{ok:!1,rejected:{fileName:e.name,mimeType:i,sizeBytes:e.size,reason:`too-large`}}:{ok:!0,mimeType:i}}function WJ(e){let t=e.parts&&e.parts.length>0?e.parts.map(e=>structuredClone(e)):[...e.text?.trim()??``?[{type:`text`,text:e.text.trim()}]:[],...(e.attachments??[]).map(e=>({type:`file`,name:e.name,mimeType:e.mimeType,...e.assetUri?.trim()?{assetUri:e.assetUri.trim()}:{},...e.url?.trim()?{url:e.url.trim()}:{},...e.contentBase64?.trim()?{contentBase64:e.contentBase64.trim()}:{},sizeBytes:e.sizeBytes}))];if(t.length===0)return null;let n=e.timestamp??new Date().toISOString(),r=e.messageId??`user-${Date.now().toString(36)}`;return{...e.sessionId?{sessionId:e.sessionId}:{},message:{id:r,...e.sessionId?{sessionId:e.sessionId}:{},role:`user`,status:`final`,parts:t,timestamp:n,...e.metadata?{metadata:e.metadata}:{}},...e.metadata?{metadata:e.metadata}:{}}}async function GJ(e,t){let n=[],r=[];for(let i of e){let e=UJ(i,t);if(!e.ok){r.push(e.rejected);continue}n.push(i)}if(n.length===0)return{attachments:[],rejected:r};try{return{attachments:await t.uploadBatch(n),rejected:r}}catch{return r.push(...n.map(e=>({fileName:e.name,mimeType:HJ(e),sizeBytes:e.size,reason:`read-failed`}))),{attachments:[],rejected:r}}}function KJ(e){return typeof e==`string`?e:e instanceof URL?e.toString():e.url}function qJ(e){if(e instanceof Error){let t=e.name?.trim(),n=e.message?.trim();return t&&n?`${t}: ${n}`:n||t||`Unknown Error`}return String(e??`Unknown error`)}function JJ(e,t){let n=Error(e);return t!==void 0&&(n.cause=t),n}function YJ(){return async(e,t)=>{try{return await fetch(e,{credentials:`include`,...t})}catch(n){throw re.reportTransportFailure(qJ(n)),JJ(`NCP fetch failed for ${(t?.method||`GET`).toUpperCase()} ${KJ(e)}: ${qJ(n)}`,n)}}}var XJ=300,ZJ=`ncp agent unavailable during startup`;function QJ(e){return e instanceof Error?e.message.includes(`ncp session not found:`):!1}function $J(e){return e?.trim().toLowerCase().includes(ZJ)??!1}function eY(){return new oJ({baseUrl:x,basePath:`/api/ncp/agent`,fetchImpl:YJ()})}async function tY(e,t,n=XJ){t.throwIfAborted();try{let r=await Ve(e,n);return t.throwIfAborted(),{messages:r.messages,status:r.status??`idle`,contextWindow:r.contextWindow??null}}catch(e){if(t.throwIfAborted(),!QJ(e))throw e;return{messages:[],status:`idle`}}}function nY(e,t){let n=(0,P.useRef)(null),r=(0,P.useCallback)(e=>{if(!e){n.current=null;return}n.current!==e&&(n.current=e,t())},[t]);(0,P.useEffect)(()=>{r(e)},[e,r])}function rY(e,t={}){let[n]=(0,P.useState)(()=>eY()),r=b(),[i,a]=(0,P.useState)(0),[o,s]=(0,P.useState)(null),c=t.messageLimit??XJ;(0,P.useEffect)(()=>{s(null)},[e]);let l=zJ({sessionId:e,client:n,loadSeed:(0,P.useCallback)(async(e,t)=>{let n=await tY(e,t,c);return t.aborted||s(n.contextWindow??null),{messages:n.messages,status:n.status}},[i,c])}),u=l.hydrateError?.message??l.snapshot.error?.message??null;return nY(e&&r.phase===`ready`&&$J(u)?`${e}:${r.lastReadyAt??0}`:null,()=>{a(e=>e+1)}),(0,P.useMemo)(()=>({...l,snapshot:{...l.snapshot,contextWindow:l.snapshot.contextWindow??o}}),[l,o])}function iY(e){return e.bootstrapStatus?.ncpAgent.state!==`ready`}function aY(e){return e.activeSystemAction?.message?.trim()||(e.lifecyclePhase===`cold-starting`?f(`chatRuntimeInitializing`):e.lifecyclePhase===`startup-failed`?e.bootstrapStatus?.ncpAgent.error?.trim()||e.bootstrapStatus?.lastError?.trim()||e.lastError?.trim()||f(`chatRuntimeInitializationFailed`):null)}function oY(e){let{message:t,status:n}=e,r=t?.trim();if(!r)return aY(n);let i=n.activeSystemAction?.message?.trim();if(n.phase===`service-transitioning`&&i)return i;let a=je(r);return n.phase===`recovering`&&a?f(`runtimeControlRecoveringHelp`):n.phase===`stalled`&&a?null:r}function sY(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function cY(e){if(!e||e.totalContextTokens<=0)return null;let t=e.usedContextTokens/e.totalContextTokens,n=Math.max(0,Math.min(1,t)),r=`${Math.round(n*100)}%`,i=n>=.9?`danger`:n>=.75?`warning`:`neutral`,a=[{label:f(`chatContextWindowUsed`),value:sY(e.usedContextTokens)},{label:f(`chatContextWindowTotal`),value:sY(e.totalContextTokens)},{label:f(`chatContextWindowAvailable`),value:sY(e.availableContextTokens)}];return e.prunedUsedContextTokens!==e.usedContextTokens&&a.push({label:f(`chatContextWindowPruned`),value:sY(e.prunedUsedContextTokens)}),e.droppedHistoryCount>0&&a.push({label:f(`chatContextWindowDroppedHistory`),value:String(e.droppedHistoryCount)}),e.truncatedToolResultCount>0&&a.push({label:f(`chatContextWindowTruncatedTools`),value:String(e.truncatedToolResultCount)}),{label:f(`chatContextWindow`),percentLabel:r,ratio:n,tone:i,details:a}}var lY=Bt(`18rem`);function uY({agents:e,selectedAgent:t,selectedAgentId:n,onSelectAgent:r}){return(0,F.jsxs)(Wt,{value:n,onValueChange:r,children:[(0,F.jsxs)(It,{"aria-label":f(`chatDraftAgentTitle`),className:`h-auto w-auto min-w-0 gap-1 rounded-lg border-0 bg-transparent px-2 py-1.5 text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground focus:ring-0`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:f(`chatDraftAgentTitle`)}),(0,F.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:t?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ku,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-5 w-5 shrink-0`}),(0,F.jsx)(`span`,{className:`max-w-28 truncate text-sm font-medium`,children:t.displayName?.trim()||t.id})]}):null})]}),(0,F.jsx)(zt,{className:`rounded-xl border-border shadow-lg`,style:{maxHeight:lY},children:e.map(e=>(0,F.jsx)(Ht,{value:e.id,className:`rounded-lg pr-10`,children:(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(ku,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-5 w-5 shrink-0`}),(0,F.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.displayName?.trim()||e.id})]})},e.id))})]})}var dY=[{icon:Lo,titleKey:`chatWelcomeCapability1Title`,descKey:`chatWelcomeCapability1Desc`,promptKey:`chatWelcomeCapability1Prompt`},{icon:Za,titleKey:`chatWelcomeCapability2Title`,descKey:`chatWelcomeCapability2Desc`,promptKey:`chatWelcomeCapability2Prompt`},{icon:Wa,titleKey:`chatWelcomeCapability3Title`,descKey:`chatWelcomeCapability3Desc`,promptKey:`chatWelcomeCapability3Prompt`}];function fY({onSelectPrompt:e}){return(0,F.jsx)(`div`,{className:`mt-8 grid grid-cols-[repeat(auto-fit,minmax(min(100%,9.5rem),1fr))] gap-3`,children:dY.map(t=>{let n=t.icon;return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>e(f(t.promptKey)),className:m(`min-w-0 rounded-xl border border-border/75 bg-card p-3 text-left text-card-foreground shadow-none transition-colors sm:p-3.5`,`hover:bg-muted/40`),children:[(0,F.jsx)(`div`,{className:`mb-2.5 flex h-8 w-8 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,F.jsx)(n,{className:`h-4 w-4`})}),(0,F.jsx)(`div`,{className:`mb-1 text-sm font-medium text-foreground`,children:f(t.titleKey)}),(0,F.jsx)(`div`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:f(t.descKey)})]},t.titleKey)})})}var pY=We(`20rem`);function mY({defaultProjectRoot:e,isSaving:t,projectOptions:n,projectRoot:r,selectable:i,onOpenProjectDialog:a,onSelectProjectRoot:o}){let[s,c]=(0,P.useState)(!1),l=gc(r)??f(`chatWelcomeProjectPickerPlaceholder`),u=e!=null&&r===e,d=async e=>{c(!1),await o(e)};return(0,F.jsxs)(Ze,{open:s,onOpenChange:c,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,title:r??void 0,"aria-label":f(`chatWelcomeProjectPickerLabel`),disabled:!i||t,children:[(0,F.jsx)(xo,{className:`h-4 w-4 shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:l}),u?(0,F.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground/70`,children:f(`chatWelcomeProjectDefaultBadge`)}):null,(0,F.jsx)(Et,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,F.jsxs)(Ye,{align:`start`,className:`flex w-[min(20rem,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border border-border bg-popover p-0 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,style:{maxHeight:pY},children:[(0,F.jsx)(`div`,{className:`shrink-0 px-3 pb-2 pt-3 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:f(`chatWelcomeProjectRecentTitle`)}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1.5 pb-1.5`,children:n.length>0?n.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-2 rounded-xl px-2 py-2 text-left transition-colors hover:bg-accent`,title:e.projectRoot,onClick:()=>{d(e.projectRoot)},children:[(0,F.jsx)(xo,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,F.jsx)(`span`,{className:`truncate text-[13px] font-semibold text-foreground`,children:e.projectName})}),(0,F.jsx)(`span`,{className:`block truncate text-[11px] leading-4 text-muted-foreground`,children:e.projectRoot})]}),e.sessionCount>0?(0,F.jsx)(`span`,{className:`mt-0.5 shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:e.sessionCount}):null]},e.projectRoot)):(0,F.jsx)(`div`,{className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:f(`chatWelcomeProjectNoRecent`)})}),(0,F.jsx)(`div`,{className:`shrink-0 border-t border-border p-1.5`,children:(0,F.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-xl px-2.5 py-2 text-left text-[13px] font-semibold text-foreground transition-colors hover:bg-accent`,onClick:()=>{c(!1),a()},children:[(0,F.jsx)(xo,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,F.jsx)(`span`,{children:f(`chatWelcomeProjectOpenFolder`)})]})})]})]})}function hY(e){let{disabled:t=!1,option:n,onSelect:r,selected:i=!1}=e,a=n.ready===!1?n.reasonMessage?.trim()||f(`statusSetup`):null;return(0,F.jsx)(`button`,{type:`button`,"aria-pressed":i,disabled:t,onClick:r,className:m(`w-full rounded-2xl px-3 py-2.5 text-left transition-colors`,i?`bg-gray-50`:`hover:bg-gray-50`,t?`cursor-not-allowed opacity-70`:null),children:(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2.5`,children:[n.icon?.src?(0,F.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center pt-0.5`,children:(0,F.jsx)(Cl,{icon:{kind:`runtime-image`,src:n.icon.src,alt:n.icon.alt??null,name:n.label}})}):(0,F.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center pt-0.5 text-gray-400`,children:(0,F.jsx)(Ya,{className:`h-4 w-4`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsx)(`div`,{className:`truncate text-[13px] font-semibold text-gray-900`,children:n.label}),(0,F.jsx)(wn,{status:n.ready===!1?`warning`:`ready`,label:n.ready===!1?f(`statusSetup`):f(`statusReady`),className:`bg-transparent px-0`})]}),a?(0,F.jsx)(`div`,{className:`mt-1 pr-4 text-[11px] leading-4 text-gray-500`,children:a}):null]})]}),i?(0,F.jsx)(qt,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-primary`}):null]})})}var gY=We(`18rem`);function _Y({options:e,selectedSessionType:t,onSelectSessionType:n}){let[r,i]=(0,P.useState)(!1),a=e.find(e=>e.value===t)??e[0]??null;return a?(0,F.jsxs)(Ze,{open:r,onOpenChange:i,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-label":f(`chatWelcomeSessionTypePickerLabel`),children:[a.icon?.src?(0,F.jsx)(Cl,{icon:{kind:`runtime-image`,src:a.icon.src,alt:a.icon.alt??null,name:a.label},className:`h-4 w-4`}):(0,F.jsx)(Ya,{className:`h-4 w-4 shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:a.label}),(0,F.jsx)(Et,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,F.jsx)(Ye,{align:`start`,className:`flex w-[min(16rem,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,style:{maxHeight:gY},children:(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.map(e=>(0,F.jsx)(hY,{option:e,onSelect:()=>{n(e.value),i(!1)}},e.value))})})]}):null}function vY({agents:e,defaultProjectRoot:t,inputSlot:n,projectOptions:r,selectedAgentId:i,selectedProjectRoot:a,selectedSessionType:o,sessionTypeOptions:s,onSelectAgent:c,onSelectPrompt:l,onSelectProjectRoot:u,onSelectSessionType:d}){let p=e.find(e=>e.id===i)??null,[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(!1),v=a??t??null,y=async e=>{if(u){_(!0);try{await u(e),h(!1)}finally{_(!1)}}},b=!!u;return(0,F.jsxs)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-8 sm:p-8`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 w-full max-w-[min(760px,100%)]`,children:[(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground sm:text-3xl`,children:f(`chatWelcomeTitle`)}),(0,F.jsx)(`p`,{className:`mt-3 text-sm font-medium text-muted-foreground sm:text-base`,children:f(`chatWelcomeSubtitle`)})]}),n?(0,F.jsx)(`div`,{className:`mt-8`,children:n}):null,(0,F.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 px-1 text-sm text-muted-foreground`,children:[u?(0,F.jsx)(mY,{defaultProjectRoot:t,isSaving:g,projectOptions:r,projectRoot:v,selectable:b,onOpenProjectDialog:()=>h(!0),onSelectProjectRoot:y}):null,(0,F.jsx)(uY,{agents:e,selectedAgent:p,selectedAgentId:i,onSelectAgent:c}),(0,F.jsx)(_Y,{options:s,selectedSessionType:o,onSelectSessionType:d})]}),(0,F.jsx)(fY,{onSelectPrompt:l})]}),u?(0,F.jsx)(Zs,{open:m,currentProjectRoot:v,isSaving:g,onOpenChange:h,onSave:y}):null]})}function yY(e){let{agents:t,fallbackAgentId:n}=e;return(t?.length??0)>0?t??[]:[{id:n}]}function bY(e){return e.agents.find(t=>t.id===e.agentId)??null}function xY(e,t){if(typeof e!=`string`||e.trim().length===0)return null;let n=Pl(e);return t.some(e=>e.value===n)?n:null}function SY(e){let{agentId:t,agents:n,defaultSessionType:r,pendingSessionType:i,selectedSessionType:a,sessionTypeOptions:o}=e;return(xY(a,o)??xY(i,o))||((n&&t?xY(Fl(bY({agents:n,agentId:t}),r),o):null)??xY(r,o)??o[0]?.value??Pl(r))}function CY(e){return new Date(e.lastMessageAt??e.createdAt).getTime()}function wY(e){let{defaultProjectRoot:t,sessionSummaries:n}=e,r=new Map;for(let e of Jc([...n])){let n=e.projectRoot?.trim();if(!n||n===t)continue;let i=r.get(n),a=CY(e);if(i){i.sessionCount+=1,i.latestUpdatedAt=Math.max(i.latestUpdatedAt,a);continue}r.set(n,{projectRoot:n,projectName:e.projectName?.trim()||gc(n)||n,sessionCount:1,latestUpdatedAt:a})}return[...r.values()].sort((e,t)=>t.latestUpdatedAt-e.latestUpdatedAt).map(({latestUpdatedAt:e,...t})=>t)}var TY=[];function EY({inputSlot:e,pendingProjectRoot:t,pendingSessionType:n,selectedSessionTypeValue:r,onSelectProjectRoot:i,onSelectPrompt:a,onSelectSessionType:o}){let s=ic(),c=I(e=>e.snapshot.selectedAgentId),l=L(e=>e.snapshot),u=Rl(e=>e.snapshot.configQuery?.data??null),d=Rl(e=>e.snapshot.sessionsQuery?.data?.sessions??TY),f=Rl(e=>e.snapshot.sessionTypesQuery?.data??null),p=Au(),m=l.agentId??c,h=yY({agents:p.data?.agents,fallbackAgentId:m}),g=hc(u?.agents.defaults.workspace),_=hc(t),v=Ll(f?.options??[]),y=Pl(f?.defaultType??`native`),b=SY({defaultSessionType:y,pendingSessionType:n,selectedSessionType:r,sessionTypeOptions:v}),x=wY({defaultProjectRoot:g,sessionSummaries:d});return(0,F.jsx)(vY,{agents:h,defaultProjectRoot:g,inputSlot:e,projectOptions:x,selectedAgentId:m,selectedProjectRoot:_,selectedSessionType:b,sessionTypeOptions:v,onSelectAgent:e=>{s.chatSessionListManager.setSelectedAgentId(e),o(SY({agents:h,agentId:e,defaultSessionType:y,pendingSessionType:null,selectedSessionType:null,sessionTypeOptions:v}))},onSelectPrompt:a,onSelectProjectRoot:i,onSelectSessionType:o})}var DY=`$`,OY=`@panel-app:`;function kY(e,t){if(t.length===0)return e;let n=e[e.length-1];return n?.type===`text`?[...e.slice(0,-1),{...n,text:n.text+t}]:[...e,{type:`text`,text:t}]}function AY(e){return ch(e)}function jY(e){return dh(e)}function MY(e){return fh(e,`skill`)}function NY(e){return fh(e,`file`)}function PY(e,t,n){let r=new Set(t),i=yh(e,e=>e.tokenKind===`skill`&&!r.has(e.tokenKey)),a=fh(i,`skill`),o=new Map(n.map(e=>[e.ref,e])),s=t.filter(e=>!a.includes(e)).map(e=>ah({tokenKind:`skill`,tokenKey:e,label:o.get(e)?.name||e}));return s.length===0?i:lh([...i,...s])}function FY(e,t){let n=new Set(NY(e));return t.filter(e=>n.has(e.id))}function IY(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of e){if(t.type===`text`){r=kY(r,t.text);continue}if(t.tokenKind===`skill`){r=kY(r,`${DY}${t.tokenKey}`);continue}if(t.tokenKind===`panel_app`){r=kY(r,`${OY}${t.tokenKey}`);continue}if(t.tokenKind!==`file`)continue;let e=n.get(t.tokenKey);e&&r.push({type:`file`,name:e.name,mimeType:e.mimeType,...e.assetUri?{assetUri:e.assetUri}:{},...e.url?{url:e.url}:{},...e.contentBase64?{contentBase64:e.contentBase64}:{},sizeBytes:e.sizeBytes})}return r}function LY(e){return e.modelOptions.length>0}function RY(e){return!e.isProviderStateResolved&&!LY(e)}function zY(e){return e.isProviderStateResolved&&!LY(e)}function BY(e){return!1}function VY(e){let{hasSendableDraft:t,isRuntimeBlocked:n}=e;return n||!t}function HY(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function UY(e,t){return e?Object.fromEntries(t.map(t=>[t,e])):{}}function WY(e){let t=hc(e.projectRoot),n={...UY(e.model?.trim(),[`model`,`preferred_model`]),...UY(e.thinkingLevel?.trim(),[`thinkingEffort`,`thinking`,`preferred_thinking`]),...UY(e.sessionType?.trim(),[`agentRuntimeId`,`session_type`,`runtime`]),...UY(e.agentId?.trim(),[`agentId`,`agent_id`]),...UY(t??void 0,[`projectRoot`,`project_root`])},r=HY(e.requestedSkills);r.length>0&&(n.requested_skill_refs=r);let i=e.composerNodes?bH(e.composerNodes):[];return i.length>0&&(n[pH]=i),e.sessionMaterialization&&(n[Ce]=e.sessionMaterialization),n}var GY=e=>e.some(e=>e.type!==`text`||e.text.trim().length>0),KY=e=>e?.trim()||void 0;function qY(e){return e.text.replace(/\s+/g,` `).trim()||e.attachments.map(e=>e.name).filter(Boolean).join(`, `)}function JY(e){return{isProviderStateResolved:e.isProviderStateResolved,modelOptions:e.modelOptions,sessionTypeUnavailable:e.sessionTypeState.sessionTypeUnavailable}}function YY(e){let{agentIsSending:t,inputQuery:n,inputSnapshot:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:o,sessionKey:s}=e,c=IY([...r.nodes],r.attachments);if(VY({snapshot:JY(n),hasSendableDraft:GY(c),isRuntimeBlocked:i})||t)return null;let l={text:r.text,nodes:[...r.nodes],selectedSkills:[...r.selectedSkills],skillRecords:[...r.skillRecords],attachments:[...r.attachments]},u=WY({agentId:a?void 0:o,model:KY(a?r.selectedModel:r.selectedModel??n.fallbackPreferredModel??n.defaultModel),thinkingLevel:a?r.selectedThinkingLevel??void 0:r.selectedThinkingLevel??n.fallbackPreferredThinking??void 0,sessionType:a?void 0:n.sessionTypeState.selectedSessionType,projectRoot:a?r.pendingProjectRoot:s?n.selectedSession?.projectRoot??null:r.pendingProjectRoot,requestedSkills:[...r.selectedSkills],composerNodes:[...r.nodes],sessionMaterialization:a?{kind:a.kind,parentSessionId:a.parentSessionKey,inheritContext:a.inheritContext}:null});return{composerSnapshot:l,id:`queued-input-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,metadata:u,preview:qY(l)}}function XY(e,t){return WJ({sessionId:t??void 0,text:e.composerSnapshot.text.trim(),attachments:[...e.composerSnapshot.attachments],parts:IY([...e.composerSnapshot.nodes],e.composerSnapshot.attachments),metadata:e.metadata})}function ZY(e){let{autoSendingQueuedDraftIdRef:t,draft:n,sendQueuedDraft:r,setQueuedDrafts:i,setSendError:a}=e;t.current=n.id,i(e=>e[0]?.id===n.id?e.slice(1):e),a(null),r(n).catch(e=>{i(e=>[n,...e]),a(e instanceof Error?e.message:String(e))}).finally(()=>{t.current=null})}function QY(e){let{agentIsRunning:t,agentIsSending:n,queuedDrafts:r,sendQueuedDraft:i,setQueuedDrafts:a,setSendError:o}=e,s=(0,P.useRef)(null);(0,P.useEffect)(()=>{t||n||s.current||r.length===0||ZY({autoSendingQueuedDraftIdRef:s,draft:r[0],sendQueuedDraft:i,setQueuedDrafts:a,setSendError:o})},[t,n,r,i,a,o])}function $Y(e){let{queuedDrafts:t,restoreComposer:n,setQueuedDrafts:r,setSendError:i}=e,a=(0,P.useCallback)(e=>{let a=t.find(t=>t.id===e);a&&(r(t=>t.filter(t=>t.id!==e)),n(a.composerSnapshot),i(null))},[t,n,r,i]);return{deleteQueuedInput:(0,P.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e)),i(null)},[r,i]),editQueuedInput:a}}function eX(e){let{agent:t,inputSnapshot:n,inputQuery:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:o,sessionKey:s,onSessionMaterialized:c,resetComposer:l,restoreComposer:u,setSendError:d}=e,f=GY((0,P.useMemo)(()=>IY([...n.nodes],n.attachments),[n.attachments,n.nodes])),p=t.isSending||t.isRunning,m=VY({snapshot:JY(r),hasSendableDraft:f,isRuntimeBlocked:i})||t.isSending,[h,g]=(0,P.useState)([]),_=(0,P.useCallback)(()=>YY({agentIsSending:t.isSending,inputSnapshot:n,inputQuery:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:o,sessionKey:s}),[t.isSending,r,n,i,a,o,s]),v=(0,P.useCallback)(async e=>{let n=await t.send(e),r=n?.sessionId?.trim()||t.snapshot.activeRun?.sessionId?.trim()||null;return!s&&r&&c?.(r),n},[t,c,s]),y=(0,P.useCallback)(async e=>{let t=XY(e,s);return t?v(t):null},[v,s]),b=(0,P.useCallback)(async()=>{let e=_();if(e){if(l(),d(null),t.isRunning){g(t=>[...t,e]);return}try{await y(e)}catch(t){throw u(e.composerSnapshot),d(t instanceof Error?t.message:String(t)),t}}},[t.isRunning,_,l,u,y,d]),x=$Y({queuedDrafts:h,restoreComposer:u,setQueuedDrafts:g,setSendError:d});QY({agentIsRunning:t.isRunning,agentIsSending:t.isSending,queuedDrafts:h,sendQueuedDraft:y,setQueuedDrafts:g,setSendError:d});let S=(0,P.useCallback)(async()=>{await t.abort()},[t]);return{canStopGeneration:t.isRunning,...x,hasSendableDraft:f,isSending:p,queuedInputs:h.map(({id:e,preview:t})=>({id:e,preview:t})),send:b,sendDisabled:m,stop:S,stopDisabled:!t.isRunning}}function tX(e,t){return{value:we,modelLabel:e,providerLabel:``,isRuntimeDefault:!0,thinkingCapability:t??null}}function nX(e){let t=new Set;return Un({providersView:e.providersView??void 0,templatesView:e.templatesView??void 0,config:e.config??void 0,onlyConfigured:!0}).flatMap(e=>e.models.map(n=>{let r=Wn(e.prefix,n);return!r||t.has(r)?null:(t.add(r),{value:r,modelLabel:n,providerLabel:e.displayName,thinkingCapability:Hn(e.modelThinking,n,e.aliases)})})).filter(e=>e!==null).sort((e,t)=>{let n=e.providerLabel.localeCompare(t.providerLabel);return n===0?e.modelLabel.localeCompare(t.modelLabel):n})}function rX(e){let{modelOptions:t,modelSelectionMode:n,runtimeDefaultThinkingCapability:r,runtimeDefaultModelLabel:i=`Runtime default`,supportedModels:a}=e,o=tX(i,r);if(n===`runtime-default`)return[o];if(!a||a.length===0)return n===`optional`?[o,...t]:t;let s=new Set(a),c=t.filter(e=>s.has(e.value)),l=c.length>0?c:t;return n===`optional`?[o,...l]:l}function iX(e){return e?.trim().toLowerCase()||`native`}function aX(e){let{sessions:t,selectedSessionKey:n,sessionType:r,readPreference:i}=e,a=iX(r),o,s=-1/0;for(let e of t){if(e.key===n||iX(e.sessionType)!==a)continue;let t=i(e);if(t==null)continue;let r=Date.parse(e.updatedAt),c=Number.isFinite(r)?r:-1/0;(o===void 0||c>s)&&(o=t,s=c)}return o}function oX(e){let{selectedSession:t,pendingSessionType:n,setPendingSessionType:r,sessionTypesData:i}=e,a=(0,P.useMemo)(()=>Ll(i?.options??[]),[i?.options]),o=(0,P.useMemo)(()=>{let e=[...a],n=Pl(t?.sessionType);return e.some(e=>e.value===n)||e.push({value:n,label:Il(n),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}),e.sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))},[a,t?.sessionType]),s=(0,P.useMemo)(()=>Pl(i?.defaultType??`native`),[i?.defaultType]),c=(0,P.useRef)(null),l=typeof n==`string`&&n.trim().length>0?n:void 0,u=(0,P.useMemo)(()=>Pl(t?.sessionType??l??s),[s,l,t?.sessionType]),d=(0,P.useMemo)(()=>o.find(e=>e.value===u)??null,[u,o]);(0,P.useEffect)(()=>{if(t)return;let e=typeof n==`string`?n.trim():``,i=Pl(n);(e.length===0||c.current===i||c.current===null&&i===`native`)&&(c.current=s,i!==s&&r(s))},[s,n,t,r]);let p=!t||!!t.sessionTypeMutable,m=(0,P.useMemo)(()=>new Set(a.map(e=>e.value)),[a]),h=(0,P.useMemo)(()=>t&&!m.has(Pl(t.sessionType))?!0:d?.ready===!1,[m,t,d?.ready]),g=(0,P.useMemo)(()=>t&&!m.has(Pl(t.sessionType))?`${Il(u)} ${f(`chatSessionTypeUnavailableSuffix`)}`:d?.ready===!1?d.reasonMessage?.trim()||`${d.label} setup required`:null,[m,t,u,d]);return(0,P.useMemo)(()=>({sessionTypeOptions:o,selectedSessionTypeOption:d,defaultSessionType:s,selectedSessionType:u,canEditSessionType:p,sessionTypeUnavailable:h,sessionTypeUnavailableMessage:g}),[p,s,u,d,o,h,g])}var sX=`nextclaw.chat.recent-selection.store`;function cX(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function lX(e,t){return Array.isArray(e)?Array.from(new Set(e.map(cX).filter(e=>!!e))).slice(0,t):[]}function uX(e,t){let n=cX(t?.namespace);return n?`${e.storageKey}.${encodeURIComponent(n.toLowerCase())}`:e.storageKey}function dX(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e)){let e=cX(n);if(!e)continue;let i=lX(r,1/0);i.length>0&&(t[e]=i)}return t}var fX=p()(Dn(e=>({entriesByKey:{},setEntries:(t,n)=>e(e=>({entriesByKey:{...e.entriesByKey,[t]:lX(n,1/0)}}))}),{name:sX,storage:On(()=>window.localStorage),partialize:e=>({entriesByKey:e.entriesByKey}),merge:(e,t)=>({...t,entriesByKey:dX(e?.entriesByKey)})})),pX=class{constructor(e){this.options=e,this.read=(e={})=>{let t=uX(this.options,e);return lX(fX.getState().entriesByKey[t],this.options.limit)},this.remember=(e,t={})=>{let n=cX(e);if(!n)return this.read(t);let r=uX(this.options,t),i=[n,...this.read(t).filter(e=>e!==n)].slice(0,this.options.limit);return fX.getState().setEntries(r,i),i},this.resolveVisible=e=>{let t=lX(e.availableValues,1/0);if(t.length<=e.minAvailableCount)return[];let n=new Set(t),r=[],i=Math.max(1,e.limit??this.options.limit);for(let t of this.read(e))if(!(!n.has(t)||r.includes(t))&&(r.push(t),r.length>=i))break;return r}}},mX=new pX({storageKey:`nextclaw.chat.recent-models`,limit:3}),hX=[],gX=[];function _X(e){let{sessionKey:t,inputSnapshot:n,setPendingSessionType:r}=e,i=t??null,a=ql(),o=Rl(e=>e.snapshot),s=o.configQuery?.data??null,c=o.sessionsQuery?.data?.sessions??gX,l=sl({sessionId:i?.trim()||`draft-session`,projectRoot:hc(n.pendingProjectRoot)}),u=l.data?.records??hX,d=!!(l.isLoading||l.isFetching),p=(0,P.useMemo)(()=>Jc(c),[c]),m=(0,P.useMemo)(()=>p.find(e=>e.key===i)??null,[i,p]),h=oX({selectedSession:m,pendingSessionType:n.pendingSessionType,setPendingSessionType:r,sessionTypesData:o.sessionTypesQuery?.data??null}),g=(0,P.useMemo)(()=>nX({config:s,providersView:o.providersQuery?.data??null,templatesView:o.providerTemplatesQuery?.data??null}),[s,o.providerTemplatesQuery?.data,o.providersQuery?.data]),_=(0,P.useMemo)(()=>rX({modelOptions:g,modelSelectionMode:h.selectedSessionTypeOption?.modelSelectionMode,runtimeDefaultThinkingCapability:h.selectedSessionTypeOption?.runtimeDefaultThinking??null,runtimeDefaultModelLabel:f(`chatRuntimeDefaultModel`),supportedModels:h.selectedSessionTypeOption?.supportedModels}),[g,h.selectedSessionTypeOption?.modelSelectionMode,h.selectedSessionTypeOption?.runtimeDefaultThinking,h.selectedSessionTypeOption?.supportedModels]),v=(0,P.useMemo)(()=>new Set(_.map(e=>e.value)),[_]),y=mX.read({namespace:h.selectedSessionType}).find(e=>v.has(e)),b=(0,P.useMemo)(()=>y??aX({sessions:p,selectedSessionKey:i,sessionType:h.selectedSessionType,readPreference:e=>e.preferredModel?.trim()||void 0}),[y,i,h.selectedSessionType,p]),x=(0,P.useMemo)(()=>aX({sessions:p,selectedSessionKey:i,sessionType:h.selectedSessionType,readPreference:e=>e.preferredThinking??void 0}),[i,h.selectedSessionType,p]),S=hc(s?.agents.defaults.workspace);return(0,P.useMemo)(()=>({defaultModel:s?.agents.defaults.model,defaultProjectRoot:S,fallbackPreferredModel:b,fallbackPreferredThinking:x,isProviderStateResolved:a,isSkillsLoading:d,modelOptions:_,selectedSession:m,selectedSessionKey:i,sessionTypeState:h,skillRecords:u}),[s?.agents.defaults.model,S,b,x,a,d,_,m,i,h,u])}var vX={text:``,nodes:[],selectedSkills:[],skillRecords:[]},yX=()=>({...vX,attachments:[],selectedModel:void 0,selectedThinkingLevel:null,pendingSessionType:Nl,selectedSessionType:Nl,pendingProjectRoot:null,composerFocusRequestId:0,sendError:null}),bX=e=>e?.trim()||Nl,xX=e=>[e.assetUri??``,e.url??``,e.name,e.mimeType,String(e.sizeBytes),e.contentBase64??``].join(`:`),SX=(e,t)=>{let n=new Set(e.map(xX)),r=[...e];return t.forEach(e=>{let t=xX(e);n.has(t)||(n.add(t),r.push(e))}),r},CX=()=>{let[e,t]=(0,P.useState)(yX),n=(0,P.useCallback)(e=>{t(t=>{let n=typeof e==`function`?e(t):e;return{...t,...n}})},[]),r=(0,P.useCallback)(e=>{n({text:e.text,nodes:e.nodes,selectedSkills:e.selectedSkills,skillRecords:e.skillRecords,sendError:null})},[n]),i=(0,P.useCallback)(()=>{n({...vX,attachments:[],sendError:null})},[n]),a=(0,P.useCallback)(e=>{n({...e})},[n]),o=(0,P.useCallback)(e=>{n({text:e,nodes:AY(e),selectedSkills:[],skillRecords:[],sendError:null,composerFocusRequestId:Date.now()})},[n]),s=(0,P.useCallback)(()=>{n(e=>({composerFocusRequestId:e.composerFocusRequestId+1}))},[n]),c=(0,P.useCallback)(()=>{n({composerFocusRequestId:0})},[n]),l=(0,P.useCallback)(e=>{n({attachments:e})},[n]),u=(0,P.useCallback)(t=>{if(t.length===0)return[];let r=new Set(e.attachments.map(xX)),i=SX(e.attachments,t),a=i.filter(e=>!r.has(xX(e)));return a.length>0&&n({attachments:i}),a},[e.attachments,n]),d=(0,P.useCallback)(e=>{n(t=>({attachments:t.attachments.filter(t=>t.id!==e)}))},[n]),f=(0,P.useCallback)(e=>{n({selectedModel:e})},[n]),p=(0,P.useCallback)(e=>{n({selectedThinkingLevel:e})},[n]),m=(0,P.useCallback)(e=>{n(t=>{let n=bX(typeof e==`function`?e(t.pendingSessionType):e);return{pendingSessionType:n,selectedSessionType:n}})},[n]),h=(0,P.useCallback)(e=>{n({pendingProjectRoot:e})},[n]),g=(0,P.useCallback)((e,t)=>{n({selectedSkills:e,skillRecords:t,sendError:null})},[n]),_=(0,P.useCallback)(e=>{n({sendError:e})},[n]);return{inputSnapshot:e,inputActions:(0,P.useMemo)(()=>({update:n,syncComposer:r,resetComposer:i,restoreComposer:a,applyPromptSuggestion:o,requestComposerFocusAtEnd:s,consumeComposerFocusRequest:c,setAttachments:l,addAttachments:u,removeAttachment:d,setSelectedModel:f,setSelectedThinkingLevel:p,setPendingSessionType:m,setPendingProjectRoot:h,setSelectedSkills:g,setSendError:_}),[n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_])}},wX={exactId:1200,exactLabel:1150,prefixId:1e3,prefixLabel:950,prefixToken:900,containsId:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function TX(e){return(e??``).trim().toLowerCase()}function EX(e,t){if(!e||!t)return!1;let n=0;for(let r of t)if(r===e[n]&&(n+=1,n>=e.length))return!0;return!1}function DX(e,t){let n=TX(t);if(!n)return wX.fallback;let r=TX(e.id),i=TX(e.label||e.id),a=TX(e.description),o=(e.aliases??[]).map(TX).filter(Boolean),s=i.split(/[\s/_-]+/).filter(Boolean),c=[r,...o];return c.some(e=>e===n)?wX.exactId:i===n?wX.exactLabel:c.some(e=>e.startsWith(n))?wX.prefixId:i.startsWith(n)?wX.prefixLabel:s.some(e=>e.startsWith(n))?wX.prefixToken:c.some(e=>e.includes(n))?wX.containsId:i.includes(n)?wX.containsLabel:a.includes(n)?wX.containsDescription:EX(n,i)||c.some(e=>EX(n,e))?wX.subsequence:0}function OX(e){return e>=wX.exactLabel?4:e>=wX.prefixToken?3:e>=wX.containsLabel?2:e>0?1:0}var kX={key:`panel-app-reference`,marker:`@`};function AX(e){return Date.parse(e.lastOpenedAt??e.updatedAt)||0}function jX(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.entries.map((t,n)=>({entry:t,order:n,score:DX({id:t.appId,label:t.title||t.appId,description:t.description,aliases:[t.id,t.fileName]},e.query)})).filter(e=>e.score>0).sort((e,n)=>{let r=OX(e.score),i=OX(n.score);if(i!==r)return i-r;if(e.entry.favorite!==n.entry.favorite)return e.entry.favorite?-1:1;let a=AX(n.entry),o=AX(e.entry);return a===o?n.score===e.score?t.compare(e.entry.title||e.entry.appId,n.entry.title||n.entry.appId)||e.order-n.order:n.score-e.score:a-o}).map(({entry:e})=>e)}function MX(e){let t=e.keyPrefix??`panel-app`;return jX({entries:e.entries,query:e.query}).map(n=>({entry:n,item:{key:`${t}:${n.appId}`,title:n.title||n.appId,subtitle:e.texts.subtitle,description:(n.description??``).trim()||e.texts.noDescriptionLabel,detailLines:[`${e.texts.appIdLabel}: ${n.appId}`,`${e.texts.fileLabel}: ${n.fileName}`]}}))}function NX(e){return MX(e).map(({item:e})=>e)}function PX(e){return MX(e).map(({entry:e,item:t})=>({...t,tokenKind:`panel_app`,tokenKey:e.appId,value:e.appId}))}function FX(e){return iH({key:`panel-app-reference`,trigger:kX,tokenKind:`panel_app`,texts:e.menuTexts,getIsLoading:({data:e})=>e.isPanelAppsLoading,getRecords:({data:e})=>e.panelApps,getItems:({records:t,query:n})=>PX({entries:t,query:n,texts:e.itemTexts})})}function IX(e){let t=e.modelLabel.trim(),n=e.providerLabel.trim();return n?`${n}/${t}`:t}function LX(e){let t=[];for(let n of[`off`,...e])t.includes(n)||t.push(n);return t}function RX(e){let{isModelOptionsEmpty:t,isModelOptionsLoading:n,onGoToProviders:r,texts:i}=e;return!n&&!t?null:n?{tone:`neutral`,loading:!0}:{tone:`warning`,text:i.noModelOptionsLabel,actionLabel:i.configureProviderLabel,onAction:r}}function zX({modelOptions:e,favoriteModelValues:t,recentModelValues:n,selectedModel:r,isModelOptionsLoading:i,hasModelOptions:a,onFavoriteToggle:o,onValueChange:s,texts:c}){let l=e.find(e=>e.value===r)??e[0],u=a?l?.value:void 0,d=new Map(e.map(e=>[e.value,e])),f=(t??[]).map(e=>d.get(e)).filter(e=>!!e),p=new Set(f.map(e=>e.value)),m=(n??[]).map(e=>d.get(e)).filter(e=>e!==void 0&&!p.has(e.value)),h=new Set(m.map(e=>e.value)),g=e.filter(e=>!p.has(e.value)&&!h.has(e.value)),_=f.length>0||m.length>0?[{key:`favorite-models`,label:c.favoriteModelsLabel,options:f.map(e=>({value:e.value,label:IX(e)}))},{key:`recent-models`,label:c.recentModelsLabel,options:m.map(e=>({value:e.value,label:IX(e)}))},{key:`all-models`,label:c.allModelsLabel,options:g.map(e=>({value:e.value,label:IX(e)}))}].filter(e=>e.options.length>0):void 0;return{key:`model`,value:u,placeholder:c.modelSelectPlaceholder,selectedLabel:l?IX(l):void 0,icon:`sparkles`,options:e.map(e=>({value:e.value,label:IX(e)})),groups:_,disabled:!a,loading:i,emptyLabel:c.modelNoOptionsLabel,search:{placeholder:c.modelSearchPlaceholder,emptyLabel:c.modelSearchEmptyLabel},optionAction:o?{kind:`favorite`,activeValues:f.map(e=>e.value),activeLabel:c.unfavoriteModelLabel,inactiveLabel:c.favoriteModelLabel,onToggle:o}:void 0,onValueChange:s}}function BX(e){let{defaultThinkingLevel:t,onValueChange:n,selectedThinkingLevel:r,supportedLevels:i,texts:a}=e;if(i.length===0)return null;let o=LX(i),s=o.includes(`off`)?`off`:o[0],c=r&&o.includes(r)&&r||t&&o.includes(t)&&t||s;return{key:`thinking`,value:c,placeholder:a.thinkingLabels[c],selectedLabel:a.thinkingLabels[c],icon:`brain`,options:o.map(e=>({value:e,label:a.thinkingLabels[e]})),onValueChange:e=>n(e)}}var VX={exactSpec:1200,exactLabel:1150,prefixSpec:1e3,prefixLabel:950,prefixToken:900,containsSpec:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function HX(e){return(e??``).trim().toLowerCase()}function UX(e,t){if(!e||!t)return!1;let n=0;for(let r of t)if(r===e[n]&&(n+=1,n>=e.length))return!0;return!1}function WX(e,t){let n=HX(t);if(!n)return VX.fallback;let r=HX(e.key),i=HX(e.label||e.key),a=HX(`${e.descriptionZh??``} ${e.description??``}`),o=i.split(/[\s/_-]+/).filter(Boolean);return r===n?VX.exactSpec:i===n?VX.exactLabel:r.startsWith(n)?VX.prefixSpec:i.startsWith(n)?VX.prefixLabel:o.some(e=>e.startsWith(n))?VX.prefixToken:r.includes(n)?VX.containsSpec:i.includes(n)?VX.containsLabel:a.includes(n)?VX.containsDescription:UX(n,i)||UX(n,r)?VX.subsequence:0}function GX(e){return e>=VX.exactLabel?4:e>=VX.prefixToken?3:e>=VX.containsLabel?2:e>0?1:0}function KX(e){return new Map(e.map((e,t)=>[e,t]))}function qX(e,t){let n=KX(t),r=[],i=[];for(let t of e){if(n.has(t.key)){r.push(t);continue}i.push(t)}return r.sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0)),[...r,...i]}function JX(e,t,n,r=[]){let i=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0}),a=KX(r),o=new Map;for(let t of e){let e=t.groupKey?.trim();e&&!o.has(e)&&o.set(e,o.size)}return e.map((e,n)=>({record:e,order:n,score:WX(e,t)})).filter(e=>e.score>0).sort((e,t)=>{let n=o.get(e.record.groupKey?.trim()??``)??1/0,r=o.get(t.record.groupKey?.trim()??``)??1/0;if(n!==r)return n-r;let s=GX(e.score),c=GX(t.score);if(c!==s)return c-s;let l=a.get(e.record.key)??1/0,u=a.get(t.record.key)??1/0;if(l!==u)return l-u;if(t.score!==e.score)return t.score-e.score;let d=(e.record.label||e.record.key).trim(),f=(t.record.label||t.record.key).trim(),p=i.compare(d,f);return p===0?e.order-t.order:p}).map(({record:e})=>({key:`skill:${e.key}`,title:e.label||e.key,subtitle:n.slashSkillSubtitle,description:(e.descriptionZh??e.description??``).trim()||n.noSkillDescription,detailLines:[`${n.slashSkillSpecLabel}: ${e.key}`,...e.scopeLabel?[`${n.slashSkillScopeLabel}: ${e.scopeLabel}`]:[]],sectionKey:e.groupKey,sectionLabel:e.groupLabel,tokenKind:`skill`,tokenKey:e.key,value:e.key}))}function YX(e){return e.map(e=>({key:e.key,label:e.label,description:e.descriptionZh||e.description||``,badgeLabel:e.badgeLabel}))}function XX(e){let{allSkillsLabel:t,recentKeySet:n,recentSkillsLabel:r,skillRecords:i}=e,a=i.filter(e=>n.has(e.key)),o=new Map;for(let e of i){if(n.has(e.key))continue;let r=e.groupKey?.trim()||`all-skills`,i=e.groupLabel?.trim()||t,a=o.get(r)??{label:i,records:[]};a.records.push(e),o.set(r,a)}let s=[...o].map(([e,t])=>({key:e,label:t.label,options:YX(t.records)})),c=s.some(e=>e.key!==`all-skills`);if(!(a.length===0&&!c))return[...a.length>0?[{key:`recent-skills`,label:r,options:YX(a)}]:[],...s].filter(e=>e.options.length>0)}function ZX(e){let{groupedRecentSkillValues:t,isLoading:n,onSelectedKeysChange:r,recentSkillValues:i,selectedSkills:a,skillRecords:o,texts:s}=e,c=qX(o,i??[]),l=new Set(t??[]);return{title:s.title,searchPlaceholder:s.searchPlaceholder,emptyLabel:s.emptyLabel,loadingLabel:s.loadingLabel,isLoading:n,manageLabel:s.manageLabel,manageHref:`/marketplace/skills`,options:YX(c),groups:XX({skillRecords:c,recentKeySet:l,recentSkillsLabel:s.recentSkillsLabel,allSkillsLabel:s.allSkillsLabel}),selectedKeys:a,onSelectedKeysChange:r}}var QX=`commands`,$X=`panel-app-action`,eZ=`panel-apps`,tZ=`skills`;function nZ(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.commands.map((t,n)=>({command:t,order:n,score:DX({id:t.key,label:t.title,description:t.description,aliases:t.keywords},e.query)})).filter(e=>e.score>0).sort((e,n)=>{let r=OX(e.score),i=OX(n.score);return i===r?n.score===e.score?t.compare(e.command.title,n.command.title)||e.order-n.order:n.score-e.score:i-r}).map(({command:t})=>({key:`command:${t.key}`,title:t.title,subtitle:e.texts.commandSubtitle,description:t.description,detailLines:[...t.detailLines??[]],hintLabel:e.texts.commandHintLabel,sectionKey:QX,sectionLabel:e.texts.commandSectionLabel}))}function rZ(e){let{data:t,itemTexts:n,query:r,skillHintLabel:i,skillSectionLabel:a}=e;return JX([...t.skillRecords],r,n,[...t.recentSkillValues]).map(e=>({...e,hintLabel:i,sectionKey:e.sectionKey?`${tZ}:${e.sectionKey}`:tZ,sectionLabel:e.sectionLabel||a}))}function iZ(e){return NX({entries:e.data.panelApps,keyPrefix:$X,query:e.query,texts:e.itemTexts}).map(t=>({...t,hintLabel:e.panelAppHintLabel,sectionKey:eZ,sectionLabel:e.panelAppSectionLabel}))}function aZ(e){let t=`${$X}:`;return e.key.startsWith(t)?e.key.slice(t.length):null}function oZ(e){return rH({key:`slash-command`,trigger:nh,resolvePanel:t=>{let{data:n,trigger:r}=t,i=rZ({data:n,itemTexts:e.itemTexts.skillTexts,query:r.query,skillHintLabel:e.labels.skillHintLabel,skillSectionLabel:e.labels.skillSectionLabel}),a=[...new Set(i.flatMap(e=>e.sectionKey?[e.sectionKey]:[]))];return{filterOptions:[{key:`all`,label:e.labels.filterAllLabel},{key:QX,label:e.labels.filterCommandsLabel,sectionKeys:[QX]},{key:tZ,label:e.labels.filterSkillsLabel,sectionKeys:a.length>0?a:[tZ]},{key:eZ,label:e.labels.filterPanelAppsLabel,sectionKeys:[eZ]}],isLoading:n.isPanelAppsLoading||n.isSkillsLoading,items:[...nZ({commands:e.commands,query:r.query,texts:{commandHintLabel:e.labels.commandHintLabel,commandSectionLabel:e.labels.commandSectionLabel,commandSubtitle:e.labels.commandSubtitle}}),...i,...iZ({data:n,itemTexts:e.itemTexts.panelAppTexts,panelAppHintLabel:e.labels.panelAppHintLabel,panelAppSectionLabel:e.labels.panelAppSectionLabel,query:r.query})],onSelectItem:t=>{if(t.key.startsWith(`command:`)){e.commands.find(e=>t.key===`command:${e.key}`)?.onSelect();return}let n=aZ(t);if(n){e.onSelectPanelApp(n);return}let r=t.tokenKey??t.value;r&&e.onSelectSkill?.(r)},texts:e.menuTexts}}})}function sZ(e){let{isSkillsLoading:t,itemTexts:n,language:r,onSelectPanelApp:i,onSelectSkill:a,recentSkillValues:o,skillRecords:s,commands:c}=e,[l,u]=(0,P.useState)(null),d=(0,P.useRef)(`null`),p=(0,P.useCallback)(e=>{let t=JSON.stringify(e?[e.key,e.marker,e.query,e.start,e.end]:null);d.current!==t&&(d.current=t,u(e))},[]),m=TG({enabled:l?.key===kX.key||l?.key===nh.key}),h=(0,P.useMemo)(()=>[oZ({commands:c,itemTexts:{panelAppTexts:{appIdLabel:f(`chatPanelAppReferenceAppId`,r),fileLabel:f(`chatPanelAppReferenceFile`,r),noDescriptionLabel:f(`chatPanelAppReferenceNoDescription`,r),subtitle:f(`chatPanelAppReferenceType`,r)},skillTexts:n.slashTexts},menuTexts:{loadingLabel:f(`chatSlashLoading`,r),sectionLabel:f(`chatSlashSection`,r),emptyLabel:f(`chatSlashNoResult`,r),hintLabel:f(`chatSlashHint`,r),itemHintLabel:f(`chatSlashSkillHint`,r)},labels:{commandHintLabel:f(`chatSlashCommandHint`,r),commandSectionLabel:f(`chatSlashSectionCommands`,r),commandSubtitle:f(`chatSlashTypeCommand`,r),filterAllLabel:f(`chatSlashFilterAll`,r),filterCommandsLabel:f(`chatSlashFilterCommands`,r),filterPanelAppsLabel:f(`chatSlashFilterPanelApps`,r),filterSkillsLabel:f(`chatSlashFilterSkills`,r),panelAppHintLabel:f(`chatSlashPanelAppHint`,r),panelAppSectionLabel:f(`chatPanelAppReferenceSection`,r),skillHintLabel:f(`chatSlashSkillHint`,r),skillSectionLabel:f(`chatSlashSectionSkills`,r)},onSelectPanelApp:i,onSelectSkill:a}),FX({itemTexts:{appIdLabel:f(`chatPanelAppReferenceAppId`,r),fileLabel:f(`chatPanelAppReferenceFile`,r),noDescriptionLabel:f(`chatPanelAppReferenceNoDescription`,r),subtitle:f(`chatPanelAppReferenceType`,r)},menuTexts:{loadingLabel:f(`chatPanelAppReferenceLoading`,r),sectionLabel:f(`chatPanelAppReferenceSection`,r),emptyLabel:f(`chatPanelAppReferenceNoResult`,r),hintLabel:f(`chatPanelAppReferenceHint`,r),itemHintLabel:f(`chatPanelAppReferenceItemHint`,r)}})],[c,n.slashTexts,r,i,a]);return{inputSurfaceState:(0,P.useMemo)(()=>aH({data:{isPanelAppsLoading:m.isLoading||m.isFetching,isSkillsLoading:t,panelApps:m.data?.entries??[],recentSkillValues:o,skillRecords:s},plugins:h,trigger:l}),[h,l,m.data?.entries,m.isFetching,m.isLoading,t,o,s]),setInputSurfaceTrigger:p}}var cZ=xe.chat.modelFavorites,lZ=[`preference`,cZ];function uZ(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();e&&!t.includes(e)&&t.push(e)}return t}function dZ(e){let t=pe(),n=(0,P.useMemo)(()=>new Set(e),[e]),r=E({queryKey:lZ,queryFn:()=>be(cZ),staleTime:3e4}),i=(0,P.useMemo)(()=>uZ(r.data?.value),[r.data?.value]),a=(0,P.useMemo)(()=>i.filter(e=>n.has(e)),[n,i]),o=Me({mutationFn:async e=>await ue(cZ,e),onMutate:async e=>{await t.cancelQueries({queryKey:lZ});let n=t.getQueryData(lZ);return t.setQueryData(lZ,{key:cZ,value:e,updatedAt:new Date().toISOString()}),{previous:n}},onError:(e,n,r)=>{r?.previous&&t.setQueryData(lZ,r.previous)},onSuccess:e=>{t.setQueryData(lZ,e)}}),s=(0,P.useCallback)((e,t)=>{let n=e.trim();if(!n)return;let r=t?[n,...i.filter(e=>e!==n)]:i.filter(e=>e!==n);o.mutate(r)},[i,o]);return{favoriteModelValues:a,isLoading:r.isLoading,setModelFavorite:s}}var fZ=new pX({storageKey:`nextclaw.chat.recent-skills`,limit:5});function pZ(e){let{addAttachments:t,attachmentSupported:n,inputBarRef:r}=e,i=(0,P.useCallback)(e=>{if(e===`unsupported-type`){D.error(f(`chatInputAttachmentUnsupported`));return}if(e===`too-large`){D.error(f(`chatInputAttachmentTooLarge`).replace(`{maxMb}`,String(BJ/(1024*1024))));return}D.error(f(`chatInputAttachmentReadFailed`))},[]),a=(0,P.useCallback)(async e=>{if(!n||e.length===0)return;let a=await GJ(e,{uploadBatch:y});if(a.attachments.length>0){let e=t(a.attachments);e.length>0&&r.current?.insertFileTokens(e.map(e=>({tokenKey:e.id,label:e.name})))}a.rejected.length>0&&i(a.rejected[0].reason)},[t,n,r,i]);return{handleFilesAdd:a,handleFileInputChange:(0,P.useCallback)(async e=>{let t=Array.from(e.target.files??[]);e.currentTarget.value=``,await a(t)},[a])}}function mZ(){return{off:f(`chatThinkingLevelOff`),minimal:f(`chatThinkingLevelMinimal`),low:f(`chatThinkingLevelLow`),medium:f(`chatThinkingLevelMedium`),high:f(`chatThinkingLevelHigh`),adaptive:f(`chatThinkingLevelAdaptive`),xhigh:f(`chatThinkingLevelXhigh`)}}function hZ(e){let{allModelsLabel:t,favoriteModelLabel:n,favoriteModelValues:r,favoriteModelsLabel:i,hasModelOptions:a,isModelOptionsLoading:o,modelRecords:s,modelSearchEmptyLabel:c,modelSearchPlaceholder:l,onFavoriteModelToggle:u,onModelChange:d,onThinkingChange:p,recentModelValues:m,recentModelsLabel:h,selectedModel:g,selectedThinkingLevel:_,thinkingDefaultLevel:v,thinkingSupportedLevels:y,unfavoriteModelLabel:b}=e;return[zX({modelOptions:s,favoriteModelValues:r,recentModelValues:m,selectedModel:g,isModelOptionsLoading:o,hasModelOptions:a,onFavoriteToggle:u,onValueChange:d,texts:{modelSelectPlaceholder:f(`chatSelectModel`),modelNoOptionsLabel:f(`chatModelNoOptions`),modelSearchPlaceholder:l,modelSearchEmptyLabel:c,favoriteModelsLabel:i,favoriteModelLabel:n,unfavoriteModelLabel:b,recentModelsLabel:h,allModelsLabel:t}}),BX({supportedLevels:y,selectedThinkingLevel:_,defaultThinkingLevel:v,onValueChange:p,texts:{thinkingLabels:mZ()}})].filter(e=>e!==null)}function gZ(e){let{allSkillsLabel:t,isSkillsLoading:n,onSelectedKeysChange:r,recentSkillGroupValues:i,recentSkillValues:a,recentSkillsLabel:o,selectedSkills:s,skillRecords:c}=e;return ZX({skillRecords:c,recentSkillValues:a,groupedRecentSkillValues:i,selectedSkills:[...s],isLoading:n,onSelectedKeysChange:r,texts:{title:f(`chatSkillsPickerTitle`),searchPlaceholder:f(`chatSkillsPickerSearchPlaceholder`),emptyLabel:f(`chatSkillsPickerEmpty`),loadingLabel:f(`sessionsLoading`),manageLabel:f(`chatSkillsPickerManage`),recentSkillsLabel:o,allSkillsLabel:t}})}function _Z(e,t){let n=e?.thinkingCapability;return!n||n.supported.length===0?null:t===`off`?`off`:t&&n.supported.includes(t)?t:n.default&&n.supported.includes(n.default)?n.default:`off`}function vZ({children:e,disabled:t=!1,label:n,onClick:r}){return(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`span`,{className:`inline-flex`,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":n,disabled:t,onClick:r,className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:text-muted-foreground/50`,children:e})})}),(0,F.jsx)(yt,{side:`top`,children:n})]})}function yZ({controller:e}){return e.queuedInputs.length===0?null:(0,F.jsx)(St,{delayDuration:120,children:(0,F.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.queuedInputs.map(t=>(0,F.jsxs)(`div`,{className:`flex min-h-8 min-w-0 items-center gap-2 text-sm`,children:[(0,F.jsx)(co,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground/80`,children:t.preview||f(`chatQueuedBannerAttachmentFallback`)}),(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,F.jsx)(vZ,{label:f(`chatQueuedEdit`),onClick:()=>e.editQueuedInput(t.id),children:(0,F.jsx)(qo,{className:`h-4 w-4`})}),(0,F.jsx)(vZ,{label:f(`chatQueuedDelete`),onClick:()=>e.deleteQueuedInput(t.id),children:(0,F.jsx)(Sn,{className:`h-4 w-4`})})]})]},t.id))})})}function bZ(e,t,n){return e.map(e=>({key:e.ref,label:e.name,scopeLabel:t[e.source],groupKey:e.source,groupLabel:n[e.source],description:e.description,descriptionZh:e.descriptionZh,badgeLabel:t[e.source]}))}function xZ(e){return e.map(e=>({value:e.value,modelLabel:e.modelLabel,providerLabel:e.providerLabel,thinkingCapability:e.thinkingCapability?{supported:e.thinkingCapability.supported,default:e.thinkingCapability.default??null}:null}))}function SZ(e){let{skillGroupLabels:t,skillScopeLabels:n}=(0,P.useMemo)(()=>({skillScopeLabels:{builtin:f(`chatSkillScopeBuiltin`),global:f(`chatSkillScopeGlobal`),project:f(`chatSkillScopeProject`),workspace:f(`chatSkillScopeWorkspace`)},skillGroupLabels:{builtin:f(`chatSkillGroupBuiltin`),global:f(`chatSkillGroupGlobal`),project:f(`chatSkillGroupProject`),workspace:f(`chatSkillGroupWorkspace`)}}),[e]);return{skillScopeLabels:n,skillGroupLabels:t,slashTexts:(0,P.useMemo)(()=>({slashSkillSubtitle:f(`chatSlashTypeSkill`),slashSkillSpecLabel:f(`chatSlashSkillSpec`),slashSkillScopeLabel:f(`chatSlashSkillScope`),noSkillDescription:f(`chatSkillsPickerNoDescription`)}),[e]),recentModelsLabel:f(`chatPickerRecentModels`),allModelsLabel:f(`chatPickerAllModels`),favoriteModelsLabel:f(`chatPickerFavoriteModels`),modelSearchPlaceholder:f(`chatModelSearchPlaceholder`),modelSearchEmptyLabel:f(`chatModelSearchEmpty`),favoriteModelLabel:f(`chatFavoriteModel`),unfavoriteModelLabel:f(`chatUnfavoriteModel`),recentSkillsLabel:f(`chatPickerRecent`),allSkillsLabel:f(`chatPickerAllSkills`)}}function CZ(e){let{modelOptions:t,skillGroupLabels:n,skillRecords:r,skillScopeLabels:i}=e,a=(0,P.useMemo)(()=>bZ(r,i,n),[n,i,r]),o=(0,P.useMemo)(()=>xZ(t),[t]);return{skillRecords:a,modelRecords:o,recentModelValues:mX.resolveVisible({availableValues:o.map(e=>e.value),minAvailableCount:5}),recentSkillValues:fZ.resolveVisible({availableValues:a.map(e=>e.key),minAvailableCount:0}),recentSkillGroupValues:fZ.resolveVisible({availableValues:a.map(e=>e.key),minAvailableCount:4})}}var wZ=(0,P.memo)(function(e){let{contextWindow:t,controller:n,inputActions:r,inputQuery:i,inputSnapshot:a,surface:o=`default`}=e,s=ic(),{language:c}=Qt(),l=_q(e=>e.layout),{isMobile:u}=gn(),d=(0,P.useRef)(null),p=(0,P.useRef)(null),m=SZ(c),{skillRecords:h,modelRecords:_,recentModelValues:v,recentSkillValues:y,recentSkillGroupValues:b}=CZ({modelOptions:i.modelOptions,skillRecords:i.skillRecords,skillGroupLabels:m.skillGroupLabels,skillScopeLabels:m.skillScopeLabels}),x=(0,P.useMemo)(()=>{let e=i.selectedSessionKey?.trim();return e?[{key:`side-chat`,title:f(`chatSlashCommandSideChatTitle`,c),description:f(`chatSlashCommandSideChatDescription`,c),detailLines:[f(`chatSlashCommandSideChatDetail`,c)],keywords:[`side`,`chat`,`child`,`branch`,`new`],onSelect:()=>s.chatThreadManager.openSideChatDraft(e)}]:[]},[i.selectedSessionKey,c,s.chatThreadManager]),S=(0,P.useCallback)(e=>void s.chatUiManager.showContent({target:{type:`panel_app`,payload:{appId:e}}}),[s.chatUiManager]),{inputSurfaceState:C,setInputSurfaceTrigger:w}=sZ({commands:x,isSkillsLoading:i.isSkillsLoading,itemTexts:{slashTexts:m.slashTexts},language:c,onSelectPanelApp:S,onSelectSkill:fZ.remember,recentSkillValues:y,skillRecords:h}),{favoriteModelValues:T,setModelFavorite:E}=dZ((0,P.useMemo)(()=>_.map(e=>e.value),[_])),D=a.selectedModel??i.fallbackPreferredModel??i.defaultModel??``,O=a.selectedThinkingLevel??i.fallbackPreferredThinking??null,k={isProviderStateResolved:i.isProviderStateResolved,modelOptions:i.modelOptions,sessionTypeUnavailable:i.sessionTypeState.sessionTypeUnavailable},A=LY(k),ee=RY(k),j=zY(k),te=BY(k),ne=f(j?`chatModelNoOptions`:u?`chatInputPlaceholderCompact`:`chatInputPlaceholder`),re=_.find(e=>e.value===D),ie=re?.thinkingCapability?.supported??[],{handleFilesAdd:ae,handleFileInputChange:oe}=pZ({attachmentSupported:!0,inputBarRef:d,addAttachments:r.addAttachments}),se=(0,P.useCallback)(e=>{!i.selectedSessionKey||!i.selectedSession||M(i.selectedSessionKey,e).catch(()=>void 0)},[i.selectedSession,i.selectedSessionKey]),ce=(0,P.useCallback)(e=>{let t=[...e];r.update(e=>({nodes:t,attachments:FY(t,e.attachments),text:jY(t),selectedSkills:MY(t),sendError:null}))},[r]),le=(0,P.useCallback)(e=>{let t=_Z(_.find(t=>t.value===e),O);r.update({selectedModel:e,selectedThinkingLevel:t,sendError:null}),mX.remember(e,{namespace:i.sessionTypeState.selectedSessionType}),g(e)||mX.remember(e),se({preferredModel:g(e)?null:e,preferredThinking:t})},[r,i.sessionTypeState.selectedSessionType,_,O,se]),ue=(0,P.useCallback)(e=>{r.setSelectedThinkingLevel(e),se({preferredThinking:e})},[r,se]),de=(0,P.useCallback)(e=>{let t=a.selectedSkills;e.filter(e=>!t.includes(e)).forEach(e=>fZ.remember(e)),ce(PY([...a.nodes],e,i.skillRecords.map(e=>({ref:e.ref,name:e.name}))))},[ce,i.skillRecords,a.nodes,a.selectedSkills]);(0,P.useEffect)(()=>{a.composerFocusRequestId&&(d.current?.focusComposerAtEnd([...a.nodes]),r.consumeComposerFocusRequest())},[r,a.composerFocusRequestId,a.nodes]);let fe=hZ({allModelsLabel:m.allModelsLabel,favoriteModelLabel:m.favoriteModelLabel,favoriteModelValues:T,favoriteModelsLabel:m.favoriteModelsLabel,hasModelOptions:A,isModelOptionsLoading:ee,modelRecords:_,modelSearchEmptyLabel:m.modelSearchEmptyLabel,modelSearchPlaceholder:m.modelSearchPlaceholder,onFavoriteModelToggle:E,onModelChange:le,onThinkingChange:ue,recentModelValues:v,recentModelsLabel:m.recentModelsLabel,selectedModel:D,selectedThinkingLevel:O,thinkingSupportedLevels:ie,thinkingDefaultLevel:re?.thinkingCapability?.default??null,unfavoriteModelLabel:m.unfavoriteModelLabel}),pe=gZ({allSkillsLabel:m.allSkillsLabel,onSelectedKeysChange:de,recentSkillGroupValues:b,recentSkillValues:y,recentSkillsLabel:m.recentSkillsLabel,isSkillsLoading:i.isSkillsLoading,skillRecords:h,selectedSkills:a.selectedSkills}),me=o===`default`&&l===`flat`,he=(0,F.jsx)(iD,{ref:d,surface:me?`embedded`:o,sendError:a.sendError,sendErrorDetailsLabel:f(`chatErrorDetails`,c),topSlot:n.queuedInputs.length>0?(0,F.jsx)(yZ,{controller:n}):null,composer:{nodes:[...a.nodes],placeholder:ne,disabled:te,onNodesChange:ce,onFilesAdd:ae,inputSurfaceTriggerSpecs:C.triggerSpecs,onInputSurfaceTriggerChange:w},inputSurface:C.panel??void 0,hint:RX({isModelOptionsLoading:ee,isModelOptionsEmpty:j,onGoToProviders:s.chatUiManager.goToProviders,texts:{noModelOptionsLabel:f(`chatModelNoOptions`),configureProviderLabel:f(`chatGoConfigureProvider`)}}),toolbar:{selects:[],trailingSelects:fe,accessories:[{key:`attach`,label:f(`chatInputAttach`),icon:`paperclip`,iconOnly:!0,disabled:te,onClick:()=>p.current?.click()}],skillPicker:pe,actions:{isSending:n.isSending,canStopGeneration:n.canStopGeneration,sendDisabled:n.sendDisabled,stopDisabled:n.stopDisabled,stopHint:f(`chatStopUnavailable`),sendButtonLabel:n.isSending?f(`chatQueueSend`):f(`chatSend`),stopButtonLabel:f(`chatStop`),contextWindow:t,onSend:n.send,onStop:n.stop}}});return(0,F.jsxs)(F.Fragment,{children:[me?(0,F.jsx)(jq,{className:`pb-4 pt-2`,width:`composer`,children:he}):he,(0,F.jsx)(`input`,{ref:p,type:`file`,multiple:!0,className:`hidden`,onChange:oe})]})});function TZ(e){let{applyPromptSuggestion:t,consumeDraftIntent:n}=e,r=c2(),i=ic();(0,P.useEffect)(()=>{if(!n)return;let e=e=>{i.chatSessionListManager.createSession(),i.chatSessionListManager.setSelectedAgentId(`main`),t(e.prompt),r.chatDraftIntentManager.markConsumed(e.id)},a=r.chatDraftIntentManager.subscribe(e),o=r.chatDraftIntentManager.consumePending();return o&&e(o),a},[r,t,n,i])}function EZ(e){if(!e||typeof e!=`object`)return null;let t=e.chatDraft;return!t||typeof t!=`object`?null:t}function DZ(e){let{sessionKey:t,setPendingProjectRoot:n,setPendingSessionType:r}=e,i=ii(),a=(0,P.useRef)(null);(0,P.useEffect)(()=>{if(t)return;let e=EZ(i.state);if(!e)return;let o=[i.key,typeof e.sessionType==`string`?e.sessionType:``,typeof e.projectRoot==`string`?e.projectRoot:``].join(`:`);a.current!==o&&(a.current=o,typeof e.sessionType==`string`&&e.sessionType.trim()&&r(e.sessionType),n(typeof e.projectRoot==`string`&&e.projectRoot.trim()?e.projectRoot:null))},[i.key,i.state,t,n,r])}function OZ({inputQuery:e}){let t=ic(),n=e.isProviderStateResolved&&e.modelOptions.length===0,r=e.sessionTypeState.sessionTypeUnavailableMessage?.trim()||null;return(0,F.jsxs)(F.Fragment,{children:[n?(0,F.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-amber-200/70 bg-amber-50/70 flex items-center justify-between gap-3 shrink-0 sm:px-5`,children:[(0,F.jsx)(`span`,{className:`text-xs text-amber-800`,children:f(`chatModelNoOptions`)}),(0,F.jsx)(`button`,{type:`button`,onClick:t.chatUiManager.goToProviders,className:`text-xs font-semibold text-amber-900 underline-offset-2 hover:underline`,children:f(`chatGoConfigureProvider`)})]}):null,e.sessionTypeState.sessionTypeUnavailable&&r?(0,F.jsx)(`div`,{className:`px-4 py-2.5 border-b border-amber-200/70 bg-amber-50/70 shrink-0 sm:px-5`,children:(0,F.jsx)(`span`,{className:`text-xs text-amber-800`,children:r})}):null]})}function kZ(e){let{consumeDraftIntent:t=!1,materializationContext:n=null,onSessionMaterialized:r,sessionKey:i,showWelcomeForDraft:a=!0}=e,o=b(),s=I(e=>e.snapshot.selectedAgentId),c=rY(i??void 0),{inputActions:l,inputSnapshot:u}=CX(),d=_X({sessionKey:i,inputSnapshot:u,setPendingSessionType:l.setPendingSessionType});DZ({sessionKey:i,setPendingProjectRoot:l.setPendingProjectRoot,setPendingSessionType:l.setPendingSessionType});let p=iY(o),m=c.isRunning||d.selectedSession?.status===`running`,h=c.hydrateError?.message??c.snapshot.error?.message??null,g=o.phase===`ready`&&$J(h)?null:h,_=p?null:o.phase===`ready`?g:oY({message:g,status:o}),v=eX({agent:(0,P.useMemo)(()=>({...c,isRunning:m,isSending:c.isSending}),[c,m]),inputSnapshot:u,inputQuery:d,isRuntimeBlocked:p,materializationContext:n,selectedAgentId:s,sessionKey:i,onSessionMaterialized:r,resetComposer:l.resetComposer,restoreComposer:l.restoreComposer,setSendError:l.setSendError}),y=(0,P.useRef)(v);(0,P.useEffect)(()=>{y.current=v},[v]);let x=(0,P.useMemo)(()=>({canStopGeneration:v.canStopGeneration,deleteQueuedInput:e=>y.current.deleteQueuedInput(e),editQueuedInput:e=>y.current.editQueuedInput(e),isSending:v.isSending,queuedInputs:v.queuedInputs,send:()=>y.current.send(),sendDisabled:v.sendDisabled,stop:()=>y.current.stop(),stopDisabled:v.stopDisabled}),[v.canStopGeneration,v.isSending,v.queuedInputs,v.sendDisabled,v.stopDisabled]),S=(0,P.useMemo)(()=>cY(MW(c.snapshot.contextWindow)),[c.snapshot.contextWindow]),C=(0,P.useMemo)(()=>({...u,sendError:_??u.sendError}),[u,_]),w=d.selectedSession?.activityPreview,T=w?.state===`failed`&&(w.statusText?.trim()||w.replyText?.trim())||null,E=T?(0,F.jsxs)(`div`,{className:`rounded-lg border border-red-200/80 bg-red-50/80 px-3 py-2.5 shadow-sm`,children:[(0,F.jsx)(`div`,{className:`text-xs font-semibold text-red-800`,children:f(`chatSessionErrorTitle`)}),(0,F.jsx)(`div`,{className:`mt-1 whitespace-pre-wrap break-words text-xs leading-5 text-red-700`,children:T})]}):null;TZ({consumeDraftIntent:t,applyPromptSuggestion:l.applyPromptSuggestion});let D=(0,P.useCallback)(e=>(0,F.jsx)(wZ,{contextWindow:S,controller:x,inputActions:l,inputQuery:d,inputSnapshot:C,surface:e}),[S,C,x,l,d]),O=a&&!i&&c.visibleMessages.length===0&&!c.isHydrating;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(OZ,{inputQuery:d}),(0,F.jsx)(Mq,{isAwaitingAssistantOutput:v.isSending&&m,isHistoryLoading:c.isHydrating,isSending:v.isSending,bottomSlot:E,messages:c.visibleMessages,sessionKey:i,showWelcome:O,welcomeSlot:(0,F.jsx)(EY,{inputSlot:D(`embedded`),pendingProjectRoot:u.pendingProjectRoot,pendingSessionType:u.pendingSessionType,selectedSessionTypeValue:u.selectedSessionType,onSelectProjectRoot:l.setPendingProjectRoot,onSelectPrompt:l.applyPromptSuggestion,onSelectSessionType:l.setPendingSessionType})}),O?null:D(`default`)]})}function AZ(e={all:!0}){return E({queryKey:[`cron`,e],queryFn:()=>oe(e),staleTime:1e4})}function jZ(){let e=pe();return{onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),D.success(f(`configSavedApplied`))},onError:e=>{D.error(f(`configSaveFailed`)+`: `+e.message)}}}function MZ(){return Me({mutationFn:({id:e})=>O(e),...jZ()})}function NZ(){return Me({mutationFn:({id:e,enabled:t})=>le(e,{enabled:t}),...jZ()})}function PZ(){return Me({mutationFn:({id:e,force:t})=>ce(e,{force:t}),...jZ()})}function FZ(e){return l(e??void 0)}function IZ(e){if(!e)return`-`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`-`;let n=Date.now(),i=t.getTime()-n,a=r(),o=Math.abs(i);if(o<6e4)return a===`zh`?`刚刚`:`just now`;if(o<36e5){let e=Math.round(o/6e4);return i>0?a===`zh`?`${e}分钟后`:`in ${e}m`:a===`zh`?`${e}分钟前`:`${e}m ago`}if(o<864e5){let e=Math.round(o/36e5);return i>0?a===`zh`?`${e}小时后`:`in ${e}h`:a===`zh`?`${e}小时前`:`${e}h ago`}let s=Math.round(o/864e5);return i>0?a===`zh`?`${s}天后`:`in ${s}d`:a===`zh`?`${s}天前`:`${s}d ago`}function LZ(e){return typeof e!=`number`||!Number.isFinite(e)?`-`:l(new Date(e))}function RZ(e){if(typeof e!=`number`||!Number.isFinite(e))return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}var zZ=[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],BZ=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function VZ(e){return e.padStart(2,`0`)}function HZ(e,t){let n=e.trim().split(/\s+/);if(n.length!==5)return null;let[r,i,a,o,s]=n,c=t===`zh`;if(r===`*`&&i===`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每分钟`:`every minute`;if(r.startsWith(`*/`)&&i===`*`&&a===`*`&&o===`*`&&s===`*`){let e=parseInt(r.slice(2),10);if(Number.isFinite(e)&&e>0)return c?`每 ${e} 分钟`:`every ${e}m`}if(r===`0`&&i===`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每小时`:`every hour`;let l=`${VZ(i)}:${VZ(r)}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每天 ${l}`:`daily ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&s===`1-5`)return c?`工作日 ${l}`:`weekdays ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&(s===`0,6`||s===`6,0`))return c?`周末 ${l}`:`weekends ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&/^\d$/.test(s)){let e=parseInt(s,10),t=c?zZ[e]:BZ[e];return t?`${t} ${l}`:null}return r!==`*`&&i!==`*`&&a!==`*`&&o===`*`&&s===`*`?c?`每月 ${a} 日 ${l}`:`monthly ${a} ${l}`:null}function UZ(e){let t=r(),n=t===`zh`,{schedule:i}=e;if(i.kind===`cron`)return i.expr?HZ(i.expr,t)??`cron ${i.expr}`:`cron`;if(i.kind===`every`){let e=RZ(i.everyMs);return n?`每 ${e}`:`every ${e}`}return i.kind===`at`?`${n?`定时`:`at`} ${LZ(i.atMs)}`:`-`}function WZ(e){return e.payload.sessionId?.trim()||`cron:${e.id}`}function GZ(e,t){let n=t?.trim();return!!(n&&e.payload.sessionId?.trim()===n)}function KZ(e,t){let n=t.trim().toLowerCase();return n?[e.id,e.name,e.payload.message,e.payload.sessionId??``].join(` `).toLowerCase().includes(n):!0}function qZ(e,t){return t===`all`?!0:t===`enabled`?e.enabled:!e.enabled}function JZ({job:e}){return(0,F.jsxs)(`span`,{className:m(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium`,e.enabled?`bg-emerald-50 text-emerald-700`:`bg-muted text-muted-foreground`),children:[(0,F.jsx)(`span`,{className:m(`h-1.5 w-1.5 rounded-full`,e.enabled?`bg-emerald-500`:`bg-muted-foreground/50`)}),e.enabled?f(`enabled`):f(`disabled`)]})}function YZ(e){let{job:t,onDelete:n,onRun:r,onToggle:i}=e,[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(!1);return(0,F.jsx)(`div`,{className:m(`group overflow-hidden rounded-xl border border-border/70 bg-card transition-colors cursor-pointer`,a?`bg-muted/20`:`hover:bg-muted/30`),onClick:e=>{e.target.closest(`[data-no-expand]`)||o(!a)},children:(0,F.jsxs)(`div`,{className:`px-3 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a?(0,F.jsx)(Et,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):(0,F.jsx)(eo,{className:`h-3.5 w-3.5 text-muted-foreground/50 shrink-0 group-hover:text-muted-foreground transition-colors`}),(0,F.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:t.name||t.id}),(0,F.jsx)(JZ,{job:t}),t.deleteAfterRun?(0,F.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:f(`cronOneShot`)}):null]})}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,"data-no-expand":!0,children:[(0,F.jsx)(ze,{checked:t.enabled,onCheckedChange:e=>i(t,e)}),(0,F.jsxs)(Ze,{open:s,onOpenChange:c,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(w,{variant:`ghost`,size:`icon`,className:`h-7 w-7 text-muted-foreground hover:text-foreground hover:bg-muted`,"aria-label":f(`cronMoreActions`),children:(0,F.jsx)(pt,{className:`h-4 w-4`})})}),(0,F.jsxs)(Ye,{align:`end`,sideOffset:4,className:`w-40 p-1`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{c(!1),r(t)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted`,children:[(0,F.jsx)(Jo,{className:`h-3.5 w-3.5 text-muted-foreground`}),f(`cronRunNow`)]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{c(!1),n(t)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-600 transition-colors hover:bg-red-50`,children:[(0,F.jsx)(Sn,{className:`h-3.5 w-3.5`}),f(`delete`)]})]})]})]})]}),(0,F.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground pl-6`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)($a,{className:`h-3 w-3 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`font-mono text-foreground/80`,children:UZ(t)})]}),t.state.nextRunAt?(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(ao,{className:`h-3 w-3 text-muted-foreground/70`}),(0,F.jsx)(`span`,{children:IZ(t.state.nextRunAt)})]}):null,t.state.lastRunAt?(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,"data-no-expand":!0,children:[(0,F.jsx)(`span`,{className:`text-border`,children:`•`}),t.state.lastStatus===`error`&&t.state.lastError?(0,F.jsx)(St,{delayDuration:200,children:(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`span`,{className:`inline-flex items-center gap-0.5 text-orange-500 cursor-help`,children:(0,F.jsx)($t,{className:`h-3 w-3`})})}),(0,F.jsx)(yt,{side:`top`,align:`start`,className:`max-w-xs text-xs bg-red-50 text-red-700 border-red-200`,children:t.state.lastError})]})}):(0,F.jsx)(`span`,{className:m(t.state.lastStatus===`ok`?`text-emerald-500`:`text-muted-foreground/70`),children:t.state.lastStatus===`ok`?`✓`:``}),(0,F.jsx)(`span`,{children:IZ(t.state.lastRunAt)})]}):null]}),(0,F.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,F.jsx)(`div`,{className:m(`text-sm text-muted-foreground break-words`,!a&&`line-clamp-2`),children:t.payload.message})}),a?(0,F.jsxs)(`div`,{className:`mt-3 ml-6 space-y-3 border-t border-border/60 pt-3`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-2 text-xs`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70 mb-0.5`,children:f(`cronSessionLabel`)}),(0,F.jsx)(`div`,{className:`text-foreground/80 font-mono text-[11px] truncate`,title:WZ(t),children:WZ(t)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70 mb-0.5`,children:f(`cronNextRun`)}),(0,F.jsx)(`div`,{className:`text-foreground/80`,children:FZ(t.state.nextRunAt)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70 mb-0.5`,children:f(`cronLastRun`)}),(0,F.jsx)(`div`,{className:`text-foreground/80`,children:FZ(t.state.lastRunAt)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70 mb-0.5`,children:f(`cronLastStatus`)}),(0,F.jsx)(`div`,{className:m(`inline-flex items-center gap-1 font-medium`,t.state.lastStatus===`ok`?`text-emerald-600`:t.state.lastStatus===`error`?`text-red-600`:t.state.lastStatus===`skipped`?`text-amber-600`:`text-muted-foreground`),children:t.state.lastStatus??`-`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70 mb-0.5`,children:f(`cronCreatedAt`)}),(0,F.jsx)(`div`,{className:`text-foreground/80`,children:FZ(t.createdAt)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70 mb-0.5`,children:f(`cronId`)}),(0,F.jsx)(`div`,{className:`text-foreground/80 font-mono text-[11px] truncate`,title:t.id,children:t.id})]})]}),t.state.lastError?(0,F.jsx)(`div`,{className:`rounded-lg bg-red-50/80 border border-red-100 px-3 py-2 text-xs text-red-600 break-words`,children:t.state.lastError}):null]}):null]})})}function XZ(){let[e,t]=(0,P.useState)(``),[n,r]=(0,P.useState)(`all`),i=AZ({all:!0}),a=MZ(),o=NZ(),s=PZ(),{confirm:c,ConfirmDialog:l}=en(),u=(0,P.useMemo)(()=>(i.data?.jobs??[]).filter(t=>KZ(t,e)).filter(e=>qZ(e,n)),[i.data,e,n]),d=async e=>{await c({title:`${f(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:`destructive`,confirmLabel:f(`delete`)})&&a.mutate({id:e.id})},p=(e,t)=>{o.mutate({id:e.id,enabled:t})},h=async e=>{let t=!e.enabled;t&&!await c({title:`${f(`cronRunForceConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:f(`cronRunNow`)})||s.mutate({id:e.id,force:t})};return(0,F.jsxs)(Ue,{fullHeight:!0,children:[(0,F.jsx)(te,{title:f(`cronPageTitle`),description:f(`cronPageDescription`),actions:(0,F.jsx)(w,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted`,onClick:()=>i.refetch(),children:(0,F.jsx)(yn,{className:m(`h-4 w-4`,i.isFetching&&`animate-spin`)})})}),(0,F.jsx)(`div`,{className:`mb-4`,children:(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2.5 items-center`,children:[(0,F.jsxs)(`div`,{className:`relative flex-1 min-w-[240px]`,children:[(0,F.jsx)(st,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,F.jsx)(ae,{value:e,onChange:e=>t(e.target.value),placeholder:f(`cronSearchPlaceholder`),className:`pl-9`})]}),(0,F.jsx)(`div`,{className:`min-w-[140px]`,children:(0,F.jsxs)(Wt,{value:n,onValueChange:e=>r(e),children:[(0,F.jsx)(It,{className:`w-full`,children:(0,F.jsx)(kt,{placeholder:f(`cronStatusLabel`)})}),(0,F.jsxs)(zt,{children:[(0,F.jsx)(Ht,{value:`all`,children:f(`cronStatusAll`)}),(0,F.jsx)(Ht,{value:`enabled`,children:f(`cronStatusEnabled`)}),(0,F.jsx)(Ht,{value:`disabled`,children:f(`cronStatusDisabled`)})]})]})}),(0,F.jsxs)(`div`,{className:`text-xs text-muted-foreground ml-auto tabular-nums`,children:[u.length,` / `,i.data?.total??0]})]})}),(0,F.jsx)(`div`,{className:`flex-1 overflow-auto custom-scrollbar`,children:i.isLoading?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-muted-foreground`,children:[(0,F.jsx)(yn,{className:`h-5 w-5 animate-spin mb-3`}),(0,F.jsx)(`span`,{className:`text-sm`,children:f(`cronLoading`)})]}):u.length===0?(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-muted-foreground`,children:[(0,F.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-xl bg-muted`,children:(0,F.jsx)(Po,{className:`h-5 w-5 text-muted-foreground/70`})}),(0,F.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:f(`cronEmpty`)}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground mt-1`,children:f(`cronEmptyGuide`)})]}):(0,F.jsx)(`div`,{className:`space-y-2`,children:u.map(e=>(0,F.jsx)(YZ,{job:e,onDelete:d,onRun:h,onToggle:p},e.id))})}),(0,F.jsx)(l,{})]})}function ZZ({jobs:e}){let t=MZ(),{confirm:n,ConfirmDialog:r}=en(),i=async e=>{await n({title:`${f(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:f(`delete`)})&&t.mutate({id:e.id})};return(0,F.jsxs)(`div`,{className:`h-full overflow-y-auto custom-scrollbar px-4 py-4`,children:[(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:f(`chatWorkspaceSessionCronJobs`)}),(0,F.jsxs)(`div`,{className:`mt-1 text-xs text-gray-500`,children:[f(`cronTotalLabel`),`: `,e.length]})]}),e.length===0?(0,F.jsx)(`div`,{className:`py-8 text-center text-sm text-gray-500`,children:f(`chatWorkspaceCronJobEmpty`)}):(0,F.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-white px-3 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.name||e.id}),(0,F.jsx)(`div`,{className:`mt-1 text-[11px] text-gray-400`,children:e.id})]}),(0,F.jsxs)(w,{type:`button`,variant:`subtle`,size:`sm`,className:`h-7 gap-1 rounded-lg px-2`,onClick:()=>void i(e),disabled:t.isPending,children:[(0,F.jsx)(Sn,{className:`h-3.5 w-3.5`}),f(`delete`)]})]}),(0,F.jsxs)(`div`,{className:`mt-3 space-y-1.5 text-xs text-gray-500`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[f(`cronScheduleLabel`),`:`]}),` `,UZ(e)]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[f(`cronNextRun`),`:`]}),` `,FZ(e.state.nextRunAt)]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[f(`cronLastRun`),`:`]}),` `,FZ(e.state.lastRunAt)]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[f(`cronLastStatus`),`:`]}),` `,e.state.lastStatus??`-`]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[f(`cronSessionLabel`),`:`]}),` `,WZ(e)]})]}),(0,F.jsx)(`div`,{className:`mt-3 whitespace-pre-wrap break-words text-sm text-gray-700`,children:e.payload.message})]},e.id))}),(0,F.jsx)(r,{})]})}function QZ({count:e,description:t,icon:n,onClick:r,title:i}){return(0,F.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-lg border border-gray-200/80 bg-white px-3 py-3 text-left transition-colors hover:border-gray-300 hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`,onClick:r,children:[(0,F.jsx)(`span`,{className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600`,children:n}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:i}),typeof e==`number`?(0,F.jsx)(`span`,{className:`rounded-full bg-gray-100 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-gray-500`,children:e}):null]}),(0,F.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-gray-500`,children:t})]}),(0,F.jsx)(eo,{className:`h-4 w-4 shrink-0 text-gray-300 transition-transform group-hover:translate-x-0.5 group-hover:text-gray-500`})]})}function $Z({childSessionTabs:e,sessionCronJobs:t,sessionKey:n}){let r=ic();return(0,F.jsx)(`div`,{className:`h-full overflow-auto bg-gray-50/45 px-4 py-5 custom-scrollbar`,children:(0,F.jsxs)(`div`,{className:`mx-auto max-w-xl`,children:[(0,F.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:f(`chatWorkspaceOverview`)}),(0,F.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:f(`chatWorkspaceOverviewDescription`)}),(0,F.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,F.jsx)(QZ,{count:e.length,description:f(`chatWorkspaceChildSessionsDescription`),icon:(0,F.jsx)(To,{className:`h-4 w-4`}),title:f(`chatWorkspaceChildSessions`),onClick:()=>{n&&r.chatThreadManager.openChildSessions(n)}}),(0,F.jsx)(QZ,{count:t.length,description:f(`chatWorkspaceSessionCronJobsDescription`),icon:(0,F.jsx)(Wa,{className:`h-4 w-4`}),title:f(`chatWorkspaceSessionCronJobs`),onClick:()=>{n&&r.chatThreadManager.openSessionCronPanel(n)}}),(0,F.jsx)(QZ,{description:f(`chatWorkspaceProjectFilesDescription`),icon:(0,F.jsx)(So,{className:`h-4 w-4`}),title:f(`chatWorkspaceProjectFiles`),onClick:()=>{n&&r.chatThreadManager.openProjectFiles(n)}})]})]})})}function eQ({childSessionTabs:e}){let t=ic();return(0,F.jsx)(`div`,{className:`h-full overflow-auto bg-gray-50/45 px-4 py-5 custom-scrollbar`,children:(0,F.jsxs)(`div`,{className:`mx-auto max-w-xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:f(`chatWorkspaceChildSessions`)}),(0,F.jsx)(`span`,{className:`rounded-full bg-gray-100 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-gray-500`,children:e.length})]}),e.length===0?(0,F.jsx)(`div`,{className:`py-10 text-center text-sm text-gray-500`,children:f(`chatWorkspaceChildSessionsEmpty`)}):(0,F.jsx)(`div`,{className:`mt-4 space-y-2`,children:e.map(e=>(0,F.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-lg border border-gray-200/80 bg-white px-3 py-3 text-left transition-colors hover:border-gray-300 hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`,onClick:()=>t.chatThreadManager.selectChildSessionDetail(e.sessionKey),children:[(0,F.jsx)(`span`,{className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600`,children:(0,F.jsx)(To,{className:`h-4 w-4`})}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm font-medium text-gray-900`,children:e.title}),e.projectName||e.sessionTypeLabel?(0,F.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-gray-500`,children:[e.sessionTypeLabel,e.projectName].filter(Boolean).join(` · `)}):null]}),(0,F.jsx)(eo,{className:`h-4 w-4 shrink-0 text-gray-300 transition-transform group-hover:translate-x-0.5 group-hover:text-gray-500`})]},e.sessionKey))})]})})}function tQ({projectRoot:e,workingDir:t}){let n=ic(),r=e??t,i=Js({path:r,includeFiles:!0,enabled:!!r});return r?(0,F.jsx)(BW,{browseQuery:i,onFileOpen:n.chatThreadManager.openFilePreview,renderStatus:({text:e,tone:t=`muted`})=>(0,F.jsx)(`div`,{className:m(`flex h-full items-center justify-center px-6 text-center text-sm`,t===`error`?`text-rose-600`:`text-gray-500`),children:e}),showRoot:!0}):(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center text-sm text-gray-500`,children:f(`chatWorkspaceProjectFilesUnavailable`)})}function nQ({value:e}){return(0,F.jsx)(`span`,{className:`inline-flex max-w-full shrink-0 items-center rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[10px] font-medium text-gray-600`,children:(0,F.jsx)(`span`,{className:`truncate`,children:e})})}function rQ({tab:e}){let t=[e.sessionTypeLabel,e.preferredModel,e.projectName].filter(e=>!!e?.trim());return t.length===0&&!e.projectRoot?null:(0,F.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center gap-1.5 border-b border-gray-200/70 px-3 py-1.5 text-[11px] text-gray-500`,children:[t.map(e=>(0,F.jsx)(nQ,{value:e},e)),e.projectRoot?(0,F.jsx)(`span`,{title:e.projectRoot,className:`min-w-0 flex-1 truncate rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 font-mono text-[10px] text-gray-500`,children:e.projectRoot}):null]})}function iQ(){return(0,F.jsxs)(`div`,{className:`border-b border-gray-200/70 px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-semibold text-gray-900`,children:[(0,F.jsx)(Ro,{className:`h-4 w-4 shrink-0 text-primary`}),(0,F.jsx)(`span`,{className:`truncate`,children:f(`chatWorkspaceSideChatDraftTitle`)})]}),(0,F.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:f(`chatWorkspaceSideChatDraftSubtitle`)})]})}function aQ({activeSelection:e,childSessionTabs:t,filePreviewRefreshVersion:n,sessionKey:r,sessionCronJobs:i,sessionProjectRoot:a,sessionWorkingDir:o}){let s=ic();return e.kind===`overview`?(0,F.jsx)($Z,{childSessionTabs:t,sessionCronJobs:i,sessionKey:r}):e.kind===`project-files`?(0,F.jsx)(tQ,{projectRoot:a,workingDir:o}):e.kind===`child-sessions`?(0,F.jsx)(eQ,{childSessionTabs:t}):e.kind===`side-chat-draft`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(iQ,{}),(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,F.jsx)(kZ,{materializationContext:{kind:`child`,parentSessionKey:e.draft.parentSessionKey,inheritContext:!0},sessionKey:null,showWelcomeForDraft:!1,onSessionMaterialized:t=>s.chatThreadManager.materializeSideChatDraft({draftKey:e.draft.draftKey,sessionKey:t})})})]}):e.kind===`child-session`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(rQ,{tab:e.tab}),(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,F.jsx)(kZ,{sessionKey:e.tab.sessionKey})})]}):e.kind===`file`?(0,F.jsx)(mG,{file:e.file,refreshVersion:n,sessionProjectRoot:a,sessionWorkingDir:o,onFileOpen:s.chatThreadManager.openFilePreview}):(0,F.jsx)(ZZ,{jobs:i})}function oQ({sessionKey:e,childSessionTabs:t,activeChildSessionKey:n,activeSideChatDraft:r,workspaceFileTabs:i,activeWorkspaceFileKey:a,closedWorkspaceTabEntries:o,workspaceNavigationHistory:s=[],workspaceNavigationHistoryIndex:c=0,activePanelKind:l,sessionCronJobs:u=[],sessionProjectRoot:d,sessionWorkingDir:f,workspacePanelWidth:p=480,displayMode:h=`docked`}){let g=ic(),_=pe(),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(0),S=Vu(t),C=I(e=>e.optimisticReadAtBySessionKey),w=qu({activeChildSessionKey:n,activeSideChatDraft:r,activeWorkspaceFileKey:a,activePanelKind:l,childSessionTabs:S,workspaceFileTabs:i}),T={entries:s,index:c};(0,P.useEffect)(()=>{g.chatThreadManager.syncVisibleWorkspaceSelection(w)},[w,g]);let E=(0,P.useMemo)(()=>Xu({resolvedChildTabs:S,activeSideChatDraft:r,closedWorkspaceTabEntries:o,workspaceFileTabs:i,activeSelection:w,optimisticReadAtBySessionKey:C,onSelectSession:g.chatThreadManager.selectChildSessionDetail,onSelectFile:g.chatThreadManager.selectWorkspaceFile,onOpenFileViewer:g.chatThreadManager.openWorkspaceFileViewer,onCloseTab:g.chatThreadManager.closeWorkspaceTab,onSelectOverview:()=>{e&&g.chatThreadManager.openWorkspaceOverview(e)},onSelectChildSessions:()=>{e&&g.chatThreadManager.openChildSessions(e)},onSelectProjectFiles:()=>{e&&g.chatThreadManager.openProjectFiles(e)},onSelectCronJobs:()=>{e&&g.chatThreadManager.openSessionCronPanel(e)}}),[w,r,o,C,g.chatThreadManager,S,e,i]);if(!w)return null;let D=h===`docked`&&v,O=h===`overlay`||D,k=w.kind===`file`&&w.file.viewMode===`preview`?w.file:null,A=k?()=>{_.invalidateQueries({queryKey:iG({path:k.path,basePath:f})}),_.invalidateQueries({queryKey:qs({path:k.path,basePath:f,includeFiles:!0})}),x(e=>e+1)}:void 0;return(0,F.jsxs)(vt,{"data-testid":`chat-session-workspace-panel`,className:m(O?`bg-white`:`hidden border-gray-200/70 bg-white/95 backdrop-blur-sm md:flex`,D?`shadow-xl`:null),defaultWidth:p,width:p,minWidth:360,maxWidth:860,onWidthCommit:g.chatThreadManager.setWorkspacePanelWidth,overlay:O,overlayScope:D?`container`:`viewport`,children:[(0,F.jsx)(th,{tabs:E,canGoBack:iu(T),canGoForward:au(T),isMaximized:D,onGoBack:g.chatThreadManager.goBackWorkspacePanel,onGoForward:g.chatThreadManager.goForwardWorkspacePanel,onRefreshFile:A,onToggleMaximize:h===`docked`?()=>y(e=>!e):void 0,onClose:g.chatThreadManager.closeWorkspacePanel}),(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-white`,children:(0,F.jsx)(aQ,{activeSelection:w,childSessionTabs:S,filePreviewRefreshVersion:b,sessionKey:e,sessionCronJobs:u,sessionProjectRoot:d,sessionWorkingDir:f})})]})}var sQ=[];function cQ(e,t){let n=Rl(e=>e.snapshot.sessionsQuery?.data?.sessions??sQ),r=(0,P.useMemo)(()=>{let r=e.childSessionTabs.filter(e=>e.parentSessionKey===t),i=new Set(r.map(e=>e.sessionKey));return[...r,...Jc(n).filter(e=>e.parentSessionId===t&&!i.has(e.key)).map(e=>({sessionKey:e.key,parentSessionKey:t}))]},[t,n,e.childSessionTabs]),i=(0,P.useMemo)(()=>e.workspaceFileTabs.filter(e=>e.parentSessionKey===t),[t,e.workspaceFileTabs]),a=e.activeSideChatDraft?.parentSessionKey===t?e.activeSideChatDraft:null,o=AZ({all:!0});return{childSessionTabs:r,activeSideChatDraft:a,workspaceFileTabs:i,sessionCronJobs:(0,P.useMemo)(()=>(o.data?.jobs??[]).filter(e=>GZ(e,t)),[o.data?.jobs,t]),showWorkspacePanel:e.workspacePanelParentKey===t&&e.activeWorkspacePanelKind!=null}}function lQ({layoutMode:e,sessionKey:t}){let n=L(e=>e.snapshot),r=Jl(t),{childSessionTabs:i,activeSideChatDraft:a,workspaceFileTabs:o,sessionCronJobs:s,showWorkspacePanel:c}=cQ(n,t);return c?(0,F.jsx)(oQ,{sessionKey:t,childSessionTabs:i,activeChildSessionKey:n.activeChildSessionKey??null,activeSideChatDraft:a,workspaceFileTabs:o,activeWorkspaceFileKey:n.activeWorkspaceFileKey??null,closedWorkspaceTabEntries:n.closedWorkspaceTabEntries,workspaceNavigationHistory:n.workspaceNavigationHistory,workspaceNavigationHistoryIndex:n.workspaceNavigationHistoryIndex,activePanelKind:n.activeWorkspacePanelKind??null,sessionCronJobs:s,sessionProjectRoot:r?.projectRoot??null,sessionWorkingDir:r?.workingDir??r?.projectRoot??null,workspacePanelWidth:n.workspacePanelWidth,displayMode:e===`mobile`?`overlay`:`docked`}):null}function uQ({layoutMode:e=`desktop`,onBackToList:t}){let n=ic(),r=ql(),i=I(e=>e.snapshot.selectedSessionKey),a=(0,P.useCallback)(e=>{n.chatUiManager.isAtChatRoot()&&n.chatUiManager.goToSession(e,{replace:!0})},[n]);return r?(0,F.jsxs)(`section`,{className:`relative flex-1 min-h-0 flex overflow-hidden bg-background`,children:[(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,F.jsx)(Lu,{}),(0,F.jsx)(Iu,{layoutMode:e,onBackToList:t}),(0,F.jsx)(kZ,{consumeDraftIntent:!0,sessionKey:i,onSessionMaterialized:a})]}),(0,F.jsx)(lQ,{layoutMode:e,sessionKey:i})]}):(0,F.jsx)(zu,{})}function dQ(){let e=Hs(),[t,n]=(0,P.useState)(null),[r,i]=(0,P.useState)(``),[a,o]=(0,P.useState)(null),s=e=>{n(e.key),i(e.label?.trim()??``)},c=()=>{n(null),i(``),o(null)};return{editingSessionKey:t,draftLabel:r,savingSessionKey:a,setDraftLabel:i,startEditingSessionLabel:s,cancelEditingSessionLabel:c,saveSessionLabel:async t=>{let n=r.trim();if(n===(t.label?.trim()??``)){c();return}o(t.key);try{await e({sessionKey:t.key,label:n||null}),c()}catch{o(null)}}}}var fQ=`nextclaw.ui.theme`,pQ=`work`,mQ=[{value:`work`,labelKey:`themeWork`,appearance:`light`},{value:`night`,labelKey:`themeNight`,appearance:`dark`},{value:`natural`,labelKey:`themeNatural`,appearance:`light`},{value:`minimal`,labelKey:`themeMinimal`,appearance:`light`},{value:`warm`,labelKey:`themeWarm`,appearance:`light`},{value:`cool`,labelKey:`themeCool`,appearance:`light`},{value:`dawn`,labelKey:`themeDawn`,appearance:`light`},{value:`graphite`,labelKey:`themeGraphite`,appearance:`light`},{value:`probe`,labelKey:`themeProbe`,appearance:`light`}],hQ=mQ.map(({value:e})=>e),gQ=mQ.map(({value:e,labelKey:t})=>({value:e,labelKey:t}));function _Q(e){return typeof e==`string`?hQ.includes(e)?e:e===`leaf`?`warm`:null:null}function vQ(e){return mQ.find(t=>t.value===e)?.appearance??`light`}var yQ=new class{constructor(){this.activeTheme=pQ,this.initialized=!1,this.listeners=new Set,this.resolveInitialTheme=()=>{if(typeof window>`u`)return pQ;try{let e=_Q(window.localStorage.getItem(fQ));if(e)return e}catch{}return pQ},this.initializeTheme=()=>(this.initialized||=(this.activeTheme=this.resolveInitialTheme(),this.applyThemeAttribute(this.activeTheme),!0),this.activeTheme),this.getTheme=()=>this.initialized?this.activeTheme:this.initializeTheme(),this.setTheme=e=>{this.initializeTheme(),e!==this.activeTheme&&(this.activeTheme=e,this.applyThemeAttribute(this.activeTheme),this.saveTheme(this.activeTheme),this.listeners.forEach(e=>e(this.activeTheme)))},this.subscribeThemeChange=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.applyThemeAttribute=e=>{if(typeof document>`u`)return;let t=vQ(e);document.documentElement.setAttribute(`data-theme`,e),document.documentElement.setAttribute(`data-theme-appearance`,t),document.documentElement.style.colorScheme=t},this.saveTheme=e=>{if(!(typeof window>`u`))try{window.localStorage.setItem(fQ,e)}catch{}}}};function bQ(){return yQ.initializeTheme()}function xQ(){return yQ.getTheme()}function SQ(e){yQ.setTheme(e)}function CQ(e){return yQ.subscribeThemeChange(e)}var wQ=`nextclaw-pwa-install-banner-dismissed`,TQ=`nextclaw-pwa-install-banner-dismissed-until`;function EQ(){let e=kQ();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:AQ(e):!1}function DQ(){let e=kQ();e?.setItem(wQ,`1`),e?.removeItem(TQ)}function OQ(){let e=kQ();e?.removeItem(wQ),e?.removeItem(TQ)}function kQ(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function AQ(e){let t=e.getItem(TQ);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(TQ),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(wQ,`1`),!0)}function jQ(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:EQ()}}var MQ=p(()=>jQ()),NQ=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),MQ.setState(jQ())},this.refreshState=()=>{let e=this.resolveInstallability();MQ.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:EQ()}))},this.dismissInstallPrompt=()=>{DQ(),MQ.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(OQ(),this.refreshState(),D.success(f(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,OQ(),MQ.setState({dismissedInstallPrompt:!0}),D.success(f(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}};function PQ(){let e=MQ(e=>e.installability);return(0,F.jsx)(`span`,{className:m(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:FQ(e)})}function FQ(e){return f(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function IQ(e,t,n){return f(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function LQ(){let e=MQ(e=>e.installability),t=MQ(e=>e.installMethod),n=MQ(e=>e.blockedReason);return(0,F.jsxs)(A,{children:[(0,F.jsxs)(T,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(k,{children:f(`pwaInstallTitle`)}),(0,F.jsx)(S,{children:f(`pwaInstallDescription`)})]}),(0,F.jsx)(PQ,{})]}),(0,F.jsxs)(j,{className:`space-y-4`,children:[(0,F.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,F.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:IQ(e,t,n)})}),e===`available`&&t===`prompt`?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsxs)(w,{type:`button`,className:`gap-2`,onClick:()=>{NQ.promptInstall()},children:[(0,F.jsx)(tn,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,F.jsx)(`p`,{className:`text-sm text-gray-500`,children:f(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,F.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,F.jsx)(rs,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,F.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:f(`pwaInstallManualHint`)})]}):null]})]})}function RQ(){let e=MQ(e=>e.installability),t=MQ(e=>e.installMethod),n=MQ(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,F.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:f(`pwaInstallBannerTitle`)}),(0,F.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:f(`pwaInstallBannerDescription`)})]}),(0,F.jsx)(`button`,{type:`button`,"aria-label":f(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{NQ.dismissInstallPrompt()},children:(0,F.jsx)(Cn,{className:`h-4 w-4`})})]}),(0,F.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,F.jsxs)(w,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{NQ.promptInstall()},children:[(0,F.jsx)(tn,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,F.jsx)(w,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{NQ.dismissInstallPrompt()},children:f(`pwaInstallDismiss`)})]})]})}var zQ=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},BQ=!1;function VQ(){BQ||typeof window>`u`||(BQ=!0,NQ.start(),zQ.start())}var HQ={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,probe:`#FEFCF6`},UQ=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=HQ[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=vQ(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(_Q(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}},WQ=(0,P.createContext)(null);function GQ({children:e}){let[t,n]=(0,P.useState)(()=>bQ());(0,P.useEffect)(()=>{UQ.syncTheme(t)},[t]),(0,P.useEffect)(()=>CQ(e=>{n(e)}),[]);let r=(0,P.useCallback)(e=>{SQ(e),n(xQ())},[]),i=(0,P.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,F.jsx)(WQ.Provider,{value:i,children:e})}function KQ(){let e=(0,P.useContext)(WQ);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function qQ({sessionKey:e,draftLabel:t,isSaving:n,onDraftLabelChange:r,onSave:i,onCancel:a}){return(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(ae,{value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),i()):e.key===`Escape`&&(e.preventDefault(),a())},placeholder:f(`sessionsLabelPlaceholder`),className:`h-8 rounded-lg border-gray-300 bg-white text-xs`,autoFocus:!0,disabled:n}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`div`,{className:`min-w-0 text-[11px] text-gray-400 truncate`,children:e}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(ht,{icon:(0,F.jsx)(qt,{className:`h-3.5 w-3.5`}),label:f(`save`),tooltip:!1,onClick:()=>void i(),disabled:n}),(0,F.jsx)(ht,{icon:(0,F.jsx)(Cn,{className:`h-3.5 w-3.5`}),label:f(`cancel`),tooltip:!1,onClick:a,disabled:n})]})]})]})}function JQ({active:e,showUnreadDot:t,runStatus:n,context:r,isPinned:i,title:a,previewText:o,trailingText:s,agentId:c,agentLabel:l,agentAvatarUrl:u,childSessionCount:d=0,onSelect:p,onOpenChildSessions:h,onStartEditing:g,onTogglePinned:_}){return(0,F.jsxs)(`div`,{className:`group/session relative`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:p,className:`w-full text-left`,children:[(0,F.jsx)(`div`,{className:m(`flex min-h-6 min-w-0 items-center`,d>0&&h?`pr-20`:`pr-12`),children:(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[c?.trim()&&c.trim().toLowerCase()!==`main`?(0,F.jsx)(ku,{agentId:c,displayName:l,avatarUrl:u,className:`h-5 w-5 shrink-0`}):null,(0,F.jsx)(`span`,{className:`truncate leading-6 font-medium`,children:a}),r.label?(0,F.jsx)(`span`,{className:m(`shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-semibold leading-none`,e?`border-gray-300 bg-white/80 text-gray-700`:`border-gray-200 bg-gray-100 text-gray-500`),children:r.label}):null,r.icon?(0,F.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:(0,F.jsx)(Cl,{icon:r.icon,className:e?`text-gray-700`:`text-gray-500`})}):null]})}),(0,F.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[11px] text-gray-400`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:o}),t?(0,F.jsx)(`span`,{"aria-label":f(`chatSessionUnread`),className:`ml-auto h-2 w-2 shrink-0 rounded-full bg-primary`}):(0,F.jsx)(`span`,{className:`ml-auto shrink-0`,children:s})]})]}),d>0&&h?(0,F.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),h()},className:`pointer-events-none absolute right-12 top-0 inline-flex h-6 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium text-muted-foreground opacity-0 transition-colors hover:bg-black/10 hover:text-foreground group-hover/session:pointer-events-auto group-hover/session:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"aria-label":f(`chatSessionOpenChildSessions`),title:f(`chatSessionOpenChildSessions`),children:[(0,F.jsx)(To,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:d})]}):null,n?(0,F.jsx)(`span`,{className:`absolute right-0 top-0 inline-flex h-6 w-6 items-center justify-center transition-opacity group-hover/session:opacity-0`,children:(0,F.jsx)(Tl,{status:n})}):null,(0,F.jsxs)(`div`,{className:`pointer-events-none absolute right-0 top-0 flex h-6 items-center gap-0.5 opacity-0 transition-opacity group-hover/session:pointer-events-auto group-hover/session:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100`,children:[(0,F.jsx)(ht,{size:`sm`,tone:`strong`,icon:(0,F.jsx)(_t,{className:m(`h-3.5 w-3.5`,i&&`fill-current text-foreground`)}),label:f(i?`chatSidebarUnpinSession`:`chatSidebarPinSession`),tooltipSide:`right`,onClick:e=>{e.stopPropagation(),_()}}),(0,F.jsx)(ht,{size:`sm`,tone:`strong`,icon:(0,F.jsx)(qo,{className:`h-3.5 w-3.5`}),label:f(`edit`),tooltipSide:`right`,onClick:e=>{e.stopPropagation(),g()}})]})]})}function YQ({sessionKey:e,active:t,showUnreadDot:n,runStatus:r,context:i,isPinned:a,title:o,previewText:s,trailingText:c,agentId:l,agentLabel:u,agentAvatarUrl:d,childSessionCount:f,isEditing:p,draftLabel:h,isSaving:g,onSelect:_,onOpenChildSessions:v,onStartEditing:y,onDraftLabelChange:b,onSave:x,onCancel:S,onTogglePinned:C}){return(0,F.jsx)(`div`,{className:m(`w-full rounded-xl px-3 py-2.5 text-left transition-all text-[13px]`,t?`bg-gray-200/80 text-gray-900 font-semibold shadow-sm`:`text-gray-700 hover:bg-gray-200/60 hover:text-gray-900`),children:p?(0,F.jsx)(qQ,{sessionKey:e,draftLabel:h,isSaving:g,onDraftLabelChange:b,onSave:x,onCancel:S}):(0,F.jsx)(JQ,{active:t,showUnreadDot:n,runStatus:r,context:i,isPinned:a,title:o,previewText:s,trailingText:c,agentId:l,agentLabel:u,agentAvatarUrl:d,onSelect:_,childSessionCount:f,onOpenChildSessions:v,onStartEditing:y,onTogglePinned:C})})}function XQ(e){let{item:t,selectedSessionKey:n,optimisticReadAtBySessionKey:r,agentsById:i,childSessionsByParentKey:a,editingSessionKey:o,draftLabel:s,savingSessionKey:c,sessionTypeOptions:l,isPinned:u,sessionTitle:d,onSelectSession:f,onOpenChildSessions:p,onStartEditingSessionLabel:m,onDraftLabelChange:h,onSaveSessionLabel:g,onCancelEditingSessionLabel:_,onTogglePinned:v}=e,{session:y,runStatus:b}=t,x=n===y.key,S=r[y.key],C=S&&y.readAt?S.localeCompare(y.readAt)>0?S:y.readAt:S??y.readAt,w=a.get(y.key)??[],T=y.agentId?i.get(y.agentId)?.displayName??y.agentId:null,E=oc(y)??`${T?.trim()?`${T} · `:``}${y.messageCount}`;return(0,F.jsx)(YQ,{sessionKey:y.key,active:x,showUnreadDot:tl({active:x,lastMessageAt:y.lastMessageAt,readAt:C,runStatus:b}),runStatus:b,context:yl(y,l),isPinned:u,title:d(y),previewText:E,trailingText:uc(y.lastMessageAt??y.createdAt),agentId:y.agentId??null,agentLabel:T,agentAvatarUrl:y.agentId?i.get(y.agentId)?.avatarUrl??null:null,childSessionCount:w.length,isEditing:o===y.key,draftLabel:s,isSaving:c===y.key,onSelect:()=>f(y.key),onOpenChildSessions:()=>p(y.key,w[0]?.session.key??null),onStartEditing:()=>m(y),onDraftLabelChange:h,onSave:()=>g(y),onCancel:_,onTogglePinned:v})}var ZQ={maxHeight:We(`18rem`)};function QQ({className:e,onSelect:t,options:n,selectedSessionType:r,title:i=f(`chatSessionTypeLabel`),titleClassName:a}){return(0,F.jsxs)(`div`,{className:m(`space-y-1 overflow-y-auto overscroll-contain`,e),style:ZQ,children:[(0,F.jsx)(`div`,{className:m(`px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.18em] text-gray-400`,a),children:i}),n.map(e=>(0,F.jsx)(hY,{disabled:e.ready===!1,option:e,selected:e.value===r,onSelect:()=>t(e.value)},e.value))]})}var $Q=`w-[56px]`,e$=`px-2`,t$=`h-9 w-9 rounded-xl`,n$=`h-4 w-4`,r$=`space-y-1`,i$=`gap-1`,a$=`[mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)] [-webkit-mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)]`,o$=`text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 active:bg-gray-200/80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,s$=`bg-gray-200/80 text-gray-900`,c$=`brandSoft`,l$={neutralSurface:{leftVariant:`ghost`,leftClassName:`bg-card text-foreground shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-accent-foreground hover:shadow-sm active:bg-accent`,rightClassName:`bg-card text-muted-foreground shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-accent-foreground hover:shadow-sm active:bg-accent`},brandSoft:{leftVariant:`ghost`,leftClassName:`bg-primary/10 text-primary shadow-none ring-1 ring-primary/10 transition-[background-color,color,box-shadow] hover:bg-primary/15 hover:text-primary-700 hover:shadow-sm active:bg-primary/20`,rightClassName:`bg-primary/10 text-primary shadow-none ring-1 ring-primary/10 transition-[background-color,color,box-shadow] hover:bg-primary/15 hover:text-primary-700 hover:shadow-sm active:bg-primary/20`},brandTextSurface:{leftVariant:`ghost`,leftClassName:`bg-card text-primary shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-primary-700 hover:shadow-sm active:bg-primary/15`,rightClassName:`bg-card text-primary shadow-none transition-[background-color,color,box-shadow] hover:bg-accent hover:text-primary-700 hover:shadow-sm active:bg-primary/15`},brandSolid:{leftVariant:`primary`,leftClassName:``,rightClassName:`bg-primary text-primary-foreground shadow-sm hover:bg-primary-600 hover:text-primary-foreground active:bg-primary-700`}};function u$(e){let t=e.sessionTypeOptions.find(t=>t.value===e.defaultSessionType);return[...t?[t]:[],...e.nonDefaultSessionTypeOptions]}function d$({option:e}){return e?.icon?.src?(0,F.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,F.jsx)(Cl,{icon:{kind:`runtime-image`,src:e.icon.src,alt:e.icon.alt??null,name:e.label},className:`h-4 w-4`})}):(0,F.jsx)(Ya,{className:`h-4 w-4 shrink-0`})}function f$(e){let{query:t,selectedNewSessionType:n,selectedNewSessionTypeOption:r,sessionTypeOptions:i,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:s,onSelectNewSessionType:c,onQueryChange:l,collapsed:u=!1}=e,d=i.length>1,p=l$[c$];return u?(0,F.jsx)(`div`,{className:`px-2 pb-2`,children:(0,F.jsxs)(`div`,{className:m(`flex flex-col items-center`,i$),children:[(0,F.jsx)(ht,{icon:(0,F.jsx)(vn,{className:n$}),label:f(`chatSidebarNewTask`),className:m(t$,o$),onClick:()=>{o(!1),s(n)}}),d?(0,F.jsxs)(Ze,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(ht,{icon:(0,F.jsx)(d$,{option:r}),label:f(`chatSessionTypeLabel`),className:m(t$,o$)})}),(0,F.jsx)(Ye,{align:`start`,side:`right`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,F.jsx)(QQ,{options:i,selectedSessionType:n,onSelect:e=>{c(e),o(!1)}})})]}):null]})}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`px-4 pb-3`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(w,{variant:p.leftVariant,className:m(`min-w-0 rounded-xl`,p.leftClassName,d?`flex-1 rounded-r-md`:`w-full`),onClick:()=>{o(!1),s(n)},children:[(0,F.jsx)(vn,{className:`mr-2 h-4 w-4`}),f(`chatSidebarNewTask`)]}),d?(0,F.jsxs)(Ze,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(ht,{icon:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,F.jsx)(d$,{option:r}),(0,F.jsx)(Et,{className:`h-3 w-3 opacity-60`})]}),label:f(`chatSessionTypeLabel`),tooltip:f(`chatSessionTypeLabel`),className:m(`h-9 w-12 shrink-0 rounded-xl rounded-l-md`,p.rightClassName)})}),(0,F.jsx)(Ye,{align:`end`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,F.jsx)(QQ,{options:i,selectedSessionType:n,onSelect:e=>{c(e),o(!1)}})})]}):null]})}),(0,F.jsx)(`div`,{className:`px-4 pb-3`,children:(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(st,{className:`pointer-events-none absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground/70`}),(0,F.jsx)(ae,{value:t,onChange:e=>l(e.target.value),placeholder:f(`chatSidebarSearchPlaceholder`),className:`h-9 rounded-lg pl-8 text-xs`})]})})]})}function p$(e){let{query:t,defaultSessionType:n,sessionTypeOptions:r,nonDefaultSessionTypeOptions:i,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:s,onQueryChange:c}=e,l=u$({defaultSessionType:n,sessionTypeOptions:r,nonDefaultSessionTypeOptions:i}),u=l.length>1;return(0,F.jsx)(`div`,{className:`px-4 pb-2 pt-1`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,F.jsx)(st,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,F.jsx)(ae,{value:t,onChange:e=>c(e.target.value),placeholder:f(`chatSidebarSearchPlaceholder`),className:`h-9 rounded-full border-transparent bg-muted pl-9 pr-3 text-[13px] shadow-none focus:border-border focus:bg-card`})]}),u?(0,F.jsxs)(Ze,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(ht,{icon:(0,F.jsx)(vn,{className:`h-4 w-4`}),label:f(`chatSidebarNewTask`),tooltip:!1,className:`h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-accent hover:text-accent-foreground`})}),(0,F.jsx)(Ye,{align:`end`,className:`w-60 rounded-3xl border border-border bg-popover p-2 text-popover-foreground shadow-[0_24px_70px_-30px_rgba(15,23,42,0.45)]`,children:(0,F.jsx)(QQ,{options:l,selectedSessionType:n,title:f(`chatSidebarNewTask`),titleClassName:`pb-1.5 text-[11px] font-medium normal-case tracking-normal`,onSelect:e=>{s(e),o(!1)}})})]}):(0,F.jsx)(ht,{icon:(0,F.jsx)(vn,{className:`h-4 w-4`}),label:f(`chatSidebarNewTask`),className:`h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,onClick:()=>s(n)})]})})}function m$(){return E({queryKey:[`app-meta`],queryFn:_,staleTime:1/0})}var h$={healthy:`bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]`,attention:`bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.16)]`,inactive:`bg-muted-foreground/45 shadow-[0_0_0_3px_rgba(156,163,175,0.12)]`};function g$(){let e=ne(),t=e.actionLabel===f(`runtimeStatusRestartAction`),n=()=>{e.tone!==`healthy`&&re.requestRuntimeBootstrapProbeNow()},r=async()=>{if(t)try{let e=await re.runRuntimeControlAction(`restart-service`);D.success(e.message)}catch(e){let t=e instanceof Error?e.message:f(`runtimeControlActionFailed`);D.error(`${f(`runtimeControlActionFailed`)}: ${t}`)}};return(0,F.jsxs)(Ze,{children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,className:`inline-flex items-center justify-center rounded-full p-0.5 transition-transform hover:scale-105`,"aria-label":e.title,title:e.title,"data-testid":`runtime-status-entry`,onClick:n,children:(0,F.jsx)(`span`,{className:m(`h-2.5 w-2.5 rounded-full`,h$[e.tone])})})}),(0,F.jsxs)(Ye,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-border bg-popover p-4 text-popover-foreground`,children:[(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.title}),(0,F.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:e.description})]}),e.reasonLines.length>0?(0,F.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,F.jsx)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-900`,children:e},e))}):null,e.actionLabel?(0,F.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border/70 pt-1`,children:[(0,F.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:f(`runtimeStatusActionHint`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:e.isBusy,className:`text-sm font-semibold text-primary transition-colors hover:text-primary-hover disabled:text-muted-foreground/45`,children:e.isBusy?f(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}function _$({className:e,density:t=`sidebar`,suffix:n}){let{data:r}=m$(),i=r?.name??`NextClaw`,a=r?.productVersion?.trim(),o=a?`v${a}`:null,s=n??(0,F.jsx)(g$,{}),c=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`,l=t===`chrome`;return(0,F.jsxs)(`div`,{className:m(e??`flex min-w-0 items-center gap-2`,c&&`pl-[58px]`),children:[(0,F.jsx)(`div`,{className:m(`flex shrink-0 items-center justify-center overflow-hidden`,`h-6 w-6 rounded-md`),children:(0,F.jsx)(`img`,{src:`/logo.svg`,alt:i,className:`h-full w-full object-contain`})}),(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,F.jsx)(`span`,{className:m(`shrink-0 font-semibold text-gray-800`,l?`text-[15px]`:`text-[14px]`),children:i}),o?(0,F.jsx)(v$,{versionLabel:o,density:t}):null]}),(0,F.jsx)(y$,{}),s?(0,F.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:s}):null]})]})}function v$({versionLabel:e,density:t}){return(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`span`,{tabIndex:0,"aria-label":e,className:m(`block min-w-0 flex-1 truncate font-medium text-gray-500 outline-none`,`text-[12px]`),children:e})}),(0,F.jsx)(yt,{side:`bottom`,className:`text-xs`,children:e})]})})}function y$(){let{supported:e,busyAction:t,snapshot:n}=he();return!e||!n?null:n.status===`downloading`||n.status===`blocked`||n.status===`failed`?(0,F.jsx)(b$,{snapshot:n}):n.status===`downloaded`?(0,F.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-emerald-50 px-2 text-[11px] font-semibold leading-none text-emerald-700 ring-1 ring-emerald-100 transition-colors hover:bg-emerald-100 disabled:opacity-70`,disabled:t===`applying`,onClick:()=>void He.applyDownloadedUpdate(),children:f(t===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)}):n.status===`update-available`?(0,F.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,disabled:t===`downloading`,onClick:()=>void He.downloadUpdate(),children:f(t===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)}):null}function b$({snapshot:e}){if(e.status===`blocked`||e.status===`failed`)return(0,F.jsx)(x$,{snapshot:e});let t=e.status===`downloading`?S$(e):null;return t?(0,F.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,title:f(`updates`),children:t}):null}function x$({snapshot:e}){let t=e.status===`failed`?f(`desktopUpdatesStatusFailed`):f(`desktopUpdatesStatusBlocked`),n=e.recoveryCommand?.trim()||null,r=e.errorMessage?.trim()||e.blockReason?.trim()||null,i=[t,e.status===`blocked`&&e.blockReason?f(`desktopUpdatesBlockedRootCause.${e.blockReason}`):null,r,n].filter(Boolean).join(`
106
+ `);return(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`span`,{role:`img`,"aria-label":t,tabIndex:0,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-50 text-[13px] font-bold leading-none text-amber-700 ring-1 ring-amber-100 outline-none focus-visible:ring-2 focus-visible:ring-amber-300`,children:`!`})}),(0,F.jsx)(yt,{side:`bottom`,className:`max-w-80 whitespace-pre-line break-words text-xs leading-relaxed`,children:i})]})})}function S$(e){let t=e.progress?.percent;return t==null?f(`desktopUpdatesInlineDownloading`):f(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(t))}var C$={connected:{dotClass:`bg-emerald-500`},disconnected:{dotClass:`h-2.5 w-2.5 rounded-full border border-gray-400 bg-transparent`},connecting:{dotClass:`text-amber-600`}};function w$({status:e,className:t}){let n=C$[e],r=f(e===`connected`?`connected`:e===`disconnected`?`disconnected`:`connecting`);return(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`span`,{role:`status`,"aria-label":r,className:m(`inline-flex h-5 w-5 items-center justify-center`,t),children:e===`connecting`?(0,F.jsx)(_n,{className:m(`h-3 w-3 animate-spin`,n.dotClass)}):(0,F.jsx)(`span`,{className:m(e===`connected`?`h-2 w-2 rounded-full`:``,n.dotClass)})})}),(0,F.jsx)(yt,{side:`bottom`,className:`text-xs`,children:r})]})})}function T$({isProjectFirstView:e,onSelectMode:t}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,F.jsx)(`button`,{type:`button`,"aria-pressed":!e,onClick:()=>t(`time-first`),className:m(`transition-colors`,e?`text-muted-foreground/65 hover:text-muted-foreground`:`font-medium text-foreground`),children:f(`chatSidebarViewTime`)}),(0,F.jsx)(`span`,{className:`text-muted-foreground/35`,children:`/`}),(0,F.jsx)(`button`,{type:`button`,"aria-pressed":e,onClick:()=>t(`project-first`),className:m(`transition-colors`,e?`font-medium text-foreground`:`text-muted-foreground/65 hover:text-muted-foreground`),children:f(`chatSidebarViewProject`)})]})}var E$={default:{row:`gap-3 px-3 py-2.5 text-[14px]`,icon:`h-[17px] w-[17px]`,value:`text-xs`,gap:`gap-3`},compact:{row:`gap-2.5 px-3 py-2 text-[13px]`,icon:`h-4 w-4`,value:`text-[11px]`,gap:`gap-2.5`}};function D$(e){return E$[e]}function O$(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function k$({children:e,label:t,side:n=`right`}){return(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:e}),(0,F.jsx)(yt,{side:n,className:`text-xs`,children:t})]})})}function A$({to:e,label:t,icon:n,density:r=`default`,className:i,collapsed:a=!1}){let o=D$(r),{pathname:s}=ii(),c=O$(s,e),l=(0,F.jsxs)(Ea,{to:e,"aria-label":t,"aria-current":c?`page`:void 0,className:m(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,a?m(t$,`justify-center px-0 py-0`):o.row,c?a?s$:`bg-gray-200/80 text-gray-900 shadow-sm`:a?o$:`text-muted-foreground hover:bg-gray-200/60 hover:text-gray-900`,i),children:[(0,F.jsx)(n,{className:m(a?n$:o.icon,`shrink-0 transition-colors`,c?`text-gray-700`:`text-muted-foreground group-hover:text-gray-700`)}),(0,F.jsx)(`span`,{className:a?`sr-only`:`min-w-0 flex-1 text-left`,children:t})]});return a?(0,F.jsx)(k$,{label:t,children:l}):l}function j$({isCollapsed:e,items:t,density:n,className:r}){return(0,F.jsx)(`ul`,{className:r,children:t.map(t=>(0,F.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,F.jsx)(A$,{to:t.target,label:t.label,icon:t.icon,density:n,collapsed:e})},t.target))})}function M$({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:a,trailing:o,trailingClassName:s,testId:c,trailingTestId:l,collapsed:u=!1}){let d=D$(r),f=(0,F.jsxs)(`button`,{type:`button`,onClick:n,"aria-label":e,className:m(`group flex w-full items-center rounded-xl font-medium text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,u?m(t$,`justify-center px-0 py-0`,o$):d.row,i),"data-testid":c,children:[(0,F.jsx)(t,{className:m(u?n$:d.icon,`shrink-0 text-muted-foreground transition-colors group-hover:text-gray-700`)}),(0,F.jsx)(`span`,{className:m(u?`sr-only`:`min-w-0 flex-1 text-left`,a),children:e}),!u&&o?(0,F.jsx)(`span`,{className:m(`shrink-0 text-muted-foreground`,d.value,s),"data-testid":l,children:o}):null]});return u?(0,F.jsx)(k$,{label:e,children:f}):f}function N$({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:a=`default`,children:o,collapsed:s=!1}){let c=D$(a),l=(0,F.jsxs)(It,{"aria-label":e,className:m(`group h-auto w-full rounded-xl border-0 bg-transparent font-medium text-muted-foreground shadow-none hover:bg-gray-200/60 hover:text-gray-900 focus:ring-0 focus-visible:ring-1 focus-visible:ring-border`,s?m(t$,`justify-center px-0 py-0`,o$):c.row),children:[(0,F.jsxs)(`div`,{className:m(`flex min-w-0 items-center`,s?`justify-center`:c.gap),children:[(0,F.jsx)(t,{className:m(s?n$:c.icon,`shrink-0 text-muted-foreground/75 transition-colors group-hover:text-gray-700`)}),(0,F.jsx)(`span`,{className:s?`sr-only`:`text-left`,children:e})]}),s?null:(0,F.jsx)(`span`,{className:m(`ml-auto text-muted-foreground`,c.value),children:r})]});return(0,F.jsxs)(Wt,{value:n,onValueChange:i,children:[s?(0,F.jsx)(k$,{label:`${e}: ${r}`,children:l}):l,(0,F.jsx)(zt,{children:o})]})}function P$(e,t){return t.some(t=>t.value===e)?e:t[0]?.value??e}function F$(e){let{groups:t,defaultSessionType:n,sessionTypeOptions:r,renderSessionItem:i}=e,a=ic(),o=I(e=>e.snapshot.collapsedProjectRoots),[s,c]=(0,P.useState)(null),l=(0,P.useMemo)(()=>P$(n,r),[n,r]),u=r.length>1;return(0,F.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>{let t=`${f(`chatSidebarNewTask`)} · ${e.projectName}`,n=o.includes(e.projectRoot),d=f(e.isPinned?`chatSidebarUnpinProject`:`chatSidebarPinProject`);return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`group/project relative h-10 rounded-lg px-2 text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,F.jsxs)(`button`,{type:`button`,"aria-expanded":!n,"aria-label":f(n?`chatSidebarExpandProject`:`chatSidebarCollapseProject`),className:`flex h-full w-full min-w-0 items-center gap-1.5 pr-14 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>a.chatSessionListManager.toggleProjectCollapsed(e.projectRoot),children:[(0,F.jsx)(an,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wider`,title:e.projectRoot,children:e.projectName}),n?(0,F.jsx)(eo,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):(0,F.jsx)(Et,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/70`,children:e.items.length})]}),(0,F.jsxs)(`div`,{className:`pointer-events-none absolute right-2 top-1/2 flex -translate-y-1/2 items-center opacity-0 transition-opacity group-hover/project:pointer-events-auto group-hover/project:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100`,children:[u?(0,F.jsxs)(Ze,{open:s===e.projectRoot,onOpenChange:t=>{c(t?e.projectRoot:null)},children:[(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(ht,{icon:(0,F.jsx)(vn,{className:`h-3.5 w-3.5`}),label:t})}),(0,F.jsx)(Ye,{align:`end`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,F.jsx)(QQ,{options:r,selectedSessionType:l,onSelect:t=>{a.chatSessionListManager.createSession(t,e.projectRoot),c(null)}})})]}):(0,F.jsx)(ht,{icon:(0,F.jsx)(vn,{className:`h-3.5 w-3.5`}),label:t,onClick:()=>a.chatSessionListManager.createSession(l,e.projectRoot)}),(0,F.jsx)(ht,{icon:(0,F.jsx)(_t,{className:e.isPinned?`h-3.5 w-3.5 fill-current text-foreground`:`h-3.5 w-3.5`}),label:d,tooltipSide:`right`,onClick:()=>a.chatSessionListManager.toggleProjectPinned(e.projectRoot)})]})]}),n?null:(0,F.jsx)(`div`,{className:`mt-0.5 space-y-0.5 pl-2`,children:e.items.map(i)})]},e.projectRoot)})})}function I$({label:e}){return(0,F.jsxs)(`div`,{className:`p-4 text-center`,children:[(0,F.jsx)(zo,{className:`mx-auto mb-2 h-6 w-6 text-muted-foreground/45`}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e})]})}function L$({defaultSessionType:e,groups:t,isLoading:n,isProjectFirstView:r,projectGroups:i,renderSessionItem:a,sessionTypeOptions:o}){return n?(0,F.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:f(`sessionsLoading`)}):r?i.length===0?(0,F.jsx)(I$,{label:f(`chatSidebarProjectViewEmpty`)}):(0,F.jsx)(F$,{groups:i,defaultSessionType:e,sessionTypeOptions:o,renderSessionItem:a}):t.length===0?(0,F.jsx)(I$,{label:f(`sessionsEmpty`)}):(0,F.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`px-2 py-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70`,children:e.label}),(0,F.jsx)(`div`,{className:`space-y-0.5`,children:e.items.map(a)})]},e.label))})}function R$({isOpen:e,onOpenChange:t,currentTheme:n,currentThemeLabel:r,themeOptions:i,onSelectTheme:a,currentLanguage:o,currentLanguageLabel:s,languageOptions:c,onSelectLanguage:l,onOpenDocs:u,onOpenApps:d,collapsed:p=!1}){return(0,F.jsxs)(Ze,{open:e,onOpenChange:t,children:[p?(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":f(`settingsMenu`),className:m(`flex items-center justify-center`,t$,o$),children:(0,F.jsx)(ln,{className:m(n$,`shrink-0 text-muted-foreground`)})})})}),(0,F.jsx)(yt,{side:`right`,className:`text-xs`,children:f(`settingsMenu`)})]})}):(0,F.jsx)(Ke,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":f(`settingsMenu`),className:`flex w-full items-center gap-2.5 rounded-xl px-3 py-2 text-[13px] font-medium text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,F.jsx)(ln,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:f(`settings`)}),(0,F.jsxs)(`span`,{className:`max-w-[112px] truncate text-[13px] text-muted-foreground`,children:[r,` / `,s]})]})}),(0,F.jsxs)(Ye,{side:p?`right`:`top`,align:p?`end`:`start`,className:`w-64 p-2`,children:[(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(Da,{to:`/settings`,onClick:()=>t(!1),className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,F.jsx)(ln,{className:`h-4 w-4 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`flex-1 text-left`,children:f(`settings`)})]}),[{key:`docs`,icon:Tt,label:f(`docBrowserHelp`),action:u},{key:`apps`,icon:ct,label:f(`appsTitle`),action:d}].map(({key:e,icon:n,label:r,action:i})=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{i(),t(!1)},className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,F.jsx)(n,{className:`h-4 w-4 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`flex-1 text-left`,children:r})]},e))]}),(0,F.jsx)(`div`,{className:`my-2 h-px bg-border`}),(0,F.jsx)(z$,{icon:Ho,label:f(`theme`),options:i,value:n,valueLabel:r,onSelect:a,onCloseMenu:()=>t(!1)}),(0,F.jsx)(z$,{icon:Ao,label:f(`language`),options:c,value:o,valueLabel:s,onSelect:l,onCloseMenu:()=>t(!1)})]})]})}function z$({icon:e,label:t,options:n,value:r,valueLabel:i,onSelect:a,onCloseMenu:o}){return(0,F.jsxs)(Wt,{value:r,onOpenChange:e=>{e||o()},onValueChange:e=>a(e),children:[(0,F.jsxs)(It,{"aria-label":t,className:`h-auto w-full rounded-lg border-0 bg-transparent px-3 py-2 text-[13px] font-medium text-foreground shadow-none hover:bg-gray-200/60 hover:text-gray-900 focus:ring-0`,indicator:(0,F.jsx)(eo,{className:`h-4 w-4 text-muted-foreground/70`}),children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,F.jsx)(e,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`text-left`,children:t})]}),(0,F.jsx)(`span`,{className:`ml-auto max-w-[96px] truncate text-[13px] text-muted-foreground`,children:i})]}),(0,F.jsx)(zt,{side:`right`,align:`center`,sideOffset:6,className:`z-[var(--z-tooltip)] min-w-[7rem] rounded-lg`,viewportClassName:`h-auto min-w-[7rem] w-auto`,children:n.map(e=>(0,F.jsx)(Ht,{value:e.value,className:`text-[13px]`,children:e.label},e.value))})]})}var B$=p(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),V$=new class{constructor(){this.start=async()=>{let e=this.getDesktopApi();if(!e){this.markUnsupported();return}B$.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let t=await e.getPresenceState();B$.setState({supported:!0,initialized:!0,busyAction:null,snapshot:t})}catch(e){B$.setState({supported:!0,initialized:!0,busyAction:null}),D.error(`${f(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.markUnsupported=()=>{B$.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async e=>{let t=this.getDesktopApi();if(!t)throw Error(f(`runtimePresenceLaunchAtLoginUnavailable`));B$.setState({busyAction:`saving-preferences`});try{let n=await t.updatePresencePreferences(e);return B$.setState({supported:!0,initialized:!0,snapshot:n}),D.success(f(`runtimePresenceSaved`)),n}catch(e){throw D.error(`${f(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(e)}`),e}finally{B$.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:f(`error`)}},H$=p(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null}));new class{constructor(){this.unsubscribe=null,this.subscriptionCount=0,this.start=async()=>{this.subscriptionCount+=1;let e=this.getDesktopApi();if(!e){H$.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=e.onUpdateStateChanged(e=>{H$.setState({supported:!0,initialized:!0,snapshot:e})}),H$.setState({supported:!0,initialized:!1});try{let t=await e.getUpdateState();H$.setState({supported:!0,initialized:!0,snapshot:t})}catch(e){H$.setState({supported:!0,initialized:!0}),D.error(`${f(`desktopUpdatesLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.stop=()=>{this.subscriptionCount=Math.max(0,this.subscriptionCount-1),!(this.subscriptionCount>0)&&(this.unsubscribe?.(),this.unsubscribe=null)},this.checkForUpdates=async()=>{let e;try{e=await this.runSnapshotCommand(`checking`,f(`desktopUpdatesCheckFailed`),async e=>await e.checkForUpdates())}catch{return}if(e.status===`up-to-date`){D.success(f(`desktopUpdatesAlreadyLatest`));return}if(e.status===`update-available`){D.success(f(`desktopUpdatesAvailable`).replace(`{version}`,e.availableVersion??f(`desktopUpdatesUnknownVersion`)));return}if(e.status===`downloaded`){D.success(f(`desktopUpdatesReadyToApply`));return}e.status===`failed`&&e.errorMessage&&D.error(e.errorMessage)},this.downloadUpdate=async()=>{let e;try{e=await this.runSnapshotCommand(`downloading`,f(`desktopUpdatesDownloadFailed`),async e=>await e.downloadUpdate())}catch{return}e.status===`downloaded`&&D.success(f(`desktopUpdatesReadyToApply`))},this.applyDownloadedUpdate=async()=>{try{await this.runSnapshotCommand(`applying`,f(`desktopUpdatesApplyFailed`),async e=>await e.applyDownloadedUpdate())}catch{return}},this.updatePreferences=async e=>{try{await this.runSnapshotCommand(`saving-preferences`,f(`desktopUpdatesPreferencesFailed`),async t=>await t.updatePreferences(e))}catch{return}},this.updateChannel=async e=>{if(H$.getState().snapshot?.channel===e)return;let t;try{t=await this.runSnapshotCommand(`switching-channel`,f(`desktopUpdatesChannelChangeFailed`),async t=>await t.updateChannel(e))}catch{return}if(t.status===`update-available`&&t.availableVersion){D.success(f(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(e)).replace(`{version}`,t.availableVersion));return}D.success(f(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(e)))},this.runSnapshotCommand=async(e,t,n)=>{let r=this.getDesktopApi();if(!r)throw Error(f(`desktopUpdatesDesktopOnlyDescription`));H$.setState({busyAction:e});try{let e=await n(r);return H$.setState({snapshot:e}),e}catch(e){throw D.error(`${t}: ${this.getErrorMessage(e)}`),e}finally{H$.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:f(`error`),this.getChannelLabel=e=>f(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}};function U$(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function W$(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)}function G$(e){let t=e.toLowerCase();return t.startsWith(`/chat/`)&&t!==`/chat`}function K$(e){return[{target:`/chat`,label:e(`chat`),icon:Lo},{target:`/skills`,label:e(`marketplaceFilterSkills`),icon:Za},{target:`/agents`,label:e(`agentsPageTitle`),icon:Ya},{target:`/settings`,label:e(`settings`),icon:ln}]}function q$(e){return[{target:`/chat`,label:e(`chat`),icon:Lo},{target:`/chat/cron`,label:e(`cron`),icon:Wa},{target:`/chat/skills`,label:e(`marketplaceFilterSkills`),icon:Za},{target:`/agents`,label:e(`agentsPageTitle`),icon:Ya}]}function J$(e){return[{target:`/model`,label:e(`model`),icon:lo},{target:`/providers`,label:e(`providers`),icon:bn},{target:`/channels`,label:e(`channels`),icon:dn},{target:`/search`,label:e(`searchChannels`),icon:st},{target:`/appearance`,label:e(`appearance`),icon:Ho},{target:`/security`,label:e(`security`),icon:ns},{target:`/runtime`,label:e(`runtime`),icon:lo},{target:`/updates`,label:e(`updates`),icon:tn},{target:`/remote`,label:e(`remote`),icon:ds},{target:`/secrets`,label:e(`secrets`),icon:pn},{target:`/marketplace/mcp`,label:e(`marketplaceFilterMcp`),icon:ps}]}function Y$(e){let t=J$(e);return[{label:e(`settingsGroupBasic`),items:t.slice(0,3)},{label:e(`settingsGroupAdvanced`),items:t.slice(3)}]}function X$(e){return[{target:`/language`,label:e(`language`),icon:Ao},...J$(e)]}function Z$(e){let t=e.toLowerCase();return t===`/settings`?!0:X$(e=>e).some(e=>U$(t,e.target))}function Q$(e,t){let n=e.toLowerCase(),r=X$(t);if(G$(n))return{title:t(`chat`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/chat`)return{title:t(`chat`),backTarget:null,backLabel:null};if(n===`/skills`||n.startsWith(`/skills/`))return{title:t(`marketplaceFilterSkills`),backTarget:null,backLabel:null};if(n===`/agents`||n.startsWith(`/agents/`))return{title:t(`agentsPageTitle`),backTarget:null,backLabel:null};if(n===`/settings`)return{title:t(`settings`),backTarget:null,backLabel:null};for(let e of r)if(U$(n,e.target))return{title:e.label,backTarget:`/settings`,backLabel:t(`settings`)};return{title:t(`settings`),backTarget:null,backLabel:null}}function $$(){let{language:e,setLanguage:t}=Qt();return{currentLanguage:e,currentLanguageLabel:s.find(t=>t.value===e)?.label??e,languageOptions:s,selectLanguage:(0,P.useCallback)(n=>{e!==n&&(t(n),window.location.reload())},[e,t])}}function e1(){let{currentLanguage:e,currentLanguageLabel:t,languageOptions:n,selectLanguage:r}=$$();return(0,F.jsxs)(`section`,{className:`mx-auto w-full max-w-3xl space-y-4`,children:[(0,F.jsx)(`div`,{className:`rounded-3xl border border-gray-200/80 bg-white p-5 shadow-card`,children:(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-gray-100 text-gray-600`,children:(0,F.jsx)(Ao,{className:`h-4 w-4`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:f(`language`)}),(0,F.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:t})]})]})}),(0,F.jsx)(`div`,{className:`overflow-hidden rounded-3xl border border-gray-200/80 bg-white shadow-card`,children:n.map(t=>{let n=t.value===e;return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(t.value),className:m(`flex w-full items-center justify-between gap-3 border-b border-gray-100 px-5 py-4 text-left text-sm transition-colors last:border-b-0`,n?`bg-gray-50 text-gray-900`:`text-gray-700 hover:bg-gray-50/70`),"aria-current":n?`true`:void 0,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:t.label}),n?(0,F.jsx)(qt,{className:`h-4 w-4 text-gray-700`}):null]},t.value)})})]})}function t1(e,t){if(!e)return{items:q$(t),density:`default`};let n=Y$(t);return{items:n.flatMap(e=>e.items),sections:n,density:`compact`}}function n1({isCollapsed:e,onToggle:t}){let n=f(e?`sidebarExpand`:`sidebarCollapse`);return(0,F.jsx)(ht,{icon:(0,F.jsx)(e?Wo:Uo,{className:n$}),label:n,className:m(o$,e&&`h-9 w-9 rounded-xl`),onClick:t})}function r1({isCollapsed:e,onToggle:t}){return(0,F.jsx)(`div`,{className:m(`shrink-0`,e?`px-0 py-1.5`:`px-2 py-2`),children:(0,F.jsxs)(`div`,{className:m(`flex items-center py-1`,e?m(`flex-col px-0`,i$):`gap-2 px-1`),"data-testid":`settings-sidebar-header`,children:[e?(0,F.jsx)(n1,{isCollapsed:e,onToggle:t}):null,(0,F.jsxs)(Da,{to:`/chat`,"aria-label":f(`backToMain`),className:m(`group inline-flex min-w-0 items-center rounded-lg text-[12px] font-medium text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?m(t$,o$,`justify-center p-0`):`gap-1.5 px-1 py-1`),children:[(0,F.jsx)(ot,{className:m(e?n$:`h-3.5 w-3.5`,`shrink-0 text-muted-foreground/75 group-hover:text-gray-700`)}),(0,F.jsx)(`span`,{className:e?`sr-only`:`truncate`,children:f(`backToMain`)})]}),e?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-border`,"aria-hidden":`true`}),(0,F.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-foreground`,children:f(`settings`)}),(0,F.jsx)(`div`,{className:`ml-auto`,children:(0,F.jsx)(n1,{isCollapsed:e,onToggle:t})})]})]})})}function i1({isCollapsed:e,onToggle:t}){return(0,F.jsx)(`div`,{className:m(`shrink-0`,e?`flex justify-center px-0 py-1.5`:`px-2 py-2`),children:e?(0,F.jsx)(n1,{isCollapsed:e,onToggle:t}):(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(_$,{className:`flex min-w-0 flex-1 items-center gap-2.5 cursor-pointer`}),(0,F.jsx)(n1,{isCollapsed:e,onToggle:t})]})})}function a1({isSettingsMode:e,isCollapsed:t,onToggle:n}){return e?(0,F.jsx)(r1,{isCollapsed:t,onToggle:n}):(0,F.jsx)(i1,{isCollapsed:t,onToggle:n})}function o1({isSettingsMode:e,isCollapsed:t,items:n,sections:r,density:i}){let a=m(t?m(r$,`pb-3`):e?`space-y-0.5 pb-3`:`space-y-1 pb-4`);return(0,F.jsx)(`nav`,{className:m(`custom-scrollbar min-h-0 flex-1 overflow-y-auto`,t?`pr-0`:`pr-1`,a$),children:r&&!t?(0,F.jsx)(`div`,{className:`space-y-3 pb-3`,children:r.map(e=>(0,F.jsxs)(`section`,{"aria-label":e.label,className:`space-y-1`,children:[(0,F.jsx)(`h2`,{className:`px-3 text-[11px] font-semibold text-muted-foreground/70`,children:e.label}),(0,F.jsx)(j$,{isCollapsed:t,items:e.items,density:i,className:`space-y-0.5`})]},e.label))}):(0,F.jsx)(j$,{isCollapsed:t,items:n,density:i,className:a})})}function s1({mode:e}){let t=c2(),n=Ln(),r=ms(),i=hn(e=>e.isSidebarCollapsed),a=mn.toggleSidebarCollapsed,{currentLanguage:o,currentLanguageLabel:s,languageOptions:c,selectLanguage:l}=$$(),{theme:u,setTheme:d}=KQ(),p=e===`settings`,h=f(gQ.find(e=>e.value===u)?.labelKey??`themeWork`),g=r.data?.account.email?.trim(),_=!!r.data?.account.loggedIn,v=e=>{u!==e&&d(e)},{items:y,sections:b,density:x}=t1(p,f);return(0,F.jsxs)(`aside`,{className:m(`shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary pb-6 transition-[width] duration-200 ease-out`,i?m($Q,e$):`w-[240px] px-4`),"data-sidebar-collapsed":i?`true`:`false`,children:[(0,F.jsx)(a1,{isSettingsMode:p,isCollapsed:i,onToggle:a}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsx)(o1,{isSettingsMode:p,isCollapsed:i,items:y,sections:b,density:x}),(0,F.jsxs)(`div`,{className:m(`shrink-0 bg-secondary`,i?`mt-2 pt-2`:p?`mt-2 pt-3`:`mt-3 pt-3`),children:[p?(0,F.jsx)(M$,{onClick:()=>t.accountManager.openAccountPanel(),icon:pn,label:f(`remoteAccountEntryManage`),density:`compact`,className:i?`mb-1`:`mb-1.5`,trailing:_?g||f(`remoteAccountEntryConnected`):f(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`,collapsed:i}):null,e===`main`&&(0,F.jsx)(`div`,{className:m(i?`mb-1`:`mb-2`,i?`flex justify-center`:void 0),children:(0,F.jsx)(A$,{to:`/settings`,label:f(`settings`),icon:ln,collapsed:i})}),(0,F.jsx)(`div`,{className:m(i?`mb-1`:`mb-2`,i?`flex justify-center`:void 0),children:(0,F.jsx)(N$,{value:u,onValueChange:e=>v(e),icon:Ho,label:f(`theme`),valueLabel:h,density:x,collapsed:i,children:gQ.map(e=>(0,F.jsx)(Ht,{value:e.value,className:`text-xs`,children:f(e.labelKey)},e.value))})}),(0,F.jsx)(`div`,{className:m(i?`mb-1`:`mb-2`,i?`flex justify-center`:void 0),children:(0,F.jsx)(N$,{value:o,onValueChange:e=>l(e),icon:Ao,label:f(`language`),valueLabel:s,density:x,collapsed:i,children:c.map(e=>(0,F.jsx)(Ht,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,F.jsx)(M$,{onClick:()=>n.open(void 0,{kind:`docs`,title:f(`docBrowserHelp`)}),icon:Tt,label:f(`docBrowserHelp`),density:x,collapsed:i})]})]})]})}var c1=[{action:`minimize`,label:`Minimize`,icon:Vo},{action:`close`,label:`Close`,icon:Cn,variant:`danger`}];function l1({sidebarCollapsed:e=!1}){let t=d1()?{action:`toggle-maximize`,label:`Restore`,icon:so}:{action:`toggle-maximize`,label:`Maximize`,icon:as};return(0,F.jsxs)(`header`,{className:`desktop-window-drag relative flex h-[var(--desktop-titlebar-height)] shrink-0 bg-secondary after:absolute after:bottom-0 after:left-[var(--desktop-sidebar-width)] after:right-0 after:border-b after:border-border/80`,"data-testid":`desktop-window-chrome`,children:[(0,F.jsx)(`div`,{className:`desktop-window-no-drag absolute left-0 right-0 top-0 h-1`,"data-testid":`desktop-window-chrome-resize-strip`}),(0,F.jsx)(`div`,{className:m(`desktop-window-drag relative z-10 flex h-full w-[var(--desktop-sidebar-width)] shrink-0 items-center bg-secondary text-secondary-foreground`,e?`justify-center px-0`:`pl-4 pr-3`),"data-testid":`desktop-window-chrome-sidebar`,children:e?(0,F.jsx)(`img`,{src:`/logo.svg`,alt:`NextClaw`,className:`h-6 w-6 shrink-0 object-contain`}):(0,F.jsx)(_$,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,density:`chrome`})}),(0,F.jsx)(`div`,{className:`desktop-window-no-drag absolute right-0 top-0 z-20 flex h-full w-[var(--desktop-caption-safe-right)] items-start justify-end`,"data-testid":`desktop-window-controls`,children:[c1[0],t,c1[1]].map(e=>(0,F.jsx)(u1,{control:e},e.action))})]})}function u1({control:e}){let t=e.icon;return(0,F.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,className:e.variant===`danger`?`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-red-500 hover:text-white`:`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-black/10`,onClick:()=>{window.nextclawDesktop?.controlWindow?.(e.action)},children:(0,F.jsx)(t,{className:`h-3.5 w-3.5`})})}function d1(){let[e,t]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{let e=!0,n=window.nextclawDesktop;n?.getWindowState?.().then(n=>{e&&t(n.isMaximized)});let r=n?.onWindowStateChanged?.(e=>{t(e.isMaximized)});return()=>{e=!1,r?.()}},[]),e}function f1(){return typeof window>`u`?null:m1()??window.nextclawDesktop?.platform??null}function p1(){return f1()===`win32`}function m1(){return null}function h1(e,t){if(t===`/settings`)return Z$(e);let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function g1(){let{pathname:e}=ii(),t=K$(f);return(0,F.jsx)(`nav`,{"data-testid":`mobile-bottom-nav`,"aria-label":f(`settings`),className:`shrink-0 border-t border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingBottom:`calc(env(safe-area-inset-bottom, 0px) + 0.25rem)`},children:(0,F.jsx)(`ul`,{className:`grid grid-cols-4 gap-1 px-2 pt-1`,children:t.map(t=>{let n=h1(e,t.target);return(0,F.jsx)(`li`,{children:(0,F.jsx)(Ea,{to:t.target,"aria-current":n?`page`:void 0,className:m(`group flex min-h-[2.875rem] items-center justify-center rounded-xl px-1 py-1 text-[10px] font-medium transition-colors`,n?`text-gray-900`:`text-gray-500 hover:text-gray-800`),children:(0,F.jsxs)(`span`,{"data-testid":n?`mobile-nav-active-indicator`:void 0,className:m(`inline-flex max-w-full min-w-14 flex-col items-center justify-center gap-0.5 rounded-xl px-2 py-1 transition-colors`,n?`bg-gray-100`:`bg-transparent group-hover:bg-gray-50`),children:[(0,F.jsx)(t.icon,{className:m(`h-3.5 w-3.5`,n?`text-gray-900`:`text-gray-400`)}),(0,F.jsx)(`span`,{className:`max-w-full truncate`,children:t.label})]})})},t.target)})})})}function _1({leadingInset:e}){let t=si(),{pathname:n}=ii(),r=Q$(n,f);return(0,F.jsx)(`header`,{"data-testid":`mobile-topbar`,className:`shrink-0 border-b border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.25rem)`},children:(0,F.jsxs)(`div`,{className:`flex min-h-[2.75rem] items-center gap-2 py-1.5 pl-3 pr-3`,style:{paddingLeft:e?`calc(${e} + 0.75rem)`:void 0},children:[r.backTarget?(0,F.jsx)(`button`,{type:`button`,onClick:()=>t(r.backTarget),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-gray-200 text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900`,"aria-label":r.backLabel??f(`backToMain`),children:(0,F.jsx)(ot,{className:`h-4 w-4`})}):null,(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h1`,{className:`truncate text-center text-[15px] font-semibold text-gray-900`,children:r.title})}),r.backTarget?(0,F.jsx)(`div`,{className:`h-8 w-8 shrink-0`,"aria-hidden":`true`}):null]})})}var v1=(0,P.lazy)(async()=>({default:(await h(async()=>{let{DocBrowser:e}=await import(`./doc-browser-DJQ5XPsi2.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,34,35,36]))).DocBrowser}));function y1({pathname:e,isDocBrowserOpen:t,docBrowserDockControls:n,docBrowserRenderers:r={},topbarLeadingInset:i,children:a}){let o=W$(e),s=!G$(e),c=!G$(e);return(0,F.jsxs)(`div`,{className:`flex h-[100svh] flex-col bg-background font-sans text-foreground supports-[height:100dvh]:h-[100dvh]`,children:[s?(0,F.jsx)(_1,{leadingInset:i}):null,(0,F.jsx)(`div`,{className:`relative flex-1 min-h-0 overflow-hidden`,children:o?(0,F.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:a}):(0,F.jsx)(`main`,{className:`h-full overflow-auto px-4 py-4 custom-scrollbar`,children:(0,F.jsx)(`div`,{className:`mx-auto max-w-3xl animate-fade-in`,children:a})})}),c?(0,F.jsx)(g1,{}):null,t?(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(v1,{customTabRenderers:r,displayMode:`fullscreen`,dockControls:n})}):null]})}function b1(){let e=X$(f);return(0,F.jsx)(`div`,{"data-testid":`mobile-settings-shell`,className:`space-y-3 pb-4`,children:e.map(e=>(0,F.jsxs)(Da,{to:e.target,className:({isActive:e})=>m(`flex items-center gap-3 rounded-2xl border border-gray-200/80 bg-white px-4 py-4 shadow-card transition-colors`,e?`border-gray-300 bg-gray-50`:`hover:border-gray-300 hover:bg-gray-50/70`),children:[(0,F.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-gray-100 text-gray-600`,children:(0,F.jsx)(e.icon,{className:`h-4 w-4`})}),(0,F.jsx)(`div`,{className:`min-w-0`,children:(0,F.jsx)(`p`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.label})})]},e.target))})}function x1(){let{pathname:e}=ii(),t=si();return G$(e)?(0,F.jsx)(uQ,{layoutMode:`mobile`,onBackToList:()=>t(`/chat`)}):(0,F.jsx)(L1,{variant:`mobile`})}var S1=(0,P.lazy)(async()=>({default:(await h(async()=>{let{DocBrowser:e}=await import(`./doc-browser-DJQ5XPsi2.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,34,35,36]))).DocBrowser}));function C1({pathname:e,isMobileLayout:t=!1,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:i,docBrowserRenderers:a={},sideDock:o,children:s}){let c=W$(e),l=hn(e=>e.isSidebarCollapsed),u=t&&!G$(e),d=p1(),f=l?`56px`:c?`280px`:`240px`;return(0,F.jsxs)(`div`,{className:m(`h-screen flex flex-col overflow-hidden bg-background font-sans text-foreground`,d?`rounded-[10px]`:null),style:d?{"--desktop-titlebar-height":`40px`,"--desktop-caption-safe-right":`140px`,"--desktop-sidebar-width":f}:void 0,children:[d?(0,F.jsx)(l1,{sidebarCollapsed:l}):null,(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[!c&&(0,F.jsx)(s1,{mode:`settings`}),(0,F.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,F.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:c?(0,F.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:s}):(0,F.jsx)(`main`,{className:`flex-1 overflow-auto p-8 pb-16 custom-scrollbar`,children:(0,F.jsx)(`div`,{className:`mx-auto h-full max-w-6xl animate-fade-in`,children:s})})}),n&&r===`docked`?(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(S1,{customTabRenderers:a,dockControls:i})}):null,o]})]}),u?(0,F.jsx)(g1,{}):null,n&&r===`floating`?(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(S1,{customTabRenderers:a,dockControls:i})}):null]})}var w1=[{target:`/cron`,label:()=>f(`chatSidebarScheduledTasks`),icon:Wa},{target:`/skills`,label:()=>f(`chatSidebarSkills`),icon:Za},{target:`/agents`,label:()=>f(`agentsPageTitle`),icon:Ya}];function T1({isCollapsed:e}){let t=f(e?`sidebarExpand`:`sidebarCollapse`);return(0,F.jsx)(ht,{icon:(0,F.jsx)(e?Wo:Uo,{className:n$}),label:t,className:m(o$,e&&`h-9 w-9 rounded-xl`),onClick:mn.toggleSidebarCollapsed})}function E1({connectionStatus:e,isCollapsed:t}){let n=p1(),r=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`;return(0,F.jsxs)(`div`,{className:m(`flex items-center`,t?`justify-center px-2 py-1.5`:n?`justify-end px-3 py-1.5`:`gap-2 px-5 py-2`,t&&r?`pt-8`:null),children:[t||n?null:(0,F.jsx)(_$,{className:`flex min-w-0 flex-1 items-center gap-2`,suffix:(0,F.jsx)(w$,{status:e})}),(0,F.jsx)(T1,{isCollapsed:t})]})}function D1({isCollapsed:e}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:m(`pb-2`,e?`px-0`:`px-3`),children:(0,F.jsx)(`ul`,{className:e?r$:`space-y-0.5`,children:w1.map(t=>(0,F.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,F.jsx)(A$,{to:t.target,label:t.label(),icon:t.icon,density:`compact`,collapsed:e})},t.target))})}),(0,F.jsx)(`div`,{className:m(`border-t border-border/70`,e?`mx-2 my-1.5`:`mx-4`)})]})}function O1({defaultSessionType:e,groups:t,isCollapsed:n,isLoading:r,isProjectFirstView:i,onSelectMode:a,projectGroups:o,renderSessionItem:s,sessionTypeOptions:c}){return n?(0,F.jsx)(`div`,{className:`min-h-0 flex-1`,"aria-hidden":`true`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between px-5 pb-2 pt-3`,children:[(0,F.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/75`,children:f(`chatSidebarTaskRecords`)}),(0,F.jsx)(T$,{isProjectFirstView:i,onSelectMode:a})]}),(0,F.jsx)(`div`,{className:m(`custom-scrollbar min-h-0 flex-1 overflow-y-auto px-3 pb-7 pt-2`,a$),children:(0,F.jsx)(L$,{isLoading:r,isProjectFirstView:i,groups:t,projectGroups:o,defaultSessionType:e,sessionTypeOptions:c,renderSessionItem:s})})]})}function k1({currentLanguage:e,currentLanguageLabel:t,currentTheme:n,currentThemeLabel:r,isCollapsed:i,isOpen:a,languageOptions:o,onOpenApps:s,onOpenChange:c,onOpenDocs:l,onSelectLanguage:u,onSelectTheme:d,themeOptions:f}){return(0,F.jsx)(`div`,{className:m(`py-3`,i?m(`flex justify-center`,e$):`px-3`),children:(0,F.jsx)(R$,{isOpen:a,onOpenChange:c,currentTheme:n,currentThemeLabel:r,themeOptions:f,onSelectTheme:d,currentLanguage:e,currentLanguageLabel:t,languageOptions:o,onSelectLanguage:u,onOpenDocs:l,onOpenApps:s,collapsed:i})})}var A1=xe.chat.newSessionType,j1=[`preference`,A1];function M1(e,t){let n=Pl(e);return t.find(e=>e.value===n&&e.ready!==!1)??null}function N1(e){let{defaultSessionType:t,preferredSessionType:n,sessionTypeOptions:r}=e,i=n?M1(n,r):null,a=M1(t,r);return i??a??r.find(e=>e.ready!==!1)??r[0]??{value:Pl(t),label:Pl(t),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}}function P1(e){return typeof e?.value==`string`?Pl(e.value):null}function F1({defaultSessionType:e,sessionTypeOptions:t}){let n=pe(),r=E({queryKey:j1,queryFn:()=>be(A1),staleTime:3e4,retry:!1}),i=(0,P.useMemo)(()=>P1(r.data),[r.data]),a=(0,P.useMemo)(()=>N1({preferredSessionType:i,defaultSessionType:e,sessionTypeOptions:t}),[e,i,t]),o=Me({mutationFn:async e=>await ue(A1,Pl(e)),onMutate:async e=>{let t=Pl(e);await n.cancelQueries({queryKey:j1});let r=n.getQueryData(j1);return n.setQueryData(j1,{key:A1,value:t,updatedAt:new Date().toISOString()}),{previous:r}},onError:(e,t,r)=>{r?.previous&&n.setQueryData(j1,r.previous)},onSuccess:e=>{n.setQueryData(j1,e)}}),s=(0,P.useCallback)(e=>{let n=M1(e,t);n&&o.mutate(n.value)},[t,o]);return{selectedSessionType:a.value,selectedSessionTypeOption:a,isLoading:r.isLoading,setSelectedSessionType:s}}function I1(e,t,n){let r=I(e=>e.optimisticReadAtBySessionKey);return(0,P.useEffect)(()=>{(()=>{if(!t)return;let r=e.find(({session:e})=>e.key===t);if(!r||r.runStatus===`running`)return;let{session:i}=r;n(i.key,i.lastMessageAt,i.readAt)})()},[e,n,t]),r}function L1({variant:e=`desktop`}){let t=e===`mobile`,n=ic(),r=Ln(),i=hn(e=>e.isSidebarCollapsed),[a,o]=(0,P.useState)(!1),[c,l]=(0,P.useState)(!1),u=I(e=>e.snapshot),d=Rl(e=>e.snapshot.sessionTypesQuery?.data??null),p=b(),h=Au(),{isLoading:g,items:_}=ul(),{language:v,setLanguage:y}=Qt(),{theme:x,setTheme:S}=KQ(),C=f(gQ.find(e=>e.value===x)?.labelKey??`themeWork`),w=s.find(e=>e.value===v)?.label??v,T=(0,P.useMemo)(()=>gQ.map(e=>({value:e.value,label:f(e.labelKey)})),[]),E=(0,P.useMemo)(()=>s.map(e=>({value:e.value,label:e.label})),[]),D=(0,P.useMemo)(()=>new Map((h.data?.agents??[]).map(e=>[e.id,e])),[h.data?.agents]),O=(0,P.useMemo)(()=>new Set(u.pinnedSessionKeys),[u.pinnedSessionKeys]),k=(0,P.useMemo)(()=>new Set(u.pinnedProjectRoots),[u.pinnedProjectRoots]),A=(0,P.useMemo)(()=>Dl(_),[_]),ee=(0,P.useMemo)(()=>jl(_),[_]),j=(0,P.useMemo)(()=>kl(A,O),[O,A]),te=(0,P.useMemo)(()=>Al(A,O,k),[k,O,A]),M=(0,P.useMemo)(()=>Ll(d?.options??[]),[d?.options]),ne=(0,P.useMemo)(()=>Pl(d?.defaultType??`native`),[d?.defaultType]),re=(0,P.useMemo)(()=>M.filter(e=>e.value!==ne),[ne,M]),ie=F1({defaultSessionType:ne,sessionTypeOptions:M}),ae=u.listMode===`project-first`,oe=!t&&i,se=I1(_,u.selectedSessionKey,n.chatSessionListManager.markSessionRead),{editingSessionKey:ce,draftLabel:le,savingSessionKey:ue,setDraftLabel:de,startEditingSessionLabel:fe,cancelEditingSessionLabel:pe,saveSessionLabel:me}=dQ(),he=e=>{v!==e&&(y(e),window.location.reload())},ge=e=>(0,F.jsx)(XQ,{item:e,selectedSessionKey:u.selectedSessionKey,optimisticReadAtBySessionKey:se,agentsById:D,childSessionsByParentKey:ee,editingSessionKey:ce,draftLabel:le,savingSessionKey:ue,sessionTypeOptions:M,isPinned:O.has(e.session.key),sessionTitle:Ml,onSelectSession:n.chatSessionListManager.selectSession,onOpenChildSessions:(e,t)=>n.chatThreadManager.openChildSessionPanel({parentSessionKey:e,activeChildSessionKey:t}),onStartEditingSessionLabel:fe,onDraftLabelChange:de,onSaveSessionLabel:me,onCancelEditingSessionLabel:pe,onTogglePinned:()=>n.chatSessionListManager.toggleSessionPinned(e.session.key)},e.session.key),_e=(e,t)=>{n.chatSessionListManager.createSession(e,typeof t==`string`?t:void 0)};return(0,F.jsxs)(`aside`,{className:m(`flex h-full min-h-0 flex-col bg-secondary transition-[width] duration-200 ease-out`,t?`flex-1 overflow-hidden`:oe?m($Q,`shrink-0`):`w-[280px] shrink-0`),"data-sidebar-collapsed":oe?`true`:`false`,children:[t?null:(0,F.jsx)(E1,{connectionStatus:p.connectionStatus,isCollapsed:oe}),t?(0,F.jsx)(p$,{query:u.query,defaultSessionType:ie.selectedSessionType,sessionTypeOptions:M,nonDefaultSessionTypeOptions:re,selectedNewSessionType:ie.selectedSessionType,selectedNewSessionTypeOption:ie.selectedSessionTypeOption,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:_e,onSelectNewSessionType:ie.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery}):(0,F.jsx)(f$,{query:u.query,defaultSessionType:ne,sessionTypeOptions:M,nonDefaultSessionTypeOptions:re,selectedNewSessionType:ie.selectedSessionType,selectedNewSessionTypeOption:ie.selectedSessionTypeOption,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:_e,onSelectNewSessionType:ie.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery,collapsed:oe}),t?null:(0,F.jsx)(D1,{isCollapsed:oe}),(0,F.jsx)(O1,{defaultSessionType:ie.selectedSessionType,groups:j,isCollapsed:oe,isLoading:g,isProjectFirstView:ae,onSelectMode:n.chatSessionListManager.setListMode,projectGroups:te,renderSessionItem:ge,sessionTypeOptions:M}),t?null:(0,F.jsx)(k1,{currentLanguage:v,currentLanguageLabel:w,currentTheme:x,currentThemeLabel:C,isCollapsed:oe,isOpen:c,languageOptions:E,onOpenApps:()=>oq(r),onOpenChange:l,onOpenDocs:()=>r.open(void 0,{kind:`docs`,title:f(`docBrowserHelp`)}),onSelectLanguage:he,onSelectTheme:S,themeOptions:T})]})}var R1=`sid_`,z1=`/chat/draft`,B1=z1.slice(6);function V1(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return`${R1}${btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}`}function H1(e){if(!e.startsWith(R1))return null;let t=e.slice(4).replace(/-/g,`+`).replace(/_/g,`/`),n=`=`.repeat((4-t.length%4)%4);try{let e=atob(t+n),r=Uint8Array.from(e,e=>e.charCodeAt(0));return new TextDecoder().decode(r)}catch{return null}}function U1(e){if(!e||e===B1)return null;let t=H1(e);if(t)return t;try{return decodeURIComponent(e)}catch{return e}}function W1(e){return`/chat/${V1(e)}`}function G1(e,t){let n=t.trim();return n?e.includes(n)?e.filter(e=>e!==n):[n,...e]:e}var K1=class{constructor(e){this.uiManager=e,this.syncDraftThreadState=()=>{L.getState().setSnapshot({sessionKey:null,sessionDisplayName:void 0,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.resolveUpdateValue=(e,t)=>typeof t==`function`?t(e):t,this.shouldPersistReadAt=(e,t,n)=>{let r=I.getState().optimisticReadAtBySessionKey[e],i=r&&n?r.localeCompare(n)>0?r:n:r??n??void 0;return i?t.localeCompare(i)>0:!0},this.setSelectedAgentId=e=>{let t=I.getState().snapshot.selectedAgentId,n=this.resolveUpdateValue(t,e);n!==t&&I.getState().setSnapshot({selectedAgentId:n})},this.syncSelectedSessionAgent=()=>{let e=L.getState().snapshot.agentId?.trim();e&&this.setSelectedAgentId(e)},this.setSelectedSessionKey=e=>{let t=I.getState().snapshot.selectedSessionKey,n=this.resolveUpdateValue(t,e);n!==t&&I.getState().setSnapshot({selectedSessionKey:n})},this.syncRouteSessionSelection=e=>{let{isChatView:t,routeSessionKey:n}=e;if(!t)return;let{selectedSessionKey:r}=I.getState().snapshot;if(n){r!==n&&this.setSelectedSessionKey(n);return}r!==null&&this.setSelectedSessionKey(null)},this.setListMode=e=>{let t=I.getState().snapshot.listMode,n=this.resolveUpdateValue(t,e);n!==t&&I.getState().setSnapshot({listMode:n})},this.toggleSessionPinned=e=>{let{pinnedSessionKeys:t}=I.getState().snapshot;I.getState().setSnapshot({pinnedSessionKeys:G1(t,e)})},this.toggleProjectPinned=e=>{let{pinnedProjectRoots:t}=I.getState().snapshot;I.getState().setSnapshot({pinnedProjectRoots:G1(t,e)})},this.toggleProjectCollapsed=e=>{let{collapsedProjectRoots:t}=I.getState().snapshot;I.getState().setSnapshot({collapsedProjectRoots:G1(t,e)})},this.markSessionRead=(e,t,n)=>{let r=e?.trim(),i=t?.trim();!r||!i||this.shouldPersistReadAt(r,i,n)&&(I.getState().markSessionRead(r,i),M(r,{uiReadAt:i}).catch(()=>void 0))},this.markVisibleWorkspaceChildRead=e=>{this.markSessionRead(e.sessionKey,e.runStatus===`running`?null:e.lastMessageAt,e.readAt)},this.createSession=(e,t)=>{let n=Pl(e??`native`),r=hc(t);I.getState().setSnapshot({selectedSessionKey:null}),this.syncDraftThreadState(),this.uiManager.navigateTo(z1,{replace:this.uiManager.isAtChatRoot(),state:{chatDraft:{sessionType:n,projectRoot:r}}})},this.startAgentDraftChat=(e,t)=>{let n=e.trim()||`main`;this.createSession(t),this.setSelectedAgentId(n)},this.selectSession=e=>{this.uiManager.goToSession(e)},this.setQuery=e=>{let t=I.getState().snapshot.query,n=this.resolveUpdateValue(t,e);n!==t&&I.getState().setSnapshot({query:n})}}},q1=async()=>!1,J1=class{constructor(e){this.docBrowserManager=e,this.state={pathname:``},this.actions={navigate:null,confirm:q1},this.syncState=e=>{this.state={...this.state,...e}},this.bindActions=e=>{this.actions={...this.actions,...e}},this.confirm=async e=>this.actions.confirm(e),this.navigateTo=(e,t)=>{this.actions.navigate&&(this.state.pathname===e&&!t?.replace||(this.actions.navigate(e,t),this.state.pathname=e))},this.goToProviders=()=>{this.navigateTo(`/providers`)},this.isCompactViewport=()=>mn.getSnapshot().mode===`mobile`,this.resolvePanelAppEntry=async e=>{let t=e.trim();if(!t)return null;try{return UG((await ye.panelApps.listPanelApps()).entries,t)}catch{return null}},this.showContent=async e=>{let{target:t,title:n}=e;if(t.type===`url`){this.docBrowserManager.open(t.payload.url,{dedupeKey:`browser:${t.payload.url}`,kind:`content`,title:n});return}let{appId:r}=t.payload,i=await this.resolvePanelAppEntry(r);if(i){this.docBrowserManager.openTarget(IK(i),{title:n});return}this.docBrowserManager.open(NK(r),{title:n})},this.goToChatRoot=e=>{this.navigateTo(`/chat`,e)},this.isAtChatRoot=()=>this.state.pathname===`/chat`||this.state.pathname===`/chat/draft`,this.goToSession=(e,t)=>{this.navigateTo(W1(e),t)}}};function Y1(e){let t=e=>{if(!e||typeof e!=`object`)return e;let t=e,n=t.error instanceof Error?{name:t.error.name,message:t.error.message}:t.error;return{data:t.data,error:n,status:t.status,fetchStatus:t.fetchStatus,isLoading:t.isLoading,isFetching:t.isFetching,isFetched:t.isFetched,isSuccess:t.isSuccess}};return{configQuery:t(e.configQuery),providersQuery:t(e.providersQuery),providerTemplatesQuery:t(e.providerTemplatesQuery),sessionsQuery:t(e.sessionsQuery),sessionTypesQuery:t(e.sessionTypesQuery),sessionSkillsSessionId:e.sessionSkillsSessionId,sessionSkillsQuery:t(e.sessionSkillsQuery)}}function X1(e,t){return JSON.stringify(Y1(e))!==JSON.stringify(Y1({...e,...t}))}var Z1=class{constructor(){this.syncSnapshot=e=>{let t=Rl.getState();X1(t.snapshot,e)&&t.setSnapshot(e)}}},Q1=class{constructor(e,t,n){this.uiManager=e,this.sessionListManager=t,this.onWorkspacePanelOpened=n,this.handledUiShowContentEventIds=new Set,this.hasSnapshotChanges=e=>{let t=L.getState().snapshot;for(let[n,r]of Object.entries(e))if(!Object.is(t[n],r))return!0;return!1},this.syncSnapshot=e=>{this.hasSnapshotChanges(e)&&L.getState().setSnapshot(e)},this.clearDeletedSessionState=e=>{I.getState().snapshot.selectedSessionKey===e&&this.sessionListManager.setSelectedSessionKey(null),L.getState().setSnapshot({sessionKey:null,sessionTypeLabel:null,agentId:null,sessionDisplayName:void 0,sessionProjectRoot:null,sessionProjectName:null,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,workspaceFileTabs:[],activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.resolveWorkspaceParentSessionKey=()=>I.getState().snapshot.selectedSessionKey?.trim()||L.getState().snapshot.sessionKey?.trim()||(I.getState().snapshot.selectedSessionKey??null),this.activateWorkspaceFileTab=(e,t)=>{let{parentSessionKey:n}=e,{workspaceFileTabs:r}=L.getState().snapshot;this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:`file`,workspaceFileTabs:gG(r,e,t),activeWorkspaceFileKey:e.key,activeChildSessionKey:null,activeSideChatDraft:null},{kind:`file`,key:e.key}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.()},this.ensureWorkspaceParentRoute=e=>{if(!e)return;let{snapshot:{selectedSessionKey:t}}=I.getState();t!==e&&this.uiManager.goToSession(e)},this.setWorkspaceSelection=(e,t)=>{let{snapshot:n}=L.getState(),r=ou({entries:n.workspaceNavigationHistory,index:n.workspaceNavigationHistoryIndex},t,uu),i=e.workspacePanelParentKey&&e.workspacePanelParentKey!==n.workspacePanelParentKey?[]:n.closedWorkspaceTabEntries.filter(e=>!uu(e,t));L.getState().setSnapshot({...e,closedWorkspaceTabEntries:i,workspaceNavigationHistory:[...r.entries],workspaceNavigationHistoryIndex:r.index})},this.openWorkspacePage=(e,t)=>{let n=e.trim();n&&(this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:t,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null},{kind:t}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.())},this.openWorkspaceOverview=e=>{this.openWorkspacePage(e,`overview`)},this.toggleWorkspacePanel=e=>{let t=e.trim();if(!t)return;let{snapshot:n}=L.getState();if(n.workspacePanelParentKey===t&&n.activeWorkspacePanelKind){this.closeWorkspacePanel();return}this.openWorkspaceOverview(t)},this.setWorkspacePanelWidth=e=>{this.syncSnapshot({workspacePanelWidth:ru(e)})},this.openChildSessions=e=>{this.openWorkspacePage(e,`child-sessions`)},this.openProjectFiles=e=>{this.openWorkspacePage(e,`project-files`)},this.openChildSessionPanel=e=>{let{activeChildSessionKey:t,childSessionTab:n,parentSessionKey:r}=e,i=r.trim();if(!i)return;let a=t?.trim()||null,o={workspacePanelParentKey:i,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:a,activeSideChatDraft:null,activeWorkspaceFileKey:null};a&&n&&(o.childSessionTabs=hu(L.getState().snapshot.childSessionTabs,{sessionKey:a,parentSessionKey:i,label:n.label?.trim()||null,agentId:n.agentId?.trim()||null})),a?this.setWorkspaceSelection(o,{kind:`child-session`,key:a}):L.getState().setSnapshot(o),this.ensureWorkspaceParentRoute(i),this.onWorkspacePanelOpened?.()},this.openSideChatDraft=e=>{let t=e?.trim()||this.resolveWorkspaceParentSessionKey()?.trim();if(!t)return;let n=mu(t);this.setWorkspaceSelection({workspacePanelParentKey:t,activeWorkspacePanelKind:`side-chat-draft`,activeChildSessionKey:null,activeSideChatDraft:n,activeWorkspaceFileKey:null},{kind:`side-chat-draft`,key:n.draftKey}),this.ensureWorkspaceParentRoute(t),this.onWorkspacePanelOpened?.()},this.materializeSideChatDraft=e=>{let t=gu({snapshot:L.getState().snapshot,...e});t&&(L.getState().setSnapshot(t.patch),this.ensureWorkspaceParentRoute(t.parentSessionKey))},this.openFilePreview=e=>{let t=hG(e,this.resolveWorkspaceParentSessionKey());t&&this.activateWorkspaceFileTab(t)},this.openWorkspaceFileViewer=(e,t)=>{let n=L.getState().snapshot.workspaceFileTabs.find(t=>t.key===e.trim());if(!n||n.viewMode!==`preview`)return;let r=t??Gu(n.path,n.previewViewer);if(!r)return;let i=hG({path:n.path,label:n.label??void 0,viewMode:`preview`,previewViewer:r,line:n.line??void 0,column:n.column??void 0,rawText:n.rawText??void 0,contentUrl:n.contentUrl??void 0,mimeType:n.mimeType??void 0},n.parentSessionKey);i&&this.activateWorkspaceFileTab(i,n.key)},this.openSessionFromToolAction=e=>{if(e.kind!==`open-session`)return;let t=e.sessionId.trim();if(t){if(e.sessionKind===`child`&&!this.uiManager.isCompactViewport()){let n=e.parentSessionId?.trim()||I.getState().snapshot.selectedSessionKey||null;if(n){this.openChildSessionPanel({parentSessionKey:n,activeChildSessionKey:t,childSessionTab:{label:e.label,agentId:e.agentId}});return}}this.closeWorkspacePanel(),this.uiManager.goToSession(t)}},this.handleToolAction=async e=>{if(e.kind===`show-content`){await this.showContent(e.request);return}this.openSessionFromToolAction(e)},this.handleUiShowContentEvent=async e=>{let t=e.id.trim();!t||this.handledUiShowContentEventIds.has(t)||(this.handledUiShowContentEventIds.add(t),await this.showContent({target:e.target,title:e.title,purpose:e.purpose,placement:e.placement}))},this.showContent=async e=>{if(e.placement!==`inline`){if(e.target.type===`file`){this.openFilePreview({path:e.target.payload.path,label:e.title,viewMode:`preview`,previewViewer:e.target.payload.viewer,line:e.target.payload.line,column:e.target.payload.column});return}await this.uiManager.showContent({target:e.target,title:e.title})}},this.syncVisibleWorkspaceSelection=e=>{e?.kind===`child-session`&&this.sessionListManager.markVisibleWorkspaceChildRead(e.tab)},this.selectChildSessionDetail=e=>{let t=e.trim();t&&this.setWorkspaceSelection({activeChildSessionKey:t,activeWorkspaceFileKey:null,activeWorkspacePanelKind:`child-session`,activeSideChatDraft:null},{kind:`child-session`,key:t})},this.selectWorkspaceFile=e=>{let t=e.trim();if(!t)return;let{workspaceFileTabs:n}=L.getState().snapshot;n.some(e=>e.key===t)&&this.setWorkspaceSelection({activeWorkspaceFileKey:t,activeChildSessionKey:null,activeWorkspacePanelKind:`file`,activeSideChatDraft:null},{kind:`file`,key:t})},this.closeWorkspaceTab=e=>{let{snapshot:t}=L.getState(),n=pu(t,e);n&&L.getState().setSnapshot(n)},this.closeWorkspacePanel=()=>{L.getState().setSnapshot({workspacePanelParentKey:null,activeWorkspacePanelKind:null,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.openSessionCronPanel=e=>{this.openWorkspacePage(e,`cron`)},this.goBackWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`back`)},this.goForwardWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`forward`)},this.restoreWorkspaceNavigationStep=e=>{let{snapshot:t}=L.getState(),n=su({entries:t.workspaceNavigationHistory,index:t.workspaceNavigationHistoryIndex},e);if(!n)return;let r=fu(n.entry,t);r&&L.getState().setSnapshot({...r,workspaceNavigationHistory:[...n.history.entries],workspaceNavigationHistoryIndex:n.history.index})},this.goToParentSession=()=>{let{parentSessionKey:e,activeSideChatDraft:t,childSessionTabs:n,activeChildSessionKey:r}=L.getState().snapshot,i=n.find(e=>e.sessionKey===r)?.parentSessionKey??null,a=e??t?.parentSessionKey??i;a&&(this.closeWorkspacePanel(),this.uiManager.goToSession(a))},this.deleteSession=async()=>{let{snapshot:{selectedSessionKey:e}}=I.getState();if(e&&await this.uiManager.confirm({title:f(`chatDeleteSessionConfirm`),variant:`destructive`,confirmLabel:f(`delete`)})){L.getState().setSnapshot({isDeletePending:!0});try{await Re(e),Ae(se,e),se.removeQueries({queryKey:[`ncp-session-messages`,e]}),this.clearDeletedSessionState(e),this.uiManager.goToChatRoot({replace:!0})}finally{L.getState().setSnapshot({isDeletePending:!1})}}}}},$1=class{constructor(e){this.chatUiManager=new J1(e.docBrowserManager),this.chatSessionListManager=new K1(this.chatUiManager),this.chatQueryManager=new Z1,this.chatThreadManager=new Q1(this.chatUiManager,this.chatSessionListManager,e.notifyRightPanelOpened)}},e0=class{constructor(){this.nextId=0,this.pendingIntent=null,this.listeners=new Set,this.requestDraft=e=>{let t=e.trim();if(!t)return;let n={id:this.nextId+1,prompt:t};this.nextId=n.id,this.pendingIntent=n,this.listeners.forEach(e=>e(n))},this.consumePending=()=>{let e=this.pendingIntent;return this.pendingIntent=null,e},this.markConsumed=e=>{this.pendingIntent?.id===e&&(this.pendingIntent=null)},this.subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})}};function t0(){return E({queryKey:[`ncp-session-types`],queryFn:C,staleTime:1e4,retry:!1})}var n0=`nextclaw://docs`,r0=`github-project`,i0=`https://github.com/Peiiii/nextclaw`;function a0(){return[{builtIn:!0,icon:{type:`builtin`,name:`apps`},id:`apps`,label:f(`appsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:TK}},{builtIn:!0,icon:{type:`builtin`,name:`service-apps`},id:`service-apps`,label:f(`serviceAppsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:EK}},{builtIn:!0,icon:{type:`builtin`,name:`docs`},id:`docs`,label:f(`docBrowserHelp`),removable:!1,target:{type:`right-panel-resource`,uri:n0}},{builtIn:!0,icon:{type:`builtin`,name:`new-tab`},id:`new-tab`,label:f(`docBrowserHomeTitle`),removable:!1,target:{type:`right-panel-resource`,uri:CK}},{builtIn:!0,icon:{type:`builtin`,name:`github`},id:r0,label:f(`sideDockGitHubProject`),removable:!1,target:{type:`external-url`,url:i0}}]}var o0=[`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`];function s0(e){return!!e&&typeof e==`object`}function c0(e){return o0.includes(e)}function l0(e){return!s0(e)||typeof e.type!=`string`?null:e.type===`builtin`&&c0(e.name)?{type:`builtin`,name:e.name}:e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function u0(e){if(!s0(e)||typeof e.id!=`string`||e.id.trim().length===0||typeof e.label!=`string`||e.label.trim().length===0||typeof e.createdAt!=`string`||e.createdAt.trim().length===0||!s0(e.target)||e.target.type!==`right-panel-resource`||typeof e.target.uri!=`string`||e.target.uri.trim().length===0)return null;let t=l0(e.icon);return t?{createdAt:e.createdAt,icon:t,id:e.id.trim(),label:e.label.trim(),target:{type:`right-panel-resource`,uri:e.target.uri.trim()}}:null}function d0(e){if(!Array.isArray(e))return[];let t=new Map;return e.forEach(e=>{let n=u0(e);n&&t.set(n.id,n)}),Array.from(t.values())}function f0(e,t){return{createdAt:t,icon:e.icon,id:e.id,label:e.label,target:e.target}}function p0(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function m0(e){return{builtIn:!1,icon:e.icon,id:e.id,label:e.label,removable:!0,target:e.target}}function h0(e,t){let n=new Set(e.map(e=>e.id)),r=new Set(e.map(p0).filter(e=>e!==null)),i=t.filter(e=>!n.has(e.id)&&!r.has(e.target.uri)).map(m0);return[...e,...i]}var g0=`nextclaw.side-dock.state`,_0=1;function v0(e){return!!e&&typeof e==`object`}var y0=p()(Dn(e=>({isVisible:!0,pinnedItems:[],setVisible:t=>e({isVisible:t}),setPinnedItems:t=>e({pinnedItems:d0(t)})}),{name:g0,version:_0,storage:On(()=>window.localStorage),partialize:e=>({isVisible:e.isVisible,pinnedItems:e.pinnedItems}),merge:(e,t)=>{let n=v0(e)?d0(e.pinnedItems):[],r=v0(e)&&typeof e.isVisible==`boolean`?e.isVisible:!0;return{...t,isVisible:r,pinnedItems:n}}})),b0={apps:ct,docs:Tt,github:Eo,"new-tab":vn,"panel-app":Ga,"service-apps":Ga},x0=new Set([r0]),S0=/^\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?(?:\u200D\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?)*$/u;function C0(e){return S0.test(e.trim())}function w0({icon:e}){if(e.type===`url`)return(0,F.jsx)(`img`,{src:e.url,alt:``,className:`h-5 w-5 rounded object-cover`});if(e.type===`text`)return C0(e.value)?(0,F.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center text-[20px] leading-none`,"aria-hidden":`true`,children:e.value}):(0,F.jsx)(`span`,{className:`max-w-7 truncate text-center text-[13px] font-semibold leading-none`,"aria-hidden":`true`,children:e.value});let t=b0[e.name];return(0,F.jsx)(t,{className:`h-5 w-5`,"aria-hidden":`true`})}function T0({active:e,item:t,onOpen:n,onUnpin:r}){let{label:i}=t;return(0,F.jsxs)(lt,{children:[(0,F.jsxs)(`div`,{className:`group relative`,children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":i,title:i,"data-side-dock-item-id":t.id,onClick:()=>n(t),className:m(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?`bg-primary/10 text-primary`:`bg-transparent`),children:(0,F.jsx)(w0,{icon:t.icon})})}),t.removable?(0,F.jsx)(`button`,{type:`button`,"aria-label":f(`sideDockUnpinItem`),title:f(`sideDockUnpinItem`),onClick:e=>{e.stopPropagation(),r(t)},className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-background text-muted-foreground shadow-sm ring-1 ring-border/70 transition-colors hover:bg-muted hover:text-foreground group-hover:flex focus-visible:flex focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:(0,F.jsx)(Cn,{className:`h-3 w-3`,"aria-hidden":`true`})}):null]}),(0,F.jsx)(yt,{side:`left`,children:i})]})}function E0({icon:e,label:t,onClick:n}){return(0,F.jsxs)(lt,{children:[(0,F.jsx)(ut,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"data-side-dock-action":`hide`,onClick:n,className:m(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`),children:(0,F.jsx)(e,{className:`h-5 w-5`,"aria-hidden":`true`})})}),(0,F.jsx)(yt,{side:`left`,children:t})]})}function D0(e){return e?.trim()??``}function O0(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function k0(e,t,n,r=!1){if(!t||!n)return!1;let i=D0(O0(e)??void 0);if(!i)return!1;let a=D0(n.resourceUri);return a&&a===i||D0(n.currentUrl)===i?!0:r?!1:e.id===`docs`&&n.kind===`docs`}function A0(e,t){if(!t)return!1;let n=D0(t.resourceUri),r=D0(t.currentUrl);return e.some(e=>{let t=D0(O0(e)??void 0);return t===n||t===r})}function j0(e){return x0.has(e.id)}function M0({manager:e}){let t=y0(e=>e.pinnedItems),n=y0(e=>e.setVisible),{currentTab:r,isOpen:i}=Ln(),{confirm:a,ConfirmDialog:o}=en(),s=h0(a0(),t),c=s.filter(e=>!j0(e)),l=s.filter(j0),u=A0(s,r),d=async()=>{await a({title:f(`sideDockHideConfirmTitle`),description:f(`sideDockHideConfirmDescription`),confirmLabel:f(`sideDockHideConfirmAction`),cancelLabel:f(`cancel`)})&&n(!1)};return(0,F.jsx)(St,{delayDuration:250,children:(0,F.jsxs)(`aside`,{"data-testid":`side-dock`,className:`z-30 flex h-full w-14 shrink-0 flex-col items-center gap-1 border-l border-border/60 bg-background/95 px-2 py-3`,children:[(0,F.jsx)(`div`,{className:`flex w-full flex-col items-center gap-1`,children:c.map(t=>(0,F.jsx)(T0,{active:k0(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id))}),l.length>0?(0,F.jsxs)(`div`,{"data-testid":`side-dock-utility`,className:`mt-auto flex w-full flex-col items-center gap-1`,children:[l.map(t=>(0,F.jsx)(T0,{active:k0(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id)),(0,F.jsx)(E0,{icon:Go,label:f(`sideDockHide`),onClick:()=>{d()}})]}):null,(0,F.jsx)(o,{})]})})}var N0=`pinned`,P0=new Set([`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`]);function F0(e){return e.trim()}function I0(e){let t=0;return Array.from(F0(e)).forEach(e=>{t=t*31+e.charCodeAt(0)>>>0}),`${N0}-${F0(e).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()||`resource`}-${t.toString(36)}`}function L0(e){return e?.type===`builtin`&&P0.has(e.name)?{type:`builtin`,name:e.name}:e?.type===`url`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e?.type===`text`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function R0(e){return e.kind===`docs`?`docs`:e.kind===`home`?`new-tab`:e.kind===`apps`?e.resourceUri?.includes(`service-apps`)?`service-apps`:`apps`:e.kind===`panel-app`?`panel-app`:`apps`}var z0=class{constructor(e){this.docBrowserManager=e,this.getItems=()=>h0(a0(),y0.getState().pinnedItems),this.openItem=async e=>{if(e.target.type===`right-panel-resource`){this.docBrowserManager.open(e.target.uri,{dockIcon:e.icon,title:e.label});return}e.target.type===`external-url`&&await En.openExternalUrl(e.target.url)},this.getDockState=e=>{let t=this.getTabResourceUri(e);if(!t)return{canDock:!1,isDocked:!1,removable:!1};let n=this.findItemByUri(t);return{canDock:!0,isDocked:!!n,removable:n?.removable===!0}},this.pinTab=(e,t=new Date().toISOString())=>{let n=this.getTabResourceUri(e);!e||!n||this.findItemByUri(n)||this.pinItem({builtIn:!1,icon:L0(e.dockIcon)??{type:`builtin`,name:R0(e)},id:I0(n),label:e.title.trim()||n,removable:!0,target:{type:`right-panel-resource`,uri:n}},t)},this.unpinTab=e=>{let t=this.getTabResourceUri(e),n=t?this.findItemByUri(t):void 0;n?.removable&&this.unpinItem(n.id)},this.pinItem=(e,t=new Date().toISOString())=>{if(!e.removable||e.target.type!==`right-panel-resource`)return;let n=F0(e.target.uri),r={...e,target:{type:`right-panel-resource`,uri:n}};this.setPinnedItems(i=>i.some(t=>t.id===e.id||F0(t.target.uri)===n)?i:[...i,f0(r,t)])},this.unpinItem=e=>{this.setPinnedItems(t=>t.filter(t=>t.id!==e))},this.reorderPinnedItems=e=>{this.setPinnedItems(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.id)),a=t.filter(e=>!i.has(e.id));return[...r,...a]})},this.setPinnedItems=e=>{let{pinnedItems:t,setPinnedItems:n}=y0.getState();n(e(t))},this.getTabResourceUri=e=>{let t=e?.resourceUri??e?.currentUrl,n=t?F0(t):``;return n.length>0?n:null},this.findItemByUri=e=>{let t=F0(e);return this.getItems().find(e=>e.target.type===`right-panel-resource`&&F0(e.target.uri)===t)}}},B0=new class{constructor(){this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=n??(r?void 0:t?.kind)??(r&&In(r)?`docs`:`home`),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i===`home`?`nextclaw://new-tab`:i===`docs`?jn():`about:blank`),o=i===`docs`?Mn(a,`docs`):a;return{historyPolicy:`managed`,kind:i,title:i===`home`?f(`docBrowserHomeTitle`):zn(o,i,i===`docs`?f(`docBrowserHelp`):`Detail`),url:o}},this.areUrlsEquivalent=(e,t,n,r)=>n===r?n===`docs`?Nn(e)===Nn(t):e===t:!1,this.usesManagedHistory=e=>e.currentUrl!==An}};function V0(e,t,n){return{...e,tabs:e.tabs.map(e=>e.id===t?n(e):e)}}function H0(e,t){return V0(e,e.activeTabId,t)}function U0(e,t){let n=[...e.history.slice(0,e.historyIndex+1),t];return{history:n,historyIndex:n.length-1}}function W0(e,t,n){let r=t.resourceUri??t.url,i=n.resourceUri??n.url;return t.tabId===n.tabId&&t.kind===n.kind&&e.areUrlsEquivalent(r,i,t.kind,n.kind)}function G0(e,t){return{kind:t.kind,resourceUri:t.resourceUri??t.url,tabId:e,url:t.url}}function K0(e,t,n){let r=ou({entries:t.activeHistory,index:t.activeHistoryIndex},n,(t,n)=>W0(e,t,n));return{...t,activeHistory:[...r.entries],activeHistoryIndex:r.index}}function q0(e,t,n){for(let r=t.history.length-1;r>=0;--r)if(e.areUrlsEquivalent(t.history[r],n,t.kind,t.kind))return r;return-1}function J0(e,t,n){let r=t.tabs.find(e=>e.id===n.tabId);if(!r)return t;let i=n.resourceUri??n.url,a=e.resolveOpenTarget({activeTab:r,kind:n.kind,url:i}),o=q0(e,r,a.url),s=n.resourceUri!==void 0&&n.resourceUri===r.resourceUri;return V0({...t,activeTabId:r.id,isOpen:!0},r.id,e=>({...e,currentUrl:a.url,dedupeKey:a.dedupeKey,dockIcon:a.dockIcon??e.dockIcon,historyIndex:o>=0?o:e.historyIndex,kind:a.kind,resourceUri:a.resourceUri??a.url,title:s?e.title:a.title}))}function Y0(e,t,n,r,i){let a={...t,title:r?.title||n.title||t.title,kind:n.kind,resourceUri:n.resourceUri??n.url,dockIcon:r?.dockIcon??n.dockIcon,dedupeKey:i};return e.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?a:{...a,currentUrl:n.url,...U0(t,n.url),navVersion:t.navVersion+1}}function X0(e,t){return!e.isOpen&&e.tabs.length===1&&t?.kind===`home`&&t.currentUrl===`nextclaw://new-tab`}function Z0(e,t,n,r){let{activate:i,dedupeKey:a,newTab:o,title:s}=r??{},c=a?.trim()||n.dedupeKey,l=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0],u=c?t.tabs.find(e=>e.dedupeKey===c):void 0;if(u){let a=V0(t,u.id,t=>Y0(e,t,n,r,c)),o=i!==!1,s=o?u.id:t.activeTabId,l={...a,activeTabId:s,isOpen:!0};return o||u.id===t.activeTabId?K0(e,l,G0(u.id,n)):l}if(o||c||!l||l.kind!==n.kind){let i=Rn(n.url,n.kind,s??n.title,c,n.resourceUri??n.url,r?.dockIcon??n.dockIcon);return X0(t,l)?{...t,isOpen:!0,tabs:[i],activeTabId:i.id,activeHistory:[kn(i)],activeHistoryIndex:0}:K0(e,{...t,isOpen:!0,tabs:[...t.tabs,i],activeTabId:i.id},kn(i))}return K0(e,{...H0(t,t=>Y0(e,t,n,r,c)),isOpen:!0},G0(t.activeTabId,n))}function Q0(e,t,n,r){let i=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0];return Z0(e,t,e.resolveOpenTarget({activeTab:i,kind:r?.kind,url:n}),r)}var $0=class{constructor(e=B0,t){this.routeResolver=e,this.onRightPanelOpened=t,this.setSnapshot=e=>{Bn.getState().setSnapshot(e)},this.open=(e,t)=>{this.setSnapshot(n=>Q0(this.routeResolver,n,e,t)),this.onRightPanelOpened?.()},this.openTarget=(e,t)=>{this.setSnapshot(n=>Z0(this.routeResolver,n,e,{...t,dedupeKey:t?.dedupeKey??e.dedupeKey,kind:t?.kind??e.kind,title:t?.title??e.title})),this.onRightPanelOpened?.()},this.openNewTab=()=>{this.open(void 0,{kind:Fn,newTab:!0})},this.close=()=>{this.setSnapshot(e=>({...e,isOpen:!1}))},this.toggleMode=()=>{this.setSnapshot(e=>({...e,mode:e.mode===`floating`?`docked`:`floating`})),this.onRightPanelOpened?.()},this.setDockedWidth=e=>{this.setSnapshot(t=>({...t,dockedWidth:Vn(e)}))},this.navigate=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Rn(jn(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id,isOpen:!0}}let n=H0(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...U0(t,n.url),kind:n.kind,navVersion:t.navVersion+1,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?K0(this.routeResolver,n,kn(r)):n})},this.syncUrl=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Rn(jn(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id}}let n=H0(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,kind:t.kind,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...U0(t,n.url),kind:n.kind,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?K0(this.routeResolver,n,kn(r)):n})},this.goBack=()=>{this.setSnapshot(e=>{let t=su({entries:e.activeHistory,index:e.activeHistoryIndex},`back`);return t?J0(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.goForward=()=>{this.setSnapshot(e=>{let t=su({entries:e.activeHistory,index:e.activeHistoryIndex},`forward`);return t?J0(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.closeTab=e=>{this.setSnapshot(t=>{if(t.tabs.length<=1)return{...Pn(),isOpen:!1};let n=t.tabs.findIndex(t=>t.id===e);if(n<0)return t;let r=t.tabs.filter(t=>t.id!==e),i=t.activeTabId===e?r[Math.max(0,n-1)]?.id??r[0].id:t.activeTabId,a={...t,tabs:r,activeTabId:i},o=r.find(e=>e.id===i)??r[0],s=cu({entries:a.activeHistory,index:a.activeHistoryIndex},t=>t.tabId!==e,kn(o)),c={...a,activeHistory:[...s.entries],activeHistoryIndex:s.index};return t.activeTabId===e?K0(this.routeResolver,c,kn(o)):c})},this.setActiveTab=e=>{this.setSnapshot(t=>{if(!t.tabs.some(t=>t.id===e))return t;let n=t.tabs.find(t=>t.id===e);return n?K0(this.routeResolver,{...t,activeTabId:e,isOpen:!0},kn(n)):t})}}};function e2(e){return e.activeWorkspacePanelKind!=null}var t2=class{constructor(){this.accountManager=new Rs,this.rightPanelResourceRouteResolver=new $K,this.notifyRightPanelOpened=()=>{let e=Bn.getState().snapshot,t=L.getState().snapshot;mn.collapseSidebarForDenseRightPanels({isDocBrowserDocked:e.mode===`docked`,isDocBrowserOpen:e.isOpen,isWorkspacePanelOpen:e2(t)})},this.docBrowserManager=new $0(this.rightPanelResourceRouteResolver,this.notifyRightPanelOpened),this.sideDockManager=new z0(this.docBrowserManager),this.chatDraftIntentManager=new e0,this.serviceActionAuthorizationManager=new ZG,this.panelAppBridgeManager=new VG(this.serviceActionAuthorizationManager),this.remoteAccessManager=new Es({accountManager:this.accountManager})}},n2=null;function r2(){return n2??=new t2,n2}function i2(){return r2()}var a2=globalThis,o2=a2.__NEXTCLAW_APP_PRESENTER_CONTEXT__??(0,P.createContext)(null);a2.__NEXTCLAW_APP_PRESENTER_CONTEXT__=o2;function s2({children:e}){let t=(0,P.useMemo)(()=>r2(),[]);return(0,F.jsx)(o2.Provider,{value:t,children:e})}function c2(){let e=(0,P.useContext)(o2);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}export{ts as $,ku as A,Is as B,XZ as C,Au as D,JG as E,sl as F,_s as G,As as H,ol as I,Ss as J,bs as K,rc as L,Pl as M,Fl as N,Mu as O,Il as P,as as Q,ic as R,uQ as S,sq as T,Es as U,js as V,Ts as W,gs as X,ws as Y,ms as Z,B$ as _,li as _t,y0 as a,uo as at,RQ as b,U1 as c,Qa as ct,x1 as d,Ni as dt,Jo as et,b1 as f,Pi as ft,V$ as g,si as gt,e1 as h,ii as ht,M0 as i,Oo as it,Ll as j,ju as k,L1 as l,Ya as lt,f1 as m,Li as mt,c2 as n,Ho as nt,t0 as o,lo as ot,y1 as p,Fi as pt,xs as q,i2 as r,Lo as rt,$1 as s,to as st,s2 as t,qo as tt,C1 as u,Ca as ut,GQ as v,_q as w,LQ as x,VQ as y,Ls as z};