@nextclaw/ui 0.15.4 → 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 (226) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/assets/abnfDiagram-VRR7QNED-BYpK0F5F.js +1 -0
  3. package/dist/assets/{aiden0z-pptx-renderer.es-Bd99vut2.js → aiden0z-pptx-renderer.es-D87ywFdC.js} +1 -1
  4. package/dist/assets/{api-BOXOrpcJ.js → api-IlX_CbwU.js} +2 -2
  5. package/dist/assets/app-presenter-provider-Bbl_MVbg.js +106 -0
  6. package/dist/assets/{appearance-settings-page-fLIJbx1C.js → appearance-settings-page-80fLa4-9.js} +1 -1
  7. package/dist/assets/arc-DFELHWM2.js +1 -0
  8. package/dist/assets/architecture-TIHT7OUA-ClwVFq-K.js +1 -0
  9. package/dist/assets/architectureDiagram-ZJ3FMSHR-CvRhdovL.js +36 -0
  10. package/dist/assets/array-BqYdCIE6.js +1 -0
  11. package/dist/assets/blockDiagram-677ZJIJ3-DVYNkbR_.js +132 -0
  12. package/dist/assets/{book-open-DWUjS6aW.js → book-open-CN7Shpij.js} +1 -1
  13. package/dist/assets/c4Diagram-LMCZKHZV-B1w-iwRe.js +10 -0
  14. package/dist/assets/channel-BEHOSFc5.js +1 -0
  15. package/dist/assets/{channels-list-page-CvCTJraa.js → channels-list-page-R7M6pzp6.js} +1 -1
  16. package/dist/assets/{chat-page-B42UUIFR.js → chat-page-152YuwfU.js} +1 -1
  17. package/dist/assets/chunk-2Q5K7J3B-DrIhesSX.js +1 -0
  18. package/dist/assets/chunk-32BRIVSS-kG3lg0bC.js +1 -0
  19. package/dist/assets/chunk-52WLFC77-BLeB7iGk.js +10 -0
  20. package/dist/assets/chunk-5FCAYU7R-BQga1Rr7.js +1 -0
  21. package/dist/assets/chunk-5HE753X5-DU81hkcF.js +1 -0
  22. package/dist/assets/chunk-5JV3BV7I-C2bAx0m7.js +1 -0
  23. package/dist/assets/chunk-5TONJI2A-BExIIgWY.js +2 -0
  24. package/dist/assets/chunk-5VM5RSS4-C3XB05yh.js +15 -0
  25. package/dist/assets/chunk-7BUUIJ7U-JiyRtrGu.js +1 -0
  26. package/dist/assets/chunk-BIQX33UG-BZRV20pI.js +1 -0
  27. package/dist/assets/chunk-C7G6YPKG-AsyDSQ9j.js +1 -0
  28. package/dist/assets/chunk-CQNSW5MT-iN-fiXVA.js +1 -0
  29. package/dist/assets/chunk-CYSBUYHQ-DhC_TRzI.js +1 -0
  30. package/dist/assets/chunk-EMLP6XTP-QFLK8R6d.js +1 -0
  31. package/dist/assets/chunk-EX3LRPZG-DzUwhkCz.js +231 -0
  32. package/dist/assets/chunk-FWX5IMBZ-DFelpZBy.js +2 -0
  33. package/dist/assets/chunk-HOUHSVGY-BMPwFEwN.js +1 -0
  34. package/dist/assets/chunk-ICXQ74PX-DH8NJMok.js +2 -0
  35. package/dist/assets/chunk-JG7HCLWE-D-95AsO4.js +2 -0
  36. package/dist/assets/chunk-JWPE2WC7-DIaTv8kx.js +1 -0
  37. package/dist/assets/chunk-KEIR6QF5-A3jEqwzn.js +161 -0
  38. package/dist/assets/chunk-MOJQB5TN-BPFLzWgj.js +88 -0
  39. package/dist/assets/chunk-MOZMSUNE-DR_fzxG0.js +1 -0
  40. package/dist/assets/chunk-OGEWGWER-TIcEoPPH.js +1 -0
  41. package/dist/assets/chunk-OSBZ3O6U-BALNvSfG.js +1 -0
  42. package/dist/assets/chunk-PUDLZKDR-I-EXhf_k.js +156 -0
  43. package/dist/assets/chunk-Q4XR5HBZ-uvIGstBS.js +70 -0
  44. package/dist/assets/chunk-QBLGF6JB-r-TjLdxa.js +1 -0
  45. package/dist/assets/chunk-R7FJI6CG-N-1LDgvy.js +1 -0
  46. package/dist/assets/chunk-RYQCIY6F-jxNASx65.js +1 -0
  47. package/dist/assets/chunk-U6XO7XAA-Cphbuc7q.js +2 -0
  48. package/dist/assets/chunk-V7JOEXUC-BLEuBf1s.js +206 -0
  49. package/dist/assets/chunk-VAUOI2AC-Dpcz6BhT.js +1 -0
  50. package/dist/assets/chunk-VR4S4FIN-BAUbR0ke.js +1 -0
  51. package/dist/assets/chunk-WYO6CB5R-Do6SJrnY.js +127 -0
  52. package/dist/assets/chunk-XXDRQBXY-C2QjjwYX.js +1 -0
  53. package/dist/assets/chunk-Y2CYZVJY-BGrd8tLy.js +1 -0
  54. package/dist/assets/chunk-YOTPTUD7-CQqvMTCr.js +1 -0
  55. package/dist/assets/chunk-ZGVPDNZ5-B7kWWaXv.js +62 -0
  56. package/dist/assets/chunk-ZIRB5QZD-DTU0cDNh.js +32 -0
  57. package/dist/assets/classDiagram-OUVF2IWQ-DESMaY3_.js +1 -0
  58. package/dist/assets/classDiagram-v2-EOCWNBFH-DwOlByYH.js +1 -0
  59. package/dist/assets/{config-split-page-DBgt9S8b.js → config-split-page-BlfvfmTm.js} +1 -1
  60. package/dist/assets/{confirm-dialog-GSXIvoRU.js → confirm-dialog-Dt8Kdbgp.js} +1 -1
  61. package/dist/assets/cose-bilkent-JH36ORCC-B9LrtV-q.js +1 -0
  62. package/dist/assets/cynefin-VYW2F7L2-CzjeeOq9.js +1 -0
  63. package/dist/assets/cynefinDiagram-TSTJHNR4-BfjvW4su.js +62 -0
  64. package/dist/assets/cytoscape.esm-CRW8q92n.js +321 -0
  65. package/dist/assets/dagre-DkiXZKkL.js +1 -0
  66. package/dist/assets/dagre-VKFMJZFB-B1pQKQSY.js +4 -0
  67. package/dist/assets/defaultLocale-Cdv9x6q7.js +1 -0
  68. package/dist/assets/{desktop-update-config-7bmNeWIC.js → desktop-update-config-DreMJu9z.js} +1 -1
  69. package/dist/assets/diagram-FQU43EPY-cB4EZdaP.js +3 -0
  70. package/dist/assets/diagram-G47NLZAW-CtW8im1B.js +24 -0
  71. package/dist/assets/diagram-NH7WQ7WH-BDCtrCCm.js +24 -0
  72. package/dist/assets/diagram-OA4YK3LP-DEMJ42Gt.js +30 -0
  73. package/dist/assets/diagram-WEI45ONY-CdCcxSYU.js +41 -0
  74. package/dist/assets/{dist-DC7f4TJH.js → dist-D5ycbwCo.js} +1 -1
  75. package/dist/assets/dist-dw-gAfM_.js +1 -0
  76. package/dist/assets/{doc-browser-D0monHjG.js → doc-browser-C9u7N9vH.js} +1 -1
  77. package/dist/assets/doc-browser-DJQ5XPsi2.js +1 -0
  78. package/dist/assets/{doc-browser-context-CGwEOhBy.js → doc-browser-context-CCdW9TJf.js} +1 -1
  79. package/dist/assets/{docx-preview-eFH9DRsS.js → docx-preview-zis3U0Fa.js} +1 -1
  80. package/dist/assets/{download-DiP9zx-J.js → download-CyPgglKr.js} +1 -1
  81. package/dist/assets/ebnfDiagram-CCIWWBDH-DBZETBwE.js +1 -0
  82. package/dist/assets/erDiagram-Q63AITRT-y2zDXprP.js +85 -0
  83. package/dist/assets/eventmodeling-45OFAUF4-C38BqG8w.js +1 -0
  84. package/dist/assets/{external-link-C6ZeSPef.js → external-link-BahW1sl3.js} +1 -1
  85. package/dist/assets/{eye-suvKmtwn.js → eye-D8gGXMkD.js} +1 -1
  86. package/dist/assets/flowDiagram-23GEKE2U-BoKk8RRq.js +1 -0
  87. package/dist/assets/{folder-CMELbQGG.js → folder-DGWqFDvE.js} +1 -1
  88. package/dist/assets/{form-actions-CUAzpNe_.js → form-actions-D2imZLnU.js} +1 -1
  89. package/dist/assets/ganttDiagram-NO4QXBWP-D2DP344e.js +292 -0
  90. package/dist/assets/gitGraph-TEB2WS4Q-IsQHHJuS.js +1 -0
  91. package/dist/assets/gitGraphDiagram-IHSO6WYX-D37uiwA2.js +106 -0
  92. package/dist/assets/graphlib-BcNFQr5y.js +1 -0
  93. package/dist/assets/index-0av6WO9-.css +1 -0
  94. package/dist/assets/index-CT0iYlxV.js +2 -0
  95. package/dist/assets/info-DKCQHKI2-ofy2qlHI.js +1 -0
  96. package/dist/assets/infoDiagram-FWYZ7A6U-CG-WAIRi.js +2 -0
  97. package/dist/assets/init-D8TjIqfm.js +1 -0
  98. package/dist/assets/ishikawaDiagram-FXEZZL3T-WeCTnW0f.js +70 -0
  99. package/dist/assets/journeyDiagram-5HDEW3XC-DUFBW9Td.js +139 -0
  100. package/dist/assets/kanban-definition-HUTT4EX6-B0lxgMpg.js +89 -0
  101. package/dist/assets/katex-wEmrEFTg.js +257 -0
  102. package/dist/assets/line-B78frP_c.js +1 -0
  103. package/dist/assets/linear-C6lVEcb2.js +1 -0
  104. package/dist/assets/loader-circle-DtKek-qG.js +1 -0
  105. package/dist/assets/{logo-badge-Cu5UGH_4.js → logo-badge-CuPetu-v.js} +1 -1
  106. package/dist/assets/map-Bdri5UL5.js +1 -0
  107. package/dist/assets/mcp-marketplace-page-4qMwFDpz.js +1 -0
  108. package/dist/assets/{mcp-marketplace-page-BUzHDwW6.js → mcp-marketplace-page-BbxN5aZF.js} +1 -1
  109. package/dist/assets/mermaid-parser.core-Cue18vLo.js +4 -0
  110. package/dist/assets/mermaid.core-CXwWRh5i.js +11 -0
  111. package/dist/assets/mindmap-definition-LN4V7U3C-CFxz0P0-.js +96 -0
  112. package/dist/assets/{model-config-page-CWP6pyBm.js → model-config-page-DiJcvBML.js} +1 -1
  113. package/dist/assets/ordinal-Cbd8t4LB.js +1 -0
  114. package/dist/assets/packet-7NZHBO7P-Rfopfa1o.js +1 -0
  115. package/dist/assets/path-DzBnMI1r.js +1 -0
  116. package/dist/assets/pegDiagram-2B236MQR-B_Qt9zyT.js +1 -0
  117. package/dist/assets/pie-RZYD4A2V-CJR1xKEv.js +1 -0
  118. package/dist/assets/pieDiagram-ENE6RG2P-CRQdSuwS.js +39 -0
  119. package/dist/assets/plus-BwgE-Zwf.js +1 -0
  120. package/dist/assets/{popover-DImguRok.js → popover-Btp7KVc3.js} +1 -1
  121. package/dist/assets/preload-helper-D4M6sveU.js +1 -0
  122. package/dist/assets/{provider-scoped-model-input-CE7p4SbJ.js → provider-scoped-model-input-DZMtoAJG.js} +1 -1
  123. package/dist/assets/{providers-config-page-BKPo8SjH.js → providers-config-page-DfiWveEF.js} +1 -1
  124. package/dist/assets/quadrantDiagram-ABIIQ3AL-D5kPpttq.js +7 -0
  125. package/dist/assets/radar-I7S5WNFK-CDg8Z-1r.js +1 -0
  126. package/dist/assets/railroad-3IZDKUUU-BHnNmjxO.js +1 -0
  127. package/dist/assets/railroad-abnf-AHOZXSZD-DGtNcusW.js +1 -0
  128. package/dist/assets/railroad-ebnf-EBAXGLYW-BRFtsQmm.js +1 -0
  129. package/dist/assets/railroad-peg-LSFZ7HO6-Bj5IypCA.js +1 -0
  130. package/dist/assets/railroadDiagram-RFXS5EU6-DGh_TGlQ.js +1 -0
  131. package/dist/assets/{react-5sjAT_6d.js → react-BY-U3h3t.js} +1 -1
  132. package/dist/assets/{refresh-cw-CHLBzWWj.js → refresh-cw-Cme5qFej.js} +1 -1
  133. package/dist/assets/remote-BaVECEZw.js +1 -0
  134. package/dist/assets/requirementDiagram-TGXJPOKE-EmFph0H_.js +84 -0
  135. package/dist/assets/rotate-cw-CMRZxIkH.js +1 -0
  136. package/dist/assets/rough.esm-wJ1d3nQl.js +1 -0
  137. package/dist/assets/{runtime-config-page-1Axv4QGu.js → runtime-config-page-wygwvMB4.js} +1 -1
  138. package/dist/assets/sankeyDiagram-HTMAVEWB-BXWB5Ugi.js +40 -0
  139. package/dist/assets/{save-BABzyrjB.js → save-DNg2yJTS.js} +1 -1
  140. package/dist/assets/{search-BTqxG3ZG.js → search-3ykfrAFt.js} +1 -1
  141. package/dist/assets/{search-config-page-BkKKmxmS.js → search-config-page-DrVKa_Ls.js} +1 -1
  142. package/dist/assets/{secrets-config-page-CWJMyu-k.js → secrets-config-page-B39uQ5kF.js} +1 -1
  143. package/dist/assets/security-config-BPzet76z.js +1 -0
  144. package/dist/assets/{select-TYZDBNmq.js → select-B5EecXJt.js} +1 -1
  145. package/dist/assets/sequenceDiagram-DBY2YBRQ-ClKnO7v0.js +162 -0
  146. package/dist/assets/{setting-row-DR23Z_5I.js → setting-row-Qv1Ps79v.js} +1 -1
  147. package/dist/assets/{settings-2-D8WWcBnw.js → settings-2-D-3um9Az.js} +1 -1
  148. package/dist/assets/sizeCapture-X5ZJPWSS-DSo-t5ou.js +1 -0
  149. package/dist/assets/{skeleton-CloHeg0S.js → skeleton-BgkzQd4U.js} +1 -1
  150. package/dist/assets/src-Dad2ZbCt.js +1 -0
  151. package/dist/assets/stateDiagram-2N3HPSRC-BvAalBfz.js +1 -0
  152. package/dist/assets/stateDiagram-v2-6OUMAXLB-CfMU38yc.js +1 -0
  153. package/dist/assets/swimlanes-5IMT3BWC-DdVqVa1a.js +2 -0
  154. package/dist/assets/swimlanesDiagram-G3AALYLV-D9Zb9X57.js +8 -0
  155. package/dist/assets/{tabs-CX-ckWoo.js → tabs-BVD8gp3y.js} +1 -1
  156. package/dist/assets/{tag-chip-mCc23Rhb.js → tag-chip-0qn-f3Bo.js} +1 -1
  157. package/dist/assets/timeline-definition-FHXFAJF6-D4ar8IQY.js +120 -0
  158. package/dist/assets/{trash-2-SAW1Z4Po.js → trash-2-cnsMppRC.js} +1 -1
  159. package/dist/assets/treeView-QDETBFTQ-Uy7M0WvH.js +1 -0
  160. package/dist/assets/treemap-6X3UGDF4-BJfGV7KX.js +1 -0
  161. package/dist/assets/{use-config-BucdaK23.js → use-config-D6yx0lb0.js} +1 -1
  162. package/dist/assets/{use-confirm-dialog-C95F6sT1.js → use-confirm-dialog-C_o0eQeH.js} +1 -1
  163. package/dist/assets/{use-viewport-layout-C6m3Nte7.js → use-viewport-layout-BWav4KCL.js} +1 -1
  164. package/dist/assets/vennDiagram-L72KCM5P-CDXJ_i3p.js +34 -0
  165. package/dist/assets/wardley-OPB4EBWU-q263iF3K.js +1 -0
  166. package/dist/assets/wardleyDiagram-EHGQE667-D-dSuT_7.js +78 -0
  167. package/dist/assets/x-B3o1dWR5.js +1 -0
  168. package/dist/assets/xychartDiagram-FW5EYKEG-C9JCzsZF.js +7 -0
  169. package/dist/index.html +33 -32
  170. package/package.json +5 -5
  171. package/src/features/chat/components/chat-popover-content.tsx +1 -26
  172. package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +1 -0
  173. package/src/features/chat/features/conversation/components/session-conversation-input.tsx +28 -11
  174. package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +43 -0
  175. package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +14 -10
  176. package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +51 -0
  177. package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +61 -21
  178. package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +42 -10
  179. package/src/features/chat/features/message/components/chat-inline-file-preview.tsx +80 -0
  180. package/src/features/chat/features/message/components/chat-message-list.container.tsx +55 -60
  181. package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +2 -0
  182. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +22 -24
  183. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +2 -1
  184. package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +6 -17
  185. package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +41 -19
  186. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +5 -1
  187. package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +5 -1
  188. package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +104 -3
  189. package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +83 -0
  190. package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +4 -1
  191. package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +96 -25
  192. package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +25 -0
  193. package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +5 -1
  194. package/src/features/chat/managers/chat-session-list.manager.ts +1 -0
  195. package/src/features/chat/managers/chat-thread.manager.ts +15 -37
  196. package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +9 -0
  197. package/src/features/chat/stores/chat-thread.store.ts +16 -36
  198. package/src/features/chat/types/chat-input-bar.types.ts +2 -0
  199. package/src/shared/components/common/__tests__/brand-header.test.tsx +17 -7
  200. package/src/shared/components/common/brand-header.tsx +34 -34
  201. package/src/shared/hooks/use-server-path-read.ts +10 -5
  202. package/src/shared/lib/api/types.ts +3 -3
  203. package/src/shared/lib/api/utils/server-path.utils.ts +1 -0
  204. package/src/shared/lib/i18n/locales/en-US/chat.json +8 -0
  205. package/src/shared/lib/i18n/locales/zh-CN/chat.json +8 -0
  206. package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +1 -4
  207. package/src/shared/lib/session-project/workspace-file-breadcrumb.utils.ts +1 -18
  208. package/dist/assets/app-presenter-provider-CkHLbvZQ.js +0 -106
  209. package/dist/assets/doc-browser-CgdoLUT92.js +0 -1
  210. package/dist/assets/index-BFeNDQ4R.css +0 -1
  211. package/dist/assets/index-D_6U-M94.js +0 -2
  212. package/dist/assets/loader-circle-tYHStefV.js +0 -1
  213. package/dist/assets/mcp-marketplace-page-ohUAdfqJ.js +0 -1
  214. package/dist/assets/plus-tywizkeY.js +0 -1
  215. package/dist/assets/remote-DXJryUxB.js +0 -1
  216. package/dist/assets/rotate-cw-BefO5brU.js +0 -1
  217. package/dist/assets/security-config-DeQUIXfi.js +0 -1
  218. package/dist/assets/x-DtCPHwCu.js +0 -1
  219. package/src/features/chat/components/__tests__/chat-popover-content.test.tsx +0 -41
  220. package/src/features/chat/components/layout/__tests__/chat-sidebar-utility-menu.test.tsx +0 -55
  221. /package/dist/assets/{config-hints-fDrYfl0l.js → config-hints-LxG80Uj5.js} +0 -0
  222. /package/dist/assets/{host-capabilities-zZvY9U63.js → host-capabilities-CFbAfrrA.js} +0 -0
  223. /package/dist/assets/{jszip.min-Das2IAnb.js → jszip.min-CP5uPNQa.js} +0 -0
  224. /package/dist/assets/{middleware-BLMHv9YF.js → middleware-CAXxl-af.js} +0 -0
  225. /package/dist/assets/{provider-models-C_yOh6DE.js → provider-models-BoUhFo9R.js} +0 -0
  226. /package/dist/assets/{xlsx-B6zVt1RK.js → xlsx-DUqJhg5u.js} +0 -0
@@ -1,106 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/docx-preview-eFH9DRsS.js","assets/chunk-DseTPa7n.js","assets/jszip.min-Das2IAnb.js","assets/aiden0z-pptx-renderer.es-Bd99vut2.js","assets/doc-browser-CgdoLUT92.js","assets/doc-browser-D0monHjG.js","assets/dist-DC7f4TJH.js","assets/react-5sjAT_6d.js","assets/popover-DImguRok.js","assets/search-BTqxG3ZG.js","assets/external-link-C6ZeSPef.js","assets/plus-tywizkeY.js","assets/refresh-cw-CHLBzWWj.js","assets/x-DtCPHwCu.js","assets/doc-browser-context-CGwEOhBy.js","assets/middleware-BLMHv9YF.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-5sjAT_6d.js";import{At as h,B as g,Bt as _,C as v,Ct as y,Dt as b,Ft as x,G as S,Ht as C,It as w,Jt as T,Kt as E,L as D,Lt as O,Nt as k,Ot as A,Pt as ee,Rt as j,S as te,St as M,Tt as ne,Ut as re,Vt as ie,W as ae,Wt as oe,X as se,Z as ce,_ as le,_t as ue,a as de,an as fe,b as pe,bt as me,c as he,d as ge,dt as _e,ft as ve,g as ye,h as be,i as xe,jt as Se,kt as Ce,l as we,lt as Te,m as Ee,n as De,o as Oe,p as ke,pt as Ae,qt as je,r as Me,s as Ne,t as Pe,u as Fe,ut as Ie,v as Le,vt as Re,x as ze,y as Be,yt as Ve,zt as He}from"./api-BOXOrpcJ.js";import{c as N}from"./dist-DC7f4TJH.js";import{a as Ue,c as We,i as Ge,l as Ke,o as qe,r as Je,s as Ye,t as Xe,u as Ze}from"./popover-DImguRok.js";import{a as Qe,i as $e,n as et,o as tt,r as nt,s as rt,t as it}from"./confirm-dialog-GSXIvoRU.js";import{n as at,t as ot}from"./search-BTqxG3ZG.js";import{_ as st,a as ct,c as lt,d as ut,f as dt,g as ft,h as pt,i as mt,l as ht,m as gt,n as _t,o as vt,p as yt,r as bt,s as xt,u as St,v as Ct}from"./doc-browser-D0monHjG.js";import{t as wt}from"./book-open-DWUjS6aW.js";import{C as Tt,S as Et,_ as Dt,a as Ot,b as kt,c as At,d as jt,f as Mt,g as Nt,h as Pt,i as Ft,l as It,m as Lt,n as Rt,o as zt,p as Bt,r as Vt,s as Ht,t as Ut,u as Wt,v as Gt,w as Kt,x as qt,y as Jt}from"./select-TYZDBNmq.js";import{a as Yt,o as Xt,r as Zt,s as Qt,t as $t}from"./use-confirm-dialog-C95F6sT1.js";import{t as en}from"./download-DiP9zx-J.js";import{t as tn}from"./external-link-C6ZeSPef.js";import{t as nn}from"./eye-suvKmtwn.js";import{t as rn}from"./folder-CMELbQGG.js";import{a as an,c as on,i as sn,o as cn,r as ln,s as un,t as dn}from"./tabs-CX-ckWoo.js";import{i as fn,n as pn,r as mn,t as hn}from"./use-viewport-layout-C6m3Nte7.js";import{t as gn}from"./loader-circle-tYHStefV.js";import{t as _n}from"./plus-tywizkeY.js";import{t as vn}from"./refresh-cw-CHLBzWWj.js";import{n as yn,t as bn}from"./skeleton-CloHeg0S.js";import{t as xn}from"./trash-2-SAW1Z4Po.js";import{t as Sn}from"./x-DtCPHwCu.js";import{n as Cn,t as wn}from"./logo-badge-Cu5UGH_4.js";import{t as Tn}from"./host-capabilities-zZvY9U63.js";import{n as En,t as Dn}from"./middleware-BLMHv9YF.js";import{a as On,c as kn,d as An,g as jn,h as Mn,i as Nn,l as Pn,m as Fn,n as In,o as Ln,p as Rn,r as zn,s as Bn}from"./doc-browser-context-CGwEOhBy.js";import{c as Vn,n as Hn,r as Un}from"./provider-models-C_yOh6DE.js";var Wn=`modulepreload`,Gn=function(e){return`/`+e},Kn={},qn=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Gn(t,n),t in Kn)return;Kn[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Wn,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},P=e(o(),1),Jn=`popstate`;function Yn(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=tr(i?l().pathname:`/`,e,t,n);return Qn(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),r}function d(e){return typeof e==`string`?e:nr(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`?rr(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 Xn(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return tr(``,{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:nr(t)}return ir(t,n,null,e)}function Zn(e,t){if(e===!1||e==null)throw Error(t)}function Qn(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function $n(){return Math.random().toString(36).substring(2,10)}function er(e,t){return{usr:e.state,key:e.key,idx:t}}function tr(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?rr(t):t,state:n,key:t&&t.key||r||$n()}}function nr({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 rr(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 ir(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=tr(h.location,e,t);n&&n(r,e),l=u()+1;let d=er(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=tr(h.location,e,t);n&&n(r,e),l=u();let i=er(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ar(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(Jn,d),c=e,()=>{i.removeEventListener(Jn,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 ar(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),Zn(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:nr(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function or(e,t,n=`/`){return sr(e,t,n,!1)}function sr(e,t,n,r){let i=Tr((typeof t==`string`?rr(t):t).pathname||`/`,n);if(i==null)return null;let a=lr(e);dr(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=wr(i);o=xr(a[e],t,r)}return o}function cr(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 lr(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;Zn(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=Nr([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Zn(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),lr(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:yr(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ur(e.path))a(e,t,!0,n)}),t}function ur(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=ur(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 dr(e){e.sort((e,t)=>e.score===t.score?br(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var fr=/^:[\w-]+$/,pr=3,mr=2,hr=1,gr=10,_r=-2,vr=e=>e===`*`;function yr(e,t){let n=e.split(`/`),r=n.length;return n.some(vr)&&(r+=_r),t&&(r+=mr),n.filter(e=>!vr(e)).reduce((e,t)=>e+(fr.test(t)?pr:t===``?hr:gr),r)}function br(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 xr(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=Sr({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Sr({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Nr([a,u.pathname]),pathnameBase:Pr(Nr([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Nr([a,u.pathnameBase]))}return o}function Sr(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Cr(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 Cr(e,t=!1,n=!0){Qn(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 wr(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Qn(!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 Tr(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 Er=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Dr(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?rr(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?Or(n.substring(1),`/`):Or(n,t)):a=t,{pathname:a,search:Fr(r),hash:Ir(i)}}function Or(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 kr(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 Ar(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function jr(e){let t=Ar(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Mr(e,t,n,r=!1){let i;typeof e==`string`?i=rr(e):(i={...e},Zn(!i.pathname||!i.pathname.includes(`?`),kr(`?`,`pathname`,`search`,i)),Zn(!i.pathname||!i.pathname.includes(`#`),kr(`#`,`pathname`,`hash`,i)),Zn(!i.search||!i.search.includes(`#`),kr(`#`,`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=Dr(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Nr=e=>e.join(`/`).replace(/\/\/+/g,`/`),Pr=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Fr=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ir=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Lr=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 Rr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function zr(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var Br=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Vr(e,t){let n=e;if(typeof n!=`string`||!Er.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Br)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Tr(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Qn(!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 Hr=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Hr);var Ur=[`GET`,...Hr];new Set(Ur);var Wr=P.createContext(null);Wr.displayName=`DataRouter`;var Gr=P.createContext(null);Gr.displayName=`DataRouterState`;var Kr=P.createContext(!1),qr=P.createContext({isTransitioning:!1});qr.displayName=`ViewTransition`;var Jr=P.createContext(new Map);Jr.displayName=`Fetchers`;var Yr=P.createContext(null);Yr.displayName=`Await`;var Xr=P.createContext(null);Xr.displayName=`Navigation`;var Zr=P.createContext(null);Zr.displayName=`Location`;var Qr=P.createContext({outlet:null,matches:[],isDataRoute:!1});Qr.displayName=`Route`;var $r=P.createContext(null);$r.displayName=`RouteError`;var ei=`REACT_ROUTER_ERROR`,ti=`REDIRECT`,ni=`ROUTE_ERROR_RESPONSE`;function ri(e){if(e.startsWith(`${ei}:${ti}:{`))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 ii(e){if(e.startsWith(`${ei}:${ni}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Lr(t.status,t.statusText,t.data)}catch{}}function ai(e,{relative:t}={}){Zn(oi(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=P.useContext(Xr),{hash:i,pathname:a,search:o}=pi(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Nr([n,a])),r.createHref({pathname:s,search:o,hash:i})}function oi(){return P.useContext(Zr)!=null}function si(){return Zn(oi(),`useLocation() may be used only in the context of a <Router> component.`),P.useContext(Zr).location}var ci=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function li(e){P.useContext(Xr).static||P.useLayoutEffect(e)}function ui(){let{isDataRoute:e}=P.useContext(Qr);return e?Mi():di()}function di(){Zn(oi(),`useNavigate() may be used only in the context of a <Router> component.`);let e=P.useContext(Wr),{basename:t,navigator:n}=P.useContext(Xr),{matches:r}=P.useContext(Qr),{pathname:i}=si(),a=JSON.stringify(jr(r)),o=P.useRef(!1);return li(()=>{o.current=!0}),P.useCallback((r,s={})=>{if(Qn(o.current,ci),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Mr(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Nr([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}P.createContext(null);function fi(){let{matches:e}=P.useContext(Qr),t=e[e.length-1];return t?t.params:{}}function pi(e,{relative:t}={}){let{matches:n}=P.useContext(Qr),{pathname:r}=si(),i=JSON.stringify(jr(n));return P.useMemo(()=>Mr(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function mi(e,t){return hi(e,t)}function hi(e,t,n,r,i){Zn(oi(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=P.useContext(Xr),{matches:o}=P.useContext(Qr),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||``;Pi(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=si(),p;if(t){let e=typeof t==`string`?rr(t):t;Zn(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=or(e,{pathname:h});Qn(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Qn(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 _=Si(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:Nr([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:Nr([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?P.createElement(Zr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function gi(){let e=ji(),t=Rr(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 _i=P.createElement(gi,null),vi=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=ii(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:P.createElement(Qr.Provider,{value:this.props.routeContext},P.createElement($r.Provider,{value:e,children:this.props.component}));return this.context?P.createElement(bi,{error:e},t):t}};vi.contextType=Kr;var yi=new WeakMap;function bi({children:e,error:t}){let{basename:n}=P.useContext(Xr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ri(t.digest);if(e){let r=yi.get(t);if(r)throw r;let i=Vr(e.location,n);if(Br&&!yi.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 yi.set(t,n),n}return P.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function xi({routeContext:e,match:t,children:n}){let r=P.useContext(Wr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),P.createElement(Qr.Provider,{value:e},n)}function Si(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);Zn(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:zr(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||_i,s&&(c<0&&i===0?(Pi(`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(xi,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?P.createElement(vi,{location:n.location,revalidation:n.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Ci(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wi(e){let t=P.useContext(Wr);return Zn(t,Ci(e)),t}function Ti(e){let t=P.useContext(Gr);return Zn(t,Ci(e)),t}function Ei(e){let t=P.useContext(Qr);return Zn(t,Ci(e)),t}function Di(e){let t=Ei(e),n=t.matches[t.matches.length-1];return Zn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Oi(){return Di(`useRouteId`)}function ki(){return Ti(`useNavigation`).navigation}function Ai(){let{matches:e,loaderData:t}=Ti(`useMatches`);return P.useMemo(()=>e.map(e=>cr(e,t)),[e,t])}function ji(){let e=P.useContext($r),t=Ti(`useRouteError`),n=Di(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Mi(){let{router:e}=wi(`useNavigate`),t=Di(`useNavigate`),n=P.useRef(!1);return li(()=>{n.current=!0}),P.useCallback(async(r,i={})=>{Qn(n.current,ci),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ni={};function Pi(e,t,n){!t&&!Ni[e]&&(Ni[e]=!0,Qn(!1,n))}P.useOptimistic,P.memo(Fi);function Fi({routes:e,future:t,state:n,onError:r}){return hi(e,void 0,n,r,t)}function Ii({basename:e,children:t,initialEntries:n,initialIndex:r,unstable_useTransitions:i}){let a=P.useRef();a.current??=Yn({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(zi,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,unstable_useTransitions:i})}function Li({to:e,replace:t,state:n,relative:r}){Zn(oi(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=P.useContext(Xr);Qn(!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(Qr),{pathname:o}=si(),s=ui(),c=Mr(e,jr(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 Ri(e){Zn(!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 zi({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){Zn(!oi(),`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=rr(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`}=n,m=P.useMemo(()=>{let e=Tr(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 Qn(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(Xr.Provider,{value:c},P.createElement(Zr.Provider,{children:t,value:m}))}function Bi({children:e,location:t}){return mi(Vi(e),t)}P.Component;function Vi(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,Vi(e.props.children,i));return}Zn(e.type===Ri,`[${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>`),Zn(!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=Vi(e.props.children,i)),n.push(a)}),n}var Hi=`get`,Ui=`application/x-www-form-urlencoded`;function Wi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Gi(e){return Wi(e)&&e.tagName.toLowerCase()===`button`}function Ki(e){return Wi(e)&&e.tagName.toLowerCase()===`form`}function qi(e){return Wi(e)&&e.tagName.toLowerCase()===`input`}function Ji(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yi(e,t){return e.button===0&&(!t||t===`_self`)&&!Ji(e)}var Xi=null;function Zi(){if(Xi===null)try{new FormData(document.createElement(`form`),0),Xi=!1}catch{Xi=!0}return Xi}var Qi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $i(e){return e!=null&&!Qi.has(e)?(Qn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ui}"`),null):e}function ea(e,t){let n,r,i,a,o;if(Ki(e)){let o=e.getAttribute(`action`);r=o?Tr(o,t):null,n=e.getAttribute(`method`)||Hi,i=$i(e.getAttribute(`enctype`))||Ui,a=new FormData(e)}else if(Gi(e)||qi(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?Tr(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Hi,i=$i(e.getAttribute(`formenctype`))||$i(o.getAttribute(`enctype`))||Ui,a=new FormData(o,e),!Zi()){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(Wi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Hi,r=null,i=Ui,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 ta={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},na=/[&><\u2028\u2029]/g;function ra(e){return e.replace(na,e=>ta[e])}function ia(e,t){if(e===!1||e==null)throw Error(t)}function aa(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&&Tr(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function oa(e,t){if(e.id in t)return t[e.id];try{let n=await qn(()=>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 sa(e){return e!=null&&typeof e.page==`string`}function ca(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 la(e,t,n){return ma((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await oa(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ca).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function ua(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 da(e,t,{includeHydrateFallback:n}={}){return fa(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 fa(e){return[...new Set(e)]}function pa(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ma(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!sa(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(pa(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ha(){let e=P.useContext(Wr);return ia(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ga(){let e=P.useContext(Gr);return ia(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var _a=P.createContext(void 0);_a.displayName=`FrameworkContext`;function va(){let e=P.useContext(_a);return ia(e,`You must render this element inside a <HydratedRouter> element`),e}function ya(e,t){let n=P.useContext(_a),[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:ba(s,p),onBlur:ba(c,m),onMouseEnter:ba(l,p),onMouseLeave:ba(u,m),onTouchStart:ba(d,p)}]:[a,f,{}]:[!1,f,{}]}function ba(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function xa({page:e,...t}){let{router:n}=ha(),r=P.useMemo(()=>or(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?P.createElement(Ca,{page:e,matches:r,...t}):null}function Sa(e){let{manifest:t,routeModules:n}=va(),[r,i]=P.useState([]);return P.useEffect(()=>{let r=!1;return la(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ca({page:e,matches:t,...n}){let r=si(),{future:i,manifest:a,routeModules:o}=va(),{basename:s}=ha(),{loaderData:c,matches:l}=ga(),u=P.useMemo(()=>ua(e,t,l,a,r,`data`),[e,t,l,a,r]),d=P.useMemo(()=>ua(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=aa(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(()=>da(d,a),[d,a]),m=Sa(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 wa(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}P.Component;var Ta=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Ta&&(window.__reactRouterVersion=`7.13.0`)}catch{}function Ea({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=P.useRef();i.current??=Xn({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(zi,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Da({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(zi,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Da.displayName=`unstable_HistoryRouter`;var Oa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ka=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(Xr),g=typeof c==`string`&&Oa.test(c),_=Vr(c,m);c=_.to;let v=ai(c,{relative:r}),[y,b,x]=ya(n,f),S=Ia(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:wa(p,b),target:s,"data-discover":!g&&t===`render`?`true`:void 0});return y&&!g?P.createElement(P.Fragment,null,w,P.createElement(xa,{page:v})):w});ka.displayName=`Link`;var Aa=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=pi(a,{relative:c.relative}),d=si(),f=P.useContext(Gr),{navigator:p,basename:m}=P.useContext(Xr),h=f!=null&&Ka(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=Tr(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(ka,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Aa.displayName=`NavLink`;var ja=P.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Hi,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=P.useContext(Xr),g=za(),_=Ba(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Oa.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})});ja.displayName=`Form`;function Ma({getKey:e,storageKey:t,...n}){let r=P.useContext(_a),{basename:i}=P.useContext(Xr),a=si(),o=Ai();Wa({getKey:e,storageKey:t});let s=P.useMemo(()=>{if(!r||!e)return null;let t=Ua(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})(${ra(JSON.stringify(t||Va))}, ${ra(JSON.stringify(s))})`}})}Ma.displayName=`ScrollRestoration`;function Na(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pa(e){let t=P.useContext(Wr);return Zn(t,Na(e)),t}function Fa(e){let t=P.useContext(Gr);return Zn(t,Na(e)),t}function Ia(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s,unstable_useTransitions:c}={}){let l=ui(),u=si(),d=pi(e,{relative:a});return P.useCallback(f=>{if(Yi(f,t)){f.preventDefault();let t=n===void 0?nr(u)===nr(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 La=0,Ra=()=>`__${String(++La)}__`;function za(){let{router:e}=Pa(`useSubmit`),{basename:t}=P.useContext(Xr),n=Oi(),r=e.fetch,i=e.navigate;return P.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ea(e,t);a.navigate===!1?await r(a.fetcherKey||Ra(),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 Ba(e,{relative:t}={}){let{basename:n}=P.useContext(Xr),r=P.useContext(Qr);Zn(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...pi(e||`.`,{relative:t})},o=si();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:Nr([n,a.pathname])),nr(a)}var Va=`react-router-scroll-positions`,Ha={};function Ua(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Tr(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Wa({getKey:e,storageKey:t}={}){let{router:n}=Pa(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Fa(`useScrollRestoration`),{basename:a}=P.useContext(Xr),o=si(),s=Ai(),c=ki();P.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ga(P.useCallback(()=>{if(c.state===`idle`){let t=Ua(o,s,a,e);Ha[t]=window.scrollY}try{sessionStorage.setItem(t||Va,JSON.stringify(Ha))}catch(e){Qn(!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||Va);e&&(Ha=JSON.parse(e))}catch{}},[t]),P.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ha,()=>window.scrollY,e?(t,n)=>Ua(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{Qn(!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 Ga(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 Ka(e,{relative:t}={}){let n=P.useContext(qr);Zn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Pa(`useViewTransitionState`),i=pi(e,{relative:t});if(!n.isTransitioning)return!1;let a=Tr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Tr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Sr(i.pathname,o)!=null||Sr(i.pathname,a)!=null}var qa=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`}]]),Ja=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`}]]),Ya=N(`ArrowDown`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Xa=N(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Za=N(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Qa=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`}]]),$a=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`}]]),eo=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`}]]),to=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`}]]),no=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`}]]),ro=N(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),io=N(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ao=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`}]]),oo=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`}]]),so=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`}]]),co=N(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),lo=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`}]]),uo=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`}]]),fo=N(`CornerDownRight`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),po=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`}]]),mo=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`}]]),ho=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`}]]),go=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`}]]),_o=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`}]]),vo=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`}]]),yo=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`}]]),bo=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`}]]),xo=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`}]]),So=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`}]]),Co=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`}]]),wo=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`}]]),To=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`}]]),Eo=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`}]]),Do=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`}]]),Oo=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`}]]),ko=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`}]]),Ao=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`}]]),jo=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`}]]),Mo=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`}]]),No=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`}]]),Po=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`}]]),Fo=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`}]]),Io=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`}]]),Lo=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`}]]),Ro=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`}]]),zo=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`}]]),Bo=N(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Vo=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`}]]),Ho=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`}]]),Uo=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`}]]),Wo=N(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Go=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`}]]),Ko=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`}]]),qo=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`}]]),Jo=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`}]]),Yo=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`}]]),Xo=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`}]]),Zo=N(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Qo=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`}]]),$o=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`}]]),es=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`}]]),ts=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`}]]),ns=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`}]]),rs=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`}]]),is=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`}]]),as=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`}]]),os=N(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),ss=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`}]]),cs=N(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ls=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`}]]),us=N(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),ds=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`}]]),fs=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`}]]),ps=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`}]]),ms=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`}]]),hs=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`}]]),gs=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 _s(){return T({queryKey:bs,queryFn:Oe,staleTime:5e3,refetchOnWindowFocus:!0})}var F=d();function vs(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 ys(){let e=B0(),t=_s(),n=t.data,r=Os(e=>e.actionLabel),i=(0,P.useMemo)(()=>Ps(n),[n]),a=!!r,o=n?.runtime?.deviceName?.trim()||n?.settings.deviceName?.trim()||f(`remoteDeviceNameAuto`),s=!!(n?.account.loggedIn&&Ds(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)(He,{className:`space-y-6`,children:[(0,F.jsx)(j,{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)(k,{children:[(0,F.jsxs)(w,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsx)(O,{children:c.title}),(0,F.jsx)(Cn,{status:c.badgeStatus,label:c.badgeLabel})]}),(0,F.jsx)(x,{children:c.description})]}),(0,F.jsxs)(ee,{className:`space-y-5`,children:[(0,F.jsxs)(Yt,{tone:`neutral`,children:[(0,F.jsx)(vs,{label:f(`remoteSignedInAccount`),value:n?.account.email}),(0,F.jsx)(vs,{label:f(`remoteDeviceName`),value:o}),(0,F.jsx)(vs,{label:f(`remoteConnectionStatus`),value:c.badgeLabel}),(0,F.jsx)(vs,{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)(C,{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)(es,{className:`mr-2 h-4 w-4`}):null,r||i.primaryAction.label]}):null,(0,F.jsxs)(C,{variant:`outline`,onClick:()=>void e.accountManager.openNextClawWeb(),disabled:a||!s,children:[(0,F.jsx)(ss,{className:`mr-2 h-4 w-4`}),f(`remoteOpenDeviceList`)]}),n?.settings.enabled?(0,F.jsx)(C,{variant:`outline`,onClick:()=>void e.remoteAccessManager.disableRemoteAccess(n),disabled:a,children:f(`remoteDisable`)}):null]}),i.shouldShowIssueHint&&u?(0,F.jsx)(Yt,{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)(k,{children:[(0,F.jsxs)(w,{children:[(0,F.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Po,{className:`h-4 w-4 text-primary`}),f(`remoteDeviceSectionTitle`)]}),(0,F.jsx)(x,{children:f(`remoteDeviceSectionDescription`)})]}),(0,F.jsxs)(ee,{className:`space-y-5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsx)(Cn,{status:n?.account.loggedIn?`ready`:`inactive`,label:n?.account.loggedIn?f(`remoteAccountConnected`):f(`remoteAccountNotConnected`)}),(0,F.jsx)(Cn,{status:n?.settings.enabled?`active`:`inactive`,label:n?.settings.enabled?f(`remoteEnabled`):f(`remoteStateDisabled`)}),(0,F.jsx)(Cn,{status:n?.service.running?`active`:`inactive`,label:n?.service.running?f(`remoteServiceRunning`):f(`remoteServiceStopped`)})]}),(0,F.jsxs)(Yt,{tone:`neutral`,children:[(0,F.jsx)(vs,{label:f(`remoteDeviceName`),value:o}),(0,F.jsx)(vs,{label:f(`remoteConnectionStatus`),value:c.badgeLabel}),(0,F.jsx)(vs,{label:f(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?l(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,F.jsx)(Yt,{tone:`neutral`,borderStyle:`dashed`,description:n?.account.loggedIn?f(`remoteOpenWebHint`):f(`remoteStatusNeedsSignInDescription`),className:`text-sm`})]})]})]})]})}var bs=[`remote-status`],xs=`https://platform.nextclaw.io`,Ss=`https://nextclaw-platform-console.pages.dev`,Cs=async()=>await oe.fetchQuery({queryKey:bs,queryFn:Oe,staleTime:5e3}),ws=async()=>(await oe.invalidateQueries({queryKey:bs}),await Cs()),Ts=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function Es(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 xs;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return Ss}var Ds=e=>Es(e?.account.apiBase)||Es(e?.settings.platformApiBase)||Es(e?.platformBase)||Es(e?.account.platformBase)||void 0,Os=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})})),ks=class{constructor(e){this.params=e,this.syncStatus=e=>{if(!e)return;let t=Os.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{Os.getState().setEnabled(e)},this.setDeviceName=e=>{Os.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{Os.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{Os.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await ws(),n=Os.getState(),r=await this.ensureRemoteAccount(t,n.platformApiBase);await this.applyEnabledState(!0,r)},this.disableRemoteAccess=async e=>{let t=e??await ws();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await ws(),n=(await this.ensureRemoteAccount(t)).service.running?`restart`:`start`;await this.runManagedAction({actionLabel:f(n===`restart`?`remoteActionRestarting`:`remoteActionStarting`),job:async()=>{await xe(n);let e=await ws();this.hydrateDraftFromStatus(e)},successMessage:f(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await ws(),n=await this.params.accountManager.startBrowserSignInAndWait({status:t,apiBase:Os.getState().platformApiBase});await this.repairRemoteAccess(n)},this.saveAdvancedSettings=async e=>{let t=e??await ws(),n=Os.getState();await this.runManagedAction({actionLabel:f(`remoteActionSavingAdvanced`),job:async()=>{await ge({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await ws();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 de();Os.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=Os.getState();await this.runManagedAction({actionLabel:f(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await ge({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await ws();this.hydrateDraftFromStatus(r),e?await xe(r.service.running?`restart`:`start`):t.service.running&&await xe(`restart`);let i=await ws();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 xe(e),n=await ws();this.hydrateDraftFromStatus(n),E.success(t.message)}})},this.hydrateDraftFromStatus=e=>{Os.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;Os.getState().beginAction(t);try{await n(),r&&E.success(r)}catch(e){let t=e instanceof Error?e.message:f(`error`);throw E.error(t),e}finally{Os.getState().finishAction()}}}},As=[/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 js(e){return e?.runtime?.lastError?.trim()||``}function Ms(e){let t=f(`remoteStatusIssueDetailGeneric`),n=js(e);return n?`${t} (${n})`:t}function Ns(e){if(!e?.settings.enabled)return!1;let t=js(e);return As.some(e=>e.test(t))}function Ps(e){return Ns(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:Ms(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 Fs=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 Is({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 Ls(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)(Yt,{tone:`success`,title:f(`accountPanelSignedInTitle`),description:f(`accountPanelSignedInDescription`)}),(0,F.jsxs)(Yt,{tone:`neutral`,children:[(0,F.jsx)(Is,{label:f(`remoteAccountEmail`),value:t}),(0,F.jsx)(Is,{label:f(`remoteAccountUsername`),value:n}),(0,F.jsx)(Is,{label:f(`remoteAccountRole`),value:r})]}),n?(0,F.jsx)(`p`,{className:`text-xs text-gray-500`,children:f(`remoteAccountUsernameLockedHelp`)}):(0,F.jsxs)(Yt,{tone:`warning`,title:f(`remoteAccountUsernameRequiredTitle`),description:f(`remoteAccountUsernameRequiredDescription`),children:[(0,F.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,F.jsx)(_,{htmlFor:`account-panel-username`,children:f(`remoteAccountUsername`)}),(0,F.jsx)(ie,{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)(C,{disabled:!i,onClick:()=>void c(),children:f(a?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,F.jsxs)(C,{onClick:()=>void l(),children:[(0,F.jsx)(ss,{className:`mr-2 h-4 w-4`}),f(`remoteOpenDeviceList`)]}),(0,F.jsxs)(C,{variant:`outline`,onClick:()=>void u(),children:[(0,F.jsx)(Ro,{className:`mr-2 h-4 w-4`}),f(`remoteLogout`)]})]})]})}function Rs(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)(Yt,{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)(Is,{label:f(`remoteBrowserAuthSession`),value:t}),(0,F.jsx)(Is,{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)(C,{onClick:()=>void a(),children:f(t?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),i?(0,F.jsx)(C,{variant:`outline`,onClick:()=>void o(),children:f(`remoteBrowserAuthResume`)}):null]})]})}function zs(){let e=F0(),t=_s(),n=Fs(e=>e.panelOpen),r=Fs(e=>e.authSessionId),i=Fs(e=>e.authVerificationUri),a=Fs(e=>e.authExpiresAt),o=Fs(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)(et,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,F.jsxs)(nt,{className:`max-w-xl`,children:[(0,F.jsxs)(tt,{children:[(0,F.jsxs)(rt,{className:`flex items-center gap-2`,children:[(0,F.jsx)(fn,{className:`h-5 w-5 text-primary`}),f(`accountPanelTitle`)]}),(0,F.jsx)($e,{children:f(`accountPanelDescription`)})]}),s?.account.loggedIn?(0,F.jsx)(Ls,{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)(Rs,{authSessionId:r,authExpiresAt:a,authStatusMessage:o,authVerificationUri:i,onStartBrowserSignIn:()=>e.accountManager.startBrowserSignIn(),onResumeBrowserSignIn:()=>e.accountManager.resumeBrowserSignIn()})]})})}function Bs({username:e}){let t=ue(),[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)(k,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,F.jsxs)(w,{children:[(0,F.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:f(`authBrand`)}),(0,F.jsx)(O,{className:`text-2xl`,children:f(`authLoginTitle`)}),(0,F.jsx)(x,{children:f(`authLoginDescription`)})]}),(0,F.jsx)(ee,{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)(ie,{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)(ie,{type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:f(`authPasswordPlaceholder`)})]}),(0,F.jsx)(C,{type:`submit`,className:`w-full`,disabled:!o,children:t.isPending?f(`authLoggingIn`):f(`authLoginAction`)})]})})]})})}var Vs=class{constructor(){this.authPollTimerId=null,this.browserSignInCompletion=null,this.openAccountPanel=()=>{Fs.getState().openPanel()},this.closeAccountPanel=()=>{Fs.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),this.resolveBrowserSignIn(e),Fs.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=e?.status??await Cs();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 we({apiBase:Ts(e?.status??await Cs(),t)});Fs.getState().beginBrowserAuth({sessionId:n.sessionId,verificationUri:n.verificationUri,expiresAt:n.expiresAt,intervalMs:n.intervalMs,statusMessage:f(`remoteBrowserAuthWaiting`)}),(await Tn.openExternalUrl(n.verificationUri)).opened||Fs.getState().setAuthStatusMessage(f(`remoteBrowserAuthPopupBlocked`)),this.scheduleBrowserAuthPoll()}catch(e){let t=e instanceof Error?e.message:f(`remoteBrowserAuthStartFailed`);this.rejectBrowserSignIn(e),E.error(`${f(`remoteBrowserAuthStartFailed`)}: ${t}`)}},this.resumeBrowserSignIn=async()=>{let e=Fs.getState().authVerificationUri;e&&await Tn.openExternalUrl(e)},this.logout=async()=>{try{await Ne(),this.rejectBrowserSignIn(Error(`Signed out before browser sign-in completed.`)),Fs.getState().clearBrowserAuth(),await ws(),E.success(f(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:f(`remoteLogoutFailed`);E.error(`${f(`remoteLogoutFailed`)}: ${t}`)}},this.updateUsername=async e=>{try{await Fe({username:e.trim()}),await ws(),E.success(f(`remoteAccountUsernameSetSuccess`))}catch(e){let t=e instanceof Error?e.message:f(`remoteAccountUsernameSetFailed`);E.error(`${f(`remoteAccountUsernameSetFailed`)}: ${t}`)}},this.openNextClawWeb=async(e=`/`)=>{let t=Ds(await Cs());if(!t){E.error(f(`remoteOpenWebUnavailable`));return}let n=new URL(e,`${t.replace(/\/+$/,``)}/`).toString();await Tn.openExternalUrl(n)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=Fs.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=Fs.getState();if(e.authSessionId)try{let t=await Cs(),n=await he({sessionId:e.authSessionId,apiBase:Ts(t)});if(n.status===`pending`){Fs.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`))),Fs.getState().clearBrowserAuth(),E.error(n.message||f(`remoteBrowserAuthExpired`));return}Fs.getState().setAuthStatusMessage(f(`remoteBrowserAuthCompleted`));let r=await ws();this.clearPollTimer(),this.resolveBrowserSignIn(r),Fs.getState().clearBrowserAuth(),E.success(f(`remoteLoginSuccess`))}catch(e){this.clearPollTimer(),this.rejectBrowserSignIn(e),Fs.getState().clearBrowserAuth();let t=e instanceof Error?e.message:f(`remoteBrowserAuthPollFailed`);E.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=Fs.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?l(e.authExpiresAt):`-`}}}};function Hs({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)(at,{className:`h-3.5 w-3.5`}),(0,F.jsxs)(`span`,{children:[f(`chatBackToParent`),n?` · ${n}`:``]})]})})}function Us({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)(mt,{icon:(0,F.jsx)(at,{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 Ws(e){return e instanceof HTMLElement&&!!e.closest(`.nextclaw-chat-input-bar-shell [role="textbox"][contenteditable="true"]`)}var Gs=(0,P.forwardRef)(function({onFocusOutside:e,...t},n){return(0,F.jsx)(Je,{...t,ref:n,onFocusOutside:t=>{e?.(t),!t.defaultPrevented&&Ws(t.detail.originalEvent.target)&&t.preventDefault()}})});function Ks(){let e=fe();return async t=>{let{sessionKey:n,patch:r,successMessage:i}=t;try{Ee(e,await te(n,r)),await e.invalidateQueries({queryKey:[`ncp-session-skills`,n]}),E.success(i??f(`configSavedApplied`))}catch(e){throw E.error(f(`configSaveFailed`)+`: `+(e instanceof Error?e.message:String(e))),e}}}function qs(){let e=Ks();return async t=>{await e({sessionKey:t.sessionKey,patch:{label:t.label},successMessage:f(`configSavedApplied`)})}}function Js(){let e=Ks();return async t=>{let{persistToServer:n,projectRoot:r,sessionKey:i}=t,a=f(r?`chatSessionProjectUpdated`:`chatSessionProjectCleared`);if(!n){E.success(a);return}await e({sessionKey:i,patch:{projectRoot:r},successMessage:a})}}function Ys({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 Xs(e){try{return JSON.stringify(e??{},null,2)}catch{return`{}`}}function Zs({open:e,metadata:t,onOpenChange:n}){return(0,F.jsx)(et,{open:e,onOpenChange:n,children:(0,F.jsxs)(nt,{className:`max-w-2xl gap-0 overflow-hidden p-0`,children:[(0,F.jsxs)(tt,{className:`border-b border-border px-5 py-4 pr-12`,children:[(0,F.jsx)(rt,{className:`text-base`,children:f(`chatSessionMetadataDialogTitle`)}),(0,F.jsx)($e,{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:Xs(t)})})]})})}function Qs(e){return[`server-path-browse`,e.path?.trim()??``,e.basePath?.trim()??``,e.includeFiles??!1]}function $s(e){let{basePath:t,enabled:n,includeFiles:r,path:i}=e,a=i?.trim()??``,o=t?.trim()??``;return T({queryKey:Qs({path:a,basePath:o,includeFiles:r}),queryFn:()=>De({path:a,basePath:o,includeFiles:r}),enabled:n??!0,staleTime:0})}var ec=P.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsx)(`div`,{ref:r,className:m(`overflow-auto`,e),...n,children:t}));ec.displayName=`ScrollArea`;function tc({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,v]=(0,P.useState)(``);(0,P.useEffect)(()=>{if(!e)return;let n=t?.trim()||null;p(n??``),h(n),v(``)},[t,e]);let y=$s({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]),w=g.trim().toLowerCase(),T=(0,P.useMemo)(()=>{let e=y.data?.entries??[];return w.length===0?e:e.filter(e=>{let t=e.name.toLowerCase(),n=e.path.toLowerCase();return t.includes(w)||n.includes(w)})},[y.data?.entries,w]),E=e=>{h(e),v(``),e&&p(e)};return(0,F.jsx)(et,{open:e,onOpenChange:e=>{n||r(e)},children:(0,F.jsxs)(nt,{className:`max-h-[85vh] overflow-hidden sm:h-[42rem] sm:max-w-2xl sm:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,F.jsxs)(tt,{children:[(0,F.jsx)(rt,{children:a}),o?(0,F.jsx)($e,{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)(_,{htmlFor:`server-path-picker-input`,children:s}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(ie,{id:`server-path-picker-input`,value:d,onChange:e=>p(e.target.value),placeholder:c,autoFocus:!0,disabled:n}),(0,F.jsx)(C,{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)(C,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>E(y.data?.homePath??null),disabled:n||y.isLoading,children:[(0,F.jsx)(jo,{className:`mr-1 h-4 w-4`}),f(`homeDirectory`)]}),(0,F.jsxs)(C,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>E(y.data?.parentPath??null),disabled:!y.data?.parentPath||n||y.isLoading,children:[(0,F.jsx)(Eo,{className:`mr-1 h-4 w-4`}),f(`parentDirectory`)]}),(0,F.jsxs)(C,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{y.refetch()},disabled:n||y.isLoading,children:[(0,F.jsx)(es,{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)(ro,{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)(ot,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,F.jsx)(ie,{value:g,onChange:e=>v(e.target.value),placeholder:f(`pathPickerSearchPlaceholder`),disabled:n||y.isLoading,className:`pl-9`})]})}),(0,F.jsx)(ec,{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)(rn,{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)(Qe,{children:[(0,F.jsx)(C,{type:`button`,variant:`outline`,onClick:()=>r(!1),disabled:n,children:f(`cancel`)}),(0,F.jsx)(C,{type:`submit`,disabled:x,children:n?f(`saving`):l})]})]})]})})}function nc({open:e,currentProjectRoot:t,isSaving:n,onOpenChange:r,onSave:i}){return(0,F.jsx)(tc,{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 rc=`flex shrink-0 items-center gap-1.5`;function ic({sessionKey:e,canDeleteSession:t,isDeletePending:n,projectRoot:r,metadata:i,isWorkspaceOpen:a,onToggleWorkspace:o,onDeleteSession:s}){let c=Js(),[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:rc,children:[(0,F.jsxs)(Xe,{open:l,onOpenChange:u,children:[(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsx)(mt,{icon:(0,F.jsx)(ft,{className:`h-4 w-4`}),label:f(`chatSessionMoreActions`),tooltip:!1,disabled:v})}),(0,F.jsx)(Gs,{align:`end`,className:`w-56 p-2`,children:(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(Ys,{icon:wo,label:f(`chatSessionSetProject`),onClick:()=>{u(!1),p(!0)},disabled:v}),(0,F.jsx)(Ys,{icon:$a,label:f(`chatSessionViewMetadata`),onClick:()=>{u(!1),h(!0)},disabled:v}),(0,F.jsx)(Ys,{icon:xn,label:f(`chatDeleteSession`),onClick:()=>{u(!1),s()},disabled:!t||v,destructive:!0})]})})]}),(0,F.jsx)(mt,{icon:a?(0,F.jsx)(Jo,{className:`h-4 w-4`}):(0,F.jsx)(pt,{className:`h-4 w-4`}),label:f(a?`chatSessionCloseWorkspace`:`chatSessionOpenWorkspace`),"aria-pressed":a,onClick:o,disabled:v}),(0,F.jsx)(nc,{open:d,currentProjectRoot:r,isSaving:g,onOpenChange:p,onSave:y}),(0,F.jsx)(Zs,{open:m,metadata:i,onOpenChange:h})]})}var ac={maxHeight:Ue(`18rem`)};function oc({sessionKey:e,projectName:t,projectRoot:n,persistToServer:r}){let i=Js(),[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)(Xe,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ge,{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)(wo,{className:`h-3.5 w-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:t}),(0,F.jsx)(Tt,{className:`h-3 w-3 shrink-0 opacity-70`})]})})}),(0,F.jsxs)(Gs,{align:`start`,className:`w-72 p-2`,style:ac,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)(Ys,{icon:Xo,label:f(`chatSessionSetProject`),onClick:()=>{o(!1),c(!0)},disabled:l}),(0,F.jsx)(Ys,{icon:Do,label:f(`chatSessionClearProject`),onClick:()=>{d(null)},disabled:l})]})]})]}),(0,F.jsx)(nc,{open:s,currentProjectRoot:n,isSaving:l,onOpenChange:c,onSave:d})]})}var sc=(0,P.createContext)(null);function cc({presenter:e,children:t}){return(0,F.jsx)(sc.Provider,{value:e,children:t})}function lc(){let e=(0,P.useContext)(sc);if(!e)throw Error(`usePresenter must be used inside ChatPresenterProvider`);return e}function uc(e){let t=e.label?.trim();if(t)return t;let n=e.key.split(`:`);return n[n.length-1]||e.key}function dc(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 fc(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function pc(e,t){return e.getFullYear()===t.getFullYear()}function mc(e,t){let n=`${e.getMonth()+1}月${e.getDate()}日`;return pc(e,t)?n:`${e.getFullYear()}年${n}`}function hc(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=fc(i),s=fc(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 mc(i,n);let l=pc(i,n)?{month:`numeric`,day:`numeric`}:{year:`numeric`,month:`numeric`,day:`numeric`};return new Intl.DateTimeFormat(a,l).format(i)}function gc(e){return e.trim().toLowerCase()}function _c(e,t){let n=gc(t);return n?[e.key,uc(e),e.projectRoot??``,e.projectName??``].map(gc).some(e=>e.includes(n)):!0}var vc=function(e){return e.CALL=`call`,e.RESULT=`result`,e.PARTIAL_CALL=`partial-call`,e.ERROR=`error`,e.CANCELLED=`cancelled`,e}({});function yc(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function bc(e){return yc(e)}function xc(e){let t=yc(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 Sc(e){return/^[A-Za-z]:[\\/]?$/.test(e)||e===`/`?e:e.replace(/[\\/]+$/,``)}function Cc(e){let t=Sc(e.trim().replace(/\\/g,`/`));return/^[A-Za-z]:/.test(t)?`${t.slice(0,1).toLowerCase()}${t.slice(1)}`:t}function wc(e,t){if(!e)return t.join(`/`);let n=Sc(e.trim().replace(/\\/g,`/`));return t.length===0?n:n===`/`?`/${t.join(`/`)}`:`${n}/${t.join(`/`)}`}function Tc(e){let t=Sc(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 Ec(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 Dc(e){let t=Cc(e.path),n=Cc(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 Oc(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=wc(t,r.slice(0,i+1));return{key:`${i}:${e}`,label:e,kind:a,path:o,browsePath:a===`file`?Tc(o):o,isCurrent:i===r.length-1}});return i?[i,...a]:a}function kc(e){let{column:t,line:n}=e;return typeof n==`number`?`L${n}${typeof t==`number`?`:${t}`:``}`:null}function Ac(e){let{column:t,kind:n=`file`,line:r,path:i,sessionProjectRoot:a,truncated:o}=e,s=i.trim(),c=a?.trim()&&s?Dc({path:s,sessionProjectRoot:a}):null,l;if(a?.trim()&&c){let e=a.trim(),t=xc(e)??e;l=Oc({labels:c,basePath:e,currentKind:n,leading:{key:`workspace:${t}`,label:t,kind:`workspace`,path:e,browsePath:e,isCurrent:c.length===0}})}else{let{prefix:e,segments:t}=Ec(s),r=e===`/`?`/`:e?`${e}/`:null;l=Oc({labels:t,basePath:r,currentKind:n,leading:e?{key:`root:${e}`,label:e,kind:`root`,path:r??e,browsePath:r??e,isCurrent:t.length===0}:null})}return l.length===0&&(l=[{key:`file:unknown`,label:s||`file`,kind:n,path:s,browsePath:n===`directory`?s:Tc(s),isCurrent:!0}]),{fullPath:s,locationLabel:kc({line:r,column:t}),truncated:o,segments:l}}var jc=new Set([`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`]),Mc=new Set([`running`,`completed`,`failed`,`cancelled`,`idle`]);function Nc(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??{})}catch{return String(e??``)}}function Pc(e){return`${b}/api/ncp/assets/content?${new URLSearchParams({uri:e}).toString()}`}function Fc(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Ic(e){let{metadata:t}=e;return!t||typeof t!=`object`||Array.isArray(t)?null:t}function Lc(e){let t=Ic(e)?.last_activity_preview;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,{state:r}=n,i=Fc(n.timestamp);if(!Mc.has(r)||!i)return null;let a=Fc(n.statusText),o=Fc(n.replyText);return{state:r,timestamp:i,...a?{statusText:a}:{},...o?{replyText:o}:{}}}function Rc(e){let t=Ic(e);return t?Fc(t.preferred_model)??Fc(t.preferredModel)??Fc(t.model):null}function zc(e){let t=Ic(e);if(!t)return null;let n=Fc(t.preferred_thinking)??Fc(t.thinking)??Fc(t.thinking_level)??Fc(t.thinkingLevel);if(!n)return null;let r=n.toLowerCase();return jc.has(r)?r:null}function Bc(e){let t=Ic(e);return t?Fc(t.label):null}function Vc(e){let t=Ic(e);return t?bc(t.project_root??t.projectRoot):null}function Hc(e){return Fc(e.workingDir)}function Uc(e){let t=Ic(e);return t?Fc(t.ui_last_read_at):null}function Wc(e){let t=Ic(e);return t?Fc(t.runtime)??Fc(t.session_type)??Fc(t.sessionType)??`native`:`native`}function Gc(e){let t=Ic(e);return t?Fc(t.parent_session_id)??Fc(t.parentSessionId):null}function Kc(e){let t=Ic(e);return t?Fc(t.spawned_by_request_id)??Fc(t.spawnedByRequestId):null}function qc(e){let t=Ic(e);return t?t.child_session_promoted===!0:!1}function Jc(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 Yc(e){return e.state===`cancelled`?vc.CANCELLED:e.state===`result`?vc.RESULT:e.state===`partial-call`?vc.PARTIAL_CALL:vc.CALL}function Xc(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:Pc(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:Yc(n),toolCallId:n.toolCallId??`${n.toolName}-${Math.random().toString(36).slice(2,8)}`,toolName:n.toolName,args:Nc(n.args),result:n.result}})}return t}function Zc(e){return e===`service`?`system`:e===`tool`?`assistant`:e}function Qc(e){return{id:e.id,role:Zc(e.role),parts:Xc(e.parts),meta:{source:`stream`,status:e.status,sessionKey:e.sessionId,timestamp:e.timestamp}}}function $c(e){let t=Ic(e),n=Bc(e),r=Rc(e),i=zc(e),a=Vc(e),o=Hc(e)??a,s=Uc(e),c=Fc(e.lastMessageAt),l=xc(a),u=Jc(e.sessionId),d=Gc(e),f=Kc(e),p=qc(e),m=Lc(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:Wc(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 el(e){return e.map($c)}var tl=`nextclaw.chat.session-list.mode`,nl=`time-first`;function rl(e){return e===`time-first`||e===`project-first`}function il(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean))]:[]}function al(e){if(!e||typeof e!=`object`)return null;let{snapshot:t}=e;return!t||typeof t!=`object`?null:rl(t.listMode)?t.listMode:null}function ol(e,t){let n=e?.trim();if(!n)return!1;let r=t?.trim();return r?n.localeCompare(r)>0:!1}function sl(e){let{active:t,readAt:n,runStatus:r,lastMessageAt:i}=e;return t||r===`running`?!1:ol(i,n)}var cl={selectedSessionKey:null,selectedAgentId:`main`,query:``,listMode:nl,pinnedSessionKeys:[],pinnedProjectRoots:[],collapsedProjectRoots:[]};function ll(e){return t=>e(e=>({snapshot:{...e.snapshot,...t}}))}function ul(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()(En(e=>({snapshot:cl,optimisticReadAtBySessionKey:{},setSnapshot:ll(e),markSessionRead:ul(e)}),{name:tl,storage:Dn(()=>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=al(e);return{...t,snapshot:{...t.snapshot,...r?{listMode:r}:{},pinnedSessionKeys:il(n?.pinnedSessionKeys),pinnedProjectRoots:il(n?.pinnedProjectRoots),collapsedProjectRoots:il(n?.collapsedProjectRoots)}}}})),dl={staleTime:5e3,retry:!1};function fl(e){return T({queryKey:[`ncp-sessions`,e?.limit??null,e?.peerId?.trim()||null],queryFn:()=>ze(e),...dl})}function pl(e){return T({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>pe(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,...dl})}function ml(e,t){return e.filter(e=>_c(e,t))}function hl(e){return e.isChildSession?e.isPromotedChildSession===!0:!0}function gl(e={}){let t=I(e=>e.snapshot.query),n=e.query??t,r=fl({limit:e.limit??200}),i=(0,P.useMemo)(()=>ml(el(r.data?.sessions??[]).filter(hl),n).map(e=>({session:e,runStatus:e.status===`running`?`running`:void 0})),[n,r.data?.sessions]);return{isLoading:r.isLoading,items:i}}var _l={wx:`weixin`,lark:`feishu`},vl={cron:{icon:`cron`}},yl={codex:`chatSessionTypeCodex`,claude:`chatSessionTypeClaude`};function bl(e){return e?.trim().toLowerCase()??``}function xl(e){return e.split(/[-_]+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Sl(e,t){let n=bl(e);if(!n||n===`native`)return null;let r=t.find(e=>bl(e.value)===n);return r?.label.trim()?r.label.trim():xl(n)}function Cl(e,t){let n=bl(e);return!n||n===`native`?null:t.find(e=>bl(e.value)===n)??null}function wl(e){let t=bl(e);if(!t)return null;let n=_l[t]??t;return an(n)?n:null}function Tl(e,t){let n=wl(e.channel??``);if(n)return{icon:{kind:`channel-logo`,channel:n},label:null};let r=vl[bl(e.type)];if(r)return{icon:{kind:`symbol`,icon:r.icon},label:null};let i=bl(e.sessionType),a=Cl(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=yl[i];return o?{icon:null,label:f(o)}:{icon:null,label:a?.label?.trim()||Sl(e.sessionType,t)}}var El=`app://`;function Dl(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 Ol(e){let t=e.trim();if(!t)return null;if(!t.startsWith(El))return t;let n=Dl(t.slice(6));return n?`/${n}`:null}function kl({icon:e,className:t}){if(e.kind===`channel-logo`)return(0,F.jsx)(Al,{channel:e.channel,className:t});if(e.kind===`runtime-image`){let n=Ol(e.src);return(0,F.jsx)(wn,{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)(Qa,{className:m(`h-3 w-3 text-muted-foreground`,t)})})}return(0,F.jsx)(qa,{className:m(`h-3.5 w-3.5`,t)})}function Al({channel:e,className:t}){return(0,F.jsx)(wn,{name:e,src:an(e),className:m(`h-[1.125rem] w-[1.125rem]`,t),imgClassName:`h-full w-full object-contain`,fallback:(0,F.jsx)(Qa,{className:`h-3 w-3 text-muted-foreground`})})}function jl({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)(gn,{className:`h-3 w-3 animate-spin`}),(0,F.jsx)(`span`,{className:`sr-only`,children:n})]})}function Ml(e){return new Date(e.session.lastMessageAt??e.session.createdAt).getTime()}function Nl(e){return[...e].sort((e,t)=>Ml(t)-Ml(e))}function Pl(e,t){return[...e].sort((e,n)=>Number(t.has(n.session.key))-Number(t.has(e.session.key))||Ml(n)-Ml(e))}function Fl(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=Pl(e.filter(e=>t.has(e.session.key)),t);for(let e of u){let t=Ml(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 Il(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=Ml(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()||xc(e)||e,items:[t],latestUpdatedAt:a,isPinned:n.has(e)})}return[...r.values()].map(e=>({...e,items:Pl(e.items,t)})).sort((e,t)=>Number(t.isPinned)-Number(e.isPinned)||t.latestUpdatedAt-e.latestUpdatedAt)}function Ll(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)=>Ml(t)-Ml(e));return t}function Rl(e){if(e.label&&e.label.trim())return e.label.trim();let t=e.key.split(`:`);return t[t.length-1]||e.key}var zl=`native`;function Bl(e){return typeof e==`string`?e.trim().toLowerCase()||`native`:zl}function Vl(e,t=zl){return Bl(e?.runtime?.trim()||e?.engine?.trim()||t)}function Hl(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 Ul(e){let t=new Map;for(let n of e){let e=Bl(n.value);t.set(e,{value:e,label:n.label?.trim()||Hl(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(zl,{value:zl,label:Hl(zl),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 Wl=p(e=>({snapshot:{},setSnapshot:t=>e(({snapshot:e})=>({snapshot:{...e,...t}}))})),Gl=`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 Kl({title:e}){return(0,F.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:e})}function ql({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)(Ho,{className:`h-4 w-4 shrink-0 text-muted-foreground/55`}),(0,F.jsx)(`span`,{children:e})]})}function Jl(){return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground`,children:[(0,F.jsx)(gn,{className:`h-4 w-4 shrink-0 animate-spin`}),(0,F.jsx)(`span`,{children:f(`sessionsLoading`)})]})}function Yl({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=sl({active:s,lastMessageAt:a.lastMessageAt,readAt:l,runStatus:o}),d=dc(a)??a.projectName??a.projectRoot??`${a.messageCount}`,p=hc(a.lastMessageAt??a.createdAt),h=Tl(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)(Kt,{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:uc(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)(kl,{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)(jl,{status:o})}):null]})}function Xl({selectedSessionKey:e,title:t}){let n=lc(),[r,i]=(0,P.useState)(!1),[a,o]=(0,P.useState)(``),s=I(e=>e.optimisticReadAtBySessionKey),c=Wl(e=>e.snapshot.sessionTypesQuery?.data??null),{isLoading:l,items:u}=gl({query:a}),d=(0,P.useMemo)(()=>Nl(u),[u]),p=(0,P.useMemo)(()=>Ul(c?.options??[]),[c?.options]),h=t=>{i(!1),o(``),t!==e&&n.chatSessionListManager.selectSession(t)};return(0,F.jsxs)(Xe,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":`${f(`chatSessionSwitch`)}: ${t}`,"aria-expanded":r,className:Gl,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,F.jsx)(Tt,{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)(Gs,{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)(ot,{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)(ie,{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)(Jl,{}):d.length>0?(0,F.jsx)(`div`,{className:`space-y-1`,children:d.map(t=>(0,F.jsx)(Yl,{item:t,selectedSessionKey:e,optimisticReadAtBySessionKey:s,sessionTypeOptions:p,onSelect:h},t.session.key))}):(0,F.jsx)(ql,{label:a.trim()?f(`chatSessionSwitcherNoResults`):f(`sessionsEmpty`)})})]})]})}function Zl({layoutMode:e,selectedSessionKey:t,title:n}){let r=mn(e=>e.isSidebarCollapsed);return e!==`desktop`||!r?(0,F.jsx)(Kl,{title:n}):(0,F.jsx)(Xl,{selectedSessionKey:t,title:n})}var Ql=[];function $l(){let e=Wl(e=>!!(e.snapshot.configQuery?.isFetched||e.snapshot.configQuery?.isSuccess)),t=Wl(e=>!!(e.snapshot.providersQuery?.isFetched||e.snapshot.providersQuery?.isSuccess)),n=Wl(e=>!!(e.snapshot.providerTemplatesQuery?.isFetched||e.snapshot.providerTemplatesQuery?.isSuccess));return e&&t&&n}function eu(e){let t=Wl(e=>e.snapshot.sessionsQuery?.data?.sessions??Ql),n=(0,P.useMemo)(()=>el(t),[t]);return(0,P.useMemo)(()=>n.find(t=>t.key===e)??null,[n,e])}function tu(e){return!!e&&typeof e==`object`}function nu(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function ru(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function iu(e){return typeof e==`string`?e:null}function au(e){return e===`auto`||e===`source`||e===`rendered`?e:null}function ou(e){if(!tu(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:nu(e.parentSessionKey),path:n,label:nu(e.label),viewMode:e.viewMode,previewViewer:au(e.previewViewer),line:ru(e.line),column:ru(e.column),rawText:iu(e.rawText),contentUrl:nu(e.contentUrl),mimeType:nu(e.mimeType),beforeText:iu(e.beforeText),afterText:iu(e.afterText),patchText:iu(e.patchText),oldStartLine:ru(e.oldStartLine),newStartLine:ru(e.newStartLine)}}function su(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 cu(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 lu(e){return typeof e!=`number`||!Number.isFinite(e)?480:Math.max(360,Math.min(860,e))}var uu=`nextclaw.chat.workspace-panel.state`,du=2,fu=8,pu={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,workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0,workspacePanelWidth:480,contextWindow:null};function mu(e){return!!e&&typeof e==`object`}function hu(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function gu(e,t){return typeof e==`number`&&Number.isInteger(e)?Math.min(Math.max(0,e),t):t}function _u(e){return e===`overview`||e===`child-sessions`||e===`child-session`||e===`project-files`||e===`file`||e===`cron`}function vu(e){if(!mu(e))return null;if(e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`cron`)return{kind:e.kind};let t=hu(e.key);return!t||e.kind!==`child-session`&&e.kind!==`file`?null:{kind:e.kind,key:t}}function yu({activeChildSessionKey:e,activeWorkspaceFileKey:t,activeWorkspacePanelKind:n}){return n===`overview`?{kind:`overview`}:n===`child-sessions`?{kind:`child-sessions`}:n===`project-files`?{kind:`project-files`}:n===`cron`?{kind:`cron`}:n===`child-session`&&e?{kind:`child-session`,key:e}:n===`file`&&t?{kind:`file`,key:t}:null}function bu(e){if(!mu(e))return null;let t=hu(e.workspacePanelParentKey),n=hu(e.activeWorkspaceFileKey),r=cu(Array.isArray(e.workspaceFileTabs)?e.workspaceFileTabs.map(ou).filter(e=>e!==null):[],n,fu),i=r.filter(e=>e.parentSessionKey===t),a=n&&i.some(e=>e.key===n)?n:i[0]?.key??null,o=_u(e.activeWorkspacePanelKind)?e.activeWorkspacePanelKind:null,s=o===`file`&&!a?null:o,c=hu(e.activeChildSessionKey),l=yu({activeWorkspacePanelKind:s,activeChildSessionKey:c,activeWorkspaceFileKey:a}),u=Array.isArray(e.workspaceNavigationHistory)?e.workspaceNavigationHistory.map(vu).filter(e=>e!==null).filter(e=>e.kind!==`file`||r.some(t=>t.key===e.key)):[],d=u.length>0?u:l?[l]:[];return{workspacePanelParentKey:t,activeWorkspacePanelKind:s,activeChildSessionKey:c,workspaceFileTabs:r,activeWorkspaceFileKey:a,workspaceNavigationHistory:d,workspaceNavigationHistoryIndex:d.length>0?gu(e.workspaceNavigationHistoryIndex,d.length-1):0,workspacePanelWidth:lu(e.workspacePanelWidth)}}var L=p()(En(e=>({snapshot:pu,setSnapshot:t=>e(e=>({snapshot:{...e.snapshot,...t}}))}),{name:uu,version:du,storage:Dn(()=>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:cu(e.snapshot.workspaceFileTabs,e.snapshot.activeWorkspaceFileKey,fu).map(su),activeWorkspaceFileKey:e.snapshot.activeWorkspaceFileKey,workspaceNavigationHistory:t,workspaceNavigationHistoryIndex:n,workspacePanelWidth:e.snapshot.workspacePanelWidth}}},merge:(e,t)=>{let n=bu(mu(e)?e.snapshot:null);return n?{...t,snapshot:{...t.snapshot,...n}}:t}})),xu=[[`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 Su(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 Cu({agentId:e,displayName:t,avatarUrl:n,className:r}){let i=t?.trim()||e,a=e.trim().toLowerCase()===`main`,[o,s]=xu[Su(e)%xu.length]??xu[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)(Qa,{className:`h-[55%] w-[55%]`,strokeWidth:2.4}):(i.trim()||`A`).slice(0,1).toUpperCase()})}function wu(){return T({queryKey:[`agents`],queryFn:Ie,staleTime:3e4})}function Tu(){let e=fe();return je({mutationFn:({agentId:e,data:t})=>_e(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),E.success(f(`configSavedApplied`))},onError:e=>{E.error(f(`configSaveFailed`)+`: `+e.message)}})}function Eu(){let e=fe();return je({mutationFn:({agentId:e})=>Te(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),E.success(f(`configSavedApplied`))},onError:e=>{E.error(f(`configSaveFailed`)+`: `+e.message)}})}function Du(e){return new Map(e.filter(e=>typeof e.id==`string`&&e.id.trim().length>0).map(e=>[e.id,e]))}function Ou(e){let t=e?.trim()??``,n=wu(),r=(0,P.useMemo)(()=>Du(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 ku({agentId:e,className:t}){let n=Ou(e);return n?(0,F.jsx)(Cu,{agentId:n.agentId,displayName:n.displayName,avatarUrl:n.avatarUrl,className:t}):null}function Au({layoutMode:e,onBackToList:t}){let n=lc(),r=L(e=>e.snapshot),i=I(e=>e.snapshot.selectedSessionKey),a=I(e=>e.snapshot.selectedAgentId),o=Wl(e=>e.snapshot.sessionTypesQuery?.data??null),s=eu(i),c=(0,P.useMemo)(()=>Ul(o?.options??[]),[o?.options]),l=Bl(s?.sessionType??o?.defaultType??`native`),u=c.find(e=>e.value===l)??null,d=u?.label??Hl(l),p=l!==`native`&&!!d,m=s?.projectRoot??null,h=s?.projectName??xc(m),g=!!s,_=!!(i||d),v=(s?uc(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)(Us,{layoutMode:e,title:v,titleContent:(0,F.jsx)(Zl,{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)(ku,{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)(kl,{icon:{kind:`runtime-image`,src:u.icon.src,alt:u.icon.alt??null,name:d}})}):null,d]}):null,projectBadge:h?(0,F.jsx)(oc,{sessionKey:i??`draft`,projectName:h,projectRoot:m,persistToServer:g}):null,actions:i?(0,F.jsx)(ic,{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 ju(){let e=lc(),t=L(e=>e.snapshot);return(0,F.jsx)(Hs,{parentSessionLabel:t.parentSessionKey?t.parentSessionLabel??null:null,onGoToParentSession:e.chatThreadManager.goToParentSession})}var Mu=[{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 Nu(){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)(bn,{className:`h-6 w-52 rounded-lg bg-muted`}),(0,F.jsx)(`div`,{className:`space-y-5`,children:Mu.map(e=>(0,F.jsx)(`div`,{className:m(`flex w-full`,e.alignmentClassName),children:(0,F.jsx)(bn,{"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)(bn,{className:`h-4 w-40 rounded-full bg-muted`}),(0,F.jsx)(bn,{className:`h-[112px] w-full rounded-[30px] bg-muted`})]}),(0,F.jsx)(`div`,{className:`hidden justify-end sm:flex`,children:(0,F.jsx)(bn,{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)(bn,{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)(bn,{className:`h-8 w-20 rounded-full bg-muted`}),(0,F.jsx)(bn,{className:`h-8 w-28 rounded-full bg-muted`}),(0,F.jsx)(bn,{className:`hidden h-8 w-24 rounded-full bg-muted sm:block`})]}),(0,F.jsx)(bn,{className:`h-8 w-8 rounded-full bg-muted`})]})]})})})]})}function Pu(e,t){return e.label?.trim()?e.label.trim():t?uc(t):e.sessionKey}function Fu(e){let t=fl({limit:200}),n=(0,P.useMemo)(()=>t.data?.sessions??[],[t.data?.sessions]),r=(0,P.useMemo)(()=>{let e=el(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:Pu(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?Hl(t.sessionType):null,preferredModel:t?.preferredModel?.trim()||null,projectName:t?.projectName?.trim()||null,projectRoot:t?.projectRoot?.trim()||null}}),[r,e])}function Iu(e){return/\.html?$/i.test(e)?`html`:/\.mdx?$/i.test(e)?`markdown`:null}function Lu(e,t){let n=Iu(e);return n===`html`?t===`rendered`?`rendered`:`source`:n===`markdown`?t===`source`?`source`:`rendered`:t===`source`||t===`rendered`?t:null}function Ru(e,t){return Lu(e,t)??t??null}function zu(e,t){return Iu(e)?Lu(e,t)===`source`?`rendered`:`source`:null}function Bu(e){let t=e.path.split(`/`).filter(Boolean).pop();return e.label?.trim()||t||e.path}function Vu(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 Hu(e){let{activeSideChatDraft:t,resolvedChildTabs:n,workspaceFileTabs:r,activeSelection:i,optimisticReadAtBySessionKey:a,onSelectSession:o,onSelectFile:s,onOpenFileViewer:c,onCloseFile:l,onSelectOverview:u,onSelectChildSessions:d,onSelectProjectFiles:p,onSelectCronJobs:m}=e,h=[{key:`overview`,kind:`overview`,title:f(`chatWorkspaceOverview`),tooltip:f(`chatWorkspaceOverview`),active:i?.kind===`overview`,onSelect:u},{key:`child-sessions`,kind:`child-sessions`,title:f(`chatWorkspaceChildSessions`),tooltip:f(`chatWorkspaceChildSessions`),active:i?.kind===`child-sessions`,onSelect:d},{key:`cron:session`,kind:`cron`,title:f(`chatWorkspaceSessionCronJobs`),tooltip:f(`chatWorkspaceSessionCronJobs`),active:i?.kind===`cron`,onSelect:m},{key:`project-files`,kind:`project-files`,title:f(`chatWorkspaceProjectFiles`),tooltip:f(`chatWorkspaceProjectFiles`),active:i?.kind===`project-files`,onSelect:p}],g=t?[{key:`side-chat-draft:${t.draftKey}`,kind:`side-chat-draft`,title:f(`chatWorkspaceSideChatDraftTitle`),tooltip:f(`chatWorkspaceSideChatDraftSubtitle`),active:i?.kind===`side-chat-draft`&&i.draft.draftKey===t.draftKey,onSelect:()=>void 0}]:[],_=n.map(e=>{let t=a[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:i?.kind===`child-session`&&i.tab.sessionKey===e.sessionKey,showUnreadDot:sl({active:i?.kind===`child-session`&&i.tab.sessionKey===e.sessionKey,lastMessageAt:e.lastMessageAt,readAt:n,runStatus:e.runStatus}),onSelect:()=>o(e.sessionKey)}}),v=r.map(e=>{let t=e.viewMode===`preview`?Lu(e.path,e.previewViewer):null,n=e.viewMode===`preview`?zu(e.path,e.previewViewer):null,r=Bu(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:()=>c(e.key,n)}:null,active:i?.kind===`file`&&i.file.key===e.key,onSelect:()=>s(e.key),onClose:()=>l(e.key)}});return[...h,...g,..._,...v]}function Uu(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 Wu=Object.freeze({left:0,top:0,width:16,height:16}),Gu=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ku=Object.freeze({...Wu,...Gu}),qu=Object.freeze({...Ku,body:``,hidden:!1});function Ju(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 Yu(e,t){let n=Ju(e,t);for(let r in qu)r in Gu?r in e&&!(r in n)&&(n[r]=Gu[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Xu(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Yu(r[e]||i[e],a)}return o(t),n.forEach(o),Yu(e,a)}function Zu(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=Uu(e);for(let i in r){let a=r[i];a&&(t(i,Xu(e,i,a)),n.push(i))}return n}var Qu={provider:``,aliases:{},not_found:{},...Wu};function $u(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ed(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!$u(e,Qu))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!$u(t,qu))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]||!$u(t,qu))return null}return t}var td=Object.create(null);function nd(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function rd(e,t){let n=td[e]||(td[e]=Object.create(null));return n[t]||(n[t]=nd(e,t))}function id(e,t){return ed(t)?Zu(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ad(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var od=/^[a-z0-9]+(-[a-z0-9]+)*$/,sd=(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&&!cd(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&&!cd(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!cd(e,n)?null:e}return null},cd=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,ld=!1;function ud(e){return typeof e==`boolean`&&(ld=e),ld}function dd(e){let t=typeof e==`string`?sd(e,!0,ld):e;if(t){let e=rd(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function fd(e,t){let n=sd(e,!0,ld);if(!n)return!1;let r=rd(n.provider,n.prefix);return t?ad(r,n.name,t):(r.missing.add(n.name),!0)}function pd(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),ld&&!t&&!e.prefix){let t=!1;return ed(e)&&(e.prefix=``,Zu(e,(e,n)=>{fd(e,n)&&(t=!0)})),t}let n=e.prefix;return cd({prefix:n,name:`a`})?!!id(rd(t,n),e):!1}var md=Object.freeze({width:null,height:null}),hd=Object.freeze({...md,...Gu}),gd=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_d=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function vd(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(gd);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=_d.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 yd(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 bd(e,t){return e?`<defs>`+e+`</defs>`+t:t}function xd(e,t,n){let r=yd(e);return bd(r.defs,t+r.content+n)}var Sd=e=>e===`unset`||e===`undefined`||e===`none`;function Cd(e,t){let n={...Ku,...e},r={...hd,...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=xd(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=vd(d,c/l)):(u=o===`auto`?c:o,d=s===null?vd(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Sd(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 wd=/\sid="(\S+)"/g,Td=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ed=0;function Dd(e,t=Td){let n=[],r;for(;r=wd.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+(Ed++).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 Od=Object.create(null);function kd(e,t){Od[e]=t}function Ad(e){return Od[e]||Od[``]}function jd(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 Md=Object.create(null),Nd=[`https://api.simplesvg.com`,`https://api.unisvg.com`],Pd=[];Nd.length>0;)Nd.length===1||Math.random()>.5?Pd.push(Nd.shift()):Pd.push(Nd.pop());Md[``]=jd({resources:[`https://api.iconify.design`].concat(Pd)});function Fd(e,t){let n=jd(t);return n===null?!1:(Md[e]=n,!0)}function Id(e){return Md[e]}var Ld=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function Rd(e,t){let n=Id(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 zd(e){return e===404}var Bd=(e,t,n)=>{let r=[],i=Rd(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 Vd(e){if(typeof e==`string`){let t=Id(e);if(t)return t.path}return`/`}var Hd={prepare:Bd,send:(e,t,n)=>{if(!Ld){n(`abort`,424);return}let r=Vd(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;Ld(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(zd(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 Ud(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Wd(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||Ud([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Gd=0;function Kd(e,t,n){let r=Gd++,i=Ud.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 qd(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]=rd(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 Jd(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?sd(e,t,n):e;i&&r.push(i)}),r}var Yd={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Xd(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 Zd(e){let t={...Yd,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Xd(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 Qd(){}var $d=Object.create(null);function ef(e){if(!$d[e]){let t=Id(e);if(!t)return;$d[e]={config:t,redundancy:Zd(t)}}return $d[e]}function tf(e,t,n){let r,i;if(typeof e==`string`){let t=Ad(e);if(!t)return n(void 0,424),Qd;i=t.send;let a=ef(e);a&&(r=a.redundancy)}else{let t=jd(e);if(t){r=Zd(t);let n=Ad(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Qd):r.query(t,i,n)().abort}function nf(){}function rf(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Wd(e)}))}function af(e){let t=[],n=[];return e.forEach(e=>{(e.match(od)?t:n).push(e)}),{valid:t,invalid:n}}function of(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(!id(e,n).length){r();return}}catch(e){console.error(e)}r(),rf(e)}function sf(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function cf(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)){sf(e.loadIcons(r,n,t),t=>{of(e,r,t)});return}if(i){r.forEach(r=>{sf(i(r,n,t),t=>{of(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=af(r);if(o.length&&of(e,o,null),!a.length)return;let s=n.match(od)?Ad(t):null;if(!s){of(e,a,null);return}s.prepare(t,n,a).forEach(n=>{tf(t,n,t=>{of(e,n.icons,t)})})}))}var lf=(e,t)=>{let n=qd(Jd(e,!0,ud()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,nf)}),()=>{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(rd(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=rd(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&&cf(e,t)}),t?Kd(t,n,i):nf};function uf(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in md?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var df=/[\s,]+/;function ff(e,t){t.split(df).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function pf(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 mf(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 hf(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function gf(e){return`data:image/svg+xml,`+hf(e)}function _f(e){return`url("`+gf(e)+`")`}var vf;function yf(){try{vf=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{vf=null}}function bf(e){return vf===void 0&&yf(),vf?vf.createHTML(e):e}var xf={...hd,inline:!1},Sf={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Cf={display:`inline-block`},wf={backgroundColor:`currentColor`},Tf={backgroundColor:`transparent`},Ef={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},Df={WebkitMask:wf,mask:wf,background:Tf};for(let e in Df){let t=Df[e];for(let n in Ef)t[e+n]=Ef[n]}var Of={...xf,inline:!0};function kf(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Af=(e,t,n)=>{let r=t.inline?Of:xf,i=uf(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?Sf:{}};if(n){let e=sd(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`&&ff(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=pf(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=Cd(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:bf(Dd(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=mf(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":_f(h),width:kf(u.width),height:kf(u.height),...Cf,...m?wf:Tf,...s},(0,P.createElement)(`span`,c)};if(ud(!0),kd(``,Hd),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`||!pd(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;Fd(e,r)||console.error(n)}catch{console.error(n)}}}}function jf(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=dd(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=dd(n);l({name:n,data:r})&&(r===void 0?i({callback:lf([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?Af({...Ku,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,P.createElement)(`span`,{})}var Mf=(0,P.forwardRef)((e,t)=>jf({...e,_ref:t}));(0,P.forwardRef)((e,t)=>jf({inline:!0,...e,_ref:t}));var Nf=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#c5c5c5" d="M20.414 2H5v28h22V8.586ZM7 28V4h12v6h6v18Z"/>`}})),Pf=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"/>`}})),Ff=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"/>`}})),If=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"/>`}})),Lf=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"/>`}})),Rf=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"/>`}})),zf=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"/>`}})),Bf=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"/>`}})),Vf=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>`}})),Hf=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"/>`}})),Uf=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"/>`}})),Wf=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"/>`}})),Gf=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"/>`}})),Kf=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"/>`}})),qf=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"/>`}})),Jf=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"/>`}})),Yf=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"/>`}})),Xf=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"/>`}})),Zf=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"/>`}})),Qf=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"/>`}})),$f=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"/>`}})),ep=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"/>`}})),tp=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"/>`}})),np=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"/>`}})),rp=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"/>`}})),ip=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"/>`}})),ap=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"/>`}})),op=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"/>`}})),sp=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"/>`}})),cp=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"/>`}})),lp=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"/>`}})),up=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"/>`}})),dp=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"/>`}})),fp=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"/>`}})),pp=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"/>`}})),mp=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"/>`}})),hp=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"/>`}})),gp=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"/>`}})),_p=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"/>`}})),vp=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"/>`}})),yp=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"/>`}})),bp=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"/>`}})),xp=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"/>`}})),Sp=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"/>`}})),Cp=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"/>`}})),wp=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"/>`}})),Tp=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"/>`}})),Ep=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"/>`}})),Dp=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>`}})),Op=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"/>`}})),kp=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"/>`}})),Ap=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"/>`}})),jp=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"/>`}})),Mp=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"/>`}})),Np=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"/>`}})),Pp=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"/>`}})),Fp=e(Nf(),1),Ip=e(Pf(),1),Lp=e(Ff(),1),Rp=e(If(),1),zp=e(Lf(),1),Bp=e(Rf(),1),Vp=e(zf(),1),Hp=e(Bf(),1),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=[{icon:Hp.default,name:`docker`,pattern:/^(dockerfile|\.dockerignore)$/},{icon:Up.default,name:`dotenv`,pattern:/^\.env(?:\.|$)/},{icon:qp.default,name:`git`,pattern:/^\.git(?:attributes|ignore|modules)$/},{icon:im.default,name:`makefile`,pattern:/^makefile$/},{icon:nm.default,name:`license`,pattern:/^licen[cs]e(?:\.|$)/},{icon:am.default,name:`markdown`,pattern:/^readme(?:\.|$)/},{icon:om.default,name:`npm`,pattern:/^package(?:-lock)?\.json$/},{icon:lm.default,name:`pnpm`,pattern:/^(pnpm-lock\.yaml|pnpm-workspace\.yaml)$/},{icon:Fm.default,name:`yarn`,pattern:/^yarn\.lock$/},{icon:Lp.default,name:`bun`,pattern:/^bun\.lockb?$/},{icon:Em.default,name:`tsconfig`,pattern:/^tsconfig(?:\..+)?\.json$/},{icon:km.default,name:`vite`,pattern:/^vite\.config\./},{icon:Am.default,name:`vitest`,pattern:/^vitest(?:\..+)?\.config\./},{icon:Cm.default,name:`tailwind`,pattern:/^tailwind\.config\./},{icon:Wp.default,name:`eslint`,pattern:/^(eslint\.config\.|\.eslintrc)/},{icon:dm.default,name:`prettier`,pattern:/^(prettier\.config\.|\.prettierrc)/}],Rm=[{icon:mm.default,name:`react-typescript`,extensions:[`tsx`]},{icon:pm.default,name:`react-javascript`,extensions:[`jsx`]},{icon:Dm.default,name:`typescript`,extensions:[`ts`,`mts`,`cts`]},{icon:$p.default,name:`javascript`,extensions:[`js`,`mjs`,`cjs`]},{icon:em.default,name:`json`,extensions:[`json`,`json5`,`jsonc`]},{icon:am.default,name:`markdown`,extensions:[`md`,`mdx`]},{icon:Xp.default,name:`html`,extensions:[`html`,`htm`]},{icon:Vp.default,name:`css`,extensions:[`css`,`pcss`,`less`]},{icon:_m.default,name:`sass`,extensions:[`sass`,`scss`]},{icon:jm.default,name:`vue`,extensions:[`vue`]},{icon:bm.default,name:`svelte`,extensions:[`svelte`]},{icon:fm.default,name:`python`,extensions:[`py`,`pyw`]},{icon:Jp.default,name:`go`,extensions:[`go`]},{icon:gm.default,name:`rust`,extensions:[`rs`]},{icon:Qp.default,name:`java`,extensions:[`java`]},{icon:tm.default,name:`kotlin`,extensions:[`kt`,`kts`]},{icon:Sm.default,name:`swift`,extensions:[`swift`]},{icon:zp.default,name:`cpp`,extensions:[`c`,`cc`,`cpp`,`h`,`hpp`]},{icon:Bp.default,name:`csharp`,extensions:[`cs`]},{icon:cm.default,name:`php`,extensions:[`php`]},{icon:hm.default,name:`ruby`,extensions:[`rb`]},{icon:rm.default,name:`lua`,extensions:[`lua`]},{icon:vm.default,name:`shell`,extensions:[`sh`,`bash`,`zsh`,`fish`,`ps1`]},{icon:Yp.default,name:`graphql`,extensions:[`graphql`,`gql`]},{icon:Pm.default,name:`yaml`,extensions:[`yaml`,`yml`]},{icon:Tm.default,name:`toml`,extensions:[`toml`]},{icon:Nm.default,name:`xml`,extensions:[`xml`]},{icon:ym.default,name:`sql`,extensions:[`sql`,`sqlite`,`db`]},{icon:xm.default,name:`svg`,extensions:[`svg`]},{icon:Zp.default,name:`image`,extensions:[`avif`,`bmp`,`gif`,`heic`,`ico`,`jpeg`,`jpg`,`png`,`tif`,`tiff`,`webp`]},{icon:Ip.default,name:`audio`,extensions:[`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]},{icon:Om.default,name:`video`,extensions:[`avi`,`m4v`,`mkv`,`mov`,`mp4`,`webm`,`wmv`]},{icon:sm.default,name:`pdf`,extensions:[`pdf`]},{icon:Mm.default,name:`word`,extensions:[`doc`,`docx`,`odt`,`rtf`]},{icon:Gp.default,name:`excel`,extensions:[`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]},{icon:um.default,name:`powerpoint`,extensions:[`odp`,`ppt`,`pptx`]},{icon:Im.default,name:`archive`,extensions:[`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]},{icon:Kp.default,name:`font`,extensions:[`eot`,`otf`,`ttf`,`woff`,`woff2`]},{icon:Rp.default,name:`config`,extensions:[`cfg`,`conf`,`ini`,`properties`]},{icon:wm.default,name:`text`,extensions:[`log`,`txt`]}],zm={icon:Fp.default,name:`default`};function Bm(e){return e.trim().split(/[\\/]/).filter(Boolean).pop()??e.trim()}function Vm(e){return/\.([a-z0-9]{1,16})$/i.exec(e)?.[1]?.toLowerCase()??``}function Hm(e){let t=Bm(e).toLowerCase(),n=Lm.find(({pattern:e})=>e.test(t));if(n)return n;let r=Vm(t);return Rm.find(({extensions:e})=>e.includes(r))??zm}function Um(e){let t=e;return`body`in t?t:t.default}function Wm({className:e,fileName:t,size:n=`default`}){let r=Hm(t);return(0,F.jsx)(Mf,{"aria-hidden":`true`,"data-file-type-icon":r.name,icon:Um(r.icon),className:m(`shrink-0`,n===`compact`?`h-3.5 w-3.5`:`h-4 w-4`,e)})}function Gm({agentId:e,fileName:t,kind:n}){return n===`overview`?(0,F.jsx)(Fo,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`child-sessions`?(0,F.jsx)(Oo,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`project-files`?(0,F.jsx)(To,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`cron`?(0,F.jsx)(qa,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`file`?(0,F.jsx)(Wm,{fileName:t??``,size:`compact`}):n===`side-chat-draft`?(0,F.jsx)(Vo,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):e?(0,F.jsx)(ku,{agentId:e,className:`h-3.5 w-3.5 shrink-0`}):(0,F.jsx)(Ho,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`})}function Km(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)(Gm,{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:f(`chatWorkspaceCloseFile`),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)(nn,{className:`h-3.5 w-3.5`}):(0,F.jsx)(lo,{className:`h-3.5 w-3.5`}),label:e.alternateViewerAction.label,onClick:e.alternateViewerAction.onSelect}]:[],...e.onClose?[{key:`close`,icon:(0,F.jsx)(Sn,{className:`h-3.5 w-3.5`}),label:f(`chatWorkspaceCloseFile`),onClick:e.onClose}]:[]]:void 0}))}function qm({canGoBack:e,canGoForward:t,isMaximized:n=!1,onClose:r,onGoBack:i,onGoForward:a,onRefreshFile:o,onToggleMaximize:s,tabs:c}){return(0,F.jsx)(bt,{testId:`workspace-tabs-bar`,scrollTestId:`workspace-tabs-scroll`,tabs:Km(c),actions:[{key:`back`,icon:(0,F.jsx)(at,{className:`h-4 w-4`}),label:f(`chatWorkspaceBack`),disabled:!e,onClick:i},{key:`forward`,icon:(0,F.jsx)(Ct,{className:`h-4 w-4`}),label:f(`chatWorkspaceForward`),disabled:!t,onClick:a},...o?[{key:`refresh-file`,icon:(0,F.jsx)(vn,{className:`h-4 w-4`}),label:f(`chatWorkspaceRefreshFile`),onClick:o}]:[],...s?[{key:`maximize`,icon:n?(0,F.jsx)(Uo,{className:`h-4 w-4`}):(0,F.jsx)(zo,{className:`h-4 w-4`}),label:f(n?`chatWorkspaceRestorePanel`:`chatWorkspaceMaximizePanel`),onClick:s}]:[],{key:`close`,icon:(0,F.jsx)(Sn,{className:`h-4 w-4`}),label:f(`chatWorkspaceClosePanel`),onClick:r}],scrollClassName:`workspace-horizontal-scrollbar`,actionsClassName:`ml-1 mr-1 self-stretch`})}var Jm={key:`slash`,marker:`/`};function Ym(){return`composer-${Math.random().toString(36).slice(2,10)}`}function Xm(e=``){return{id:Ym(),type:`text`,text:e}}function Zm(e){return{id:Ym(),type:`token`,tokenKind:e.tokenKind,tokenKey:e.tokenKey,label:e.label}}function Qm(e){return e.type===`text`?e.text.length:1}function $m(){return[Xm(``)]}function eh(e){return[Xm(e)]}function th(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?$m():t}function nh(e){return e.map(e=>e.type===`text`?e.text:``).join(``)}function rh(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function ih(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 ah(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 oh(e,t,n,r){return t<=n||e>=r}function sh(e,t,n,r,i){return!n&&r>=i?(e.push(...t),!0):n}function ch(e,t,n,r,i,a,o){let s=ah(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 lh(e,t,n,r,i,a){return!r&&i<=a?(e.push(...n),!0):(e.push(t),r)}function uh(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=Qm(t),n=s,l=s+e;if(oh(n,l,i,a)){c=sh(o,r,c,n,a),o.push(t),s=l;continue}c=t.type===`text`?ch(o,t,n,i,a,r,c):lh(o,t,r,c,i,n),s=l}return c||o.push(...r),th(o)}function dh(e,t){return th(e.filter(e=>e.type!==`token`||!t(e)))}function fh(e,t){return t===0||/\s/.test(e[t-1]??``)}function ph(e,t,n){if(!t||t.start!==t.end)return null;let r=nh(e),i=t.end,a=r.slice(0,i),o=a.lastIndexOf(n.marker);if(o<0||!fh(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 mh(e,t,n=[Jm]){let r=null;for(let i of n){let n=ph(e,t,i);n&&(!r||n.start>r.start)&&(r=n)}return r}function hh(e,t){let n=ph(e,t,Jm);return n?{query:n.query,start:n.start,end:n.end}:null}var gh=e=>`[data-item-index="${e}"]`;function _h(e){let{activeIndex:t,containerRef:n,getItemSelector:r,isEnabled:i,itemCount:a}=e,o=r??gh;(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 vh(){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 yh=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}));yh.displayName=`ChatInput`;var bh=`2rem`;function xh(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${bh})))`}var Sh=xh(`24rem`),Ch=Ke,wh=Ze,Th=qe,Eh=P.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,collisionPadding:r=12,style:i,...a},o)=>(0,F.jsx)(We,{children:(0,F.jsx)(Ye,{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:Sh,...i},...a})}));Eh.displayName=Ye.displayName;var Dh=Pt,Oh=At,kh=kt,Ah=`2rem`;function jh(e){return`min(${e}, max(0px, calc(var(--radix-select-content-available-height, 100vh) - ${Ah})))`}var Mh=jh(`24rem`),Nh=P.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(Jt,{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)(It,{asChild:!0,children:(0,F.jsx)(Tt,{className:`h-4 w-4 opacity-50`})})]}));Nh.displayName=Jt.displayName;var Ph=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Dt,{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`})}));Ph.displayName=Dt.displayName;var Fh=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Nt,{ref:n,className:R(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(Tt,{className:`h-4 w-4`})}));Fh.displayName=Nt.displayName;var Ih=P.forwardRef(({className:e,children:t,collisionPadding:n=12,position:r=`popper`,style:i,viewportClassName:a,...o},s)=>(0,F.jsx)(Lt,{children:(0,F.jsxs)(Ht,{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:Mh,...i},...o,children:[(0,F.jsx)(Ph,{}),(0,F.jsx)(qt,{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)(Fh,{})]})}));Ih.displayName=Ht.displayName;var Lh=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Bt,{ref:n,className:R(`px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,e),...t}));Lh.displayName=Bt.displayName;var Rh=P.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(Wt,{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)(jt,{children:(0,F.jsx)(Kt,{className:`h-4 w-4`})})}),(0,F.jsx)(Mt,{children:t})]}));Rh.displayName=Wt.displayName;var zh=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(Gt,{ref:n,className:R(`-mx-1 my-1 h-px bg-border`,e),...t}));zh.displayName=Gt.displayName;var Bh=ut,Vh=dt,Hh=yt,Uh=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,F.jsx)(St,{children:(0,F.jsx)(ht,{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})}));Uh.displayName=ht.displayName;var Wh={Popover:Ch,PopoverAnchor:Th,PopoverContent:Eh,PopoverTrigger:wh,Input:yh,Select:Dh,SelectContent:Ih,SelectGroup:Oh,SelectItem:Rh,SelectLabel:Lh,SelectSeparator:zh,SelectTrigger:Nh,SelectValue:kh,Tooltip:Vh,TooltipContent:Uh,TooltipProvider:Bh,TooltipTrigger:Hh},Gh=680,Kh=.82,qh=560,Jh=xh(`24rem`),Yh=xh(`240px`);function Xh(e,t){return!t.sectionKeys||t.sectionKeys.length===0?!0:!!(e.sectionKey&&t.sectionKeys.includes(e.sectionKey))}var Zh=(0,P.forwardRef)(function(e,t){let{Popover:n,PopoverAnchor:r,PopoverContent:i}=Wh,{elementRef:a,width:o}=vh(),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=>Xh(t,e)).length}))??[],[f,p]),C=(0,P.useMemo)(()=>x?p.filter(e=>Xh(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>qh?o*Kh:o,Gh)},[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]),_h({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:Jh,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:Yh},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 Qh(e){return`${e.key}:${e.marker}:${e.start}`}function $h(e,t){return t.type===`insert-text`&&t.text===e.marker&&e.query===``&&e.end===e.start+e.marker.length}function eg(e,t,n){if(!t)return null;let r=Qh(t);return e===r?e:$h(t,n)?r:null}function tg(e){let{children:t,inputSurface:n,onInputSurfaceTriggerChange:r,onSelectItem:i,triggerSpecs:a=[Jm]}=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=mh(e,t,a),i=eg(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)(Zh,{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 ng=re(`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`}}),rg=P.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,F.jsx)(`button`,{className:R(ng({variant:t,size:n,className:e})),ref:i,...r}));rg.displayName=`ChatButton`;function ig(){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 ag({contextWindow:e}){let{Tooltip:t,TooltipContent:n,TooltipProvider:r,TooltipTrigger:i}=Wh,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 og({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}=Wh;return(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s?(0,F.jsx)(ag,{contextWindow:s}):null,!e||!n?(0,F.jsx)(rg,{size:`icon`,className:`h-8 w-8 rounded-full`,"aria-label":a,onClick:()=>void c(),disabled:n,children:(0,F.jsx)(Za,{className:`h-5 w-5`})}):t?(0,F.jsx)(rg,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":o,onClick:()=>void l(),disabled:r,children:(0,F.jsx)(ig,{})}):(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)(rg,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":o,disabled:!0,children:(0,F.jsx)(ig,{})})})}),(0,F.jsx)(d,{side:`top`,children:(0,F.jsx)(`p`,{className:`text-xs`,children:i})})]})})]})}function sg(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 cg=xh(`24rem`);function lg(e){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i}=Wh,{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):sg(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]),_h({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)(eo,{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:cg},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)(ot,{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)(Qo,{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)(Kt,{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)(tn,{className:`h-3 w-3`})]})}):null]})]})}function ug({icon:e}){return e===`sparkles`?(0,F.jsx)(yn,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):e===`brain`?(0,F.jsx)(to,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):null}function dg({icon:e}){return e===`paperclip`?(0,F.jsx)(Yo,{className:`h-4 w-4`}):(0,F.jsx)(ug,{icon:e})}var fg={model:`min-w-0 max-w-[18rem]`,"session-type":`shrink-0`,thinking:`shrink-0`},pg={model:`w-[min(18rem,calc(100vw-1rem))] sm:w-[320px]`,"session-type":`w-[220px]`,thinking:`w-[180px]`},mg=xh(`18rem`),hg=jh(`18rem`);function gg(e){return e.key===`model`&&e.selectedLabel&&e.selectedLabel.split(`/`).slice(1).join(`/`).trim()||e.selectedLabel}function _g(e){return e.groups?.filter(e=>e.options.length>0)??(e.options.length>0?[{key:`${e.key}-default`,options:e.options}]:[])}function vg({item:e}){let t=gg(e);return e.selectedLabel?(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,F.jsx)(ug,{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 yg({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 bg({item:e}){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i,Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=Wh,[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(``),p=_g(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 ${fg[e.key]??``}`,children:[(0,F.jsx)(vg,{item:e}),(0,F.jsx)(Tt,{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 ${pg[e.key]??``}`,style:{maxHeight:mg},children:[(0,F.jsxs)(`div`,{className:`relative mb-1.5 shrink-0`,children:[(0,F.jsx)(ot,{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)(yg,{option:t})}),n?(0,F.jsx)(Kt,{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)(ls,{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 xg({item:e}){if(e.search)return(0,F.jsx)(bg,{item:e});let{Select:t,SelectContent:n,SelectGroup:r,SelectItem:i,SelectLabel:a,SelectSeparator:o,SelectTrigger:s,SelectValue:c}=Wh,l=_g(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 ${fg[e.key]??``}`,children:e.selectedLabel||e.loading?(0,F.jsx)(vg,{item:e}):(0,F.jsx)(c,{placeholder:e.placeholder})}),(0,F.jsxs)(n,{className:pg[e.key]??``,style:{maxHeight:hg},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)(yg,{option:e})},e.value))]})]},e.key))]})]})}function Sg({actions:e,accessories:t,selects:n,skillPicker:r,trailingSelects:i=[]}){let{Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=Wh;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)(lg,{picker:r}):null,n.map(e=>(0,F.jsx)(xg,{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)(dg,{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)(xg,{item:e},e.key))}):null,(0,F.jsx)(og,{...e})]})]})}var Cg=(0,P.createContext)(null);function wg(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function Tg(){let e=(0,P.useContext)(Cg);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 Eg(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 Dg=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Og=Dg&&`documentMode`in document?document.documentMode:null,kg=Dg&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ag=Dg&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),jg=!(!Dg||!(`InputEvent`in window)||Og)&&`getTargetRanges`in new window.InputEvent(`input`),Mg=Dg&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ng=Dg&&/Android/.test(navigator.userAgent),Pg=Dg&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Ng,Fg=Dg&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ig=Dg&&Ng&&Fg,Lg=Dg&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&kg&&!Fg,Rg=0,zg=1,Bg=2,Vg=1,Hg=2,Ug=3,Wg=4,Gg=5,Kg=6,qg=Pg||Mg||Lg?`\xA0`:`​`,Jg=`
5
-
6
- `,Yg=Ag?`\xA0`:qg,Xg={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Zg={directionless:1,unmergeable:2},Qg={center:2,end:6,justify:4,left:1,right:3,start:5},$g={[Hg]:`center`,[Kg]:`end`,[Wg]:`justify`,[Vg]:`left`,[Ug]:`right`,[Gg]:`start`},e_={normal:0,segmented:2,token:1},t_={[Rg]:`normal`,[Bg]:`segmented`,[zg]:`token`},n_=`$config`;function r_(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(W(o)&&r_(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var i_=!1,a_=0;function o_(e){a_=e.timeStamp}function s_(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&iS(e,n)!==void 0}function c_(e,t,n){let r=KS(RS(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&_S(t,o,i,a,!1)}function l_(e,t,n){if(H(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return qx(t)&&n.isAttached()}function u_(e,t,n,r){for(let i=e;i&&!sC(i);i=MS(i)){let e=iS(i,t);if(e!==void 0){let t=nS(e,n);if(t)return mx(t)||!JS(i)?void 0:[i,t]}else if(i===r)return[r,lS(n)]}}function d_(e,t,n){i_=!0;let r=performance.now()-a_>100;try{cx(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=u_(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&V(g)&&qx(p)&&l_(i,p,g)&&c_(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=rS(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!s_(r,a,e)){if(Ag){let e=(JS(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];(s_(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`||s_(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&uS(i),Ag&&AS(e)&&i.insertRawText(u))})}finally{i_=!1}}function f_(e){let t=e._observer;t!==null&&d_(e,t.takeRecords(),t)}function p_(e){(function(e){a_===0&&RS(e).addEventListener(`textInput`,o_,!0)})(e),e._observer=new MutationObserver((t,n)=>{d_(e,t,n)})}var m_=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||x_).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function h_(e,t){return new m_(e,t)}function g_(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}=lC(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 __=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 b_(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=b_(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 v_(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new __(t,y_(t));return t.__state=n,n}function y_(e){return e.__state?e.__state.sharedNodeState:Ix(eC(),e.getType()).sharedNodeState}function b_(e){if(e)for(let t in e)return e}function x_(e){return e}function S_(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 C_(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 w_(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function T_(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&&S_(n,e,t)||t&&S_(n,t,e)||e&&C_(n,e,t)||t&&C_(n,t,e))}(c,l))}function E_(e,t){let n=e.mergeWithSibling(t),r=Yb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function D_(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(T_(t,r)){r=E_(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&V(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(T_(r,n)){r=E_(r,n);break}break}n.remove()}}else r.remove()}function O_(e){return k_(e.anchor),k_(e.focus),e}function k_(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 A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_=``,V_=null,H_=null,U_=!1,W_=!1;function G_(e,t){let n=I_.get(e);if(t!==null){let n=lv(e);n.parentNode===t&&t.removeChild(n)}if(L_.has(e)||j_._keyToDOMMap.delete(e),W(n)){let e=rv(n,I_);K_(e,0,e.length-1,null)}n!==void 0&&DS(z_,M_,N_,n,`destroyed`)}function K_(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&G_(t,r)}}function q_(e,t){e.setProperty(`text-align`,t)}var J_=`40px`;function Y_(e,t){let n=A_.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(j_._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||J_;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function X_(e,t){let n=e.style;t===0?q_(n,``):t===1?q_(n,`left`):t===2?q_(n,`center`):t===3?q_(n,`right`):t===4?q_(n,`justify`):t===5?q_(n,`start`):t===6&&q_(n,`end`)}function Z_(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(gx(e))return null;let n=e.getParentOrThrow();return gx(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Q_(e,t){let n=L_.get(e);n===void 0&&z(60);let r=n.createDOM(A_,j_);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,j_),V(n)?r.setAttribute(`data-lexical-text`,`true`):mx(n)&&r.setAttribute(`data-lexical-decorator`,`true`),W(n)){let e=n.__indent,t=n.__size;if(Z_(r,n),e!==0&&Y_(r,e),t!==0){let e=t-1;$_(rv(n,L_),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&X_(r,i),n.isInline()||tv(null,n,r)}else{let t=n.getTextContent();if(mx(n)){let t=n.decorate(j_,A_);t!==null&&av(e,t),r.contentEditable=`false`}B_+=t}return t!==null&&t.insertChild(r),DS(z_,M_,N_,n,`created`),r}function $_(e,t,n,r,i){let a=B_;B_=``;let o=n;for(;o<=r;++o){Q_(e[o],i);let t=L_.get(e[o]);t!==null&&V(t)?V_===null&&(V_=t.getFormat(),H_=t.getStyle()):W(t)&&o<r&&!t.isInline()&&(B_+=Jg)}i.element.__lexicalTextContent=B_,B_=a+B_}function ev(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return By(e)?`line-break`:mx(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function tv(e,t,n){let r=ev(e,I_),i=ev(t,L_);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function nv(e,t,n){var r;V_=null,H_=null,function(e,t,n){let r=B_,i=e.__size,a=t.__size;B_=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)iv(n,o);else{let e=lv(n),t=Q_(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}G_(n,null)}let i=L_.get(r);V(i)&&V_===null&&(V_=i.getFormat(),H_=i.getStyle())}else{let r=rv(e,I_),s=rv(t,L_);if(r.length!==i&&z(227),s.length!==a&&z(228),i===0)a!==0&&$_(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;K_(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=ov(iv(r,a.element)),d++,f++;else{if(l===void 0&&(l=sv(n,f)),c===void 0)c=sv(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=ov(lv(e)),G_(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=jS(j_,r);e!==u&&a.withBefore(u).insertChild(e),u=ov(iv(r,a.element)),d++,f++}else Q_(r,a.withBefore(u)),f++}let i=L_.get(r);i!==null&&V(i)?V_===null&&(V_=i.getFormat(),H_=i.getStyle()):W(i)&&f<=s&&!i.isInline()&&(B_+=Jg)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:j_.getElementByKey(e);$_(n,0,f,s,a.withBefore(t))}else m&&!p&&K_(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=B_,B_=r+B_}(e,t,t.getDOMSlot(n)),r=t,V_==null||V_===r.__textFormat||W_||r.setTextFormat(V_),function(e){H_==null||H_===e.__textStyle||W_||e.setTextStyle(H_)}(t)}function rv(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 iv(e,t){let n=I_.get(e),r=L_.get(e);n!==void 0&&r!==void 0||z(61);let i=U_||F_.has(e)||P_.has(e),a=jS(j_,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 B_+=e,a}if(n!==r&&i&&DS(z_,M_,N_,r,`updated`),r.updateDOM(n,a,A_)){let n=Q_(e,null);return t===null&&z(62),t.replaceChild(n,a),G_(e,null),n}if(W(n)){W(r)||z(334,e);let t=r.__indent;(U_||t!==n.__indent)&&Y_(a,t);let o=r.__format;if((U_||o!==n.__format)&&X_(a,o),i)nv(n,r,a),gx(r)||r.isInline()||tv(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),B_+=t}if((U_||r.__dir!==n.__dir)&&(Z_(a,r),gx(r)&&!U_))for(let e of r.getChildren())W(e)&&Z_(jS(j_,e.getKey()),e)}else{let t=r.getTextContent();if(mx(r)){let t=r.decorate(j_,A_);t!==null&&av(e,t)}B_+=t}if(!W_&&gx(r)&&r.__cachedText!==B_){let e=r.getWritable();e.__cachedText=B_,r=e}return a}function av(e,t){let n=j_._pendingDecorators,r=j_._decorators;if(n===null){if(r[e]===t)return;n=oS(j_)}n[e]=t}function ov(e){let t=e.nextSibling;return t!==null&&t===j_._blockCursorElement&&(t=t.nextSibling),t}function sv(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function cv(e,t,n,r,i,a){B_=``,U_=r===2,j_=n,A_=n._config,M_=n._nodes,N_=j_._listeners.mutation,P_=i,F_=a,I_=e._nodeMap,L_=t._nodeMap,W_=t._readOnly,R_=new Map(n._keyToDOMMap);let o=new Map;return z_=o,iv(`root`,null),j_=void 0,M_=void 0,P_=void 0,F_=void 0,I_=void 0,L_=void 0,A_=void 0,R_=void 0,z_=void 0,o}function lv(e){let t=R_.get(e);return t===void 0&&z(75,e),t}function B(e){return{type:e}}var uv=B(`SELECTION_CHANGE_COMMAND`),dv=B(`CLICK_COMMAND`),fv=B(`BEFORE_INPUT_COMMAND`),pv=B(`INPUT_COMMAND`),mv=B(`COMPOSITION_START_COMMAND`),hv=B(`COMPOSITION_END_COMMAND`),gv=B(`DELETE_CHARACTER_COMMAND`),_v=B(`INSERT_LINE_BREAK_COMMAND`),vv=B(`INSERT_PARAGRAPH_COMMAND`),yv=B(`CONTROLLED_TEXT_INSERTION_COMMAND`),bv=B(`PASTE_COMMAND`),xv=B(`REMOVE_TEXT_COMMAND`),Sv=B(`DELETE_WORD_COMMAND`),Cv=B(`DELETE_LINE_COMMAND`),wv=B(`FORMAT_TEXT_COMMAND`),Tv=B(`UNDO_COMMAND`),Ev=B(`REDO_COMMAND`),Dv=B(`KEYDOWN_COMMAND`),Ov=B(`KEY_ARROW_RIGHT_COMMAND`),kv=B(`MOVE_TO_END`),Av=B(`KEY_ARROW_LEFT_COMMAND`),jv=B(`MOVE_TO_START`),Mv=B(`KEY_ARROW_UP_COMMAND`),Nv=B(`KEY_ARROW_DOWN_COMMAND`),Pv=B(`KEY_ENTER_COMMAND`),Fv=B(`KEY_SPACE_COMMAND`),Iv=B(`KEY_BACKSPACE_COMMAND`),Lv=B(`KEY_ESCAPE_COMMAND`),Rv=B(`KEY_DELETE_COMMAND`),zv=B(`KEY_TAB_COMMAND`),Bv=B(`DROP_COMMAND`),Vv=B(`DRAGSTART_COMMAND`),Hv=B(`DRAGOVER_COMMAND`),Uv=B(`DRAGEND_COMMAND`),Wv=B(`COPY_COMMAND`),Gv=B(`CUT_COMMAND`),Kv=B(`SELECT_ALL_COMMAND`),qv=B(`FOCUS_COMMAND`),Jv=B(`BLUR_COMMAND`),Yv=B(`KEY_MODIFIER_COMMAND`),Xv=Object.freeze({}),Zv=[[`keydown`,function(e,t){Qv=e.timeStamp,$v=e.key,!t.isComposing()&&K(t,Dv,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;YS(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&cx(t,()=>{zx(n)||(ay=!0)})}],[`compositionstart`,function(e,t){K(t,mv,e)}],[`compositionend`,function(e,t){Ag?sy=!0:Mg||!Pg&&!Lg?K(t,hv,e):(cy=!0,ly=e.data)}],[`input`,function(e,t){e.stopPropagation(),cx(t,()=>{t.dispatchCommand(pv,e)},{event:e}),ty=null}],[`click`,function(e,t){cx(t,()=>{let n=U(),r=KS(RS(t)),i=Ob();if(r){if(H(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!gx(a)&&cS().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=dC(a,e=>W(e)&&!e.isInline());W(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(JS(n)||qx(n))&&uS(Db(i,r,t,e))}}K(t,dv,e)})}],[`cut`,Xv],[`copy`,Xv],[`dragstart`,Xv],[`dragover`,Xv],[`dragend`,Xv],[`paste`,Xv],[`focus`,Xv],[`blur`,Xv],[`drop`,Xv]];jg&&Zv.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||Ag&&AS(t)||n!==`insertCompositionText`&&K(t,fv,e)}(e,t)]);var Qv=0,$v=null,ey=0,ty=null,ny=new WeakMap,ry=new WeakMap,iy=!1,ay=!1,oy=!1,sy=!1,cy=!1,ly=``,uy=null,dy=[0,``,0,`root`,0];function fy(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=Yb(),l=KS(RS(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!V(s)||(!i&&(!jg||ey<r+50)||s.isDirty()&&p<2||fS(n))&&a.offset!==o.offset&&!s.isComposing()||Kx(s)||s.isDirty()&&p>1||(i||!jg)&&f!==null&&!s.isComposing()&&u!==Yx(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=Gx(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 py(e,t){return qx(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function my(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;iy&&(iy=!1,py(r,i)&&py(a,o)&&!uy)||cx(t,()=>{if(!n)return void uS(null);if(!Vx(t,r,a))return;let s=U();if(uy&&H(s)&&s.isCollapsed()){let e=s.anchor,t=uy.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=uy.clone(),uS(s))}if(uy=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=RS(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=dy,f=cS(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)hy(s,o,c);else if(n.type===`text`)V(r)||z(141),gy(s,r);else if(n.type===`element`&&!p){W(r)||z(259);let e=n.getNode();e.isEmpty()?function(e,t){hy(e,t.getTextFormat(),t.getTextStyle())}(s,e):hy(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,uv,void 0)})}function hy(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function gy(e,t){hy(e,t.getFormat(),t.getStyle())}function _y(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function vy(e){let t=e.inputType,n=_y(e),r=Yb(),i=U();if(t===`deleteContentBackward`){if(i===null){let e=Ob();if(!H(e))return!0;uS(e.clone())}if(H(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,$v===`MediaLast`&&a<Qv+30&&r.isComposing()&&t){if(eS(null),Qv=0,setTimeout(()=>{cx(r,()=>{eS(null)})},30),H(i)){let e=i.anchor.getNode();e.markDirty(),V(e)||z(142),gy(i,e)}}else{eS(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=Ig&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!mx(kS(i.anchor,!0))),!c){K(r,gv,!0);let e=U();Ig&&H(e)&&e.isCollapsed()&&(uy=e,setTimeout(()=>uy=null))}}return!0}}var a;if(!H(i))return!0;let o=e.data;ty!==null&&gS(!1,r,ty),i.dirty&&ty===null||!i.isCollapsed()||gx(i.anchor.getNode())||n===null||i.applyDOMRange(n),ty=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,_v,!1);else if(o===Jg)e.preventDefault(),K(r,vv,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&fy(i,n,o,e.timeStamp,!0)?(e.preventDefault(),K(r,yv,o)):ty=o;return ey=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:K(r,yv,e);break;case`insertFromComposition`:eS(null),K(r,yv,e);break;case`insertLineBreak`:eS(null),K(r,_v,!1);break;case`insertParagraph`:eS(null),oy&&!Mg?(oy=!1,K(r,_v,!1)):K(r,vv,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:K(r,bv,e);break;case`deleteByComposition`:(function(e,t){return e!==t||W(e)||W(t)||!Gx(e)||!Gx(t)})(l,u)&&K(r,xv,e);break;case`deleteByDrag`:case`deleteByCut`:K(r,xv,e);break;case`deleteContent`:K(r,gv,!1);break;case`deleteWordBackward`:K(r,Sv,!0);break;case`deleteWordForward`:K(r,Sv,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:K(r,Cv,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:K(r,Cv,!1);break;case`formatStrikeThrough`:K(r,wv,`strikethrough`);break;case`formatBold`:K(r,wv,`bold`);break;case`formatItalic`:K(r,wv,`italic`);break;case`formatUnderline`:K(r,wv,`underline`);break;case`historyUndo`:K(r,Tv,void 0);break;case`historyRedo`:K(r,Ev,void 0)}return!0}function yy(e){if(JS(e.target)&&zx(e.target))return!0;let t=Yb(),n=U(),r=e.data,i=_y(e);if(r!=null&&H(n)&&fy(n,i,r,e.timeStamp,!1)){sy&&=(Sy(t,r),!1);let i=n.anchor.getNode(),a=KS(RS(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;jg&&!n.isCollapsed()&&V(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===hS(a.anchorNode)||K(t,yv,r);let l=r.length;Ag&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),Ig&&t.isComposing()&&(Qv=0,eS(null))}else gS(!1,t,r===null?void 0:r),sy&&=(Sy(t,r||void 0),!1);return function(){Kb(),f_(Yb())}(),!0}function by(e){let t=Yb(),n=U();if(H(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();eS(r.key),PS(Fy),(e.timeStamp<Qv+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||V(i)&&i.getStyle()!==n.style)&&K(t,yv,Yg)}return!0}function xy(e){return Sy(Yb(),e.data),PS(Iy),!0}function Sy(e,t){let n=e._compositionKey;if(eS(null),n!==null&&t!=null){if(t===``){let t=nS(n),r=Yx(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&V(t)){let n=KS(RS(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),_S(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
8
- `){let t=U();if(H(t)||mb(t)){if(H(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}K(e,Pv,null);return}}}gS(!0,e,t)}function Cy(e){let t=Yb();if(e.key==null)return!0;if(cy){if(CS(e))return cx(t,()=>{Sy(t,ly)}),cy=!1,ly=``,!0;cy=!1,ly=``}if(function(e){return G(e,`ArrowRight`,{shiftKey:`any`})}(e))K(t,Ov,e);else if(function(e){return G(e,`ArrowRight`,xS)}(e))K(t,kv,e);else if(function(e){return G(e,`ArrowLeft`,{shiftKey:`any`})}(e))K(t,Av,e);else if(function(e){return G(e,`ArrowLeft`,xS)}(e))K(t,jv,e);else if(function(e){return G(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))K(t,Mv,e);else if(function(e){return G(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))K(t,Nv,e);else if(function(e){return G(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))oy=!0,K(t,Pv,e);else if(function(e){return e.key===` `}(e))K(t,Fv,e);else if(function(e){return kg&&G(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),oy=!0,K(t,_v,!0);else if(function(e){return G(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))oy=!1,K(t,Pv,e);else if(function(e){return G(e,`Backspace`,{shiftKey:`any`})||kg&&G(e,`h`,{ctrlKey:!0})}(e))CS(e)?K(t,Iv,e):(e.preventDefault(),K(t,gv,!0));else if(function(e){return e.key===`Escape`}(e))K(t,Lv,e);else if(function(e){return G(e,`Delete`,{})||kg&&G(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?K(t,Rv,e):(e.preventDefault(),K(t,gv,!1));else if(function(e){return G(e,`Backspace`,SS)}(e))e.preventDefault(),K(t,Sv,!0);else if(function(e){return G(e,`Delete`,SS)}(e))e.preventDefault(),K(t,Sv,!1);else if(function(e){return kg&&G(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),K(t,Cv,!0);else if(function(e){return kg&&(G(e,`Delete`,{metaKey:!0})||G(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),K(t,Cv,!1);else if(function(e){return G(e,`b`,xS)}(e))e.preventDefault(),K(t,wv,`bold`);else if(function(e){return G(e,`u`,xS)}(e))e.preventDefault(),K(t,wv,`underline`);else if(function(e){return G(e,`i`,xS)}(e))e.preventDefault(),K(t,wv,`italic`);else if(function(e){return G(e,`Tab`,{shiftKey:`any`})}(e))K(t,zv,e);else if(function(e){return G(e,`z`,xS)}(e))e.preventDefault(),K(t,Tv,void 0);else if(function(e){return kg?G(e,`z`,{metaKey:!0,shiftKey:!0}):G(e,`y`,{ctrlKey:!0})||G(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),K(t,Ev,void 0);else{let n=t._editorState._selection;n===null||H(n)?wS(e)&&(e.preventDefault(),K(t,Kv,e)):function(e){return G(e,`c`,xS)}(e)?(e.preventDefault(),K(t,Wv,e)):function(e){return G(e,`x`,xS)}(e)?(e.preventDefault(),K(t,Gv,e)):wS(e)&&(e.preventDefault(),K(t,Kv,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Yv,e),!0}function wy(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Ty=new Map;function Ey(e){let t=qS(e.target);if(t===null)return;let n=Ux(t.anchorNode);if(n===null)return;ay&&(ay=!1,cx(n,()=>{let r=Ob(),i=t.anchorNode;(JS(i)||qx(i))&&uS(Db(r,t,n,e))}));let r=pS(n),i=r[r.length-1],a=i._key,o=Ty.get(a),s=o||i;s!==n&&my(t,s,!1),my(t,n,!0),n===i?o&&Ty.delete(a):Ty.set(a,n)}function Dy(e){e._lexicalHandled=!0}function Oy(e){return!0===e._lexicalHandled}function ky(e){let t=ny.get(e);if(t===void 0)return;let n=ry.get(t);if(n===void 0)return;let r=n-1;r>=0||z(164),ny.delete(e),ry.set(t,r),r===0&&t.removeEventListener(`selectionchange`,Ey);let i=Wx(e);Hx(i)?(function(e){if(e._parentEditor!==null){let t=pS(e),n=t[t.length-1]._key;Ty.get(n)===e&&Ty.delete(n)}else Ty.delete(e._key)}(i),e.__lexicalEditor=null):i&&z(198);let a=wy(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function Ay(e,t,n){Kb();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 IS(i,e)&&n.set(e.__key,0,`element`),IS(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&&(jb(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(jb(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else mb(a)&&t&&e.isSelected()&&e.selectPrevious();if(H(a)&&t&&!o){let t=e.getIndexWithinParent();Qx(e),kb(a,i,t,-1)}else Qx(e);n||BS(i)||i.canBeEmpty()||!i.isEmpty()||Ay(i,t),t&&a&&gx(i)&&i.isEmpty()&&i.selectEnd()}var jy=Symbol.for(`ephemeral`);function My(e){return e[jy]||!1}var Ny=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=lC(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}),Zx(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=nS(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(mx(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:nS(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(BS(t))return W(e)||e===this&&mx(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:nS(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:nS(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?UC(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=UC(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?BC(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&z(279),!1)))}isParentOf(e){let t=UC(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=Yb()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(My(this))return this;let e=nS(this.__key);return e===null&&z(113),e}getWritable(){if(My(this))return this;Kb();let e=Jb(),t=Yb(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=U();if(o!==null&&o.setCachedNodes(null),a.has(r))return $x(i),i;let s=iC(i);return a.add(r),$x(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 y_(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&v_(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Ay(this,!0,e)}replace(e,t){Kb();let n=U();n!==null&&(n=n.clone()),HS(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;Qx(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(Ay(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)){uS(n);let e=n.anchor,t=n.focus;e.key===i&&db(e,o),t.key===i&&db(t,o)}return tS()===i&&eS(a),o}insertAfter(e,t=!0){Kb(),HS(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(Qx(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();kb(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){Kb(),HS(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;Qx(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)&&kb(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Tx()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Kb();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){Kb();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()}},Py=`history-merge`,Fy=`composition-start`,Iy=`composition-end`,Ly=class e extends Ny{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&&QS(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Vy(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&Vy(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&QS(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&Vy(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&Vy(r))return!0}return!1}(e)?null:{conversion:Ry,priority:0}}}static importJSON(e){return zy().updateFromJSON(e)}};function Ry(e){return{node:zy()}}function zy(){return VS(new Ly)}function By(e){return e instanceof Ly}function Vy(e){return qx(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function Hy(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function Uy(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Wy(e,t,n,r,i){let a=r.classList,o=ES(i,`base`);o!==void 0&&a.add(...o),o=ES(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 Xg){let r=Xg[e];if(o=ES(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 Gy(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?qg:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a)if(i||Ag){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 Ky(e,t,n,r,i,a){Gy(i,e,t);let o=a.theme.text;o!==void 0&&Wy(0,0,r,e,o)}function qy(e,t){let n=document.createElement(t);return n.appendChild(e),n}var Jy=class e extends Ny{__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 t_[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===tS()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Xg[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Xx(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Hy(0,n),i=Uy(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)),Ky(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=Hy(0,i),s=Hy(0,a),c=Uy(0,i),l=Uy(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 Ky(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??z(49)),Gy(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Wy(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:$y,priority:0}),b:()=>({conversion:Xy,priority:0}),code:()=>({conversion:nb,priority:0}),em:()=>({conversion:nb,priority:0}),i:()=>({conversion:nb,priority:0}),mark:()=>({conversion:nb,priority:0}),s:()=>({conversion:nb,priority:0}),span:()=>({conversion:Yy,priority:0}),strong:()=>({conversion:nb,priority:0}),sub:()=>({conversion:nb,priority:0}),sup:()=>({conversion:nb,priority:0}),u:()=>({conversion:nb,priority:0})}}static importJSON(e){return rb().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 JS(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=qy(t,`b`)),this.hasFormat(`italic`)&&(t=qy(t,`i`)),this.hasFormat(`strikethrough`)&&(t=qy(t,`s`)),this.hasFormat(`underline`)&&(t=qy(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`?Xg[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Zg[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Xx(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=e_[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){Kb();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 wb(o,n,o,r,`text`,`text`);{let e=tS();e!==i.anchor.key&&e!==i.focus.key||eS(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){Kb();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=tS(),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=rb(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=w_(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=rb(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=w_(t,n);let a=n.__key;i===r&&eS(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&&$x(t),n!==null&&$x(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),H(v)&&kb(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;tS()===r&&eS(n);let o=U();if(H(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Mb(i,t,n,e,a),s!==null&&s.key===r&&Mb(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 Yy(e){return{forChild:ib(e.style),node:null}}function Xy(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:ib(t.style,n?void 0:`bold`),node:null}}var Zy=new WeakMap;function Qy(e){if(!JS(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function $y(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=Zy.get(n))===void 0&&!Qy(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)Zy.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(zy()):r===` `?t.push(ob()):r!==``&&t.push(rb(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=eb(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=eb(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:rb(n)}}function eb(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,JS(n)){let e=n.style.display;if(e===``&&!ZS(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(qx(n))return n;if(n.nodeName===`BR`)return null}}var tb={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function nb(e){let t=tb[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:ib(e.style,t),node:null}}function rb(e=``){return VS(new Jy(e))}function V(e){return e instanceof Jy}function ib(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 ab=class e extends Jy{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=ES(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return ob().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&Eg(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 ob(){return VS(new ab)}function sb(e){return e instanceof ab}var cb=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:zC($C(WC(this,`next`)),$C(WC(e,`next`)))<0}getNode(){let e=nS(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,Gb()||(tS()===a&&eS(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function lb(e,t,n){return new cb(e,t,n)}function ub(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 db(e,t){if(W(t)){let n=t.getLastDescendant();W(n)||V(n)?ub(e,n):ub(e,t)}else ub(e,t)}var fb=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(!mb(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=nS(e);t!==null&&n.push(t)}return Gb()||(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()||Ob())===this&&e[0]){let t=EC(e[0],`next`);KC(LC(t,t))}for(let t of e)t.remove()}};function H(e){return e instanceof pb}var pb=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(SC(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),xC(e.focus)&&W(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=AC(e.focus.origin,`previous`);SC(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=MC(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=$C(e.anchor),r=$C(e.anchor.getFlipped()),i=e=>bC(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(nw(JC(this),`next`));return Gb()||(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]=gb(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 !mx(d)&&!By(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=Yb(),n=t.getEditorState()._selection,r=Cb(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),O_(this)}clone(){let t=this.anchor,n=this.focus;return new e(lb(t.key,t.offset,t.type),lb(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Xx(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=Xg[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(zy()):r===` `?n.push(ob()):n.push(rb(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=rb();if(o.setFormat(n),o.setStyle(r),Ex(a))a.splice(0,0,[o]);else{let e=gx(i)?Tx().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`&&GC(o,$C(WC(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&&(Kx(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(V(t)&&t.canInsertTextBefore()&&!Kx(t)||(t=rb(),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&&(Kx(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(V(t)&&!Kx(t)||(t=rb(),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=rb(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(``),Sb(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(Gx(d)){let t=rb(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(sb(d)){let t=rb(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=rb(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)&&!Gx(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=rb(m.getTextContent());m.replace(e),m=e}gx(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(Gx(d))if(s===f)d.select();else{let t=rb(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;qC(this,QC(JC(this))),e&&U()!==this&&uS(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void eS(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),eS(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(Kx(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||Kx(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||Kx(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=dC(t,$S),r=e[e.length-1];if(W(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=Ib(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some(e=>(W(e)||mx(e))&&!e.isInline())){W(n)||z(211,t.constructor.name,t.getType());let i=Ib(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=Tx(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=By(i);if(a||mx(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)&&$S(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=dC(a,$S);s&&W(d)&&(s.canMergeWhenEmpty()||$S(c))&&(d.append(...s.getChildren()),s.remove()),W(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=W(n)?n.getLastChild():null;By(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=Tx();return cS().splice(this.anchor.offset,0,[e]),e.select(),e}let e=Ib(this),t=dC(this.anchor.getNode(),$S);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=zy();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]=gb(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(Rb(this,e,t,n))return;let r=e===`move`,i=Yb(),a=KS(RS(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()||GS(o,i,s),this.dirty){let e=jS(i,this.anchor.key),t=jS(i,this.focus.key);this.anchor.type===`text`&&(e=Yx(e)),this.focus.type===`text`&&(t=Yx(t)),e&&t&&Nb(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=gx(n)?n:zS(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];IS(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`&&Rb(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=FC(WC(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(SC(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=$C(t);qC(this,LC(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(xC(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(mx(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=Eb();e.add(t.origin.getKey()),uS(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return qC(this,LC(!t.origin.isEmpty()&&n.isEmpty()?YC(EC(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&&_b(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 yb(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 yb(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!(fS(e)||vb(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()&&gx(e.getParent())&&e.getPreviousSibling()===null&&_b(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 mb(e){return e instanceof fb}function hb(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function gb(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]:[hb(n),hb(r)]}function _b(e,t){for(let n=t;n;n=n.getParent()){if(W(n)){if(n.collapseAtStart(e))return!0;if(BS(n))break}if(n.getPreviousSibling())break}return!1}var vb=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function yb(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 bb(e,t,n,r){let i,a=t;if(JS(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=dS(u),V(i))a=OC(i,o?`next`:`previous`);else{let s=dS(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=OC(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&&mx(s)&&dS(e)===s?n:n+1,s=s.getParentOrThrow()}if(W(s))return lb(s.__key,a,`element`)}}else i=dS(e);return V(i)?lb(i.__key,OC(i,a,`clamp`),`text`):null}function xb(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 Sb(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);xb(e,n,r),xb(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function Cb(e,t,n,r,i,a){if(e===null||n===null||!Vx(i,e,n))return null;let o=bb(e,t,H(a)?a.anchor:null,i);if(o===null)return null;let s=bb(n,r,H(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=dS(e),r=dS(n);if(mx(t)&&mx(r))return null}return Sb(o,s),[o,s]}function wb(e,t,n,r,i,a){let o=Jb(),s=new pb(lb(e,t,i),lb(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Tb(){return new pb(lb(`root`,0,`element`),lb(`root`,0,`element`),0,``)}function Eb(){return new fb(new Set)}function Db(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=!i_&&(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)&&!Vx(n,l,u))return e.clone();let p=Cb(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 pb(m,h,g,_)}function U(){return Jb()._selection}function Ob(){return Yb()._editorState._selection}function kb(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`),Ab(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`)}}Ab(e)}function Ab(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 jb(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 Mb(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 Nb(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Pb(e,t,n){let r=jS(e,t.getKey());if(W(t)){let e=t.getDOMSlot(r);return[e.element,n+e.getFirstChildOffset()]}return[r,n]}function Fb(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&&Bx(d))return;if(!H(t))return void(e!==null&&Vx(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.getNode(),h=p.getNode(),[g,_]=Pb(n,m,f.offset),[v,y]=Pb(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=Yx(g),T=m.getFormat()!==b||m.getStyle()!==x):H(e)&&e.anchor.type===`text`&&(T=!0),p.type===`text`&&(w=Yx(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(),dy=[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(Nb(r,C,_,w,y),!Ag||!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=NS(n),i=LS(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=RS(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=MS(l)}})(n,t,a)}}iy=!0}}function Ib(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(;!$S(i);){let e=i;if([i,a]=Lb(i,a),e.is(i))break}return a}function Lb(e,t){let n=e.getParent();if(!n){let e=Tx();return cS().append(e),e.select(),[cS(),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 pb(lb(e.__key,t,`element`),lb(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Rb(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=WC(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!ew(c)){for(let e of c){l=!1;let{origin:t}=e;if(!mx(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of FC(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(SC(e))e.origin.isInline()||(c=e);else{if(W(e.origin))continue;mx(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&mx(c.origin)&&c.origin.isKeyboardSelectable()){let e=Eb();return e.add(c.origin.getKey()),uS(e),!0}return c=$C(c),s&&GC(e.anchor,c),GC(e.focus,c),l||!o}var zb=null,Bb=null,Vb=!1,Hb=!1,Ub=0,Wb={characterData:!0,childList:!0,subtree:!0};function Gb(){return Vb||zb!==null&&zb._readOnly}function Kb(){Vb&&z(13)}function qb(){Ub>99&&z(14)}function Jb(){return zb===null&&z(195,Xb()),zb}function Yb(){return Bb===null&&z(196,Xb()),Bb}function Xb(){let e=0,t=new Set,n=Mx.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=Wx(r);if(Hx(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 Zb(){return Bb}function Qb(e,t,n){let r=t.__type,i=Ix(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 $b(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function ex(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 tx(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=tx(o[e],t);a.append(n)}return a}function nx(e,t,n){let r=zb,i=Vb,a=Bb;zb=t,Vb=!0,Bb=e;try{return n()}finally{zb=r,Vb=i,Bb=a}}function rx(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=zb,u=Vb,d=Bb,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){Bb=e,zb=n,Vb=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=cv(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),Hb)throw t;Dx(e,null,r,n),p_(e),e._dirtyType=2,Hb=!0,rx(e,a),Hb=!1;return}finally{p.observe(r,Wb),e._updating=f,zb=l,Vb=u,Bb=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=oS(e)),delete r[a])}(e,n);let b=i?null:KS(RS(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){Bb=e,zb=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&GS(t,e,r),Fb(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())WS(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&WS(t)){let n=t.getPreviousSibling();(n===null||WS(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=sw(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&&GS(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Wb),Bb=d,zb=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(uv,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,ix(`decorator`,e,!0,x)),function(e,t,n){let r=sS(t),i=sS(n);r!==i&&ix(`textcontent`,e,!0,i)}(e,t||a,n),ix(`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;sx(e,t,r)}}}(e)}function ix(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 ax(e,t,n,r){let i=pS(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(cx(s,()=>{for(let t=0;t<i;t++)if(e[t](n,r))return void(a=!0)}),a)return a}}}return a&&a.update(()=>{ax(a,t,n,r)}),!1}function ox(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),ex(e,i.tag)),a==null?sx(e,n,i):n()}}return r}function sx(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,ex(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=_x(c||s),l=!0),c._flushSync=o;let u=zb,d=Vb,f=Bb,p=e._updating;zb=c,Vb=!1,e._updating=!0,Bb=e;let m=e._headless||e.getRootElement()===null;Px(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=KS(RS(e));return H(n)||n==null?Db(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=ox(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()&&D_(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=tS(),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()&&D_(r),r!==void 0&&$b(r,a)&&Qb(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){Ub++;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&&$b(c,a)&&Qb(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,Ub++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),ox(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)&&r_(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 mb(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(),rx(e);return}finally{zb=u,Vb=d,Bb=f,e._updating=p,Ub=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,rx(e)):l&&Rx(()=>{rx(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function cx(e,t,n){Bb===e&&n===void 0?t():sx(e,t,n)}var lx=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`&&(Lg||Mg||Pg);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=ux(t,n);i.push(r);let a=ux(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 ux(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 dx=class extends Ny{__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 $g[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=Yb()._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:nS(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&z(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:nS(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+=Jg)}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=Qg[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Xg[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Xx(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Kb();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):wb(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:Qg[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){My(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;Qx(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--,Qx(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;fx(r,t,n)&&jb(r,r.getNode(),this,l,c),fx(i,t,n)&&jb(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||BS(this)||this.remove()}}return i}getDOMSlot(e){return new lx(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(JS(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===``||BS(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 dx}function fx(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 px=class extends Ny{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function mx(e){return e instanceof px}var hx=class e extends dx{__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!Gb()&&Yb()._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)||mx(e)||z(282);return super.splice(e,t,n)}static importJSON(e){return cS().updateFromJSON(e)}collapseAtStart(){return!0}};function gx(e){return e instanceof hx}function _x(e){return new xx(new Map(e._nodeMap))}function vx(){return new xx(new Map([[`root`,new hx]]))}function yx(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=yx(i[e]);r.push(t)}}return t}function bx(e){return e instanceof xx}var xx=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 nx(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 nx(null,this,()=>({root:yx(cS())}))}},Sx=class extends dx{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},Cx=class e extends dx{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=ES(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:wx,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(JS(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return Tx().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=Tx();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 wx(e){let t=Tx();if(e.style&&(t.setFormat(e.style.textAlign),oC(e,t)),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in Qg&&t.setFormat(n)}return{node:t}}function Tx(){return VS(new Cx)}function Ex(e){return e instanceof Cx}function Dx(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=vx(),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 Ox(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=lC(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 Ny&&e!==Ny?e:void 0}}return t}function kx(e){let t=e||{},n=Zb(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=vx(),s=t.namespace||(i===null?mS():i._config.namespace),c=t.editorState,l=[hx,Jy,Ly,ab,Cx,Sx,...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}lC(t);let i=t.getType(),a=Ox(t);p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:g_(l[e]),transforms:a})}}let m=new Mx(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(fv,vy,0),e.registerCommand(pv,yy,0),e.registerCommand(mv,by,0),e.registerCommand(hv,xy,0),e.registerCommand(Dv,Cy,0)}(m),m}function Ax(e,t){let n=e.get(t);e.delete(t),n&&n()}function jx(e,t,n){return e.set(t,n),Ax.bind(null,e,t)}var Mx=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=mS(),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 jx(this._listeners.update,e)}registerEditableListener(e){return jx(this._listeners.editable,e)}registerDecoratorListener(e){return jx(this._listeners.decorator,e)}registerTextContentListener(e){return jx(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return lw(jx(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=rC(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=rC(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=nS(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:Py}: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=ES(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Dx(this,t,e,r),t!==null&&(this._config.disableEvents||ky(t),n!=null&&t.classList.remove(...n)),e!==null){let t=LS(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,p_(this),this._updateTags.add(Py),rx(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;ny.set(e,n);let r=ry.get(n)??0;r<1&&n.addEventListener(`selectionchange`,Ey),ry.set(n,r+1),e.__lexicalEditor=t;let i=wy(e);for(let n=0;n<Zv.length;n++){let[r,a]=Zv[n],o=typeof a==`function`?e=>{Oy(e)||(Dy(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(Oy(e))return;Dy(e);let n=t.isEditable();switch(r){case`cut`:return n&&K(t,Gv,e);case`copy`:return K(t,Wv,e);case`paste`:return n&&K(t,bv,e);case`dragstart`:return n&&K(t,Vv,e);case`dragover`:return n&&K(t,Hv,e);case`dragend`:return n&&K(t,Uv,e);case`focus`:return n&&K(t,qv,e);case`blur`:return n&&K(t,Jv,e);case`drop`:return n&&K(t,Bv,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(Py),rx(this);ix(`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=_x(e),n._selection=e._selection?e._selection.clone():null),f_(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),rx(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||rx(this)}parseEditorState(e,t){return function(e,t,n){let r=vx(),i=zb,a=Vb,o=Bb,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,zb=r,Vb=!1,Bb=t,Px(null);try{let i=t._nodes;tx(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,zb=i,Vb=a,Bb=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return rx(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):sx(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),cx(this,()=>{let r=U(),i=cS();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||uS(r.clone()),PS(`focus`),FS(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=KS(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ix(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};Mx.version=`0.43.0+prod.esm`;var Nx=null;function Px(e){Nx=e}var Fx=1;function Ix(e,t){let n=Lx(e,t);return n===void 0&&z(30,t),n}function Lx(e,t){return e._nodes.get(t)}var Rx=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function zx(e){return mx(aS(e))}function Bx(e){let t=document.activeElement;if(!JS(t))return!1;let n=t.nodeName;return mx(aS(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&Wx(t)==null)}function Vx(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Bx(t)&&Ux(t)===e}catch{return!1}}function Hx(e){return e instanceof Mx}function Ux(e){let t=e;for(;t!=null;){let e=Wx(t);if(Hx(e))return e;t=MS(t)}return null}function Wx(e){return e?e.__lexicalEditor:null}function Gx(e){return sb(e)||e.isToken()}function Kx(e){return Gx(e)||e.isSegmented()}function qx(e){return YS(e)&&e.nodeType===3}function Jx(e){return YS(e)&&e.nodeType===9}function Yx(e){let t=e;for(;t!=null;){if(qx(t))return t;t=t.firstChild}return null}function Xx(e,t,n){let r=Xg[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Xg.superscript:t===`superscript`?i&=~Xg.subscript:t===`lowercase`?(i&=~Xg.uppercase,i&=~Xg.capitalize):t===`uppercase`?(i&=~Xg.lowercase,i&=~Xg.capitalize):t===`capitalize`&&(i&=~Xg.lowercase,i&=~Xg.uppercase),i}function Zx(e,t){let n=function(){let e=Nx;return Nx=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Kb(),qb();let r=Yb(),i=Jb(),a=``+ Fx++;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 Qx(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 $x(e){qb(),My(e)&&z(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=Jb(),i=Yb(),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 eS(e){Kb();let t=Yb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=nS(n);e!==null&&e.getWritable()}if(e!==null){let t=nS(e);t!==null&&t.getWritable()}}}function tS(){return Gb()?null:Yb()._compositionKey}function nS(e,t){let n=(t||Jb())._nodeMap.get(e);return n===void 0?null:n}function rS(e,t){let n=iS(e,Yb());return n===void 0?null:nS(n,t)}function iS(e,t){return e[`__lexicalKey_${t._key}`]}function aS(e,t){let n=e;for(;n!=null;){let e=rS(n,t);if(e!==null)return e;n=MS(n)}return null}function oS(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function sS(e){return e.read(()=>cS().getTextContent())}function cS(){return lS(Jb())}function lS(e){return e._nodeMap.get(`root`)}function uS(e){Kb();let t=Jb();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function dS(e){let t=Yb(),n=function(e,t){let n=e;for(;n!=null;){let e=iS(n,t);if(e!==void 0)return e;n=MS(n)}return null}(e,t);return n===null?e===t.getRootElement()?nS(`root`):null:nS(n)}function fS(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function pS(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function mS(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function hS(e){return qx(e)?e.nodeValue:null}function gS(e,t,n){let r=KS(RS(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=hS(i),r=aS(i);if(t!==null&&V(r)){if((t===qg||t===Yg)&&n){let e=n.length;t=n,a=e,o=e}t!==null&&_S(r,t,a,o,e)}}}function _S(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(qg)&&(s=t.slice(0,-qg.length)),i)){let e=Yg,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(eS(null),Pg||Mg||Lg)a.remove();else{let e=Yb();setTimeout(()=>{e.update(()=>{a.isAttached()&&a.remove()})},20)}return}let t=a.getParent(),i=Ob(),c=a.getTextContentSize(),l=tS(),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 vS(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=rb(a.getTextContent());a.replace(e),a=e}vS(a,s,d)}}}function vS(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=OC(e,i.offset,`clamp`))}}}function yS(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function bS(e,t){return yS(e,t,`altKey`)&&yS(e,t,`ctrlKey`)&&yS(e,t,`shiftKey`)&&yS(e,t,`metaKey`)}function G(e,t,n){if(!bS(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 xS={ctrlKey:!kg,metaKey:kg},SS={altKey:kg,ctrlKey:!kg};function CS(e){return e.key===`Backspace`}function wS(e){return G(e,`a`,xS)}function TS(e){let t=cS();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`),O_(e),e}{let e=t.select(0,t.getChildrenSize());return uS(O_(e)),e}}function ES(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=sw(i);return n[t]=e,e}return i}function DS(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 OS(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 kS(e,t){let n=e.offset;if(e.type===`element`)return OS(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?OS(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function AS(e){let t=RS(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function K(e,t,n){return ax(e,t,n,e)}function jS(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&z(75,t),n}function MS(e){let t=e.assignedSlot||e.parentElement;return XS(t)?t.host:t}function NS(e){return Jx(e)?e:JS(e)?e.ownerDocument:null}function PS(e){Kb(),Yb()._updateTags.add(e)}function FS(e){Kb(),Yb()._deferred.push(e)}function IS(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function LS(e){let t=NS(e);return t?t.defaultView:null}function RS(e){let t=e._window;return t===null&&z(78),t}function zS(e){let t=e.getParentOrThrow();for(;t!==null;){if(BS(t))return t;t=t.getParentOrThrow()}return t}function BS(e){return gx(e)||W(e)&&e.isShadowRoot()}function VS(e){let t=Yb(),n=e.getType(),r=Lx(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 HS(e,t){!gx(e.getParent())||W(t)||mx(t)||z(99)}function US(e){let t=nS(e);return t===null&&z(63,e),t}function WS(e){return(mx(e)||W(e)&&!e.canBeEmpty())&&!e.isInline()}function GS(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function KS(e){return Dg?(e||window).getSelection():null}function qS(e){let t=LS(e);return t?t.getSelection():null}function JS(e){return YS(e)&&e.nodeType===1}function YS(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function XS(e){return YS(e)&&e.nodeType===11}function ZS(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 QS(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 $S(e){if(mx(e)&&!e.isInline())return!0;if(!W(e)||BS(e))return!1;let t=e.getFirstChild(),n=t===null||By(t)||V(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function eC(){return Yb()}var tC=new WeakMap,nC=new Map;function rC(e){if(!e._readOnly&&e.isEmpty())return nC;e._readOnly||z(192);let t=tC.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),tC.set(e,t)),t}function iC(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function aC(e){return(t=iC(e))[jy]=!0,t;var t}function oC(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function sC(e){return!0===e.__lexicalUnmanaged}function cC(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==Ny[t]}function lC(e){let t=n_ in e.prototype?e.prototype[n_]():void 0,n=function(e){if(!(e===Ny||e.prototype instanceof Ny)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{Mx.version&&(n=JSON.parse(Mx.version))}catch{}z(290,e.name,t,n)}return e===px||e===dx||e===Ny}(e),r=!n&&cC(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&&(cC(e,`getType`)||(e.getType=()=>a),cC(e,`clone`)||(e.clone=t=>(Px(t),new e)),cC(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!cC(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function uC(e){let t=eC();return Kb(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var dC=(e,t)=>{let n=e;for(;n!=null&&!gx(n);){if(t(n))return n;n=n.getParent()}return null},fC={next:`previous`,previous:`next`},pC=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return RC({hasNext:xC,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return EC(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return EC(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=EC(e,this.direction)}for(let e of o.values())e.remove();return this}},mC=class e extends pC{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:AC(e,this.direction)}getParentCaret(e=`root`){return EC(_C(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=gC(this.direction);return EC(this.getNodeAtCaret(),e)||AC(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)}},hC={root:gx,shadowRoot:BS};function gC(e){return fC[e]}function _C(e,t=`root`){return hC[t](e)?null:e}var vC=class e extends pC{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:EC(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return W(this.origin)?AC(this.origin,this.direction):null}getParentCaret(e=`root`){return EC(_C(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=gC(this.direction);return EC(this.getNodeAtCaret(),e)||AC(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 yC)&&this.direction===t.direction&&this.origin.is(t.origin)}},yC=class e extends pC{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:DC(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return EC(_C(this.getParentAtCaret(),e),this.direction)}getFlipped(){return DC(this.origin,gC(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 vC||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return EC(this.origin,this.direction)}};function bC(e){return e instanceof yC}function xC(e){return e instanceof vC}function SC(e){return e instanceof mC}var CC={next:class extends yC{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends yC{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},wC={next:class extends vC{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends vC{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},TC={next:class extends mC{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends mC{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function EC(e,t){return e?new wC[t](e):null}function DC(e,t,n){return e?new CC[t](e,OC(e,n)):null}function OC(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Eg(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function kC(e,t){return new PC(e,t)}function AC(e,t){return W(e)?new TC[t](e):null}function jC(e){return e&&e.getChildCaret()||e}function MC(e){return e&&jC(e.getAdjacentCaret())}var NC=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 bC(t)?function(e,t){let{direction:n,origin:r}=e;return kC(e,OC(r,t===`focus`?gC(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[kC(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=bC(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=bC(n),i=t=>t.isSameNodeCaret(n)?null:MC(t)||t.getParentCaret(e);return RC({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`)}},PC=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 DC(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function FC(e){return LC(e,EC(cS(),e.direction))}function IC(e){return LC(e,e)}function LC(e,t){return e.direction!==t.direction&&z(265),new NC(e,t,e.direction)}function RC(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 zC(e,t){let n=UC(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 BC(n)}}function BC(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 VC(e,t){return t.is(e)}function HC(e){return W(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function UC(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=HC(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=HC(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(VC(e,r)||z(276),{commonAncestor:r,type:`ancestor`}):i===null?(VC(t,r)||z(277),{commonAncestor:r,type:`descendant`}):((W(a)||VC(e,a))&&(W(i)||VC(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||z(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function WC(e,t){let{type:n,key:r,offset:i}=e,a=US(e.key);return n===`text`?(V(a)||z(266,a.getType(),r),DC(a,t,i)):(W(a)||z(267,a.getType(),r),rw(a,e.offset,t))}function GC(e,t){let{origin:n,direction:r}=t,i=r===`next`;bC(t)?e.set(n.getKey(),t.offset,`text`):xC(t)?V(n)?e.set(n.getKey(),OC(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),`element`):(SC(t)&&W(n)||z(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function KC(e){let t=U(),n=H(t)?t:Tb();return qC(n,e),uS(n),n}function qC(e,t){GC(e.anchor,t.anchor),GC(e.focus,t.focus)}function JC(e){let{anchor:t,focus:n}=e,r=WC(t,`next`),i=WC(n,`next`),a=zC(r,i)<=0?`next`:`previous`;return LC(tw(r,a),tw(i,a))}function YC(e){let{direction:t,origin:n}=e,r=EC(n,gC(t)).getNodeAtCaret();return r?EC(r,t):AC(n.getParentOrThrow(),t)}function XC(e,t=`root`){let n=[e];for(let r=SC(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(YC(r));return n}function ZC(e){return!!e&&e.origin.isAttached()}function QC(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=nw(e,r),o=XC(a.anchor,n),s=XC(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(SC(e))c.add(e.origin.getKey());else if(xC(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=YC(EC(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=rb(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=DC(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(ZC(e)){u=$C(e);break}for(let e of s)if(ZC(e)){d=$C(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(BS(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,$S),d=u&&l(o,e=>n.has(e.getKey())&&$S(e));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;AC(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(ZC);if(p)return IC(tw($C(p),e.direction));z(269,JSON.stringify(o.map(e=>e.origin.__key)))}function $C(e){let t=function(e){let t=e;for(;SC(t);){let e=MC(t);if(!SC(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(V(t.origin))return bC(t)?t:DC(t.origin,n,n);let r=t.getAdjacentCaret();return xC(r)&&V(r.origin)?DC(r.origin,n,gC(n)):t}function ew(e){return bC(e)&&e.offset!==OC(e.origin,e.direction)}function tw(e,t){return e.direction===t?e:e.getFlipped()}function nw(e,t){return e.direction===t?e:LC(tw(e.focus,t),tw(e.anchor,t))}function rw(e,t,n){let r=AC(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return tw(r,n)}function iw(e){return e}function aw(e){return e}function ow(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function sw(...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 cw(e,...t){let n=sw(...t);n.length>0&&e.classList.add(...n)}function lw(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function uw(){return cS().getTextContent()}function dw(e,t=!0){if(e)return!1;let n=uw();return t&&(n=n.trim()),n===``}function fw(e){if(!dw(e,!1))return!1;let t=cS().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(mx(n))return!1;if(W(n)){if(!Ex(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 pw(e){return()=>fw(e)}function mw(e){let t=eC().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function hw(e){return mw(gx(e)?e:e.getParentOrThrow())}function gw(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!Kx(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]=gb(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=aC(t)),t.__text=p)}}return t}function _w(e){let t=vw(e);return t!==null&&t.writingMode===`vertical-rl`}function vw(e){let t=e.anchor.getNode();return W(t)?mw(t):hw(t)}function yw(e,t){let n=_w(e)?!t:t;xw(e)&&(n=!n);let r=WC(e.focus,n?`previous`:`next`);if(ew(r))return!1;for(let e of FC(r)){if(SC(e))return!e.origin.isInline();if(!W(e.origin)){if(mx(e.origin))return!0;break}}return!1}function bw(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function xw(e){let t=vw(e);return t!==null&&t.direction===`rtl`}function Sw(e,t,n){let r=xw(e),i;i=_w(e)||r?!n:n,bw(e,t,i,`character`)}var Cw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,ww=Cw&&`documentMode`in document?document.documentMode:null;Cw&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Cw&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!Cw||!(`InputEvent`in window)||ww)&&`getTargetRanges`in new window.InputEvent(`input`),Cw&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,Cw&&/Android/.test(navigator.userAgent),Cw&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Cw&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Cw&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function Tw(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}var Ew=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Dw({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 Ew(()=>(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 Ow=(0,P.forwardRef)(Dw);function kw(e){return e.getEditorState().read(pw(e.isComposing()))}var Aw=(0,P.forwardRef)(jw);function jw(e,t){let{placeholder:n,...r}=e,[i]=Tg();return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ow,{editor:i,...r,ref:t}),n!=null&&(0,F.jsx)(Mw,{editor:i,content:n})]})}function Mw({content:e,editor:t}){let n=function(e){let[t,n]=(0,P.useState)(()=>kw(e));return Ew(()=>{function t(){n(kw(e))}return t(),lw(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 Nw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Pw=Nw?P.useLayoutEffect:P.useEffect,Fw={tag:Py};function Iw({initialConfig:e,children:t}){let n=(0,P.useMemo)(()=>{let{theme:t,namespace:n,nodes:r,onError:i,editorState:a,html:o}=e,s=wg(null,t),c=kx({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=cS();if(t.isEmpty()){let n=Tx();t.append(n);let r=Nw?document.activeElement:null;(U()!==null||r!==null&&r===e.getRootElement())&&n.select()}},Fw);else if(t!==null)switch(typeof t){case`string`:{let n=e.parseEditorState(t);e.setEditorState(n,Fw);break}case`object`:e.setEditorState(t,Fw);break;case`function`:e.update(()=>{cS().isEmpty()&&t(e)},Fw)}}}(c,a),[c,s]},[]);return Pw(()=>{let t=e.editable,[r]=n;r.setEditable(t===void 0||t)},[]),(0,F.jsx)(Cg.Provider,{value:n,children:t})}var Lw=(0,P.createContext)(null),Rw={didCatch:!1,error:null},zw=class extends P.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rw}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(Rw))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&Bw(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(Rw))}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)(Lw.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function Bw(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function Vw({children:e,onError:t}){return(0,F.jsx)(zw,{fallback:(0,F.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}),onError:t,children:e})}var Hw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Uw(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Ww(){return function(e){let[t]=Tg(),n=(0,P.useMemo)(()=>e(t),[t,e]),[r,i]=(0,P.useState)(()=>n.initialValueFn()),a=(0,P.useRef)(r);return Hw(()=>{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}(Uw)}var Gw=Symbol.for(`preact-signals`);function Kw(){if(Xw>1)return void Xw--;let e,t=!1;for(function(){let e=Yw;for(Yw=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();qw!==void 0;){let n=qw;for(qw=void 0,Zw++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&nT(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Zw=0,Xw--,t)throw e}var q,qw;function Jw(e){let t=q;q=void 0;try{return e()}finally{q=t}}var Yw,Xw=0,Zw=0,Qw=0,$w=0;function eT(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 tT(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 nT(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 rT(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 iT(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 aT(e,t){tT.call(this,void 0),this.x=e,this.s=void 0,this.g=$w-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function oT(e){let t=e.m;if(e.m=void 0,typeof t==`function`){Xw++;let n=q;q=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,sT(e),t}finally{q=n,Kw()}}}function sT(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,oT(e)}function cT(e){if(q!==this)throw Error(`Out-of-order effect`);iT(this),q=e,this.f&=-2,8&this.f&&sT(this),Kw()}function lT(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 uT(e,t){let n=new lT(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}tT.prototype.brand=Gw,tT.prototype.h=function(){return!0},tT.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?Jw(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},tT.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&&Jw(()=>{var e;(e=this.Z)==null||e.call(this)}))}},tT.prototype.subscribe=function(e){return uT(()=>{let t=this.value,n=q;q=void 0;try{e(t)}finally{q=n}},{name:`sub`})},tT.prototype.valueOf=function(){return this.value},tT.prototype.toString=function(){return this.value+``},tT.prototype.toJSON=function(){return this.value},tT.prototype.peek=function(){let e=q;q=void 0;try{return this.value}finally{q=e}},Object.defineProperty(tT.prototype,`value`,{get(){let e=eT(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Zw>100)throw Error(`Cycle detected`);(function(e){Xw!==0&&Zw===0&&e.l!==Qw&&(e.l=Qw,Yw={S:e,v:e.v,i:e.i,o:Yw})})(this),this.v=e,this.i++,$w++,Xw++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Kw()}}}}),aT.prototype=new tT,aT.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===$w))return!0;if(this.g=$w,this.f|=1,this.i>0&&!nT(this))return this.f&=-2,!0;let e=q;try{rT(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,iT(this),this.f&=-2,!0},aT.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)}tT.prototype.S.call(this,e)},aT.prototype.U=function(e){if(this.t!==void 0&&(tT.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)}},aT.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(aT.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=eT(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),lT.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()}},lT.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,oT(this),rT(this),Xw++;let e=q;return q=this,cT.bind(this,e)},lT.prototype.N=function(){2&this.f||(this.f|=2,this.u=qw,qw=this)},lT.prototype.d=function(){this.f|=8,1&this.f||sT(this)},lT.prototype.dispose=function(){this.d()};function dT(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}h_(`format`,{parse:e=>typeof e==`number`?e:0});function fT(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 pT(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]=pT(n[e],r[e]);return e}return t}var mT=0,hT=1,gT=2,_T=3,vT=4,yT=5,bT=6,xT=7;function ST(e){return e.id===mT}function CT(e){return e.id===gT}function wT(e){return function(e){return e.id===hT}(e)||fT(305,String(e.id),String(hT)),Object.assign(e,{id:gT})}var TT=new Set,ET=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:mT}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):ow;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;CT(t)||fT(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:_T,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:vT,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==vT&&fT(307,String(t.id),String(yT)),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:yT,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==yT&&fT(308,String(n.id),String(yT));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:bT})}(n),()=>{let e=this.state;e.id!==xT&&fT(309,String(n.id),String(xT)),this.state=function(e){return Object.assign(e,{id:yT})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==bT&&fT(310,String(t.id),String(bT)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:xT})}(t),n}getSignal(){return this._signal===void 0&&fT(311),this._signal}getInitResult(){this.extension.init===void 0&&fT(312,this.extension.name);let e=this.state;return function(e){return e.id>=vT}(e)||fT(313,String(e.id),String(vT)),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>=_T}(e)||fT(314,String(e.id),String(_T)),{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&&fT(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&fT(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=xT}(e)||fT(316,String(e.id),String(xT)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||TT}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>=yT})(e)||fT(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},DT={tag:Py};function OT(){let e=cS();e.isEmpty()&&e.append(Tx())}var kT=iw({config:aw({setOptions:DT,updateOptions:DT}),init:({$initialEditorState:e=OT})=>({$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(bx(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:[hx,Jy,Ly,ab,Cx]}),AT=Symbol.for(`@lexical/extension/LexicalBuilder`);function jT(){}function MT(e){throw e}function NT(e){return Array.isArray(e)?e:[e]}var PT=`0.43.0+prod.esm`,FT=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=PT,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[NT(kT)];for(let e of t)n.push(NT(e));return new e(n)}static maybeFromEditor(t){let n=t[AT];return n&&(n.PACKAGE_VERSION!==PT&&fT(292,n.PACKAGE_VERSION,PT),n instanceof e||fT(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&fT(294),n}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign(kx({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[AT]:this});for(let e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){let e=jT;function t(){try{e()}finally{e=jT}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=lw(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&&fT(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&&fT(296);let[t]=NT(e);typeof t.name!=`string`&&fT(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&fT(298,t.name),!n){n=new ET(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&fT(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&fT(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=NT(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(CT(i))return;let a=n.extension.name;var o;ST(i)||fT(300,a,r||`[unknown]`),ST(o=i)||fT(304,String(o.id),String(mT)),i=Object.assign(o,{id:hT}),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=wT(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())ST(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&&fT(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 lw(...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 dT(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&fT(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&&pT(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||=MT,e}},IT=class e extends px{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return RT().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:LT,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return cw(t,e.theme.hr),t}getTextContent(){return`
15
- `}isInline(){return!1}updateDOM(){return!1}};function LT(){return{node:RT()}}function RT(){return uC(IT)}var zT=iw({name:`@lexical/react/ReactProvider`});function BT(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 VT(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=cS().getChildren();for(let i=0;i<r.length;i++)HT(e,r[i],n,t);return n.innerHTML}function HT(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=gw(r,t,`clone`));let s=W(o)?o.getChildren():[],c=Lx(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=HT(e,a,f,r);!i&&W(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((JS(u)||XS(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(XS(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}function UT(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 WT(e,t=U()){return t??UT(166),H(t)&&t.isCollapsed()||t.getNodes().length===0?``:VT(e,t)}function GT(e,t){let n=e.getData(`text/plain`)||e.getData(`text/uri-list`);n!=null&&t.insertRawText(n)}var KT=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,qT=KT&&`documentMode`in document?document.documentMode:null,JT=KT&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),YT=!(!KT||!(`InputEvent`in window)||qT)&&`getTargetRanges`in new window.InputEvent(`input`),XT=KT&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ZT=KT&&/Android/.test(navigator.userAgent),QT=KT&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!ZT,$T=KT&&/^(?=.*Chrome).*/i.test(navigator.userAgent),eE=KT&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&JT&&!$T;function tE(e,t){t.update(()=>{if(e!==null){let n=Tw(e,KeyboardEvent)?null:e.clipboardData,r=U();if(r!==null&&!r.isCollapsed()&&n!=null){e.preventDefault();let i=WT(t);i!==null&&n.setData(`text/html`,i),n.setData(`text/plain`,r.getTextContent())}}})}function nE(e){return lw(e.registerCommand(gv,e=>{let t=U();return!!H(t)&&(t.deleteCharacter(e),!0)},0),e.registerCommand(Sv,e=>{let t=U();return!!H(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(Cv,e=>{let t=U();return!!H(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(yv,e=>{let t=U();if(!H(t))return!1;if(typeof e==`string`)t.insertText(e);else{let n=e.dataTransfer;if(n!=null)GT(n,t);else{let n=e.data;n&&t.insertText(n)}}return!0},0),e.registerCommand(xv,()=>{let e=U();return!!H(e)&&(e.removeText(),!0)},0),e.registerCommand(_v,e=>{let t=U();return!!H(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(vv,()=>{let e=U();return!!H(e)&&(e.insertLineBreak(),!0)},0),e.registerCommand(Av,e=>{let t=U();if(!H(t))return!1;let n=e,r=n.shiftKey;return!!yw(t,!0)&&(n.preventDefault(),Sw(t,r,!0),!0)},0),e.registerCommand(Ov,e=>{let t=U();if(!H(t))return!1;let n=e,r=n.shiftKey;return!!yw(t,!1)&&(n.preventDefault(),Sw(t,r,!1),!0)},0),e.registerCommand(Iv,t=>!!H(U())&&(!XT||navigator.language!==`ko-KR`)&&(t.preventDefault(),e.dispatchCommand(gv,!0)),0),e.registerCommand(Rv,t=>!!H(U())&&(t.preventDefault(),e.dispatchCommand(gv,!1)),0),e.registerCommand(Pv,t=>{if(!H(U()))return!1;if(t!==null){if((XT||QT||eE)&&YT)return!1;t.preventDefault()}return e.dispatchCommand(_v,!1)},0),e.registerCommand(Kv,()=>(TS(),!0),0),e.registerCommand(Wv,t=>!!H(U())&&(tE(t,e),!0),0),e.registerCommand(Gv,t=>!!H(U())&&(function(e,t){tE(e,t),t.update(()=>{let e=U();H(e)&&e.removeText()})}(t,e),!0),0),e.registerCommand(bv,t=>!!H(U())&&(function(e,t){e.preventDefault(),t.update(()=>{let t=U(),n=Tw(e,ClipboardEvent)?e.clipboardData:null;n!=null&&H(t)&&GT(n,t)},{tag:`paste`})}(t,e),!0),0),e.registerCommand(Bv,e=>!!H(U())&&(e.preventDefault(),!0),0),e.registerCommand(Vv,e=>!!H(U())&&(e.preventDefault(),!0),0))}var rE=e(c(),1);function iE(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 aE=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function oE({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,P.useState)(()=>e.getDecorators());return aE(()=>e.registerDecoratorListener(e=>{(0,rE.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,rE.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function sE({editor:e,ErrorBoundary:t}){return function(e){let t=FT.maybeFromEditor(e);if(t&&t.hasExtensionByName(zT.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&iE(320,e);return!0}return!1}(e)?null:(0,F.jsx)(oE,{editor:e,ErrorBoundary:t})}function cE(e){return e.getEditorState().read(pw(e.isComposing()))}function lE({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=Tg();return function(e){aE(()=>lw(nE(e),BT(e)),[e])}(r),(0,F.jsxs)(F.Fragment,{children:[e,(0,F.jsx)(uE,{content:t}),(0,F.jsx)(sE,{editor:r,ErrorBoundary:n})]})}function uE({content:e}){let[t]=Tg(),n=function(e){let[t,n]=(0,P.useState)(()=>cE(e));return aE(()=>{function t(){n(cE(e))}return t(),lw(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=Ww();return n?typeof e==`function`?e(r):e:null}function dE(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 fE({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)(Mo,{"aria-hidden":`true`,className:`h-3 w-3`}):t===`panel_app`?(0,F.jsx)(Ja,{"aria-hidden":`true`,className:`h-3 w-3`}):(0,F.jsx)(Qo,{"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 pE=class e extends px{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 mE({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=dE(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)(fE,{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 mE(e){let{composerId:t,label:n,tokenKey:r,tokenKind:i}=e;return VS(new pE(t,i,r,n))}function hE(e){return e instanceof pE}function gE(){let e=cS(),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(hE(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 _E(e){let{descriptors:t,paragraphKey:n,paragraphSize:r,totalLength:i}=gE(),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 vE(e){let{descriptors:t,paragraphKey:n,totalLength:r}=gE();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 yE(e){if(e.type===`element`)return vE(e);let{descriptors:t,totalLength:n}=gE(),r=t.find(t=>t.key===e.key);return r?r.start+Math.min(e.offset,r.length):n}function bE(){let{descriptors:e}=gE(),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(),th(t)}function xE(e){return e.read(()=>{let e=U(),t=bE();return H(e)?{nodes:t,selection:{start:Math.min(yE(e.anchor),yE(e.focus)),end:Math.max(yE(e.anchor),yE(e.focus))}}:{nodes:t,selection:null}})}function SE(e,t){let n=cS();n.clear();let r=Tx();n.append(r);for(let t of th(e)){if(t.type===`token`){r.append(mE({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(rb(n)),t<e.length-1&&r.append(zy())}if(hE(r.getLastChild())&&r.append(rb(``)),!t)return;let i=Tb(),a=_E(t.start),o=_E(t.end);i.anchor.set(a.key,a.offset,a.type),i.focus.set(o.key,o.offset,o.type),uS(i)}function CE(e,t,n){e.update(()=>{SE(t,n)})}function wE(e,t){e.update(()=>{let e=Tb(),n=_E(t.start),r=_E(t.end);e.anchor.set(n.key,n.offset,n.type),e.focus.set(r.key,r.offset,r.type),uS(e)})}function TE(e){return e.reduce((e,t)=>e+Qm(t),0)}function EE(e){let{label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,trigger:o}=e,s=TE(n),[c,l]=r?[Math.min(r.start,r.end),Math.max(r.start,r.end)]:[s,s],u=o?.start??c;return{nodes:uh(n,u,o?.end??l,[Zm({label:t,tokenKey:i,tokenKind:a})]),selection:{start:u+1,end:u+1}}}function DE(e){let{label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,triggerSpecs:o}=e;return ih(n,a).includes(i)?{nodes:th(n),selection:r}:EE({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:a,trigger:mh(n,r,o??[Jm])})}function OE(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=mh(n,r,i??[Jm]);return e?{nodes:th(uh(n,e.start,e.end,[])),selection:{start:e.start,end:e.start}}:{nodes:th(n),selection:r}}return DE({label:t.title,nodes:n,selection:r,tokenKey:o,tokenKind:a,triggerSpecs:i})}function kE(e){return e.map(e=>e.type===`text`?`text:${e.text}`:`token:${e.tokenKind}:${e.tokenKey}:${e.label}`).join(``)}function AE(e){let{nodes:t,selection:n,text:r}=e,i=TE(t),[a,o]=n?[Math.min(n.start,n.end),Math.max(n.start,n.end)]:[i,i],s=a+r.length;return{nodes:uh(t,a,o,[Xm(r)]),selection:{start:s,end:s}}}function jE(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return EE({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`file`})}function ME(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return ih(n,`skill`).includes(i)?{nodes:th(n),selection:r}:EE({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`skill`,trigger:hh(n,r)})}function NE(e){let{nextKeys:t,nodes:n,options:r,selection:i}=e,a=ih(n,`skill`),o=new Map(r.map(e=>[e.key,e])),s=t.find(e=>!a.includes(e));if(s)return ME({label:o.get(s)?.label??s,nodes:n,selection:i,tokenKey:s});let c=a.find(e=>!t.includes(e));return c?{nodes:dh(n,e=>e.tokenKind===`skill`&&e.tokenKey===c),selection:i}:{nodes:th(n),selection:i}}function PE(e){let{direction:t,nodes:n,selection:r}=e,i=TE(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:th(n),selection:{start:s,end:c}};return{nodes:uh(n,s,c,[]),selection:{start:s,end:s}}}function FE(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 IE(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 LE(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(AE({nodes:a().nodes,selection:a().selection,text:o.data}),{inputSurfaceReason:{type:`insert-text`,text:o.data}}))}function RE(e){let{compositionStartSnapshot:t,data:n,fallbackSnapshot:r,publishSnapshot:i,snapshotReader:a}=e,o=a(),s=r(),c=t??o;i(IE(s.nodes)===IE(c.nodes)&&n.length>0?AE({nodes:c.nodes,selection:c.selection,text:n}):s,{forcePublish:!0,inputSurfaceReason:{type:`insert-text`,text:n}})}function zE(e){let{actions:t,nativeEvent:n,publishSnapshot:r,snapshot:i}=e,a=FE({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(AE({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(PE({direction:a.direction,nodes:i.nodes,selection:i.selection}),{inputSurfaceReason:{type:`delete-content`}}),!0;case`noop`:return!1}}function BE(e){return{current:e}}function VE(e){return e.reduce((e,t)=>e+(t.type===`text`?t.text.length:1),0)}var HE=class{constructor(){this.isApplyingExternalUpdateRef=BE(!1),this.isComposingRef=BE(!1),this.pendingOwnerSignatureRef=BE(null),this.pendingSelectionRef=BE(null),this.selectionRef=BE(null),this.shouldFocusAfterSyncRef=BE(!1),this.compositionStartSnapshotRef=BE(null),this.editorSignatureRef=BE(``),this.lastPublishedSignatureRef=BE(``),this.pendingInputSurfaceReasonRef=BE(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=>lw(e.registerUpdateListener(({editorState:e})=>{let t=this.getRuntime();this.handleEditorUpdate(e,t.callbacks)}),e.registerCommand(uv,()=>{let t=this.getRuntime();return this.handleSelectionChange(e,t.callbacks),!1},0),e.registerCommand(Jv,()=>(this.getRuntime().callbacks.onInputSurfaceOpenChange?.(!1),!1),0),e.registerCommand(Dv,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=kE(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)&&(this.startApplyingExternalUpdate(),a?(CE(e,t,r),this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n):r&&wE(e,r),r&&(this.selectionRef.current=r,this.pendingSelectionRef.current=null),this.shouldFocusAfterSyncRef.current)){this.shouldFocusAfterSyncRef.current=!1;let t=this.selectionRef.current;e.focus(()=>{t&&wE(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=kE(e.nodes),{editor:i}=this;this.pendingOwnerSignatureRef.current=r,i&&(this.startApplyingExternalUpdate(),CE(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&&wE(e,t),e.focus()},this.focusComposerAtEnd=e=>{let{editor:t}=this;if(!t)return;let n=VE(e??xE(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=kE(e);CE(t,e,r),this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n}else wE(t,r);t.focus(()=>{wE(t,r)})},this.readComposerSnapshot=e=>{let{editor:t}=this;if(!t)return{nodes:e,selection:this.selectionRef.current};let n=xE(t.getEditorState());return this.selectionRef.current=n.selection,n},this.createHandle=()=>{let e=(e,t=[Jm])=>{let{callbacks:n}=this.getRuntime();n.onInputSurfaceItemSelect?.(e),this.publishRuntimeSnapshot(n=>OE({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=>jE({label:t,nodes:n.nodes,selection:n.selection,tokenKey:e}),{focusAfterSync:!0})},insertFileTokens:e=>{this.publishRuntimeSnapshot(t=>e.reduce((e,t)=>jE({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=>NE({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();LE({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,RE({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:zE({actions:t,nativeEvent:r,publishSnapshot:(e,t)=>this.publishSnapshot(e,n,t),snapshot:a})},this.handleEditorUpdate=(e,t)=>{let n=xE(e),r=kE(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=xE(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 UE({disabled:e,nodes:t,owner:n}){let[r]=Tg();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 WE=(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 HE),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)(Iw,{initialConfig:(0,P.useMemo)(()=>({editable:!t,editorState:()=>{SE(n,null)},namespace:`NextClawChatComposerLexical`,nodes:[pE],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)(lE,{contentEditable:(0,F.jsx)(Aw,{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:Vw})})}),(0,F.jsx)(UE,{disabled:t,nodes:n,owner:d})]})});WE.displayName=`LexicalChatInputBarTokenizedComposer`;var GE=120;function KE(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=GE?t:`${t.slice(0,GE-1)}…`}function qE({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 JE({sendError:e,sendErrorDetailsLabel:t}){let n=e?.trim()??``;if(!n)return null;let{Popover:r,PopoverContent:i,PopoverTrigger:a}=Wh,o=KE(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 YE=(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)(tg,{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)(WE,{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)(qE,{hint:t}),(0,F.jsx)(JE,{sendError:r,sendErrorDetailsLabel:i}),(0,F.jsx)(Sg,{...f})]})})})});YE.displayName=`ChatInputBar`;function XE({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)(ps,{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)(gs,{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)(Qa,{className:R(n?`h-4 w-4`:`h-[18px] w-[18px]`,`text-current`),strokeWidth:2.5})})}function ZE(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var QE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$E=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eD={};function tD(e,t){return((t||eD).jsx?$E:QE).test(e)}var nD=/[ \t\n\f\r]/g;function rD(e){return typeof e==`object`?e.type===`text`?iD(e.value):!1:iD(e)}function iD(e){return e.replace(nD,``)===``}var aD=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};aD.prototype.normal={},aD.prototype.property={},aD.prototype.space=void 0;function oD(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new aD(n,r,t)}function sD(e){return e.toLowerCase()}var cD=class{constructor(e,t){this.attribute=t,this.property=e}};cD.prototype.attribute=``,cD.prototype.booleanish=!1,cD.prototype.boolean=!1,cD.prototype.commaOrSpaceSeparated=!1,cD.prototype.commaSeparated=!1,cD.prototype.defined=!1,cD.prototype.mustUseProperty=!1,cD.prototype.number=!1,cD.prototype.overloadedBoolean=!1,cD.prototype.property=``,cD.prototype.spaceSeparated=!1,cD.prototype.space=void 0;var lD=t({boolean:()=>J,booleanish:()=>dD,commaOrSpaceSeparated:()=>hD,commaSeparated:()=>mD,number:()=>Y,overloadedBoolean:()=>fD,spaceSeparated:()=>pD}),uD=0,J=gD(),dD=gD(),fD=gD(),Y=gD(),pD=gD(),mD=gD(),hD=gD();function gD(){return 2**++uD}var _D=Object.keys(lD),vD=class extends cD{constructor(e,t,n,r){let i=-1;if(super(e,t),yD(this,`space`,r),typeof n==`number`)for(;++i<_D.length;){let e=_D[i];yD(this,_D[i],(n&lD[e])===lD[e])}}};vD.prototype.defined=!0;function yD(e,t,n){n&&(e[t]=n)}function bD(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new vD(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[sD(r)]=r,n[sD(a.attribute)]=r}return new aD(t,n,e.space)}var xD=bD({properties:{ariaActiveDescendant:null,ariaAtomic:dD,ariaAutoComplete:null,ariaBusy:dD,ariaChecked:dD,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:pD,ariaCurrent:null,ariaDescribedBy:pD,ariaDetails:null,ariaDisabled:dD,ariaDropEffect:pD,ariaErrorMessage:null,ariaExpanded:dD,ariaFlowTo:pD,ariaGrabbed:dD,ariaHasPopup:null,ariaHidden:dD,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pD,ariaLevel:Y,ariaLive:null,ariaModal:dD,ariaMultiLine:dD,ariaMultiSelectable:dD,ariaOrientation:null,ariaOwns:pD,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:dD,ariaReadOnly:dD,ariaRelevant:null,ariaRequired:dD,ariaRoleDescription:pD,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:dD,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 SD(e,t){return t in e?e[t]:t}function CD(e,t){return SD(e,t.toLowerCase())}var wD=bD({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:mD,acceptCharset:pD,accessKey:pD,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:pD,autoFocus:J,autoPlay:J,blocking:pD,capture:null,charSet:null,checked:J,cite:null,className:pD,cols:Y,colSpan:null,content:null,contentEditable:dD,controls:J,controlsList:pD,coords:Y|mD,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:fD,draggable:dD,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:pD,height:Y,hidden:fD,high:Y,href:null,hrefLang:null,htmlFor:pD,httpEquiv:pD,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:pD,itemRef:pD,itemScope:J,itemType:pD,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:pD,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:pD,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:pD,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:dD,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:dD,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pD,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:dD,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:CD}),TD=bD({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:hD,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:pD,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:mD,g2:mD,glyphName:mD,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:hD,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:pD,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:hD,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:hD,rev:hD,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:hD,requiredFeatures:hD,requiredFonts:hD,requiredFormats:hD,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:hD,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:hD,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:hD,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:SD}),ED=bD({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()}}),DD=bD({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:CD}),OD=bD({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),kD={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`},AD=/[A-Z]/g,jD=/-[a-z]/g,MD=/^data[-\w.:]+$/i;function ND(e,t){let n=sD(t),r=t,i=cD;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&MD.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(jD,FD);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!jD.test(e)){let n=e.replace(AD,PD);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=vD}return new i(r,t)}function PD(e){return`-`+e.toLowerCase()}function FD(e){return e.charAt(1).toUpperCase()}var ID=oD([xD,wD,ED,DD,OD],`html`),LD=oD([xD,TD,ED,DD,OD],`svg`);function RD(e){return e.join(` `).trim()}var zD=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})),BD=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(zD());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}})),VD=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))}})),HD=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(BD()),r=VD();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})),UD=GD(`end`),WD=GD(`start`);function GD(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 KD(e){let t=WD(e),n=UD(e);if(t&&n)return{start:t,end:n}}function qD(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?YD(e.position):`start`in e||`end`in e?YD(e):`line`in e||`column`in e?JD(e):``}function JD(e){return XD(e&&e.line)+`:`+XD(e&&e.column)}function YD(e){return JD(e&&e.start)+`-`+JD(e&&e.end)}function XD(e){return e&&typeof e==`number`?e:1}var ZD=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=qD(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}};ZD.prototype.file=``,ZD.prototype.name=``,ZD.prototype.reason=``,ZD.prototype.message=``,ZD.prototype.stack=``,ZD.prototype.column=void 0,ZD.prototype.line=void 0,ZD.prototype.ancestors=void 0,ZD.prototype.cause=void 0,ZD.prototype.fatal=void 0,ZD.prototype.place=void 0,ZD.prototype.ruleId=void 0,ZD.prototype.source=void 0;var QD=e(HD(),1),$D={}.hasOwnProperty,eO=new Map,tO=/[A-Z]/g,nO=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),rO=new Set([`td`,`th`]),iO=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function aO(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=gO(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=hO(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`?LD:ID,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=oO(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function oO(e,t,n){if(t.type===`element`)return sO(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return cO(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return uO(e,t,n);if(t.type===`mdxjsEsm`)return lO(e,t);if(t.type===`root`)return dO(e,t,n);if(t.type===`text`)return fO(e,t)}function sO(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=LD,e.schema=i),e.ancestors.push(t);let a=SO(e,t.tagName,!1),o=_O(e,t),s=yO(e,t);return nO.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!rD(e):!0})),pO(e,o,a,t),mO(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cO(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)}CO(e,t.position)}function lO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);CO(e,t.position)}function uO(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=LD,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:SO(e,t.name,!0),o=vO(e,t),s=yO(e,t);return pO(e,o,a,t),mO(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function dO(e,t,n){let r={};return mO(r,yO(e,t)),e.create(t,e.Fragment,r,n)}function fO(e,t){return t.value}function pO(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function mO(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function hO(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 gO(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=WD(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 _O(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&$D.call(t.properties,i)){let a=bO(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&rO.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 vO(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 CO(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 CO(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function yO(e,t){let n=[],r=-1,i=e.passKeys?new Map:eO;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=oO(e,a,o);s!==void 0&&n.push(s)}return n}function bO(e,t,n){let r=ND(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ZE(n):RD(n)),r.property===`style`){let t=typeof n==`object`?n:xO(e,String(n));return e.stylePropertyNameCase===`css`&&(t=wO(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?kD[r.property]||r.property:r.attribute,n]}}function xO(e,t){try{return(0,QD.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new ZD("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=iO+`#cannot-parse-style-attribute`,r}}function SO(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=tD(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=tD(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return $D.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);CO(e)}function CO(e,t){let n=new ZD("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=iO+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function wO(e){let t={},n;for(n in e)$D.call(e,n)&&(t[TO(n)]=e[n]);return t}function TO(e){let t=e.replace(tO,EO);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function EO(e){return`-`+e.toLowerCase()}var DO={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`]},OO={};function kO(e,t){let n=t||OO;return AO(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function AO(e,t,n){if(MO(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 jO(e.children,t,n)}return Array.isArray(e)?jO(e,t,n):``}function jO(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=AO(e[i],t,n);return r.join(``)}function MO(e){return!!(e&&typeof e==`object`)}var NO=document.createElement(`i`);function PO(e){let t=`&`+e+`;`;NO.innerHTML=t;let n=NO.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function FO(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 IO(e,t){return e.length>0?(FO(e,e.length,0,t),e):t}var LO={}.hasOwnProperty;function RO(e){let t={},n=-1;for(;++n<e.length;)zO(t,e[n]);return t}function zO(e,t){let n;for(n in t){let r=(LO.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){LO.call(r,a)||(r[a]=[]);let e=i[a];BO(r[a],Array.isArray(e)?e:e?[e]:[])}}}function BO(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);FO(e,0,0,r)}function VO(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 HO(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var UO=$O(/[A-Za-z]/),WO=$O(/[\dA-Za-z]/),GO=$O(/[#-'*+\--9=?A-Z^-~]/);function KO(e){return e!==null&&(e<32||e===127)}var qO=$O(/\d/),JO=$O(/[\dA-Fa-f]/),YO=$O(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function XO(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var ZO=$O(/\p{P}|\p{S}/u),QO=$O(/\s/);function $O(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ek(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&WO(e.charCodeAt(n+1))&&WO(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 tk={tokenize:nk};function nk(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 rk={tokenize:ak},ik={tokenize:ok};function ak(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 FO(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(ik,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(ik,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++;FO(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 ok(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 sk(e){if(e===null||XO(e)||QO(e))return 1;if(ZO(e))return 2}function ck(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 lk={name:`attention`,resolveAll:uk,tokenize:dk};function uk(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};fk(d,-c),fk(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=IO(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=IO(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=IO(l,ck(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=IO(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=IO(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,FO(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 dk(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=sk(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=sk(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 fk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var pk={name:`autolink`,tokenize:mk};function mk(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 UO(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||WO(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||WO(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||KO(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):GO(t)?(e.consume(t),l):n(t)}function u(e){return WO(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||WO(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var hk={partial:!0,tokenize:gk};function gk(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 _k={continuation:{tokenize:yk},exit:bk,name:`blockQuote`,tokenize:vk};function vk(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 yk(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(_k,t,n)(r)}}function bk(e){e.exit(`blockQuote`)}var xk={name:`characterEscape`,tokenize:Sk};function Sk(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 YO(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Ck={name:`characterReference`,tokenize:wk};function wk(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=WO,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=JO,u):(e.enter(`characterReferenceValue`),a=7,o=qO,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===WO&&!PO(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 Tk={partial:!0,tokenize:Ok},Ek={concrete:!0,name:`codeFenced`,tokenize:Dk};function Dk(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(Tk,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(Tk,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 Ok(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 kk={name:`codeIndented`,tokenize:jk},Ak={partial:!0,tokenize:Mk};function jk(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(Ak,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 Mk(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 Nk={name:`codeText`,previous:Fk,resolve:Pk,tokenize:Ik};function Pk(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 Fk(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ik(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 Lk=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&&Rk(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),Rk(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Rk(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);Rk(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Rk(this.left,t.reverse())}}};function Rk(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 zk(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Lk(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,Bk(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 FO(e,0,1/0,u.slice(0)),!l}function Bk(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 Vk={resolve:Uk,tokenize:Wk},Hk={partial:!0,tokenize:Gk};function Uk(e){return zk(e),e}function Wk(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(Hk,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 Gk(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 Kk(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||KO(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||XO(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||KO(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 qk(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 Jk(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 Yk(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 Xk={name:`definition`,tokenize:Qk},Zk={partial:!0,tokenize:$k};function Qk(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return qk.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=HO(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 XO(t)?Yk(e,l)(t):l(t)}function l(t){return Kk(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Zk,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 $k(e,t,n){return r;function r(t){return XO(t)?Yk(e,i)(t):n(t)}function i(t){return Jk(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 eA={name:`hardBreakEscape`,tokenize:tA};function tA(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 nA={name:`headingAtx`,resolve:rA,tokenize:iA};function rA(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`},FO(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function iA(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||XO(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||XO(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var aA=`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(`.`),oA=[`pre`,`script`,`style`,`textarea`],sA={concrete:!0,name:`htmlFlow`,resolveTo:uA,tokenize:dA},cA={partial:!0,tokenize:pA},lA={partial:!0,tokenize:fA};function uA(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 dA(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):UO(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):UO(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 UO(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||XO(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&oA.includes(l)?(i=1,r.interrupt?t(s):O(s)):aA.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||WO(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||UO(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||WO(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||XO(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(cA,ae,k)(t)):t===null||X(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(lA,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 oA.includes(n)?(e.consume(t),ie):O(t)}return UO(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 fA(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 pA(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(hk,t,n)}}var mA={name:`htmlText`,tokenize:hA};function hA(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):UO(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):UO(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 UO(t)?(e.consume(t),S):n(t)}function S(t){return t===45||WO(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||WO(t)?(e.consume(t),w):t===47||t===62||XO(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||UO(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||WO(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||XO(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||XO(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 gA={name:`labelEnd`,resolveAll:bA,resolveTo:xA,tokenize:SA},_A={tokenize:CA},vA={tokenize:wA},yA={tokenize:TA};function bA(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&&FO(e,0,e.length,n),e}function xA(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=IO(s,e.slice(a+1,a+r+3)),s=IO(s,[[`enter`,u,t]]),s=IO(s,ck(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=IO(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=IO(s,e.slice(o+1)),s=IO(s,[[`exit`,c,t]]),FO(e,a,e.length,s),e}function SA(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(HO(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(_A,u,o?u:d)(t):t===91?e.attempt(vA,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(yA,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function CA(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 XO(t)?Yk(e,a)(t):a(t)}function a(t){return t===41?u(t):Kk(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return XO(t)?Yk(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Jk(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return XO(t)?Yk(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 wA(e,t,n){let r=this;return i;function i(t){return qk.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(HO(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function TA(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 EA={name:`labelStartImage`,resolveAll:gA.resolveAll,tokenize:DA};function DA(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 OA={name:`labelStartLink`,resolveAll:gA.resolveAll,tokenize:kA};function kA(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 AA={name:`lineEnding`,tokenize:jA};function jA(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var MA={name:`thematicBreak`,tokenize:NA};function NA(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 PA={continuation:{tokenize:RA},exit:BA,name:`list`,tokenize:LA},FA={partial:!0,tokenize:VA},IA={partial:!0,tokenize:zA};function LA(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:qO(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(MA,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 qO(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(hk,r.interrupt?n:u,e.attempt(FA,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 RA(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(hk,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(IA,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(PA,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function zA(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 BA(e){e.exit(this.containerState.type)}function VA(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 HA={name:`setextUnderline`,resolveTo:UA,tokenize:WA};function UA(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 WA(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 GA={tokenize:KA};function KA(e){let t=this,n=e.attempt(hk,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Vk,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 qA={resolveAll:ZA()},JA=XA(`string`),YA=XA(`text`);function XA(e){return{resolveAll:ZA(e===`text`?QA: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 ZA(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 QA(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 $A=t({attentionMarkers:()=>sj,contentInitial:()=>tj,disable:()=>cj,document:()=>ej,flow:()=>rj,flowInitial:()=>nj,insideSpan:()=>oj,string:()=>ij,text:()=>aj}),ej={42:PA,43:PA,45:PA,48:PA,49:PA,50:PA,51:PA,52:PA,53:PA,54:PA,55:PA,56:PA,57:PA,62:_k},tj={91:Xk},nj={[-2]:kk,[-1]:kk,32:kk},rj={35:nA,42:MA,45:[HA,MA],60:sA,61:HA,95:MA,96:Ek,126:Ek},ij={38:Ck,92:xk},aj={[-5]:AA,[-4]:AA,[-3]:AA,33:EA,38:Ck,42:lk,60:[pk,mA],91:OA,92:[eA,xk],93:gA,95:lk,96:Nk},oj={null:[lk,qA]},sj={null:[42,95]},cj={null:[]};function lj(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=IO(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=ck(a,l.events,l),l.events):[]}function f(e,t){return dj(p(e),t)}function p(e){return uj(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&&FO(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 uj(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 dj(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 fj(e){let t={constructs:RO([$A,...(e||{}).extensions||[]]),content:n(tk),defined:[],document:n(rk),flow:n(GA),lazy:{},string:n(JA),text:n(YA)};return t;function n(e){return n;function n(n){return lj(t,e,n)}}}function pj(e){for(;!zk(e););return e}var mj=/[\0\t\n\r]/g;function hj(){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(mj.lastIndex=u,c=mj.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 gj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _j(e){return e.replace(gj,vj)}function vj(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return VO(n.slice(t?2:1),t?16:10)}return PO(n)||e}var yj={}.hasOwnProperty;function bj(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),xj(n)(pj(fj(n).document().write(hj()(e,t,!0))))}function xj(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()}};Cj(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]];yj.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]||Tj).call(a,void 0,e[0])}for(r.position={start:Sj(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Sj(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:Sj(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]||Tj).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+qD({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Sj(e.end)}function u(){return kO(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=HO(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:Sj(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=Sj(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=Sj(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=_j(t),n.identifier=HO(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=HO(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=VO(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=PO(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=Sj(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 Sj(e){return{line:e.line,column:e.column,offset:e.offset}}function Cj(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Cj(e,r):wj(e,r)}}function wj(e,t){let n;for(n in t)if(yj.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 Tj(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+qD({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qD({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+qD({start:t.start,end:t.end})+`) is still open`)}function Ej(e){let t=this;t.parser=n;function n(n){return bj(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Dj(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 Oj(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
23
- `}]}function kj(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 Aj(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jj(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mj(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=ek(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 Nj(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 Pj(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Fj(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 Ij(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Fj(e,t);let i={src:ek(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 Lj(e,t){let n={src:ek(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 Rj(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 zj(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Fj(e,t);let i={href:ek(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 Bj(e,t){let n={href:ek(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 Vj(e,t,n){let r=e.all(t),i=n?Hj(n):Uj(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 Hj(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Uj(n[r])}return t}function Uj(e){return e.spread??e.children.length>1}function Wj(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 Gj(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kj(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function qj(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jj(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=WD(t.children[1]),o=UD(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 Yj(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 Xj(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Zj=9,Qj=32;function $j(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(eM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(eM(t.slice(i),i>0,!1)),a.join(``)}function eM(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Zj||t===Qj;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Zj||t===Qj;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function tM(e,t){let n={type:`text`,value:$j(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nM(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var rM={blockquote:Dj,break:Oj,code:kj,delete:Aj,emphasis:jj,footnoteReference:Mj,heading:Nj,html:Pj,imageReference:Ij,image:Lj,inlineCode:Rj,linkReference:zj,link:Bj,listItem:Vj,list:Wj,paragraph:Gj,root:Kj,strong:qj,table:Jj,tableCell:Xj,tableRow:Yj,text:tM,thematicBreak:nM,toml:iM,yaml:iM,definition:iM,footnoteDefinition:iM};function iM(){}var aM=typeof self==`object`?self:globalThis,oM=(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 aM[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 aM[a](o),i)};return r},sM=e=>oM(new Map,e)(0),cM=``,{toString:lM}={},{keys:uM}=Object,dM=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=lM.call(e).slice(8,-1);switch(n){case`Array`:return[1,cM];case`Object`:return[2,cM];case`Date`:return[3,cM];case`RegExp`:return[4,cM];case`Map`:return[5,cM];case`Set`:return[6,cM];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},fM=([e,t])=>e===0&&(t===`function`||t===`symbol`),pM=(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]=dM(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 uM(r))(e||!fM(dM(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||!(fM(dM(n))||fM(dM(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!fM(dM(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},mM=(e,{json:t,lossy:n}={})=>{let r=[];return pM(!(t||n),!!t,new Map,r)(e),r},hM=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?sM(mM(e,t)):structuredClone(e):(e,t)=>sM(mM(e,t));function gM(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 _M(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function vM(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||gM,r=e.options.footnoteBackLabel||_M,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=ek(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:{...hM(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 yM=(function(e){if(e==null)return wM;if(typeof e==`function`)return CM(e);if(typeof e==`object`)return Array.isArray(e)?bM(e):xM(e);if(typeof e==`string`)return SM(e);throw Error(`Expected function, string, or object as test`)});function bM(e){let t=[],n=-1;for(;++n<e.length;)t[n]=yM(e[n]);return CM(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function xM(e){let t=e;return CM(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function SM(e){return CM(t);function t(t){return t&&t.type===e}}function CM(e){return t;function t(t,n,r){return!!(TM(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function wM(){return!0}function TM(e){return typeof e==`object`&&!!e&&`type`in e}function EM(e){return e}var DM=[];function OM(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=yM(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 (`+EM(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=DM,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=kM(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 kM(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?DM:[e]}function AM(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),OM(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 jM={}.hasOwnProperty,MM={};function NM(e,t){let n=t||MM,r=new Map,i=new Map,a={all:s,applyData:FM,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...rM,...n.handlers},one:o,options:n,patch:PM,wrap:LM};return AM(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(jM.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=hM(n);return r.children=a.all(e),r}return hM(e)}return(a.options.unknownHandler||IM)(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=RM(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=RM(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function PM(e,t){e.position&&(t.position=KD(e))}function FM(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,hM(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function IM(e,t){let n=t.data||{},r=`value`in t&&!(jM.call(n,`hProperties`)||jM.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 LM(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 RM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function zM(e,t){let n=NM(e,t),r=n.one(e,void 0),i=vM(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 BM(e,t){return e&&`run`in e?async function(n,r){let i=zM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zM(n,{file:r,...e||t})}}function VM(e){if(e)throw e}var HM=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 UM(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 WM(){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?GM(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 GM(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 KM={basename:qM,dirname:JM,extname:YM,join:XM,sep:`/`};function qM(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);$M(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 JM(e){if($M(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 YM(e){$M(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 XM(...e){let t=-1,n;for(;++t<e.length;)$M(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:ZM(n)}function ZM(e){$M(e);let t=e.codePointAt(0)===47,n=QM(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function QM(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 $M(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var eN={cwd:tN};function tN(){return`/`}function nN(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function rN(e){if(typeof e==`string`)e=new URL(e);else if(!nN(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 iN(e)}function iN(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 aN=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],oN=class{constructor(e){let t;t=e?nN(e)?{path:e}:typeof e==`string`||uN(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:eN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<aN.length;){let e=aN[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)aN.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?KM.basename(this.path):void 0}set basename(e){cN(e,`basename`),sN(e,`basename`),this.path=KM.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?KM.dirname(this.path):void 0}set dirname(e){lN(this.basename,`dirname`),this.path=KM.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?KM.extname(this.path):void 0}set extname(e){if(sN(e,`extname`),lN(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=KM.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){nN(e)&&(e=rN(e)),cN(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?KM.basename(this.path,this.extname):void 0}set stem(e){cN(e,`stem`),sN(e,`stem`),this.path=KM.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 ZD(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 sN(e,t){if(e&&e.includes(KM.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+KM.sep+"`")}function cN(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function lN(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function uN(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var dN=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),fN=e(HM(),1),pN={}.hasOwnProperty,mN=new class e extends dN{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=WM()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,fN.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(_N(`data`,this.frozen),this.namespace[e]=t,this):pN.call(this.namespace,e)&&this.namespace[e]||void 0:e?(_N(`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=bN(e),n=this.parser||this.Parser;return hN(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),hN(`process`,this.parser||this.Parser),gN(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=bN(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);SN(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(),hN(`processSync`,this.parser||this.Parser),gN(`processSync`,this.compiler||this.Compiler),this.process(e,r),yN(`processSync`,`process`,t),n;function r(e,r){t=!0,VM(e),n=r}}run(e,t,n){vN(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=bN(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),yN(`runSync`,`run`,n),r;function i(e,t){VM(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=bN(t),r=this.compiler||this.Compiler;return gN(`stringify`,r),vN(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(_N(`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,fN.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];UM(o)&&UM(r)&&(r=(0,fN.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function hN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function gN(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function _N(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 vN(e){if(!UM(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function yN(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function bN(e){return xN(e)?e:new oN(e)}function xN(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function SN(e){return typeof e==`string`||CN(e)}function CN(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var wN=[],TN={allowDangerousHtml:!0},EN=/^(https?|ircs?|mailto|xmpp)$/i,DN=[{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 ON(e){let t=kN(e),n=AN(e);return jN(t.runSync(t.parse(n),n),e)}function kN(e){let t=e.rehypePlugins||wN,n=e.remarkPlugins||wN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...TN}:TN;return mN().use(Ej).use(n).use(BM,r).use(t)}function AN(e){let t=e.children||``,n=new oN;return typeof t==`string`?n.value=t:``+t,n}function jN(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||MN;for(let e of DN)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return AM(e,l),aO(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 DO)if(Object.hasOwn(DO,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=DO[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 MN(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||EN.test(e.slice(0,t))?e:``}function NN(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 PN(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function FN(e,t,n){let r=yM((n||{}).ignore||[]),i=IN(t),a=-1;for(;++a<i.length;)OM(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 IN(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([LN(e[0]),RN(e[1])])}return t}function LN(e){return typeof e==`string`?new RegExp(PN(e),`g`):e}function RN(e){return typeof e==`function`?e:function(){return e}}var zN=`phrasing`,BN=[`autolink`,`link`,`image`,`label`];function VN(){return{transforms:[YN],enter:{literalAutolink:UN,literalAutolinkEmail:WN,literalAutolinkHttp:WN,literalAutolinkWww:WN},exit:{literalAutolink:JN,literalAutolinkEmail:qN,literalAutolinkHttp:GN,literalAutolinkWww:KN}}}function HN(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:zN,notInConstruct:BN},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:zN,notInConstruct:BN},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:zN,notInConstruct:BN}]}}function UN(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function WN(e){this.config.enter.autolinkProtocol.call(this,e)}function GN(e){this.config.exit.autolinkProtocol.call(this,e)}function KN(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 qN(e){this.config.exit.autolinkEmail.call(this,e)}function JN(e){this.exit(e)}function YN(e){FN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,XN],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ZN]],{ignore:[`link`,`linkReference`]})}function XN(e,t,n,r,i){let a=``;if(!eP(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!QN(n)))return!1;let o=$N(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 ZN(e,t,n,r){return!eP(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function QN(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 $N(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=NN(e,`(`),a=NN(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 eP(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||QO(n)||ZO(n))&&(!t||n!==47)}uP.peek=lP;function tP(){this.buffer()}function nP(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function rP(){this.buffer()}function iP(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function aP(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=HO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oP(e){this.exit(e)}function sP(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=HO(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cP(e){this.exit(e)}function lP(){return`[`}function uP(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 dP(){return{enter:{gfmFootnoteCallString:tP,gfmFootnoteCall:nP,gfmFootnoteDefinitionLabelString:rP,gfmFootnoteDefinition:iP},exit:{gfmFootnoteCallString:aP,gfmFootnoteCall:oP,gfmFootnoteDefinitionLabelString:sP,gfmFootnoteDefinition:cP}}}function fP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:uP},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?mP:pP))),s(),o}}function pP(e,t,n){return t===0?e:mP(e,t,n)}function mP(e,t,n){return(n?``:` `)+e}var hP=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];bP.peek=xP;function gP(){return{canContainEols:[`delete`],enter:{strikethrough:vP},exit:{strikethrough:yP}}}function _P(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:hP}],handlers:{delete:bP}}}function vP(e){this.enter({type:`delete`,children:[]},e)}function yP(e){this.exit(e)}function bP(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 xP(){return`~`}function SP(e){return e.length}function CP(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||SP,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=wP(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]=TP(r[d]);else{let e=TP(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 wP(e){return e==null?``:String(e)}function TP(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 EP(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()),DP);return i(),o}function DP(e,t,n){return`>`+(n?``:` `)+e}function OP(e,t){return kP(e,t.inConstruct,!0)&&!kP(e,t.notInConstruct,!1)}function kP(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 AP(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
35
- `&&OP(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
36
- `}function jP(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 MP(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 NP(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function PP(e,t,n,r){let i=NP(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(MP(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,FP);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(jP(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 FP(e,t,n){return(n?``:` `)+e}function IP(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function LP(e,t,n,r){let i=IP(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 RP(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function zP(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function BP(e,t,n){let r=sk(e),i=sk(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}}VP.peek=HP;function VP(e,t,n,r){let i=RP(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=BP(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=zP(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=BP(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+zP(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function HP(e,t,n){return n.options.emphasis||`*`}function UP(e,t){let n=!1;return AM(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)&&kO(e)&&(t.options.setext||n))}function WP(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(UP(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=zP(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}GP.peek=KP;function GP(e){return e.value||``}function KP(){return`<`}qP.peek=JP;function qP(e,t,n,r){let i=IP(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 JP(){return`!`}YP.peek=XP;function YP(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 XP(){return`!`}ZP.peek=QP;function ZP(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 QP(){return"`"}function $P(e,t){let n=kO(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))}eF.peek=tF;function eF(e,t,n,r){let i=IP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if($P(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 tF(e,t,n){return $P(e,n)?`<`:`[`}nF.peek=rF;function nF(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 rF(){return`[`}function iF(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 aF(e){let t=iF(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 oF(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function sF(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 cF(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?oF(n):iF(n),s=e.ordered?o===`.`?`)`:`.`:aF(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),sF(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 lF(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 uF(e,t,n,r){let i=lF(n),a=n.bulletCurrent||iF(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 dF(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var fF=yM([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function pF(e,t,n,r){return(e.children.some(function(e){return fF(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mF(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hF.peek=gF;function hF(e,t,n,r){let i=mF(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=BP(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=zP(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=BP(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+zP(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function gF(e,t,n){return n.options.strong||`*`}function _F(e,t,n,r){return n.safe(e.value,r)}function vF(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 yF(e,t,n){let r=(sF(n)+(n.options.ruleSpaces?` `:``)).repeat(vF(n));return n.options.ruleSpaces?r.slice(0,-1):r}var bF={blockquote:EP,break:AP,code:PP,definition:LP,emphasis:VP,hardBreak:AP,heading:WP,html:GP,image:qP,imageReference:YP,inlineCode:ZP,link:eF,linkReference:nF,list:cF,listItem:uF,paragraph:dF,root:pF,strong:hF,text:_F,thematicBreak:yF};function xF(){return{enter:{table:SF,tableData:EF,tableHeader:EF,tableRow:wF},exit:{codeText:DF,table:CF,tableData:TF,tableHeader:TF,tableRow:TF}}}function SF(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 CF(e){this.exit(e),this.data.inTable=void 0}function wF(e){this.enter({type:`tableRow`,children:[]},e)}function TF(e){this.exit(e)}function EF(e){this.enter({type:`tableCell`,children:[]},e)}function DF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,OF));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function OF(e,t){return t===`|`?t:e}function kF(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 CP(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=bF.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function AF(){return{exit:{taskListCheckValueChecked:MF,taskListCheckValueUnchecked:MF,paragraph:NF}}}function jF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:PF}}}function MF(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function NF(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 PF(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=bF.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 FF(){return[VN(),dP(),gP(),xF(),AF()]}function IF(e){return{extensions:[HN(),fP(e),_P(),kF(e),jF()]}}var LF={tokenize:ZF,partial:!0},RF={tokenize:QF,partial:!0},zF={tokenize:$F,partial:!0},BF={tokenize:eI,partial:!0},VF={tokenize:tI,partial:!0},HF={name:`wwwAutolink`,tokenize:YF,previous:nI},UF={name:`protocolAutolink`,tokenize:XF,previous:rI},WF={name:`emailAutolink`,tokenize:JF,previous:iI},GF={};function KF(){return{text:GF}}for(var qF=48;qF<123;)GF[qF]=WF,qF++,qF===58?qF=65:qF===91&&(qF=97);GF[43]=WF,GF[45]=WF,GF[46]=WF,GF[95]=WF,GF[72]=[WF,UF],GF[104]=[WF,UF],GF[87]=[WF,HF],GF[119]=[WF,HF];function JF(e,t,n){let r=this,i,a;return o;function o(t){return!aI(t)||!iI.call(r,r.previous)||oI(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return aI(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(VF,u,l)(t):t===45||t===95||WO(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&&UO(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function YF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!nI.call(r,r.previous)||oI(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(LF,e.attempt(RF,e.attempt(zF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function XF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&rI.call(r,r.previous)&&!oI(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(UO(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||KO(t)||XO(t)||QO(t)||ZO(t)?n(t):e.attempt(RF,e.attempt(zF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function ZF(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 QF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(BF,c,s)(t):t===null||XO(t)||QO(t)||t!==45&&ZO(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 $F(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(BF,t,a)(o):o===null||XO(o)||QO(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function eI(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||XO(o)||QO(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||XO(e)||QO(e)?t(e):r(e)}function a(e){return UO(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):UO(t)?(e.consume(t),o):n(t)}}function tI(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return WO(e)?n(e):t(e)}}function nI(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||XO(e)}function rI(e){return!UO(e)}function iI(e){return!(e===47||aI(e))}function aI(e){return e===43||e===45||e===46||e===95||WO(e)}function oI(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 sI={tokenize:hI,partial:!0};function cI(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:fI,continuation:{tokenize:pI},exit:mI}},text:{91:{name:`gfmFootnoteCall`,tokenize:dI},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:lI,resolveTo:uI}}}}function lI(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=HO(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 uI(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 dI(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||XO(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(HO(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return XO(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 fI(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||XO(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=HO(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return XO(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 pI(e,t,n){return e.check(hk,t,e.attempt(sI,t,n))}function mI(e){e.exit(`gfmFootnoteDefinition`)}function hI(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 gI(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&&FO(o,o.length,0,ck(s,e.slice(r+1,n),t)),FO(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),FO(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=sk(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=sk(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var _I=class{constructor(){this.map=[]}add(e,t,n){vI(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 vI(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 yI(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 bI(){return{flow:{null:{name:`table`,tokenize:xI,resolveAll:SI}}}}function xI(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||XO(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||XO(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 SI(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 _I;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(wI(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=CI(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=CI(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=CI(f,t,o,i,n,d)):(o[0]=o[1],d=CI(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&wI(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=yI(t.events,n))}return e}function CI(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},TI(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=TI(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=TI(t.events,n[2]),a=TI(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({},TI(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function wI(e,t,n,r,i){let a=[],o=TI(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 TI(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var EI={name:`tasklistCheck`,tokenize:OI};function DI(){return{text:{91:EI}}}function OI(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 XO(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:kI},t,n)(r):n(r)}}function kI(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function AI(e){return RO([KF(),cI(),gI(e),bI(),DI()])}var jI={};function MI(e){let t=this,n=e||jI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(AI(n)),a.push(FF()),o.push(IF(n))}function NI(e){return e===`skill`?`skill`:e===`panel_app`?`panel_app`:`default`}function PI(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 FI(e,t){return e===`skill`?`text-current opacity-80`:t?`text-primary-foreground/80`:`text-muted-foreground`}function II(e){return e===`panel_app`?(0,F.jsx)(Ja,{"aria-hidden":`true`,className:`h-3 w-3`}):(0,F.jsx)(Qo,{"aria-hidden":`true`,className:`h-3 w-3`})}function LI({kind:e,label:t,isUser:n,onClick:r}){let i=NI(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`,PI(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`,FI(i,n)),children:II(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 RI(){return typeof navigator<`u`&&typeof navigator.clipboard?.writeText==`function`}function zI(e){if(typeof document>`u`)return;let t=document.getSelection();t&&(t.removeAllRanges(),e.forEach(e=>t.addRange(e)))}function BI(){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 VI(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 HI(e){try{e.focus({preventScroll:!0})}catch{e.focus()}}function UI(e){HI(e),e.select(),e.setSelectionRange(0,e.value.length)}function WI(){try{return typeof document.execCommand==`function`&&document.execCommand(`copy`)}catch{return!1}}function GI(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 KI(e){e.activeElement&&HI(e.activeElement),GI(e)||zI(e.ranges)}function qI(e){if(typeof document>`u`||!document.body)return!1;let t=BI(),n=VI(e);document.body.appendChild(n),UI(n);let r=WI();return n.remove(),KI(t),r}async function JI(e){if(!e)return!1;if(RI())try{return await navigator.clipboard.writeText(e),!0}catch{return qI(e)}return qI(e)}var YI=1300;function XI(e){let[t,n]=(0,P.useState)(!1),r=(0,P.useCallback)(async()=>{e.text&&(await JI(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??YI);return()=>window.clearTimeout(r)},[t,e.resetDelayMs]),{copied:t,copy:r}}var ZI=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,N=a,Ue=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 Ue;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!==Ue)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=N(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:N,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 QI(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 $I=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_-]*/}}),eL=`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(`.`),tL=`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(`.`),nL=[...eL,...tL],rL=`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(),iL=`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(),aL=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),oL=`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 sL(e){let t=e.regex,n=$I(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:`:(`+iL.join(`|`)+`)`},{begin:`:(:)?(`+aL.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+oL.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:rL.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+nL.join(`|`)+`)\\b`}]}}function cL(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 lL=`[A-Za-z$_][0-9A-Za-z$_]*`,uL=`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(`.`),dL=[`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(`.`),pL=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],mL=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],hL=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],gL=[].concat(mL,fL,pL);function _L(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=lL,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:lL,keyword:uL,literal:dL,built_in:gL,"variable.language":hL},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,...pL]}},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([...mL,`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={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 yL(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 bL(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 xL(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function SL(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 CL=`[A-Za-z$_][0-9A-Za-z$_]*`,wL=`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(`.`),TL=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],EL=`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(`.`),DL=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],OL=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],kL=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],AL=[].concat(OL,EL,DL);function jL(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=CL,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:CL,keyword:wL,literal:TL,built_in:AL,"variable.language":kL},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:{_:[...EL,...DL]}},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([...OL,`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 ML(e){let t=e.regex,n=jL(e),r=CL,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:CL,keyword:wL.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:TL,built_in:AL.concat(i),"variable.language":kL},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 NL(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 PL(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 FL=new Set([`text`,`txt`,`plain`,`plaintext`,`none`,`output`]),IL=[`typescript`,`javascript`,`json`,`bash`,`shell`,`python`,`css`,`xml`,`markdown`,`yaml`,`sql`,`diff`],LL=4,RL=[{name:`typescript`,language:ML,aliases:[`ts`,`tsx`]},{name:`javascript`,language:_L,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{name:`json`,language:vL,aliases:[`jsonc`]},{name:`bash`,language:QI,aliases:[`sh`,`zsh`]},{name:`shell`,language:xL,aliases:[`console`,`terminal`]},{name:`python`,language:bL,aliases:[`py`]},{name:`css`,language:sL},{name:`xml`,language:NL,aliases:[`html`,`svg`]},{name:`markdown`,language:yL,aliases:[`md`,`mdx`]},{name:`yaml`,language:PL,aliases:[`yml`]},{name:`sql`,language:SL},{name:`diff`,language:cL,aliases:[`patch`]}];function zL(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function BL(e){return e.trim().toLowerCase()}var VL=new class{constructor(){this.highlight=(e,t)=>{let n=BL(t);if(!e||FL.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,IL);return r.language&&r.relevance>=LL?{html:r.value,language:r.language,highlighted:!0}:this.createPlainTextResult(e,n||`text`)},this.createPlainTextResult=(e,t)=>({html:zL(e),language:t,highlighted:!1}),this.engine=ZI.newInstance(),RL.forEach(e=>{this.engine.registerLanguage(e.name,e.language),e.aliases&&this.engine.registerAliases(e.aliases,{languageName:e.name})})}},HL=/language-([a-z0-9-]+)/i;function UL(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(UL).join(``):``}function WL(e){let t=UL(e);return t.endsWith(`
50
- `)?t.slice(0,-1):t}function GL(e){return(e?HL.exec(e):null)?.[1]?.toLowerCase()||`text`}function KL({className:e,children:t,texts:n}){let r=(0,P.useMemo)(()=>GL(e),[e]),i=(0,P.useMemo)(()=>WL(t),[t]),a=(0,P.useMemo)(()=>VL.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}=XI({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)(Kt,{className:`h-3.5 w-3.5`}):(0,F.jsx)(uo,{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 qL=`nextclaw-inline`,JL=/language-([a-z0-9-]+)/i,YL=new Set([`auto`,`source`,`rendered`]);function XL(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ZL(e){return typeof e==`string`&&e.trim().length>0?e.trim():void 0}function QL(e){return Number.isInteger(e)&&Number(e)>0?Number(e):void 0}function $L(e){let t=ZL(e);return t&&YL.has(t)?t:void 0}function eR(e){let{payload:t}=e;return XL(t)?t:null}function tR(e){let t=eR(e);if(!t)return null;let n=ZL(t.path);return n?{type:`file`,payload:{path:n,line:QL(t.line),column:QL(t.column),viewer:$L(t.viewer)}}:null}function nR(e){let t=eR(e);if(!t)return null;let n=ZL(t.url);return n?{type:`url`,payload:{url:n}}:null}function rR(e){let t=eR(e);if(!t)return null;let n=ZL(t.appId);return n?{type:`panel_app`,payload:{appId:n}}:null}function iR(e){let t=eR(e);return!t||!(`value`in t)?null:{type:`json`,payload:{value:t.value}}}function aR(e){if(!XL(e))return null;let t=ZL(e.type);return t===`file`?tR(e):t===`url`?nR(e):t===`panel_app`?rR(e):t===`json`?iR(e):null}function oR(e){return(e?JL.exec(e):null)?.[1]?.toLowerCase()===qL}function sR(e){let t=e.endsWith(`
51
- `)?e.slice(0,-1):e,n;try{n=JSON.parse(t)}catch{return null}if(!XL(n))return null;let r=aR(n.target);return r?{target:r,title:ZL(n.title),description:ZL(n.description)}:null}function cR(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 lR(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 uR({display:e}){let t=`h-3.5 w-3.5 shrink-0 text-muted-foreground`;return e.target.type===`file`?(0,F.jsx)(Xt,{className:t,"aria-hidden":!0}):e.target.type===`url`?(0,F.jsx)(on,{className:t,"aria-hidden":!0}):e.target.type===`panel_app`?(0,F.jsx)(Ja,{className:t,"aria-hidden":!0}):(0,F.jsx)(lo,{className:t,"aria-hidden":!0})}function dR(e){return e.length>1200?`${e.slice(0,1200)}\n...`:e}function fR({display:e}){let t=cR(e),n=lR(e),r=e.target.type===`json`?dR(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)(uR,{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 pR({display:e,renderInlineDisplay:t}){let n=t?.(e);return n==null?(0,F.jsx)(fR,{display:e}):(0,F.jsx)(F.Fragment,{children:n})}function mR({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,rE.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)(Sn,{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 hR({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)(ho,{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)(mR,{alt:e,closeLabel:n,onClose:()=>o(!1),src:i}):null]})}var gR=new Set([`http:`,`https:`,`mailto:`,`tel:`]),_R=/^[a-zA-Z][a-zA-Z\d+.-]*:/,vR=/^[a-z]:[\\/]/i;function yR(e){return!e.startsWith(`//`)&&!_R.test(e)}function bR(e){if(!e)return null;if(vR.test(e)||yR(e))return e;try{let t=new URL(e);return gR.has(t.protocol)?e:null}catch{return null}}function xR(e){return/^https?:\/\//i.test(e)}function SR(e){let t=e.split(`#`)[0]??e,[n,r=``]=t.split(`?`,2),i;try{i=decodeURIComponent(n??t)}catch{return null}if(!i||i.startsWith(`#`)||i.startsWith(`//`)||!vR.test(i)&&_R.test(i))return null;let a=new URLSearchParams(r).get(`viewer`),o=/^(.*?)(?::(\d+)(?::(\d+))?)$/.exec(i),s=o?.[1]??i,c=o?.[2]?Number(o[2]):void 0,l=o?.[3]?Number(o[3]):void 0;return{path:s,label:s.split(/[\\/]/).filter(Boolean).pop()??s,viewMode:`preview`,...a===`source`||a===`rendered`?{previewViewer:a}:{},...typeof c==`number`?{line:c}:{},...typeof l==`number`?{column:l}:{}}}var CR=14e4,wR=`data-chat-inline-token-kind`,TR=`data-chat-inline-token-key`,ER=`data-chat-inline-token-label`,DR=`data-chat-inline-token-raw-text`;function OR(e){return e.length<=CR?e:`${e.slice(0,CR)}\n\n...`}function kR(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 AR(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 jR(e){return{type:`chatInlineToken`,data:{hName:`span`,hProperties:{[wR]:e.kind,[TR]:e.key,[ER]:e.label,[DR]:e.rawText},hChildren:[{type:`text`,value:e.label}]}}}function MR(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 NR(e,t){let n=[],r=0;for(;r<e.length;){let i=MR(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(jR(i.token)),r=i.index+i.token.rawText.length}return n.length>0?n:[{type:`text`,value:e}]}function PR(e,t){if(e.type===`code`||e.type===`inlineCode`||!e.children)return;let n=[];for(let r of e.children){if(r.type===`text`&&typeof r.value==`string`){n.push(...NR(r.value,t));continue}PR(r,t),n.push(r)}e.children=n}function FR(e){let t=AR(e);return()=>e=>{t.length!==0&&PR(e,t)}}function IR(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:null}function LR({text:e,role:t,texts:n,inline:r=!1,inlineTokens:i,onFileOpen:a,onInlineTokenClick:o,resolveFileContentUrl:s,renderInlineDisplay:c}){let l=t===`user`,u=(0,P.useMemo)(()=>i&&i.length>0?[MI,FR(i)]:[MI],[i]),d=(0,P.useMemo)(()=>({p:({node:e,children:t})=>r?(0,F.jsx)(F.Fragment,{children:t}):(0,F.jsx)(`p`,{"data-chat-image-row":kR(e)?`three-column`:void 0,children:t}),span:({node:e,children:t,...n})=>{let r=n,i=IR(r,wR),a=IR(r,TR),s=IR(r,ER),c=IR(r,DR);return i&&a&&s&&c?(0,F.jsx)(LI,{kind:i,label:s,isUser:l,onClick:o?()=>o({kind:i,key:a,label:s,rawText:c}):void 0}):(0,F.jsx)(`span`,{...n,children:t})},a:({node:e,href:t,children:n,...r})=>{let i=bR(t),o=i?xR(i):!1,s=o?null:i?SR(i):null,c=e=>{if(!i){e.preventDefault();return}!a||!s||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),a(s))};return(0,F.jsx)(`a`,{...r,className:R(r.className,!i&&`chat-link-invalid`),href:i??`#`,"aria-disabled":!i||void 0,onClick:c,target:o?`_blank`:void 0,rel:o?`noreferrer noopener`:void 0,children:n})},table:({node:e,children:t,...n})=>(0,F.jsx)(`div`,{className:`chat-table-wrap`,children:(0,F.jsx)(`table`,{...n,children:t})}),input:({node:e,type:t,checked:n,...r})=>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:({node:e,src:t,alt:r})=>{let i=bR(t);if(!i)return null;let a=SR(i),o=a&&s?s(a):i;return o?(0,F.jsx)(hR,{alt:r||``,closeLabel:n.attachmentCloseLabel??`Close preview`,expandLabel:n.attachmentExpandLabel??`Expand image`,sizeLabel:null,src:o}):null},code:({node:e,className:t,children:r,...i})=>{let a=String(r??``);if(!t&&!a.includes(`
53
- `))return(0,F.jsx)(`code`,{...i,className:R(`chat-inline-code`,t),children:r});let o=oR(t)?sR(a):null;return o?(0,F.jsx)(pR,{display:o,renderInlineDisplay:c}):(0,F.jsx)(KL,{className:t,texts:n,children:r})}}),[r,l,a,o,c,s,n]);return(0,F.jsx)(r?`span`:`div`,{className:R(`chat-markdown`,l?`chat-markdown-user`:`chat-markdown-assistant`),children:(0,F.jsx)(ON,{skipHtml:!0,remarkPlugins:u,components:d,children:OR(e)})})}var RR={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`},zR=new Set([`c`,`cpp`,`css`,`go`,`html`,`java`,`js`,`jsx`,`md`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`svg`,`ts`,`tsx`]),BR=new Set([`graphql`,`json`,`toml`,`xml`,`yaml`,`yml`]),VR=new Set([`avif`,`bmp`,`gif`,`heic`,`heif`,`ico`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`]),HR=new Set([`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]),UR=new Set([`avi`,`m4v`,`mov`,`mp4`,`mkv`,`webm`,`wmv`]),WR=new Set([`doc`,`docx`,`odt`,`pages`,`rtf`,`txt`]),GR=new Set([`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]),KR=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]);function qR(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 JR(e,t){let n=YR(e);if(n)return n.toUpperCase();let r=(t.split(`/`)[1]??``).split(/[+.;-]/)[0]?.trim();return r?r.slice(0,6).toUpperCase():`FILE`}function YR(e){return/\.([a-z0-9]{1,12})$/i.exec(e.trim())?.[1]?.toLowerCase()??``}function XR(e){return typeof e==`string`&&/^data:image\//i.test(e.trim())}function ZR(e){return VR.has(e)?e===`jpg`||e===`jpeg`?`image/jpeg`:e===`svg`?`image/svg+xml`:`image/${e}`:HR.has(e)?e===`mp3`?`audio/mpeg`:e===`m4a`?`audio/mp4`:e===`weba`?`audio/webm`:`audio/${e}`:UR.has(e)?e===`mov`?`video/quicktime`:e===`m4v`?`video/mp4`:`video/${e}`:e===`pdf`?`application/pdf`:null}function QR(e){let t=YR(e);return t?ZR(t):null}function $R(e){let t=e.mimeType.trim().toLowerCase();return t.length>0&&t!==`application/octet-stream`?t:QR(e.label)}function ez(e){let t=e.mimeType.trim().toLowerCase(),n=YR(e.label);return e.isImage||t.startsWith(`image/`)||VR.has(n)||XR(e.dataUrl)}function tz(e,t){let n=YR(e),r=t.toLowerCase();return r.startsWith(`image/`)||VR.has(n)?`image`:r.startsWith(`audio/`)||HR.has(n)?`audio`:r.startsWith(`video/`)||UR.has(n)?`video`:r.includes(`pdf`)||n===`pdf`?`pdf`:KR.has(n)||/(zip|tar|gzip|rar|compressed|archive)/.test(r)?`archive`:GR.has(n)||/(spreadsheet|sheet|excel|csv)/.test(r)?`sheet`:BR.has(n)||/(json|xml|yaml|toml)/.test(r)?`data`:zR.has(n)||/(javascript|typescript|jsx|tsx|css|html)/.test(r)?`code`:WR.has(n)||/(msword|document|opendocument|rtf|text\/)/.test(r)?`document`:`generic`}function nz(e){let t=tz(e.label,e.mimeType),n=qR(e.sizeBytes);return{category:t,extension:JR(e.label,e.mimeType),sizeLabel:n}}var rz={archive:`Archive`,audio:`Audio`,code:`Code file`,data:`Data file`,document:`Document`,generic:`File`,image:`Image`,pdf:`PDF document`,sheet:`Spreadsheet`,video:`Video`},iz={archive:go,audio:_o,code:vo,data:bo,document:Xt,generic:Co,image:yo,pdf:Xt,sheet:xo,video:So};function az(e,t){return t?.attachmentCategoryLabels?.[e]??rz[e]}function oz(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 sz(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 cz(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}):sz(t,r,!1)}function lz({category:e,isUser:t}){let n=iz[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`:RR[e]),children:(0,F.jsx)(n,{className:R(`h-4 w-4`,t?`text-foreground/70`:`text-current`),strokeWidth:2})})}function uz(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)(lz,{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}),oz(r,i,a)]}),o]})})]})}function dz(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=$R(n);return(0,F.jsxs)(`div`,{className:o,children:[uz({category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:cz({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 fz({file:e,isUser:t=!1,texts:n,onOpen:r}){let{category:i,sizeLabel:a}=nz(e),o=ez(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)(hR,{alt:e.label,expandLabel:d,closeLabel:f,sizeLabel:a,src:e.dataUrl});if(s||c)return dz({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,shellClasses:m,actionLabel:u,onOpen:r});let h=uz({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,action:sz(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 pz({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)(fz,{file:a.file,isUser:n,texts:r,onOpen:i},`file-${t+e}`))})}function mz(e){return!!(e?.kind===`part`&&e.part.type===`file`&&e.part.file.isImage&&e.part.file.dataUrl)}function hz(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!mz(r)){r&&t.push(r),n+=1;continue}let i=n,a=[];for(;mz(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 gz(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 _z=10;function vz({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??_z),[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 yz=`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-current`,bz=`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 xz({children:e,className:t}){return(0,F.jsx)(`span`,{className:R(yz,t),children:e})}function Sz({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 Cz({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(bz,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 wz({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(bz,`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)(xz,{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)(ro,{className:R(`h-[1.05em] w-[1.05em] transition-transform`,n&&`rotate-90`),strokeWidth:2.25})})]})}function Tz(e,t,n){let r=Array.from(t).length;return(n??`${e} · {count}`).split(`{count}`).join(String(r))}function Ez({label:e,text:t,characterCountTemplates:n,isUser:r,isInProgress:i}){let{isOpen:a,onSummaryClick:o}=gz({isInProgress:i}),s=(0,P.useRef)(null),c=Tz(e,t,i?n?.inProgress:n?.completed),{onScroll:l}=vz({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)(wz,{openGroup:`reasoning`,open:a,icon:to,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 Dz({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 Oz({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 kz({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 Az={running:{text:`text-muted-foreground`,icon:gn,spin:!0},success:{text:`text-muted-foreground/75`,icon:Kt,spin:!1},error:{text:`text-destructive`,icon:ds,spin:!1},cancelled:{text:`text-muted-foreground/70`,icon:Wo,spin:!1}};function jz({card:e,iconOnly:t=!1}){let n=Az[e.statusTone]||Az.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 Mz(e){return e.kind===`show-content`?{icon:nn,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:Xa,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 Nz({action:e,onAction:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=Wh,o=Mz(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 Pz(e){return e.replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim()}function Fz(e,t){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),t())}function Iz({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 Lz({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)(ro,{className:R(`h-[1.05em] w-[1.05em] transition-transform`,e&&`rotate-90`),strokeWidth:2.25})})}function Rz({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 zz({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??Pz(e.toolName);return(0,F.jsxs)(Cz,{interactive:a,onClick:a?()=>c():void 0,role:a?`button`:void 0,tabIndex:a?0:void 0,onKeyDown:a?e=>Fz(e,c):void 0,children:[(0,F.jsx)(xz,{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)(Iz,{label:u,summary:l}),n?(0,F.jsx)(Rz,{...n}):null,(0,F.jsx)(jz,{card:e,iconOnly:!!t}),a?(0,F.jsx)(Lz,{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 Bz({action:e,onAction:t}){return(0,F.jsx)(Nz,{action:e,onAction:t})}var Vz=`font-mono text-[11px] leading-5`,Hz=`flex h-5 w-full ${Vz}`,Uz=`flex h-5 items-center justify-center px-2.5 tabular-nums select-none`;function Wz(e){let t=e.newLineNumber??e.oldLineNumber;return typeof t==`number`?String(t):``}function Gz(e,t,n){return`${e}-${n}-${t.oldLineNumber??`x`}-${t.newLineNumber??`x`}`}function Kz(e){return typeof e.newLineNumber==`number`||typeof e.oldLineNumber==`number`}function qz(e){return e.lines.some(Kz)}function Jz(e){let t=e.lines.reduce((e,t)=>Kz(t)?Math.max(e,Wz(t).length):e,0);return`${Math.max(6.5,Math.min(8,t+3.5))}ch`}function Yz(e){return`calc(${e.lines.reduce((e,t)=>Math.max(e,Math.max(1,t.text.length)),1)}ch + 1.25rem)`}function Xz(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 Zz(e){return e.languageHint?.trim()||Xz(e.path)||`text`}function Qz(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?`language-${t}`:`language-text`}function $z(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 tB({layout:e,line:t,lineNumberColumnWidth:n}){return(0,F.jsx)(`span`,{"data-file-line-number-cell":`true`,style:e===`compact`?{width:n,minWidth:n}:void 0,className:R(Uz,e===`compact`?`sticky left-0 z-[1]`:`w-full shrink-0`,$z(t)),children:Wz(t)})}function nB({language:e,line:t}){let n=(0,P.useMemo)(()=>VL.highlight(t.text||` `,e),[e,t.text]);return(0,F.jsx)(`span`,{"data-file-code-row":`true`,"data-file-code-language":n.language,"data-highlighted":n.highlighted?`true`:`false`,className:R(`chat-file-code-syntax hljs block min-w-0 flex-1 whitespace-pre px-2.5`,Qz(n.language),eB(t)),dangerouslySetInnerHTML:{__html:n.html}})}function rB({language:e,line:t,showLineNumbers:n,lineNumberColumnWidth:r}){return(0,F.jsxs)(`div`,{"data-file-line-row":`true`,className:Hz,children:[n?(0,F.jsx)(tB,{layout:`compact`,line:t,lineNumberColumnWidth:r}):null,(0,F.jsx)(nB,{language:e,line:t})]})}function iB({block:e}){let t=qz(e),n=Jz(e),r=Yz(e),i=Zz(e);return(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:[t?(0,F.jsxs)(`div`,{"data-file-code-gutter":`true`,style:{width:n,minWidth:n},className:R(`flex h-full min-h-full shrink-0 flex-col`,Vz),children:[e.lines.map((e,t)=>(0,F.jsx)(tB,{layout:`workspace`,line:e,lineNumberColumnWidth:n},Gz(`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:r},children:e.lines.map((e,t)=>(0,F.jsx)(`div`,{"data-file-code-canvas-row":`true`,className:Hz,children:(0,F.jsx)(nB,{language:i,line:e})},Gz(`code`,e,t)))}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 bg-card`})]})]})}function aB({block:e,layout:t=`compact`}){if(t===`workspace`)return(0,F.jsx)(iB,{block:e});let n=qz(e),r=Jz(e),i=Yz(e),a=n?`calc(${r} + ${i})`:i,o=Zz(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:a},children:e.lines.map((e,t)=>(0,F.jsx)(rB,{language:o,line:e,showLineNumbers:n,lineNumberColumnWidth:r},Gz(`row`,e,t)))})})}function oB({block:e}){return(0,F.jsx)(aB,{block:e,layout:`compact`})}function sB(e){return e.display===`preview`}function cB(e){return e.rawText?e.rawText:e.lines.map(e=>[e.kind,e.oldLineNumber??``,e.newLineNumber??``,e.text].join(`:`)).join(`
54
- `)}function lB(e){return/^\+\d+$/.test(e)?`text-emerald-700`:/^-\d+$/.test(e)?`text-rose-700`:`text-muted-foreground`}function uB(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(lB(e)),children:e})]},`${e}-${t}`))})}function dB(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 fB({children:e,contentVersion:t,resetKey:n,className:r,scrollKind:i}){let a=(0,P.useRef)(null),{onScroll:o}=vz({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 pB({block:e,showPathRow:t,isFirst:n,onFileOpen:r}){let{Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=Wh,c=sB(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(dB(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?uB(e.caption):null]}):null,e.lines.length>0?(0,F.jsx)(fB,{resetKey:`block:${e.key}`,contentVersion:cB(e),className:`max-h-72`,scrollKind:`block`,children:(0,F.jsx)(oB,{block:e})}):e.rawText?(0,F.jsx)(fB,{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 mB({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)(pB,{block:e,showPathRow:r,isFirst:t===0,onFileOpen:n},e.key)),a?(0,F.jsx)(fB,{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 hB=`\x1B`,gB=RegExp(`${hB}\\[(.*?)([ -/]*[@-~])`,`g`);function _B(e){return e.includes(`${hB}[`)}function vB(e){return e.replace(RegExp(`${hB}\\[[0-?]*[ -/]*[@-~]`,`g`),``)}function yB(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var bB={bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1},xB={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}},SB={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`},CB={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 wB(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 TB(e,t){let n={...e};for(let e=0;e<t.length;e+=1){let r=t[e];if(r===0)return{...bB};let i=xB[r];if(i){n={...n,...i};continue}if(r===38||r===48){let i=wB(t,e);i&&(n=r===38?{...n,fg:i.color}:{...n,bg:i.color},e+=i.consumed);continue}if(SB[r]){n={...n,fg:SB[r]};continue}CB[r]&&(n={...n,bg:CB[r]})}return n}function EB(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 DB(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 OB(e){let t=EB(e),n=DB(e);return n?`<span class="${t}" style="${n}">`:`<span class="${t}">`}function kB(e){if(!e)return``;if(!_B(e))return yB(e);let t=``,n=0,r={...bB},i=!1,a=e=>{e&&(i||=(t+=OB(r),!0),t+=yB(e))},o=()=>{i&&=(t+=`</span>`,!1)};return e.replace(gB,(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=TB(r,l.length>0?l:[0]),t}),a(e.slice(n)),o(),t}var AB=12e4;function jB(e){return e.length<=AB?e:`${e.slice(0,AB)}\n…`}function MB({code:e,language:t,preferAnsi:n=!1,className:r}){let i=jB(e),a=(0,P.useMemo)(()=>{if(n&&_B(i))return{html:kB(i),language:`ansi`,highlighted:!0};let e=vB(i);return VL.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 NB({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)(MB,{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)(MB,{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 PB=200;function FB(e){return typeof e==`string`&&e.length>0?e:null}function IB(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function LB(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 RB(e){let t=FB(e.aggregated_output)??FB(e.combinedOutput)??FB(e.output);if(t)return t;let n=FB(e.stdout),r=FB(e.stderr);return!n&&!r?null:[n,r].filter(e=>!!e).join(`
55
- `)}function zB(e,t){if(IB(t)){let e=RB(t);if(e)return e;if(LB(t))return``}if(!e)return``;let n=e.trim();if(!n.startsWith(`{`))return e;try{let t=JSON.parse(n);return IB(t)?RB(t)||(LB(t)?``:e):e}catch{return e}}function BB(e){return e===`write_file`||e===`edit_file`}function VB(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 HB({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},PB)),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 UB(e){return IB(e)?{exitCode:typeof e.exitCode==`number`?e.exitCode:typeof e.exit_code==`number`?e.exit_code:null,workingDir:FB(e.workingDir)??FB(e.cwd)??FB(e.working_directory)}:{}}function WB({card:e,toolLabel:t}){let n=zB(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=UB(e.outputData),{expanded:c,onToggle:l}=HB({canExpand:o,isRunning:r,autoExpandWhileRunning:!1,expandOnError:o,statusTone:e.statusTone});return(0,F.jsxs)(Dz,{children:[(0,F.jsx)(zz,{card:e,toolLabel:t,icon:us,expanded:c,canExpand:o,onToggle:l}),c&&(0,F.jsx)(Oz,{className:`bg-transparent py-0`,children:(0,F.jsx)(NB,{command:i,output:n,emptyLabel:e.emptyLabel,isRunning:r,hasOutput:a,isError:e.statusTone===`error`,exitCode:s.exitCode,workingDir:s.workingDir})})]})}function GB({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=BB(e.toolName)&&!(a&&e.toolName===`write_file`&&(u>24||d>1200)),{expanded:p,onToggle:m}=HB({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)(Dz,{children:[(0,F.jsx)(zz,{card:e,toolLabel:t,changeSummary:h?VB(l):void 0,icon:h?lo:Xt,expanded:p,canExpand:c||a,hideSummary:!1,onToggle:m}),p&&c?(0,F.jsxs)(Oz,{className:`bg-transparent py-0`,children:[s?(0,F.jsx)(kz,{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)(mB,{card:e,onFileOpen:n,showPathRow:!0}):null]}):null]})}function KB({card:e,toolLabel:t,icon:n=ot}){let r=e.statusTone===`running`,i=e.output?.trim()??``,{expanded:a,onToggle:o}=HB({canExpand:!!i||r,isRunning:r,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,F.jsxs)(Dz,{children:[(0,F.jsx)(zz,{card:e,toolLabel:t,icon:n,expanded:a,canExpand:!!i||r,onToggle:o}),a&&i&&(0,F.jsx)(Oz,{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 qB(e,t,n){let r=e.agentId&&n?n(e.agentId):null,i=e.action&&t?(0,F.jsx)(Bz,{action:e.action,onAction:t}):null;return r||i?(0,F.jsxs)(F.Fragment,{children:[r,i]}):void 0}function JB({card:e,toolLabel:t,icon:n=gs,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=qB(e,r,i),{expanded:f,onToggle:p}=HB({canExpand:u||s,isRunning:s,autoExpandWhileRunning:!1,statusTone:e.statusTone});return(0,F.jsxs)(Dz,{children:[(0,F.jsx)(zz,{card:e,toolLabel:t,icon:n,expanded:f,canExpand:u||s,actionSlot:d,onToggle:p}),f&&u?(0,F.jsxs)(Oz,{className:`bg-transparent py-0`,children:[c?(0,F.jsx)(kz,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:a}):null,c&&l?(0,F.jsx)(`div`,{className:`h-2`}):null,l?(0,F.jsx)(kz,{label:e.outputLabel?.trim()||`Output`,tone:e.statusTone===`error`?`error`:`output`,children:o}):null]}):null]})}function YB({card:e,onToolAction:t,renderPanelAppCard:n}){let{panelApp:r}=e;return r&&n?n(r):(0,F.jsx)(JB,{card:e,onToolAction:t})}function XB(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 ZB(e){let t=e.toLowerCase();return t===`read_file`||t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function QB(e){let t=e.toLowerCase();return t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function $B(e){let t=e.toLowerCase();return t===`grep_search`||t===`find_files`||t.includes(`search`)}var eV={list_dir:{statusKind:`directory`,icon:To},web_fetch:{statusKind:`web`,icon:mo},message:{statusKind:`message`,icon:ts},sessions_list:{statusKind:`session`,icon:un},sessions_history:{statusKind:`session`,icon:un},sessions_request:{statusKind:`session`,icon:un},spawn:{statusKind:`agent`,icon:Qa},sessions_spawn:{statusKind:`agent`,icon:Qa},subagents:{statusKind:`agent`,icon:Qa},memory_search:{statusKind:`memory`,icon:to},memory_get:{statusKind:`memory`,icon:to},cron:{statusKind:`schedule`,icon:no},gateway:{statusKind:`system`,icon:cn},view_image:{statusKind:`image`,icon:Mo},show_file:{statusKind:`display`,icon:nn},show_url:{statusKind:`display`,icon:nn},show_panel_app:{statusKind:`display`,icon:nn},show_content:{statusKind:`display`,icon:nn}};function tV(e){return eV[e.toLowerCase()]??null}function nV({card:e,toolStatusLabels:t,onToolAction:n,onFileOpen:r,renderToolAgent:i,renderPanelAppCard:a}){if(e.panelApp)return(0,F.jsx)(YB,{card:e,onToolAction:n,renderPanelAppCard:a});let o=tV(e.toolName),s=o?t?.builtIn?.[o.statusKind]?.[e.statusTone]:void 0;return XB(e.toolName)?(0,F.jsx)(WB,{card:e,toolLabel:t?.terminal[e.statusTone]}):ZB(e.toolName)?(0,F.jsx)(GB,{card:e,toolLabel:QB(e.toolName)?t?.fileEdit[e.statusTone]:t?.fileRead[e.statusTone],onFileOpen:r}):$B(e.toolName)?(0,F.jsx)(KB,{card:e,toolLabel:s??t?.search[e.statusTone],icon:o?.icon}):(0,F.jsx)(JB,{card:e,toolLabel:s,icon:o?.icon,onToolAction:n,renderToolAgent:i})}function rV({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)(wz,{openGroup:`tool-activity`,open:t,icon:hs,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)(Sz,{position:l===0?`first`:u?`last`:`middle`}):null,t.type===`tool-card`?(0,F.jsx)(nV,{card:t.card,toolStatusLabels:i,onToolAction:a,onFileOpen:o,renderToolAgent:s,renderPanelAppCard:c}):(0,F.jsx)(Ez,{label:t.label,text:t.text,characterCountTemplates:r,isUser:n,isInProgress:!1})]},`tool-group-item-${e.startIndex+l}`)})}):null]})}var iV=3;function aV(e){return e.type===`tool-card`}function oV(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 sV(e){return e===`error`?0:e===`cancelled`?1:e===`running`?2:3}function cV(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 lV(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 uV(e){let t=[],n=new Map;for(let[r,i]of e.entries()){let e=oV(i.toolName),a=cV(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)),sV(i.statusTone)<sV(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=sV(e.tone)-sV(n.tone);return r===0?t.indexOf(e.family)-t.indexOf(n.family):r}),r}function dV(e){let{labels:t,segments:n}=e;if(n.length===0)return``;let r=n.slice(0,iV),i=n.length-r.length,a=r.map(e=>lV(e,t));return i>0&&a.push(`+${i}`),a.join(` · `)}function fV(e,t){let n=[],r=0;for(;r<e.length;){let i=e[r];if(i.type!==`tool-card`){n.push({kind:`part`,key:`part-${r}`,index:r,part:i}),r+=1;continue}let a=r,o=[],s=-1;for(;r<e.length&&(e[r]?.type===`tool-card`||e[r]?.type===`reasoning`);){let t=e[r];o.push(t),t.type===`tool-card`&&(s=o.length-1),r+=1}let c=o.filter(aV);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=uV(c.map(e=>e.card)),d=dV({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 pV={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 mV(e){return{segmentTemplates:{...pV.segmentTemplates,...e.toolActivitySegmentTemplates??{}},failedLabel:e.toolActivityFailedLabel??pV.failedLabel,cancelledLabel:e.toolActivityCancelledLabel??pV.cancelledLabel}}function hV(e){return e===`pending`||e===`streaming`}function gV(e){return e.type===`reasoning`||e.type===`tool-card`}function _V(e){if(e.role!==`assistant`||!e.processSummary||hV(e.status))return null;let t=-1;for(let n=e.parts.length-1;n>=0;--n)if(gV(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 vV({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:t,text:n}=c;return(0,F.jsx)(LR,{text:n,role:p,texts:m,inlineTokens:t,onFileOpen:a,onInlineTokenClick:o,resolveFileContentUrl:f,renderInlineDisplay:l},`markdown-${e}`)}if(h===`reasoning`){let{label:i,text:a}=c;return(0,F.jsx)(Ez,{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)(Sz,{position:`single`}),(0,F.jsx)(nV,{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)(fz,{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 yV(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 hz(fV(l,mV(h))).map(e=>e.kind===`image-group`?(0,F.jsx)(pz,{group:e,indexOffset:g,isUser:n,texts:h,onOpen:r},`${e.key}-${g}`):e.kind===`tool-group`?(0,F.jsx)(rV,{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):vV({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 bV=(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=hV(t.status),h=_V(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)(wz,{openGroup:`process`,open:g,icon:Io,leadingIconClassName:`bg-card`,label:t.processSummary?.label,onClick:()=>_(e=>!e)})}),g?(0,F.jsx)(`div`,{className:`space-y-0`,children:yV({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]}),yV({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})]}):yV({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 xV({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}=XI({text:n});return n?(0,F.jsx)(`button`,{type:`button`,onClick:()=>void i(),className:`text-muted-foreground hover:text-foreground transition-colors p-1 rounded-md hover:bg-accent flex items-center justify-center`,"aria-label":r?t.copiedMessageLabel:t.copyMessageLabel,title:r?t.copiedMessageLabel:t.copyMessageLabel,children:r?(0,F.jsx)(Kt,{className:`h-3.5 w-3.5`}):(0,F.jsx)(uo,{className:`h-3.5 w-3.5`})}):null}var SV=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g,CV=`
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 wV(e){let t=e.trim();return t?t.replace(SV,``).trim().length>0:!1}function TV(e){return e.parts.some(e=>e.type===`markdown`||e.type===`reasoning`?wV(e.text):!0)}function EV(){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 DV({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:CV}),(0,F.jsx)(`span`,{className:`nextclaw-chat-typing-indicator__text`,children:e})]})}function OV({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(TV),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)(bV,{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)(XE,{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)(EV,{})}):(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)(xV,{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)(XE,{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)(EV,{}):(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]}),t?null:(0,F.jsx)(xV,{message:e,texts:f})]})})]}),t?(0,F.jsx)(XE,{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)(XE,{role:`assistant`,size:n===`flat`?`compact`:`default`}),(0,F.jsx)(DV,{label:f.typingLabel,layout:n})]}):null]})}function kV(e){return{key:e.key,triggerSpecs:[e.trigger],resolvePanel:t=>t.trigger.key===e.trigger.key?e.resolvePanel(t):null}}function AV(e){return kV({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 jV(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 MV=[`cmd`,`command`,`query`,`q`,`path`,`url`,`to`,`channel`,`agentId`,`sessionKey`];function NV(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function PV(e,t=2400){return e.length<=t?e:`${e.slice(0,t)}\n…`}function FV(e,t=120){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:t<=1?`…`:`${n.slice(0,t-1)}…`}function IV(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(e==null)return``;try{return PV(JSON.stringify(e,null,2))}catch{return String(e)}}function LV(e){if(NV(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 NV(e)?e:null}catch{return null}}function RV(e){let t=LV(e);if(!t){let t=IV(e).trim();return t?FV(t,120):void 0}let n=[];for(let e of MV){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?FV(n.join(` · `),120):FV(IV(t),140)}var zV=`ui_inline_tokens`,BV=`$`,VV=`@panel-app:`,HV=/@panel-app:([A-Za-z0-9_-]+)/g;function UV(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function WV(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function GV(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 KV(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:`${BV}${n.tokenKey}`});return GV(t)}function qV(e){let t=[];for(let n of e.matchAll(HV)){let e=n[1];e&&t.push({kind:`panel_app`,key:e,label:e,rawText:`${VV}${e}`})}return GV(t)}function JV(e,t){return GV([...t,...qV(e)])}function YV(e){let t=e?.[zV];if(!Array.isArray(t))return[];let n=[];for(let e of t){if(!UV(e))continue;let t=WV(e.kind),r=WV(e.key),i=WV(e.rawText);!t||!r||!i||n.push({kind:t,key:r,rawText:i,label:WV(e.label)??r})}return GV(n)}var XV=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g;function ZV(e){let t=e.trim();return t&&t.replace(XV,``).trim()?t:null}function QV(e,t){let n=ZV(e.text);if(!n)return null;let r=JV(e.text,t);return{type:`markdown`,text:n,inlineTokens:r.length>0?r:void 0}}function $V(e){return ZV(e)}function eH(e){return typeof e==`object`&&!!e}function tH(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function nH(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 rH(e){return eH(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 iH(e,t){if(!eH(e))return null;let n=eH(e.asset)?e.asset:Array.isArray(e.assets)&&e.assets.length>0&&eH(e.assets[0])?e.assets[0]:null;if(!n)return null;let r=tH(n.url),i=tH(n.mimeType)??`application/octet-stream`,a=nH(n.sizeBytes);return r?{type:`file`,file:{label:tH(n.name)??(i.startsWith(`image/`)?t.imageAttachmentLabel:t.fileAttachmentLabel),mimeType:i,dataUrl:r,...a==null?{}:{sizeBytes:a},isImage:i.startsWith(`image/`)}}:null}function aH(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 oH(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 sH(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 cH(e,t){return IV(t??sH(e)).trim()||void 0}function lH(e){return typeof e==`object`&&!!e}function uH(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 dH(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function fH(e){let t=uH(e);return lH(t)?dH(t.agentId):null}function pH(e){return fH(e.parsedArgs)??fH(e.args)??fH(e.result)}var mH=12e3,hH=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function gH(e){let t=e.replace(/\r\n/g,`
95
- `).replace(/\r/g,`
96
- `);return t===``?[]:t.split(`
97
- `)}function _H(e){return typeof e==`number`?e+1:void 0}function vH(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 yH(e){let t=hH.exec(e);return t?{oldLineNumber:Number(t[1]),newLineNumber:Number(t[2])}:null}function bH(e){let{kind:t,newStartLine:n,oldStartLine:r,text:i}=e;return gH(i).map((e,i)=>vH(t===`add`?{kind:`add`,text:e,newLineNumber:n+i}:{kind:`context`,text:e,oldLineNumber:r+i,newLineNumber:n+i}))}function xH(e){let{afterLines:t,beforeLines:n,newStartLine:r,oldStartLine:i}=e,a=i,o=r;return[...n.map(e=>{let t=vH({kind:`remove`,text:e,oldLineNumber:a});return a=_H(a),t}),...t.map(e=>{let t=vH({kind:`add`,text:e,newLineNumber:o});return o=_H(o),t})]}function SH(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 CH(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(vH({kind:`remove`,text:i[e]??``,oldLineNumber:c})),c=_H(c);for(let e=t;e<n.length;e+=1)a.push(vH({kind:`add`,text:n[e]??``,newLineNumber:l})),l=_H(l)}function wH(e){let{afterText:t,beforeText:n,newStartLine:r,oldStartLine:i}=e,a=gH(n),o=gH(t);if(a.length*o.length>mH)return xH({beforeLines:a,afterLines:o,oldStartLine:i,newStartLine:r});let s=SH({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(vH({kind:`context`,text:a[l]??``,oldLineNumber:d,newLineNumber:f})),l+=1,u+=1,d=_H(d),f=_H(f);continue}if((s[l+1][u]??0)>=(s[l][u+1]??0)){c.push(vH({kind:`remove`,text:a[l]??``,oldLineNumber:d})),l+=1,d=_H(d);continue}c.push(vH({kind:`add`,text:o[u]??``,newLineNumber:f})),u+=1,f=_H(f)}return CH({lines:c,beforeLines:a,afterLines:o,beforeIndex:l,afterIndex:u,oldLineNumber:d,newLineNumber:f}),c}var TH=120;function EH(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 DH(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 OH(e){return e.length<=TH?{lines:e,truncated:!1}:{lines:e.slice(0,TH),truncated:!0}}function kH(e){let{lines:t,operation:n,path:r}=e,i=OH(t);return{path:r,display:`diff`,caption:EH({operation:n,lines:t}),lines:i.lines,...i.truncated?{fullLines:t}:{},truncated:i.truncated}}function AH(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=bH({text:o,kind:s,oldStartLine:c,newStartLine:l});return{path:i,display:`preview`,caption:EH({operation:r,lines:u}),lines:u,rawText:o,oldStartLine:c,newStartLine:l}}function jH(e){let{afterText:t,beforeText:n,operation:r,path:i}=e,{oldStartLine:a,newStartLine:o}=DH(e),s=wH({beforeText:n??``,afterText:t??``,oldStartLine:a,newStartLine:o}),c=OH(s);return c.lines.length===0?null:{path:i,display:`diff`,caption:EH({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 MH(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 NH(e){let{currentLines:t,line:n,newLineNumber:r,oldLineNumber:i}=e;return n.startsWith(`+`)?(t.push(vH({kind:`add`,text:n.slice(1),newLineNumber:r})),{oldLineNumber:i,newLineNumber:_H(r)}):n.startsWith(`-`)?(t.push(vH({kind:`remove`,text:n.slice(1),oldLineNumber:i})),{oldLineNumber:_H(i),newLineNumber:r}):n.startsWith(` `)?(t.push(vH({kind:`context`,text:n.slice(1),oldLineNumber:i,newLineNumber:r})),{oldLineNumber:_H(i),newLineNumber:_H(r)}):{oldLineNumber:i,newLineNumber:r}}function PH(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(kH({path:n,operation:r,lines:i})),n=null,r=null,i=[],a=void 0,o=void 0};for(let t of gH(e)){if(MH({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=yH(t);a=e?.oldLineNumber,o=e?.newLineNumber;continue}if(!n)continue;let e=NH({currentLines:i,line:t,oldLineNumber:a,newLineNumber:o});a=e.oldLineNumber,o=e.newLineNumber}return s(),t}function FH(e){let t=[],n=null,r=[],i,a,o=()=>{if(!n){r=[],i=void 0,a=void 0;return}t.push(kH({path:n,operation:`update`,lines:r})),n=null,r=[],i=void 0,a=void 0};for(let t of gH(e)){if(t.startsWith(`+++ `)){o(),n=t.slice(4).trim().replace(/^b\//,``).replace(/^a\//,``);continue}if(t.startsWith(`--- `))continue;if(t.startsWith(`@@`)){let e=yH(t);i=e?.oldLineNumber,a=e?.newLineNumber;continue}if(!n)continue;let e=NH({currentLines:r,line:t,oldLineNumber:i,newLineNumber:a});i=e.oldLineNumber,a=e.newLineNumber}return o(),t}function IH(e){return e.includes(`*** Begin Patch`)?PH(e):e.includes(`--- `)&&e.includes(`+++ `)?FH(e):[]}function LH(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 RH(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 zH(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+=LH(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 BH(e,t,n=1/0){for(let r of t){let t=RH(e,r);if(t!=null)return zH(e,t,n)}return null}function VH(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 HH(e){return typeof e==`string`&&e.trim()?e.trim():null}function UH(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:typeof e==`string`&&/^\d+$/.test(e.trim())?Number(e.trim()):null}function WH(e){if(VH(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 VH(e)?e:null}catch{return null}}function GH(e){if(VH(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`))return null;let n=BH(t,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`])?.value??null,r=BH(t,[`content`,`text`,`afterText`,`after_text`])?.value??null,i=BH(t,[`oldText`,`beforeText`,`before_text`])?.value??null,a=BH(t,[`newText`,`afterText`,`after_text`])?.value??null,o=BH(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 KH(e){return HH(e.path)??HH(e.filePath)??HH(e.file_path)??HH(e.targetPath)??HH(e.target_path)??HH(e.filename)??HH(e.name)}function qH(e){return $(e.operation)??$(e.op)??$(e.action)??$(e.kind)??$(e.type)??$(e.status)}function JH(e,t){for(let n of t){let t=UH(e[n]);if(t!==null)return t}return null}function YH(e){return JH(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 XH(e){return JH(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 ZH(e){return $(e.patch)??$(e.diff)??$(e.unifiedDiff)??$(e.unified_diff)}function QH(e){return $(e.beforeText)??$(e.before_text)??$(e.oldText)??$(e.old_text)??$(e.oldContent)??$(e.old_content)??$(e.before)??$(e.previous)}function $H(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 eU=new Set([`file_change`,`read_file`,`write_file`,`edit_file`,`apply_patch`]);function tU(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 nU(e,t){let n=KH(e)??t,r=qH(e),i=YH(e),a=XH(e),o=ZH(e);if(o){let e=IH(o);if(e.length>0)return e[0]??null}let s=QH(e),c=$H(e);if(s!=null||c!=null)return jH({path:n,beforeText:s,afterText:c,operation:r,oldStartLine:i,newStartLine:a});let l=$(e.preview);return l?AH({path:n,text:l,operation:r,oldStartLine:i,newStartLine:a}):null}function rU(e){if(!Array.isArray(e))return[];let t=[];return e.forEach((e,n)=>{if(typeof e==`string`){let n=IH(e);n.length>0&&t.push(...n);return}if(!VH(e))return;let r=nU(e,KH(e)??`file-${n+1}`);if(r){t.push(r);return}let i=Array.isArray(e.changes)?rU(e.changes):[];i.length>0&&t.push(...i)}),t}function iU(e){let t=WH(e.result)??WH(e.parsedArgs)??WH(e.args);return t?tU(rU(t.changes)):null}function aU(e){let t=WH(e.parsedArgs)??WH(e.args)??GH(e.args),n=t&&KH(t),r=$(e.result);return!n||!r?null:tU([AH({path:n,text:r,operation:`read`})].filter(e=>!!e))}function oU(e){if(e.status===`partial-call`&&typeof e.args==`string`){let t=BH(e.args,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`]),n=BH(e.args,[`content`,`text`,`afterText`,`after_text`]);if(t?.value&&n?.value){let e=AH({path:t.value,text:n.value,operation:`write`});if(e)return tU([e])}}let t=WH(e.parsedArgs)??WH(e.args)??GH(e.args);if(!t)return null;let n=KH(t),r=$(t.content);return!n||!r?null:tU([AH({path:n,text:r,operation:`write`})].filter(e=>!!e))}function sU(e){let t=WH(e.result),n=WH(e.parsedArgs)??WH(e.args)??GH(e.args);if(!t&&!n)return null;let r=(t?KH(t):null)??(n?KH(n):null),i=(t?QH(t):null)??(n?QH(n):null),a=(t?$H(t):null)??(n?$H(n):null),o=(t?YH(t):null)??(n?YH(n):null),s=(t?XH(t):null)??(n?XH(n):null);return!r||i==null&&a==null?null:tU([jH({path:r,beforeText:i,afterText:a,operation:`edit`,oldStartLine:o,newStartLine:s})].filter(e=>!!e))}function cU(e){let t=WH(e.parsedArgs),n=WH(e.args)??GH(e.args),r=$(e.args)??(t?$(t.patch):null)??(n?$(n.patch):null);return r?tU(IH(r)):null}function lU(e){return eU.has(e.toolName)?e.toolName===`file_change`?iU(e):e.toolName===`read_file`?aU(e):e.toolName===`write_file`?oU(e):e.toolName===`edit_file`?sU(e):e.toolName===`apply_patch`?cU(e):null:null}var uU=[`show_content`,`show_file`,`show_url`,`show_panel_app`];function dU(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function fU(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function pU(e){return Number.isInteger(e)&&typeof e==`number`&&e>0?e:void 0}function mU(e){return e===`file`||e===`url`||e===`panel_app`?e:null}function hU(e){return e===`read`||e===`preview`||e===`edit`||e===`interact`?e:void 0}function gU(e){return e===`inline`||e===`side_panel`?e:void 0}function _U(e){return e===`auto`||e===`source`||e===`rendered`?e:void 0}function vU(e){if(!dU(e)||!dU(e.target))return null;let{target:t}=e,{payload:n,type:r}=t,i=mU(r);if(!i||!dU(n))return null;let a=fU(e.title),o=hU(e.purpose),s=gU(e.placement);if(i===`file`){let e=fU(n.path);return e?{target:{type:`file`,payload:{path:e,line:pU(n.line),column:pU(n.column),viewer:_U(n.viewer)}},title:a,purpose:o,placement:s}:null}if(i===`url`){let e=fU(n.url);return e?{target:{type:`url`,payload:{url:e}},title:a,purpose:o,placement:s}:null}let c=fU(n.appId);return c?{target:{type:`panel_app`,payload:{appId:c}},title:a,purpose:o,placement:s}:null}function yU(e){return!dU(e)||e.action!==`showContent`?null:vU(e.request)}function bU(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 xU(e){let{actionLabel:t,invocation:n,statusLabel:r}=e;if(!uU.includes(n.toolName))return null;let i=yU(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:bU(i),text:void 0,outputData:n.result,hasResult:!0,statusTone:`success`,statusLabel:r,action:a,...o?{panelApp:o}:{}}}function SU(e){return typeof e==`object`&&!!e}function CU(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function wU(e){return!SU(e)||e.kind!==`nextclaw.session_request`?null:e}function TU(e){return!SU(e)||e.kind!==`nextclaw.session`?null:e}function EU(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 DU(e){return IV(EU(e)).trim()||void 0}function OU(e,t){return[CU(e.title)?`title: ${e.title?.trim()}`:null,CU(e.sessionId)?`session: ${e.sessionId?.trim()}`:null,CU(e.task)?`task: ${e.task?.trim()}`:null].filter(e=>!!e).join(` · `)||RV(t)}function kU(e,t){return[CU(e.title)?`title: ${e.title?.trim()}`:null,CU(e.sessionId)?`session: ${e.sessionId?.trim()}`:null].filter(e=>!!e).join(` · `)||RV(t)}function AU(e){let t=CU(e.requestId),n=CU(e.sessionId),r=CU(e.title),i=CU(e.task),a=CU(e.status),o=CU(e.notify),s=CU(e.lifecycle),c=CU(e.parentSessionId),l=CU(e.spawnedByRequestId),u=e.message===void 0?``:IV(e.message).trim(),d=e.finalResponseText===void 0?``:IV(e.finalResponseText).trim(),f=e.error===void 0?``:IV(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 jU(e){let t=CU(e.sessionId),n=CU(e.title),r=CU(e.sessionType),i=CU(e.lifecycle),a=CU(e.parentSessionId),o=CU(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 MU(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=wU(o);if(s){let e=CU(s.status)?.toLowerCase(),t=OU(s,a),o=AU(s),c=CU(s.sessionId),l=pH({args:a,result:s}),u=c?{kind:`open-session`,sessionId:c,sessionKind:s.isChildSession===!0?`child`:`session`,...l?{agentId:l}:{},...CU(s.title)?{label:s.title.trim()}:{},...CU(s.parentSessionId)?{parentSessionId:s.parentSessionId.trim()}:{}}:void 0;return e===`failed`?{kind:`result`,name:r,detail:t,input:DU(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:DU(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:DU(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`running`,statusLabel:n.toolStatusRunningLabel,...l?{agentId:l}:{},...u?{action:u}:{}}}let c=TU(o);if(!c)return null;let l=kU(c,a),u=jU(c),d=CU(c.sessionId),f=pH({args:a,result:c}),p=d?{kind:`open-session`,sessionId:d,sessionKind:c.isChildSession===!0?`child`:`session`,...f?{agentId:f}:{},...CU(c.title)?{label:c.title.trim()}:{},...CU(c.parentSessionId)?{parentSessionId:c.parentSessionId.trim()}:{}}:void 0;return{kind:`result`,name:r,detail:l,input:DU(a),text:u,callId:i||void 0,hasResult:!!u,statusTone:`success`,statusLabel:n.toolStatusCompletedLabel,...f?{agentId:f}:{},...p?{action:p}:{}}}function NU(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 PU(e,t){let n=$V(e.reasoning);return n?{type:`reasoning`,text:n,label:t.reasoningLabel}:null}function FU(e,t){let n=e.mimeType.startsWith(`image/`),r=nH(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 IU(e,t){let n=e.toolInvocation,r=iH(n.result,t);if(r)return r;let i=MU({invocation:n,texts:{toolStatusRunningLabel:t.toolStatusRunningLabel,toolStatusCompletedLabel:t.toolStatusCompletedLabel,toolStatusFailedLabel:t.toolStatusFailedLabel}});if(i)return{type:`tool-card`,card:aH(i,t)};let a=xU({invocation:n,actionLabel:t.showContentActionLabel??`Show content`,statusLabel:t.toolStatusCompletedLabel});if(a)return{type:`tool-card`,card:aH(a,t)};let o=oH({status:n.status,error:n.error,cancelled:n.cancelled,result:n.result,texts:t}),s=NU(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??RV(n.parsedArgs??n.args),d=l?void 0:cH(n.args,n.parsedArgs),f=c||(typeof n.error==`string`&&n.error.trim()?n.error.trim():n.result==null?``:IV(n.result).trim()),p=!n.error&&rH(n.result),m=(!l?.fileOperation||!!n.error)&&!p,h=pH(n);return{type:`tool-card`,card:aH({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 LU(e,t){return{type:`unknown`,label:t.unknownPartLabel,rawType:typeof e.type==`string`?e.type:`unknown`,text:IV(e)}}function RU(e){return e.type===`text`&&typeof e.text==`string`}function zU(e){return e.type===`reasoning`&&typeof e.reasoning==`string`}function BU(e){return e.type===`file`&&typeof e.mimeType==`string`&&typeof e.data==`string`}function VU(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 HU(e){let{inlineTokens:t,part:n,texts:r}=e;return RU(n)?QV(n,t):zU(n)?PU(n,r):BU(n)?FU(n,r):VU(n)?IU(n,r):LU(n,r)}function UU(e){let t=e.meta?.timestamp;return t&&Number.isFinite(Date.parse(t))?t:new Date().toISOString()}function WU(e,t){return e===`user`?t.user:e===`assistant`?t.assistant:e===`tool`?t.tool:e===`system`?t.system:t.fallback}function GU(e){return e===`user`||e===`assistant`||e===`tool`||e===`system`?e:`message`}function KU(e,t){return{id:e.id,role:GU(e.role),roleLabel:WU(e.role,t.texts.roleLabels),timestampLabel:t.formatTimestamp(UU(e)),status:e.meta?.status,processSummary:e.meta?.processSummary,parts:e.parts.map(n=>HU({part:n,inlineTokens:e.meta?.inlineTokens??[],texts:t.texts})).filter(e=>e!==null)}}function qU(e){return e.type===`reasoning`||e.type===`tool-invocation`}function JU(e){return e.type===`text`||e.type===`rich-text`?e.text.trim().length>0:e.type===`file`||e.type===`source`||e.type===`card`}function YU(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&&qU(r)){t=n;break}}return t>=0&&t<e.parts.length-1&&e.parts.slice(t+1).some(JU)}function XU(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 ZU({message:e,processedLabel:t}){if(!YU(e))return;let n=XU(e);return{label:n?`${t} ${n}`:t}}function QU(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 $U(){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 eW(e){return{copyCodeLabel:f(`chatCodeCopy`),copiedCodeLabel:f(`chatCodeCopied`),copyMessageLabel:f(`chatMessageCopy`),copiedMessageLabel:f(`chatMessageCopied`),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:$U()},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 tW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function nW(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=Math.trunc(e);return t>=0?t:null}function rW(e){return e===!0}function iW(e){let t=e;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,r=nW(n.usedContextTokens),i=nW(n.totalContextTokens),a=nW(n.prunedUsedContextTokens),o=tW(n.updatedAt);if(r===null||i===null||a===null||!o)return null;let s=nW(n.compactedUsedContextTokens);return{usedContextTokens:r,totalContextTokens:i,prunedUsedContextTokens:a,availableContextTokens:nW(n.availableContextTokens)??Math.max(0,i-r),droppedHistoryCount:nW(n.droppedHistoryCount)??0,truncatedToolResultCount:nW(n.truncatedToolResultCount)??0,truncatedSystemPrompt:rW(n.truncatedSystemPrompt),truncatedUserMessage:rW(n.truncatedUserMessage),compacted:rW(n.compacted),...tW(n.checkpointId)?{checkpointId:tW(n.checkpointId)??void 0}:{},compactedMessageCount:nW(n.compactedMessageCount)??0,...s===null?{}:{compactedUsedContextTokens:s},updatedAt:o}}function aW(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=tW(n.id),i=n.status===`compressing`?`compressing`:n.status===`compressed`?`compressed`:null,a=tW(n.summary),o=nW(n.coveredMessageCount),s=nW(n.coveredSessionMessageCount),c=nW(n.originalEstimatedTokens),l=nW(n.projectedEstimatedTokens),u=tW(n.createdAt),d=tW(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 oW({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`)} ${cW(t.lastOpenedAt)}`:`${f(`panelAppsUpdated`)} ${cW(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)(lW,{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)(ls,{className:t.favorite?`h-4 w-4 fill-current text-foreground`:`h-4 w-4`})}),(0,F.jsxs)(Xe,{open:o,onOpenChange:s,children:[(0,F.jsx)(Ge,{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)(ft,{className:`h-4 w-4`})})}),(0,F.jsx)(Je,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,F.jsx)(sW,{destructive:!0,disabled:e,icon:xn,label:f(`panelAppsDelete`),onClick:m})})]})]})]}),(0,F.jsx)(it,{open:c,onOpenChange:l,title:f(`panelAppsDeleteConfirmTitle`),description:`${f(`panelAppsDeleteConfirmDescription`)} ${t.fileName}`,confirmLabel:f(`delete`),variant:`destructive`,onConfirm:r,onCancel:()=>void 0})]})}function sW({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 cW(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 lW({icon:e,title:t}){return e?uW(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)(Ja,{className:`h-4 w-4`})}function uW(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}var dW=[`panel-apps`];function fW(e={}){return T({queryKey:dW,queryFn:()=>ve.panelApps.listPanelApps(),enabled:e.enabled??!0,staleTime:0})}function pW(){let e=fe();return je({mutationFn:({id:e,preferences:t})=>ve.panelApps.updatePanelAppPreferences(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:dW})}})}function mW(){let e=fe();return je({mutationFn:e=>ve.panelApps.recordPanelAppOpened(e),onSuccess:()=>{e.invalidateQueries({queryKey:dW})}})}function hW(){let e=fe();return je({mutationFn:e=>ve.panelApps.grantClient(e),onSuccess:()=>{e.invalidateQueries({queryKey:dW})}})}function gW(){let e=fe();return je({mutationFn:e=>ve.panelApps.deletePanelApp(e),onSuccess:()=>{e.invalidateQueries({queryKey:dW})}})}function _W(e,t){return t===`favorites`?vW(e.filter(e=>e.favorite),`smart`):vW(t===`recent-open`?e.filter(e=>e.lastOpenedAt):e,t)}function vW(e,t){return[...e].sort((e,n)=>yW(e,n,t))}function yW(e,t,n){return n===`recent-open`?CW(e.lastOpenedAt,t.lastOpenedAt)||bW(e,t):n===`updated`?CW(e.updatedAt,t.updatedAt)||bW(e,t):n===`name`?bW(e,t):xW(e,t)||Number(t.favorite)-Number(e.favorite)||bW(e,t)}function bW(e,t){return e.title.localeCompare(t.title)}function xW(e,t){return SW(t)-SW(e)}function SW(e){return Math.max(new Date(e.lastOpenedAt??0).getTime(),new Date(e.createdAt).getTime(),new Date(e.updatedAt).getTime())}function CW(e,t){return new Date(t??0).getTime()-new Date(e??0).getTime()}var wW=[];function TW({headerContent:e,onOpenPanelApp:t}){let n=fW(),r=gW(),i=pW(),a=mW(),o=hW(),s=B0(),c=ui(),[l,u]=(0,P.useState)(`smart`),d=n.data?.entries??wW,p=(0,P.useMemo)(()=>_W(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)(xt,{delayDuration:250,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{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)(oo,{className:`h-3.5 w-3.5`})})}),(0,F.jsx)(vt,{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)(vn,{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)(dn,{value:l,onValueChange:e=>u(e),children:(0,F.jsxs)(ln,{className:`grid h-auto w-full grid-cols-5 rounded-lg bg-muted/70 p-0.5`,children:[(0,F.jsx)(sn,{value:`smart`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortSmart`)}),(0,F.jsx)(sn,{value:`favorites`,className:`px-2 py-1 text-xs`,children:f(`panelAppsFavorites`)}),(0,F.jsx)(sn,{value:`recent-open`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortRecentOpen`)}),(0,F.jsx)(sn,{value:`updated`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortUpdated`)}),(0,F.jsx)(sn,{value:`name`,className:`px-2 py-1 text-xs`,children:f(`panelAppsSortName`)})]})})}),d.length===0?(0,F.jsx)(EW,{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)(oW,{entry:e,deletePending:r.isPending,favoritePending:i.isPending,onDelete:()=>_(e),onOpen:()=>void m(e),onToggleFavorite:()=>g(e)},e.id))})})]})}function EW({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)(Ja,{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)(DW,{icon:(0,F.jsx)(Vo,{className:`h-4 w-4`}),title:f(`panelAppsEmptyAskTitle`),description:f(`panelAppsEmptyAskDescription`),actionLabel:f(`panelAppsEmptyAskAction`),onAction:e}),(0,F.jsx)(DW,{icon:(0,F.jsx)(vo,{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)(vn,{className:`h-3.5 w-3.5`}),f(`panelAppsRefresh`)]})]})})}function DW({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 OW=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 ve.serviceApps.listServiceActions({bridgeSessionToken:e.token});case`requestGrant`:return await this.confirmAndGrant(e,this.requireActionId(t));case`revokeGrant`:return await ve.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 ve.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}catch(r){if(!(r instanceof A)||r.code!==`AUTHORIZATION_REQUIRED`)throw r;return await this.confirmAndGrant(e,n,this.readOptionalRecord(t.payload?.input)),await ve.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}},this.sendAgentMessageWithAuthorization=async(e,t)=>{try{return await ve.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof A)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:send`),await ve.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}},this.generateAgentObjectWithAuthorization=async(e,t)=>{try{return await ve.panelApps.generateAgentObject(this.readGenerateObjectRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof A)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:generateObject`),await ve.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 A({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});return await ve.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 A({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});let i=await ve.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 ve.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 A?{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 kW(e,t){let n=t.trim();return[e.id,e.appId,e.fileName,e.title].some(e=>e.trim()===n)}function AW(e,t){let n=t.trim();return n?e.find(e=>kW(e,n))??null:null}var jW=`allow-scripts allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-downloads allow-pointer-lock allow-presentation`;function MW(e){e?.focus({preventScroll:!0}),e?.contentWindow?.focus()}function NW(){return`service-action-auth-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}var PW=p((e,t)=>({pending:null,requestAuthorization:async n=>await new Promise(r=>{t().pending?.resolve(!1),e({pending:{id:NW(),...n,resolve:r}})}),resolveAuthorization:n=>{let{pending:r}=t();r&&(r.resolve(n),e({pending:null}))}}));function FW(){let e=PW(e=>e.pending),t=PW(e=>e.resolveAuthorization);return(0,F.jsx)(et,{open:!!e,onOpenChange:e=>{e||t(!1)},children:(0,F.jsxs)(nt,{className:`[&>:last-child]:hidden`,children:[(0,F.jsxs)(tt,{children:[(0,F.jsxs)(rt,{className:`flex items-center gap-2`,children:[(0,F.jsx)(rs,{className:`h-4 w-4 text-amber-600`}),f(`serviceActionAuthorizationTitle`)]}),(0,F.jsx)($e,{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)(LW,{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)(IW,{action:e},e.actionId))})]}),e.inputPreview?(0,F.jsx)(LW,{label:f(`serviceActionAuthorizationInput`),value:e.inputPreview}):null]}):null,(0,F.jsxs)(Qe,{className:`gap-2 sm:gap-0`,children:[(0,F.jsx)(C,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:f(`serviceActionAuthorizationReject`)}),(0,F.jsx)(C,{type:`button`,onClick:()=>t(!0),children:f(`serviceActionAuthorizationAllow`)})]})]})})}function IW({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 LW({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 RW=class{constructor(){this.requestAuthorization=async e=>await PW.getState().requestAuthorization(e)}},zW=[`service-apps`],BW=[`service-actions`],VW=[`service-action-grants`];function HW(){return T({queryKey:zW,queryFn:()=>ve.serviceApps.listServiceApps()})}function UW(){return T({queryKey:BW,queryFn:()=>ve.serviceApps.listServiceActions()})}function WW(){return T({queryKey:VW,queryFn:()=>ve.serviceApps.listServiceActionGrants()})}function GW(){let e=fe();return je({mutationFn:e=>ve.serviceApps.restartServiceApp(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:zW}),e.invalidateQueries({queryKey:BW})])}})}function KW(){let e=fe();return je({mutationFn:e=>ve.serviceApps.deleteServiceApp(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:zW}),e.invalidateQueries({queryKey:BW}),e.invalidateQueries({queryKey:VW})])}})}function qW(){let e=fe();return je({mutationFn:e=>ve.serviceApps.discoverServiceAppActions(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:zW})}})}function JW(){let e=fe();return je({mutationFn:e=>ve.serviceApps.revokeServiceActionGrant(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:BW}),e.invalidateQueries({queryKey:VW})])}})}function YW({headerContent:e}){let t=HW(),n=UW(),r=WW(),i=KW(),a=GW(),o=qW(),s=JW(),[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)(ns,{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)(xt,{delayDuration:250,children:(0,F.jsx)($W,{icon:vn,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)(ns,{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)(XW,{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 XW({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)(xt,{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)(ns,{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)(ZW,{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)($W,{disabled:a||!_,icon:$o,label:f(`serviceAppsDiscoverActions`),tooltip:f(`serviceAppsDiscoverActionsHint`),onClick:()=>s(e.id)}),(0,F.jsx)($W,{disabled:!v,icon:fs,label:f(`serviceAppsDisconnectRuntime`),tooltip:f(`serviceAppsDisconnectRuntimeHint`),onClick:()=>l(e.id)}),(0,F.jsxs)(Xe,{open:d,onOpenChange:p,children:[(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{asChild:!0,children:(0,F.jsx)(Ge,{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)(ft,{className:`h-3.5 w-3.5`})})})}),(0,F.jsx)(vt,{side:`bottom`,className:`text-xs`,children:f(`serviceAppsMoreActions`)})]}),(0,F.jsx)(Je,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,F.jsx)(eG,{destructive:!0,disabled:i,icon:xn,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)(tG,{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)(Tt,{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)(rG,{action:e,grants:r.filter(t=>t.actionId===e.id),onRevoke:u},e.id))})}):null]}),(0,F.jsx)(it,{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 ZW({status:e}){let t=QW(e),n=t.icon;return(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{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)(vt,{side:`bottom`,className:`text-xs`,children:t.tooltip})]})}function QW(e){switch(e){case`running`:return{className:`bg-emerald-50 text-emerald-700`,icon:io,label:f(`serviceAppsStatus_running`),tooltip:f(`serviceAppsStatusHint_running`)};case`starting`:return{className:`bg-blue-50 text-blue-700`,icon:gn,iconClassName:`animate-spin`,label:f(`serviceAppsStatus_starting`),tooltip:f(`serviceAppsStatusHint_starting`)};case`failed`:return{className:`bg-rose-50 text-rose-700`,icon:ds,label:f(`serviceAppsStatus_failed`),tooltip:f(`serviceAppsStatusHint_failed`)};case`stopped`:return{className:`bg-muted text-muted-foreground`,icon:so,label:f(`serviceAppsStatus_stopped`),tooltip:f(`serviceAppsStatusHint_stopped`)};default:return{className:`bg-muted text-muted-foreground`,icon:ao,label:f(`serviceAppsStatus_idle`),tooltip:f(`serviceAppsStatusHint_idle`)}}}function $W({disabled:e=!1,icon:t,label:n,tooltip:r=n,onClick:i}){return(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{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)(vt,{side:`bottom`,className:`max-w-56 text-xs`,children:r})]})}function eG({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 tG({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)(Tt,{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)(nG,{label:e.label,value:e.value},e.label))}):null]})}function nG({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 rG({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)(gs,{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)(is,{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)(xn,{className:`h-3 w-3`})})]},`${e.caller.surface}:${e.caller.appId}:${e.actionId}`))]})}function iG({activeTab:e,onActiveTabChange:t,onOpenPanelApp:n}){let r=(0,F.jsx)(dn,{value:e,onValueChange:e=>t(e),children:(0,F.jsxs)(ln,{className:`grid h-auto w-[min(340px,100%)] grid-cols-2 rounded-lg bg-gray-100/70 p-0.5`,children:[(0,F.jsxs)(sn,{value:`panel-apps`,className:`gap-1.5 px-2 py-1.5 text-xs`,children:[(0,F.jsx)(Ja,{className:`h-3.5 w-3.5`}),f(`panelAppsTitle`)]}),(0,F.jsxs)(sn,{value:`service-apps`,className:`gap-1.5 px-2 py-1.5 text-xs`,children:[(0,F.jsx)(ns,{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)(TW,{headerContent:r,onOpenPanelApp:n}):(0,F.jsx)(YW,{headerContent:r})})}function aG({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)(at,{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)(vn,{className:`h-3.5 w-3.5`})})]})}function oG(e){return e.split(`/`).map(e=>e.trim()).filter(e=>e.length>0)}function sG(e){let t=e.trim();try{let e=new URL(t);return{authority:e.hostname,pathSegments:oG(e.pathname),pathname:e.pathname,raw:t,scheme:e.protocol.replace(/:$/,``).toLowerCase(),searchParams:e.searchParams}}catch{return{authority:``,pathSegments:oG(t),pathname:t,raw:t,scheme:``,searchParams:new URLSearchParams}}}var cG=class{constructor(e,t){this.routeDefinitions=e,this.options=t,this.resolve=e=>{let t=sG(e);return this.findDefinition(t).resolve(t)},this.normalize=e=>this.options.getNormalizedUri(this.resolve(e)),this.areEquivalent=(e,t)=>this.findDefinition(sG(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}}},lG=`home`,uG=`nextclaw://new-tab`,dG=`apps`,fG=`nextclaw://apps`,pG=`${fG}?tab=service-apps`,mG=`panel-app`,hG=`panel-apps`;function gG(e){return e===`panel-apps`||e===`service-apps`}function _G(e=hG){return e===hG?fG:pG}function vG(e){try{let t=new URL(e).searchParams.get(`tab`);return gG(t)?t:hG}catch{return hG}}function yG(e){return _G(vG(e))}function bG(e){return`nextclaw://panel-app/${encodeURIComponent(e)}`}function xG(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}function SG(e){let t=e.icon?.trim();if(t)return xG(t)?{type:`url`,url:t}:{type:`text`,value:t}}function CG(e){return{dedupeKey:`panel-app:${e.id}`,dockIcon:SG(e),historyPolicy:`managed`,kind:mG,resourceUri:bG(e.id),title:e.title,url:e.contentPath}}function wG(e,t){return e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}/`)}function TG(e){let t=e.pathSegments.join(`/`);return jn(t?`/${t}`:`/`,`docs`)}function EG(e){let t=e.filter(e=>e.trim().length>0).map(e=>encodeURIComponent(decodeURIComponent(e))).join(`/`);return t?`nextclaw://docs/${t}`:`nextclaw://docs`}function DG(e){let t=Mn(e),n=t.startsWith(`/`)?t:(()=>{try{return new URL(e).pathname}catch{return``}})();return n?EG(n.split(`/`)):`nextclaw://docs`}function OG(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 kG(e){return OG(e).length>0}function AG(e){let t=OG(e);return t?`/api/panel-apps/${encodeURIComponent(decodeURIComponent(t))}/content`:`nextclaw://panel-app`}function jG(e){let t=OG(e);return t?`nextclaw://panel-app/${encodeURIComponent(decodeURIComponent(t))}`:`nextclaw://panel-app`}function MG(e,t){let n=sG(e),r=sG(t),i=OG(n),a=OG(r);return i.length>0&&a.length>0?decodeURIComponent(i)===decodeURIComponent(a):e===t}var NG=[{defaultUrl:()=>uG,id:`home`,kind:lG,match:e=>e.raw===uG,resolve:()=>({historyPolicy:`managed`,kind:lG,resourceUri:uG,title:f(`docBrowserHomeTitle`),url:uG}),areEquivalent:(e,t)=>e===t},{defaultUrl:An,id:`docs-url`,kind:`docs`,match:e=>Fn(e.raw),resolve:e=>{let t=jn(e.raw,`docs`);return{historyPolicy:`managed`,kind:`docs`,resourceUri:DG(t),title:f(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>Mn(e)===Mn(t)},{defaultUrl:An,id:`nextclaw-docs`,kind:`docs`,match:e=>e.scheme===`nextclaw`&&e.authority===`docs`,resolve:e=>{let t=TG(e);return{historyPolicy:`managed`,kind:`docs`,resourceUri:EG(e.pathSegments),title:f(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>Mn(e)===Mn(t)},{defaultUrl:()=>fG,id:`apps`,kind:dG,match:e=>wG(e.raw,fG),resolve:e=>{let t=yG(e.raw);return{dedupeKey:`apps`,historyPolicy:`managed`,kind:dG,resourceUri:t,title:f(t===`nextclaw://apps`?`appsTitle`:`serviceAppsTitle`),url:t}},areEquivalent:(e,t)=>yG(e)===yG(t)},{defaultUrl:()=>`nextclaw://panel-app`,id:`panel-app`,kind:mG,match:e=>e.scheme===`nextclaw`&&e.authority===`panel-app`||kG(e),resolve:e=>{let t=AG(e),n=OG(e);return{dedupeKey:n?`panel-app:${decodeURIComponent(n)}`:void 0,historyPolicy:`managed`,kind:mG,resourceUri:jG(e),title:f(`panelAppsTitle`),url:t}},areEquivalent:MG},{defaultUrl:()=>`about:blank`,id:`content`,kind:`content`,match:()=>!0,resolve:e=>({historyPolicy:`managed`,kind:`content`,resourceUri:e.raw||`about:blank`,title:Rn(e.raw,`content`,`Detail`),url:e.raw||`about:blank`}),areEquivalent:(e,t)=>e===t}],PG=NG.map(e=>({areEquivalent:e.areEquivalent,id:e.id,match:e.match,resolve:e.resolve}));function FG(){return[{id:`apps`,label:f(`appsTitle`),target:{type:`right-panel-resource`,uri:fG}},{id:`service-apps`,label:f(`serviceAppsTitle`),target:{type:`right-panel-resource`,uri:pG}},{id:`docs`,label:f(`docBrowserHelp`),target:{options:{newTab:!0},type:`right-panel-resource`,uri:An()}},{id:`skill-marketplace`,label:f(`marketplaceSkillsPageTitle`),target:{path:`/marketplace/skills`,type:`app-route`}}]}var IG={apps:{accentClassName:`bg-emerald-50 text-emerald-700`,hoverAccentClassName:`group-hover:bg-emerald-100`,icon:(0,F.jsx)(st,{className:`h-5 w-5`})},"service-apps":{accentClassName:`bg-sky-50 text-sky-700`,hoverAccentClassName:`group-hover:bg-sky-100`,icon:(0,F.jsx)(Ao,{className:`h-5 w-5`})},docs:{accentClassName:`bg-amber-50 text-amber-700`,hoverAccentClassName:`group-hover:bg-amber-100`,icon:(0,F.jsx)(wt,{className:`h-5 w-5`})},"skill-marketplace":{accentClassName:`bg-rose-50 text-rose-700`,hoverAccentClassName:`group-hover:bg-rose-100`,icon:(0,F.jsx)(eo,{className:`h-5 w-5`})}};function LG(e){return IG[e.id]??{accentClassName:`bg-gray-50 text-gray-700`,hoverAccentClassName:`group-hover:bg-gray-100`,icon:(0,F.jsx)(st,{className:`h-5 w-5`})}}function RG({open:e}){let t=ui(),n=FG(),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=LG(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 zG(e){return e&&Fn(e)?`docs`:`content`}var BG=class{constructor(){this.resourceUriResolver=new cG(PG,{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(sG(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(sG(e.currentUrl)).historyPolicy===`managed`,this.resolveRouteDefinition=(e,t,n)=>{let r=t??(e?void 0:n?.kind),i=r?NG.find(e=>e.kind===r):void 0;if(i)return i;let a=e?sG(e):null,o=a?NG.find(e=>e.match(a)):void 0;if(o)return o;let s=t??n?.kind??zG(e);return NG.find(e=>e.kind===s)??NG[NG.length-1]}}},VG=dG,HG=mG,UG=`panel-apps`;function WG(e){return e===`panel-apps`||e===`service-apps`}function GG(e=UG){return e===UG?fG:pG}function KG(e){try{let t=new URL(e).searchParams.get(`tab`);return WG(t)?t:UG}catch{return UG}}function qG(e){e.open(GG(),{kind:VG,title:f(`appsTitle`),dedupeKey:`apps`})}var JG={[lG]:{getTitle:()=>f(`docBrowserHomeTitle`),renderContent:({open:e})=>(0,F.jsx)(RG,{open:e})},[VG]:{getTitle:()=>f(`appsTitle`),renderIcon:()=>(0,F.jsx)(st,{className:`w-4 h-4 text-primary shrink-0`}),renderContent:({currentUrl:e,open:t,openTarget:n})=>(0,F.jsx)(iG,{activeTab:KG(e),onActiveTabChange:e=>t(GG(e),{activate:!1,kind:VG,title:f(`appsTitle`),dedupeKey:`apps`}),onOpenPanelApp:e=>n(CG(e))})},[HG]:{getIframeSandbox:()=>jW,getTitle:e=>e.title||f(`panelAppsTitle`),onIframeMessage:e=>I0().panelAppBridgeManager.handleIframeMessage(e),onIframePointerOver:e=>MW(e.currentTarget),renderIcon:()=>(0,F.jsx)(Ja,{className:`w-4 h-4 text-primary shrink-0`}),renderToolbar:({open:e,refreshIframe:t,tab:n})=>(0,F.jsx)(aG,{appTitle:n.title||f(`panelAppsTitle`),onOpenApps:()=>qG({open:e}),onRefresh:t})}},YG={nextclawDisplayMode:`card`,nextclawPlacement:`inline`};function XG(e){return`/api/panel-apps/${encodeURIComponent(e)}/content`}function ZG(e){return`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams(YG).toString()}`}function QG(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:mG,navVersion:0,resourceUri:bG(t),title:n}}function $G({panelApp:e,showExpandAction:t=!0}){let n=In(),r=(0,P.useRef)(null),i=(0,P.useId)(),a=fW(),o=(0,P.useMemo)(()=>AW(a.data?.entries??[],e.appId),[e.appId,a.data?.entries]),s=o?CG(o):null,c=e.title??s?.title??e.appId,l=a.isLoading?``:s?.url??XG(e.appId),u=(0,P.useMemo)(()=>l?ZG(l):``,[l]),d=(0,P.useMemo)(()=>QG({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=>{I0().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)(Ja,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,F.jsx)(`span`,{className:`truncate`,children:c})]}),t?(0,F.jsx)(mt,{size:`md`,icon:(0,F.jsx)(zo,{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:jW,tabIndex:0,onPointerOver:()=>MW(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 eK=`nextclaw.chat.message-layout`,tK=1,nK=`flat`;function rK(e){if(!e||typeof e!=`object`)return nK;let{layout:t}=e;return t===`flat`||t===`card`?t:nK}var iK=p()(En(e=>({layout:nK,setLayout:t=>e({layout:t})}),{name:eK,version:tK,storage:Dn(()=>window.localStorage),partialize:e=>({layout:e.layout}),merge:(e,t)=>({...t,layout:rK(e)})})),aK=`inherited_from_session_id`,oK=new WeakMap;function sK(e){if(e.target.type===`panel_app`)return(0,F.jsx)($G,{panelApp:{appId:e.target.payload.appId,title:e.title}})}function cK({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 lK({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 uK(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(fK).length-1}function dK(e){let t=e.metadata?.[aK];return typeof t==`string`&&t.trim()?t.trim():null}function fK(e){return!aW(e)&&!dK(e)}function pK(e){let t=e.findIndex(e=>dK(e));if(t<0)return null;let n=dK(e[t]);return n?{boundaryIndex:e.slice(0,t).filter(fK).length,sourceSessionId:n,inheritedMessageCount:e.filter(e=>dK(e)===n).length}:null}function mK(e){let t=e.rawMessages.filter(fK),n=e.rawMessages.map(e=>({rawMessageId:e.id,checkpoint:aW(e)})).filter(e=>!!e.checkpoint).map(n=>({key:n.rawMessageId,checkpoint:n.checkpoint,boundaryIndex:uK({rawMessages:e.rawMessages,visibleRawMessages:t,rawMessageId:n.rawMessageId})})).sort((e,t)=>e.boundaryIndex-t.boundaryIndex),r=pK(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 hK({messages:e,isSending:t,className:n}){let r=lc(),{language:i}=Zt(),a=iK(e=>e.layout),o=eu(I(e=>e.snapshot.selectedSessionKey)),s=o?.workingDir??o?.projectRoot??null,c=(0,P.useCallback)(e=>Pe(e.path,s),[s]),u=(0,P.useMemo)(()=>QU(i),[i]),d=(0,P.useMemo)(()=>{let t=e.filter(fK),n=f(`chatProcessSummaryProcessed`);return t.flatMap(e=>{let t=ZU({message:e,processedLabel:n}),r=t?.label??null,a=oK.get(e);if(a&&a.language===i&&a.processSummaryLabel===r)return[a.viewModel];let o=Qc(e),s=KU({id:o.id,role:o.role,meta:{timestamp:o.meta?.timestamp,status:o.meta?.status,inlineTokens:YV(e.metadata),processSummary:t},parts:o.parts},{formatTimestamp:e=>l(e,i),texts:u});return oK.set(e,{language:i,processSummaryLabel:r,viewModel:s}),[s]})},[i,e,u]),p=(0,P.useMemo)(()=>d.some(e=>e.role===`assistant`&&(e.status===`streaming`||e.status===`pending`)),[d]),m=(0,P.useMemo)(()=>eW(i),[i]),h=(0,P.useMemo)(()=>mK({rawMessages:e,messages:d}),[d,e]),g=Wl(e=>e.snapshot.sessionSkillsQuery),_=(0,P.useCallback)(e=>{if(e.kind!==`skill`)return;let t=e.key.trim();if(!t)return;let n=(g?.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,g]),v=(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:h.map((e,n)=>e.kind===`compaction`?(0,F.jsx)(cK,{checkpoint:e.checkpoint},e.key):e.kind===`context-inheritance`?(0,F.jsx)(lK,{inheritance:e.inheritance},e.key):(0,F.jsx)(OV,{layout:a,messages:e.messages,isSending:n===h.length-1?t:!1,hasAssistantDraft:p,texts:m,onToolAction:r.chatThreadManager.handleToolAction,onFileOpen:r.chatThreadManager.openFilePreview,onAttachmentOpen:v,onInlineTokenClick:_,resolveFileContentUrl:c,renderInlineDisplay:sK,renderToolAgent:e=>(0,F.jsx)(ku,{agentId:e,className:`h-4 w-4 shrink-0`}),renderPanelAppCard:e=>(0,F.jsx)($G,{panelApp:e})},e.key))})}function gK({children:e,className:t,width:n=`messages`}){let r=iK(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 _K({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}=vz({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)(gK,{className:`py-4 sm:py-5`,children:(0,F.jsx)(hK,{messages:i,isSending:m&&r&&t})}),e?(0,F.jsx)(gK,{className:`pb-4 sm:pb-5`,children:e}):null]})}),h?(0,F.jsx)(mt,{icon:(0,F.jsx)(Ya,{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 vK=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 yK(e,t=e.occurredAt??new Date().toISOString()){return{...e,occurredAt:t}}var bK=/\[\[\s*reply_to_current\s*\]\]/gi,xK=/\[\[\s*reply_to\s*:\s*([^\]]+?)\s*\]\]/i;function SK(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function CK(e,t){let n=e,r;bK.test(n)&&(r=SK(t),n=n.replace(bK,``).trim());let i=n.match(xK)?.[1];return i&&(r=SK(i),n=n.replace(xK,``).trim()),r?{content:n,replyTo:r}:{content:n}}function wK(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=SK(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}=CK(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 TK(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*EK(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}=DK(r);r=o;for(let e of a)yield e}r+=n.decode();let{frames:e}=DK(r,!0);for(let t of e)yield t}finally{t.releaseLock()}}function DK(e,t=!1){let n=e.split(/\r?\n\r?\n/),r=n.pop()??``,i=[];for(let e of n){let t=TK(e);t&&i.push(t)}if(t&&r.trim()){let e=TK(r);return e&&i.push(e),{frames:i,rest:``}}return{frames:i,rest:r}}var OK=`/ncp/agent`,kK=class extends Error{ncpError;alreadyPublished;constructor(e,t=!1){super(e.message),this.name=`NcpHttpAgentClientError(${e.code})`,this.ncpError=e,this.alreadyPublished=t}};function AK(e){let t=e.trim();if(!t)throw Error(`NcpHttpAgentClient requires a non-empty baseUrl.`);return new URL(t)}function jK(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 MK(e){let t=(e??`/ncp/agent`).trim();if(!t)return OK;let n=t.startsWith(`/`)?t:`/${t}`;return n.endsWith(`/`)?n.slice(0,-1):n}async function NK(e){try{return(await e.text()).trim()}catch{return``}}function PK(e){if(RK(e))return e.ncpError;if(IK(e))return e;let t=e instanceof Error?e.message:String(e??`Unknown error`);return{code:BK(void 0),message:t,...e instanceof Error&&e.stack?{details:{stack:e.stack}}:{}}}function FK(e,t={}){return new kK(e,t.alreadyPublished??!1)}function IK(e){return LK(e)&&typeof e.code==`string`&&typeof e.message==`string`}function LK(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function RK(e){return e instanceof kK}var zK={"config-error":`config-error`,"auth-error":`auth-error`,"runtime-error":`runtime-error`,"timeout-error":`timeout-error`,"abort-error":`abort-error`};function BK(e){if(!e)return`runtime-error`;let t=zK[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 VK(e){let t=UK(e);return!t||typeof t.type!=`string`||!t.type.trim()?null:t}function HK(e){let t=UK(e);if(!t)return{code:`runtime-error`,message:e||`Unknown stream error.`};let n=typeof t.code==`string`?t.code:void 0,r=BK(n),i=LK(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 UK(e){try{let t=JSON.parse(e);return LK(t)?t:null}catch{return null}}var WK=[`text`,`file`,`source`,`step-start`,`reasoning`,`tool-invocation`,`card`,`rich-text`,`action`,`extension`],GK=class{manifest;baseUrl;basePath;fetchImpl;defaultHeaders;subscribers=new Set;activeControllers=new Set;started=!1;constructor(e){this.baseUrl=AK(e.baseUrl),this.basePath=MK(e.basePath),this.fetchImpl=jK(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:WK,expectedLatency:`seconds`,metadata:{transport:`http+sse`,scope:`agent`}}}async start(){this.started||(this.started=!0,this.publish(yK({type:vK.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 NK(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(RK(e))throw e;let n=PK(e);throw this.publish(yK({type:vK.EndpointError,payload:n})),FK(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 NK(n)}`)}catch(e){if(t.signal.aborted)return;let n=PK(e);throw this.publish(yK({type:vK.EndpointError,payload:n})),FK(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 NK(n)}`);if(!n.body)throw Error(`NCP stream response has no body.`);for await(let e of EK(n.body)){if(t.signal.aborted)return;this.handleSseFrame(e)}}catch(e){if(t.signal.aborted)return;if(RK(e))throw e;let n=PK(e);throw this.publish(yK({type:vK.EndpointError,payload:n})),FK(n)}finally{this.activeControllers.delete(t)}}handleSseFrame(e){if(e.event===`ncp-event`){let t=VK(e.data);if(!t){this.publish(yK({type:vK.EndpointError,payload:{code:`runtime-error`,message:`Received malformed ncp-event frame.`}}));return}this.publish(t);return}if(e.event===`error`){let t=HK(e.data);throw this.publish(yK({type:vK.EndpointError,payload:t})),FK(t,{alreadyPublished:!0})}}};function KK(e){return{...e,parts:[...e.parts],lifecycle:e.lifecycle?{...e.lifecycle}:void 0,metadata:e.metadata?{...e.metadata}:void 0}}function qK(e){return KK(wK(e))}var JK=`__nextclaw_aborted_tool_call__`;function YK(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 XK(e){if(!(!e.startedAt&&!e.endedAt))return{startedAt:e.startedAt,endedAt:e.endedAt}}function ZK(e,t,n){return n?{...e,status:t,lifecycle:n}:{...e,status:t}}function QK(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 $K(e,t){let n=[...e];return n.splice(QK(e,t),0,t),n}function eq(e,t){return t.trim()?e.id.startsWith(`tool-`)?!0:e.parts.some(e=>e.type===`tool-invocation`):!1}function tq(e,t,n){for(let[r,i]of e)i===t&&e.set(r,n)}function nq(e,t,n){for(let[r,i]of e)i===n&&(e.delete(r),t.delete(r))}function rq(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 iq(e,t){return rq(e,t)?.toolName??null}function aq(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 oq(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 sq=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=>{nq(this.messageIdByCallId,this.argsRawByCallId,e)};markAborted=e=>{e.forEach(e=>this.argsRawByCallId.set(e,JK))};remapMessageId=(e,t)=>{tq(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:aq(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:aq(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:iq(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)=>aq(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:aq(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=iq(i.parts,t)??`unknown`;this.port.replaceStreamingMessage({...i,parts:aq(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`)}},cq=`assistant`,lq=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 sq({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=>qK(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 vK.MessageSent:this.handleMessageSent(e.payload);break;case vK.MessageAbort:this.handleMessageAbort(e.payload);break;case vK.MessageTextStart:this.handleMessageTextStart(e.payload);break;case vK.MessageTextDelta:this.handleMessageTextDelta(e.payload);break;case vK.MessageTextEnd:this.handleMessageTextEnd(e.payload);break;case vK.MessageReasoningStart:this.handleMessageReasoningStart(e.payload);break;case vK.MessageReasoningDelta:this.handleMessageReasoningDelta(e.payload);break;case vK.MessageReasoningEnd:this.handleMessageReasoningEnd(e.payload);break;case vK.MessageToolCallStart:this.handleMessageToolCallStart(e.payload);break;case vK.MessageToolCallArgs:this.handleMessageToolCallArgs(e.payload);break;case vK.MessageToolCallArgsDelta:this.handleMessageToolCallArgsDelta(e.payload);break;case vK.MessageToolCallEnd:this.handleMessageToolCallEnd(e.payload);break;case vK.MessageToolCallResult:this.handleMessageToolCallResult(e.payload);break;case vK.RunStarted:this.handleRunStarted(e.payload);break;case vK.RunFinished:this.handleRunFinished(e.payload);break;case vK.RunError:this.handleRunError(e.payload);break;case vK.RunMetadata:this.handleRunMetadata(e.payload);break;case vK.ContextWindowUpdated:this.handleContextWindowUpdated(e.payload);break;case vK.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}=oq(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`,XK(e)),this.setError(null),this.clearActiveRun()};handleRunError=e=>{this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.settleStreamingMessage(`error`,XK(e)),this.setError(YK(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=KK(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&&eq(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:cq,status:n,parts:[],timestamp:new Date().toISOString()};return this.replaceStreamingMessage(a),a};updateMessageContainingToolCall=(e,t)=>{if(this.streamingMessage){let n=rq(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=rq(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=qK(e);this.streamingMessage?.id===t.id&&(this.streamingMessage=null);let n=this.messages.findIndex(e=>e.id===t.id);if(n<0){this.messages=$K(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?qK(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=ZK(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)}},uq=16,dq={code:`abort-error`,message:`User stopped the current run.`,details:{source:`chat-ui`}},fq=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()},uq))},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 pq(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 mq(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 hq(e){return e.parts.some(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?e.text.trim().length>0:!0)}function gq(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(!hq(e.message))return null;let n=e.sessionId||e.message.sessionId||t;return{...e,...n?{sessionId:n}:{},message:{...e.message,...n?{sessionId:n}:{}}}}function _q(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 lq}):t.current={sessionId:e??null,manager:new lq},t.current.manager}function vq({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 fq(e=>pq(n,e)),i=t.subscribe(t=>{mq(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=gq(r,e);if(!i)return null;o(!0),e&&await n.dispatch({occurredAt:new Date().toISOString(),type:vK.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:dq})},streamRun:async()=>{e&&(await t.stop(),await t.stream({sessionId:e}))}}}function yq(e){return e instanceof Error?e:Error(String(e))}function bq(e){let{hydratedSessionId:t,isHydrating:n,sessionId:r}=e;return r?n||t!==r:!1}function xq(e,t){let n=e.getSnapshot();return n.activeRun?.sessionId===t||n.streamingMessage?.sessionId===t||n.messages.some(e=>e.sessionId===t)}function Sq(e,t){return e.status===`running`?{runId:null,sessionId:t,abortDisabledReason:null}:null}function Cq(e,t,n){return n.signal.aborted||e.requestId!==t}function wq({sessionId:e,client:t,loadSeed:n}){let r=_q(e),i=vq({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},xq(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(Cq(d.current,a,i))return;r.hydrate({sessionId:e,messages:o.messages,activeRun:Sq(o,e)}),p(e),t.stream({sessionId:e}).catch(e=>{d.current.requestId===a&&c(yq(e))})}catch(t){if(Cq(d.current,a,i))return;c(yq(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:bq({sessionId:e,hydratedSessionId:l,isHydrating:a}),hydrateError:s}}var Tq=200*1024*1024,Eq=`application/octet-stream`;function Dq(e){let t=e.type.trim().toLowerCase();return t.length>0?t:Eq}function Oq(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=Dq(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 kq(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 Aq(e,t){let n=[],r=[];for(let i of e){let e=Oq(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:Dq(e),sizeBytes:e.size,reason:`read-failed`}))),{attachments:[],rejected:r}}}function jq(e){return typeof e==`string`?e:e instanceof URL?e.toString():e.url}function Mq(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 Nq(e,t){let n=Error(e);return t!==void 0&&(n.cause=t),n}function Pq(){return async(e,t)=>{try{return await fetch(e,{credentials:`include`,...t})}catch(n){throw ne.reportTransportFailure(Mq(n)),Nq(`NCP fetch failed for ${(t?.method||`GET`).toUpperCase()} ${jq(e)}: ${Mq(n)}`,n)}}}var Fq=300,Iq=`ncp agent unavailable during startup`;function Lq(e){return e instanceof Error?e.message.includes(`ncp session not found:`):!1}function Rq(e){return e?.trim().toLowerCase().includes(Iq)??!1}function zq(){return new GK({baseUrl:b,basePath:`/api/ncp/agent`,fetchImpl:Pq()})}async function Bq(e,t,n=Fq){t.throwIfAborted();try{let r=await Be(e,n);return t.throwIfAborted(),{messages:r.messages,status:r.status??`idle`,contextWindow:r.contextWindow??null}}catch(e){if(t.throwIfAborted(),!Lq(e))throw e;return{messages:[],status:`idle`}}}function Vq(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 Hq(e,t={}){let[n]=(0,P.useState)(()=>zq()),r=y(),[i,a]=(0,P.useState)(0),[o,s]=(0,P.useState)(null),c=t.messageLimit??Fq;(0,P.useEffect)(()=>{s(null)},[e]);let l=wq({sessionId:e,client:n,loadSeed:(0,P.useCallback)(async(e,t)=>{let n=await Bq(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 Vq(e&&r.phase===`ready`&&Rq(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 Uq(e){return e.bootstrapStatus?.ncpAgent.state!==`ready`}function Wq(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 Gq(e){let{message:t,status:n}=e,r=t?.trim();if(!r)return Wq(n);let i=n.activeSystemAction?.message?.trim();if(n.phase===`service-transitioning`&&i)return i;let a=Ae(r);return n.phase===`recovering`&&a?f(`runtimeControlRecoveringHelp`):n.phase===`stalled`&&a?null:r}function Kq(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 qq(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:Kq(e.usedContextTokens)},{label:f(`chatContextWindowTotal`),value:Kq(e.totalContextTokens)},{label:f(`chatContextWindowAvailable`),value:Kq(e.availableContextTokens)}];return e.prunedUsedContextTokens!==e.usedContextTokens&&a.push({label:f(`chatContextWindowPruned`),value:Kq(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 Jq=zt(`18rem`);function Yq({agents:e,selectedAgent:t,selectedAgentId:n,onSelectAgent:r}){return(0,F.jsxs)(Ut,{value:n,onValueChange:r,children:[(0,F.jsxs)(Ft,{"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)(Cu,{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)(Rt,{className:`rounded-xl border-border shadow-lg`,style:{maxHeight:Jq},children:e.map(e=>(0,F.jsx)(Vt,{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)(Cu,{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 Xq=[{icon:Bo,titleKey:`chatWelcomeCapability1Title`,descKey:`chatWelcomeCapability1Desc`,promptKey:`chatWelcomeCapability1Prompt`},{icon:eo,titleKey:`chatWelcomeCapability2Title`,descKey:`chatWelcomeCapability2Desc`,promptKey:`chatWelcomeCapability2Prompt`},{icon:qa,titleKey:`chatWelcomeCapability3Title`,descKey:`chatWelcomeCapability3Desc`,promptKey:`chatWelcomeCapability3Prompt`}];function Zq({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:Xq.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 Qq=Ue(`20rem`);function $q({defaultProjectRoot:e,isSaving:t,projectOptions:n,projectRoot:r,selectable:i,onOpenProjectDialog:a,onSelectProjectRoot:o}){let[s,c]=(0,P.useState)(!1),l=xc(r)??f(`chatWelcomeProjectPickerPlaceholder`),u=e!=null&&r===e,d=async e=>{c(!1),await o(e)};return(0,F.jsxs)(Xe,{open:s,onOpenChange:c,children:[(0,F.jsx)(Ge,{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)(wo,{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)(Tt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,F.jsxs)(Gs,{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:Qq},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)(wo,{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)(wo,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,F.jsx)(`span`,{children:f(`chatWelcomeProjectOpenFolder`)})]})})]})]})}function eJ(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)(kl,{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)(Qa,{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)(Cn,{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)(Kt,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-primary`}):null]})})}var tJ=Ue(`18rem`);function nJ({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)(Xe,{open:r,onOpenChange:i,children:[(0,F.jsx)(Ge,{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)(kl,{icon:{kind:`runtime-image`,src:a.icon.src,alt:a.icon.alt??null,name:a.label},className:`h-4 w-4`}):(0,F.jsx)(Qa,{className:`h-4 w-4 shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:a.label}),(0,F.jsx)(Tt,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,F.jsx)(Gs,{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:tJ},children:(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.map(e=>(0,F.jsx)(eJ,{option:e,onSelect:()=>{n(e.value),i(!1)}},e.value))})})]}):null}function rJ({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)($q,{defaultProjectRoot:t,isSaving:g,projectOptions:r,projectRoot:v,selectable:b,onOpenProjectDialog:()=>h(!0),onSelectProjectRoot:y}):null,(0,F.jsx)(Yq,{agents:e,selectedAgent:p,selectedAgentId:i,onSelectAgent:c}),(0,F.jsx)(nJ,{options:s,selectedSessionType:o,onSelectSessionType:d})]}),(0,F.jsx)(Zq,{onSelectPrompt:l})]}),u?(0,F.jsx)(nc,{open:m,currentProjectRoot:v,isSaving:g,onOpenChange:h,onSave:y}):null]})}function iJ(e){let{agents:t,fallbackAgentId:n}=e;return(t?.length??0)>0?t??[]:[{id:n}]}function aJ(e){return e.agents.find(t=>t.id===e.agentId)??null}function oJ(e,t){if(typeof e!=`string`||e.trim().length===0)return null;let n=Bl(e);return t.some(e=>e.value===n)?n:null}function sJ(e){let{agentId:t,agents:n,defaultSessionType:r,pendingSessionType:i,selectedSessionType:a,sessionTypeOptions:o}=e;return(oJ(a,o)??oJ(i,o))||((n&&t?oJ(Vl(aJ({agents:n,agentId:t}),r),o):null)??oJ(r,o)??o[0]?.value??Bl(r))}function cJ(e){return new Date(e.lastMessageAt??e.createdAt).getTime()}function lJ(e){let{defaultProjectRoot:t,sessionSummaries:n}=e,r=new Map;for(let e of el([...n])){let n=e.projectRoot?.trim();if(!n||n===t)continue;let i=r.get(n),a=cJ(e);if(i){i.sessionCount+=1,i.latestUpdatedAt=Math.max(i.latestUpdatedAt,a);continue}r.set(n,{projectRoot:n,projectName:e.projectName?.trim()||xc(n)||n,sessionCount:1,latestUpdatedAt:a})}return[...r.values()].sort((e,t)=>t.latestUpdatedAt-e.latestUpdatedAt).map(({latestUpdatedAt:e,...t})=>t)}var uJ=[];function dJ({inputSlot:e,pendingProjectRoot:t,pendingSessionType:n,selectedSessionTypeValue:r,onSelectProjectRoot:i,onSelectPrompt:a,onSelectSessionType:o}){let s=lc(),c=I(e=>e.snapshot.selectedAgentId),l=L(e=>e.snapshot),u=Wl(e=>e.snapshot.configQuery?.data??null),d=Wl(e=>e.snapshot.sessionsQuery?.data?.sessions??uJ),f=Wl(e=>e.snapshot.sessionTypesQuery?.data??null),p=wu(),m=l.agentId??c,h=iJ({agents:p.data?.agents,fallbackAgentId:m}),g=bc(u?.agents.defaults.workspace),_=bc(t),v=Ul(f?.options??[]),y=Bl(f?.defaultType??`native`),b=sJ({defaultSessionType:y,pendingSessionType:n,selectedSessionType:r,sessionTypeOptions:v}),x=lJ({defaultProjectRoot:g,sessionSummaries:d});return(0,F.jsx)(rJ,{agents:h,defaultProjectRoot:g,inputSlot:e,projectOptions:x,selectedAgentId:m,selectedProjectRoot:_,selectedSessionType:b,sessionTypeOptions:v,onSelectAgent:e=>{s.chatSessionListManager.setSelectedAgentId(e),o(sJ({agents:h,agentId:e,defaultSessionType:y,pendingSessionType:null,selectedSessionType:null,sessionTypeOptions:v}))},onSelectPrompt:a,onSelectProjectRoot:i,onSelectSessionType:o})}var fJ=`$`,pJ=`@panel-app:`;function mJ(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 hJ(e){return eh(e)}function gJ(e){return rh(e)}function _J(e){return ih(e,`skill`)}function vJ(e){return ih(e,`file`)}function yJ(e,t,n){let r=new Set(t),i=dh(e,e=>e.tokenKind===`skill`&&!r.has(e.tokenKey)),a=ih(i,`skill`),o=new Map(n.map(e=>[e.ref,e])),s=t.filter(e=>!a.includes(e)).map(e=>Zm({tokenKind:`skill`,tokenKey:e,label:o.get(e)?.name||e}));return s.length===0?i:th([...i,...s])}function bJ(e,t){let n=new Set(vJ(e));return t.filter(e=>n.has(e.id))}function xJ(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[];for(let t of e){if(t.type===`text`){r=mJ(r,t.text);continue}if(t.tokenKind===`skill`){r=mJ(r,`${fJ}${t.tokenKey}`);continue}if(t.tokenKind===`panel_app`){r=mJ(r,`${pJ}${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 SJ(e){return e.modelOptions.length>0}function CJ(e){return!e.isProviderStateResolved&&!SJ(e)}function wJ(e){return e.isProviderStateResolved&&!SJ(e)}function TJ(e){return!1}function EJ(e){let{hasSendableDraft:t,isRuntimeBlocked:n}=e;return n||!t}function DJ(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 OJ(e,t){return e?Object.fromEntries(t.map(t=>[t,e])):{}}function kJ(e){let t=bc(e.projectRoot),n={...OJ(e.model?.trim(),[`model`,`preferred_model`]),...OJ(e.thinkingLevel?.trim(),[`thinkingEffort`,`thinking`,`preferred_thinking`]),...OJ(e.sessionType?.trim(),[`agentRuntimeId`,`session_type`,`runtime`]),...OJ(e.agentId?.trim(),[`agentId`,`agent_id`]),...OJ(t??void 0,[`projectRoot`,`project_root`])},r=DJ(e.requestedSkills);r.length>0&&(n.requested_skill_refs=r);let i=e.composerNodes?KV(e.composerNodes):[];return i.length>0&&(n[zV]=i),e.sessionMaterialization&&(n[Se]=e.sessionMaterialization),n}var AJ=e=>e.some(e=>e.type!==`text`||e.text.trim().length>0),jJ=e=>e?.trim()||void 0;function MJ(e){return e.text.replace(/\s+/g,` `).trim()||e.attachments.map(e=>e.name).filter(Boolean).join(`, `)}function NJ(e){return{isProviderStateResolved:e.isProviderStateResolved,modelOptions:e.modelOptions,sessionTypeUnavailable:e.sessionTypeState.sessionTypeUnavailable}}function PJ(e){let{agentIsSending:t,inputQuery:n,inputSnapshot:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:o,sessionKey:s}=e,c=xJ([...r.nodes],r.attachments);if(EJ({snapshot:NJ(n),hasSendableDraft:AJ(c),isRuntimeBlocked:i})||t)return null;let l={text:r.text,nodes:[...r.nodes],selectedSkills:[...r.selectedSkills],skillRecords:[...r.skillRecords],attachments:[...r.attachments]},u=kJ({agentId:a?void 0:o,model:jJ(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:MJ(l)}}function FJ(e,t){return kq({sessionId:t??void 0,text:e.composerSnapshot.text.trim(),attachments:[...e.composerSnapshot.attachments],parts:xJ([...e.composerSnapshot.nodes],e.composerSnapshot.attachments),metadata:e.metadata})}function IJ(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 LJ(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||IJ({autoSendingQueuedDraftIdRef:s,draft:r[0],sendQueuedDraft:i,setQueuedDrafts:a,setSendError:o})},[t,n,r,i,a,o])}function RJ(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 zJ(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=AJ((0,P.useMemo)(()=>xJ([...n.nodes],n.attachments),[n.attachments,n.nodes])),p=t.isSending||t.isRunning,m=EJ({snapshot:NJ(r),hasSendableDraft:f,isRuntimeBlocked:i})||t.isSending,[h,g]=(0,P.useState)([]),_=(0,P.useCallback)(()=>PJ({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=FJ(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=RJ({queuedDrafts:h,restoreComposer:u,setQueuedDrafts:g,setSendError:d});LJ({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 BJ(e,t){return{value:Ce,modelLabel:e,providerLabel:``,isRuntimeDefault:!0,thinkingCapability:t??null}}function VJ(e){let t=new Set;return Hn({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=Un(e.prefix,n);return!r||t.has(r)?null:(t.add(r),{value:r,modelLabel:n,providerLabel:e.displayName,thinkingCapability:Vn(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 HJ(e){let{modelOptions:t,modelSelectionMode:n,runtimeDefaultThinkingCapability:r,runtimeDefaultModelLabel:i=`Runtime default`,supportedModels:a}=e,o=BJ(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 UJ(e){return e?.trim().toLowerCase()||`native`}function WJ(e){let{sessions:t,selectedSessionKey:n,sessionType:r,readPreference:i}=e,a=UJ(r),o,s=-1/0;for(let e of t){if(e.key===n||UJ(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 GJ(e){let{selectedSession:t,pendingSessionType:n,setPendingSessionType:r,sessionTypesData:i}=e,a=(0,P.useMemo)(()=>Ul(i?.options??[]),[i?.options]),o=(0,P.useMemo)(()=>{let e=[...a],n=Bl(t?.sessionType);return e.some(e=>e.value===n)||e.push({value:n,label:Hl(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)(()=>Bl(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)(()=>Bl(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=Bl(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(Bl(t.sessionType))?!0:d?.ready===!1,[m,t,d?.ready]),g=(0,P.useMemo)(()=>t&&!m.has(Bl(t.sessionType))?`${Hl(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 KJ=`nextclaw.chat.recent-selection.store`;function qJ(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function JJ(e,t){return Array.isArray(e)?Array.from(new Set(e.map(qJ).filter(e=>!!e))).slice(0,t):[]}function YJ(e,t){let n=qJ(t?.namespace);return n?`${e.storageKey}.${encodeURIComponent(n.toLowerCase())}`:e.storageKey}function XJ(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e)){let e=qJ(n);if(!e)continue;let i=JJ(r,1/0);i.length>0&&(t[e]=i)}return t}var ZJ=p()(En(e=>({entriesByKey:{},setEntries:(t,n)=>e(e=>({entriesByKey:{...e.entriesByKey,[t]:JJ(n,1/0)}}))}),{name:KJ,storage:Dn(()=>window.localStorage),partialize:e=>({entriesByKey:e.entriesByKey}),merge:(e,t)=>({...t,entriesByKey:XJ(e?.entriesByKey)})})),QJ=class{constructor(e){this.options=e,this.read=(e={})=>{let t=YJ(this.options,e);return JJ(ZJ.getState().entriesByKey[t],this.options.limit)},this.remember=(e,t={})=>{let n=qJ(e);if(!n)return this.read(t);let r=YJ(this.options,t),i=[n,...this.read(t).filter(e=>e!==n)].slice(0,this.options.limit);return ZJ.getState().setEntries(r,i),i},this.resolveVisible=e=>{let t=JJ(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}}},$J=new QJ({storageKey:`nextclaw.chat.recent-models`,limit:3}),eY=[],tY=[];function nY(e){let{sessionKey:t,inputSnapshot:n,setPendingSessionType:r}=e,i=t??null,a=$l(),o=Wl(e=>e.snapshot),s=o.configQuery?.data??null,c=o.sessionsQuery?.data?.sessions??tY,l=pl({sessionId:i?.trim()||`draft-session`,projectRoot:bc(n.pendingProjectRoot)}),u=l.data?.records??eY,d=!!(l.isLoading||l.isFetching),p=(0,P.useMemo)(()=>el(c),[c]),m=(0,P.useMemo)(()=>p.find(e=>e.key===i)??null,[i,p]),h=GJ({selectedSession:m,pendingSessionType:n.pendingSessionType,setPendingSessionType:r,sessionTypesData:o.sessionTypesQuery?.data??null}),g=(0,P.useMemo)(()=>VJ({config:s,providersView:o.providersQuery?.data??null,templatesView:o.providerTemplatesQuery?.data??null}),[s,o.providerTemplatesQuery?.data,o.providersQuery?.data]),_=(0,P.useMemo)(()=>HJ({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=$J.read({namespace:h.selectedSessionType}).find(e=>v.has(e)),b=(0,P.useMemo)(()=>y??WJ({sessions:p,selectedSessionKey:i,sessionType:h.selectedSessionType,readPreference:e=>e.preferredModel?.trim()||void 0}),[y,i,h.selectedSessionType,p]),x=(0,P.useMemo)(()=>WJ({sessions:p,selectedSessionKey:i,sessionType:h.selectedSessionType,readPreference:e=>e.preferredThinking??void 0}),[i,h.selectedSessionType,p]),S=bc(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 rY={text:``,nodes:[],selectedSkills:[],skillRecords:[]},iY=()=>({...rY,attachments:[],selectedModel:void 0,selectedThinkingLevel:null,pendingSessionType:zl,selectedSessionType:zl,pendingProjectRoot:null,composerFocusRequestId:0,sendError:null}),aY=e=>e?.trim()||zl,oY=e=>[e.assetUri??``,e.url??``,e.name,e.mimeType,String(e.sizeBytes),e.contentBase64??``].join(`:`),sY=(e,t)=>{let n=new Set(e.map(oY)),r=[...e];return t.forEach(e=>{let t=oY(e);n.has(t)||(n.add(t),r.push(e))}),r},cY=()=>{let[e,t]=(0,P.useState)(iY),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({...rY,attachments:[],sendError:null})},[n]),a=(0,P.useCallback)(e=>{n({...e})},[n]),o=(0,P.useCallback)(e=>{n({text:e,nodes:hJ(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(oY)),i=sY(e.attachments,t),a=i.filter(e=>!r.has(oY(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=aY(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,_])}},lY={exactId:1200,exactLabel:1150,prefixId:1e3,prefixLabel:950,prefixToken:900,containsId:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function uY(e){return(e??``).trim().toLowerCase()}function dY(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 fY(e,t){let n=uY(t);if(!n)return lY.fallback;let r=uY(e.id),i=uY(e.label||e.id),a=uY(e.description),o=(e.aliases??[]).map(uY).filter(Boolean),s=i.split(/[\s/_-]+/).filter(Boolean),c=[r,...o];return c.some(e=>e===n)?lY.exactId:i===n?lY.exactLabel:c.some(e=>e.startsWith(n))?lY.prefixId:i.startsWith(n)?lY.prefixLabel:s.some(e=>e.startsWith(n))?lY.prefixToken:c.some(e=>e.includes(n))?lY.containsId:i.includes(n)?lY.containsLabel:a.includes(n)?lY.containsDescription:dY(n,i)||c.some(e=>dY(n,e))?lY.subsequence:0}function pY(e){return e>=lY.exactLabel?4:e>=lY.prefixToken?3:e>=lY.containsLabel?2:e>0?1:0}var mY={key:`panel-app-reference`,marker:`@`};function hY(e){return Date.parse(e.lastOpenedAt??e.updatedAt)||0}function gY(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.entries.map((t,n)=>({entry:t,order:n,score:fY({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=pY(e.score),i=pY(n.score);if(i!==r)return i-r;if(e.entry.favorite!==n.entry.favorite)return e.entry.favorite?-1:1;let a=hY(n.entry),o=hY(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 _Y(e){let t=e.keyPrefix??`panel-app`;return gY({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 vY(e){return _Y(e).map(({item:e})=>e)}function yY(e){return _Y(e).map(({entry:e,item:t})=>({...t,tokenKind:`panel_app`,tokenKey:e.appId,value:e.appId}))}function bY(e){return AV({key:`panel-app-reference`,trigger:mY,tokenKind:`panel_app`,texts:e.menuTexts,getIsLoading:({data:e})=>e.isPanelAppsLoading,getRecords:({data:e})=>e.panelApps,getItems:({records:t,query:n})=>yY({entries:t,query:n,texts:e.itemTexts})})}function xY(e){let t=e.modelLabel.trim(),n=e.providerLabel.trim();return n?`${n}/${t}`:t}function SY(e){let t=[];for(let n of[`off`,...e])t.includes(n)||t.push(n);return t}function CY(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 wY({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:xY(e)}))},{key:`recent-models`,label:c.recentModelsLabel,options:m.map(e=>({value:e.value,label:xY(e)}))},{key:`all-models`,label:c.allModelsLabel,options:g.map(e=>({value:e.value,label:xY(e)}))}].filter(e=>e.options.length>0):void 0;return{key:`model`,value:u,placeholder:c.modelSelectPlaceholder,selectedLabel:l?xY(l):void 0,icon:`sparkles`,options:e.map(e=>({value:e.value,label:xY(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 TY(e){let{defaultThinkingLevel:t,onValueChange:n,selectedThinkingLevel:r,supportedLevels:i,texts:a}=e;if(i.length===0)return null;let o=SY(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 EY={exactSpec:1200,exactLabel:1150,prefixSpec:1e3,prefixLabel:950,prefixToken:900,containsSpec:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function DY(e){return(e??``).trim().toLowerCase()}function OY(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 kY(e,t){let n=DY(t);if(!n)return EY.fallback;let r=DY(e.key),i=DY(e.label||e.key),a=DY(`${e.descriptionZh??``} ${e.description??``}`),o=i.split(/[\s/_-]+/).filter(Boolean);return r===n?EY.exactSpec:i===n?EY.exactLabel:r.startsWith(n)?EY.prefixSpec:i.startsWith(n)?EY.prefixLabel:o.some(e=>e.startsWith(n))?EY.prefixToken:r.includes(n)?EY.containsSpec:i.includes(n)?EY.containsLabel:a.includes(n)?EY.containsDescription:OY(n,i)||OY(n,r)?EY.subsequence:0}function AY(e){return e>=EY.exactLabel?4:e>=EY.prefixToken?3:e>=EY.containsLabel?2:e>0?1:0}function jY(e){return new Map(e.map((e,t)=>[e,t]))}function MY(e,t){let n=jY(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 NY(e,t,n,r=[]){let i=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0}),a=jY(r);return e.map((e,n)=>({record:e,order:n,score:kY(e,t)})).filter(e=>e.score>0).sort((e,t)=>{let n=AY(e.score),r=AY(t.score);if(r!==n)return r-n;let o=a.get(e.record.key)??1/0,s=a.get(t.record.key)??1/0;if(o!==s)return o-s;if(t.score!==e.score)return t.score-e.score;let c=(e.record.label||e.record.key).trim(),l=(t.record.label||t.record.key).trim(),u=i.compare(c,l);return u===0?e.order-t.order:u}).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}`]:[]],tokenKind:`skill`,tokenKey:e.key,value:e.key}))}function PY(e){return e.map(e=>({key:e.key,label:e.label,description:e.descriptionZh||e.description||``,badgeLabel:e.badgeLabel}))}function FY(e){let{groupedRecentSkillValues:t,isLoading:n,onSelectedKeysChange:r,recentSkillValues:i,selectedSkills:a,skillRecords:o,texts:s}=e,c=MY(o,i??[]),l=new Set(t??[]),u=PY(c.filter(e=>l.has(e.key))),d=PY(c.filter(e=>!l.has(e.key)));return{title:s.title,searchPlaceholder:s.searchPlaceholder,emptyLabel:s.emptyLabel,loadingLabel:s.loadingLabel,isLoading:n,manageLabel:s.manageLabel,manageHref:`/marketplace/skills`,options:PY(c),groups:u.length>0?[{key:`recent-skills`,label:s.recentSkillsLabel,options:u},{key:`all-skills`,label:s.allSkillsLabel,options:d}].filter(e=>e.options.length>0):void 0,selectedKeys:a,onSelectedKeysChange:r}}var IY=`commands`,LY=`panel-app-action`,RY=`panel-apps`,zY=`skills`;function BY(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.commands.map((t,n)=>({command:t,order:n,score:fY({id:t.key,label:t.title,description:t.description,aliases:t.keywords},e.query)})).filter(e=>e.score>0).sort((e,n)=>{let r=pY(e.score),i=pY(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:IY,sectionLabel:e.texts.commandSectionLabel}))}function VY(e){let{data:t,itemTexts:n,query:r,skillHintLabel:i,skillSectionLabel:a}=e;return NY([...t.skillRecords],r,n,[...t.recentSkillValues]).map(e=>({...e,hintLabel:i,sectionKey:zY,sectionLabel:a}))}function HY(e){return vY({entries:e.data.panelApps,keyPrefix:LY,query:e.query,texts:e.itemTexts}).map(t=>({...t,hintLabel:e.panelAppHintLabel,sectionKey:RY,sectionLabel:e.panelAppSectionLabel}))}function UY(e){let t=`${LY}:`;return e.key.startsWith(t)?e.key.slice(t.length):null}function WY(e){return kV({key:`slash-command`,trigger:Jm,resolvePanel:t=>{let{data:n,trigger:r}=t;return{filterOptions:[{key:`all`,label:e.labels.filterAllLabel},{key:IY,label:e.labels.filterCommandsLabel,sectionKeys:[IY]},{key:zY,label:e.labels.filterSkillsLabel,sectionKeys:[zY]},{key:RY,label:e.labels.filterPanelAppsLabel,sectionKeys:[RY]}],isLoading:n.isPanelAppsLoading||n.isSkillsLoading,items:[...BY({commands:e.commands,query:r.query,texts:{commandHintLabel:e.labels.commandHintLabel,commandSectionLabel:e.labels.commandSectionLabel,commandSubtitle:e.labels.commandSubtitle}}),...VY({data:n,itemTexts:e.itemTexts.skillTexts,query:r.query,skillHintLabel:e.labels.skillHintLabel,skillSectionLabel:e.labels.skillSectionLabel}),...HY({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=UY(t);if(n){e.onSelectPanelApp(n);return}let r=t.tokenKey??t.value;r&&e.onSelectSkill?.(r)},texts:e.menuTexts}}})}function GY(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=fW({enabled:l?.key===mY.key||l?.key===Jm.key}),h=(0,P.useMemo)(()=>[WY({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}),bY({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)(()=>jV({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 KY=be.chat.modelFavorites,qY=[`preference`,KY];function JY(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 YY(e){let t=fe(),n=(0,P.useMemo)(()=>new Set(e),[e]),r=T({queryKey:qY,queryFn:()=>ye(KY),staleTime:3e4}),i=(0,P.useMemo)(()=>JY(r.data?.value),[r.data?.value]),a=(0,P.useMemo)(()=>i.filter(e=>n.has(e)),[n,i]),o=je({mutationFn:async e=>await le(KY,e),onMutate:async e=>{await t.cancelQueries({queryKey:qY});let n=t.getQueryData(qY);return t.setQueryData(qY,{key:KY,value:e,updatedAt:new Date().toISOString()}),{previous:n}},onError:(e,n,r)=>{r?.previous&&t.setQueryData(qY,r.previous)},onSuccess:e=>{t.setQueryData(qY,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 XY=new QJ({storageKey:`nextclaw.chat.recent-skills`,limit:5});function ZY(e){let{addAttachments:t,attachmentSupported:n,inputBarRef:r}=e,i=(0,P.useCallback)(e=>{if(e===`unsupported-type`){E.error(f(`chatInputAttachmentUnsupported`));return}if(e===`too-large`){E.error(f(`chatInputAttachmentTooLarge`).replace(`{maxMb}`,String(Tq/(1024*1024))));return}E.error(f(`chatInputAttachmentReadFailed`))},[]),a=(0,P.useCallback)(async e=>{if(!n||e.length===0)return;let a=await Aq(e,{uploadBatch:v});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 QY(){return{off:f(`chatThinkingLevelOff`),minimal:f(`chatThinkingLevelMinimal`),low:f(`chatThinkingLevelLow`),medium:f(`chatThinkingLevelMedium`),high:f(`chatThinkingLevelHigh`),adaptive:f(`chatThinkingLevelAdaptive`),xhigh:f(`chatThinkingLevelXhigh`)}}function $Y(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[wY({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}}),TY({supportedLevels:y,selectedThinkingLevel:_,defaultThinkingLevel:v,onValueChange:p,texts:{thinkingLabels:QY()}})].filter(e=>e!==null)}function eX(e){let{allSkillsLabel:t,isSkillsLoading:n,onSelectedKeysChange:r,recentSkillGroupValues:i,recentSkillValues:a,recentSkillsLabel:o,selectedSkills:s,skillRecords:c}=e;return FY({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 tX(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 nX({children:e,disabled:t=!1,label:n,onClick:r}){return(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{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)(vt,{side:`top`,children:n})]})}function rX({controller:e}){return e.queuedInputs.length===0?null:(0,F.jsx)(xt,{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)(fo,{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)(nX,{label:f(`chatQueuedEdit`),onClick:()=>e.editQueuedInput(t.id),children:(0,F.jsx)(Xo,{className:`h-4 w-4`})}),(0,F.jsx)(nX,{label:f(`chatQueuedDelete`),onClick:()=>e.deleteQueuedInput(t.id),children:(0,F.jsx)(xn,{className:`h-4 w-4`})})]})]},t.id))})})}function iX(e,t){return e.map(e=>({key:e.ref,label:e.name,scopeLabel:t[e.scope],description:e.description,descriptionZh:e.descriptionZh,badgeLabel:t[e.scope]}))}function aX(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 oX(e){return{skillScopeLabels:(0,P.useMemo)(()=>({builtin:f(`chatSkillScopeBuiltin`),project:f(`chatSkillScopeProject`),workspace:f(`chatSkillScopeWorkspace`)}),[e]),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 sX(e){let t=(0,P.useMemo)(()=>iX(e.skillRecords,e.skillScopeLabels),[e.skillRecords,e.skillScopeLabels]),n=(0,P.useMemo)(()=>aX(e.modelOptions),[e.modelOptions]);return{skillRecords:t,modelRecords:n,recentModelValues:$J.resolveVisible({availableValues:n.map(e=>e.value),minAvailableCount:5}),recentSkillValues:XY.resolveVisible({availableValues:t.map(e=>e.key),minAvailableCount:0}),recentSkillGroupValues:XY.resolveVisible({availableValues:t.map(e=>e.key),minAvailableCount:4})}}var cX=(0,P.memo)(function(e){let{contextWindow:t,controller:n,inputActions:r,inputQuery:i,inputSnapshot:a,surface:o=`default`}=e,s=lc(),{language:c}=Zt(),l=iK(e=>e.layout),{isMobile:u}=hn(),d=(0,P.useRef)(null),p=(0,P.useRef)(null),m=oX(c),{skillRecords:g,modelRecords:_,recentModelValues:v,recentSkillValues:y,recentSkillGroupValues:b}=sX({modelOptions:i.modelOptions,skillRecords:i.skillRecords,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}=GY({commands:x,isSkillsLoading:i.isSkillsLoading,itemTexts:{slashTexts:m.slashTexts},language:c,onSelectPanelApp:S,onSelectSkill:XY.remember,recentSkillValues:y,skillRecords:g}),{favoriteModelValues:T,setModelFavorite:E}=YY((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=SJ(k),ee=CJ(k),j=wJ(k),M=TJ(k),ne=f(j?`chatModelNoOptions`:u?`chatInputPlaceholderCompact`:`chatInputPlaceholder`),re=_.find(e=>e.value===D),ie=re?.thinkingCapability?.supported??[],{handleFilesAdd:ae,handleFileInputChange:oe}=ZY({attachmentSupported:!0,inputBarRef:d,addAttachments:r.addAttachments}),se=(0,P.useCallback)(e=>{!i.selectedSessionKey||!i.selectedSession||te(i.selectedSessionKey,e).catch(()=>void 0)},[i.selectedSession,i.selectedSessionKey]),ce=(0,P.useCallback)(e=>{let t=[...e];r.update(e=>({nodes:t,attachments:bJ(t,e.attachments),text:gJ(t),selectedSkills:_J(t),sendError:null}))},[r]),le=(0,P.useCallback)(e=>{let t=tX(_.find(t=>t.value===e),O);r.update({selectedModel:e,selectedThinkingLevel:t,sendError:null}),$J.remember(e,{namespace:i.sessionTypeState.selectedSessionType}),h(e)||$J.remember(e),se({preferredModel:h(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=>XY.remember(e)),ce(yJ([...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=$Y({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=eX({allSkillsLabel:m.allSkillsLabel,onSelectedKeysChange:de,recentSkillGroupValues:b,recentSkillValues:y,recentSkillsLabel:m.recentSkillsLabel,isSkillsLoading:i.isSkillsLoading,skillRecords:g,selectedSkills:a.selectedSkills}),me=o===`default`&&l===`flat`,he=(0,F.jsx)(YE,{ref:d,surface:me?`embedded`:o,sendError:a.sendError,sendErrorDetailsLabel:f(`chatErrorDetails`,c),topSlot:n.queuedInputs.length>0?(0,F.jsx)(rX,{controller:n}):null,composer:{nodes:[...a.nodes],placeholder:ne,disabled:M,onNodesChange:ce,onFilesAdd:ae,inputSurfaceTriggerSpecs:C.triggerSpecs,onInputSurfaceTriggerChange:w},inputSurface:C.panel??void 0,hint:CY({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:M,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)(gK,{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 lX(e){let{applyPromptSuggestion:t,consumeDraftIntent:n}=e,r=B0(),i=lc();(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 uX(e){if(!e||typeof e!=`object`)return null;let t=e.chatDraft;return!t||typeof t!=`object`?null:t}function dX(e){let{sessionKey:t,setPendingProjectRoot:n,setPendingSessionType:r}=e,i=si(),a=(0,P.useRef)(null);(0,P.useEffect)(()=>{if(t)return;let e=uX(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 fX({inputQuery:e}){let t=lc(),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 pX(e){let{consumeDraftIntent:t=!1,materializationContext:n=null,onSessionMaterialized:r,sessionKey:i,showWelcomeForDraft:a=!0}=e,o=y(),s=I(e=>e.snapshot.selectedAgentId),c=Hq(i??void 0),{inputActions:l,inputSnapshot:u}=cY(),d=nY({sessionKey:i,inputSnapshot:u,setPendingSessionType:l.setPendingSessionType});dX({sessionKey:i,setPendingProjectRoot:l.setPendingProjectRoot,setPendingSessionType:l.setPendingSessionType});let p=Uq(o),m=c.isRunning||d.selectedSession?.status===`running`,h=c.hydrateError?.message??c.snapshot.error?.message??null,g=o.phase===`ready`&&Rq(h)?null:h,_=p?null:o.phase===`ready`?g:Gq({message:g,status:o}),v=zJ({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}),b=(0,P.useRef)(v);(0,P.useEffect)(()=>{b.current=v},[v]);let x=(0,P.useMemo)(()=>({canStopGeneration:v.canStopGeneration,deleteQueuedInput:e=>b.current.deleteQueuedInput(e),editQueuedInput:e=>b.current.editQueuedInput(e),isSending:v.isSending,queuedInputs:v.queuedInputs,send:()=>b.current.send(),sendDisabled:v.sendDisabled,stop:()=>b.current.stop(),stopDisabled:v.stopDisabled}),[v.canStopGeneration,v.isSending,v.queuedInputs,v.sendDisabled,v.stopDisabled]),S=(0,P.useMemo)(()=>qq(iW(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;lX({consumeDraftIntent:t,applyPromptSuggestion:l.applyPromptSuggestion});let D=(0,P.useCallback)(e=>(0,F.jsx)(cX,{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)(fX,{inputQuery:d}),(0,F.jsx)(_K,{isAwaitingAssistantOutput:v.isSending&&m,isHistoryLoading:c.isHydrating,isSending:v.isSending,bottomSlot:E,messages:c.visibleMessages,sessionKey:i,showWelcome:O,welcomeSlot:(0,F.jsx)(dJ,{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 mX(e){return`${e.kind===`directory`?f(`chatWorkspaceOpenDirectory`):f(`chatWorkspaceOpenFile`)}: ${e.name}`}function hX(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function gX(e){return e.error?e.error instanceof Error?e.error.message:String(e.error):null}function _X({fileName:e,isDirectory:t,isExpanded:n}){return t?n?(0,F.jsx)(wo,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,F.jsx)(rn,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,F.jsx)(Wm,{fileName:e})}function vX({browseQuery:e,level:t,onFileOpen:n}){let r=e.data?.entries??[],i=gX(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)(yX,{entry:e,level:t+1,onFileOpen:n},e.path))}function yX({entry:e,level:t,onFileOpen:n}){let r=e.kind===`directory`,[i,a]=(0,P.useState)(!1),o=$s({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":mX(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)(Tt,{className:`h-3.5 w-3.5`}):(0,F.jsx)(ro,{className:`h-3.5 w-3.5`}):null}),(0,F.jsx)(_X,{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)(vX,{browseQuery:o,level:t,onFileOpen:n})}):null]})}function bX({browseQuery:e,onFileOpen:t,renderStatus:n,showRoot:r=!1}){let i=e.data?.entries??[],a=gX(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)(Tt,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}),(0,F.jsx)(wo,{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:hX(e.data.currentPath)})]}),(0,F.jsx)(`div`,{role:`group`,className:`pt-1`,children:i.map(e=>(0,F.jsx)(yX,{entry:e,level:1,onFileOpen:t},e.path))})]}):i.map(e=>(0,F.jsx)(yX,{entry:e,level:0,onFileOpen:t},e.path))})}function xX({name:e,kind:t}){return t===`directory`?(0,F.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600`}):(0,F.jsx)(Wm,{fileName:e,size:`compact`})}function SX({browsePath:e,onBrowsePathChange:t,onClose:n,onFileOpen:r}){let i=$s({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)(ro,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},e.path))})}),(0,F.jsx)(ec,{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)(gn,{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)(xX,{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)(ro,{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 CX({tone:e=`neutral`,value:t}){return(0,F.jsx)(`span`,{className:m(`inline-flex h-5 items-center rounded-sm border px-1.5 text-[10px] font-medium leading-none`,e===`warning`?`border-amber-200 bg-amber-50 text-amber-700`:`border-gray-200 bg-gray-50 text-gray-500`),children:t})}function wX({onFileOpen:e,segment:t}){let[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(t.browsePath);return(0,F.jsxs)(Xe,{open:n,onOpenChange:e=>{e&&a(t.browsePath),r(e)},children:[(0,F.jsx)(Ge,{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)(To,{className:`h-3 w-3 shrink-0`}):t.kind===`directory`&&t.isCurrent?(0,F.jsx)(rn,{className:`h-3 w-3 shrink-0`}):t.isCurrent?(0,F.jsx)(Wm,{fileName:t.label,size:`compact`}):null,(0,F.jsx)(`span`,{children:t.label})]})}),(0,F.jsx)(Gs,{"data-testid":`workspace-breadcrumb-popover`,className:`w-[22rem] rounded-md p-0`,align:`start`,children:(0,F.jsx)(SX,{browsePath:i,onBrowsePathChange:a,onClose:()=>r(!1),onFileOpen:e})})]})}function TX({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)(wX,{segment:n,onFileOpen:t}),r<e.segments.length-1?(0,F.jsx)(ro,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},n.key))}),e.locationLabel||e.truncated?(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:[e.locationLabel?(0,F.jsx)(CX,{value:e.locationLabel}):null,e.truncated?(0,F.jsx)(CX,{tone:`warning`,value:f(`chatWorkspacePreviewTruncated`)}):null]}):null]})})}function EX(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 DX({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 OX(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 kX({contentUrl:e}){let t=(0,P.useRef)(null),n=EX(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(),qn(()=>import(`./docx-preview-eFH9DRsS.js`).then(async t=>{await t.renderAsync(n.data,r,r,{breakPages:!0,inWrapper:!0,ignoreLastRenderedPageBreak:!1}),a||(OX(r),i({contentUrl:e,status:`ready`}))}),__vite__mapDeps([0,1,2])).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)(DX,{status:o}),(0,F.jsx)(`div`,{ref:t,className:`workspace-docx-preview min-h-full`,"data-testid":`workspace-content-docx`})]})}function AX({contentUrl:e}){let t=(0,P.useRef)(null),n=EX(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(),qn(async()=>{let{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}=await import(`./aiden0z-pptx-renderer.es-Bd99vut2.js`);return{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}},__vite__mapDeps([3,1,2])).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)(DX,{status:o}),(0,F.jsx)(`div`,{ref:t,className:`h-full overflow-auto p-4 custom-scrollbar`,"data-testid":`workspace-content-presentation`})]})}var jX=500,MX=100;function NX(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 PX({contentUrl:e}){let t=EX(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 qn(()=>import(`./xlsx-B6zVt1RK.js`).then(i=>{let a=i.read(t.data,{dense:!0,sheetRows:jX+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,jX).map(e=>e.slice(0,MX).map(e=>String(e??``)));return{name:e,rows:r,columnCount:Math.min(MX,r.reduce((e,t)=>Math.max(e,t.length),0)),truncated:n.length>jX||n.some(e=>e.length>MX)}});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)(DX,{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:NX(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 FX(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 IX({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 LX({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)(kX,{contentUrl:e}):t===`spreadsheet`?(0,F.jsx)(PX,{contentUrl:e}):t===`presentation`?(0,F.jsx)(AX,{contentUrl:e}):(0,F.jsx)(IX,{contentUrl:e,label:n})}function RX(e){return[`server-path-read`,e.path?.trim()??``,e.basePath??null]}function zX(e){let t=e.path?.trim()??``;return T({queryKey:RX({path:t,basePath:e.basePath}),queryFn:()=>Me({path:t,basePath:e.basePath}),enabled:(e.enabled??!0)&&t.length>0,staleTime:0})}function BX(e){return e.serverKind?e.serverKind:/\.mdx?$/i.test(e.path)?`markdown`:`text`}function VX(e,t){return t<=0?e:`${e}${e.includes(`?`)?`&`:`?`}refresh=${t}`}function HX(e){let{languageHint:t,line:n,path:r,text:i}=e,a=n??1;return{key:`preview:${r}`,path:r,display:`preview`,lines:bH({text:i,kind:`context`,oldStartLine:a,newStartLine:a}),rawText:i,languageHint:t??null,oldStartLine:a,newStartLine:a}}function UX(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=wH({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 WX({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 GX({diffBlock:e}){return e?(0,F.jsx)(KX,{block:e}):(0,F.jsx)(WX,{text:f(`chatWorkspaceDiffEmpty`)})}function KX({block:e}){return(0,F.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar bg-white`,children:(0,F.jsx)(aB,{block:e,layout:`workspace`})})}function qX({contentUrl:e,contentUrlKind:t,contentLabel:n,directoryQuery:r,fileBasePath:i,onFileOpen:a,previewBlock:o,previewKind:s,previewViewer:c,previewQuery:l,previewText:u}){return e&&t?(0,F.jsx)(LX,{contentUrl:e,kind:t,label:n}):r?.data?(0,F.jsx)(bX,{browseQuery:r,onFileOpen:a,renderStatus:e=>(0,F.jsx)(WX,{...e})}):r?.isLoading&&l?.error&&!o?(0,F.jsx)(WX,{text:f(`chatWorkspaceLoadingDirectory`)}):(r?.isLoading||l?.isLoading)&&!o?(0,F.jsx)(WX,{text:f(`chatWorkspaceLoadingPreview`)}):l?.data?.kind===`binary`?(0,F.jsx)(WX,{text:f(`chatWorkspacePreviewUnsupported`)}):l?.error&&!o?(0,F.jsx)(WX,{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)(LR,{text:u,role:`assistant`,texts:{copyCodeLabel:f(`chatCodeCopy`),copiedCodeLabel:f(`chatCodeCopied`)},onFileOpen:a,resolveFileContentUrl:e=>Pe(e.path,i)})}):o?(0,F.jsx)(KX,{block:o}):(0,F.jsx)(WX,{text:f(`chatWorkspacePreviewEmpty`)})}function JX({file:e,refreshVersion:t=0,sessionProjectRoot:n,sessionWorkingDir:r,onFileOpen:i}){let a=e.viewMode===`preview`,o=e.contentUrl?.trim()||null,s=a&&!o,c=zX({path:e.path,basePath:r,enabled:s}),l=$s({path:e.path,basePath:r,includeFiles:!0,enabled:s}),u=(0,P.useMemo)(()=>e.viewMode===`diff`?UX(e):null,[e]),d=a?c?.data?.text??e.rawText??null:null,f=BX({path:c?.data?.resolvedPath??e.path,serverKind:c?.data?.kind}),p=o?FX({path:e.path,mimeType:e.mimeType}):null,m=l?.data?.currentPath??c?.data?.resolvedPath??e.path,h=l?.data?`directory`:`file`,g=Lu(m,e.previewViewer),_=FX({path:m}),v=Pe(e.path,r),y=!o&&a&&v&&e.previewViewer!==`source`&&_!==`other`&&(_!==`html`||g===`rendered`)&&v?VX(v,t):null,b=o??y,x=p??(y?_:null),S=(0,P.useMemo)(()=>!a||!d||b?null:HX({path:c?.data?.resolvedPath??e.path,text:d,languageHint:c?.data?.languageHint??null,line:e.line}),[b,e.line,e.path,a,c?.data?.languageHint,c?.data?.resolvedPath,d]),C=!b&&!!c?.data?.truncated,w=n??r;return(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-white`,children:[(0,F.jsx)(TX,{breadcrumb:(0,P.useMemo)(()=>Ac({path:m,kind:h,sessionProjectRoot:w,line:e.line,column:e.column,truncated:C}),[w,e.column,e.line,C,h,m]),onFileOpen:i}),(0,F.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:e.viewMode===`diff`?(0,F.jsx)(GX,{diffBlock:u}):(0,F.jsx)(qX,{contentUrl:b,contentUrlKind:x,contentLabel:e.label?.trim()||m,directoryQuery:l,fileBasePath:r,onFileOpen:i,previewBlock:S,previewKind:f,previewViewer:g,previewQuery:c,previewText:d})})]})}function YX(e={all:!0}){return T({queryKey:[`cron`,e],queryFn:()=>ae(e),staleTime:1e4})}function XX(){let e=fe();return{onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),E.success(f(`configSavedApplied`))},onError:e=>{E.error(f(`configSaveFailed`)+`: `+e.message)}}}function ZX(){return je({mutationFn:({id:e})=>D(e),...XX()})}function QX(){return je({mutationFn:({id:e,enabled:t})=>ce(e,{enabled:t}),...XX()})}function $X(){return je({mutationFn:({id:e,force:t})=>se(e,{force:t}),...XX()})}function eZ(e){return l(e??void 0)}function tZ(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 nZ(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 iZ=[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],aZ=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function oZ(e){return e.padStart(2,`0`)}function sZ(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=`${oZ(i)}:${oZ(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?iZ[e]:aZ[e];return t?`${t} ${l}`:null}return r!==`*`&&i!==`*`&&a!==`*`&&o===`*`&&s===`*`?c?`每月 ${a} 日 ${l}`:`monthly ${a} ${l}`:null}function cZ(e){let t=r(),n=t===`zh`,{schedule:i}=e;if(i.kind===`cron`)return i.expr?sZ(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`} ${nZ(i.atMs)}`:`-`}function lZ(e){return e.payload.sessionId?.trim()||`cron:${e.id}`}function uZ(e,t){let n=t?.trim();return!!(n&&e.payload.sessionId?.trim()===n)}function dZ(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 fZ(e,t){return t===`all`?!0:t===`enabled`?e.enabled:!e.enabled}function pZ({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 mZ(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)(Tt,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):(0,F.jsx)(ro,{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)(pZ,{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)(Re,{checked:t.enabled,onCheckedChange:e=>i(t,e)}),(0,F.jsxs)(Xe,{open:s,onOpenChange:c,children:[(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsx)(C,{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)(ft,{className:`h-4 w-4`})})}),(0,F.jsxs)(Je,{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)(Zo,{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)(xn,{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)(no,{className:`h-3 w-3 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`font-mono text-foreground/80`,children:cZ(t)})]}),t.state.nextRunAt?(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(co,{className:`h-3 w-3 text-muted-foreground/70`}),(0,F.jsx)(`span`,{children:tZ(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)(xt,{delayDuration:200,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{asChild:!0,children:(0,F.jsx)(`span`,{className:`inline-flex items-center gap-0.5 text-orange-500 cursor-help`,children:(0,F.jsx)(Qt,{className:`h-3 w-3`})})}),(0,F.jsx)(vt,{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:tZ(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:lZ(t),children:lZ(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:eZ(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:eZ(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:eZ(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 hZ(){let[e,t]=(0,P.useState)(``),[n,r]=(0,P.useState)(`all`),i=YX({all:!0}),a=ZX(),o=QX(),s=$X(),{confirm:c,ConfirmDialog:l}=$t(),u=(0,P.useMemo)(()=>(i.data?.jobs??[]).filter(t=>dZ(t,e)).filter(e=>fZ(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)(He,{fullHeight:!0,children:[(0,F.jsx)(j,{title:f(`cronPageTitle`),description:f(`cronPageDescription`),actions:(0,F.jsx)(C,{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)(vn,{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)(ot,{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)(ie,{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)(Ut,{value:n,onValueChange:e=>r(e),children:[(0,F.jsx)(Ft,{className:`w-full`,children:(0,F.jsx)(Ot,{placeholder:f(`cronStatusLabel`)})}),(0,F.jsxs)(Rt,{children:[(0,F.jsx)(Vt,{value:`all`,children:f(`cronStatusAll`)}),(0,F.jsx)(Vt,{value:`enabled`,children:f(`cronStatusEnabled`)}),(0,F.jsx)(Vt,{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)(vn,{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)(Lo,{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)(mZ,{job:e,onDelete:d,onRun:h,onToggle:p},e.id))})}),(0,F.jsx)(l,{})]})}function gZ({jobs:e}){let t=ZX(),{confirm:n,ConfirmDialog:r}=$t(),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)(C,{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)(xn,{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`),`:`]}),` `,cZ(e)]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[f(`cronNextRun`),`:`]}),` `,eZ(e.state.nextRunAt)]}),(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[f(`cronLastRun`),`:`]}),` `,eZ(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`),`:`]}),` `,lZ(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 _Z({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)(ro,{className:`h-4 w-4 shrink-0 text-gray-300 transition-transform group-hover:translate-x-0.5 group-hover:text-gray-500`})]})}function vZ({childSessionTabs:e,sessionCronJobs:t,sessionKey:n}){let r=lc();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)(_Z,{count:e.length,description:f(`chatWorkspaceChildSessionsDescription`),icon:(0,F.jsx)(Oo,{className:`h-4 w-4`}),title:f(`chatWorkspaceChildSessions`),onClick:()=>{n&&r.chatThreadManager.openChildSessions(n)}}),(0,F.jsx)(_Z,{count:t.length,description:f(`chatWorkspaceSessionCronJobsDescription`),icon:(0,F.jsx)(qa,{className:`h-4 w-4`}),title:f(`chatWorkspaceSessionCronJobs`),onClick:()=>{n&&r.chatThreadManager.openSessionCronPanel(n)}}),(0,F.jsx)(_Z,{description:f(`chatWorkspaceProjectFilesDescription`),icon:(0,F.jsx)(To,{className:`h-4 w-4`}),title:f(`chatWorkspaceProjectFiles`),onClick:()=>{n&&r.chatThreadManager.openProjectFiles(n)}})]})]})})}function yZ({childSessionTabs:e}){let t=lc();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)(Oo,{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)(ro,{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 bZ({projectRoot:e,workingDir:t}){let n=lc(),r=e??t,i=$s({path:r,includeFiles:!0,enabled:!!r});return r?(0,F.jsx)(bX,{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 xZ({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 SZ({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)(xZ,{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 CZ(){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)(Vo,{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 wZ({activeSelection:e,childSessionTabs:t,filePreviewRefreshVersion:n,sessionKey:r,sessionCronJobs:i,sessionProjectRoot:a,sessionWorkingDir:o}){let s=lc();return e.kind===`overview`?(0,F.jsx)(vZ,{childSessionTabs:t,sessionCronJobs:i,sessionKey:r}):e.kind===`project-files`?(0,F.jsx)(bZ,{projectRoot:a,workingDir:o}):e.kind===`child-sessions`?(0,F.jsx)(yZ,{childSessionTabs:t}):e.kind===`side-chat-draft`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(CZ,{}),(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,F.jsx)(pX,{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)(SZ,{tab:e.tab}),(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,F.jsx)(pX,{sessionKey:e.tab.sessionKey})})]}):e.kind===`file`?(0,F.jsx)(JX,{file:e.file,refreshVersion:n,sessionProjectRoot:a,sessionWorkingDir:o,onFileOpen:s.chatThreadManager.openFilePreview}):(0,F.jsx)(gZ,{jobs:i})}function TZ(e){return e.index>0&&e.entries.length>0}function EZ(e){return e.index>=0&&e.index<e.entries.length-1}function DZ(e,t,n=Object.is){let r=AZ(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 OZ(e,t){let n=AZ(e),r=t===`back`?n-1:n+1,i=e.entries[r];return i?{history:{entries:e.entries,index:r},entry:i}:null}function kZ(e,t,n){let r=AZ(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 AZ(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 jZ({sessionKey:e,childSessionTabs:t,activeChildSessionKey:n,activeSideChatDraft:r,workspaceFileTabs:i,activeWorkspaceFileKey:a,workspaceNavigationHistory:o=[],workspaceNavigationHistoryIndex:s=0,activePanelKind:c,sessionCronJobs:l=[],sessionProjectRoot:u,sessionWorkingDir:d,workspacePanelWidth:f=480,displayMode:p=`docked`}){let h=lc(),g=fe(),[_,v]=(0,P.useState)(!1),[y,b]=(0,P.useState)(0),x=Fu(t),S=I(e=>e.optimisticReadAtBySessionKey),C=Vu({activeChildSessionKey:n,activeSideChatDraft:r,activeWorkspaceFileKey:a,activePanelKind:c,childSessionTabs:x,workspaceFileTabs:i}),w={entries:o,index:s};(0,P.useEffect)(()=>{h.chatThreadManager.syncVisibleWorkspaceSelection(C)},[C,h]);let T=(0,P.useMemo)(()=>Hu({resolvedChildTabs:x,activeSideChatDraft:r,workspaceFileTabs:i,activeSelection:C,optimisticReadAtBySessionKey:S,onSelectSession:h.chatThreadManager.selectChildSessionDetail,onSelectFile:h.chatThreadManager.selectWorkspaceFile,onOpenFileViewer:h.chatThreadManager.openWorkspaceFileViewer,onCloseFile:h.chatThreadManager.closeWorkspaceFile,onSelectOverview:()=>{e&&h.chatThreadManager.openWorkspaceOverview(e)},onSelectChildSessions:()=>{e&&h.chatThreadManager.openChildSessions(e)},onSelectProjectFiles:()=>{e&&h.chatThreadManager.openProjectFiles(e)},onSelectCronJobs:()=>{e&&h.chatThreadManager.openSessionCronPanel(e)}}),[C,r,S,h.chatThreadManager,x,e,i]);if(!C)return null;let E=p===`docked`&&_,D=p===`overlay`||E,O=C.kind===`file`&&C.file.viewMode===`preview`?C.file:null,k=O?()=>{g.invalidateQueries({queryKey:RX({path:O.path,basePath:d})}),g.invalidateQueries({queryKey:Qs({path:O.path,basePath:d,includeFiles:!0})}),b(e=>e+1)}:void 0;return(0,F.jsxs)(_t,{"data-testid":`chat-session-workspace-panel`,className:m(D?`bg-white`:`hidden border-gray-200/70 bg-white/95 backdrop-blur-sm md:flex`,E?`shadow-xl`:null),defaultWidth:f,width:f,minWidth:360,maxWidth:860,onWidthCommit:h.chatThreadManager.setWorkspacePanelWidth,overlay:D,overlayScope:E?`container`:`viewport`,children:[(0,F.jsx)(qm,{tabs:T,canGoBack:TZ(w),canGoForward:EZ(w),isMaximized:E,onGoBack:h.chatThreadManager.goBackWorkspacePanel,onGoForward:h.chatThreadManager.goForwardWorkspacePanel,onRefreshFile:k,onToggleMaximize:p===`docked`?()=>v(e=>!e):void 0,onClose:h.chatThreadManager.closeWorkspacePanel}),(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-white`,children:(0,F.jsx)(wZ,{activeSelection:C,childSessionTabs:x,filePreviewRefreshVersion:y,sessionKey:e,sessionCronJobs:l,sessionProjectRoot:u,sessionWorkingDir:d})})]})}var MZ=[];function NZ(e,t){let n=Wl(e=>e.snapshot.sessionsQuery?.data?.sessions??MZ),r=(0,P.useMemo)(()=>{let r=e.childSessionTabs.filter(e=>e.parentSessionKey===t),i=new Set(r.map(e=>e.sessionKey));return[...r,...el(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=YX({all:!0});return{childSessionTabs:r,activeSideChatDraft:a,workspaceFileTabs:i,sessionCronJobs:(0,P.useMemo)(()=>(o.data?.jobs??[]).filter(e=>uZ(e,t)),[o.data?.jobs,t]),showWorkspacePanel:e.workspacePanelParentKey===t&&e.activeWorkspacePanelKind!=null}}function PZ({layoutMode:e,sessionKey:t}){let n=L(e=>e.snapshot),r=eu(t),{childSessionTabs:i,activeSideChatDraft:a,workspaceFileTabs:o,sessionCronJobs:s,showWorkspacePanel:c}=NZ(n,t);return c?(0,F.jsx)(jZ,{sessionKey:t,childSessionTabs:i,activeChildSessionKey:n.activeChildSessionKey??null,activeSideChatDraft:a,workspaceFileTabs:o,activeWorkspaceFileKey:n.activeWorkspaceFileKey??null,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 FZ({layoutMode:e=`desktop`,onBackToList:t}){let n=lc(),r=$l(),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)(ju,{}),(0,F.jsx)(Au,{layoutMode:e,onBackToList:t}),(0,F.jsx)(pX,{consumeDraftIntent:!0,sessionKey:i,onSessionMaterialized:a})]}),(0,F.jsx)(PZ,{layoutMode:e,sessionKey:i})]}):(0,F.jsx)(Nu,{})}function IZ(){let e=qs(),[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 LZ=`nextclaw.ui.theme`,RZ=`work`,zZ=[{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`}],BZ=zZ.map(({value:e})=>e),VZ=zZ.map(({value:e,labelKey:t})=>({value:e,labelKey:t}));function HZ(e){return typeof e==`string`?BZ.includes(e)?e:e===`leaf`?`warm`:null:null}function UZ(e){return zZ.find(t=>t.value===e)?.appearance??`light`}var WZ=new class{constructor(){this.activeTheme=RZ,this.initialized=!1,this.listeners=new Set,this.resolveInitialTheme=()=>{if(typeof window>`u`)return RZ;try{let e=HZ(window.localStorage.getItem(LZ));if(e)return e}catch{}return RZ},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=UZ(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(LZ,e)}catch{}}}};function GZ(){return WZ.initializeTheme()}function KZ(){return WZ.getTheme()}function qZ(e){WZ.setTheme(e)}function JZ(e){return WZ.subscribeThemeChange(e)}var YZ=`nextclaw-pwa-install-banner-dismissed`,XZ=`nextclaw-pwa-install-banner-dismissed-until`;function ZZ(){let e=eQ();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:tQ(e):!1}function QZ(){let e=eQ();e?.setItem(YZ,`1`),e?.removeItem(XZ)}function $Z(){let e=eQ();e?.removeItem(YZ),e?.removeItem(XZ)}function eQ(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function tQ(e){let t=e.getItem(XZ);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(XZ),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(YZ,`1`),!0)}function nQ(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:ZZ()}}var rQ=p(()=>nQ()),iQ=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(),rQ.setState(nQ())},this.refreshState=()=>{let e=this.resolveInstallability();rQ.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:ZZ()}))},this.dismissInstallPrompt=()=>{QZ(),rQ.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`?($Z(),this.refreshState(),E.success(f(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,$Z(),rQ.setState({dismissedInstallPrompt:!0}),E.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 aQ(){let e=rQ(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:oQ(e)})}function oQ(e){return f(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function sQ(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 cQ(){let e=rQ(e=>e.installability),t=rQ(e=>e.installMethod),n=rQ(e=>e.blockedReason);return(0,F.jsxs)(k,{children:[(0,F.jsxs)(w,{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)(O,{children:f(`pwaInstallTitle`)}),(0,F.jsx)(x,{children:f(`pwaInstallDescription`)})]}),(0,F.jsx)(aQ,{})]}),(0,F.jsxs)(ee,{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:sQ(e,t,n)})}),e===`available`&&t===`prompt`?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,F.jsxs)(C,{type:`button`,className:`gap-2`,onClick:()=>{iQ.promptInstall()},children:[(0,F.jsx)(en,{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)(os,{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 lQ(){let e=rQ(e=>e.installability),t=rQ(e=>e.installMethod),n=rQ(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:()=>{iQ.dismissInstallPrompt()},children:(0,F.jsx)(Sn,{className:`h-4 w-4`})})]}),(0,F.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,F.jsxs)(C,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{iQ.promptInstall()},children:[(0,F.jsx)(en,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,F.jsx)(C,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{iQ.dismissInstallPrompt()},children:f(`pwaInstallDismiss`)})]})]})}var uQ=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)))}}},dQ=!1;function fQ(){dQ||typeof window>`u`||(dQ=!0,iQ.start(),uQ.start())}var pQ={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,probe:`#FEFCF6`},mQ=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=pQ[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=UZ(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(HZ(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)}}},hQ=(0,P.createContext)(null);function gQ({children:e}){let[t,n]=(0,P.useState)(()=>GZ());(0,P.useEffect)(()=>{mQ.syncTheme(t)},[t]),(0,P.useEffect)(()=>JZ(e=>{n(e)}),[]);let r=(0,P.useCallback)(e=>{qZ(e),n(KZ())},[]),i=(0,P.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,F.jsx)(hQ.Provider,{value:i,children:e})}function _Q(){let e=(0,P.useContext)(hQ);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function vQ({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)(ie,{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)(mt,{icon:(0,F.jsx)(Kt,{className:`h-3.5 w-3.5`}),label:f(`save`),tooltip:!1,onClick:()=>void i(),disabled:n}),(0,F.jsx)(mt,{icon:(0,F.jsx)(Sn,{className:`h-3.5 w-3.5`}),label:f(`cancel`),tooltip:!1,onClick:a,disabled:n})]})]})]})}function yQ({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)(Cu,{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)(kl,{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)(Oo,{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)(jl,{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)(mt,{size:`sm`,tone:`strong`,icon:(0,F.jsx)(gt,{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)(mt,{size:`sm`,tone:`strong`,icon:(0,F.jsx)(Xo,{className:`h-3.5 w-3.5`}),label:f(`edit`),tooltipSide:`right`,onClick:e=>{e.stopPropagation(),g()}})]})]})}function bQ({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)(vQ,{sessionKey:e,draftLabel:h,isSaving:g,onDraftLabelChange:b,onSave:x,onCancel:S}):(0,F.jsx)(yQ,{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=dc(y)??`${T?.trim()?`${T} · `:``}${y.messageCount}`;return(0,F.jsx)(bQ,{sessionKey:y.key,active:x,showUnreadDot:sl({active:x,lastMessageAt:y.lastMessageAt,readAt:C,runStatus:b}),runStatus:b,context:Tl(y,l),isPinned:u,title:d(y),previewText:E,trailingText:hc(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 SQ={maxHeight:Ue(`18rem`)};function CQ({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:SQ,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)(eJ,{disabled:e.ready===!1,option:e,selected:e.value===r,onSelect:()=>t(e.value)},e.value))]})}var wQ=`w-[56px]`,TQ=`px-2`,EQ=`h-9 w-9 rounded-xl`,DQ=`h-4 w-4`,OQ=`space-y-1`,kQ=`gap-1`,AQ=`[mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)] [-webkit-mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)]`,jQ=`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`,MQ=`bg-gray-200/80 text-gray-900`,NQ=`brandSoft`,PQ={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 FQ(e){let t=e.sessionTypeOptions.find(t=>t.value===e.defaultSessionType);return[...t?[t]:[],...e.nonDefaultSessionTypeOptions]}function IQ({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)(kl,{icon:{kind:`runtime-image`,src:e.icon.src,alt:e.icon.alt??null,name:e.label},className:`h-4 w-4`})}):(0,F.jsx)(Qa,{className:`h-4 w-4 shrink-0`})}function LQ(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=PQ[NQ];return u?(0,F.jsx)(`div`,{className:`px-2 pb-2`,children:(0,F.jsxs)(`div`,{className:m(`flex flex-col items-center`,kQ),children:[(0,F.jsx)(mt,{icon:(0,F.jsx)(_n,{className:DQ}),label:f(`chatSidebarNewTask`),className:m(EQ,jQ),onClick:()=>{o(!1),s(n)}}),d?(0,F.jsxs)(Xe,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsx)(mt,{icon:(0,F.jsx)(IQ,{option:r}),label:f(`chatSessionTypeLabel`),className:m(EQ,jQ)})}),(0,F.jsx)(Gs,{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)(CQ,{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)(C,{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)(_n,{className:`mr-2 h-4 w-4`}),f(`chatSidebarNewTask`)]}),d?(0,F.jsxs)(Xe,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsx)(mt,{icon:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,F.jsx)(IQ,{option:r}),(0,F.jsx)(Tt,{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)(Gs,{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)(CQ,{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)(ot,{className:`pointer-events-none absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground/70`}),(0,F.jsx)(ie,{value:t,onChange:e=>l(e.target.value),placeholder:f(`chatSidebarSearchPlaceholder`),className:`h-9 rounded-lg pl-8 text-xs`})]})})]})}function RQ(e){let{query:t,defaultSessionType:n,sessionTypeOptions:r,nonDefaultSessionTypeOptions:i,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:s,onQueryChange:c}=e,l=FQ({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)(ot,{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)(ie,{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)(Xe,{open:a,onOpenChange:o,children:[(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsx)(mt,{icon:(0,F.jsx)(_n,{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)(Gs,{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)(CQ,{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)(mt,{icon:(0,F.jsx)(_n,{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 zQ(){return T({queryKey:[`app-meta`],queryFn:g,staleTime:1/0})}var BQ={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 VQ(){let e=M(),t=e.actionLabel===f(`runtimeStatusRestartAction`),n=()=>{e.tone!==`healthy`&&ne.requestRuntimeBootstrapProbeNow()},r=async()=>{if(t)try{let e=await ne.runRuntimeControlAction(`restart-service`);E.success(e.message)}catch(e){let t=e instanceof Error?e.message:f(`runtimeControlActionFailed`);E.error(`${f(`runtimeControlActionFailed`)}: ${t}`)}};return(0,F.jsxs)(Xe,{children:[(0,F.jsx)(Ge,{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`,BQ[e.tone])})})}),(0,F.jsxs)(Je,{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 HQ({className:e,density:t=`sidebar`,suffix:n}){let{data:r}=zQ(),i=r?.name??`NextClaw`,a=r?.productVersion?.trim(),o=a?`v${a}`:null,s=n??(0,F.jsx)(VQ,{}),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)(UQ,{versionLabel:o,density:t}):null]}),(0,F.jsx)(WQ,{}),s?(0,F.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:s}):null]})]})}function UQ({versionLabel:e,density:t}){let[n,r]=(0,P.useState)(!1);return(0,F.jsxs)(`span`,{className:`relative min-w-0 flex-1`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),children:[(0,F.jsx)(`span`,{tabIndex:0,"aria-label":e,className:m(`block min-w-0 truncate font-medium text-gray-500 outline-none`,`text-[12px]`),children:e}),n?(0,F.jsx)(`span`,{className:`pointer-events-none absolute left-0 top-full z-[var(--z-tooltip)] mt-1 w-max max-w-none whitespace-nowrap rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md`,children:e}):null]})}function WQ(){let{supported:e,busyAction:t,snapshot:n}=me();return!e||!n?null:n.status===`downloading`||n.status===`blocked`||n.status===`failed`?(0,F.jsx)(GQ,{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 Ve.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 Ve.downloadUpdate(),children:f(t===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)}):null}function GQ({snapshot:e}){if(e.status===`blocked`||e.status===`failed`)return(0,F.jsx)(KQ,{snapshot:e});let t=e.status===`downloading`?qQ(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 KQ({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)(`span`,{role:`img`,"aria-label":t,title:i,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`,children:`!`})}function qQ(e){let t=e.progress?.percent;return t==null?f(`desktopUpdatesInlineDownloading`):f(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(t))}var JQ={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 YQ({status:e,className:t}){let n=JQ[e],r=f(e===`connected`?`connected`:e===`disconnected`?`disconnected`:`connecting`);return(0,F.jsx)(xt,{delayDuration:250,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{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)(gn,{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)(vt,{side:`bottom`,className:`text-xs`,children:r})]})})}function XQ({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 ZQ={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 QQ(e){return ZQ[e]}function $Q(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function e$({children:e,label:t,side:n=`right`}){return(0,F.jsx)(xt,{delayDuration:250,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{asChild:!0,children:e}),(0,F.jsx)(vt,{side:n,className:`text-xs`,children:t})]})})}function t$({to:e,label:t,icon:n,density:r=`default`,className:i,collapsed:a=!1}){let o=QQ(r),{pathname:s}=si(),c=$Q(s,e),l=(0,F.jsxs)(ka,{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(EQ,`justify-center px-0 py-0`):o.row,c?a?MQ:`bg-gray-200/80 text-gray-900 shadow-sm`:a?jQ:`text-muted-foreground hover:bg-gray-200/60 hover:text-gray-900`,i),children:[(0,F.jsx)(n,{className:m(a?DQ: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)(e$,{label:t,children:l}):l}function n$({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)(t$,{to:t.target,label:t.label,icon:t.icon,density:n,collapsed:e})},t.target))})}function r$({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=QQ(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(EQ,`justify-center px-0 py-0`,jQ):d.row,i),"data-testid":c,children:[(0,F.jsx)(t,{className:m(u?DQ: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)(e$,{label:e,children:f}):f}function i$({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:a=`default`,children:o,collapsed:s=!1}){let c=QQ(a),l=(0,F.jsxs)(Ft,{"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(EQ,`justify-center px-0 py-0`,jQ):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?DQ: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)(Ut,{value:n,onValueChange:i,children:[s?(0,F.jsx)(e$,{label:`${e}: ${r}`,children:l}):l,(0,F.jsx)(Rt,{children:o})]})}function a$(e,t){return t.some(t=>t.value===e)?e:t[0]?.value??e}function o$(e){let{groups:t,defaultSessionType:n,sessionTypeOptions:r,renderSessionItem:i}=e,a=lc(),o=I(e=>e.snapshot.collapsedProjectRoots),[s,c]=(0,P.useState)(null),l=(0,P.useMemo)(()=>a$(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)(rn,{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)(ro,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):(0,F.jsx)(Tt,{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)(Xe,{open:s===e.projectRoot,onOpenChange:t=>{c(t?e.projectRoot:null)},children:[(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsx)(mt,{icon:(0,F.jsx)(_n,{className:`h-3.5 w-3.5`}),label:t})}),(0,F.jsx)(Gs,{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)(CQ,{options:r,selectedSessionType:l,onSelect:t=>{a.chatSessionListManager.createSession(t,e.projectRoot),c(null)}})})]}):(0,F.jsx)(mt,{icon:(0,F.jsx)(_n,{className:`h-3.5 w-3.5`}),label:t,onClick:()=>a.chatSessionListManager.createSession(l,e.projectRoot)}),(0,F.jsx)(mt,{icon:(0,F.jsx)(gt,{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 s$({label:e}){return(0,F.jsxs)(`div`,{className:`p-4 text-center`,children:[(0,F.jsx)(Ho,{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 c$({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)(s$,{label:f(`chatSidebarProjectViewEmpty`)}):(0,F.jsx)(o$,{groups:i,defaultSessionType:e,sessionTypeOptions:o,renderSessionItem:a}):t.length===0?(0,F.jsx)(s$,{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 l$({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)(Xe,{open:e,onOpenChange:t,children:[p?(0,F.jsx)(xt,{delayDuration:250,children:(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{asChild:!0,children:(0,F.jsx)(Ge,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":f(`settingsMenu`),className:m(`flex items-center justify-center`,EQ,jQ),children:(0,F.jsx)(cn,{className:m(DQ,`shrink-0 text-muted-foreground`)})})})}),(0,F.jsx)(vt,{side:`right`,className:`text-xs`,children:f(`settingsMenu`)})]})}):(0,F.jsx)(Ge,{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)(cn,{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)(Gs,{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)(Aa,{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)(cn,{className:`h-4 w-4 text-muted-foreground/70`}),(0,F.jsx)(`span`,{className:`flex-1 text-left`,children:f(`settings`)})]}),[{key:`docs`,icon:wt,label:f(`docBrowserHelp`),action:u},{key:`apps`,icon:st,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)(u$,{icon:Go,label:f(`theme`),options:i,value:n,valueLabel:r,onSelect:a,onCloseMenu:()=>t(!1)}),(0,F.jsx)(u$,{icon:No,label:f(`language`),options:c,value:o,valueLabel:s,onSelect:l,onCloseMenu:()=>t(!1)})]})]})}function u$({icon:e,label:t,options:n,value:r,valueLabel:i,onSelect:a,onCloseMenu:o}){return(0,F.jsxs)(Ut,{value:r,onOpenChange:e=>{e||o()},onValueChange:e=>a(e),children:[(0,F.jsxs)(Ft,{"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)(ro,{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)(Rt,{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)(Vt,{value:e.value,className:`text-[13px]`,children:e.label},e.value))})]})}var d$=p(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),f$=new class{constructor(){this.start=async()=>{let e=this.getDesktopApi();if(!e){this.markUnsupported();return}d$.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let t=await e.getPresenceState();d$.setState({supported:!0,initialized:!0,busyAction:null,snapshot:t})}catch(e){d$.setState({supported:!0,initialized:!0,busyAction:null}),E.error(`${f(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.markUnsupported=()=>{d$.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async e=>{let t=this.getDesktopApi();if(!t)throw Error(f(`runtimePresenceLaunchAtLoginUnavailable`));d$.setState({busyAction:`saving-preferences`});try{let n=await t.updatePresencePreferences(e);return d$.setState({supported:!0,initialized:!0,snapshot:n}),E.success(f(`runtimePresenceSaved`)),n}catch(e){throw E.error(`${f(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(e)}`),e}finally{d$.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:f(`error`)}},p$=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){p$.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=e.onUpdateStateChanged(e=>{p$.setState({supported:!0,initialized:!0,snapshot:e})}),p$.setState({supported:!0,initialized:!1});try{let t=await e.getUpdateState();p$.setState({supported:!0,initialized:!0,snapshot:t})}catch(e){p$.setState({supported:!0,initialized:!0}),E.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`){E.success(f(`desktopUpdatesAlreadyLatest`));return}if(e.status===`update-available`){E.success(f(`desktopUpdatesAvailable`).replace(`{version}`,e.availableVersion??f(`desktopUpdatesUnknownVersion`)));return}if(e.status===`downloaded`){E.success(f(`desktopUpdatesReadyToApply`));return}e.status===`failed`&&e.errorMessage&&E.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`&&E.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(p$.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){E.success(f(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(e)).replace(`{version}`,t.availableVersion));return}E.success(f(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(e)))},this.runSnapshotCommand=async(e,t,n)=>{let r=this.getDesktopApi();if(!r)throw Error(f(`desktopUpdatesDesktopOnlyDescription`));p$.setState({busyAction:e});try{let e=await n(r);return p$.setState({snapshot:e}),e}catch(e){throw E.error(`${t}: ${this.getErrorMessage(e)}`),e}finally{p$.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 m$(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function h$(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 _$(e){return[{target:`/chat`,label:e(`chat`),icon:Bo},{target:`/skills`,label:e(`marketplaceFilterSkills`),icon:eo},{target:`/agents`,label:e(`agentsPageTitle`),icon:Qa},{target:`/settings`,label:e(`settings`),icon:cn}]}function v$(e){return[{target:`/chat`,label:e(`chat`),icon:Bo},{target:`/chat/cron`,label:e(`cron`),icon:qa},{target:`/chat/skills`,label:e(`marketplaceFilterSkills`),icon:eo},{target:`/agents`,label:e(`agentsPageTitle`),icon:Qa}]}function y$(e){return[{target:`/model`,label:e(`model`),icon:po},{target:`/providers`,label:e(`providers`),icon:yn},{target:`/channels`,label:e(`channels`),icon:un},{target:`/search`,label:e(`searchChannels`),icon:ot},{target:`/appearance`,label:e(`appearance`),icon:Go},{target:`/security`,label:e(`security`),icon:as},{target:`/runtime`,label:e(`runtime`),icon:po},{target:`/updates`,label:e(`updates`),icon:en},{target:`/remote`,label:e(`remote`),icon:ms},{target:`/secrets`,label:e(`secrets`),icon:fn},{target:`/marketplace/mcp`,label:e(`marketplaceFilterMcp`),icon:gs}]}function b$(e){let t=y$(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:No},...y$(e)]}function S$(e){let t=e.toLowerCase();return t===`/settings`?!0:x$(e=>e).some(e=>m$(t,e.target))}function C$(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(m$(n,e.target))return{title:e.label,backTarget:`/settings`,backLabel:t(`settings`)};return{title:t(`settings`),backTarget:null,backLabel:null}}function w$(){let{language:e,setLanguage:t}=Zt();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 T$(){let{currentLanguage:e,currentLanguageLabel:t,languageOptions:n,selectLanguage:r}=w$();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)(No,{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)(Kt,{className:`h-4 w-4 text-gray-700`}):null]},t.value)})})]})}function E$(e,t){if(!e)return{items:v$(t),density:`default`};let n=b$(t);return{items:n.flatMap(e=>e.items),sections:n,density:`compact`}}function D$({isCollapsed:e,onToggle:t}){let n=f(e?`sidebarExpand`:`sidebarCollapse`);return(0,F.jsx)(mt,{icon:(0,F.jsx)(e?qo:Ko,{className:DQ}),label:n,className:m(jQ,e&&`h-9 w-9 rounded-xl`),onClick:t})}function O$({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`,kQ):`gap-2 px-1`),"data-testid":`settings-sidebar-header`,children:[e?(0,F.jsx)(D$,{isCollapsed:e,onToggle:t}):null,(0,F.jsxs)(Aa,{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(EQ,jQ,`justify-center p-0`):`gap-1.5 px-1 py-1`),children:[(0,F.jsx)(at,{className:m(e?DQ:`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)(D$,{isCollapsed:e,onToggle:t})})]})]})})}function k$({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)(D$,{isCollapsed:e,onToggle:t}):(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(HQ,{className:`flex min-w-0 flex-1 items-center gap-2.5 cursor-pointer`}),(0,F.jsx)(D$,{isCollapsed:e,onToggle:t})]})})}function A$({isSettingsMode:e,isCollapsed:t,onToggle:n}){return e?(0,F.jsx)(O$,{isCollapsed:t,onToggle:n}):(0,F.jsx)(k$,{isCollapsed:t,onToggle:n})}function j$({isSettingsMode:e,isCollapsed:t,items:n,sections:r,density:i}){let a=m(t?m(OQ,`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`,AQ),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)(n$,{isCollapsed:t,items:e.items,density:i,className:`space-y-0.5`})]},e.label))}):(0,F.jsx)(n$,{isCollapsed:t,items:n,density:i,className:a})})}function M$({mode:e}){let t=B0(),n=In(),r=_s(),i=mn(e=>e.isSidebarCollapsed),a=pn.toggleSidebarCollapsed,{currentLanguage:o,currentLanguageLabel:s,languageOptions:c,selectLanguage:l}=w$(),{theme:u,setTheme:d}=_Q(),p=e===`settings`,h=f(VZ.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}=E$(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(wQ,TQ):`w-[240px] px-4`),"data-sidebar-collapsed":i?`true`:`false`,children:[(0,F.jsx)(A$,{isSettingsMode:p,isCollapsed:i,onToggle:a}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsx)(j$,{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)(r$,{onClick:()=>t.accountManager.openAccountPanel(),icon:fn,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)(t$,{to:`/settings`,label:f(`settings`),icon:cn,collapsed:i})}),(0,F.jsx)(`div`,{className:m(i?`mb-1`:`mb-2`,i?`flex justify-center`:void 0),children:(0,F.jsx)(i$,{value:u,onValueChange:e=>v(e),icon:Go,label:f(`theme`),valueLabel:h,density:x,collapsed:i,children:VZ.map(e=>(0,F.jsx)(Vt,{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)(i$,{value:o,onValueChange:e=>l(e),icon:No,label:f(`language`),valueLabel:s,density:x,collapsed:i,children:c.map(e=>(0,F.jsx)(Vt,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,F.jsx)(r$,{onClick:()=>n.open(void 0,{kind:`docs`,title:f(`docBrowserHelp`)}),icon:wt,label:f(`docBrowserHelp`),density:x,collapsed:i})]})]})]})}var N$=[{action:`minimize`,label:`Minimize`,icon:Wo},{action:`close`,label:`Close`,icon:Sn,variant:`danger`}];function P$({sidebarCollapsed:e=!1}){let t=I$()?{action:`toggle-maximize`,label:`Restore`,icon:uo}:{action:`toggle-maximize`,label:`Maximize`,icon:cs};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)(HQ,{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:[N$[0],t,N$[1]].map(e=>(0,F.jsx)(F$,{control:e},e.action))})]})}function F$({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 I$(){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 L$(){return typeof window>`u`?null:z$()??window.nextclawDesktop?.platform??null}function R$(){return L$()===`win32`}function z$(){return null}function B$(e,t){if(t===`/settings`)return S$(e);let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function V$(){let{pathname:e}=si(),t=_$(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=B$(e,t.target);return(0,F.jsx)(`li`,{children:(0,F.jsx)(ka,{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 H$({leadingInset:e}){let t=ui(),{pathname:n}=si(),r=C$(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)(at,{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 U$=(0,P.lazy)(async()=>({default:(await qn(async()=>{let{DocBrowser:e}=await import(`./doc-browser-CgdoLUT92.js`);return{DocBrowser:e}},__vite__mapDeps([4,5,1,6,7,8,9,10,11,12,13,14,15]))).DocBrowser}));function W$({pathname:e,isDocBrowserOpen:t,docBrowserDockControls:n,docBrowserRenderers:r={},topbarLeadingInset:i,children:a}){let o=h$(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)(H$,{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)(V$,{}):null,t?(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(U$,{customTabRenderers:r,displayMode:`fullscreen`,dockControls:n})}):null]})}function G$(){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)(Aa,{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 K$(){let{pathname:e}=si(),t=ui();return g$(e)?(0,F.jsx)(FZ,{layoutMode:`mobile`,onBackToList:()=>t(`/chat`)}):(0,F.jsx)(c1,{variant:`mobile`})}var q$=(0,P.lazy)(async()=>({default:(await qn(async()=>{let{DocBrowser:e}=await import(`./doc-browser-CgdoLUT92.js`);return{DocBrowser:e}},__vite__mapDeps([4,5,1,6,7,8,9,10,11,12,13,14,15]))).DocBrowser}));function J$({pathname:e,isMobileLayout:t=!1,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:i,docBrowserRenderers:a={},sideDock:o,children:s}){let c=h$(e),l=mn(e=>e.isSidebarCollapsed),u=t&&!g$(e),d=R$(),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)(P$,{sidebarCollapsed:l}):null,(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[!c&&(0,F.jsx)(M$,{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)(q$,{customTabRenderers:a,dockControls:i})}):null,o]})]}),u?(0,F.jsx)(V$,{}):null,n&&r===`floating`?(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(q$,{customTabRenderers:a,dockControls:i})}):null]})}var Y$=[{target:`/cron`,label:()=>f(`chatSidebarScheduledTasks`),icon:qa},{target:`/skills`,label:()=>f(`chatSidebarSkills`),icon:eo},{target:`/agents`,label:()=>f(`agentsPageTitle`),icon:Qa}];function X$({isCollapsed:e}){let t=f(e?`sidebarExpand`:`sidebarCollapse`);return(0,F.jsx)(mt,{icon:(0,F.jsx)(e?qo:Ko,{className:DQ}),label:t,className:m(jQ,e&&`h-9 w-9 rounded-xl`),onClick:pn.toggleSidebarCollapsed})}function Z$({connectionStatus:e,isCollapsed:t}){let n=R$(),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)(HQ,{className:`flex min-w-0 flex-1 items-center gap-2`,suffix:(0,F.jsx)(YQ,{status:e})}),(0,F.jsx)(X$,{isCollapsed:t})]})}function Q$({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?OQ:`space-y-0.5`,children:Y$.map(t=>(0,F.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,F.jsx)(t$,{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 $$({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)(XQ,{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`,AQ),children:(0,F.jsx)(c$,{isLoading:r,isProjectFirstView:i,groups:t,projectGroups:o,defaultSessionType:e,sessionTypeOptions:c,renderSessionItem:s})})]})}function e1({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`,TQ):`px-3`),children:(0,F.jsx)(l$,{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 t1=be.chat.newSessionType,n1=[`preference`,t1];function r1(e,t){let n=Bl(e);return t.find(e=>e.value===n&&e.ready!==!1)??null}function i1(e){let{defaultSessionType:t,preferredSessionType:n,sessionTypeOptions:r}=e,i=n?r1(n,r):null,a=r1(t,r);return i??a??r.find(e=>e.ready!==!1)??r[0]??{value:Bl(t),label:Bl(t),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}}function a1(e){return typeof e?.value==`string`?Bl(e.value):null}function o1({defaultSessionType:e,sessionTypeOptions:t}){let n=fe(),r=T({queryKey:n1,queryFn:()=>ye(t1),staleTime:3e4,retry:!1}),i=(0,P.useMemo)(()=>a1(r.data),[r.data]),a=(0,P.useMemo)(()=>i1({preferredSessionType:i,defaultSessionType:e,sessionTypeOptions:t}),[e,i,t]),o=je({mutationFn:async e=>await le(t1,Bl(e)),onMutate:async e=>{let t=Bl(e);await n.cancelQueries({queryKey:n1});let r=n.getQueryData(n1);return n.setQueryData(n1,{key:t1,value:t,updatedAt:new Date().toISOString()}),{previous:r}},onError:(e,t,r)=>{r?.previous&&n.setQueryData(n1,r.previous)},onSuccess:e=>{n.setQueryData(n1,e)}}),s=(0,P.useCallback)(e=>{let n=r1(e,t);n&&o.mutate(n.value)},[t,o]);return{selectedSessionType:a.value,selectedSessionTypeOption:a,isLoading:r.isLoading,setSelectedSessionType:s}}function s1(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 c1({variant:e=`desktop`}){let t=e===`mobile`,n=lc(),r=In(),i=mn(e=>e.isSidebarCollapsed),[a,o]=(0,P.useState)(!1),[c,l]=(0,P.useState)(!1),u=I(e=>e.snapshot),d=Wl(e=>e.snapshot.sessionTypesQuery?.data??null),p=y(),h=wu(),{isLoading:g,items:_}=gl(),{language:v,setLanguage:b}=Zt(),{theme:x,setTheme:S}=_Q(),C=f(VZ.find(e=>e.value===x)?.labelKey??`themeWork`),w=s.find(e=>e.value===v)?.label??v,T=(0,P.useMemo)(()=>VZ.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)(()=>Nl(_),[_]),ee=(0,P.useMemo)(()=>Ll(_),[_]),j=(0,P.useMemo)(()=>Fl(A,O),[O,A]),te=(0,P.useMemo)(()=>Il(A,O,k),[k,O,A]),M=(0,P.useMemo)(()=>Ul(d?.options??[]),[d?.options]),ne=(0,P.useMemo)(()=>Bl(d?.defaultType??`native`),[d?.defaultType]),re=(0,P.useMemo)(()=>M.filter(e=>e.value!==ne),[ne,M]),ie=o1({defaultSessionType:ne,sessionTypeOptions:M}),ae=u.listMode===`project-first`,oe=!t&&i,se=s1(_,u.selectedSessionKey,n.chatSessionListManager.markSessionRead),{editingSessionKey:ce,draftLabel:le,savingSessionKey:ue,setDraftLabel:de,startEditingSessionLabel:fe,cancelEditingSessionLabel:pe,saveSessionLabel:me}=IZ(),he=e=>{v!==e&&(b(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:Rl,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(wQ,`shrink-0`):`w-[280px] shrink-0`),"data-sidebar-collapsed":oe?`true`:`false`,children:[t?null:(0,F.jsx)(Z$,{connectionStatus:p.connectionStatus,isCollapsed:oe}),t?(0,F.jsx)(RQ,{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)(LQ,{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)(Q$,{isCollapsed:oe}),(0,F.jsx)($$,{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)(e1,{currentLanguage:v,currentLanguageLabel:w,currentTheme:x,currentThemeLabel:C,isCollapsed:oe,isOpen:c,languageOptions:E,onOpenApps:()=>qG(r),onOpenChange:l,onOpenDocs:()=>r.open(void 0,{kind:`docs`,title:f(`docBrowserHelp`)}),onSelectLanguage:he,onSelectTheme:S,themeOptions:T})]})}var l1=`sid_`,u1=`/chat/draft`,d1=u1.slice(6);function f1(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return`${l1}${btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}`}function p1(e){if(!e.startsWith(l1))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 m1(e){if(!e||e===d1)return null;let t=p1(e);if(t)return t;try{return decodeURIComponent(e)}catch{return e}}function h1(e){return`/chat/${f1(e)}`}function g1(e,t){let n=t.trim();return n?e.includes(n)?e.filter(e=>e!==n):[n,...e]:e}var _1=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,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),te(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=Bl(e??`native`),r=bc(t);I.getState().setSnapshot({selectedSessionKey:null}),this.syncDraftThreadState(),this.uiManager.navigateTo(u1,{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})}}},v1=async()=>!1,y1=class{constructor(e){this.docBrowserManager=e,this.state={pathname:``},this.actions={navigate:null,confirm:v1},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=()=>pn.getSnapshot().mode===`mobile`,this.resolvePanelAppEntry=async e=>{let t=e.trim();if(!t)return null;try{return AW((await ve.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(CG(i),{title:n});return}this.docBrowserManager.open(bG(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(h1(e),t)}}};function b1(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(b1(e))!==JSON.stringify(b1({...e,...t}))}var S1=class{constructor(){this.syncSnapshot=e=>{let t=Wl.getState();x1(t.snapshot,e)&&t.setSnapshot(e)}}};function C1(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 w1(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 T1(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 E1(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 D1(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=DZ(kZ({entries:a.workspaceNavigationHistory,index:a.workspaceNavigationHistoryIndex},e=>e.kind!==`side-chat-draft`||e.key!==s),{kind:`child-session`,key:o},C1);return{parentSessionKey:l,patch:{workspacePanelParentKey:l,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:o,activeSideChatDraft:null,activeWorkspaceFileKey:null,childSessionTabs:E1(a.childSessionTabs,{sessionKey:o,parentSessionKey:l,label:r?.trim()||null,agentId:t?.trim()||null}),workspaceNavigationHistory:[...u.entries],workspaceNavigationHistoryIndex:u.index}}}function O1(e,t){let n=e.path.trim();if(!n)return null;let r=t?.trim()||null,i=e.viewMode===`preview`?Ru(n,e.previewViewer):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 k1(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)]}var A1=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,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:k1(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=DZ({entries:n.workspaceNavigationHistory,index:n.workspaceNavigationHistoryIndex},t,C1);L.getState().setSnapshot({...e,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:lu(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=E1(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=T1(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=D1({snapshot:L.getState().snapshot,...e});t&&(L.getState().setSnapshot(t.patch),this.ensureWorkspaceParentRoute(t.parentSessionKey))},this.openFilePreview=e=>{let t=O1(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??zu(n.path,n.previewViewer);if(!r)return;let i=O1({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.closeWorkspaceFile=e=>{let t=e.trim();if(!t)return;let{snapshot:n}=L.getState(),{activeWorkspaceFileKey:r,workspaceFileTabs:i}=n,a=i.filter(e=>e.key!==t),o=kZ({entries:n.workspaceNavigationHistory,index:n.workspaceNavigationHistoryIndex},e=>e.kind!==`file`||e.key!==t),s={workspaceFileTabs:a,workspaceNavigationHistory:[...o.entries],workspaceNavigationHistoryIndex:o.index};if(r===t){let e={...n,workspaceFileTabs:a},t=o.entries[o.index],r=t?w1(t,e):null;Object.assign(s,r??{activeWorkspacePanelKind:null,activeSideChatDraft:null,activeWorkspaceFileKey:null})}L.getState().setSnapshot(s)},this.closeWorkspacePanel=()=>{L.getState().setSnapshot({workspacePanelParentKey:null,activeWorkspacePanelKind:null,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null,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=OZ({entries:t.workspaceNavigationHistory,index:t.workspaceNavigationHistoryIndex},e);if(!n)return;let r=w1(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 Le(e),ke(oe,e),oe.removeQueries({queryKey:[`ncp-session-messages`,e]}),this.clearDeletedSessionState(e),this.uiManager.goToChatRoot({replace:!0})}finally{L.getState().setSnapshot({isDeletePending:!1})}}}}},j1=class{constructor(e){this.chatUiManager=new y1(e.docBrowserManager),this.chatSessionListManager=new _1(this.chatUiManager),this.chatQueryManager=new S1,this.chatThreadManager=new A1(this.chatUiManager,this.chatSessionListManager,e.notifyRightPanelOpened)}},M1=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 N1(){return T({queryKey:[`ncp-session-types`],queryFn:S,staleTime:1e4,retry:!1})}var P1=`nextclaw://docs`,F1=`github-project`,I1=`https://github.com/Peiiii/nextclaw`;function L1(){return[{builtIn:!0,icon:{type:`builtin`,name:`apps`},id:`apps`,label:f(`appsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:fG}},{builtIn:!0,icon:{type:`builtin`,name:`service-apps`},id:`service-apps`,label:f(`serviceAppsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:pG}},{builtIn:!0,icon:{type:`builtin`,name:`docs`},id:`docs`,label:f(`docBrowserHelp`),removable:!1,target:{type:`right-panel-resource`,uri:P1}},{builtIn:!0,icon:{type:`builtin`,name:`new-tab`},id:`new-tab`,label:f(`docBrowserHomeTitle`),removable:!1,target:{type:`right-panel-resource`,uri:uG}},{builtIn:!0,icon:{type:`builtin`,name:`github`},id:F1,label:f(`sideDockGitHubProject`),removable:!1,target:{type:`external-url`,url:I1}}]}var R1=[`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`];function z1(e){return!!e&&typeof e==`object`}function B1(e){return R1.includes(e)}function V1(e){return!z1(e)||typeof e.type!=`string`?null:e.type===`builtin`&&B1(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 H1(e){if(!z1(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||!z1(e.target)||e.target.type!==`right-panel-resource`||typeof e.target.uri!=`string`||e.target.uri.trim().length===0)return null;let t=V1(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 U1(e){if(!Array.isArray(e))return[];let t=new Map;return e.forEach(e=>{let n=H1(e);n&&t.set(n.id,n)}),Array.from(t.values())}function W1(e,t){return{createdAt:t,icon:e.icon,id:e.id,label:e.label,target:e.target}}function G1(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function K1(e){return{builtIn:!1,icon:e.icon,id:e.id,label:e.label,removable:!0,target:e.target}}function q1(e,t){let n=new Set(e.map(e=>e.id)),r=new Set(e.map(G1).filter(e=>e!==null)),i=t.filter(e=>!n.has(e.id)&&!r.has(e.target.uri)).map(K1);return[...e,...i]}var J1=`nextclaw.side-dock.state`,Y1=1;function X1(e){return!!e&&typeof e==`object`}var Z1=p()(En(e=>({isVisible:!0,pinnedItems:[],setVisible:t=>e({isVisible:t}),setPinnedItems:t=>e({pinnedItems:U1(t)})}),{name:J1,version:Y1,storage:Dn(()=>window.localStorage),partialize:e=>({isVisible:e.isVisible,pinnedItems:e.pinnedItems}),merge:(e,t)=>{let n=X1(e)?U1(e.pinnedItems):[],r=X1(e)&&typeof e.isVisible==`boolean`?e.isVisible:!0;return{...t,isVisible:r,pinnedItems:n}}})),Q1={apps:st,docs:wt,github:ko,"new-tab":_n,"panel-app":Ja,"service-apps":Ja},$1=new Set([F1]),e0=/^\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?(?:\u200D\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?)*$/u;function t0(e){return e0.test(e.trim())}function n0({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 t0(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=Q1[e.name];return(0,F.jsx)(t,{className:`h-5 w-5`,"aria-hidden":`true`})}function r0({active:e,item:t,onOpen:n,onUnpin:r}){let{label:i}=t;return(0,F.jsxs)(ct,{children:[(0,F.jsxs)(`div`,{className:`group relative`,children:[(0,F.jsx)(lt,{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)(n0,{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)(Sn,{className:`h-3 w-3`,"aria-hidden":`true`})}):null]}),(0,F.jsx)(vt,{side:`left`,children:i})]})}function i0({icon:e,label:t,onClick:n}){return(0,F.jsxs)(ct,{children:[(0,F.jsx)(lt,{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)(vt,{side:`left`,children:t})]})}function a0(e){return e?.trim()??``}function o0(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function s0(e,t,n,r=!1){if(!t||!n)return!1;let i=a0(o0(e)??void 0);if(!i)return!1;let a=a0(n.resourceUri);return a&&a===i||a0(n.currentUrl)===i?!0:r?!1:e.id===`docs`&&n.kind===`docs`}function c0(e,t){if(!t)return!1;let n=a0(t.resourceUri),r=a0(t.currentUrl);return e.some(e=>{let t=a0(o0(e)??void 0);return t===n||t===r})}function l0(e){return $1.has(e.id)}function u0({manager:e}){let t=Z1(e=>e.pinnedItems),n=Z1(e=>e.setVisible),{currentTab:r,isOpen:i}=In(),{confirm:a,ConfirmDialog:o}=$t(),s=q1(L1(),t),c=s.filter(e=>!l0(e)),l=s.filter(l0),u=c0(s,r),d=async()=>{await a({title:f(`sideDockHideConfirmTitle`),description:f(`sideDockHideConfirmDescription`),confirmLabel:f(`sideDockHideConfirmAction`),cancelLabel:f(`cancel`)})&&n(!1)};return(0,F.jsx)(xt,{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)(r0,{active:s0(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)(r0,{active:s0(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id)),(0,F.jsx)(i0,{icon:Jo,label:f(`sideDockHide`),onClick:()=>{d()}})]}):null,(0,F.jsx)(o,{})]})})}var d0=`pinned`,f0=new Set([`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`]);function p0(e){return e.trim()}function m0(e){let t=0;return Array.from(p0(e)).forEach(e=>{t=t*31+e.charCodeAt(0)>>>0}),`${d0}-${p0(e).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()||`resource`}-${t.toString(36)}`}function h0(e){return e?.type===`builtin`&&f0.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 g0(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 _0=class{constructor(e){this.docBrowserManager=e,this.getItems=()=>q1(L1(),Z1.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 Tn.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:h0(e.dockIcon)??{type:`builtin`,name:g0(e)},id:m0(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=p0(e.target.uri),r={...e,target:{type:`right-panel-resource`,uri:n}};this.setPinnedItems(i=>i.some(t=>t.id===e.id||p0(t.target.uri)===n)?i:[...i,W1(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}=Z1.getState();n(e(t))},this.getTabResourceUri=e=>{let t=e?.resourceUri??e?.currentUrl,n=t?p0(t):``;return n.length>0?n:null},this.findItemByUri=e=>{let t=p0(e);return this.getItems().find(e=>e.target.type===`right-panel-resource`&&p0(e.target.uri)===t)}}},v0=new class{constructor(){this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=n??(r?void 0:t?.kind)??(r&&Fn(r)?`docs`:`home`),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i===`home`?`nextclaw://new-tab`:i===`docs`?An():`about:blank`),o=i===`docs`?jn(a,`docs`):a;return{historyPolicy:`managed`,kind:i,title:i===`home`?f(`docBrowserHomeTitle`):Rn(o,i,i===`docs`?f(`docBrowserHelp`):`Detail`),url:o}},this.areUrlsEquivalent=(e,t,n,r)=>n===r?n===`docs`?Mn(e)===Mn(t):e===t:!1,this.usesManagedHistory=e=>e.currentUrl!==kn}};function y0(e,t,n){return{...e,tabs:e.tabs.map(e=>e.id===t?n(e):e)}}function b0(e,t){return y0(e,e.activeTabId,t)}function x0(e,t){let n=[...e.history.slice(0,e.historyIndex+1),t];return{history:n,historyIndex:n.length-1}}function S0(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 C0(e,t){return{kind:t.kind,resourceUri:t.resourceUri??t.url,tabId:e,url:t.url}}function w0(e,t,n){let r=DZ({entries:t.activeHistory,index:t.activeHistoryIndex},n,(t,n)=>S0(e,t,n));return{...t,activeHistory:[...r.entries],activeHistoryIndex:r.index}}function T0(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 E0(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=T0(e,r,a.url),s=n.resourceUri!==void 0&&n.resourceUri===r.resourceUri;return y0({...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 D0(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,...x0(t,n.url),navVersion:t.navVersion+1}}function O0(e,t){return!e.isOpen&&e.tabs.length===1&&t?.kind===`home`&&t.currentUrl===`nextclaw://new-tab`}function k0(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=y0(t,u.id,t=>D0(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?w0(e,l,C0(u.id,n)):l}if(o||c||!l||l.kind!==n.kind){let i=Ln(n.url,n.kind,s??n.title,c,n.resourceUri??n.url,r?.dockIcon??n.dockIcon);return O0(t,l)?{...t,isOpen:!0,tabs:[i],activeTabId:i.id,activeHistory:[On(i)],activeHistoryIndex:0}:w0(e,{...t,isOpen:!0,tabs:[...t.tabs,i],activeTabId:i.id},On(i))}return w0(e,{...b0(t,t=>D0(e,t,n,r,c)),isOpen:!0},C0(t.activeTabId,n))}function A0(e,t,n,r){let i=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0];return k0(e,t,e.resolveOpenTarget({activeTab:i,kind:r?.kind,url:n}),r)}var j0=class{constructor(e=v0,t){this.routeResolver=e,this.onRightPanelOpened=t,this.setSnapshot=e=>{zn.getState().setSnapshot(e)},this.open=(e,t)=>{this.setSnapshot(n=>A0(this.routeResolver,n,e,t)),this.onRightPanelOpened?.()},this.openTarget=(e,t)=>{this.setSnapshot(n=>k0(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:Pn,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:Bn(e)}))},this.navigate=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Ln(An(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id,isOpen:!0}}let n=b0(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,...x0(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?w0(this.routeResolver,n,On(r)):n})},this.syncUrl=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Ln(An(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id}}let n=b0(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,...x0(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?w0(this.routeResolver,n,On(r)):n})},this.goBack=()=>{this.setSnapshot(e=>{let t=OZ({entries:e.activeHistory,index:e.activeHistoryIndex},`back`);return t?E0(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.goForward=()=>{this.setSnapshot(e=>{let t=OZ({entries:e.activeHistory,index:e.activeHistoryIndex},`forward`);return t?E0(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{...Nn(),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=kZ({entries:a.activeHistory,index:a.activeHistoryIndex},t=>t.tabId!==e,On(o)),c={...a,activeHistory:[...s.entries],activeHistoryIndex:s.index};return t.activeTabId===e?w0(this.routeResolver,c,On(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?w0(this.routeResolver,{...t,activeTabId:e,isOpen:!0},On(n)):t})}}};function M0(e){return e.activeWorkspacePanelKind!=null}var N0=class{constructor(){this.accountManager=new Vs,this.rightPanelResourceRouteResolver=new BG,this.notifyRightPanelOpened=()=>{let e=zn.getState().snapshot,t=L.getState().snapshot;pn.collapseSidebarForDenseRightPanels({isDocBrowserDocked:e.mode===`docked`,isDocBrowserOpen:e.isOpen,isWorkspacePanelOpen:M0(t)})},this.docBrowserManager=new j0(this.rightPanelResourceRouteResolver,this.notifyRightPanelOpened),this.sideDockManager=new _0(this.docBrowserManager),this.chatDraftIntentManager=new M1,this.serviceActionAuthorizationManager=new RW,this.panelAppBridgeManager=new OW(this.serviceActionAuthorizationManager),this.remoteAccessManager=new ks({accountManager:this.accountManager})}},P0=null;function F0(){return P0??=new N0,P0}function I0(){return F0()}var L0=globalThis,R0=L0.__NEXTCLAW_APP_PRESENTER_CONTEXT__??(0,P.createContext)(null);L0.__NEXTCLAW_APP_PRESENTER_CONTEXT__=R0;function z0({children:e}){let t=(0,P.useMemo)(()=>F0(),[]);return(0,F.jsx)(R0.Provider,{value:t,children:e})}function B0(){let e=(0,P.useContext)(R0);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}export{is as $,Cu as A,zs as B,hZ as C,wu as D,FW as E,pl as F,bs as G,Ns as H,fl as I,Ts as J,Cs as K,cc as L,Bl as M,Vl as N,Eu as O,Hl as P,cs as Q,lc as R,FZ as S,JG as T,ks as U,Ps as V,Os as W,ys as X,Ds as Y,_s as Z,d$ as _,fi as _t,Z1 as a,mo as at,lQ as b,m1 as c,to as ct,K$ as d,Ii as dt,Zo as et,G$ as f,Li as ft,f$ as g,ui as gt,T$ as h,si as ht,u0 as i,jo as it,Ul as j,Tu as k,c1 as l,Qa as lt,L$ as m,Bi as mt,B0 as n,Go as nt,N1 as o,po as ot,W$ as p,Ri as pt,ws as q,I0 as r,Bo as rt,j1 as s,io as st,z0 as t,Xo as tt,J$ as u,Ea as ut,gQ as v,qn as vt,iK as w,cQ as x,fQ as y,Bs as z};