@xopcai/xopc 0.0.406 → 0.0.408

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 (242) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BE3ci_lj.js → agent-avatar-dicebear-B0em9Xfs.js} +1 -1
  4. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CtE1h2xU.js +1 -0
  5. package/dist/gateway/static/root/assets/agents-DAgFeHEb.js +77 -0
  6. package/dist/gateway/static/root/assets/{agents-admin-api-D6XzhsQy.js → agents-admin-api-D0UyB0Y_.js} +1 -1
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-BDbJKxa-.js → app-management-settings-panel-B1qR8ElB.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-CEOOrVYb.js → appearance-settings-GA819R2q.js} +1 -1
  9. package/dist/gateway/static/root/assets/apps-page-DZptDZ7h.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-B7pzPErg.js → archive-plugin-BjWaZIHe.js} +1 -1
  11. package/dist/gateway/static/root/assets/{automations-page-CcQjEiqk.js → automations-page-IkrLEkMb.js} +1 -1
  12. package/dist/gateway/static/root/assets/automations-workspace-qfEjk_ws.js +6 -0
  13. package/dist/gateway/static/root/assets/{binary-plugins-D5kTu6gH.js → binary-plugins-DKy1DC62.js} +1 -1
  14. package/dist/gateway/static/root/assets/{block-editor-CnW6rF_e.js → block-editor-4E-OdmNm.js} +40 -40
  15. package/dist/gateway/static/root/assets/{browser-automation-inputs-CAcUtInP.js → browser-automation-inputs-Bs-AkQ1q.js} +1 -1
  16. package/dist/gateway/static/root/assets/browser-automations-page-D0Vbe1Q_.js +3 -0
  17. package/dist/gateway/static/root/assets/browser-settings-page-BXCNNpQd.js +3 -0
  18. package/dist/gateway/static/root/assets/capabilities-CD6PzNK7.js +1 -0
  19. package/dist/gateway/static/root/assets/capabilities-page-DMtxaYgt.js +2 -0
  20. package/dist/gateway/static/root/assets/capabilities-settings-panel-BlWrMG6Z.js +8 -0
  21. package/dist/gateway/static/root/assets/{capability-header-actions-jztljvVW.js → capability-header-actions-BMffrHhT.js} +1 -1
  22. package/dist/gateway/static/root/assets/channels-C96r2Rqq.js +1 -0
  23. package/dist/gateway/static/root/assets/{chat-terminal-dock-BVlFOKJj.js → chat-terminal-dock-vb3kBSeI.js} +2 -2
  24. package/dist/gateway/static/root/assets/computer-settings-page-75SDQxQW.js +1 -0
  25. package/dist/gateway/static/root/assets/{connector-service-page-BNcTUa99.js → connector-service-page-DmJ9dIql.js} +1 -1
  26. package/dist/gateway/static/root/assets/connectors-page-Bua_nhSH.js +1 -0
  27. package/dist/gateway/static/root/assets/{date-picker-BKUmdSp7.js → date-picker-BEDH1AbM.js} +1 -1
  28. package/dist/gateway/static/root/assets/dependency-picker-LwWL5fo8.js +1 -0
  29. package/dist/gateway/static/root/assets/{desktop-pet-IvADYxyi.js → desktop-pet-Bb-s29ag.js} +1 -1
  30. package/dist/gateway/static/root/assets/{desktop-pet-settings-y6WzhGEK.js → desktop-pet-settings-Btt-DzyT.js} +1 -1
  31. package/dist/gateway/static/root/assets/device-pairing-wizard-_UWo9-4N.js +1 -0
  32. package/dist/gateway/static/root/assets/{directory-picker-path-field-DnEvwMTm.js → directory-picker-path-field-CkGfC105.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-debug-page-CCvuK1m0.js → extension-debug-page-Cm0F3rcI.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-page-DegRwY3R.js → extension-page-B72a-tnZ.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-settings-page-B8UQgGgZ.js → extension-settings-page-BEDAm_Ib.js} +1 -1
  36. package/dist/gateway/static/root/assets/{gateway-config-swr-BvuySoCX.js → gateway-config-swr-CTXr917C.js} +1 -1
  37. package/dist/gateway/static/root/assets/{gateway-realtime-SBtdXzco.js → gateway-realtime-CP6L2jIR.js} +1 -1
  38. package/dist/gateway/static/root/assets/gateway-realtime-store-yXB4a40_.js +1 -0
  39. package/dist/gateway/static/root/assets/gateway-settings-BapgXAhB.js +1 -0
  40. package/dist/gateway/static/root/assets/{gateway-startup-retry-CEpuztYK.js → gateway-startup-retry-DD2fsxdd.js} +1 -1
  41. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-MjAoJQJX.js → highlighted-body-KQOG7T2V-BWjkqT5j.js} +1 -1
  42. package/dist/gateway/static/root/assets/home-page-DNGjF6h4.js +2 -0
  43. package/dist/gateway/static/root/assets/{image-generation-api-SQDixWjO.js → image-generation-api-Bi1-Hvtr.js} +1 -1
  44. package/dist/gateway/static/root/assets/{imports-page-1ZId0Ng0.js → imports-page-b4VDs6Bd.js} +1 -1
  45. package/dist/gateway/static/root/assets/index-Cgd4fGVP.js +267 -0
  46. package/dist/gateway/static/root/assets/index-gYRNcY2Q.css +1 -0
  47. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-yMwBt1Sv.js → keyboard-shortcuts-settings-Cf29ltoI.js} +1 -1
  48. package/dist/gateway/static/root/assets/local-app-workbench-page-dgUxHhW8.js +1 -0
  49. package/dist/gateway/static/root/assets/{local-apps-page-CF6_kS9C.js → local-apps-page-D3k9GjgF.js} +1 -1
  50. package/dist/gateway/static/root/assets/{local-session-drafts-DhJjHCfQ.js → local-session-drafts-TqLFKwYo.js} +1 -1
  51. package/dist/gateway/static/root/assets/{locale-store-D5h-Ha6-.js → locale-store-D_migb9R.js} +1 -1
  52. package/dist/gateway/static/root/assets/logs-page-BUlU7t8l.js +2 -0
  53. package/dist/gateway/static/root/assets/management-settings-2L7XFZXc.js +1 -0
  54. package/dist/gateway/static/root/assets/{markdown-view-CthsQiiO.js → markdown-view-B35a4o1v.js} +1 -1
  55. package/dist/gateway/static/root/assets/markdown-view-ixUWAmoy.css +1 -0
  56. package/dist/gateway/static/root/assets/{media-plugins-UYX1YivF.js → media-plugins-Bl1Xga_v.js} +1 -1
  57. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Bi62iXra.js +1 -0
  58. package/dist/gateway/static/root/assets/messages-D__oW2yE.js +3 -0
  59. package/dist/gateway/static/root/assets/note-detail-panel-ogBu93h0.js +5 -0
  60. package/dist/gateway/static/root/assets/note-image-lightbox-Dxvo_WsE.js +1 -0
  61. package/dist/gateway/static/root/assets/notes-page-CNdoxzIZ.js +8 -0
  62. package/dist/gateway/static/root/assets/{page-context-capture-button-DOrPS73o.js → page-context-capture-button-Bq4Xpop5.js} +1 -1
  63. package/dist/gateway/static/root/assets/personal-page-7P2leCsB.js +1 -0
  64. package/dist/gateway/static/root/assets/personal-proactivity-BJcZ3Yhi.js +1 -0
  65. package/dist/gateway/static/root/assets/personal-settings-panel-D6n6TObP.js +1 -0
  66. package/dist/gateway/static/root/assets/plugin-details-dialog-JTxDbMI4.js +1 -0
  67. package/dist/gateway/static/root/assets/plugin-presentation-CO5BFDGW.js +1 -0
  68. package/dist/gateway/static/root/assets/{preview-open-alternatives-BP9C0kH3.js → preview-open-alternatives-6XU-2lVI.js} +1 -1
  69. package/dist/gateway/static/root/assets/{product-open-page-D151rJVy.js → product-open-page-BpB0klIl.js} +1 -1
  70. package/dist/gateway/static/root/assets/product-preview-content-DxQaoQew.js +1 -0
  71. package/dist/gateway/static/root/assets/project-detail-page-LilHE2OV.js +1 -0
  72. package/dist/gateway/static/root/assets/projects-page-D4Jxhuhq.js +1 -0
  73. package/dist/gateway/static/root/assets/{registry-api-Bf0hVPNV.js → registry-api-4NZOh0iz.js} +1 -1
  74. package/dist/gateway/static/root/assets/remote-access-hub-Cy71CCQq.js +1 -0
  75. package/dist/gateway/static/root/assets/{runtime-tools-api-ByH1meP7.js → runtime-tools-api-CmEWVrOg.js} +1 -1
  76. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DyLxlqWV.js → runtime-tools-settings-panel-CrbjrokA.js} +1 -1
  77. package/dist/gateway/static/root/assets/{schema-form-ClP4uPSj.js → schema-form-DITi2cne.js} +1 -1
  78. package/dist/gateway/static/root/assets/{session-api-fVuszA_P.js → session-api-aQLptIs9.js} +1 -1
  79. package/dist/gateway/static/root/assets/session-manager-D2sLfkw-.js +16 -0
  80. package/dist/gateway/static/root/assets/sessions-page-D1THmRXE.js +1 -0
  81. package/dist/gateway/static/root/assets/settings-advanced-gate-CjRLXfoo.js +1 -0
  82. package/dist/gateway/static/root/assets/{settings-form-section-B4NShgv-.js → settings-form-section-Cl0eF4hl.js} +1 -1
  83. package/dist/gateway/static/root/assets/settings-page-1jcGeVtB.js +1 -0
  84. package/dist/gateway/static/root/assets/{setup-status-panel-BVKQ2inq.js → setup-status-panel-CFhDHkyK.js} +1 -1
  85. package/dist/gateway/static/root/assets/{share-preview-page-BxN9t3MD.js → share-preview-page-By4IKKgg.js} +1 -1
  86. package/dist/gateway/static/root/assets/shares-settings-q2sa1VvF.js +1 -0
  87. package/dist/gateway/static/root/assets/{skill-api-E0E-MH1S.js → skill-api-BxCyuPhf.js} +1 -1
  88. package/dist/gateway/static/root/assets/skill-reload-api-CIHSQxr1.js +1 -0
  89. package/dist/gateway/static/root/assets/skills-page-BQaej_2C.js +2 -0
  90. package/dist/gateway/static/root/assets/{style-Bs9x3WBj.js → style-Dt_oHNvB.js} +1 -1
  91. package/dist/gateway/static/root/assets/{system-settings-panel-DpQPaJId.js → system-settings-panel-C9ejxax1.js} +1 -1
  92. package/dist/gateway/static/root/assets/task-detail-page-SipLlGGk.js +2 -0
  93. package/dist/gateway/static/root/assets/{task-expandable-content-BoGtWYbk.js → task-expandable-content-BMCvE36l.js} +1 -1
  94. package/dist/gateway/static/root/assets/tracing-settings-page-bn9vnLrf.js +1 -0
  95. package/dist/gateway/static/root/assets/{tunnel-api-3GopOQ_S.js → tunnel-api-BeTAD8BN.js} +1 -1
  96. package/dist/gateway/static/root/assets/{usage-page-B8j47CWQ.js → usage-page-BPuc6leN.js} +1 -1
  97. package/dist/gateway/static/root/assets/{use-autosave-CYIuWnRn.js → use-autosave-DwcmmxWR.js} +1 -1
  98. package/dist/gateway/static/root/assets/user-model-page-YWSqv_kR.js +2 -0
  99. package/dist/gateway/static/root/assets/{voice-api-key-field-BN37Lklj.js → voice-api-key-field-Bk947X8N.js} +1 -1
  100. package/dist/gateway/static/root/assets/{voice-config-api-CRjdZdJF.js → voice-config-api-4yGMrp7J.js} +1 -1
  101. package/dist/gateway/static/root/assets/{work-discovery-overlay-C_bcAAX6.js → work-discovery-overlay-mjj7w_wU.js} +1 -1
  102. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-B5oKCzTn.js → workflow-run-setup-panel-xQUvtVUU.js} +2 -2
  103. package/dist/gateway/static/root/assets/workflows-page-DbKRAEWP.js +6 -0
  104. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DGGi4zVC.js → xopc-cloud-account-card-C4jQM6Uo.js} +1 -1
  105. package/dist/gateway/static/root/index.html +17 -16
  106. package/dist/package.js +1 -1
  107. package/dist/packages/gateway-contract/src/capabilities.js +30 -3
  108. package/dist/src/agent/external-tools/cliProvider.js +1 -1
  109. package/dist/src/agent/prompt/conversational-configuration-guide.d.ts +4 -0
  110. package/dist/src/agent/prompt/conversational-configuration-guide.js +25 -0
  111. package/dist/src/agent/prompt/service-prompt-builder.js +6 -1
  112. package/dist/src/agent/prompt/system-prompt.js +2 -2
  113. package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +8 -0
  114. package/dist/src/agent/tool-manuals/xopc-configuration.js +55 -0
  115. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  116. package/dist/src/agent/tool-manuals/xopc-use.js +4 -1
  117. package/dist/src/agent/tools/factory.js +0 -5
  118. package/dist/src/agent/tools/tool-manual-tool.d.ts +1 -0
  119. package/dist/src/agent/tools/tool-manual-tool.js +27 -2
  120. package/dist/src/agent/tools/xopc-use-tool.js +12 -7
  121. package/dist/src/agent-catalog/capabilities.js +27 -1
  122. package/dist/src/agent-config/index.js +2 -2
  123. package/dist/src/agent-config/schema.d.ts +0 -116
  124. package/dist/src/agent-config/schema.js +2 -32
  125. package/dist/src/capabilities/store-connector.d.ts +9 -1
  126. package/dist/src/capabilities/store-connector.js +30 -1
  127. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  128. package/dist/src/config/schema.d.ts +1 -1
  129. package/dist/src/connectors/cli/adapterRegistry.js +1 -8
  130. package/dist/src/connectors/cli/runtime.js +1 -1
  131. package/dist/src/connectors/composio-catalog.d.ts +2 -2
  132. package/dist/src/connectors/composio-catalog.js +3 -8
  133. package/dist/src/connectors/composio-sessions.js +2 -0
  134. package/dist/src/connectors/composio.js +0 -6
  135. package/dist/src/connectors/connection-candidates.js +0 -5
  136. package/dist/src/connectors/connection-capabilities.js +0 -4
  137. package/dist/src/connectors/excluded-connectors.d.ts +4 -0
  138. package/dist/src/connectors/excluded-connectors.js +24 -0
  139. package/dist/src/connectors/install.js +3 -0
  140. package/dist/src/connectors/integration-strategy.js +0 -5
  141. package/dist/src/connectors/providers.d.ts +0 -1
  142. package/dist/src/connectors/providers.js +2 -14
  143. package/dist/src/extensions/agent-plugins/cli-authorization.js +7 -3
  144. package/dist/src/extensions/agent-plugins/mcp-adapter.js +3 -1
  145. package/dist/src/extensions/agent-plugins/node-runtime.d.ts +5 -0
  146. package/dist/src/extensions/agent-plugins/node-runtime.js +14 -0
  147. package/dist/src/gateway/hono/routes/personal-agent.js +4 -5
  148. package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
  149. package/dist/src/personal-agent/communication.d.ts +2 -2
  150. package/dist/src/personal-agent/communication.js +2 -1
  151. package/dist/src/personal-agent/default-style.d.ts +2 -0
  152. package/dist/src/personal-agent/default-style.js +11 -0
  153. package/dist/src/personal-agent/persona.d.ts +1 -1
  154. package/dist/src/personal-agent/persona.js +1 -1
  155. package/dist/src/personal-agent/policy.d.ts +1 -1
  156. package/dist/src/personal-agent/policy.js +0 -1
  157. package/dist/src/personal-agent/proactivity/service.js +1 -4
  158. package/dist/src/personal-agent/prompts.d.ts +1 -5
  159. package/dist/src/personal-agent/prompts.js +28 -39
  160. package/dist/src/personal-agent/reply-composer.js +3 -2
  161. package/dist/src/personal-agent/reply-style.d.ts +10 -2
  162. package/dist/src/personal-agent/reply-style.js +61 -3
  163. package/dist/src/personal-agent/repository.d.ts +0 -8
  164. package/dist/src/personal-agent/repository.js +1 -9
  165. package/dist/src/personal-agent/service.d.ts +2 -32
  166. package/dist/src/personal-agent/service.js +11 -17
  167. package/dist/src/platform/contracts.d.ts +3 -3
  168. package/dist/src/session/client-history.js +3 -0
  169. package/dist/src/session/session-context-for-llm.js +4 -0
  170. package/dist/src/session/task-allocation-status.d.ts +2 -0
  171. package/dist/src/session/task-allocation-status.js +14 -0
  172. package/dist/src/storage/sqlite/migrations/259_personal_default_style.sql +10 -0
  173. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  174. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  175. package/dist/src/storage/sqlite/schema.js +1 -1
  176. package/dist/src/tasks/task-allocation-repository.js +8 -5
  177. package/dist/src/tasks/task-main-update-decision-service.js +1 -1
  178. package/package.json +5 -2
  179. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DzDaum4Y.js +0 -1
  180. package/dist/gateway/static/root/assets/agents-BfC3FYYe.js +0 -77
  181. package/dist/gateway/static/root/assets/apps-page-CpoG_3PG.js +0 -1
  182. package/dist/gateway/static/root/assets/automations-workspace-BVTP3pzt.js +0 -6
  183. package/dist/gateway/static/root/assets/browser-BLJWD7WI.js +0 -8
  184. package/dist/gateway/static/root/assets/browser-automations-page-DT7-lnPN.js +0 -3
  185. package/dist/gateway/static/root/assets/browser-settings-page-ByK8znt2.js +0 -3
  186. package/dist/gateway/static/root/assets/capabilities-Dl3LttAm.js +0 -1
  187. package/dist/gateway/static/root/assets/capabilities-page-C8tv6M_O.js +0 -2
  188. package/dist/gateway/static/root/assets/capabilities-settings-panel-OVLgL6yL.js +0 -8
  189. package/dist/gateway/static/root/assets/capability-icon-DVoZxEgW.js +0 -1
  190. package/dist/gateway/static/root/assets/capability-links-DzQWK1Fh.js +0 -1
  191. package/dist/gateway/static/root/assets/channels-D8BKMMPW.js +0 -1
  192. package/dist/gateway/static/root/assets/computer-settings-page-CvQgrTwb.js +0 -1
  193. package/dist/gateway/static/root/assets/connectors-page-CWlLRQpK.js +0 -1
  194. package/dist/gateway/static/root/assets/dependency-picker-BarQvwoO.js +0 -1
  195. package/dist/gateway/static/root/assets/device-pairing-wizard-D3IUZ8xW.js +0 -1
  196. package/dist/gateway/static/root/assets/gateway-realtime-store-dKq2fm2X.js +0 -1
  197. package/dist/gateway/static/root/assets/gateway-settings-DlLyLsXY.js +0 -1
  198. package/dist/gateway/static/root/assets/home-page-DAYtNK3o.js +0 -2
  199. package/dist/gateway/static/root/assets/index-K2cy4f-3.js +0 -260
  200. package/dist/gateway/static/root/assets/index-QegseiyI.css +0 -1
  201. package/dist/gateway/static/root/assets/local-app-workbench-page-a7J0NPIs.js +0 -1
  202. package/dist/gateway/static/root/assets/logs-page-C8y5yhoM.js +0 -2
  203. package/dist/gateway/static/root/assets/management-settings-C7dL_jNu.js +0 -1
  204. package/dist/gateway/static/root/assets/markdown-view-Ct4sKkUf.css +0 -1
  205. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-7zpLTDLZ.js +0 -1
  206. package/dist/gateway/static/root/assets/messages-Bwv-AOYl.js +0 -3
  207. package/dist/gateway/static/root/assets/note-detail-panel-Bxm523Up.js +0 -5
  208. package/dist/gateway/static/root/assets/note-image-lightbox-B7ARnjnB.js +0 -1
  209. package/dist/gateway/static/root/assets/notes-page-BOeS2v6x.js +0 -8
  210. package/dist/gateway/static/root/assets/personal-page-BujiHops.js +0 -1
  211. package/dist/gateway/static/root/assets/plugin-details-dialog-XOzQrJQN.js +0 -1
  212. package/dist/gateway/static/root/assets/plugin-presentation-CPEwVLd4.js +0 -1
  213. package/dist/gateway/static/root/assets/product-preview-content-CAo0XpP-.js +0 -1
  214. package/dist/gateway/static/root/assets/project-detail-page-CxB_kF0F.js +0 -1
  215. package/dist/gateway/static/root/assets/projects-page-Dvu_3c2g.js +0 -1
  216. package/dist/gateway/static/root/assets/remote-access-hub-CbzBV_BL.js +0 -1
  217. package/dist/gateway/static/root/assets/session-manager-DMDBMYfh.js +0 -16
  218. package/dist/gateway/static/root/assets/sessions-page-CvfoPeM6.js +0 -1
  219. package/dist/gateway/static/root/assets/settings-advanced-gate-BOkrHL8q.js +0 -1
  220. package/dist/gateway/static/root/assets/settings-page-C54bw5J9.js +0 -1
  221. package/dist/gateway/static/root/assets/shares-settings-BOa9NAUc.js +0 -1
  222. package/dist/gateway/static/root/assets/skill-reload-api-DEN6tOwG.js +0 -1
  223. package/dist/gateway/static/root/assets/skills-page-CeNVBQG9.js +0 -2
  224. package/dist/gateway/static/root/assets/task-detail-page-DzK53B5p.js +0 -2
  225. package/dist/gateway/static/root/assets/tracing-settings-page-BUUnZfZW.js +0 -1
  226. package/dist/gateway/static/root/assets/user-model-page-DxcH74eP.js +0 -2
  227. package/dist/gateway/static/root/assets/workflows-page-Bo5b5t_9.js +0 -6
  228. package/dist/src/agent/tools/personal-preference-tool.d.ts +0 -10
  229. package/dist/src/agent/tools/personal-preference-tool.js +0 -55
  230. package/dist/src/connectors/china-catalog.d.ts +0 -2
  231. package/dist/src/connectors/china-catalog.js +0 -873
  232. package/dist/src/connectors/cli/adapters/lark.d.ts +0 -2
  233. package/dist/src/connectors/cli/adapters/lark.js +0 -143
  234. package/dist/src/connectors/cli/adapters/larkShortcuts.d.ts +0 -3
  235. package/dist/src/connectors/cli/adapters/larkShortcuts.js +0 -64
  236. package/dist/src/connectors/cli/adapters/wecom.d.ts +0 -2
  237. package/dist/src/connectors/cli/adapters/wecom.js +0 -97
  238. package/dist/src/connectors/cli/adapters/wps365/bundle.js +0 -575
  239. package/dist/src/connectors/cli/adapters/wps365.d.ts +0 -2
  240. package/dist/src/connectors/cli/adapters/wps365.js +0 -115
  241. package/dist/src/connectors/cli/distributions.d.ts +0 -4
  242. package/dist/src/connectors/cli/distributions.js +0 -69
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,m as a,t as o}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as s}from"./check-DUBLcKHA.js";import{t as ee}from"./circle-check-C23XjkUj.js";import{t as c}from"./external-link-DjqjBmc3.js";import{t as l}from"./x-B_N4OPjy.js";import{n as u,r as d}from"./locale-store-D5h-Ha6-.js";import{a as f,i as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{a as y}from"./local-apps-yys1VChX.js";import{a as b,i as x}from"./vendor-swr-BIWyz7Rc.js";import{$l as S,Ad as te,Af as ne,Br as re,Fd as ie,Fi as C,Go as ae,Gr as oe,Hr as se,Hu as w,Jl as ce,Jr as le,Ju as T,Kc as E,Ml as ue,Nl as de,Qd as D,Rc as fe,Rr as pe,So as me,Ur as he,Vr as ge,Xr as _e,Yr as ve,Zr as ye,_u as be,du as xe,gu as Se,ku as Ce,qr as we,rf as Te,uu as Ee,yd as De,zr as Oe}from"./index-K2cy4f-3.js";import{n as ke,t as Ae}from"./tab-completion-input-CxtEp0aP.js";import{t as je}from"./tab-completion-input.utils-BP3NH_du.js";import{t as Me}from"./page-context-capture-button-DOrPS73o.js";var O=e(t(),1),Ne=`build-xopc-local-app`;function k(e){return(e.routing?.agentId??e.agentId??``).trim().toLowerCase()}function Pe(e){return e.find(e=>k(e)===`coder`)??null}function Fe(e,t){let n=new URLSearchParams({skill:Ne}),r=t?.trim();return r&&n.set(`draft`,r),`/chat/${encodeURIComponent(e)}?${n.toString()}`}var Ie=/^Promoted from chat preview \S+ at revision \S+$/;function Le(e,t){return Ie.test(e.trim())?t:e}var Re=n(),A=r();function ze(e){let t=(0,Re.c)(36),{scenarios:n,results:r,runningTarget:i,zh:a,onRunAll:o,onRunScenario:s,onAskCoder:c}=e;if(!n.length)return null;let l=a?`产品场景`:`Product scenarios`,u;t[0]===l?u=t[1]:(u=(0,A.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:l}),t[0]=l,t[1]=u);let d=a?`${n.length} 个关键用户路径`:`${n.length} critical user journey${n.length===1?``:`s`}`,f;t[2]===d?f=t[3]:(f=(0,A.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:d}),t[2]=d,t[3]=f);let p;t[4]!==u||t[5]!==f?(p=(0,A.jsxs)(`div`,{children:[u,f]}),t[4]=u,t[5]=f,t[6]=p):p=t[6];let m=i!==null,h;t[7]===i?h=t[8]:(h=i===`all`?(0,A.jsx)(T,{className:`size-3 animate-spin`}):(0,A.jsx)(xe,{className:`size-3`}),t[7]=i,t[8]=h);let g=a?`全部重跑`:`Run all`,_;t[9]!==o||t[10]!==m||t[11]!==h||t[12]!==g?(_=(0,A.jsxs)(E,{variant:`ghost`,className:`h-7 rounded-lg px-2 text-[11px]`,onClick:o,disabled:m,children:[h,g]}),t[9]=o,t[10]=m,t[11]=h,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==p||t[15]!==_?(v=(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[p,_]}),t[14]=p,t[15]=_,t[16]=v):v=t[16];let y=a?`产品场景验收结果`:`Product scenario acceptance results`,b;if(t[17]!==c||t[18]!==s||t[19]!==r||t[20]!==i||t[21]!==n||t[22]!==a){let e;t[24]!==c||t[25]!==s||t[26]!==r||t[27]!==i||t[28]!==a?(e=e=>{let t=r[e.id],n=i===`all`||i===e.id?`running`:t?.status??`pending`;return(0,A.jsx)(`li`,{className:`py-2.5 first:pt-1`,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(`span`,{className:`mt-0.5 shrink-0`,"aria-hidden":!0,children:n===`running`?(0,A.jsx)(T,{className:`size-3.5 animate-spin text-accent`}):n===`passed`?(0,A.jsx)(ee,{className:`size-3.5 text-success`}):n===`failed`?(0,A.jsx)(Te,{className:`size-3.5 text-danger`}):(0,A.jsx)(D,{className:`size-3.5 text-fg-subtle`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate text-[11px] font-medium text-fg`,children:e.name}),(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] text-fg-subtle`,children:a?`${e.stepCount} 个步骤`:`${e.stepCount} step${e.stepCount===1?``:`s`}`})]}),(0,A.jsx)(E,{variant:`ghost`,className:`size-7 shrink-0 rounded-lg p-0`,onClick:()=>s(e.id),disabled:i!==null,"aria-label":a?`重跑${e.name}`:`Rerun ${e.name}`,title:a?`单独重跑`:`Rerun scenario`,children:(0,A.jsx)(xe,{className:`size-3`})})]}),n===`running`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`正在隔离预览中执行…`:`Running in an isolated preview…`}):t?.status===`failed`?(0,A.jsxs)(`div`,{className:`mt-1.5`,children:[(0,A.jsx)(`p`,{className:`text-[11px] leading-4 text-danger`,children:t.message}),(0,A.jsxs)(E,{variant:`ghost`,className:`mt-1 h-7 rounded-lg px-2 text-[11px] text-danger hover:text-danger`,onClick:()=>c(e,t),children:[(0,A.jsx)(w,{className:`size-3`}),a?`让 Coder 修复`:`Ask Coder to fix`]})]}):t?.status===`passed`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`场景已通过`:`Scenario passed`}):(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`等待运行`:`Waiting to run`})]})]})},e.id)},t[24]=c,t[25]=s,t[26]=r,t[27]=i,t[28]=a,t[29]=e):e=t[29],b=n.map(e),t[17]=c,t[18]=s,t[19]=r,t[20]=i,t[21]=n,t[22]=a,t[23]=b}else b=t[23];let x;t[30]!==y||t[31]!==b?(x=(0,A.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,"aria-label":y,children:b}),t[30]=y,t[31]=b,t[32]=x):x=t[32];let S;return t[33]!==v||t[34]!==x?(S=(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[v,x]}),t[33]=v,t[34]=x,t[35]=S):S=t[35],S}var Be=`allow-scripts allow-forms`;function Ve(e,t){return C(e,t)}function He(e,t,n){return!!(t&&n&&e.sourceHash===t&&e.status===n.status&&e.interactiveCount===n.interactiveCount&&JSON.stringify(e.checks)===JSON.stringify(n.checks))}function Ue(){let{appId:e}=a(),t=e===`new`,n=u(e=>e.language)===`zh`,r=u(e=>e.language),C=i(),{mutate:D}=b(),Te=ae(e=>e.setPageHeader),Ne=ae(e=>e.clearPageHeader),{data:k,isLoading:Ie,error:Re,mutate:Ue}=x(!t&&e?[`local-app`,e]:null,()=>se(e)),{data:j,isLoading:We,mutate:Ge}=x(!t&&e?[`local-app-validation`,e]:null,()=>ye(e)),[Ke,qe]=(0,O.useState)(``),[Je,Ye]=(0,O.useState)(``),[M,N]=(0,O.useState)(!1),[Xe,P]=(0,O.useState)(null),[Ze,Qe]=(0,O.useState)(!1),[$e,et]=(0,O.useState)(!1),[tt,nt]=(0,O.useState)(0),[rt,it]=(0,O.useState)(``),[F,at]=(0,O.useState)(!1),[I,ot]=(0,O.useState)(!1),[L,R]=(0,O.useState)(`booting`),[z,st]=(0,O.useState)(null),[B,ct]=(0,O.useState)(null),[V,lt]=(0,O.useState)({}),[H,ut]=(0,O.useState)(`all`),[U,W]=(0,O.useState)(0),[dt,ft]=(0,O.useState)(0),[pt,mt]=(0,O.useState)(null),[G,ht]=(0,O.useState)(null),[gt,_t]=(0,O.useState)([]),[vt,yt]=(0,O.useState)(!1),bt=(0,O.useRef)(new Set),K=(0,O.useRef)(null),xt=(0,O.useRef)(null),St=(0,O.useRef)(null),q=(0,O.useRef)(null),J=(0,O.useRef)(``),Y=j?.acceptanceScenarios??[],X=(0,O.useMemo)(()=>{if(!Y.length)return null;let e=Y.map(e=>V[e.id]).filter(e=>!!e);return e.length===Y.length?{status:e.some(e=>e.status===`failed`)?`failed`:`passed`,scenarioCount:Y.length,scenarios:e}:null},[Y,V]),Z=(0,O.useMemo)(()=>{if(!B)return null;if(!j?.acceptanceScenarioCount)return B;if(!X)return null;let e=X.scenarios.find(e=>e.status===`failed`),t={id:`criteria`,status:X.status,message:e?`${e.name}: ${e.message}`:`${X.scenarioCount} product scenario(s) passed`},n=[...B.checks,t];return{status:n.some(e=>e.status===`failed`)?`failed`:`passed`,checks:n,interactiveCount:B.interactiveCount}},[B,X,j?.acceptanceScenarioCount]),Ct=(0,O.useCallback)(async(e,t)=>{let n=Pe(await me(e.projectId));if(!n){C(`/chat/new?${new URLSearchParams({projectId:e.projectId,...t?{draft:t}:{}})}`,{state:{agentId:`coder`,forceNewChat:!0}});return}bt.current.add(n.key),C(Fe(n.key,t))},[C]),wt=(0,O.useCallback)(async(e=!0)=>{if(!k)return null;ot(!0);try{let t=await ye(k.id);return await Ge(t,{revalidate:!1}),e&&(q.current=t.sourceHash??null,ut(`all`),W(0),nt(e=>e+1)),t}catch(e){return P(e instanceof Error?e.message:String(e)),null}finally{ot(!1)}},[k,Ge]);(0,O.useEffect)(()=>{if(!k)return;let e=!1;me(k.projectId).then(t=>{e||(bt.current=new Set(t.filter(e=>(e.routing?.agentId??e.agentId)?.toLowerCase()===`coder`).map(e=>e.key)))}).catch(()=>{});let t=e=>{let t=e.detail?.key;!t||!bt.current.has(t)||(K.current!==null&&window.clearTimeout(K.current),K.current=window.setTimeout(()=>{K.current=null,wt(!0)},750))};return window.addEventListener(`session-transcript-updated`,t),()=>{e=!0,window.removeEventListener(`session-transcript-updated`,t),K.current!==null&&window.clearTimeout(K.current)}},[k,wt]),(0,O.useEffect)(()=>{_t(k?.acceptanceRuns??[])},[k?.acceptanceRuns]),(0,O.useEffect)(()=>{q.current=null},[k?.id]),(0,O.useEffect)(()=>{!j?.sourceHash||q.current===j.sourceHash||(q.current=j.sourceHash,ut(`all`),W(0),nt(e=>e+1))},[k?.id,j?.sourceHash]),(0,O.useLayoutEffect)(()=>{if(!k)return;R(`booting`),st(null),ct(null),ht(null),yt(!1),J.current=``;let e=window.setTimeout(()=>R(e=>e===`failed`?e:`timeout`),7e3),t=xt.current?re(xt.current,t=>{let n=y(t);if(n){if(n.type===`ready`){R(e=>e===`failed`?e:`healthy`);return}if(n.type===`acceptance`){window.clearTimeout(e),ct(n.detail),ht(q.current);return}n.type!==`criteria`&&(window.clearTimeout(e),st(n.detail),R(`failed`))}}):()=>{};return()=>{window.clearTimeout(e),t()}},[k,tt]),(0,O.useLayoutEffect)(()=>{if(!k||j?.status!==`healthy`||!Y.length){mt(null);return}let e=H===`all`?Y[U]:Y.find(e=>e.id===H),t=e?[e]:[];if(!t.length)return;mt(H),lt(e=>{if(H===`all`&&U===0)return{};let t={...e};return delete t[H],t});let r=!1,i=e=>{lt(n=>{let r={...n};for(let n of t)r[n.id]={id:n.id,name:n.name,status:`failed`,message:e,failureKind:`runner`};return r}),mt(null)},a=window.setTimeout(()=>i(r?n?`场景在 10 秒内未完成。`:`Scenario did not finish within 10 seconds.`:n?`验收执行器未能连接,请重新验收。`:`The acceptance runner did not connect. Run acceptance again.`),1e4),o=St.current?re(St.current,e=>{let t=y(e);t&&(t.type===`ready`?r=!0:t.type===`criteria`?(window.clearTimeout(a),lt(e=>{let n={...e};for(let e of t.detail.scenarios)(n[e.id]?.status!==`failed`||e.status===`failed`)&&(n[e.id]=e);return n}),H===`all`&&U+1<Y.length?(W(e=>e+1),ft(e=>e+1)):mt(null)):t.type===`error`&&(window.clearTimeout(a),i(pe(t.detail))))}):()=>{};return()=>{window.clearTimeout(a),o()}},[Y,k,dt,H,U,tt,j?.status,n]),(0,O.useEffect)(()=>{if(!k||!Z||!G||G!==j?.sourceHash)return;let e=`${k.id}:${G}:${JSON.stringify(Z)}`;J.current!==e&&(J.current=e,yt(!0),we(k.id,G,Z).then(t=>{J.current===e&&_t(e=>[t,...e.filter(e=>e.id!==t.id)].toSorted((e,t)=>t.createdAt-e.createdAt).slice(0,20))}).catch(t=>{J.current===e&&(J.current=``,yt(!1),P(t instanceof Error?t.message:String(t)))}).finally(()=>{J.current===e&&yt(!1)}))},[Z,G,k,j?.sourceHash]);let Q=(0,O.useCallback)(async e=>{if(k){at(!0),P(null);try{await Ct(k,e)}catch(e){P(e instanceof Error?e.message:String(e)),at(!1)}}},[k,Ct]);(0,O.useLayoutEffect)(()=>(Te({startExtra:(0,A.jsx)(o,{to:`/local-apps`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`返回应用工坊`:`Back to App Studio`,children:(0,A.jsx)(ne,{className:`size-4`})}),main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:k?.name||(n?`创建应用`:`Create app`)}),end:k?(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(Me,{resource:{kind:`local_app`,id:k.id,revision:j?.sourceHash??``},disabled:M||F||I||!j?.sourceHash}),(0,A.jsx)(E,{asChild:!0,variant:`ghost`,className:`h-9`,children:(0,A.jsxs)(o,{to:`/projects/${encodeURIComponent(k.projectId)}`,children:[(0,A.jsx)(te,{className:`size-4`}),`Project`]})}),(0,A.jsxs)(E,{className:`h-9`,onClick:()=>void Q(),disabled:F,children:[F?(0,A.jsx)(T,{className:`size-4 animate-spin`}):(0,A.jsx)(w,{className:`size-4`}),n?`继续开发`:`Continue building`]})]}):null}),()=>Ne()),[k,M,F,I,j?.sourceHash,Ne,Q,Te,n]);async function Tt(e){e.preventDefault(),N(!0),P(null);try{let e=await ge({name:Ke,idea:Je});await D(`local-apps-list`);let t=n?`请基于 APP_BRIEF.md 完成这个本地应用的首版。先检查现有草稿,再实现最小可用版本并运行校验;完成后告诉我可以如何预览。`:`Build the first usable version of this local app from APP_BRIEF.md. Inspect the existing draft, implement the smallest useful version, run validation, and tell me how to preview it.`;try{await Ct(e,t)}catch{C(`/local-apps/${encodeURIComponent(e.id)}`,{replace:!0})}}catch(e){P(e instanceof Error?e.message:String(e))}finally{N(!1)}}async function Et(){if(k){N(!0),P(null);try{await Ue(await oe(k.id),{revalidate:!1}),await Ge(),await Promise.all([D(`local-apps-list`),D(`gateway-extensions-list`)]),Qe(!1)}catch(e){P(e instanceof Error?e.message:String(e))}finally{N(!1)}}}async function Dt(e){N(!0),P(null);try{return await Ue(await e(),{revalidate:!1}),await Ge(),await Promise.all([D(`local-apps-list`),D(`gateway-extensions-list`)]),!0}catch(e){return P(e instanceof Error?e.message:String(e)),!1}finally{N(!1)}}async function Ot(e){k&&await Dt(()=>ve(k.id,e))}async function kt(e){k&&await Dt(()=>le(k.id,e))}async function At(){k&&await Dt(()=>_e(k.id))&&et(!1)}async function jt(e){if(!(!k||!e.length)){P(null);try{await Q((await he(k.id,{sourceHash:j?.sourceHash,locale:n?`zh`:`en`,diagnostics:e})).prompt)}catch(e){P(e instanceof Error?e.message:String(e))}}}function Mt(){jt([...j?.issues.map(e=>({phase:`build`,code:e.code,message:e.message}))??[],...z?[{phase:`runtime`,code:z.kind,message:pe(z)}]:[],...Z?.checks.filter(e=>e.status===`failed`&&e.id!==`criteria`).map(e=>({phase:`acceptance`,code:e.id,message:e.message}))??[],...Object.values(V).filter(e=>e.status===`failed`).map(e=>({phase:e.failureKind===`runner`?`runner`:`acceptance`,code:e.id,message:`${e.name}: ${e.message}`})),...L===`timeout`?[{phase:`boot`,code:`boot_timeout`,message:`Preview did not report ready within 7 seconds.`}]:[]])}function Nt(){ut(`all`),W(0),ft(e=>e+1)}function Pt(e){ut(e),W(0),ft(e=>e+1)}function Ft(e,t){jt([{phase:t.failureKind===`runner`?`runner`:`acceptance`,code:e.id,message:`${e.name}: ${t.message}`}])}let It=gt.findIndex(e=>He(e,G,Z)),$=It>=0?gt[It]:null,Lt=It>=0?gt[It+1]??null:gt[0]??null,Rt=Oe(Z),zt=Lt?Lt.checks.filter(e=>e.status===`failed`).map(e=>e.message):[],Bt=j?.status===`failed`||L===`failed`||L===`timeout`||Z?.status===`failed`||Object.values(V).some(e=>e.status===`failed`),Vt=zt.filter(e=>!Rt.includes(e)).length;async function Ht(){let e=await wt(!1);if(e?.status===`healthy`&&e.sourceHash!==G){q.current=e.sourceHash??null,W(0),nt(e=>e+1);return}e?.status===`healthy`&&L===`healthy`&&Z?.status===`passed`&&$&&$.sourceHash===e.sourceHash&&Qe(!0)}return t?(0,A.jsx)(`div`,{className:`flex min-h-0 flex-1 bg-surface-panel p-3 sm:p-5 xl:p-6`,children:(0,A.jsxs)(`div`,{className:`grid w-full min-w-0 overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base shadow-surface lg:grid-cols-[minmax(280px,0.8fr)_minmax(0,1.5fr)]`,children:[(0,A.jsxs)(`form`,{onSubmit:Tt,className:`flex flex-col border-b border-edge-subtle p-5 lg:border-b-0 lg:border-r`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-accent`,children:[(0,A.jsx)(ce,{className:`size-4`}),n?`告诉 Coder 你的想法`:`Tell Coder your idea`]}),(0,A.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:n?`你想创建什么?`:`What do you want to create?`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`我们会建立一个 Coder Project,并把应用上下文和开发 Skill 带入对话。`:`We will create a Coder Project and carry the app context and development skill into chat.`}),(0,A.jsxs)(`label`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:[n?`应用名称`:`App name`,(0,A.jsx)(Ae,{value:Ke,onChange:e=>qe(e.target.value),suggestion:je(n?`例如:阅读清单`:`e.g. Reading list`),onAcceptSuggestion:qe,required:!0,className:`mt-2 w-full rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:阅读清单`:`e.g. Reading list`})]}),(0,A.jsxs)(`label`,{className:`mt-4 text-xs font-medium text-fg-muted`,children:[n?`描述你的想法`:`Describe your idea`,(0,A.jsx)(ke,{value:Je,onChange:e=>Ye(e.target.value),suggestion:je(n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`),onAcceptSuggestion:Ye,required:!0,rows:7,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`})]}),Xe?(0,A.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:Xe}):null,(0,A.jsxs)(E,{type:`submit`,variant:`primary`,className:`mt-5 h-10`,disabled:M||!Ke.trim()||!Je.trim(),children:[M?(0,A.jsx)(T,{className:`size-4 animate-spin`}):(0,A.jsx)(w,{className:`size-4`}),n?`进入 Coder 对话`:`Continue with Coder`]})]}),(0,A.jsx)(`div`,{className:`hidden min-h-[620px] place-items-center bg-surface-panel p-8 lg:grid`,children:(0,A.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,A.jsx)(`div`,{className:`mx-auto flex size-16 items-center justify-center rounded-2xl border border-edge bg-surface-base text-accent shadow-surface`,children:(0,A.jsx)(Ce,{className:`size-7`})}),(0,A.jsx)(`h3`,{className:`mt-5 text-base font-semibold text-fg`,children:n?`创建后,这里就是实时预览`:`Your live preview appears here`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`你可以先体验草稿,再决定是否把它添加到左侧导航。`:`Try the draft first, then decide whether to add it to the sidebar.`})]})})]})}):Ie?(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_260px]`,children:[(0,A.jsx)(fe,{className:`rounded-xl`}),(0,A.jsx)(fe,{className:`rounded-xl`}),(0,A.jsx)(fe,{className:`rounded-xl`})]}):Re||!k?(0,A.jsx)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:Re instanceof Error?Re.message:n?`找不到应用`:`App not found`}):(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 overflow-hidden bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_300px]`,children:[(0,A.jsxs)(`aside`,{className:`min-h-0 min-w-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.12em] text-accent`,children:[(0,A.jsx)(ce,{className:`size-4`}),n?`创作对话`:`Build conversation`]}),(0,A.jsx)(`div`,{className:`mt-4 min-w-0 rounded-xl bg-surface-panel p-3 text-sm leading-6 text-fg [overflow-wrap:anywhere]`,children:Le(k.idea,k.name)}),(0,A.jsxs)(`div`,{className:`mt-4 rounded-xl bg-accent-soft p-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[(0,A.jsx)(ee,{className:`size-4`}),n?`草稿已准备好`:`Draft is ready`]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`继续迭代会进入对应 Project,由 Coder 读取应用上下文和专属 skill。`:`Continue in the Project where Coder has the app context and dedicated skill.`})]}),(0,A.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),Q(rt)},children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-fg-muted`,htmlFor:`local-app-change-request`,children:n?`下一步想改什么?`:`What should change next?`}),(0,A.jsx)(ke,{id:`local-app-change-request`,value:rt,onChange:e=>it(e.target.value),suggestion:je(n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`),onAcceptSuggestion:it,rows:4,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`}),(0,A.jsxs)(E,{type:`submit`,className:`mt-2 w-full`,disabled:F||!rt.trim(),children:[F?(0,A.jsx)(T,{className:`size-4 animate-spin`}):(0,A.jsx)(w,{className:`size-4`}),n?`让 Coder 修改`:`Ask Coder to update`]})]}),(0,A.jsxs)(E,{variant:`ghost`,className:`mt-2 w-full`,onClick:()=>void Q(),disabled:F,children:[(0,A.jsx)(te,{className:`size-4`}),n?`打开已有开发对话`:`Open development chat`]})]}),(0,A.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-edge-subtle px-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${j?.status===`failed`||L===`failed`||L===`timeout`||Z?.status===`failed`?`bg-danger`:j?.status===`healthy`&&L===`healthy`&&Z?.status===`passed`&&$?.sourceHash===j.sourceHash&&!vt?`bg-success`:`bg-fg-subtle`}`}),L===`failed`||L===`timeout`?n?`预览运行异常`:`Preview runtime issue`:j?.status===`failed`||Z?.status===`failed`?n?`自动验收未通过`:`Acceptance needs attention`:L===`booting`||!Z?n?`自动验收中`:`Running acceptance`:vt||$?.sourceHash!==j?.sourceHash?n?`正在保存验收快照`:`Saving acceptance snapshot`:n?`草稿已通过验收`:`Draft accepted`]}),(0,A.jsxs)(E,{variant:`ghost`,className:`h-8 px-2`,onClick:()=>void wt(!0),disabled:I,children:[I?(0,A.jsx)(T,{className:`size-3.5 animate-spin`}):(0,A.jsx)(xe,{className:`size-3.5`}),n?`重新验收`:`Run again`]})]}),(0,A.jsx)(`iframe`,{ref:xt,title:`${k.name} preview`,src:d(k.draftPreviewUrl),sandbox:Be,className:`min-h-0 w-full flex-1 bg-white`,onError:()=>{st({kind:`script_error`,message:`Preview document failed to load`}),R(`failed`)}},tt),j?.status===`healthy`&&j.acceptanceScenarioCount>0?(0,A.jsx)(`iframe`,{ref:St,title:`${k.name} acceptance runner`,src:`${d(k.draftPreviewUrl)}?xopcAcceptance=1&xopcScenario=${encodeURIComponent(H===`all`?Y[U]?.id??``:H)}`,sandbox:Be,"aria-hidden":`true`,tabIndex:-1,className:`pointer-events-none fixed left-[-200vw] top-0 h-[720px] w-[1024px] opacity-0`},`criteria-${tt}-${dt}-${U}`):null]}),(0,A.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n?`发布状态`:`Release status`}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:k.installationState===`not_installed`?n?`尚未安装`:`Not installed`:k.enabled?n?`版本 ${k.activeVersion} 正在使用`:`Version ${k.activeVersion} is active`:n?`已禁用,版本仍保留`:`Disabled, release retained`})]}),(0,A.jsx)(`span`,{className:`mt-1 size-2.5 rounded-full ${k.enabled?`bg-success`:`bg-fg-subtle`}`,"aria-hidden":!0})]}),(0,A.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-3 text-xs`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前草稿`:`Draft`}),(0,A.jsxs)(`dd`,{className:`mt-1 font-medium text-fg`,children:[`v`,k.draftVersion]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`已安装`:`Installed`}),(0,A.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:k.activeVersion?`v${k.activeVersion}`:`—`})]})]}),(0,A.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(ie,{className:`size-4 text-accent`}),n?`草稿检查`:`Draft checks`]}),We||I?(0,A.jsx)(T,{className:`size-3.5 animate-spin text-fg-muted`}):j?.status===`healthy`?(0,A.jsx)(ee,{className:`size-4 text-success`}):(0,A.jsx)(ue,{className:`size-4 text-danger`})]}),j?(0,A.jsxs)(`div`,{className:`mt-2`,children:[(0,A.jsx)(`p`,{className:`text-xs leading-5 ${j.status===`healthy`?`text-fg-muted`:`text-danger`}`,children:j.status===`healthy`?j.hasDraftChanges?n?`${j.changedFileCount} 个文件有改动,可以安装新版本。`:`${j.changedFileCount} changed files are ready for a new release.`:n?`草稿与当前安装版本一致。`:`Draft matches the installed release.`:j.issues[0]?.message}),j.changedFiles.length?(0,A.jsx)(`ul`,{className:`mt-2 space-y-1`,children:j.changedFiles.slice(0,4).map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,j.changedFileCount>4?(0,A.jsx)(`p`,{className:`mt-1 text-[10px] text-fg-subtle`,children:n?`还有 ${j.changedFileCount-4} 个文件`:`${j.changedFileCount-4} more files`}):null,(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${L===`healthy`?`bg-success`:L===`booting`?`bg-fg-subtle`:`bg-danger`}`}),n?`预览运行`:`Preview runtime`]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 ${L===`failed`||L===`timeout`?`text-danger`:`text-fg-muted`}`,children:z?pe(z):L===`healthy`?n?`已成功启动,未发现未捕获异常。`:`Started successfully with no uncaught errors.`:L===`timeout`?n?`7 秒内未完成启动,可能出现白屏或阻塞。`:`Did not finish booting within 7 seconds.`:n?`正在等待应用启动。`:`Waiting for the app to start.`})]}),(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${Z?.status===`passed`?`bg-success`:Z?.status===`failed`?`bg-danger`:`bg-fg-subtle`}`}),n?`自动验收`:`Automatic acceptance`]}),Z?(0,A.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Z.checks.map(e=>(0,A.jsxs)(`li`,{className:`flex items-start gap-2 text-[11px] leading-4 ${e.status===`failed`?`text-danger`:`text-fg-muted`}`,children:[(0,A.jsx)(`span`,{className:`mt-1 size-1.5 shrink-0 rounded-full ${e.status===`failed`?`bg-danger`:e.status===`passed`?`bg-success`:`bg-fg-subtle`}`}),(0,A.jsx)(`span`,{children:e.message})]},e.id))}):(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:j?.acceptanceScenarioCount?n?`正在检查页面基础质量和 ${j.acceptanceScenarioCount} 个产品场景。`:`Checking page quality and ${j.acceptanceScenarioCount} product scenario(s).`:n?`正在检查页面内容和基础交互。`:`Checking rendered content and basic interaction.`}),vt?(0,A.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(T,{className:`size-3 animate-spin`}),n?`正在保存当前源码对应的验收快照…`:`Saving the acceptance snapshot for this source…`]}):$?(0,A.jsx)(`p`,{className:`mt-2 text-[11px] leading-4 text-fg-muted`,children:Lt?n?`相比上次:已修复 ${Vt} 项,仍有 ${Rt.length} 项。`:`Since the previous run: ${Vt} fixed, ${Rt.length} remaining.`:n?`首个验收快照已保存。`:`First acceptance snapshot saved.`}):null,(0,A.jsx)(ze,{scenarios:Y,results:V,runningTarget:pt,zh:n,onRunAll:Nt,onRunScenario:Pt,onAskCoder:Ft})]}),Bt?(0,A.jsxs)(E,{className:`mt-3 w-full`,onClick:Mt,disabled:F,children:[(0,A.jsx)(w,{className:`size-4`}),n?`让 Coder 修复`:`Ask Coder to fix`]}):null]}):(0,A.jsx)(fe,{className:`mt-2 h-12 rounded-lg`})]}),(0,A.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(S,{className:`size-4 text-accent`}),n?`权限`:`Permissions`]}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(j?.permissions??k.permissions).map(e=>(0,A.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:e},e))})]}),(0,A.jsx)(E,{variant:`primary`,className:`mt-5 w-full`,onClick:()=>void Ht(),disabled:M||We||I||vt||j?.status===`failed`||L!==`healthy`||Z?.status!==`passed`||!$||$.sourceHash!==j?.sourceHash||k.installationState===`installed`&&j?.hasDraftChanges===!1,children:k.installationState===`installed`?n?`安装当前更新`:`Install current update`:n?`添加到左侧导航`:`Add to sidebar`}),k.installationState===`installed`?(0,A.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,A.jsxs)(E,{className:`min-w-0 flex-1`,onClick:()=>void Ot(!k.enabled),disabled:M,children:[k.enabled?(0,A.jsx)(be,{className:`size-4`}):(0,A.jsx)(Se,{className:`size-4`}),k.enabled?n?`禁用`:`Disable`:n?`启用`:`Enable`]}),(0,A.jsx)(E,{variant:`ghost`,className:`text-danger hover:text-danger`,onClick:()=>et(!0),disabled:M,"aria-label":n?`卸载应用`:`Uninstall app`,children:(0,A.jsx)(de,{className:`size-4`})})]}):null,(0,A.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(De,{className:`size-4`}),n?`版本历史`:`Release history`]}),k.releases.length?(0,A.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,children:k.releases.map(e=>(0,A.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[`v`,e.version,e.isActive?(0,A.jsx)(`span`,{className:`rounded-full bg-success-soft px-1.5 py-0.5 text-[10px] text-success`,children:n?`当前`:`Active`}):null]}),(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-fg-subtle`,children:Ve(e.createdAt,r)})]}),e.isActive?null:(0,A.jsxs)(E,{variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:()=>void kt(e.id),disabled:M,children:[(0,A.jsx)(Ee,{className:`size-3.5`}),n?`恢复`:`Restore`]})]},e.id))}):(0,A.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n?`安装首个版本后,可以从这里恢复。`:`Install the first version to enable recovery.`})]}),Xe?(0,A.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-danger`,role:`alert`,children:Xe}):null]}),(0,A.jsx)(v,{open:Ze,onOpenChange:Qe,children:(0,A.jsxs)(h,{children:[(0,A.jsx)(f,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,A.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(560px,calc(100vh-32px))] w-[min(520px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-2xl focus:outline-none`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(_,{className:`text-base font-semibold text-fg`,children:n?`确认安装到 XOPC`:`Confirm installation`}),(0,A.jsx)(p,{className:`mt-1 text-sm text-fg-muted`,children:n?`当前草稿会成为左侧导航中的可用版本。`:`The current draft will become the version available in the sidebar.`})]}),(0,A.jsx)(m,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(l,{className:`size-4`})})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,A.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:k.name}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:k.extensionId})]}),(0,A.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`本次迭代`:`This iteration`}),(0,A.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-3 text-xs`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`文件变化`:`Changed files`}),(0,A.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:j?.changedFileCount??0})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`自动验收`:`Acceptance`}),(0,A.jsxs)(`dd`,{className:`mt-1 flex items-center gap-1.5 font-medium text-success`,children:[(0,A.jsx)(ee,{className:`size-3.5`}),n?`已通过并保存`:`Passed and saved`]})]})]}),j?.changedFiles.length?(0,A.jsx)(`ul`,{className:`mt-3 space-y-1`,children:j.changedFiles.slice(0,5).map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,(0,A.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`请求权限`:`Requested permissions`}),(0,A.jsx)(`ul`,{className:`mt-2 space-y-2`,children:(j?.permissions??k.permissions).map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,A.jsx)(s,{className:`size-4 text-success`}),e,k.installationState===`installed`&&j?.permissionDelta.added.includes(e)?(0,A.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-0.5 text-[10px] text-warning`,children:n?`新增`:`New`}):null]},e))}),k.installationState===`installed`&&j?.permissionDelta.added.length?(0,A.jsx)(`p`,{className:`mt-4 rounded-xl bg-warning-soft p-3 text-xs leading-5 text-warning`,children:n?`此更新增加了权限,请确认这些能力符合你的修改意图。`:`This update adds permissions. Confirm they match the change you requested.`}):null,(0,A.jsx)(`p`,{className:`mt-5 rounded-xl bg-accent-soft p-3 text-xs leading-5 text-accent-fg`,children:n?`Phase 1 应用只能使用界面主题和本地存储,不能访问网络或运行系统命令。`:`Phase 1 apps can use theme and local storage only. They cannot access the network or run system commands.`})]}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,A.jsx)(m,{asChild:!0,children:(0,A.jsx)(E,{children:n?`取消`:`Cancel`})}),(0,A.jsxs)(E,{variant:`primary`,onClick:()=>void Et(),disabled:M,children:[M?(0,A.jsx)(T,{className:`size-4 animate-spin`}):(0,A.jsx)(c,{className:`size-4`}),n?`确认安装`:`Install`]})]})]})]})}),(0,A.jsx)(v,{open:$e,onOpenChange:et,children:(0,A.jsxs)(h,{children:[(0,A.jsx)(f,{className:`xopc-dialog-overlay fixed inset-0 z-50 bg-scrim backdrop-blur-[2px]`}),(0,A.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-50 flex h-[min(420px,calc(100vh-32px))] w-[min(500px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-2xl focus:outline-none`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(_,{className:`text-base font-semibold text-fg`,children:n?`卸载当前应用?`:`Uninstall this app?`}),(0,A.jsx)(p,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:n?`应用会从侧栏移除,但 Project、源码、版本历史和本地数据都会保留。`:`The app leaves the sidebar, while its Project, source, release history, and local data remain.`})]}),(0,A.jsx)(m,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(l,{className:`size-4`})})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,A.jsxs)(`div`,{className:`rounded-xl bg-surface-panel p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:k.name}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`之后可从任意保留版本重新安装。`:`You can reinstall any retained release later.`})]})}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,A.jsx)(m,{asChild:!0,children:(0,A.jsx)(E,{children:n?`取消`:`Cancel`})}),(0,A.jsxs)(E,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void At(),disabled:M,children:[M?(0,A.jsx)(T,{className:`size-4 animate-spin`}):(0,A.jsx)(de,{className:`size-4`}),n?`卸载但保留 Project`:`Uninstall and keep Project`]})]})]})]})})]})}export{Ue as LocalAppWorkbenchPage};
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as a}from"./download-Dk-ZjtO6.js";import{t as o}from"./x-B_N4OPjy.js";import{t as s}from"./messages-Bwv-AOYl.js";import{t as c}from"./cn-0WouolD0.js";import{a as l,c as u,n as d,r as f}from"./locale-store-D5h-Ha6-.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{u as y}from"./session-api-fVuszA_P.js";import{t as b}from"./copy-to-clipboard-HOJ79TWv.js";import{a as x}from"./gateway-realtime-SBtdXzco.js";import{n as S,t as C}from"./sliding-indicator-hwz0sx3h.js";import{$t as w,$u as T,Dd as E,Ds as D,Es as O,Fs as k,Kc as A,Ll as j,Ls as M,Od as N,Pd as P,Rc as F,Ts as I,Xa as L,au as R,bs as z,ds as B,du as V,fs as ee,pf as H,tf as U,vs as W,ws as G,ys as K}from"./index-K2cy4f-3.js";import{r as te}from"./settings-page-layout-Dx5S-Msc.js";var q=e(t(),1),J=n();function Y(e){let t=new URLSearchParams;if(!e)return``;e.level?.length&&t.set(`level`,e.level.join(`,`)),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.q&&t.set(`q`,e.q),e.module&&t.set(`module`,e.module),e.requestId&&t.set(`requestId`,e.requestId),e.conversationId&&t.set(`conversationId`,e.conversationId),e.transcriptId&&t.set(`transcriptId`,e.transcriptId),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}async function X(e){return l(f(`/api/logs${Y(e)}`))}async function Z(){return(await l(f(`/api/logs/files`))).files??[]}async function Q(){return(await l(f(`/api/logs/modules`))).modules??[]}async function ne(){let e=await l(f(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function re(){return(await l(f(`/api/logs/dir`))).dir??``}async function ie(){return(await l(f(`/api/logs/level`))).level??`info`}async function ae(e,t){return l(f(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function oe(e){let t=new URLSearchParams;e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.limit!=null&&t.set(`limit`,String(e.limit));let n=t.toString();return(await l(f(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var se=500,ce=class{_callbacks;_cleanup;constructor(e){this._callbacks=e}connect(e,t){this.disconnect();let n=new Set(e?.length?e:[`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);this._cleanup=x(`logs`,{onEvent:e=>{if(e.event!==`log.entry`||!e.data||typeof e.data!=`object`)return;let r=e.data;!n.has(r.level)||t&&r.module!==t||this._callbacks.onEntry(r)},onGap:()=>this._callbacks.onError(`Live log replay gap; refresh the log query`)}),this._callbacks.onConnected()}disconnect(){this._cleanup?.(),this._cleanup=void 0}};function le(e,t){let n=`${t.timestamp}-${t.requestId??``}-${t.message}`;return[t,...e.filter(e=>`${e.timestamp}-${e.requestId??``}-${e.message}`!==n)].slice(0,se)}var ue=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function de(e){let t=new Date(String(e.timestamp)).getTime();return Number.isFinite(t)?t:0}function fe(e){return e.toSorted((e,t)=>de(t)-de(e))}var pe=new Set(ue),me=[`error`,`fatal`],he=[`warn`,`error`,`fatal`],ge=[`info`,`warn`,`error`,`fatal`];function _e(e){if(!e)return new Set;let t=new Set;for(let n of e.split(`,`)){let e=n.trim();pe.has(e)&&t.add(e)}return t}function ve(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ye(e,t){return e.size===t.length?t.every(t=>e.has(t)):!1}function be(e){return e.size===0?`all`:ye(e,me)?`errors`:ye(e,he)?`warnPlus`:ye(e,ge)?`infoPlus`:e.size===ue.length&&ue.every(t=>e.has(t))?`verbose`:`custom`}function xe(e){let t=be(e);return t===`custom`?`other`:t}function Se(e){switch(e){case`all`:return new Set;case`errors`:return new Set(me);case`warnPlus`:return new Set(he);case`infoPlus`:return new Set(ge);case`verbose`:return new Set(ue)}}function Ce(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function we(e){return String(e.module||e.service||e.extension||`—`)}function Te(e){if(typeof e.message==`string`&&e.message)return e.message;try{return JSON.stringify(e)}catch{return``}}function Ee(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{return e}}function De(e){try{return new Date(e).toLocaleString()}catch{return e}}function Oe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ke(e){let t=e.trim();return t.length<=10?t:`${t.slice(0,8)}…`}function Ae(e){return String(e).toLowerCase()}function je(e){let t=e.phase??e.meta?.phase;return typeof t==`string`&&t.trim()?t:`—`}function Me(e){return`${e.timestamp}-${e.requestId??``}-${e.message}`}function Ne(e){let t=e.err??e.meta?.err;if(!t||typeof t!=`object`)return null;let n=t;return{name:typeof n.name==`string`?n.name:void 0,message:typeof n.message==`string`?n.message:void 0,stack:typeof n.stack==`string`?n.stack:void 0}}function Pe(e,t){if(t.selectedLevels.size>0&&!t.selectedLevels.has(e.level)||t.moduleFilter&&we(e)!==t.moduleFilter||t.requestIdFilter&&e.requestId!==t.requestIdFilter||t.transcriptIdFilter&&e.transcriptId!==t.transcriptIdFilter&&e.conversationId!==t.transcriptIdFilter)return!1;if(t.dateFrom){let n=new Date(t.dateFrom).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r<n)return!1}if(t.dateTo){let n=new Date(t.dateTo).getTime(),r=new Date(String(e.timestamp)).getTime();if(Number.isFinite(n)&&Number.isFinite(r)&&r>n)return!1}if(t.debouncedSearch){let n=t.debouncedSearch.toLowerCase();if(![e.message,we(e),je(e),e.requestId,e.conversationId,e.transcriptId,Ne(e)?.message,Ne(e)?.stack].filter(Boolean).map(String).join(` `).toLowerCase().includes(n))return!1}return!0}function Fe(e,t){let n=[];for(let r of ue){let i=e[r]??0;i>0&&n.push(`${t[r]} ${i}`)}return n.join(` · `)}function Ie(e,t){switch(t.type){case`setSearchInput`:return e.searchInput===t.value?e:{...e,searchInput:t.value};case`setDebouncedSearch`:return e.debouncedSearch===t.value?e:{...e,debouncedSearch:t.value};case`setLevels`:return ve(e.selectedLevels,t.value)?e:{...e,selectedLevels:t.value};case`toggleLevel`:{let n=new Set(e.selectedLevels);return n.has(t.level)?n.delete(t.level):n.add(t.level),{...e,selectedLevels:n}}case`setModule`:return e.moduleFilter===t.value?e:{...e,moduleFilter:t.value};case`setRequestIdFilter`:return e.requestIdFilter===t.value?e:{...e,requestIdFilter:t.value};case`setTranscriptIdFilter`:return e.transcriptIdFilter===t.value?e:{...e,transcriptIdFilter:t.value};case`setDateFrom`:return e.dateFrom===t.value?e:{...e,dateFrom:t.value};case`setDateTo`:return e.dateTo===t.value?e:{...e,dateTo:t.value};case`setAutoRefresh`:return e.autoRefresh===t.value?e:{...e,autoRefresh:t.value};case`syncFromUrl`:{let n=t.payload;return e.searchInput===n.searchInput&&e.debouncedSearch===n.debouncedSearch&&ve(e.selectedLevels,n.selectedLevels)&&e.moduleFilter===n.moduleFilter&&e.requestIdFilter===n.requestIdFilter&&e.transcriptIdFilter===n.transcriptIdFilter&&e.dateFrom===n.dateFrom&&e.dateTo===n.dateTo&&e.autoRefresh===n.autoRefresh?e:{...e,...n}}case`clearAll`:return{searchInput:``,debouncedSearch:``,selectedLevels:new Set,moduleFilter:``,requestIdFilter:``,transcriptIdFilter:``,dateFrom:``,dateTo:``,autoRefresh:e.autoRefresh}}}var Le={logs:[],loading:!1,error:null,hasMore:!1,modules:[],files:[],stats:null,logDir:null};function Re(e,t){switch(t.type){case`queryStart`:return{...e,loading:!0,error:null,logs:[]};case`querySuccess`:return{...e,loading:!1,logs:fe(t.logs),hasMore:t.hasMore};case`queryError`:return t.resetLogs?{...e,loading:!1,error:t.message,logs:[],hasMore:!1}:{...e,loading:!1,error:t.message};case`appendSuccess`:return{...e,loading:!1,logs:fe([...e.logs,...t.logs]),hasMore:t.hasMore};case`metaSuccess`:return{...e,modules:t.modules,stats:t.stats,files:t.files};case`filesSuccess`:return{...e,files:t.files,logDir:t.logDir};case`filesClear`:return{...e,files:[]};case`liveTick`:return{...e,logs:fe(t.logs),hasMore:t.hasMore,stats:t.stats};case`appendLiveEntry`:return{...e,logs:fe(le(e.logs,t.entry))};case`updateStats`:return{...e,stats:t.stats};case`refreshAllSuccess`:return{...e,loading:!1,logs:fe(t.logs),hasMore:t.hasMore,stats:t.stats,files:t.files}}}function ze(e){let t=s(e).logs,n=u(e=>e.conversationId),r=!!n,[a,o]=i(),c=(0,q.useRef)(a),[l,d]=(0,q.useReducer)(Ie,void 0,()=>{let e=c.current,t=e.get(`q`)??``;return{searchInput:t,debouncedSearch:t.trim(),selectedLevels:_e(e.get(`level`)),moduleFilter:e.get(`module`)??``,requestIdFilter:e.get(`requestId`)??``,transcriptIdFilter:e.get(`transcriptId`)??``,dateFrom:e.get(`from`)??``,dateTo:e.get(`to`)??``,autoRefresh:e.get(`live`)===`1`}}),[f,p]=(0,q.useReducer)(Re,Le),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(!1),[v,b]=(0,q.useState)(!1),[x,S]=(0,q.useState)(null),[C,w]=(0,q.useState)([]),[T,E]=(0,q.useState)(!1),{searchInput:D,debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P,autoRefresh:F}=l,{logs:I,loading:L,error:R,hasMore:z,modules:B,files:V,stats:ee,logDir:H}=f,U=(0,q.useCallback)(e=>d({type:`setSearchInput`,value:e}),[]),W=(0,q.useCallback)(e=>d({type:`setLevels`,value:e}),[]),G=(0,q.useCallback)(e=>d({type:`setModule`,value:e}),[]),K=(0,q.useCallback)(e=>d({type:`setRequestIdFilter`,value:e}),[]),te=(0,q.useCallback)(e=>d({type:`setTranscriptIdFilter`,value:e}),[]),J=(0,q.useCallback)(e=>d({type:`setDateFrom`,value:e}),[]),Y=(0,q.useCallback)(e=>d({type:`setDateTo`,value:e}),[]),ie=(0,q.useCallback)(e=>d({type:`setAutoRefresh`,value:e}),[]),ae=(0,q.useMemo)(()=>xe(k),[k]),se=e=>{if(e===`other`){b(!0);return}d({type:`setLevels`,value:Se(e)})},le=O.length>0||k.size>0||!!A||!!j||!!M||!!N||!!P,ue=+(O.length>0)+ +(k.size>0)+ +!!A+ +!!j+ +!!M+(N||P?1:0);(0,q.useEffect)(()=>{let e=setTimeout(()=>d({type:`setDebouncedSearch`,value:D.trim()}),300);return()=>clearTimeout(e)},[D]),(0,q.useEffect)(()=>{let e=a.get(`q`)??``;d({type:`syncFromUrl`,payload:{searchInput:e,debouncedSearch:e.trim(),selectedLevels:_e(a.get(`level`)),moduleFilter:a.get(`module`)??``,requestIdFilter:a.get(`requestId`)??``,transcriptIdFilter:a.get(`transcriptId`)??``,dateFrom:a.get(`from`)??``,dateTo:a.get(`to`)??``,autoRefresh:a.get(`live`)===`1`}})},[a]),(0,q.useEffect)(()=>{let e=new URLSearchParams(a),t=O.trim();t?e.set(`q`,t):e.delete(`q`),k.size>0?e.set(`level`,Array.from(k).sort().join(`,`)):e.delete(`level`),A?e.set(`module`,A):e.delete(`module`),j?e.set(`requestId`,j):e.delete(`requestId`),M?e.set(`transcriptId`,M):e.delete(`transcriptId`),N?e.set(`from`,N):e.delete(`from`),P?e.set(`to`,P):e.delete(`to`),F?e.set(`live`,`1`):e.delete(`live`),e.toString()!==a.toString()&&o(e,{replace:!0})},[F,N,P,O,A,j,M,a,k,o]);let de=(0,q.useMemo)(()=>({q:O||void 0,level:k.size>0?Array.from(k):void 0,module:A||void 0,requestId:j||void 0,transcriptId:M||void 0,from:N||void 0,to:P||void 0,limit:50}),[O,k,A,j,M,N,P]),fe=(0,q.useMemo)(()=>({debouncedSearch:O,selectedLevels:k,moduleFilter:A,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,dateTo:P}),[O,k,A,j,M,N,P]),pe=(0,q.useRef)(fe);return pe.current=fe,(0,q.useEffect)(()=>{if(!r)return;let e=!1;return E(!0),oe({from:N||void 0,to:P||void 0,limit:12}).then(t=>{e||w(t)}).catch(()=>{e||w([])}).finally(()=>{e||E(!1)}),()=>{e=!0}},[r,N,P]),(0,q.useEffect)(()=>{if(!r)return;let e=!1;return p({type:`queryStart`}),(async()=>{try{let t=await X({...de,offset:0});if(e)return;p({type:`querySuccess`,logs:t.logs,hasMore:t.logs.length===50})}catch(n){e||p({type:`queryError`,message:n instanceof Error?n.message:t.loadError,resetLogs:!0})}})(),()=>{e=!0}},[r,de,t.loadError]),(0,q.useEffect)(()=>{if(!r)return;let e=!1;return(async()=>{try{let[t,n,r]=await Promise.all([Q(),ne(),Z()]);e||p({type:`metaSuccess`,modules:t,stats:n,files:r})}catch{}})(),()=>{e=!0}},[r]),(0,q.useEffect)(()=>{if(!r||!g)return;let e=!1;return(async()=>{try{let[t,n]=await Promise.all([Z(),re()]);e||p({type:`filesSuccess`,files:t,logDir:n})}catch{e||p({type:`filesClear`})}})(),()=>{e=!0}},[r,g]),(0,q.useEffect)(()=>{if(!F||!r)return;let e=new ce({onConnected:()=>{},onEntry:e=>{Pe(e,pe.current)&&p({type:`appendLiveEntry`,entry:e})},onError:()=>{}});e.connect(k.size>0?Array.from(k):void 0,A||void 0);let t=window.setInterval(()=>{ne().then(e=>{p({type:`updateStats`,stats:e})}).catch(()=>{})},3e4);return()=>{e.disconnect(),clearInterval(t)}},[F,r,n,k,A]),(0,q.useEffect)(()=>{if(!x)return;let e=window.setTimeout(()=>S(null),2e3);return()=>clearTimeout(e)},[x]),{L:t,hasToken:r,logs:I,loading:L,error:R,hasMore:z,searchInput:D,setSearchInput:U,selectedLevels:k,setSelectedLevels:W,moduleFilter:A,setModuleFilter:G,requestIdFilter:j,transcriptIdFilter:M,dateFrom:N,setDateFrom:J,dateTo:P,setDateTo:Y,modules:B,files:V,stats:ee,selectedLog:m,setSelectedLog:h,filesOpen:g,setFilesOpen:_,filtersOpen:v,setFiltersOpen:b,logDir:H,autoRefresh:F,setAutoRefresh:ie,copiedDetail:x,setCopiedDetail:S,hasActiveFilters:le,activeFilterCount:ue,clearFilters:()=>d({type:`clearAll`}),toggleDialogLevel:e=>d({type:`toggleLevel`,level:e}),handleLoadMore:()=>{L||!z||(async()=>{p({type:`queryStart`});try{let e=await X({...de,offset:I.length});p({type:`appendSuccess`,logs:e.logs,hasMore:e.logs.length===50})}catch(e){p({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},refreshAll:()=>{(async()=>{p({type:`queryStart`});try{let e=await X({...de,offset:0}),[t,n]=await Promise.all([ne(),Z()]);p({type:`refreshAllSuccess`,logs:e.logs,hasMore:e.logs.length===50,stats:t,files:n})}catch(e){p({type:`queryError`,message:e instanceof Error?e.message:t.loadError})}})()},levelSegment:ae,handleLevelSegment:se,filterByRequestId:(0,q.useCallback)(e=>{h(null),K(e)},[K]),filterByTranscriptId:(0,q.useCallback)(e=>{h(null),te(e)},[te]),filterByErrorSummary:(0,q.useCallback)(e=>{d({type:`setSearchInput`,value:e.errName}),d({type:`setDebouncedSearch`,value:e.errName}),e.module&&d({type:`setModule`,value:e.module}),d({type:`setLevels`,value:Se(`errors`)})},[]),openChatForSession:(0,q.useCallback)(e=>{let t=e.conversationId?.trim();if(t){window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:t}}));return}let n=e.transcriptId?.trim();n&&y({transcriptId:n}).then(e=>{window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:{conversationId:e.conversationId}}))}).catch(()=>{})},[]),errorSummary:C,errorSummaryLoading:T}}var $=r();function Be(e){let t=(0,J.c)(36),{L:n,items:r,loading:i,onSelectItem:a}=e,[o,s]=(0,q.useState)(!1);if(!i&&r.length===0)return null;let l;t[0]===r?l=t[1]:(l=r.reduce(He,0),t[0]=r,t[1]=l);let u=l,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>s(Ve),t[2]=d):d=t[2];let f;t[3]===n.errorSummaryTitle?f=t[4]:(f=(0,$.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight text-fg`,children:n.errorSummaryTitle}),t[3]=n.errorSummaryTitle,t[4]=f);let p;t[5]===n.errorSummaryHint?p=t[6]:(p=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:n.errorSummaryHint}),t[5]=n.errorSummaryHint,t[6]=p);let m;t[7]!==f||t[8]!==p?(m=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==r.length||t[11]!==i||t[12]!==u?(h=i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(F,{className:`h-5 w-8 rounded-md`}),(0,$.jsx)(F,{className:`h-5 w-10 rounded-md`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:r.length}),(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-hover px-2 py-0.5 text-xs tabular-nums text-fg-muted`,children:[`×`,u]})]}),t[10]=r.length,t[11]=i,t[12]=u,t[13]=h):h=t[13];let g=o&&`rotate-180`,_;t[14]===g?_=t[15]:(_=c(`size-4 text-fg-muted transition-transform duration-150 ease-out motion-reduce:transition-none`,g),t[14]=g,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,$.jsx)(H,{className:_,strokeWidth:1.75,"aria-hidden":!0}),t[16]=_,t[17]=v);let y;t[18]!==h||t[19]!==v?(y=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-0.5`,children:[h,v]}),t[18]=h,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==y||t[23]!==m?(b=(0,$.jsxs)(`button`,{type:`button`,onClick:d,"aria-expanded":o,className:`flex w-full items-start justify-between gap-3 px-4 py-4 text-left transition-colors hover:bg-surface-hover/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset sm:px-5`,children:[m,y]}),t[21]=o,t[22]=y,t[23]=m,t[24]=b):b=t[24];let x;t[25]!==n.module||t[26]!==n.phase||t[27]!==n.time||t[28]!==o||t[29]!==r||t[30]!==i||t[31]!==a?(x=o&&!i&&r.length>0?(0,$.jsx)(`ul`,{className:`mx-1 mb-1 flex flex-col gap-1 rounded-lg bg-surface-base/45 p-1 [&>li]:rounded-lg`,children:r.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>a?.(e),className:c(`flex w-full flex-col gap-1 px-4 py-2.5 text-left transition-colors hover:bg-surface-hover`,a&&`cursor-pointer`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,children:e.errName}),(0,$.jsxs)(`span`,{className:`shrink-0 rounded-md bg-red-500/10 px-2 py-0.5 text-xs tabular-nums text-red-600 dark:text-red-400`,children:[`×`,e.count]})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[e.phase?(0,$.jsxs)(`span`,{children:[n.phase,`: `,e.phase]}):null,e.module?(0,$.jsxs)(`span`,{children:[n.module,`: `,e.module]}):null,(0,$.jsxs)(`span`,{children:[n.time,`: `,Ee(e.lastSeen)]})]}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-subtle`,children:e.sampleMessage})]})},e.key))}):null,t[25]=n.module,t[26]=n.phase,t[27]=n.time,t[28]=o,t[29]=r,t[30]=i,t[31]=a,t[32]=x):x=t[32];let S;return t[33]!==b||t[34]!==x?(S=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,children:[b,x]}),t[33]=b,t[34]=x,t[35]=S):S=t[35],S}function Ve(e){return!e}function He(e,t){return e+t.count}function Ue(e){let t=(0,J.c)(75),{log:n,labels:r,onFilterByRequestId:i,onFilterByTranscriptId:a,onOpenChat:o}=e,s=n.level??`info`,l=typeof n.requestId==`string`?n.requestId:``,u=typeof n.conversationId==`string`?n.conversationId:``,d=typeof n.transcriptId==`string`?n.transcriptId:``,f;t[0]===n?f=t[1]:(f=je(n),t[0]=n,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=Ne(n),t[2]=n,t[3]=m);let h=m,g=s===`error`||s===`fatal`,_;t[4]===r.message?_=t[5]:(_=(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.message}),t[4]=r.message,t[5]=_);let v=g&&`border-red-500/40`,y;t[6]===v?y=t[7]:(y=c(`mt-2 whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,v),t[6]=v,t[7]=y);let b=n.message||`—`,x;t[8]!==y||t[9]!==b?(x=(0,$.jsx)(`pre`,{className:y,children:b}),t[8]=y,t[9]=b,t[10]=x):x=t[10];let S;t[11]!==_||t[12]!==x?(S=(0,$.jsxs)(`div`,{children:[_,x]}),t[11]=_,t[12]=x,t[13]=S):S=t[13];let C;t[14]!==h||t[15]!==r.stackTrace?(C=h?.stack?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.stackTrace}),h.name?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:h.name}):null,(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-red-500/30 bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-red-500/30`,children:h.stack})]}):null,t[14]=h,t[15]=r.stackTrace,t[16]=C):C=t[16];let w;t[17]===r.time?w=t[18]:(w=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.time}),t[17]=r.time,t[18]=w);let T;t[19]===n.timestamp?T=t[20]:(T=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:n.timestamp}),t[19]=n.timestamp,t[20]=T);let E;t[21]===r.level?E=t[22]:(E=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.level}),t[21]=r.level,t[22]=E);let D=g&&`font-medium text-red-600 dark:text-red-400`,O;t[23]===D?O=t[24]:(O=c(`text-fg`,D),t[23]=D,t[24]=O);let k;t[25]===s?k=t[26]:(k=Ae(s),t[25]=s,t[26]=k);let j;t[27]!==O||t[28]!==k?(j=(0,$.jsx)(`span`,{className:O,children:k}),t[27]=O,t[28]=k,t[29]=j):j=t[29];let M;t[30]===r.module?M=t[31]:(M=(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.module}),t[30]=r.module,t[31]=M);let N;t[32]===n?N=t[33]:(N=we(n),t[32]=n,t[33]=N);let P;t[34]===N?P=t[35]:(P=(0,$.jsx)(`code`,{className:`break-all text-fg`,children:N}),t[34]=N,t[35]=P);let F;t[36]!==r.phase||t[37]!==p?(F=p===`—`?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.phase}),(0,$.jsx)(`code`,{className:`break-all text-fg`,children:p})]}),t[36]=r.phase,t[37]=p,t[38]=F):F=t[38];let I;t[39]!==r.filterByRequestId||t[40]!==r.requestId||t[41]!==i||t[42]!==l?(I=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.requestId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:l}),i?(0,$.jsx)(A,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>i(l),children:r.filterByRequestId}):null]})]}):null,t[39]=r.filterByRequestId,t[40]=r.requestId,t[41]=i,t[42]=l,t[43]=I):I=t[43];let L;t[44]!==r.conversationId||t[45]!==r.openChat||t[46]!==o||t[47]!==u?(L=u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.conversationId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:u}),o?(0,$.jsx)(A,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({conversationId:u}),children:r.openChat}):null]})]}):null,t[44]=r.conversationId,t[45]=r.openChat,t[46]=o,t[47]=u,t[48]=L):L=t[48];let R;t[49]!==r.filterByTranscriptId||t[50]!==r.openChat||t[51]!==r.transcriptId||t[52]!==a||t[53]!==o||t[54]!==d?(R=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`font-sans text-fg-muted`,children:r.transcriptId}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`code`,{className:`break-all text-fg`,children:d}),a?(0,$.jsx)(A,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>a(d),children:r.filterByTranscriptId}):null,o?(0,$.jsx)(A,{type:`button`,variant:`secondary`,className:`h-7 px-2 text-[11px]`,onClick:()=>o({transcriptId:d}),children:r.openChat}):null]})]}):null,t[49]=r.filterByTranscriptId,t[50]=r.openChat,t[51]=r.transcriptId,t[52]=a,t[53]=o,t[54]=d,t[55]=R):R=t[55];let z;t[56]!==w||t[57]!==T||t[58]!==E||t[59]!==j||t[60]!==M||t[61]!==P||t[62]!==F||t[63]!==I||t[64]!==L||t[65]!==R?(z=(0,$.jsxs)(`div`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-2 text-xs`,children:[w,T,E,j,M,P,F,I,L,R]}),t[56]=w,t[57]=T,t[58]=E,t[59]=j,t[60]=M,t[61]=P,t[62]=F,t[63]=I,t[64]=L,t[65]=R,t[66]=z):z=t[66];let B;t[67]!==r.metadata||t[68]!==n.meta?(B=n.meta&&Object.keys(n.meta).length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-xs font-sans font-medium text-fg-muted`,children:r.metadata}),(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto whitespace-pre-wrap break-words border border-edge bg-surface-base p-3 text-xs leading-relaxed text-fg dark:border-edge`,children:JSON.stringify(n.meta,null,2)})]}):null,t[67]=r.metadata,t[68]=n.meta,t[69]=B):B=t[69];let V;return t[70]!==z||t[71]!==B||t[72]!==S||t[73]!==C?(V=(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[S,C,z,B]}),t[70]=z,t[71]=B,t[72]=S,t[73]=C,t[74]=V):V=t[74],V}function We(e){let t=(0,J.c)(50),{L:n,log:r,onClose:i,copiedDetail:a,onCopiedMessage:s,onCopiedJson:l,onFilterByRequestId:u,onFilterByTranscriptId:d,onOpenChat:f}=e,y=r!==null,x;t[0]===i?x=t[1]:(x=e=>!e&&i(),t[0]=i,t[1]=x);let S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(p,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim`,K)}),t[2]=S):S=t[2];let C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C=c(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,W,`dark:border-edge`),t[3]=C):C=t[3];let w;t[4]===n.details?w=t[5]:(w=(0,$.jsx)(_,{className:`text-base font-semibold tracking-tight text-fg`,children:n.details}),t[4]=n.details,t[5]=w);let T;t[6]!==n.copied||t[7]!==n.copyJson||t[8]!==n.copyMessage||t[9]!==a||t[10]!==r||t[11]!==l||t[12]!==s?(T=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(A,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{b(typeof r.message==`string`?r.message:``).then(e=>{e&&s()})},children:[(0,$.jsx)(U,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`message`?n.copied:n.copyMessage})]}),(0,$.jsxs)(A,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1 px-2 text-xs`,onClick:()=>{b(JSON.stringify(r,null,2)).then(e=>{e&&l()})},children:[(0,$.jsx)(U,{className:`size-3.5 shrink-0`,strokeWidth:1.75}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:a===`json`?n.copied:n.copyJson})]})]}):null,t[6]=n.copied,t[7]=n.copyJson,t[8]=n.copyMessage,t[9]=a,t[10]=r,t[11]=l,t[12]=s,t[13]=T):T=t[13];let E;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(o,{className:`size-5`,strokeWidth:1.75}),t[14]=E):E=t[14];let D;t[15]===n.close?D=t[16]:(D=(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(A,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:E})}),t[15]=n.close,t[16]=D);let O;t[17]!==T||t[18]!==D?(O=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[T,D]}),t[17]=T,t[18]=D,t[19]=O):O=t[19];let k;t[20]!==w||t[21]!==O?(k=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[w,O]}),t[20]=w,t[21]=O,t[22]=k):k=t[22];let j;t[23]!==n.conversationId||t[24]!==n.filterByRequestId||t[25]!==n.filterByTranscriptId||t[26]!==n.level||t[27]!==n.message||t[28]!==n.metadata||t[29]!==n.module||t[30]!==n.openChat||t[31]!==n.phase||t[32]!==n.requestId||t[33]!==n.stackTrace||t[34]!==n.time||t[35]!==n.transcriptId||t[36]!==r||t[37]!==u||t[38]!==d||t[39]!==f?(j=r?(0,$.jsx)(Ue,{log:r,labels:{time:n.time,level:n.level,module:n.module,message:n.message,metadata:n.metadata,requestId:n.requestId,conversationId:n.conversationId,transcriptId:n.transcriptId,phase:n.phase,stackTrace:n.stackTrace,filterByRequestId:n.filterByRequestId,filterByTranscriptId:n.filterByTranscriptId,openChat:n.openChat},onFilterByRequestId:u,onFilterByTranscriptId:d,onOpenChat:f}):null,t[23]=n.conversationId,t[24]=n.filterByRequestId,t[25]=n.filterByTranscriptId,t[26]=n.level,t[27]=n.message,t[28]=n.metadata,t[29]=n.module,t[30]=n.openChat,t[31]=n.phase,t[32]=n.requestId,t[33]=n.stackTrace,t[34]=n.time,t[35]=n.transcriptId,t[36]=r,t[37]=u,t[38]=d,t[39]=f,t[40]=j):j=t[40];let M;t[41]===j?M=t[42]:(M=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 font-mono text-sm leading-relaxed`,children:j}),t[41]=j,t[42]=M);let N;t[43]!==k||t[44]!==M?(N=(0,$.jsxs)(h,{children:[S,(0,$.jsxs)(g,{className:C,"aria-describedby":void 0,children:[k,M]})]}),t[43]=k,t[44]=M,t[45]=N):N=t[45];let P;return t[46]!==y||t[47]!==N||t[48]!==x?(P=(0,$.jsx)(v,{open:y,onOpenChange:x,children:N}),t[46]=y,t[47]=N,t[48]=x,t[49]=P):P=t[49],P}function Ge(e){let t=(0,J.c)(25),{L:n,open:r,onOpenChange:i,files:a,logDir:s}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(p,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim`,K)}),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=c(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,85vh)] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,W,`dark:border-edge`),t[1]=u):u=t[1];let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(N,{className:`size-4 text-fg-muted`,strokeWidth:1.75}),t[2]=d):d=t[2];let f;t[3]===n.logFiles?f=t[4]:(f=(0,$.jsxs)(_,{className:`flex items-center gap-2 text-base font-semibold tracking-tight text-fg`,children:[d,n.logFiles]}),t[3]=n.logFiles,t[4]=f);let y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(o,{className:`size-5`,strokeWidth:1.75}),t[5]=y):y=t[5];let b;t[6]===n.close?b=t[7]:(b=(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(A,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:y})}),t[6]=n.close,t[7]=b);let x;t[8]!==f||t[9]!==b?(x=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[f,b]}),t[8]=f,t[9]=b,t[10]=x):x=t[10];let S;t[11]!==n.filesEmpty||t[12]!==a?(S=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:a.length===0?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.filesEmpty}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.map(Ke)})}),t[11]=n.filesEmpty,t[12]=a,t[13]=S):S=t[13];let C;t[14]!==n.logDir||t[15]!==s?(C=s?(0,$.jsxs)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-2 text-xs text-fg-subtle dark:border-edge`,children:[(0,$.jsxs)(`span`,{className:`font-medium text-fg-muted`,children:[n.logDir,`: `]}),(0,$.jsx)(`code`,{className:`break-all text-fg-subtle`,children:s})]}):null,t[14]=n.logDir,t[15]=s,t[16]=C):C=t[16];let w;t[17]!==x||t[18]!==S||t[19]!==C?(w=(0,$.jsxs)(h,{children:[l,(0,$.jsxs)(g,{className:u,children:[x,S,C]})]}),t[17]=x,t[18]=S,t[19]=C,t[20]=w):w=t[20];let T;return t[21]!==i||t[22]!==r||t[23]!==w?(T=(0,$.jsx)(v,{open:r,onOpenChange:i,children:w}),t[21]=i,t[22]=r,t[23]=w,t[24]=T):T=t[24],T}function Ke(e){return(0,$.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`break-all font-mono text-xs text-fg`,children:e.name}),(0,$.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-xs text-fg-subtle`,children:[(0,$.jsx)(`span`,{children:Oe(e.size)}),(0,$.jsx)(`span`,{children:De(e.modified)})]})]},e.name)}function qe(e){let t=(0,J.c)(68),{L:n,open:r,onOpenChange:i,dateFrom:a,onDateFromChange:s,dateTo:l,onDateToChange:u,selectedLevels:d,onToggleLevel:f}=e,y;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(p,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim`,K)}),t[0]=y):y=t[0];let b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=c(`xopc-dialog-content fixed left-1/2 top-1/2 flex max-h-[min(32rem,90vh)] w-[min(100%-2rem,22rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,W,`dark:border-edge`),t[1]=b):b=t[1];let x;t[2]===n.filtersDialogTitle?x=t[3]:(x=(0,$.jsx)(_,{className:`text-base font-semibold tracking-tight text-fg`,children:n.filtersDialogTitle}),t[2]=n.filtersDialogTitle,t[3]=x);let S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(o,{className:`size-5`,strokeWidth:1.75}),t[4]=S):S=t[4];let C;t[5]===n.close?C=t[6]:(C=(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(A,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":n.close,children:S})}),t[5]=n.close,t[6]=C);let w;t[7]!==x||t[8]!==C?(w=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3 dark:border-edge`,children:[x,C]}),t[7]=x,t[8]=C,t[9]=w):w=t[9];let T;t[10]===n.filtersDialogDesc?T=t[11]:(T=(0,$.jsx)(`div`,{id:`log-filters-desc`,className:`sr-only`,children:n.filtersDialogDesc}),t[10]=n.filtersDialogDesc,t[11]=T);let E;t[12]===n.timeRange?E=t[13]:(E=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n.timeRange}),t[12]=n.timeRange,t[13]=E);let D;t[14]===n.from?D=t[15]:(D=(0,$.jsx)(`label`,{htmlFor:`log-from-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.from}),t[14]=n.from,t[15]=D);let O;t[16]===s?O=t[17]:(O=e=>s(e.target.value),t[16]=s,t[17]=O);let k;t[18]!==a||t[19]!==O?(k=(0,$.jsx)(`input`,{id:`log-from-d`,type:`datetime-local`,value:a,onChange:O,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[18]=a,t[19]=O,t[20]=k):k=t[20];let j;t[21]!==k||t[22]!==D?(j=(0,$.jsxs)(`div`,{children:[D,k]}),t[21]=k,t[22]=D,t[23]=j):j=t[23];let M;t[24]===n.to?M=t[25]:(M=(0,$.jsx)(`label`,{htmlFor:`log-to-d`,className:`mb-1 block text-xs text-fg-muted`,children:n.to}),t[24]=n.to,t[25]=M);let N;t[26]===u?N=t[27]:(N=e=>u(e.target.value),t[26]=u,t[27]=N);let P;t[28]!==l||t[29]!==N?(P=(0,$.jsx)(`input`,{id:`log-to-d`,type:`datetime-local`,value:l,onChange:N,className:`w-full rounded-xl border border-edge bg-surface-base p-2 text-sm text-fg dark:border-edge`}),t[28]=l,t[29]=N,t[30]=P):P=t[30];let F;t[31]!==M||t[32]!==P?(F=(0,$.jsxs)(`div`,{children:[M,P]}),t[31]=M,t[32]=P,t[33]=F):F=t[33];let I;t[34]!==j||t[35]!==F?(I=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[j,F]}),t[34]=j,t[35]=F,t[36]=I):I=t[36];let L;t[37]===n.levelCustom?L=t[38]:(L=(0,$.jsx)(`p`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:n.levelCustom}),t[37]=n.levelCustom,t[38]=L);let R;t[39]===n.levelCustomHint?R=t[40]:(R=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:n.levelCustomHint}),t[39]=n.levelCustomHint,t[40]=R);let z=n.level,B;t[41]!==n.levelNames||t[42]!==f||t[43]!==d?(B=ue.map(e=>(0,$.jsx)(`button`,{type:`button`,className:c(`rounded-full border px-3 py-1.5 text-xs font-medium capitalize transition-[color,background-color,border-color] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,d.has(e)?`border-edge bg-surface-active text-fg dark:border-edge`:`border-edge-subtle bg-surface-base text-fg-muted hover:bg-surface-hover dark:border-edge`),onClick:()=>f(e),children:n.levelNames[e]},e)),t[41]=n.levelNames,t[42]=f,t[43]=d,t[44]=B):B=t[44];let V;t[45]!==n.level||t[46]!==B?(V=(0,$.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,role:`group`,"aria-label":z,children:B}),t[45]=n.level,t[46]=B,t[47]=V):V=t[47];let ee;t[48]!==I||t[49]!==L||t[50]!==R||t[51]!==V||t[52]!==E?(ee=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[E,I,L,R,V]}),t[48]=I,t[49]=L,t[50]=R,t[51]=V,t[52]=E,t[53]=ee):ee=t[53];let H;t[54]===i?H=t[55]:(H=()=>i(!1),t[54]=i,t[55]=H);let U;t[56]!==n.filtersDone||t[57]!==H?(U=(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,$.jsx)(A,{type:`button`,className:`w-full rounded-xl`,onClick:H,children:n.filtersDone})}),t[56]=n.filtersDone,t[57]=H,t[58]=U):U=t[58];let G;t[59]!==ee||t[60]!==U||t[61]!==w||t[62]!==T?(G=(0,$.jsxs)(h,{children:[y,(0,$.jsxs)(g,{className:b,"aria-describedby":`log-filters-desc`,children:[w,T,ee,U]})]}),t[59]=ee,t[60]=U,t[61]=w,t[62]=T,t[63]=G):G=t[63];let te;return t[64]!==i||t[65]!==r||t[66]!==G?(te=(0,$.jsx)(v,{open:r,onOpenChange:i,children:G}),t[64]=i,t[65]=r,t[66]=G,t[67]=te):te=t[67],te}var Je=`touch-target relative z-[2] box-border flex h-6 flex-1 cursor-pointer items-center justify-center gap-1 rounded-pill border-0 bg-transparent px-2 py-0 text-center text-xs font-medium leading-none outline-none transition-[color,background-color,box-shadow] duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel active:scale-100 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`;function Ye(e){let t=(0,J.c)(18),{value:n,onChange:r,options:i,"aria-label":a,className:o,buttonClassName:s}=e,l=(0,q.useRef)(null),u=S(l,`button`,`button[aria-pressed="true"]`,1),d;t[0]===o?d=t[1]:(d=c(w,`relative isolate flex w-full max-w-full flex-row items-center`,o),t[0]=o,t[1]=d);let f;t[2]===u?f=t[3]:(f=(0,$.jsx)(C,{bounds:u,className:`rounded-pill bg-surface-panel shadow-sm dark:ring-1 dark:ring-edge-strong/40`}),t[2]=u,t[3]=f);let p;if(t[4]!==s||t[5]!==r||t[6]!==i||t[7]!==n){let e;t[9]!==s||t[10]!==r||t[11]!==n?(e=e=>{let t=e.icon,i=n===e.value;return(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":i,title:e.title??e.label,onClick:()=>r(e.value),className:c(Je,i?`text-fg`:`text-fg-subtle`,s),children:[t?(0,$.jsx)(t,{className:`block size-3 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,$.jsx)(`span`,{className:`min-w-0 shrink truncate leading-none`,children:e.label})]},e.value)},t[9]=s,t[10]=r,t[11]=n,t[12]=e):e=t[12],p=i.map(e),t[4]=s,t[5]=r,t[6]=i,t[7]=n,t[8]=p}else p=t[8];let m;return t[13]!==a||t[14]!==d||t[15]!==f||t[16]!==p?(m=(0,$.jsxs)(`div`,{ref:l,className:d,role:`group`,"aria-label":a,children:[f,p]}),t[13]=a,t[14]=d,t[15]=f,t[16]=p,t[17]=m):m=t[17],m}function Xe(e){let t=(0,J.c)(76),{L:n,levelSegment:r,onLevelSegment:i,searchInput:a,onSearchInputChange:s,moduleFilter:l,onModuleFilterChange:u,modules:d,onOpenFilters:f,activeFilterCount:p,hasActiveFilters:m,onClearFilters:h,autoRefresh:g}=e,_=n.filters,v;t[0]===n.presetAll?v=t[1]:(v={value:`all`,label:n.presetAll},t[0]=n.presetAll,t[1]=v);let y;t[2]===n.presetErrors?y=t[3]:(y={value:`errors`,label:n.presetErrors},t[2]=n.presetErrors,t[3]=y);let b;t[4]===n.presetWarnPlus?b=t[5]:(b={value:`warnPlus`,label:n.presetWarnPlus},t[4]=n.presetWarnPlus,t[5]=b);let x;t[6]===n.presetInfoPlus?x=t[7]:(x={value:`infoPlus`,label:n.presetInfoPlus},t[6]=n.presetInfoPlus,t[7]=x);let S;t[8]===n.presetVerbose?S=t[9]:(S={value:`verbose`,label:n.presetVerbose},t[8]=n.presetVerbose,t[9]=S);let C;t[10]===n.presetOther?C=t[11]:(C={value:`other`,label:n.presetOther},t[10]=n.presetOther,t[11]=C);let w;t[12]!==v||t[13]!==y||t[14]!==b||t[15]!==x||t[16]!==S||t[17]!==C?(w=[v,y,b,x,S,C],t[12]=v,t[13]=y,t[14]=b,t[15]=x,t[16]=S,t[17]=C,t[18]=w):w=t[18];let E;t[19]!==n.levelPresetAria||t[20]!==r||t[21]!==i||t[22]!==w?(E=(0,$.jsx)(`div`,{className:`overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,$.jsx)(`div`,{className:`min-w-[min(100%,36rem)]`,children:(0,$.jsx)(Ye,{"aria-label":n.levelPresetAria,value:r,onChange:i,options:w,buttonClassName:`h-8 px-1.5 text-[11px] sm:px-2 sm:text-xs`})})}),t[19]=n.levelPresetAria,t[20]=r,t[21]=i,t[22]=w,t[23]=E):E=t[23];let D;t[24]===n.searchPlaceholder?D=t[25]:(D=(0,$.jsx)(`span`,{className:`sr-only`,children:n.searchPlaceholder}),t[24]=n.searchPlaceholder,t[25]=D);let O;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(R,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[26]=O):O=t[26];let j;t[27]===s?j=t[28]:(j=e=>s(e.target.value),t[27]=s,t[28]=j);let N=n.searchPlaceholder,P;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=c(`h-10 w-full rounded-md border border-edge bg-surface-panel py-0 pl-10 pr-3 text-sm leading-5 text-fg placeholder:text-fg-subtle dark:border-edge`,k),t[29]=P):P=t[29];let F;t[30]!==n.searchPlaceholder||t[31]!==a||t[32]!==j?(F=(0,$.jsx)(`input`,{type:`search`,value:a,onChange:j,placeholder:N,autoComplete:`off`,spellCheck:!1,className:P}),t[30]=n.searchPlaceholder,t[31]=a,t[32]=j,t[33]=F):F=t[33];let I;t[34]!==D||t[35]!==F?(I=(0,$.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:min-w-[12rem]`,children:[D,O,F]}),t[34]=D,t[35]=F,t[36]=I):I=t[36];let L;t[37]===u?L=t[38]:(L=e=>u(e.target.value),t[37]=u,t[38]=L);let z=n.module,V=n.module,H;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(H=c(M,`h-10 w-full min-w-0 rounded-md py-0`),t[39]=H):H=t[39];let U;t[40]===n.allModules?U=t[41]:(U=(0,$.jsx)(ee,{value:``,children:n.allModules}),t[40]=n.allModules,t[41]=U);let W;t[42]===d?W=t[43]:(W=d.map(Ze),t[42]=d,t[43]=W);let G;t[44]!==n.module||t[45]!==l||t[46]!==L||t[47]!==U||t[48]!==W?(G=(0,$.jsxs)(B,{id:`log-module`,value:l,onChange:L,"aria-label":z,title:V,className:H,children:[U,W]}),t[44]=n.module,t[45]=l,t[46]=L,t[47]=U,t[48]=W,t[49]=G):G=t[49];let K;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(T,{className:`size-4`,strokeWidth:1.75}),t[50]=K):K=t[50];let te;t[51]===p?te=t[52]:(te=p>0?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 text-xs tabular-nums text-fg-muted`,children:p}):null,t[51]=p,t[52]=te);let q;t[53]!==n.filtersMore||t[54]!==f||t[55]!==te?(q=(0,$.jsxs)(A,{type:`button`,variant:`secondary`,className:`h-10 min-h-[44px] gap-2 rounded-md sm:min-h-10`,onClick:f,children:[K,n.filtersMore,te]}),t[53]=n.filtersMore,t[54]=f,t[55]=te,t[56]=q):q=t[56];let Y;t[57]!==n.clear||t[58]!==m||t[59]!==h?(Y=m?(0,$.jsxs)(A,{type:`button`,variant:`ghost`,className:`h-10 min-h-[44px] gap-1 sm:min-h-10`,onClick:h,children:[(0,$.jsx)(o,{className:`size-4`,strokeWidth:1.75}),n.clear]}):null,t[57]=n.clear,t[58]=m,t[59]=h,t[60]=Y):Y=t[60];let X;t[61]!==q||t[62]!==Y?(X=(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center justify-end gap-2`,children:[q,Y]}),t[61]=q,t[62]=Y,t[63]=X):X=t[63];let Z;t[64]!==I||t[65]!==G||t[66]!==X?(Z=(0,$.jsxs)(`div`,{className:`grid gap-2 lg:grid-cols-[minmax(16rem,1fr)_minmax(12rem,16rem)_auto] lg:items-center`,children:[I,G,X]}),t[64]=I,t[65]=G,t[66]=X,t[67]=Z):Z=t[67];let Q;t[68]!==n.liveHint||t[69]!==g?(Q=g?(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:n.liveHint}):null,t[68]=n.liveHint,t[69]=g,t[70]=Q):Q=t[70];let ne;return t[71]!==n.filters||t[72]!==Z||t[73]!==Q||t[74]!==E?(ne=(0,$.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4 sm:p-5`,"aria-label":_,children:[E,Z,Q]}),t[71]=n.filters,t[72]=Z,t[73]=Q,t[74]=E,t[75]=ne):ne=t[75],ne}function Ze(e){return(0,$.jsx)(ee,{value:e,children:e},e)}function Qe(e){let t=(0,J.c)(20),{L:n,logs:r,loading:i,hasMore:a,onSelectLog:o,onLoadMore:s,onRefreshAll:l,onFilterByRequestId:u}=e,d;t[0]!==i||t[1]!==r.length?(d=i&&r.length===0?(0,$.jsx)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20`,"aria-busy":`true`,children:Array.from({length:8}).map($e)}):null,t[0]=i,t[1]=r.length,t[2]=d):d=t[2];let f;t[3]!==n||t[4]!==i||t[5]!==r.length||t[6]!==l?(f=!i&&r.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl bg-surface-hover/20 py-16 text-center`,children:[(0,$.jsx)(P,{className:`size-12 text-fg-subtle`,strokeWidth:1.5,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.noLogs}),(0,$.jsx)(`p`,{className:`max-w-sm text-sm leading-relaxed text-fg-muted`,children:n.noLogsDescription}),(0,$.jsxs)(A,{type:`button`,variant:`secondary`,className:`mt-4 gap-2`,onClick:l,children:[(0,$.jsx)(V,{className:`size-4`,strokeWidth:1.75}),n.refresh]})]}):null,t[3]=n,t[4]=i,t[5]=r.length,t[6]=l,t[7]=f):f=t[7];let p;t[8]!==n||t[9]!==a||t[10]!==i||t[11]!==r||t[12]!==u||t[13]!==s||t[14]!==o?(p=r.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:[Ce(n.showingCount,{count:String(r.length)}),a?(0,$.jsxs)(`span`,{className:`text-fg-subtle`,children:[` · `,n.moreAvailable]}):null]}),(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-hover/20 p-1 text-sm leading-6`,children:[(0,$.jsxs)(`div`,{className:`hidden items-center gap-3 px-3 py-2 text-xs font-medium text-fg-subtle md:flex`,"aria-hidden":!0,children:[(0,$.jsx)(`span`,{className:`w-[5.25rem] shrink-0`,children:n.time}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0`,children:n.level}),(0,$.jsx)(`span`,{className:`w-[4.5rem] shrink-0 sm:w-[5.25rem]`,children:n.requestId}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 xl:block`,children:n.phase}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 lg:block`,children:n.module}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.message})]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:r.map(e=>{let t=e.level??`info`,r=typeof e.requestId==`string`?e.requestId.trim():``,i=je(e),a=t===`error`||t===`fatal`;return(0,$.jsx)(`li`,{className:`rounded-lg bg-surface-base/45`,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>o(e),className:c(`flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left transition-colors duration-150 ease-out`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,a&&`bg-red-500/5`),children:[(0,$.jsx)(`span`,{className:`w-[4.75rem] shrink-0 font-mono text-xs tabular-nums text-fg-subtle sm:w-[5.25rem] sm:text-sm`,children:Ee(e.timestamp)}),(0,$.jsx)(`span`,{className:c(`w-[4.5rem] shrink-0 truncate`,a?`font-medium text-red-600 dark:text-red-400`:`text-fg-muted`),title:t,children:Ae(t)}),(0,$.jsx)(`span`,{className:`hidden w-[4.5rem] shrink-0 truncate font-mono sm:block sm:w-[5.25rem]`,children:r?u?(0,$.jsx)(`span`,{role:`link`,tabIndex:0,className:`cursor-pointer text-accent hover:underline`,title:`${n.requestId}: ${r}`,onClick:e=>{e.stopPropagation(),u(r)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),u(r))},children:ke(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,title:`${n.requestId}: ${r}`,children:ke(r)}):(0,$.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,$.jsx)(`span`,{className:`hidden max-w-[6rem] shrink-0 truncate text-fg-subtle xl:inline`,title:i===`—`?void 0:i,children:i===`—`?`—`:i}),(0,$.jsx)(`span`,{className:`hidden max-w-[7rem] shrink-0 truncate text-fg-muted lg:inline`,title:we(e),children:we(e)}),(0,$.jsx)(`span`,{className:c(`min-w-0 flex-1 truncate`,`text-fg`),children:Te(e)})]})},Me(e))})})]}),a?(0,$.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,$.jsxs)(A,{type:`button`,variant:`secondary`,className:`gap-2`,disabled:i,onClick:s,children:[i?(0,$.jsx)(V,{className:`size-4 animate-spin motion-reduce:animate-none`,strokeWidth:1.75}):(0,$.jsx)(H,{className:`size-4`,strokeWidth:1.75}),n.loadMore]})}):null]}):null,t[8]=n,t[9]=a,t[10]=i,t[11]=r,t[12]=u,t[13]=s,t[14]=o,t[15]=p):p=t[15];let m;return t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,$.jsxs)($.Fragment,{children:[d,f,p]}),t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}function $e(e,t){return(0,$.jsxs)(`div`,{className:`flex gap-3 px-3 py-2.5`,children:[(0,$.jsx)(`div`,{className:`h-4 w-16 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-12 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 w-20 shrink-0 bg-surface-hover motion-reduce:animate-none animate-pulse`}),(0,$.jsx)(`div`,{className:`h-4 min-w-0 flex-1 bg-surface-hover motion-reduce:animate-none animate-pulse`})]},t)}function et(e){let t=(0,J.c)(8),{L:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(j,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[0]=r):r=t[0];let i;t[1]===n.title?i=t[2]:(i=(0,$.jsx)(`h1`,{className:`text-base font-semibold tracking-tight text-fg`,children:n.title}),t[1]=n.title,t[2]=i);let a;t[3]===n.needToken?a=t[4]:(a=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:n.needToken}),t[3]=n.needToken,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,$.jsx)(`div`,{className:`flex w-full flex-col gap-3 px-3 py-10 sm:px-5 xl:px-6`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[r,(0,$.jsxs)(`div`,{children:[i,a]})]})}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function tt(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function nt(e){let t=[`timestamp`,`level`,`module`,`phase`,`requestId`,`transcriptId`,`message`],n=e.map(e=>{let t=String(e.module||``),n=String(e.phase??e.meta?.phase??``);return[e.timestamp,e.level,t,n,e.requestId??``,e.transcriptId??``,e.message??``].map(e=>tt(String(e))).join(`,`)});return[t.join(`,`),...n].join(`
2
- `)}function rt(e,t,n){let r=new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,a.click(),URL.revokeObjectURL(i)}function it(e,t){let n=new Date().toISOString().replace(/[:.]/g,`-`);if(t===`json`){rt(JSON.stringify(e,null,2),`xopc-logs-${n}.json`,`application/json`);return}rt(nt(e),`xopc-logs-${n}.csv`,`text/csv;charset=utf-8`)}function at(e){let t=(0,J.c)(32),{L:n,logs:r,disabled:i}=e,o=i||r.length===0,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(a,{className:`size-4`,strokeWidth:1.75}),t[0]=s):s=t[0];let l;t[1]===n.exportLogs?l=t[2]:(l=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.exportLogs}),t[1]=n.exportLogs,t[2]=l);let u;t[3]!==n.exportLogs||t[4]!==o||t[5]!==l?(u=(0,$.jsx)(D,{asChild:!0,children:(0,$.jsxs)(A,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,disabled:o,title:n.exportLogs,children:[s,l]})}),t[3]=n.exportLogs,t[4]=o,t[5]=l,t[6]=u):u=t[6];let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=c(`w-52 rounded-xl border border-edge bg-surface-overlay p-2 shadow-popover outline-none`,z,`dark:border-edge`),t[7]=d):d=t[7];let f;t[8]===n.exportLogs?f=t[9]:(f=(0,$.jsx)(`p`,{className:`px-2 py-1 text-xs font-medium text-fg`,children:n.exportLogs}),t[8]=n.exportLogs,t[9]=f);let p;t[10]===n.exportHint?p=t[11]:(p=(0,$.jsx)(`p`,{className:`px-2 pb-2 text-xs leading-5 text-fg-muted`,children:n.exportHint}),t[10]=n.exportHint,t[11]=p);let m;t[12]===r?m=t[13]:(m=()=>it(r,`json`),t[12]=r,t[13]=m);let h;t[14]!==n.exportJson||t[15]!==m?(h=(0,$.jsx)(A,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:m,children:n.exportJson}),t[14]=n.exportJson,t[15]=m,t[16]=h):h=t[16];let g;t[17]===r?g=t[18]:(g=()=>it(r,`csv`),t[17]=r,t[18]=g);let _;t[19]!==n.exportCsv||t[20]!==g?(_=(0,$.jsx)(A,{type:`button`,variant:`ghost`,className:`h-8 justify-start px-2 text-xs`,onClick:g,children:n.exportCsv}),t[19]=n.exportCsv,t[20]=g,t[21]=_):_=t[21];let v;t[22]!==_||t[23]!==h?(v=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[h,_]}),t[22]=_,t[23]=h,t[24]=v):v=t[24];let y;t[25]!==v||t[26]!==f||t[27]!==p?(y=(0,$.jsx)(I,{children:(0,$.jsxs)(G,{side:`bottom`,align:`end`,sideOffset:6,className:d,children:[f,p,v]})}),t[25]=v,t[26]=f,t[27]=p,t[28]=y):y=t[28];let b;return t[29]!==y||t[30]!==u?(b=(0,$.jsxs)(O,{children:[u,y]}),t[29]=y,t[30]=u,t[31]=b):b=t[31],b}function ot(e){let t=(0,J.c)(38),{L:n}=e,[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(`info`),[s,l]=(0,q.useState)(!1),[u,d]=(0,q.useState)(null),f,p;t[0]!==n.logLevelLoadError||t[1]!==r?(f=()=>{if(!r)return;let e=!1;return ie().then(t=>{e||o(t)}).catch(t=>{e||d(t instanceof Error?t.message:n.logLevelLoadError)}),()=>{e=!0}},p=[r,n.logLevelLoadError],t[0]=n.logLevelLoadError,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,q.useEffect)(f,p);let m;t[4]===n.logLevelSaveError?m=t[5]:(m=e=>{l(!0),d(null),ae(e).then(e=>{o(e.current),i(!1)}).catch(e=>{d(e instanceof Error?e.message:n.logLevelSaveError)}).finally(()=>l(!1))},t[4]=n.logLevelSaveError,t[5]=m);let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(E,{className:`size-4`,strokeWidth:1.75}),t[6]=g):g=t[6];let _;t[7]===n.logLevelTitle?_=t[8]:(_=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:n.logLevelTitle}),t[7]=n.logLevelTitle,t[8]=_);let v;t[9]===a?v=t[10]:(v=(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:a}),t[9]=a,t[10]=v);let y;t[11]!==n.logLevelTitle||t[12]!==_||t[13]!==v?(y=(0,$.jsx)(D,{asChild:!0,children:(0,$.jsxs)(A,{type:`button`,variant:`secondary`,className:`h-9 gap-2 whitespace-nowrap px-3 text-xs`,title:n.logLevelTitle,children:[g,_,v]})}),t[11]=n.logLevelTitle,t[12]=_,t[13]=v,t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=c(`w-56 rounded-xl border border-edge bg-surface-overlay p-3 shadow-popover outline-none`,z,`dark:border-edge`),t[15]=b):b=t[15];let x;t[16]===n.logLevelTitle?x=t[17]:(x=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.logLevelTitle}),t[16]=n.logLevelTitle,t[17]=x);let S;t[18]===n.logLevelHint?S=t[19]:(S=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.logLevelHint}),t[18]=n.logLevelHint,t[19]=S);let C;t[20]!==n.levelNames||t[21]!==h||t[22]!==a||t[23]!==s?(C=ue.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>h(e),className:c(`flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-xs transition-colors`,a===e?`bg-accent/10 font-medium text-accent`:`text-fg hover:bg-surface-hover`),children:[(0,$.jsx)(`span`,{children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`font-mono text-[10px] uppercase text-fg-subtle`,children:e})]})},e)),t[20]=n.levelNames,t[21]=h,t[22]=a,t[23]=s,t[24]=C):C=t[24];let w;t[25]===C?w=t[26]:(w=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1`,children:C}),t[25]=C,t[26]=w);let T;t[27]===u?T=t[28]:(T=u?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-red-600 dark:text-red-400`,children:u}):null,t[27]=u,t[28]=T);let k;t[29]!==S||t[30]!==w||t[31]!==T||t[32]!==x?(k=(0,$.jsx)(I,{children:(0,$.jsxs)(G,{side:`bottom`,align:`end`,sideOffset:6,className:b,children:[x,S,w,T]})}),t[29]=S,t[30]=w,t[31]=T,t[32]=x,t[33]=k):k=t[33];let j;return t[34]!==r||t[35]!==k||t[36]!==y?(j=(0,$.jsxs)(O,{open:r,onOpenChange:i,children:[y,k]}),t[34]=r,t[35]=k,t[36]=y,t[37]=j):j=t[37],j}function st(e){let t=(0,J.c)(49),{L:n,autoRefresh:r,onAutoRefreshChange:i,fileCount:a,onOpenFiles:o,loading:s,onRefreshAll:c,logs:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,$.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-lg`,children:n.title}),t[0]=n.title,t[1]=u);let d;t[2]===n.subtitle?d=t[3]:(d=(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-fg-muted sm:mt-1`,children:n.subtitle}),t[2]=n.subtitle,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=r?`live`:`paused`,m;t[7]===i?m=t[8]:(m=e=>i(e===`live`),t[7]=i,t[8]=m);let h;t[9]===n.refreshManual?h=t[10]:(h={value:`paused`,label:n.refreshManual},t[9]=n.refreshManual,t[10]=h);let g;t[11]===n.refreshLive?g=t[12]:(g={value:`live`,label:n.refreshLive},t[11]=n.refreshLive,t[12]=g);let _;t[13]!==h||t[14]!==g?(_=[h,g],t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==n.refreshModeAria||t[17]!==p||t[18]!==m||t[19]!==_?(v=(0,$.jsx)(`div`,{className:`w-full sm:w-52`,children:(0,$.jsx)(Ye,{"aria-label":n.refreshModeAria,value:p,onChange:m,options:_,buttonClassName:`h-8`})}),t[16]=n.refreshModeAria,t[17]=p,t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]===n?y=t[22]:(y=(0,$.jsx)(ot,{L:n}),t[21]=n,t[22]=y);let b;t[23]!==n||t[24]!==s||t[25]!==l?(b=(0,$.jsx)(at,{L:n,logs:l,disabled:s}),t[23]=n,t[24]=s,t[25]=l,t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(N,{className:`size-4`,strokeWidth:1.75}),t[27]=x):x=t[27];let S;t[28]===a?S=t[29]:(S=a>0?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-1.5 text-xs text-fg-muted`,children:a}):null,t[28]=a,t[29]=S);let C;t[30]!==n.logFiles||t[31]!==o||t[32]!==S?(C=(0,$.jsxs)(A,{type:`button`,variant:`ghost`,className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,title:n.logFiles,"aria-label":n.logFiles,onClick:o,children:[x,S]}),t[30]=n.logFiles,t[31]=o,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==n.refresh||t[35]!==s||t[36]!==c?(w=(0,$.jsx)(L,{className:`h-9 min-h-[44px] min-w-[44px] px-2 sm:min-h-9 sm:min-w-0`,loading:s,label:n.refresh,onClick:c}),t[34]=n.refresh,t[35]=s,t[36]=c,t[37]=w):w=t[37];let T;t[38]!==y||t[39]!==b||t[40]!==C||t[41]!==w?(T=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-1 sm:self-center`,children:[y,b,C,w]}),t[38]=y,t[39]=b,t[40]=C,t[41]=w,t[42]=T):T=t[42];let E;t[43]!==T||t[44]!==v?(E=(0,$.jsxs)(`div`,{className:`flex w-full shrink-0 flex-col gap-2 rounded-xl bg-surface-hover/20 p-2 sm:flex-row sm:items-center sm:justify-between`,children:[v,T]}),t[43]=T,t[44]=v,t[45]=E):E=t[45];let D;return t[46]!==E||t[47]!==f?(D=(0,$.jsxs)(`header`,{className:`flex flex-col gap-4`,children:[f,E]}),t[46]=E,t[47]=f,t[48]=D):D=t[48],D}function ct(e){let t=(0,J.c)(33),{L:n,stats:r}=e,i;t[0]===r.byLevel?i=t[1]:(i=r.byLevel??{},t[0]=r.byLevel,t[1]=i);let a;t[2]!==n.levelNames||t[3]!==i?(a=Fe(i,n.levelNames),t[2]=n.levelNames,t[3]=i,t[4]=a):a=t[4];let o=a,s=r.runtime?.errorsLast24h;if(!o&&s==null)return null;let l;t[5]===n.statsRegion?l=t[6]:(l=(0,$.jsx)(`span`,{className:`font-medium text-fg-muted`,children:n.statsRegion}),t[5]=n.statsRegion,t[6]=l);let u;t[7]===o?u=t[8]:(u=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsx)(`span`,{className:`tabular-nums`,children:o})]}):null,t[7]=o,t[8]=u);let d;t[9]!==n.runtimeErrors||t[10]!==s?(d=s!=null&&s>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mx-1.5 text-fg-subtle`,children:`·`}),(0,$.jsxs)(`span`,{className:`tabular-nums text-red-600 dark:text-red-400`,children:[n.runtimeErrors,` `,s]})]}):null,t[9]=n.runtimeErrors,t[10]=s,t[11]=d):d=t[11];let f;t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,$.jsx)(D,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:`max-w-full truncate rounded-lg border border-transparent px-1 py-0.5 text-left text-xs leading-5 text-fg-subtle transition-colors duration-150 ease-out hover:border-edge-subtle hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel dark:hover:border-edge`,children:[l,u,d]})}),t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15];let p;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(p=c(`w-[min(calc(100vw-2rem),20rem)] rounded-xl border border-edge bg-surface-overlay p-3 shadow-popover outline-none`,z,`dark:border-edge`),t[16]=p):p=t[16];let m;t[17]===n.statsDetailTitle?m=t[18]:(m=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:n.statsDetailTitle}),t[17]=n.statsDetailTitle,t[18]=m);let h;t[19]===n.statsHint?h=t[20]:(h=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.statsHint}),t[19]=n.statsHint,t[20]=h);let g;t[21]!==n.levelNames||t[22]!==r.byLevel?(g=ue.map(e=>{let t=r.byLevel?.[e]??0;return t===0?null:(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-edge-subtle bg-surface-base px-2 py-1 text-xs dark:border-edge`,children:[(0,$.jsx)(`span`,{className:`font-medium capitalize text-fg`,children:n.levelNames[e]}),(0,$.jsx)(`span`,{className:`tabular-nums text-fg-muted`,children:t})]},e)}),t[21]=n.levelNames,t[22]=r.byLevel,t[23]=g):g=t[23];let _;t[24]===g?_=t[25]:(_=(0,$.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1.5`,children:g}),t[24]=g,t[25]=_);let v;t[26]!==_||t[27]!==m||t[28]!==h?(v=(0,$.jsx)(I,{children:(0,$.jsxs)(G,{side:`bottom`,align:`start`,sideOffset:6,className:p,children:[m,h,_]})}),t[26]=_,t[27]=m,t[28]=h,t[29]=v):v=t[29];let y;return t[30]!==v||t[31]!==f?(y=(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsxs)(O,{children:[f,v]})}),t[30]=v,t[31]=f,t[32]=y):y=t[32],y}function lt(){let e=(0,J.c)(89),{L:t,hasToken:n,logs:r,loading:i,error:a,hasMore:o,searchInput:s,setSearchInput:c,selectedLevels:l,moduleFilter:u,setModuleFilter:f,dateFrom:p,setDateFrom:m,dateTo:h,setDateTo:g,modules:_,files:v,stats:y,selectedLog:b,setSelectedLog:x,filesOpen:S,setFilesOpen:C,filtersOpen:w,setFiltersOpen:T,logDir:E,autoRefresh:D,setAutoRefresh:O,copiedDetail:k,setCopiedDetail:A,hasActiveFilters:j,activeFilterCount:M,clearFilters:N,toggleDialogLevel:P,handleLoadMore:F,refreshAll:I,levelSegment:L,handleLevelSegment:R,filterByRequestId:z,filterByTranscriptId:B,filterByErrorSummary:V,openChatForSession:ee,errorSummary:H,errorSummaryLoading:U}=ze(d(ut));if(!n){let n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(et,{L:t}),e[0]=t,e[1]=n),n}let W;e[2]===C?W=e[3]:(W=()=>C(!0),e[2]=C,e[3]=W);let G;e[4]!==t||e[5]!==D||e[6]!==v.length||e[7]!==i||e[8]!==r||e[9]!==I||e[10]!==O||e[11]!==W?(G=(0,$.jsx)(st,{L:t,autoRefresh:D,onAutoRefreshChange:O,fileCount:v.length,onOpenFiles:W,loading:i,onRefreshAll:I,logs:r}),e[4]=t,e[5]=D,e[6]=v.length,e[7]=i,e[8]=r,e[9]=I,e[10]=O,e[11]=W,e[12]=G):G=e[12];let K;e[13]===a?K=e[14]:(K=a?(0,$.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:a}):null,e[13]=a,e[14]=K);let q;e[15]!==t||e[16]!==y?(q=y?(0,$.jsx)(ct,{L:t,stats:y}):null,e[15]=t,e[16]=y,e[17]=q):q=e[17];let Y;e[18]!==t||e[19]!==H||e[20]!==U||e[21]!==V?(Y=(0,$.jsx)(Be,{L:t,items:H,loading:U,onSelectItem:V}),e[18]=t,e[19]=H,e[20]=U,e[21]=V,e[22]=Y):Y=e[22];let X;e[23]===T?X=e[24]:(X=()=>T(!0),e[23]=T,e[24]=X);let Z;e[25]!==t||e[26]!==M||e[27]!==D||e[28]!==N||e[29]!==R||e[30]!==j||e[31]!==L||e[32]!==u||e[33]!==_||e[34]!==s||e[35]!==f||e[36]!==c||e[37]!==X?(Z=(0,$.jsx)(Xe,{L:t,levelSegment:L,onLevelSegment:R,searchInput:s,onSearchInputChange:c,moduleFilter:u,onModuleFilterChange:f,modules:_,onOpenFilters:X,activeFilterCount:M,hasActiveFilters:j,onClearFilters:N,autoRefresh:D}),e[25]=t,e[26]=M,e[27]=D,e[28]=N,e[29]=R,e[30]=j,e[31]=L,e[32]=u,e[33]=_,e[34]=s,e[35]=f,e[36]=c,e[37]=X,e[38]=Z):Z=e[38];let Q;e[39]!==t||e[40]!==z||e[41]!==F||e[42]!==o||e[43]!==i||e[44]!==r||e[45]!==I||e[46]!==x?(Q=(0,$.jsx)(Qe,{L:t,logs:r,loading:i,hasMore:o,onSelectLog:x,onLoadMore:F,onRefreshAll:I,onFilterByRequestId:z}),e[39]=t,e[40]=z,e[41]=F,e[42]=o,e[43]=i,e[44]=r,e[45]=I,e[46]=x,e[47]=Q):Q=e[47];let ne;e[48]!==t||e[49]!==p||e[50]!==h||e[51]!==w||e[52]!==l||e[53]!==m||e[54]!==g||e[55]!==T||e[56]!==P?(ne=(0,$.jsx)(qe,{L:t,open:w,onOpenChange:T,dateFrom:p,onDateFromChange:m,dateTo:h,onDateToChange:g,selectedLevels:l,onToggleLevel:P}),e[48]=t,e[49]=p,e[50]=h,e[51]=w,e[52]=l,e[53]=m,e[54]=g,e[55]=T,e[56]=P,e[57]=ne):ne=e[57];let re;e[58]===x?re=e[59]:(re=()=>x(null),e[58]=x,e[59]=re);let ie,ae;e[60]===A?(ie=e[61],ae=e[62]):(ie=()=>A(`message`),ae=()=>A(`json`),e[60]=A,e[61]=ie,e[62]=ae);let oe;e[63]!==t||e[64]!==k||e[65]!==z||e[66]!==B||e[67]!==ee||e[68]!==b||e[69]!==ie||e[70]!==ae||e[71]!==re?(oe=(0,$.jsx)(We,{L:t,log:b,onClose:re,copiedDetail:k,onCopiedMessage:ie,onCopiedJson:ae,onFilterByRequestId:z,onFilterByTranscriptId:B,onOpenChat:ee}),e[63]=t,e[64]=k,e[65]=z,e[66]=B,e[67]=ee,e[68]=b,e[69]=ie,e[70]=ae,e[71]=re,e[72]=oe):oe=e[72];let se;e[73]!==t||e[74]!==v||e[75]!==S||e[76]!==E||e[77]!==C?(se=(0,$.jsx)(Ge,{L:t,open:S,onOpenChange:C,files:v,logDir:E}),e[73]=t,e[74]=v,e[75]=S,e[76]=E,e[77]=C,e[78]=se):se=e[78];let ce;return e[79]!==G||e[80]!==oe||e[81]!==se||e[82]!==K||e[83]!==q||e[84]!==Y||e[85]!==Z||e[86]!==Q||e[87]!==ne?(ce=(0,$.jsxs)(te,{gap:`gap-6`,children:[G,K,q,Y,Z,Q,ne,oe,se]}),e[79]=G,e[80]=oe,e[81]=se,e[82]=K,e[83]=q,e[84]=Y,e[85]=Z,e[86]=Q,e[87]=ne,e[88]=ce):ce=e[88],ce}function ut(e){return e.language}export{lt as LogsPage};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as a}from"./plus-Q2yW6OE7.js";import{t as o}from"./x-B_N4OPjy.js";import{t as s}from"./messages-Bwv-AOYl.js";import{t as c}from"./cn-0WouolD0.js";import{i as l,n as u,r as d}from"./locale-store-D5h-Ha6-.js";import{a as f,n as p,o as m,r as h,s as g,t as _}from"./dist-BGTk37IG.js";import{s as v}from"./session-api-fVuszA_P.js";import{i as y}from"./vendor-swr-BIWyz7Rc.js";import{Kc as b,Lu as x,On as S,Pf as C,Ql as w,Rc as T,Xa as E,Yl as ee,Za as D,au as O,df as k,ff as A,fo as j,is as M,ld as N,us as P,vs as te,ys as ne}from"./index-K2cy4f-3.js";import{n as F,r as I,t as L}from"./settings-page-layout-Dx5S-Msc.js";import{t as R}from"./device-pairing-wizard-D3IUZ8xW.js";var z=n(),B=e(t(),1),V=r();async function H(e=`GET`,t,n){let r=await l(d(`/api/endpoint-tools/target-authorizations`+(n?`/`+encodeURIComponent(n):``)),{method:e,...t?{body:JSON.stringify(t)}:{}});if(!r.ok)throw Error(r.status===403?`owner`:`unavailable`);return(await r.json()).payload}function re({devices:e,zh:t}){let n=y(`device-single-call-grants`,()=>H(),{refreshInterval:5e3,shouldRetryOnError:!1}),r=y(n.error?null:`device-grant-conversations`,()=>v({limit:100}),{shouldRetryOnError:!1}),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(`weather`),[f,p]=(0,B.useState)(`approximate`),[m,h]=(0,B.useState)(`restaurant`),[g,_]=(0,B.useState)(!1),[x,S]=(0,B.useState)(!1);if(n.error)return null;let C=e.flatMap(e=>e.endpoints.map(t=>({...t,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))),w=C.find(e=>e.endpointId===c)?.tools.find(e=>e.descriptor.name.endsWith(`.device.get_location`))?.descriptor.name,E=async()=>{if(!(!w||!i||!o)){_(!0),S(!1);try{await H(`POST`,{conversationId:i,requestorPrincipalId:o,targetEndpointId:c,toolName:w,arguments:{purpose:u,precision:f,...u===`nearby`?{category:m}:{}}}),await n.mutate()}catch{S(!0)}finally{_(!1)}}};return(0,V.jsxs)(`section`,{className:`mb-5 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,V.jsx)(`h3`,{className:`font-semibold text-fg`,children:t?`跨设备单次授权`:`Single-call device authorization`}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t?`为指定会话和来源设备授权一次定位查询,60 秒后失效。目标设备仍需确认;授权后请在来源设备继续请求。`:`Authorize one location query for a conversation and source device. Expires in 60 seconds; target-device consent is still required. Continue the request from the source device.`}),n.isLoading||r.isLoading?(0,V.jsx)(T,{className:`mt-3 h-28`}):(0,V.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,V.jsx)(P,{value:i,onChange:a,placeholder:t?`选择会话`:`Conversation`,ariaLabel:t?`会话`:`Conversation`,options:(r.data?.items??[]).map(e=>({value:e.key,label:e.name||e.key}))}),(0,V.jsx)(P,{value:o,onChange:s,placeholder:t?`消息来源设备`:`Source device`,ariaLabel:t?`消息来源设备`:`Source device`,options:e.filter(e=>e.endpoints.length>0).map(e=>({value:e.id,label:e.displayName+` · `+e.platform+` · `+e.id.slice(-8)}))}),(0,V.jsx)(P,{value:c,onChange:l,placeholder:t?`使用哪台设备的位置`:`Location device`,ariaLabel:t?`目标设备`:`Target device`,options:C.filter(e=>e.tools.some(e=>e.descriptor.name.endsWith(`.device.get_location`))).map(e=>({value:e.endpointId,label:e.label}))}),(0,V.jsx)(P,{placeholder:t?`用途`:`Purpose`,value:u,onChange:e=>d(e),ariaLabel:t?`用途`:`Purpose`,options:[{value:`weather`,label:t?`查询天气`:`Weather`},{value:`nearby`,label:t?`附近地点`:`Nearby places`}],allowEmpty:!1}),(0,V.jsx)(P,{placeholder:t?`精度`:`Precision`,value:f,onChange:e=>p(e),ariaLabel:t?`精度`:`Precision`,options:[{value:`approximate`,label:t?`大致位置`:`Approximate`},{value:`precise`,label:t?`精确位置`:`Precise`}],allowEmpty:!1}),u===`nearby`?(0,V.jsx)(P,{placeholder:t?`地点类型`:`Category`,value:m,onChange:h,ariaLabel:t?`附近地点类型`:`Place category`,options:[`restaurant`,`cafe`,`pharmacy`,`park`].map((e,n)=>({value:e,label:t?[`餐厅`,`咖啡馆`,`药店`,`公园`][n]:e})),allowEmpty:!1}):null,(0,V.jsx)(b,{variant:`primary`,disabled:g||!i||!o||!w,onClick:()=>void E(),children:t?`允许一次`:`Allow once`})]}),x?(0,V.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-fg-muted`,children:t?`授权失败,请检查设备连接后重试。`:`Authorization failed. Check the device connection.`}):null,(0,V.jsx)(`div`,{className:`mt-3 space-y-2`,children:n.data?.map(r=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm text-fg-muted`,children:[(0,V.jsxs)(`span`,{children:[e.find(e=>e.endpoints.some(e=>e.endpointId===r.targetEndpointId))?.displayName??(t?`设备`:`Device`),` · `,r.state===`running`?t?`执行中`:`Running`:t?`等待本次调用`:`Awaiting one call`]}),(0,V.jsx)(b,{disabled:g,onClick:()=>{_(!0),H(`DELETE`,void 0,r.id).then(()=>n.mutate()).catch(()=>S(!0)).finally(()=>_(!1))},children:t?`撤销`:`Revoke`})]},r.id))})]})}var U=720*60*60*1e3;function ie(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function W(e){return ie(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function ae(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function oe(e,t=Date.now()){return W(e)===`offline`?(e.lastSeenAt??e.createdAt)<t-U:!1}function se(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=W(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?oe(e,n):i===t.status),o=!t.platform||e.platform===t.platform,s=!r||[e.displayName,e.id,e.kind,e.platform].some(e=>e.toLocaleLowerCase().includes(r));return a&&o&&s})}function ce(e){return e.length>8?e.slice(-8):e}function le(e){let t=(0,z.c)(61),{device:n,busy:r,onClose:i,onRevoke:a,onRename:l}=e,d=u(ue),v;t[0]===d?v=t[1]:(v=s(d),t[0]=d,t[1]=v);let y=v.endpointToolsSettings,x=d===`zh`?`zh-CN`:`en`,S;t[2]===x?S=t[3]:(S=new Intl.DateTimeFormat(x,{dateStyle:`medium`,timeStyle:`short`}),t[2]=x,t[3]=S);let C=S,T;t[4]===n?T=t[5]:(T=n?W(n):`offline`,t[4]=n,t[5]=T);let E=T,ee=n!==null,D;t[6]===i?D=t[7]:(D=e=>!e&&i(),t[6]=i,t[7]=D);let O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,V.jsx)(f,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim`,ne)}),t[8]=O):O=t[8];let k;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=c(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,te),t[9]=k):k=t[9];let A=n?.displayName??y.deviceDetails,j;t[10]===A?j=t[11]:(j=(0,V.jsx)(g,{className:`truncate text-base font-semibold text-fg`,children:A}),t[10]=A,t[11]=j);let M;t[12]===n?M=t[13]:(M=n?(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,ce(n.id)]}):null,t[12]=n,t[13]=M);let N;t[14]!==j||t[15]!==M?(N=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[j,M]}),t[14]=j,t[15]=M,t[16]=N):N=t[16];let P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,V.jsx)(o,{className:`size-5`,"aria-hidden":!0}),t[17]=P):P=t[17];let F;t[18]===y.close?F=t[19]:(F=(0,V.jsx)(p,{asChild:!0,children:(0,V.jsx)(b,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":y.close,children:P})}),t[18]=y.close,t[19]=F);let I;t[20]!==N||t[21]!==F?(I=(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[N,F]}),t[20]=N,t[21]=F,t[22]=I):I=t[22];let L;t[23]!==y.accessActive||t[24]!==y.accessRevoked||t[25]!==y.accessTitle||t[26]!==y.createdAt||t[27]!==y.endpointCount||t[28]!==y.endpointsTitle||t[29]!==y.identityId||t[30]!==y.identityTitle||t[31]!==y.lastSeen||t[32]!==y.never||t[33]!==y.noAccessIdentity||t[34]!==y.noOnlineEndpoints||t[35]!==y.noPermissions||t[36]!==y.permissions||t[37]!==y.status||t[38]!==y.statusLabel||t[39]!==y.toolCount||t[40]!==n||t[41]!==C||t[42]!==d||t[43]!==l||t[44]!==E?(L=n?(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[n.principal&&E!==`revoked`&&l?(0,V.jsx)(de,{device:n,zh:d===`zh`,onRename:l},`${n.id}:${n.settingsRevision??0}`):null,(0,V.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,V.jsx)(G,{label:y.statusLabel,value:y.status[E]}),(0,V.jsx)(G,{label:y.lastSeen,value:n.lastSeenAt?C.format(n.lastSeenAt):y.never}),(0,V.jsx)(G,{label:y.endpointCount,value:String(n.endpoints.length)}),(0,V.jsx)(G,{label:y.toolCount,value:String(ae(n))})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:y.accessTitle}),(0,V.jsx)(`div`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs text-fg-muted`,children:n.access?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{children:n.access.revokedAt?y.accessRevoked:y.accessActive}),(0,V.jsx)(`p`,{className:`mt-1`,children:n.access.requestProofVersion===1?d===`zh`?`设备请求签名已启用`:`Device request signing enabled`:d===`zh`?`旧版兼容:尚未启用请求签名`:`Legacy compatibility: request signing not enabled`}),(0,V.jsxs)(`p`,{className:`mt-1 break-words`,children:[y.permissions,`: `,n.access.scopes.join(`, `)||y.noPermissions]})]}):(0,V.jsx)(`p`,{children:y.noAccessIdentity})})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:y.endpointsTitle}),(0,V.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,V.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,V.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,V.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,V.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[y.status[e.availability],` · v`,e.appVersion]})]}),(0,V.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,V.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,V.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.title}),(0,V.jsxs)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:[t.requiresForeground?d===`zh`?`需要设备在前台 · `:`Requires foreground · `:``,t.confirmation===`always`?d===`zh`?`每次确认`:`Confirm each time`:d===`zh`?`按已授权范围调用`:`Uses the authorized scope`]})]},t.name)})})]},e.connectionId))]})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:y.identityTitle}),n.principal&&E!==`revoked`&&l?(0,V.jsx)(de,{device:n,zh:d===`zh`,onRename:l},`${n.id}:${n.settingsRevision??0}`):null,(0,V.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,V.jsx)(G,{label:y.identityId,value:n.id,breakAll:!0}),(0,V.jsx)(`div`,{className:`mt-3`,children:(0,V.jsx)(G,{label:y.createdAt,value:C.format(n.createdAt)})})]})]})]}):null,t[23]=y.accessActive,t[24]=y.accessRevoked,t[25]=y.accessTitle,t[26]=y.createdAt,t[27]=y.endpointCount,t[28]=y.endpointsTitle,t[29]=y.identityId,t[30]=y.identityTitle,t[31]=y.lastSeen,t[32]=y.never,t[33]=y.noAccessIdentity,t[34]=y.noOnlineEndpoints,t[35]=y.noPermissions,t[36]=y.permissions,t[37]=y.status,t[38]=y.statusLabel,t[39]=y.toolCount,t[40]=n,t[41]=C,t[42]=d,t[43]=l,t[44]=E,t[45]=L):L=t[45];let R;t[46]!==r||t[47]!==y.removeDevice||t[48]!==y.revoking||t[49]!==n||t[50]!==a||t[51]!==E?(R=n&&E!==`revoked`?(0,V.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,V.jsxs)(b,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,V.jsx)(w,{className:`size-4`,"aria-hidden":!0}),r?y.revoking:y.removeDevice]})}):null,t[46]=r,t[47]=y.removeDevice,t[48]=y.revoking,t[49]=n,t[50]=a,t[51]=E,t[52]=R):R=t[52];let B;t[53]!==I||t[54]!==L||t[55]!==R?(B=(0,V.jsxs)(m,{children:[O,(0,V.jsxs)(h,{className:k,"aria-describedby":void 0,children:[I,L,R]})]}),t[53]=I,t[54]=L,t[55]=R,t[56]=B):B=t[56];let H;return t[57]!==B||t[58]!==ee||t[59]!==D?(H=(0,V.jsx)(_,{open:ee,onOpenChange:D,children:B}),t[57]=B,t[58]=ee,t[59]=D,t[60]=H):H=t[60],H}function ue(e){return e.language}function G(e){let t=(0,z.c)(10),{label:n,value:r,breakAll:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,V.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s=a&&`break-all font-mono text-xs`,l;t[2]===s?l=t[3]:(l=c(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=l);let u;t[4]!==l||t[5]!==r?(u=(0,V.jsx)(`dd`,{className:l,children:r}),t[4]=l,t[5]=r,t[6]=u):u=t[6];let d;return t[7]!==o||t[8]!==u?(d=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[o,u]}),t[7]=o,t[8]=u,t[9]=d):d=t[9],d}function de({device:e,zh:t,onRename:n}){let[r,i]=(0,B.useState)(e.displayName),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(!1);return(0,V.jsxs)(`form`,{className:`space-y-2`,onSubmit:async t=>{if(t.preventDefault(),!(a||!r.trim())){o(!0),c(!1);try{await n(e,r.trim())}catch{c(!0)}finally{o(!1)}}},children:[(0,V.jsxs)(`label`,{className:`block text-sm text-fg`,children:[t?`设备名称`:`Device name`,(0,V.jsx)(`input`,{value:r,maxLength:80,onChange:e=>i(e.target.value),className:`mt-2 h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-fg`})]}),(0,V.jsx)(b,{type:`submit`,variant:`secondary`,disabled:a||!r.trim()||r.trim()===e.displayName,children:a?t?`保存中…`:`Saving…`:t?`保存名称`:`Save name`}),s?(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:t?`保存失败,请刷新设备信息后重试。`:`Unable to save. Refresh device information and retry.`}):null]})}function fe(e){let t=(0,z.c)(19),{onPaired:n}=e,[r,o]=i(),c=u(me),l;t[0]===c?l=t[1]:(l=s(c),t[0]=c,t[1]=l);let d=l.endpointToolsSettings.deviceAccess,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f={open:!1},t[2]=f):f=t[2];let[p,m]=(0,B.useState)(f),h,g;t[3]!==r||t[4]!==o?(h=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(m({open:!0,target:e}),o(pe,{replace:!0}))},g=[r,o],t[3]=r,t[4]=o,t[5]=h,t[6]=g):(h=t[5],g=t[6]),(0,B.useEffect)(h,g);let _,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>m({open:!0}),v=(0,V.jsx)(a,{className:`size-4`,"aria-hidden":!0}),t[7]=_,t[8]=v):(_=t[7],v=t[8]);let y;t[9]===d.addDevice?y=t[10]:(y=(0,V.jsxs)(b,{variant:`primary`,onClick:_,children:[v,d.addDevice]}),t[9]=d.addDevice,t[10]=y);let x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>m(t=>({...t,open:e})),t[11]=x):x=t[11];let S;t[12]!==p.open||t[13]!==p.target||t[14]!==n?(S=(0,V.jsx)(R,{open:p.open,onOpenChange:x,onPaired:n,targetKind:p.target}),t[12]=p.open,t[13]=p.target,t[14]=n,t[15]=S):S=t[15];let C;return t[16]!==y||t[17]!==S?(C=(0,V.jsxs)(V.Fragment,{children:[y,S]}),t[16]=y,t[17]=S,t[18]=C):C=t[18],C}function pe(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function me(e){return e.language}async function K(e){let t=await e.json().catch(()=>null);if(!e.ok||t?.payload===void 0)throw Error(t?.error?.message??`Endpoint management request failed: ${e.status}`);return t.payload}function he(){return d(`/api/endpoint-tools/devices`)}function ge(e){let t=new URLSearchParams({page:String(e.page),pageSize:String(e.pageSize)});return e.query.trim()&&t.set(`query`,e.query.trim()),e.principalId&&t.set(`principalId`,e.principalId),e.status&&t.set(`status`,e.status),e.effect&&t.set(`effect`,e.effect),d(`/api/endpoint-tools/invocations?${t}`)}async function _e(){return K(await l(he()))}async function ve(e){let t=Array.from({length:Math.ceil(e.length/100)},(t,n)=>e.slice(n*100,(n+1)*100));await Promise.all(t.map(async e=>{await K(await l(d(`/api/endpoint-tools/devices/revoke`),{method:`POST`,body:JSON.stringify({ids:e})}))}))}async function ye(e){return K(await l(ge(e)))}async function be(e,t,n){await K(await l(d(`/api/endpoint-tools/devices/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({nickname:t,expectedRevision:n})}))}var xe=5e3,q=20,Se=20;function Ce(e){return e===`online`||e===`succeeded`?`bg-success-soft text-success`:e===`running`?`bg-accent-soft text-accent-fg`:e===`failed`||e===`revoked`?`bg-danger-soft text-danger`:`bg-surface-hover text-fg-muted`}function we(e){let t=(0,z.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=c(`rounded-full px-2 py-0.5 text-xs font-medium`,Ce(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,V.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function Te(){let e=u(e=>e.language),t=s(e).endpointToolsSettings,[n,r]=i(),a=n.get(`view`)===`activity`?`activity`:`devices`,[o,l]=(0,B.useState)(null),[d,f]=(0,B.useState)([]),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(``),[T,te]=(0,B.useState)(`active`),[ne,R]=(0,B.useState)(``),[z,H]=(0,B.useState)(1),[U,ie]=(0,B.useState)(()=>new Set),[ue,G]=(0,B.useState)(``),[de]=j(ue,250),[pe,me]=(0,B.useState)(``),[K,Ce]=(0,B.useState)(``),[Te,Ee]=(0,B.useState)(``),[De,J]=(0,B.useState)(1),Oe={page:De,pageSize:Se,query:de,principalId:pe,status:K,effect:Te},Y=y(he(),_e,{refreshInterval:xe}),X=y(a===`activity`?ge(Oe):null,()=>ye(Oe),{refreshInterval:xe,keepPreviousData:!0}),ke=(0,B.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(Y.isLoading&&!Y.data)return(0,V.jsx)(I,{children:(0,V.jsx)(S,{sections:2})});let Z=Y.data??[],Ae=X.data?.items??[],je=Z.filter(e=>W(e)===`online`).length,Me=Z.filter(e=>W(e)!==`revoked`).length,Ne=Z.filter(e=>oe(e)).length,Pe=[...new Set(Z.map(e=>e.platform))].toSorted(),Q=se(Z,{query:_,status:T,platform:ne}),Fe=Math.max(1,Math.ceil(Q.length/q)),$=Math.min(z,Fe),Ie=Q.slice(($-1)*q,$*q),Le=Ie.reduce((e,t)=>(W(t)!==`revoked`&&e.push(t.id),e),[]),Re=Le.length>0&&Le.every(e=>U.has(e)),ze=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Be=async()=>{await Promise.all([Y.mutate(),a===`activity`?X.mutate():Promise.resolve()])},Ve=async()=>{if(!(d.length===0||p)){m(!0),g(!1);try{await ve(d.map(e=>e.id)),f([]),ie(new Set),await Y.mutate()}catch{g(!0)}finally{m(!1)}}},He=e=>{e(),H(1),ie(new Set)};return(0,V.jsxs)(I,{children:[(0,V.jsx)(F,{title:t.title,subtitle:t.subtitle,actions:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(E,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Be}),(0,V.jsx)(fe,{onPaired:()=>void Y.mutate()})]})}),Y.error||X.error?(0,V.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:Me,filter:`active`},{label:t.onlineDevices,value:je,filter:`online`},{label:t.staleDevices,value:Ne,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,V.jsxs)(`button`,{type:`button`,className:c(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,T===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":T===n,onClick:()=>{He(()=>te(n)),ze(`devices`)},children:[(0,V.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,V.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,V.jsx)(M,{items:[{id:`devices`,label:t.devicesTab,icon:x,count:Me},{id:`activity`,label:t.activityTab,icon:C,count:X.data?.total}],activeTab:a,onChange:ze,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,V.jsxs)(L,{id:`devices`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,V.jsx)(re,{devices:Z,zh:e===`zh`}),(0,V.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,V.jsxs)(`label`,{className:`relative block`,children:[(0,V.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,V.jsx)(O,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,V.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:_,placeholder:t.searchDevices,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>He(()=>v(e.target.value))})]}),(0,V.jsx)(P,{value:T,options:[{value:`active`,label:t.filterActive},{value:`online`,label:t.status.online},{value:`offline`,label:t.status.offline},{value:`stale`,label:t.filterStale},{value:`revoked`,label:t.status.revoked},{value:`all`,label:t.filterAll}],placeholder:t.statusLabel,allowEmpty:!1,ariaLabel:t.statusLabel,onChange:e=>He(()=>te(e))}),(0,V.jsx)(P,{value:ne,options:Pe.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>He(()=>R(e))})]}),U.size>0?(0,V.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-3 py-2`,children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(U.size))}),(0,V.jsxs)(b,{variant:`secondary`,className:`text-danger`,onClick:()=>{g(!1),f(Z.filter(e=>U.has(e.id)))},children:[(0,V.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,Z.length===0?(0,V.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Q.length===0?(0,V.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,V.jsxs)(`label`,{className:c(`touch-target flex items-center gap-2 text-xs text-fg-muted`,Le.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:Re,disabled:Le.length===0,className:`size-4 accent-accent`,onChange:e=>{ie(t=>{let n=new Set(t);for(let t of Le)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,V.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Ie.map(e=>{let n=W(e),r=e.kind===`mobile`?ee:N;return(0,V.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`label`,{className:c(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,V.jsx)(`input`,{type:`checkbox`,checked:U.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{ie(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,V.jsxs)(`button`,{type:`button`,className:`touch-target flex min-w-0 flex-1 items-center gap-3 py-3 text-left hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>l(e),children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,V.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,V.jsx)(we,{status:n,label:t.status[n]})]}),(0,V.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,ce(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?ke.format(e.lastSeenAt):t.never]})]}),(0,V.jsx)(`span`,{className:`hidden shrink-0 text-right text-xs text-fg-muted sm:block`,children:t.endpointSummary.replace(`{{endpoints}}`,String(e.endpoints.length)).replace(`{{tools}}`,String(ae(e)))}),(0,V.jsx)(k,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,V.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String(($-1)*q+1)).replace(`{{to}}`,String(Math.min($*q,Q.length))).replace(`{{total}}`,String(Q.length))}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:$<=1,onClick:()=>H(e=>Math.max(1,e-1)),children:(0,V.jsx)(A,{className:`size-4`,"aria-hidden":!0})}),(0,V.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:$>=Fe,onClick:()=>H(e=>Math.min(Fe,e+1)),children:(0,V.jsx)(k,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,V.jsxs)(L,{id:`activity`,activeTab:a,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,V.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,V.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,V.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,V.jsx)(O,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,V.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:ue,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{G(e.target.value),J(1)}})]}),(0,V.jsx)(P,{value:pe,options:Z.map(e=>({value:e.id,label:`${e.displayName} · ${ce(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{me(e),J(1)}}),(0,V.jsx)(P,{value:K,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{Ce(e),J(1)}}),(0,V.jsx)(P,{value:Te,options:[{value:`read`,label:t.effects.read},{value:`write`,label:t.effects.write},{value:`destructive`,label:t.effects.destructive}],placeholder:t.allEffects,emptyLabel:t.allEffects,ariaLabel:t.effectLabel,onChange:e=>{Ee(e),J(1)}})]}),X.isLoading&&!X.data?(0,V.jsx)(S,{sections:1}):null,Ae.length===0&&!X.isLoading?(0,V.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,V.jsx)(`div`,{className:`space-y-2`,children:Ae.map(e=>(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[ke.format(e.startedAt),` · `,t.effects[e.effect],` · `,e.endpointId]}),e.errorMessage?(0,V.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,V.jsx)(we,{status:e.status,label:t.status[e.status]})]},e.id))}),X.data&&X.data.total>0?(0,V.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,V.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((X.data.page-1)*X.data.pageSize+1)).replace(`{{to}}`,String(Math.min(X.data.page*X.data.pageSize,X.data.total))).replace(`{{total}}`,String(X.data.total))}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:X.data.page<=1,onClick:()=>J(e=>Math.max(1,e-1)),children:(0,V.jsx)(A,{className:`size-4`,"aria-hidden":!0})}),(0,V.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:X.data.page>=X.data.totalPages,onClick:()=>J(e=>Math.min(X.data.totalPages,e+1)),children:(0,V.jsx)(k,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,V.jsx)(le,{device:o,busy:p,onRename:async(e,t)=>{await be(e.id,t,e.settingsRevision??0),l((await Y.mutate())?.find(t=>t.id===e.id)??null)},onClose:()=>l(null),onRevoke:e=>{l(null),g(!1),f([e])}}),(0,V.jsx)(D,{open:d.length>0,title:d.length>1?t.removeManyTitle:t.removeTitle,description:`${d.length>1?t.removeManyDescription.replace(`{{count}}`,String(d.length)):t.removeDescription.replace(`{{name}}`,d[0]?.displayName??``)}${h?`\n\n${t.revokeError}`:``}`,confirmLabel:p?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void Ve(),onCancel:()=>{p||f([])}})]})}export{Te as EndpointToolsManagementSettings};
@@ -1 +0,0 @@
1
- pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.markdown-render-boundary{isolation:isolate;contain:layout paint;overflow-wrap:anywhere;min-width:0}.markdown-body{letter-spacing:-.011em;color:inherit;font-size:.9375rem;line-height:1.5}.assistant-markdown-content .markdown-body,.chat-user-message .markdown-body{font-size:inherit;line-height:inherit}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{letter-spacing:-.022em;color:var(--color-fg);margin-top:1.35em;margin-bottom:.45em;font-weight:600;line-height:1.25}.markdown-body h1{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.5em}.markdown-body h2{border-bottom:1px solid var(--color-edge);padding-bottom:.3em;font-size:1.3em}.markdown-body h3{font-size:1.1em}.markdown-body ul,.markdown-body ol{margin-bottom:1em;padding-left:2em}.markdown-body li{margin-bottom:.35em}.markdown-body code{font-family:var(--font-mono);background:color-mix(in srgb, var(--color-fg) 8%, transparent);color:var(--color-fg-muted);border-radius:.4rem;padding:.15em .4em;font-size:.875em}.markdown-body pre{background:var(--color-surface-hover);border-radius:var(--radius-xl);border:1px solid var(--color-edge);margin-bottom:1em;padding:1em;overflow-x:auto}.markdown-code-block{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);margin:0 0 1em;overflow:visible}.markdown-code-block-header{z-index:3;border-bottom:1px solid var(--color-edge);border-radius:var(--radius-xl) var(--radius-xl) 0 0;background:var(--color-surface-active);justify-content:space-between;align-items:center;gap:.75rem;min-height:2.25rem;padding:.35rem .65rem .35rem .85rem;display:flex;position:sticky;top:0}.markdown-code-block-lang{min-width:0;font-family:var(--font-mono);letter-spacing:.02em;color:var(--color-fg-muted);text-transform:lowercase;-webkit-user-select:none;user-select:none;flex:auto;font-size:.75rem;font-weight:500;line-height:1.35}.markdown-code-copy-btn{border-radius:var(--radius-md);width:1.75rem;height:1.75rem;color:var(--color-fg-muted);cursor:pointer;opacity:0;pointer-events:none;background:0 0;border:none;flex:none;justify-content:center;align-items:center;margin:0;padding:0;font-size:.75rem;font-weight:500;line-height:1.25;transition:opacity .15s,color .15s,background-color .15s,transform .12s;display:inline-flex}.markdown-code-block:hover .markdown-code-copy-btn,.markdown-code-block:focus-within .markdown-code-copy-btn{opacity:1;pointer-events:auto}.markdown-code-copy-btn:hover{color:var(--color-fg);background:var(--color-surface-panel)}.markdown-code-copy-btn:active{transform:scale(.97)}.markdown-code-copy-btn:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.markdown-code-copy-inner{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.markdown-code-copy-btn svg{pointer-events:none;width:1rem;height:1rem}.markdown-body .markdown-code-block>pre{border-radius:0 0 var(--radius-xl) var(--radius-xl);background:var(--color-surface-hover);border:none;margin:0}html:not(.dark) .assistant-markdown-content .markdown-code-block,html:not(.dark) .assistant-markdown-content .markdown-body .markdown-code-block>pre{background:color-mix(in srgb, var(--color-fg) 4%, var(--color-surface-panel))}html:not(.dark) .assistant-markdown-content .markdown-code-block-header{background:color-mix(in srgb, var(--color-fg) 7%, var(--color-surface-panel))}html.dark .markdown-code-block{border-color:var(--color-edge);background:#0d1117}html.dark .markdown-code-block-header{border-bottom-color:var(--color-edge);background:#06080b}html.dark .markdown-code-block-lang{color:var(--color-fg-muted)}html.dark .markdown-body .markdown-code-block>pre{background:#0d1117}html.dark .markdown-code-copy-btn{color:var(--color-fg-subtle);background:0 0}html.dark .markdown-code-copy-btn:hover{color:var(--color-fg);background:#121820}.chat-messages .markdown-code-block-header{top:-1rem}.chat-messages.chat-messages--compact-welcome .markdown-code-block-header{top:-1.25rem}.markdown-body pre code{color:inherit;background:0 0;padding:0;font-size:.8125rem}.markdown-body blockquote{border-left:2px solid var(--color-edge-strong);color:var(--color-fg-muted);background:0 0;border-radius:0;margin:0 0 1em;padding:.1em 0 .1em 1em}.markdown-body a[href]{color:var(--color-accent-fg);text-decoration:none}.markdown-body a[href]:hover{text-decoration:underline}.markdown-body a[href]:focus-visible{outline:2px solid var(--color-accent);outline-offset:3px;border-radius:var(--radius-sm)}.markdown-body hr{background:var(--color-edge);border:none;height:1px;margin:1.5em 0}.markdown-body table{border-collapse:collapse;border:1px solid var(--color-edge);border-radius:var(--radius-lg);width:100%;margin:0 0 1em;font-size:.875rem;line-height:1.5;overflow:hidden}.markdown-body th,.markdown-body td{border:1px solid var(--color-edge-subtle);text-align:left;vertical-align:top;padding:.5rem .75rem}.markdown-body th{background:var(--color-surface-hover);color:var(--color-fg);font-weight:600}.markdown-body tbody tr:hover td{background:var(--color-surface-hover)}.markdown-body p{margin:0 0 .75em}.markdown-body.workflow-result-markdown{color:var(--color-fg-muted);font-size:1rem;line-height:1.7}.markdown-body.workflow-result-markdown>:first-child{margin-top:0}.markdown-body.workflow-result-markdown>:last-child{margin-bottom:0}.markdown-body.workflow-result-markdown h1,.markdown-body.workflow-result-markdown h2,.markdown-body.workflow-result-markdown h3{color:var(--color-fg)}.markdown-body.workflow-result-markdown table{display:block;overflow-x:auto}.markdown-body.workflow-status-markdown{color:var(--color-fg-muted);font-size:.8125rem;line-height:1.55}.markdown-body.workflow-status-markdown>:first-child{margin-top:0}.markdown-body.workflow-status-markdown h1,.markdown-body.workflow-status-markdown h2,.markdown-body.workflow-status-markdown h3{border-bottom:0;padding-bottom:0;font-size:.875rem}.markdown-body.workflow-status-markdown table{font-size:.75rem;display:block;overflow-x:auto}.markdown-body.markdown-note{font-size:.9375rem;line-height:1.45}.markdown-body.markdown-note p{margin-bottom:.65em}.markdown-body strong{font-weight:600}.markdown-body em{font-style:italic}.markdown-body.markdown-compact h1,.markdown-body.markdown-compact h2,.markdown-body.markdown-compact h3{border-bottom:0;margin-top:1.25em;margin-bottom:.4em;padding-bottom:0}.markdown-body.markdown-compact p{margin:0 0 .8em}.markdown-body.markdown-compact>:first-child{margin-top:0}.markdown-body.markdown-compact:not(.markdown-stream-block)>:last-child,.xopc-chat-markdown>.markdown-stream-block:last-child>:last-child{margin-bottom:0}.xopc-chat-markdown>.markdown-stream-block{margin-block:0}.xopc-chat-markdown>.markdown-stream-block:first-child>:first-child{margin-top:0}.xopc-chat-markdown>.markdown-stream-block:last-child>:has(+[data-xopc-watermark]){margin-bottom:0}.xopc-chat-markdown>.markdown-stream-block:last-child{margin-bottom:0}.xopc-chat-markdown .markdown-code-block>pre{max-height:28rem;overflow:auto}.xopc-chat-markdown .markdown-table-scroll{border-radius:var(--radius-lg);max-width:100%;margin-bottom:1em;overflow:auto}.markdown-body.xopc-chat-markdown .markdown-table-scroll>table{table-layout:fixed;margin-bottom:0;display:table}.xopc-chat-markdown th,.xopc-chat-markdown td[data-markdown-align=right]{white-space:nowrap;word-break:normal;overflow-wrap:normal}.xopc-chat-markdown .markdown-mermaid svg{max-width:100%}.markdown-body.markdown-compact pre,.markdown-body.markdown-compact .markdown-code-block{margin-bottom:.75em}.markdown-body.markdown-compact .markdown-code-block>pre{margin-bottom:0}.markdown-mermaid{border:1px solid var(--color-edge);border-radius:var(--radius-xl);background:var(--color-surface-hover);text-align:center;margin:0 0 1em;padding:1em;overflow-x:auto}.markdown-mermaid svg{max-width:100%;height:auto;display:inline-block}.markdown-mermaid-interactive{position:relative}.markdown-mermaid-interactive>svg{cursor:zoom-in}.markdown-mermaid-actions{z-index:1;border:1px solid var(--color-edge);border-radius:var(--radius-lg);background:color-mix(in srgb, var(--color-surface-panel) 92%, transparent);box-shadow:var(--shadow-popover);opacity:0;pointer-events:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);gap:.25rem;padding:.25rem;transition:opacity .15s,transform .15s;display:flex;position:absolute;top:.5rem;right:.5rem;transform:translateY(-.25rem)}.markdown-mermaid-interactive:hover .markdown-mermaid-actions,.markdown-mermaid-interactive:focus-within .markdown-mermaid-actions{opacity:1;pointer-events:auto;transform:translateY(0)}.markdown-mermaid-action-button,.mermaid-preview-toolbar-button{border-radius:var(--radius-md);width:2rem;height:2rem;color:var(--color-fg-muted);background:0 0;border:0;justify-content:center;align-items:center;transition:color .15s,background-color .15s,transform .15s;display:inline-flex}.markdown-mermaid-action-button:hover,.mermaid-preview-toolbar-button:hover{background:var(--color-surface-hover);color:var(--color-fg)}.markdown-mermaid-action-button:active,.mermaid-preview-toolbar-button:active{transform:scale(.95)}.markdown-mermaid-action-button:focus-visible,.mermaid-preview-toolbar-button:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.markdown-mermaid-action-button:disabled,.mermaid-preview-toolbar-button:disabled{cursor:wait;opacity:.5}.markdown-mermaid-action-button{width:1.75rem;height:1.75rem}@media (hover:none){.markdown-code-copy-btn{opacity:1;pointer-events:auto}.markdown-mermaid-actions{opacity:1;pointer-events:auto;transform:translateY(0)}}@media (max-width:640px){.mermaid-preview-secondary-action{display:none}}.markdown-mermaid-error{justify-content:center;align-items:center;min-height:6rem;display:flex}.markdown-mermaid-error-message{color:var(--color-danger);font-size:.875rem;font-weight:500}.markdown-body.markdown-compact .markdown-mermaid{margin-bottom:.75em}html.dark .markdown-mermaid{background:var(--color-surface-panel)}html.dark .markdown-body pre code.hljs{padding:1em;display:block;overflow-x:auto}html.dark .markdown-body code.hljs{padding:3px 5px}html.dark .markdown-body .hljs{color:#c9d1d9;background:var(--color-surface-panel)}html.dark .markdown-body .hljs-doctag,html.dark .markdown-body .hljs-keyword,html.dark .markdown-body .hljs-meta .hljs-keyword,html.dark .markdown-body .hljs-template-tag,html.dark .markdown-body .hljs-template-variable,html.dark .markdown-body .hljs-type,html.dark .markdown-body .hljs-variable.language_{color:#ff7b72}html.dark .markdown-body .hljs-title,html.dark .markdown-body .hljs-title.class_,html.dark .markdown-body .hljs-title.class_.inherited__,html.dark .markdown-body .hljs-title.function_{color:#d2a8ff}html.dark .markdown-body .hljs-attr,html.dark .markdown-body .hljs-attribute,html.dark .markdown-body .hljs-literal,html.dark .markdown-body .hljs-meta,html.dark .markdown-body .hljs-number,html.dark .markdown-body .hljs-operator,html.dark .markdown-body .hljs-variable,html.dark .markdown-body .hljs-selector-attr,html.dark .markdown-body .hljs-selector-class,html.dark .markdown-body .hljs-selector-id{color:#79c0ff}html.dark .markdown-body .hljs-regexp,html.dark .markdown-body .hljs-string,html.dark .markdown-body .hljs-meta .hljs-string{color:#a5d6ff}html.dark .markdown-body .hljs-built_in,html.dark .markdown-body .hljs-symbol{color:#ffa657}html.dark .markdown-body .hljs-comment,html.dark .markdown-body .hljs-code,html.dark .markdown-body .hljs-formula{color:#8b949e}html.dark .markdown-body .hljs-name,html.dark .markdown-body .hljs-quote,html.dark .markdown-body .hljs-selector-tag,html.dark .markdown-body .hljs-selector-pseudo{color:#7ee787}html.dark .markdown-body .hljs-subst{color:#c9d1d9}html.dark .markdown-body .hljs-section{color:#1f6feb;font-weight:700}html.dark .markdown-body .hljs-bullet{color:#f2cc60}html.dark .markdown-body .hljs-emphasis{color:#c9d1d9;font-style:italic}html.dark .markdown-body .hljs-strong{color:#c9d1d9;font-weight:700}html.dark .markdown-body .hljs-addition{color:#aff5b4;background-color:#033a16}html.dark .markdown-body .hljs-deletion{color:#ffdcd7;background-color:#67060c}.xopc-chat-markdown ul{list-style-type:disc}.xopc-chat-markdown ol{list-style-type:decimal}.xopc-chat-markdown ul ul{list-style-type:circle}.xopc-chat-markdown ul ul ul{list-style-type:square}.xopc-chat-markdown li>ul,.xopc-chat-markdown li>ol{margin-top:.35em;margin-bottom:0}.xopc-chat-markdown li.task-list-item{list-style-type:none}.xopc-chat-markdown li.task-list-item>input[type=checkbox]{margin-right:.4em}.markdown-body.xopc-chat-markdown .markdown-code-block>pre>code.hljs{background:0 0;padding:0;display:block;overflow:visible}.markdown-math{min-width:0;max-width:100%;color:inherit}.markdown-math-display{padding:2rem 0 .75rem;position:relative}.markdown-math-display .katex-display{scrollbar-width:none;min-width:0;max-width:100%;margin:.25rem 0;padding-block:.5em;overflow-x:auto}.markdown-math-display .katex-display::-webkit-scrollbar{display:none}.markdown-math-source{white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--font-mono,monospace)}.markdown-math-actions{opacity:0;pointer-events:none;gap:.25rem;transition:opacity .15s;display:flex;position:absolute;top:0;right:0}.markdown-math-display:hover>.markdown-math-actions,.markdown-math-display:focus-within>.markdown-math-actions{opacity:1;pointer-events:auto}.markdown-math-actions button{width:1.75rem;height:1.75rem;color:var(--color-fg-muted);cursor:pointer;border-radius:.25rem;justify-content:center;align-items:center;display:inline-flex}.markdown-math-actions button svg{pointer-events:none}.markdown-math-actions button:hover{background:var(--color-surface-hover)}.markdown-math-actions button:focus-visible{outline:2px solid var(--color-accent)}@media (hover:none){.markdown-math-actions{opacity:1;pointer-events:auto}}@media (prefers-reduced-motion:reduce){.markdown-math-actions,.markdown-code-copy-btn,.markdown-mermaid-actions{transition:none}.markdown-mermaid-actions{transform:none}}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2)format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff)format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2)format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff)format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff)format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2)format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff)format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2)format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff)format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2)format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff)format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2)format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff)format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2)format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff)format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2)format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff)format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2)format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff)format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff)format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff)format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2)format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff)format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2)format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff)format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2)format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff)format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2)format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff)format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC)format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff)format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2)format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff)format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf)format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2)format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff)format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf)format("truetype")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,math,Times New Roman,serif;position:relative}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.19.0"}.katex .katex-mathml{clip-path:inset(50%);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.katex-newline{display:block}.katex .katex-base{white-space:nowrap;width:min-content;position:relative}.katex .katex-base,.katex .katex-strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .katex-vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .katex-thinbox{flex-direction:row;width:0;max-width:0;display:inline-flex}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .katex-hdashline,.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-rule,.katex .katex-underline .underline-line,.katex .mfrac .frac-line{min-height:1px}.katex .mspace{display:inline-block}.katex .katex-smash{line-height:0;display:inline}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.katex-inner,.katex .llap>.katex-inner,.katex .rlap>.katex-inner{position:absolute}.katex .clap>.katex-fix,.katex .llap>.katex-fix,.katex .rlap>.katex-fix{display:inline-block}.katex .llap>.katex-inner{right:0}.katex .clap>.katex-inner,.katex .rlap>.katex-inner{left:0}.katex .clap>.katex-inner>span{margin-left:-50%;margin-right:50%}.katex .katex-rule{border:0 solid;display:inline-block;position:relative}.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .katex-hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.katex-root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .katex-sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .katex-sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .katex-sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .katex-sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .katex-sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .katex-sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .katex-sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .katex-sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .katex-sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .katex-sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .katex-sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .katex-sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .katex-sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .katex-sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .katex-sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .katex-sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .katex-sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .katex-sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .katex-sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .katex-sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .katex-sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .katex-sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .katex-sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .katex-sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .katex-sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .katex-sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .katex-sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .katex-sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .katex-sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .katex-sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .katex-sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .katex-sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .katex-sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .katex-sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .katex-sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .katex-sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .katex-sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .katex-sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .katex-sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .katex-sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .katex-sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .katex-sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .katex-sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .katex-sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .katex-sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .katex-sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .katex-sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .katex-sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .katex-sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .katex-sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .katex-sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .katex-sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .katex-sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .katex-sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .katex-sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .katex-sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .katex-sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .katex-sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .katex-sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .katex-sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .katex-sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .katex-sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .katex-sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .katex-sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .katex-sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .katex-sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .katex-sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .katex-sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .katex-sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .katex-sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .katex-sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .katex-sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .katex-sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .katex-sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .katex-sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .katex-sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .katex-sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .katex-sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .katex-sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .katex-sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .katex-sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .katex-sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .katex-sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .katex-sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .katex-sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .katex-sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .katex-sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .katex-sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .katex-sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .katex-sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .katex-sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .katex-sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .katex-sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .katex-sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .katex-sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .katex-sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .katex-sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .katex-sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .katex-sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .katex-sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .katex-sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .katex-sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .katex-sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .katex-sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .katex-sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .katex-sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .katex-sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .katex-sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .katex-sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .katex-sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .katex-sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .katex-sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .katex-sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .katex-sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .katex-sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .katex-sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .katex-sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .katex-sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .katex-sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .katex-sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .katex-sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .katex-accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .katex-accent .accent-body{position:relative}.katex .katex-accent .accent-body:not(.accent-full){width:0}.katex .katex-overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;height:inherit;width:100%;display:block;position:absolute}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .katex-stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .katex-stretchy:after,.katex .katex-stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .katex-sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .reflectbox{display:inline-block;transform:scaleX(-1)}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.katex-tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.katex-tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo}
@@ -1 +0,0 @@
1
- import{Gc as e}from"./index-K2cy4f-3.js";export{e as Mermaid};