@xopcai/xopc 0.0.486 → 0.0.487

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 (665) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  3. package/dist/extensions/feishu/src/transport/reliability/message-ingress.js +2 -2
  4. package/dist/extensions/telegram/src/inbound-processor.js +2 -2
  5. package/dist/extensions/telegram/src/outbound-sender.js +1 -1
  6. package/dist/extensions/telegram/src/plugin.js +3 -3
  7. package/dist/extensions/telegram/src/polling-session.js +1 -1
  8. package/dist/extensions/telegram/src/update-offset-store.js +2 -1
  9. package/dist/extensions/telegram/xopc.extension.json +1 -1
  10. package/dist/extensions/weixin/src/api/api.js +2 -2
  11. package/dist/extensions/weixin/src/auth/accounts.js +12 -12
  12. package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
  13. package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
  14. package/dist/extensions/weixin/src/messaging/process-message.js +2 -2
  15. package/dist/extensions/weixin/src/messaging/quote-cache.js +3 -1
  16. package/dist/extensions/weixin/src/storage/sync-buf.js +2 -1
  17. package/dist/gateway/server/chunks.bin +1568 -1404
  18. package/dist/gateway/server/chunks.json +1 -1
  19. package/dist/gateway/server/dependency-records.json +42 -0
  20. package/dist/gateway/static/root/assets/{activity-store-hSe5Nbgk.js → activity-store-CWGtissf.js} +1 -1
  21. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BY2wRiwY.js → agent-avatar-dicebear-D4YSq8A9.js} +1 -1
  22. package/dist/gateway/static/root/assets/{agent-avatar-display-D_UDgOr9.js → agent-avatar-display-DWv7biOS.js} +2 -2
  23. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BrcyLG9M.js → agent-defaults-settings-panel-3xdD9dR1.js} +1 -1
  24. package/dist/gateway/static/root/assets/{agent-plugin-dialog-CSJC1yud.js → agent-plugin-dialog-BNvw2z1Y.js} +1 -1
  25. package/dist/gateway/static/root/assets/{agents-DX-t3X7K.js → agents-DcENLHHW.js} +3 -3
  26. package/dist/gateway/static/root/assets/{agents-admin-api-DSr-PWuW.js → agents-admin-api-BzpxMKwk.js} +1 -1
  27. package/dist/gateway/static/root/assets/{api-CGrHK9ij.js → api-D70-LnNE.js} +1 -1
  28. package/dist/gateway/static/root/assets/{api-B3T06TLl.js → api-SIYalfjE.js} +1 -1
  29. package/dist/gateway/static/root/assets/{app-management-settings-panel-D6ZoYKaA.js → app-management-settings-panel-CEveRIMe.js} +1 -1
  30. package/dist/gateway/static/root/assets/{appearance-settings-BRb6kZT8.js → appearance-settings-CT2NLLuY.js} +1 -1
  31. package/dist/gateway/static/root/assets/{apps-page-6xeWvMpF.js → apps-page-pEqr4fAK.js} +1 -1
  32. package/dist/gateway/static/root/assets/{archive-plugin-CQ5UXgZk.js → archive-plugin-xnggGfUN.js} +1 -1
  33. package/dist/gateway/static/root/assets/{automation-api-D-gn6x5E.js → automation-api-CaBLskwk.js} +1 -1
  34. package/dist/gateway/static/root/assets/{automation-result-state-B7hq0XOL.js → automation-result-state-CeGtOXK0.js} +1 -1
  35. package/dist/gateway/static/root/assets/{automation-run-list-CM59-qm5.js → automation-run-list-DUpezxj4.js} +1 -1
  36. package/dist/gateway/static/root/assets/{automation-task-card-C453Q-Wa.js → automation-task-card-CLayJo0S.js} +1 -1
  37. package/dist/gateway/static/root/assets/{automations-page-BLFBqaPX.js → automations-page-BKfvaA41.js} +1 -1
  38. package/dist/gateway/static/root/assets/{automations-workspace-DiO3Iyuj.js → automations-workspace-BRcJzgLA.js} +2 -2
  39. package/dist/gateway/static/root/assets/{binary-plugins-D_zw0TgG.js → binary-plugins-DtD3acS4.js} +1 -1
  40. package/dist/gateway/static/root/assets/block-editor-BFDeQtYs.css +1 -0
  41. package/dist/gateway/static/root/assets/{block-editor-Cesz2DqP.js → block-editor-DXjBAN8L.js} +46 -46
  42. package/dist/gateway/static/root/assets/{browser-settings-page-BHElJSFt.js → browser-settings-page-Cgxtr2eR.js} +1 -1
  43. package/dist/gateway/static/root/assets/{capabilities-CW-vdkz6.js → capabilities-CpwoMqtm.js} +1 -1
  44. package/dist/gateway/static/root/assets/{capabilities-DZrjA95P.js → capabilities-DcD15BrU.js} +1 -1
  45. package/dist/gateway/static/root/assets/{capabilities-page-DQrfkrBA.js → capabilities-page-x_AS_XJ0.js} +2 -2
  46. package/dist/gateway/static/root/assets/{capabilities-settings-panel-DIT2dvtc.js → capabilities-settings-panel-DMgEXxkC.js} +1 -1
  47. package/dist/gateway/static/root/assets/{channels-Dcr5dgqw.js → channels-565FQAGr.js} +1 -1
  48. package/dist/gateway/static/root/assets/{chat-agents-api-CyvBfBbp.js → chat-agents-api-BfsNH-ht.js} +1 -1
  49. package/dist/gateway/static/root/assets/{chat-chart-block-B83s8HE9.js → chat-chart-block-Dpolmx0-.js} +1 -1
  50. package/dist/gateway/static/root/assets/{chat-page-DWZCzxY7.js → chat-page-Bn44NcvF.js} +6 -6
  51. package/dist/gateway/static/root/assets/{chat-terminal-dock-DCUuwiTt.js → chat-terminal-dock-D6fuI2tI.js} +1 -1
  52. package/dist/gateway/static/root/assets/{command-palette-api-UrqPvWR1.js → command-palette-api-H3lCPfK8.js} +1 -1
  53. package/dist/gateway/static/root/assets/{composer-model-config-control-C2Bku39S.js → composer-model-config-control-BcWrGT5D.js} +1 -1
  54. package/dist/gateway/static/root/assets/{composer-notifications-MGKffwC7.js → composer-notifications-0fMBrXZD.js} +1 -1
  55. package/dist/gateway/static/root/assets/{composer-payload-handoff-a0quQ25p.js → composer-payload-handoff-DCGudJjU.js} +1 -1
  56. package/dist/gateway/static/root/assets/{computer-settings-page-DUzQe6Bz.js → computer-settings-page-kvYzJ_j2.js} +1 -1
  57. package/dist/gateway/static/root/assets/confirm-dialog-yhRKgG72.js +1 -0
  58. package/dist/gateway/static/root/assets/{connected-providers-grid-BJKEp0SE.js → connected-providers-grid-CApjiM_x.js} +1 -1
  59. package/dist/gateway/static/root/assets/{connection-usage-guide-B9hoSOnN.js → connection-usage-guide-C2qOP6Nx.js} +1 -1
  60. package/dist/gateway/static/root/assets/{connector-service-page-e67KylnM.js → connector-service-page-DKihi3WL.js} +1 -1
  61. package/dist/gateway/static/root/assets/{connectors-api-CRGq-TSw.js → connectors-api-Dj9RbG9p.js} +1 -1
  62. package/dist/gateway/static/root/assets/{connectors-page-BteRI1XM.js → connectors-page-CR6a3Mne.js} +1 -1
  63. package/dist/gateway/static/root/assets/{date-picker-DwITf4I2.js → date-picker-BX5tr0IG.js} +1 -1
  64. package/dist/gateway/static/root/assets/{date-time-picker-ChG1CqR1.js → date-time-picker-CdPsuK2A.js} +1 -1
  65. package/dist/gateway/static/root/assets/{desktop-pet-BHoFymL4.js → desktop-pet-DRfOb9ZT.js} +1 -1
  66. package/dist/gateway/static/root/assets/{desktop-pet-settings-BYeBN4jj.js → desktop-pet-settings-D6qCAFLe.js} +1 -1
  67. package/dist/gateway/static/root/assets/{dev-view-store-DsjH8x76.js → dev-view-store-DrRxtile.js} +1 -1
  68. package/dist/gateway/static/root/assets/{device-connections-panel-DE01vyK_.js → device-connections-panel-Drbw9eRH.js} +1 -1
  69. package/dist/gateway/static/root/assets/{device-pairing-action-w1enAo76.js → device-pairing-action-Dd2YtIhH.js} +1 -1
  70. package/dist/gateway/static/root/assets/{device-pairing-wizard-Dt737tSq.js → device-pairing-wizard-wtsyHEO3.js} +1 -1
  71. package/dist/gateway/static/root/assets/{directory-picker-path-field-B-eUnbng.js → directory-picker-path-field-B3YBba3x.js} +1 -1
  72. package/dist/gateway/static/root/assets/{extension-authoritative-grants-DYp2nNol.js → extension-authoritative-grants-WXYRv5nA.js} +1 -1
  73. package/dist/gateway/static/root/assets/{extension-debug-page-4jJ1uVQJ.js → extension-debug-page-CKeIq8S2.js} +1 -1
  74. package/dist/gateway/static/root/assets/{extension-iframe-host-CJV5JETm.js → extension-iframe-host-Cv4PCSVv.js} +1 -1
  75. package/dist/gateway/static/root/assets/{extension-marketplace-api-DGV5FC-v.js → extension-marketplace-api-e0e9OxOT.js} +1 -1
  76. package/dist/gateway/static/root/assets/{extension-message-router-B4I-Y6qs.js → extension-message-router-GPlMiYyF.js} +1 -1
  77. package/dist/gateway/static/root/assets/{extension-page-lc7a84nG.js → extension-page-DcP7IEMp.js} +1 -1
  78. package/dist/gateway/static/root/assets/{extension-provider-D8_mIBI0.js → extension-provider-DZ97b5uA.js} +1 -1
  79. package/dist/gateway/static/root/assets/{extension-settings-page-Uw2lfWRh.js → extension-settings-page-DIYoawnA.js} +1 -1
  80. package/dist/gateway/static/root/assets/{gateway-config-swr-BD-ams0X.js → gateway-config-swr-aAsaoOK1.js} +1 -1
  81. package/dist/gateway/static/root/assets/{gateway-realtime-CoIFB3im.js → gateway-realtime-egUNyhxi.js} +1 -1
  82. package/dist/gateway/static/root/assets/gateway-realtime-store-5YcWzAfG.js +1 -0
  83. package/dist/gateway/static/root/assets/{gateway-restart-Dos1Pp84.js → gateway-restart-BY6zJgTe.js} +1 -1
  84. package/dist/gateway/static/root/assets/{gateway-settings-DUC1iOVK.js → gateway-settings-4TvJ0_i0.js} +1 -1
  85. package/dist/gateway/static/root/assets/{gateway-startup-retry-DgmvR-hb.js → gateway-startup-retry-D0dDJJQ4.js} +1 -1
  86. package/dist/gateway/static/root/assets/{global-defaults-api-B7suATYU.js → global-defaults-api-9iooq81U.js} +1 -1
  87. package/dist/gateway/static/root/assets/{home-page-mSRCU81k.js → home-page-VMzHth7Q.js} +3 -3
  88. package/dist/gateway/static/root/assets/{home-task-actions-_ZAc57Y7.js → home-task-actions-iUYzLb18.js} +1 -1
  89. package/dist/gateway/static/root/assets/{image-generation-api-Baz4xdZ4.js → image-generation-api-Dv4fjHaE.js} +1 -1
  90. package/dist/gateway/static/root/assets/{imports-page-DR0eLPgB.js → imports-page-WENCxW7P.js} +1 -1
  91. package/dist/gateway/static/root/assets/index-CaUUC83j.css +1 -0
  92. package/dist/gateway/static/root/assets/{index-CJAEAcZV.js → index-DwdoCbAF.js} +6 -6
  93. package/dist/gateway/static/root/assets/{install-connector-dialog-CntHi8Rh.js → install-connector-dialog-DNY-rpBC.js} +1 -1
  94. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-DHWEGna7.js +1 -0
  95. package/dist/gateway/static/root/assets/{local-app-workbench-page-C3Lqi8E1.js → local-app-workbench-page-Dnug0YtC.js} +1 -1
  96. package/dist/gateway/static/root/assets/{local-apps-page-BoCtITdL.js → local-apps-page-Bjr4rrgT.js} +1 -1
  97. package/dist/gateway/static/root/assets/{local-session-drafts-CGSV1RQg.js → local-session-drafts-Z3PoR-8i.js} +1 -1
  98. package/dist/gateway/static/root/assets/{locale-store-CHjsq5NR.js → locale-store-DgbX5Azb.js} +1 -1
  99. package/dist/gateway/static/root/assets/{logs-page-0hkRbcUR.js → logs-page-BIZvtqSJ.js} +1 -1
  100. package/dist/gateway/static/root/assets/{management-api-FVu7eYXD.js → management-api-CJb5Vclf.js} +1 -1
  101. package/dist/gateway/static/root/assets/{management-settings-QQB1r71U.js → management-settings-BjtIRkgJ.js} +1 -1
  102. package/dist/gateway/static/root/assets/{markdown-view-ihzUc4ud.js → markdown-view-lnMk_L03.js} +1 -1
  103. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DffQKrjd.js → mcp-conversation-setup-page-kq0dZ2Nc.js} +1 -1
  104. package/dist/gateway/static/root/assets/{media-plugins-C78NkHfB.js → media-plugins-RU49QGcW.js} +1 -1
  105. package/dist/gateway/static/root/assets/messages-Clfka2Sx.js +3 -0
  106. package/dist/gateway/static/root/assets/{model-selector-QFZY5XNN.js → model-selector-BolKz5sx.js} +1 -1
  107. package/dist/gateway/static/root/assets/{models-hub-cache-BrD6r5Qs.js → models-hub-cache-CjdnTF5z.js} +1 -1
  108. package/dist/gateway/static/root/assets/note-detail-panel-Qm1Et_f8.js +7 -0
  109. package/dist/gateway/static/root/assets/note-image-lightbox-BVcE6TAF.js +1 -0
  110. package/dist/gateway/static/root/assets/{notes-api-D5SvfybU.js → notes-api-FjHO1h6b.js} +1 -1
  111. package/dist/gateway/static/root/assets/{notes-page-RPfvHnl6.js → notes-page-B_atfwwi.js} +2 -2
  112. package/dist/gateway/static/root/assets/{oauth-api-DnMpUoyx.js → oauth-api-B1lbdI3v.js} +1 -1
  113. package/dist/gateway/static/root/assets/{oauth-provider-connect-DGYky6ut.js → oauth-provider-connect-Cy1Yy8aX.js} +1 -1
  114. package/dist/gateway/static/root/assets/{page-context-capture-button-CVHz9b6c.js → page-context-capture-button-Phh-SyES.js} +1 -1
  115. package/dist/gateway/static/root/assets/{page-context-draft-Bk7jVvAG.js → page-context-draft-M04A73Ul.js} +1 -1
  116. package/dist/gateway/static/root/assets/{page-header-store-NP7MCIaP.js → page-header-store-CYA4Isnf.js} +1 -1
  117. package/dist/gateway/static/root/assets/{personal-avatar-1TVnHakL.js → personal-avatar-DF3Frmnt.js} +1 -1
  118. package/dist/gateway/static/root/assets/{personal-page-Dt1d3tQT.js → personal-page-DkDROUWV.js} +1 -1
  119. package/dist/gateway/static/root/assets/{personal-profile-settings-XiT1MgTK.js → personal-profile-settings-LAAXGLKs.js} +1 -1
  120. package/dist/gateway/static/root/assets/{personal-settings-panel-bcw04REt.js → personal-settings-panel-B6G-4av9.js} +1 -1
  121. package/dist/gateway/static/root/assets/{phone-dependencies-card-B4QsgIEF.js → phone-dependencies-card-DeBlKu7M.js} +1 -1
  122. package/dist/gateway/static/root/assets/{phone-model-connection-Dk5kE1Ll.js → phone-model-connection-TStZicIQ.js} +1 -1
  123. package/dist/gateway/static/root/assets/{phone-model-picker-CFoxQiws.js → phone-model-picker-C3xcbacO.js} +1 -1
  124. package/dist/gateway/static/root/assets/{phone-settings-page-Bv1xm8sh.js → phone-settings-page-CllfdPFi.js} +1 -1
  125. package/dist/gateway/static/root/assets/{phone-workspace-store-DGaibcsi.js → phone-workspace-store-CeP3GXUk.js} +1 -1
  126. package/dist/gateway/static/root/assets/{plugin-details-dialog-FcOJaeP0.js → plugin-details-dialog-Ck1dirgu.js} +1 -1
  127. package/dist/gateway/static/root/assets/{preference-select-fields-B-yK91If.js → preference-select-fields-DMClbggY.js} +1 -1
  128. package/dist/gateway/static/root/assets/{preview-runtime-FtWOW5i4.js → preview-runtime-Cl-SoLXg.js} +3 -3
  129. package/dist/gateway/static/root/assets/product-automation-feedback-Bb_lbw1l.js +1 -0
  130. package/dist/gateway/static/root/assets/{product-open-page-C09VEZjY.js → product-open-page-BWH54iuf.js} +1 -1
  131. package/dist/gateway/static/root/assets/{product-preview-content-B3mzl6-f.js → product-preview-content-NOZu0WO2.js} +1 -1
  132. package/dist/gateway/static/root/assets/{product-preview-modal-5kTp_7Qk.js → product-preview-modal-ZKiIeKof.js} +2 -2
  133. package/dist/gateway/static/root/assets/{project-detail-page-DGPfKx5M.js → project-detail-page-BTgDajpj.js} +1 -1
  134. package/dist/gateway/static/root/assets/{project-understanding-4IyHVmus.js → project-understanding-BWpcOkWw.js} +1 -1
  135. package/dist/gateway/static/root/assets/{projects-page-C-9x23LR.js → projects-page-Dnx2AcQX.js} +1 -1
  136. package/dist/gateway/static/root/assets/{providers-api-D9NuB7w3.js → providers-api-BRAMBKCK.js} +1 -1
  137. package/dist/gateway/static/root/assets/recording-upload-C0d2YjJV.js +1 -0
  138. package/dist/gateway/static/root/assets/{registry-api-CDpUAb2R.js → registry-api-Dz4umdY3.js} +1 -1
  139. package/dist/gateway/static/root/assets/{remote-access-hub-DVTs8pwO.js → remote-access-hub-BEIzBYdj.js} +1 -1
  140. package/dist/gateway/static/root/assets/{resource-unavailable-CZlqZYk-.js → resource-unavailable-82byHwG_.js} +1 -1
  141. package/dist/gateway/static/root/assets/{right-workspace-store-Cehybf-G.js → right-workspace-store-B8ooYVOe.js} +1 -1
  142. package/dist/gateway/static/root/assets/{route-preload-CzorjVc9.js → route-preload-DkUojqyb.js} +2 -2
  143. package/dist/gateway/static/root/assets/{routine-panel-n4IstC8Y.js → routine-panel-wJxaH-1V.js} +2 -2
  144. package/dist/gateway/static/root/assets/{runtime-tools-api-BhS0RWf2.js → runtime-tools-api-CQ7fTX-H.js} +1 -1
  145. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-jTbGPGeA.js → runtime-tools-settings-panel-DZD-cEXM.js} +1 -1
  146. package/dist/gateway/static/root/assets/{service-recommendation-list-wfd0Mjtu.js → service-recommendation-list-CFJ8WBzq.js} +1 -1
  147. package/dist/gateway/static/root/assets/{session-api-CR3NLqvs.js → session-api-Dxhtjzoa.js} +1 -1
  148. package/dist/gateway/static/root/assets/{session-manager-C2MCS4C5.js → session-manager-DvIGR4Sw.js} +1 -1
  149. package/dist/gateway/static/root/assets/{sessions-page-9ibCNP9o.js → sessions-page-BDPieIpD.js} +1 -1
  150. package/dist/gateway/static/root/assets/settings-advanced-gate-CaALReQD.js +1 -0
  151. package/dist/gateway/static/root/assets/{settings-advanced-section-CTLdGPvx.js → settings-advanced-section-1R7xRVEG.js} +1 -1
  152. package/dist/gateway/static/root/assets/{settings-mode-store-CCQVvItG.js → settings-mode-store-D4-i8uQI.js} +1 -1
  153. package/dist/gateway/static/root/assets/{settings-page-DsM_f07M.js → settings-page-DXo8rZFt.js} +1 -1
  154. package/dist/gateway/static/root/assets/{settings-page-header-C21Iw2rD.js → settings-page-header-BooYRGUH.js} +1 -1
  155. package/dist/gateway/static/root/assets/{settings-page-layout-BXcLlp6p.js → settings-page-layout-BeHnqGAN.js} +1 -1
  156. package/dist/gateway/static/root/assets/{setup-interaction-page-W2F5ZaR_.js → setup-interaction-page-DqmPSRNo.js} +1 -1
  157. package/dist/gateway/static/root/assets/{setup-status-panel-BFNwZuhp.js → setup-status-panel-c4yDTYiK.js} +1 -1
  158. package/dist/gateway/static/root/assets/{share-link-dialog-2JjvWs0q.js → share-link-dialog-Cvma1jxB.js} +1 -1
  159. package/dist/gateway/static/root/assets/{share-preview-page-C32Mq-BY.js → share-preview-page-BL6FwL4u.js} +1 -1
  160. package/dist/gateway/static/root/assets/{shares-api-BhWvN3LS.js → shares-api-BqIBNEtd.js} +1 -1
  161. package/dist/gateway/static/root/assets/{shares-settings-BDGbs8wz.js → shares-settings-BoBOd-eB.js} +1 -1
  162. package/dist/gateway/static/root/assets/{skill-api-BG9A1WF0.js → skill-api-oDg0Zlyb.js} +1 -1
  163. package/dist/gateway/static/root/assets/{skill-list-api-B26hHnXq.js → skill-list-api-BvfKctht.js} +1 -1
  164. package/dist/gateway/static/root/assets/{skill-reload-api-B9Eu5Yk_.js → skill-reload-api-CnchMEV8.js} +1 -1
  165. package/dist/gateway/static/root/assets/{skills-page-kL8E5zgi.js → skills-page-CFZk_0nE.js} +1 -1
  166. package/dist/gateway/static/root/assets/{space-api-_uKFiASp.js → space-api-C_GoZOc_.js} +1 -1
  167. package/dist/gateway/static/root/assets/{space-page-DwyuUvI3.js → space-page-CBSaZbyH.js} +2 -2
  168. package/dist/gateway/static/root/assets/{space-workbook-BAwHwK6O.js → space-workbook-B8JGuyIf.js} +1 -1
  169. package/dist/gateway/static/root/assets/{system-settings-panel-0e2zfQLt.js → system-settings-panel-DzNDyMOH.js} +1 -1
  170. package/dist/gateway/static/root/assets/{task-detail-page-DdCpNW8K.js → task-detail-page-BmWkL-KH.js} +1 -1
  171. package/dist/gateway/static/root/assets/{task-header-title-CLt_lmjb.js → task-header-title-CCaEJNV4.js} +1 -1
  172. package/dist/gateway/static/root/assets/{task-result-presentation-CgvcqEMD.js → task-result-presentation-DwEf7Xf7.js} +1 -1
  173. package/dist/gateway/static/root/assets/{task-run-issue-notice-8FX876PP.js → task-run-issue-notice-COE7ppvl.js} +1 -1
  174. package/dist/gateway/static/root/assets/{terminal-panel-store-Cy90Ix5U.js → terminal-panel-store-CHQ2xJtk.js} +1 -1
  175. package/dist/gateway/static/root/assets/{theme-store-CvG266p8.js → theme-store-Bij94a-6.js} +1 -1
  176. package/dist/gateway/static/root/assets/{tracing-settings-page-Cx_fOH70.js → tracing-settings-page-CKH4dKSl.js} +1 -1
  177. package/dist/gateway/static/root/assets/{tunnel-api-Cph-ZBBy.js → tunnel-api-ChjCCCGL.js} +1 -1
  178. package/dist/gateway/static/root/assets/{understanding-activity-store-CN4JzOIO.js → understanding-activity-store-BD1OXjlI.js} +1 -1
  179. package/dist/gateway/static/root/assets/{understanding-refresh-store-BuZZ1_VH.js → understanding-refresh-store-BSVLFuVh.js} +1 -1
  180. package/dist/gateway/static/root/assets/{usage-page-Du42x0ej.js → usage-page-v5c3aC-p.js} +1 -1
  181. package/dist/gateway/static/root/assets/{use-autosave-B_WH_LBE.js → use-autosave-teDzNJW4.js} +1 -1
  182. package/dist/gateway/static/root/assets/{use-composer-attachments-BEuyorVm.js → use-composer-attachments-rUl5n4_a.js} +1 -1
  183. package/dist/gateway/static/root/assets/{use-file-preview-expanded-Cehu0745.js → use-file-preview-expanded-BRjXpRde.js} +1 -1
  184. package/dist/gateway/static/root/assets/{use-generated-media-CzRbgtcv.js → use-generated-media-Bx6BscUT.js} +1 -1
  185. package/dist/gateway/static/root/assets/{use-personal-profile-D4gLM6Wi.js → use-personal-profile-Dz3wWaGt.js} +1 -1
  186. package/dist/gateway/static/root/assets/{use-personal-work-B25WRGHj.js → use-personal-work-D-Tgi4DZ.js} +1 -1
  187. package/dist/gateway/static/root/assets/{use-realtime-voice-CV3GIt_T.js → use-realtime-voice-Bp81D6PV.js} +1 -1
  188. package/dist/gateway/static/root/assets/{use-share-link-WKZLlEqr.js → use-share-link-D5HNXEIt.js} +1 -1
  189. package/dist/gateway/static/root/assets/{use-workspace-tree-C0C861cb.js → use-workspace-tree-DXKhfc1T.js} +1 -1
  190. package/dist/gateway/static/root/assets/{user-model-page-AK2U8vGc.js → user-model-page-B0tEc4rh.js} +1 -1
  191. package/dist/gateway/static/root/assets/{voice-api-key-field-BqXQj51r.js → voice-api-key-field-odum3GZx.js} +1 -1
  192. package/dist/gateway/static/root/assets/{voice-config-api-sXEIG6lz.js → voice-config-api-CiA2cr3s.js} +1 -1
  193. package/dist/gateway/static/root/assets/voice-input-shortcut-events-JsEfJGJz.js +1 -0
  194. package/dist/gateway/static/root/assets/{voice-player-store-CTbnOdeM.js → voice-player-store-CUV5cpmX.js} +1 -1
  195. package/dist/gateway/static/root/assets/{voice-settings-JpPo3BvX.js → voice-settings-FOeRWVH4.js} +1 -1
  196. package/dist/gateway/static/root/assets/{work-discovery-overlay-BjfTRFX8.js → work-discovery-overlay-CJxXUdeq.js} +1 -1
  197. package/dist/gateway/static/root/assets/{work-discovery-page-CSRkFiXc.js → work-discovery-page-Dm0XTxsk.js} +1 -1
  198. package/dist/gateway/static/root/assets/{working-directory-picker-modal-DgM21YVT.js → working-directory-picker-modal-DfyyBJpb.js} +1 -1
  199. package/dist/gateway/static/root/assets/{workspace-api-CQOuWbVv.js → workspace-api-B1JW3oZZ.js} +2 -2
  200. package/dist/gateway/static/root/assets/workspace-editor-agent-store-BbfHBVhA.js +1 -0
  201. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-CmMueTmW.js → workspace-file-preview-dialog-kGa6o4bV.js} +1 -1
  202. package/dist/gateway/static/root/assets/{workspace-open-location-menu-BAbIGS01.js → workspace-open-location-menu-Dl4QsZL3.js} +1 -1
  203. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-e8HJFnTs.js → xopc-cloud-account-card-fiyk59YU.js} +1 -1
  204. package/dist/gateway/static/root/index.html +94 -94
  205. package/dist/package.js +1 -1
  206. package/dist/src/agent/agent-manager.js +18 -18
  207. package/dist/src/agent/agent-scope.js +2 -2
  208. package/dist/src/agent/background-review/prompts.js +2 -2
  209. package/dist/src/agent/background-review/run-background-review.js +14 -14
  210. package/dist/src/agent/child-agent-factory.js +4 -4
  211. package/dist/src/agent/commands/command-registry.js +2 -1
  212. package/dist/src/agent/context/coordinator.js +3 -3
  213. package/dist/src/agent/context/deep-recall.js +5 -5
  214. package/dist/src/agent/context/execution-context.js +3 -3
  215. package/dist/src/agent/context/project-context.js +4 -4
  216. package/dist/src/agent/data-acquisition/service.js +1 -1
  217. package/dist/src/agent/embedded/codemode-extension.js +1 -1
  218. package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
  219. package/dist/src/agent/embedded/execution-tool-policy.js +8 -4
  220. package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
  221. package/dist/src/agent/embedded/index.js +1 -1
  222. package/dist/src/agent/embedded/run-for-session.js +10 -10
  223. package/dist/src/agent/embedded/run-turn.js +19 -19
  224. package/dist/src/agent/embedded/runs.js +1 -1
  225. package/dist/src/agent/embedded/session-runner.js +5 -5
  226. package/dist/src/agent/embedded/xopc-tools-bridge.js +1 -1
  227. package/dist/src/agent/external-tools/cliProvider.js +5 -5
  228. package/dist/src/agent/external-tools/composio-provider.js +3 -3
  229. package/dist/src/agent/external-tools/endpoint-provider.js +9 -9
  230. package/dist/src/agent/external-tools/extension-provider.js +1 -1
  231. package/dist/src/agent/external-tools/gateway-tools.js +3 -3
  232. package/dist/src/agent/external-tools/memory-provider.js +1 -1
  233. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  234. package/dist/src/agent/image/generation/runtime.js +1 -1
  235. package/dist/src/agent/image/index.js +1 -1
  236. package/dist/src/agent/image/tool-model-config.js +1 -1
  237. package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
  238. package/dist/src/agent/inbound/inbound-loop.js +3 -3
  239. package/dist/src/agent/independent-execution.js +1 -1
  240. package/dist/src/agent/index.js +1 -1
  241. package/dist/src/agent/mcp/connection-drafts.js +1 -1
  242. package/dist/src/agent/mcp/connection-setup.js +2 -2
  243. package/dist/src/agent/mcp/continuation-guard.js +2 -1
  244. package/dist/src/agent/mcp/conversation-setup.js +2 -1
  245. package/dist/src/agent/mcp/discovery.js +3 -2
  246. package/dist/src/agent/mcp/managed-discovery.js +1 -1
  247. package/dist/src/agent/mcp/tool-catalog.js +1 -1
  248. package/dist/src/agent/mcp/transport.js +1 -1
  249. package/dist/src/agent/memory/index.js +1 -1
  250. package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
  251. package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
  252. package/dist/src/agent/orchestration/child-run-monitor.js +2 -1
  253. package/dist/src/agent/orchestration/child-run-resume.js +3 -3
  254. package/dist/src/agent/orchestration/llm-turn-retry.js +1 -1
  255. package/dist/src/agent/prompt/response-language.js +1 -1
  256. package/dist/src/agent/prompt/service-prompt-builder.js +3 -3
  257. package/dist/src/agent/prompt/system-prompt-params.js +1 -1
  258. package/dist/src/agent/sandbox/exec-policy.js +1 -1
  259. package/dist/src/agent/service/direct-turn-helpers.js +4 -4
  260. package/dist/src/agent/service/process-direct-streaming.js +7 -7
  261. package/dist/src/agent/service/webchat-tts.js +3 -3
  262. package/dist/src/agent/service.js +21 -21
  263. package/dist/src/agent/session/interaction-policy-state.js +2 -1
  264. package/dist/src/agent/session/session-config-service.js +2 -2
  265. package/dist/src/agent/session/session-hydrator.js +1 -1
  266. package/dist/src/agent/session/session-inspector.js +1 -1
  267. package/dist/src/agent/skills/skill-manager.js +1 -1
  268. package/dist/src/agent/skills/skill-sources.js +1 -1
  269. package/dist/src/agent/tasks/task-judge-service.js +7 -7
  270. package/dist/src/agent/tools/clarify-tool.js +1 -1
  271. package/dist/src/agent/tools/create-share-tool.js +1 -1
  272. package/dist/src/agent/tools/delegate-tool.js +3 -3
  273. package/dist/src/agent/tools/exec-command.js +1 -1
  274. package/dist/src/agent/tools/executor.js +1 -1
  275. package/dist/src/agent/tools/factory.js +20 -20
  276. package/dist/src/agent/tools/fetch-text.js +1 -1
  277. package/dist/src/agent/tools/image-generate-tool.js +2 -2
  278. package/dist/src/agent/tools/index.js +4 -4
  279. package/dist/src/agent/tools/knowledge-memory-tool.js +1 -1
  280. package/dist/src/agent/tools/managed-job-tool.js +1 -1
  281. package/dist/src/agent/tools/personal-attention-tool.js +2 -2
  282. package/dist/src/agent/tools/personal-memory-tool.js +7 -7
  283. package/dist/src/agent/tools/personal-read-tool.js +1 -1
  284. package/dist/src/agent/tools/personal-request-result-tool.js +2 -2
  285. package/dist/src/agent/tools/personal-request-tool.js +2 -2
  286. package/dist/src/agent/tools/personal-result-tool.js +1 -1
  287. package/dist/src/agent/tools/personal-task-tool.js +5 -5
  288. package/dist/src/agent/tools/session-search-tool.js +2 -2
  289. package/dist/src/agent/tools/skill-install-tool.js +2 -1
  290. package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
  291. package/dist/src/agent/tools/tts-tool.js +1 -1
  292. package/dist/src/agent/tools/user-context-tool.js +2 -2
  293. package/dist/src/agent/tools/web.js +1 -1
  294. package/dist/src/agent/tools/workbook-tools.js +1 -1
  295. package/dist/src/agent/tools/xopc-use-tool.js +19 -13
  296. package/dist/src/agent-catalog/capabilities.js +1 -1
  297. package/dist/src/ai-assist/text-assist.js +1 -1
  298. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  299. package/dist/src/auth/sync-provider-auth.js +1 -1
  300. package/dist/src/automations/capabilities/write.js +3 -2
  301. package/dist/src/automations/domain/index.js +1 -1
  302. package/dist/src/automations/draft/automation-draft-service.js +1 -1
  303. package/dist/src/automations/index.js +2 -2
  304. package/dist/src/automations/mcp-source.js +2 -1
  305. package/dist/src/automations/service/action-executor.js +2 -2
  306. package/dist/src/automations/service/automation-service.js +2 -2
  307. package/dist/src/bootstrap/application-state.js +1 -1
  308. package/dist/src/browser/native-messaging-host.js +1 -1
  309. package/dist/src/capabilities/capability-catalog.js +4 -4
  310. package/dist/src/capabilities/runtime/dispatcher.d.ts +6 -0
  311. package/dist/src/capabilities/runtime/dispatcher.js +48 -13
  312. package/dist/src/capabilities/store-connector.js +1 -1
  313. package/dist/src/channels/attachments/inbound-persist.js +1 -0
  314. package/dist/src/channels/attachments/outbound-tts-persist.js +1 -0
  315. package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
  316. package/dist/src/channels/index.js +1 -1
  317. package/dist/src/channels/message-journal.js +2 -1
  318. package/dist/src/channels/outbound-sender.js +1 -1
  319. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  320. package/dist/src/channels/pairing/pairing-store.js +6 -6
  321. package/dist/src/chat-commands/agent-edit.js +1 -1
  322. package/dist/src/chat-commands/builtins/config.js +2 -2
  323. package/dist/src/chat-commands/builtins/session.js +1 -1
  324. package/dist/src/chat-commands/builtins/thinking.js +1 -1
  325. package/dist/src/chat-commands/builtins/tts.js +1 -1
  326. package/dist/src/chat-commands/index.js +3 -3
  327. package/dist/src/cli/cli-log-level-preset.js +5 -1
  328. package/dist/src/cli/commands/agent.js +7 -7
  329. package/dist/src/cli/commands/config.js +1 -1
  330. package/dist/src/cli/commands/connectors.js +1 -1
  331. package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
  332. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  333. package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
  334. package/dist/src/cli/commands/extension-dev.js +1 -1
  335. package/dist/src/cli/commands/extension.js +1 -1
  336. package/dist/src/cli/commands/image.js +1 -1
  337. package/dist/src/cli/commands/init.js +1 -1
  338. package/dist/src/cli/commands/mcp.js +45 -6
  339. package/dist/src/cli/commands/models.js +2 -2
  340. package/dist/src/cli/commands/onboard/model.js +1 -1
  341. package/dist/src/cli/commands/onboard.js +1 -1
  342. package/dist/src/cli/commands/project.js +1 -1
  343. package/dist/src/cli/commands/skills.js +1 -1
  344. package/dist/src/cli/commands/tunnel.js +4 -4
  345. package/dist/src/cli/extension-cli-register.js +5 -5
  346. package/dist/src/cli/index.js +9 -1
  347. package/dist/src/cli/utils/gateway-client.js +1 -1
  348. package/dist/src/cli/utils/init-workspace-core.js +1 -1
  349. package/dist/src/computer/flows.js +2 -1
  350. package/dist/src/computer/model-adapter.js +1 -1
  351. package/dist/src/computer/runtime.js +11 -11
  352. package/dist/src/config/config-file.js +1 -1
  353. package/dist/src/config/index.js +4 -4
  354. package/dist/src/config/loader.js +1 -1
  355. package/dist/src/config/models-json.js +2 -2
  356. package/dist/src/config/schema.d.ts +18 -0
  357. package/dist/src/config/schema.js +6 -0
  358. package/dist/src/connectors/cli/authorization.js +1 -1
  359. package/dist/src/connectors/composio-triggers.js +2 -1
  360. package/dist/src/connectors/connected-source-ingestion.js +2 -2
  361. package/dist/src/connectors/connected-source-understanding.js +5 -5
  362. package/dist/src/connectors/connection-recovery-service.js +4 -4
  363. package/dist/src/connectors/content-enrichment.js +1 -1
  364. package/dist/src/connectors/health.js +1 -1
  365. package/dist/src/discussions/live-worker.js +1 -1
  366. package/dist/src/discussions/sealer.js +1 -1
  367. package/dist/src/endpoint-tools/delegation.js +2 -1
  368. package/dist/src/endpoint-tools/device-capability-grants.js +2 -1
  369. package/dist/src/endpoint-tools/execution-actor.js +2 -1
  370. package/dist/src/endpoint-tools/folder-connections.js +2 -1
  371. package/dist/src/endpoint-tools/invocation-service.js +4 -3
  372. package/dist/src/endpoint-tools/provider-catalog.js +2 -1
  373. package/dist/src/endpoint-tools/provider-operation-status.js +2 -1
  374. package/dist/src/endpoint-tools/runtime.js +2 -1
  375. package/dist/src/endpoint-tools/target-resolver.js +1 -1
  376. package/dist/src/extensions/activation-context.js +3 -3
  377. package/dist/src/extensions/agent-plugins/auth.js +1 -1
  378. package/dist/src/extensions/agent-plugins/cli-authorization.js +1 -1
  379. package/dist/src/extensions/agent-plugins/credentials.js +1 -1
  380. package/dist/src/extensions/agent-plugins/setup.js +1 -1
  381. package/dist/src/extensions/agent-plugins/skill-catalog.js +3 -3
  382. package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
  383. package/dist/src/extensions/agent-plugins/user-config.js +1 -1
  384. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  385. package/dist/src/extensions/api.js +2 -2
  386. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  387. package/dist/src/extensions/index.js +1 -1
  388. package/dist/src/extensions/install.js +1 -1
  389. package/dist/src/extensions/loader.js +1 -1
  390. package/dist/src/extensions/sdk/index.js +1 -1
  391. package/dist/src/extensions/sdk/media.js +1 -1
  392. package/dist/src/files/workspace-file-spaces.d.ts +4 -0
  393. package/dist/src/files/workspace-file-spaces.js +14 -0
  394. package/dist/src/gateway/agent-reactions/reaction.js +3 -3
  395. package/dist/src/gateway/agents-admin.js +1 -1
  396. package/dist/src/gateway/device-routes.js +1 -1
  397. package/dist/src/gateway/file-path-classifier.js +1 -1
  398. package/dist/src/gateway/file-space-service.d.ts +1 -1
  399. package/dist/src/gateway/file-space-service.js +2 -8
  400. package/dist/src/gateway/global-defaults-admin.js +1 -1
  401. package/dist/src/gateway/hono/app.js +31 -10
  402. package/dist/src/gateway/hono/lib/config-payload.js +3 -3
  403. package/dist/src/gateway/hono/lib/extension-store.js +2 -1
  404. package/dist/src/gateway/hono/lib/mcp-dispatcher.d.ts +2 -0
  405. package/dist/src/gateway/hono/lib/mcp-dispatcher.js +19 -0
  406. package/dist/src/gateway/hono/oauth-async.js +1 -1
  407. package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
  408. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +6 -6
  409. package/dist/src/gateway/hono/routes/capability-operations.d.ts +1 -0
  410. package/dist/src/gateway/hono/routes/capability-operations.js +6 -3
  411. package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
  412. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  413. package/dist/src/gateway/hono/routes/device-connections.js +2 -2
  414. package/dist/src/gateway/hono/routes/device-targets.js +1 -1
  415. package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
  416. package/dist/src/gateway/hono/routes/home.js +1 -1
  417. package/dist/src/gateway/hono/routes/lazy-bundles.js +19 -0
  418. package/dist/src/gateway/hono/routes/local-app-capabilities.js +1 -1
  419. package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
  420. package/dist/src/gateway/hono/routes/mcp-bridge.d.ts +3 -0
  421. package/dist/src/gateway/hono/routes/mcp-bridge.js +87 -0
  422. package/dist/src/gateway/hono/routes/mcp-remote.d.ts +3 -0
  423. package/dist/src/gateway/hono/routes/mcp-remote.js +169 -0
  424. package/dist/src/gateway/hono/routes/mcp.js +1 -1
  425. package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
  426. package/dist/src/gateway/hono/routes/mobile-capability-actions.js +5 -5
  427. package/dist/src/gateway/hono/routes/mobile-capability-panels.js +13 -13
  428. package/dist/src/gateway/hono/routes/mobile-model-settings.js +3 -3
  429. package/dist/src/gateway/hono/routes/models.js +5 -5
  430. package/dist/src/gateway/hono/routes/music-generation.js +1 -1
  431. package/dist/src/gateway/hono/routes/notes.js +2 -2
  432. package/dist/src/gateway/hono/routes/personal-agent.js +3 -2
  433. package/dist/src/gateway/hono/routes/phone-setup.js +4 -4
  434. package/dist/src/gateway/hono/routes/phone.js +3 -3
  435. package/dist/src/gateway/hono/routes/projects.js +5 -5
  436. package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
  437. package/dist/src/gateway/hono/routes/session-input-handler.js +3 -3
  438. package/dist/src/gateway/hono/routes/sessions.js +3 -3
  439. package/dist/src/gateway/hono/routes/shares.js +2 -2
  440. package/dist/src/gateway/hono/routes/side-chats.js +1 -1
  441. package/dist/src/gateway/hono/routes/tui.js +1 -1
  442. package/dist/src/gateway/hono/routes/user-model.js +7 -7
  443. package/dist/src/gateway/hono/routes/video-generation.js +1 -1
  444. package/dist/src/gateway/hono/routes/voice.js +6 -6
  445. package/dist/src/gateway/image-generation-setup.js +1 -1
  446. package/dist/src/gateway/lock.js +11 -11
  447. package/dist/src/gateway/media-access.js +2 -2
  448. package/dist/src/gateway/mobile-privacy.js +2 -2
  449. package/dist/src/gateway/ports.js +6 -6
  450. package/dist/src/gateway/provider-model-setup.js +1 -1
  451. package/dist/src/gateway/server.js +1 -1
  452. package/dist/src/gateway/service/agent-runner.js +11 -6
  453. package/dist/src/gateway/service/config-coordinator.d.ts +9 -0
  454. package/dist/src/gateway/service/config-coordinator.js +2 -2
  455. package/dist/src/gateway/service/marketplace-service.js +2 -2
  456. package/dist/src/gateway/service/run-gateway-agent.js +5 -5
  457. package/dist/src/gateway/service/session-command-service.js +2 -2
  458. package/dist/src/gateway/service/session-input-coordinator.d.ts +1 -0
  459. package/dist/src/gateway/service/session-input-coordinator.js +31 -3
  460. package/dist/src/gateway/service/sessions-api.js +1 -1
  461. package/dist/src/gateway/service.d.ts +4 -0
  462. package/dist/src/gateway/service.js +65 -38
  463. package/dist/src/gateway/session-context-summary.js +1 -1
  464. package/dist/src/gateway/workspace-editor-path.js +2 -2
  465. package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
  466. package/dist/src/home-intelligence/follow-ups.js +1 -1
  467. package/dist/src/home-intelligence/generator.js +2 -2
  468. package/dist/src/home-intelligence/observation.js +1 -1
  469. package/dist/src/home-intelligence/routines.js +2 -2
  470. package/dist/src/imports/importService.js +1 -1
  471. package/dist/src/imports/inventory.js +2 -2
  472. package/dist/src/imports/productImport.js +1 -1
  473. package/dist/src/infra/bus/queue.js +1 -1
  474. package/dist/src/infra/gateway-processes.js +2 -2
  475. package/dist/src/infra/path-env.js +3 -3
  476. package/dist/src/infra/update-global.js +9 -9
  477. package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
  478. package/dist/src/knowledge/index.js +1 -1
  479. package/dist/src/knowledge-memory/repository.js +1 -1
  480. package/dist/src/knowledge-memory/usage-policy.js +1 -1
  481. package/dist/src/local-apps/access-audit.js +2 -1
  482. package/dist/src/local-apps/automation-proposals.js +2 -1
  483. package/dist/src/local-apps/capabilities/automation-policy.js +2 -1
  484. package/dist/src/local-apps/capabilities/delegate.js +3 -2
  485. package/dist/src/local-apps/execution-authority.js +4 -3
  486. package/dist/src/local-apps/p1-services.js +4 -3
  487. package/dist/src/local-apps/public-assets.js +2 -1
  488. package/dist/src/local-apps/service.js +3 -2
  489. package/dist/src/local-apps/store.js +2 -1
  490. package/dist/src/mcp/callback-config.d.ts +5 -0
  491. package/dist/src/mcp/callback-config.js +16 -0
  492. package/dist/src/mcp/capability-server.d.ts +1 -2
  493. package/dist/src/mcp/capability-server.js +34 -79
  494. package/dist/src/mcp/connection-grants.d.ts +15 -0
  495. package/dist/src/mcp/connection-grants.js +73 -0
  496. package/dist/src/mcp/delegation.d.ts +329 -0
  497. package/dist/src/mcp/delegation.js +610 -0
  498. package/dist/src/mcp/gateway-http-client.d.ts +2 -2
  499. package/dist/src/mcp/gateway-http-client.js +5 -5
  500. package/dist/src/mcp/product-tools.d.ts +7 -0
  501. package/dist/src/mcp/product-tools.js +292 -0
  502. package/dist/src/mcp/remote-auth.d.ts +8 -0
  503. package/dist/src/mcp/remote-auth.js +51 -0
  504. package/dist/src/mcp/remote-config.d.ts +11 -0
  505. package/dist/src/mcp/remote-config.js +31 -0
  506. package/dist/src/mcp/remote-grants.d.ts +20 -0
  507. package/dist/src/mcp/remote-grants.js +60 -0
  508. package/dist/src/mcp/run-callbacks.d.ts +9 -0
  509. package/dist/src/mcp/run-callbacks.js +138 -0
  510. package/dist/src/mcp/tool-contract.d.ts +30 -0
  511. package/dist/src/mcp/tool-contract.js +81 -0
  512. package/dist/src/mcp/workspace-search.d.ts +16 -0
  513. package/dist/src/mcp/workspace-search.js +68 -0
  514. package/dist/src/media/index.js +4 -1
  515. package/dist/src/media/media-reference.js +2 -1
  516. package/dist/src/media/session-references.js +4 -2
  517. package/dist/src/media/store.js +2 -1
  518. package/dist/src/media/uri.js +17 -12
  519. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  520. package/dist/src/memory-learning/choice-observations.js +7 -7
  521. package/dist/src/memory-learning/source-learning.js +5 -5
  522. package/dist/src/memory-learning/task-receipts.js +1 -1
  523. package/dist/src/memory-learning/work-capture.js +1 -1
  524. package/dist/src/memory-learning/work-review.js +3 -3
  525. package/dist/src/music-generation/artifact.js +3 -2
  526. package/dist/src/music-generation/settings.js +2 -1
  527. package/dist/src/music-generation/worker.js +1 -1
  528. package/dist/src/notes/agent-context.js +4 -4
  529. package/dist/src/notes/capabilities/write.js +2 -1
  530. package/dist/src/notes/service.js +1 -1
  531. package/dist/src/personal-agent/capability-service.js +1 -1
  532. package/dist/src/personal-agent/proactivity/repository.js +2 -1
  533. package/dist/src/personal-agent/proactivity/routes.js +1 -1
  534. package/dist/src/personal-agent/proactivity/service.js +7 -6
  535. package/dist/src/personal-agent/prompt-context.js +4 -4
  536. package/dist/src/personal-agent/prompts.js +1 -1
  537. package/dist/src/personal-agent/reply-composer.js +9 -9
  538. package/dist/src/personal-agent/reply-result.js +4 -2
  539. package/dist/src/personal-agent/request-delivery.js +1 -1
  540. package/dist/src/personal-agent/request-service.js +4 -4
  541. package/dist/src/personal-agent/result-reader.js +1 -1
  542. package/dist/src/personal-agent/service.js +2 -2
  543. package/dist/src/personal-agent/task-cancel.js +1 -1
  544. package/dist/src/phone/adb-driver.js +1 -1
  545. package/dist/src/phone/assistance.js +2 -1
  546. package/dist/src/phone/cloud-adb-connection.js +1 -1
  547. package/dist/src/phone/location-environment.js +2 -1
  548. package/dist/src/phone/model-adapter.js +1 -1
  549. package/dist/src/phone/repository.js +2 -1
  550. package/dist/src/phone/runtime.js +4 -4
  551. package/dist/src/phone/setup/service.js +2 -1
  552. package/dist/src/projects/index.js +2 -2
  553. package/dist/src/projects/project-service.js +2 -2
  554. package/dist/src/projects/workspace.js +1 -1
  555. package/dist/src/providers/model-catalog-persistence.js +1 -1
  556. package/dist/src/providers/model-reference-auditor.js +1 -1
  557. package/dist/src/providers/model-registry.js +1 -1
  558. package/dist/src/remote-access/exposure-manager.js +1 -1
  559. package/dist/src/session/history-recall-policy.js +2 -2
  560. package/dist/src/session/index.js +2 -2
  561. package/dist/src/session/session-title.js +1 -1
  562. package/dist/src/session/store.js +10 -9
  563. package/dist/src/session/thinking-resolve.js +1 -1
  564. package/dist/src/share/hosted-session-share.js +2 -1
  565. package/dist/src/share/note-share-revocation.js +2 -1
  566. package/dist/src/share/share-store.js +2 -1
  567. package/dist/src/share/share-thumbnail.js +1 -1
  568. package/dist/src/share/site-proxy.js +1 -1
  569. package/dist/src/share/site-share-store.js +2 -1
  570. package/dist/src/space/ingest.js +2 -1
  571. package/dist/src/space/repository.js +1 -1
  572. package/dist/src/space/workbook-proposals.js +2 -1
  573. package/dist/src/space/workbook-turn.js +2 -1
  574. package/dist/src/space/worker.js +2 -1
  575. package/dist/src/storage/sqlite/connection.js +9 -9
  576. package/dist/src/storage/sqlite/durable-state.js +43 -39
  577. package/dist/src/storage/sqlite/session-input-control-repository.js +2 -1
  578. package/dist/src/storage/sqlite/session-input-repository.js +7 -5
  579. package/dist/src/tasks/capabilities/read.js +4 -3
  580. package/dist/src/tasks/capabilities/relations.js +1 -1
  581. package/dist/src/tasks/capabilities/runs.d.ts +101 -0
  582. package/dist/src/tasks/capabilities/runs.js +42 -35
  583. package/dist/src/tasks/capabilities/write.js +5 -4
  584. package/dist/src/tasks/delegated-run-result.d.ts +16 -0
  585. package/dist/src/tasks/delegated-run-result.js +47 -0
  586. package/dist/src/tasks/home-query-service.js +1 -1
  587. package/dist/src/tasks/index.js +6 -6
  588. package/dist/src/tasks/task-allocation-service.js +6 -6
  589. package/dist/src/tasks/task-application-service.d.ts +5 -0
  590. package/dist/src/tasks/task-application-service.js +8 -4
  591. package/dist/src/tasks/task-context-assembler.js +8 -5
  592. package/dist/src/tasks/task-contract-planner.js +2 -2
  593. package/dist/src/tasks/task-deliverables.js +19 -14
  594. package/dist/src/tasks/task-delivery-checks.js +1 -1
  595. package/dist/src/tasks/task-execution-capabilities.js +1 -1
  596. package/dist/src/tasks/task-handoff-service.js +1 -1
  597. package/dist/src/tasks/task-handoff.d.ts +16 -3
  598. package/dist/src/tasks/task-handoff.js +165 -145
  599. package/dist/src/tasks/task-json-acceptance.js +4 -3
  600. package/dist/src/tasks/task-main-update-decision-service.js +2 -2
  601. package/dist/src/tasks/task-main-update-delivery.js +1 -1
  602. package/dist/src/tasks/task-model-call.js +1 -1
  603. package/dist/src/tasks/task-repository.js +3 -0
  604. package/dist/src/tasks/task-research-repair.js +2 -1
  605. package/dist/src/tasks/task-research-result.js +3 -3
  606. package/dist/src/tasks/task-result-delivery-service.js +4 -3
  607. package/dist/src/tasks/task-retry-service.js +1 -1
  608. package/dist/src/tasks/task-run-coordinator.js +8 -7
  609. package/dist/src/tasks/task-run-dispatcher.js +2 -2
  610. package/dist/src/tasks/task-run-repository.d.ts +2 -1
  611. package/dist/src/tasks/task-run-repository.js +9 -4
  612. package/dist/src/tui/backend-services.js +1 -1
  613. package/dist/src/tui/backends/embedded-backend.js +13 -13
  614. package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
  615. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  616. package/dist/src/tui/tui-capabilities.js +2 -2
  617. package/dist/src/tui/tui-commands.js +3 -3
  618. package/dist/src/tui/tui-management.js +8 -8
  619. package/dist/src/tui/tui-picker-overlay.js +1 -1
  620. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  621. package/dist/src/tui/tui-startup-resources.js +3 -3
  622. package/dist/src/tui/tui.js +6 -6
  623. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  624. package/dist/src/user-context/access-policy.js +2 -2
  625. package/dist/src/user-model/bootstrap.js +1 -1
  626. package/dist/src/user-model/capture/executor.js +2 -2
  627. package/dist/src/user-model/index.js +2 -2
  628. package/dist/src/user-model/usage-policy.js +1 -1
  629. package/dist/src/video-generation/artifact.js +3 -2
  630. package/dist/src/video-generation/drafts.js +2 -1
  631. package/dist/src/video-generation/repository.js +2 -1
  632. package/dist/src/video-generation/settings.js +2 -1
  633. package/dist/src/video-generation/worker.js +1 -1
  634. package/dist/src/voice/realtime/conversation-context.js +2 -2
  635. package/dist/src/voice/realtime/memory-context.js +4 -4
  636. package/dist/src/voice/realtime/omniRoute.js +1 -1
  637. package/dist/src/voice/realtime/runtime.js +3 -3
  638. package/dist/src/voice/realtime/user-context.js +1 -1
  639. package/dist/src/voice/stt/index.js +2 -2
  640. package/dist/src/voice/stt/preflight.js +1 -1
  641. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  642. package/dist/src/voice/stt/providers/bailian-plan-transcription.js +1 -1
  643. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  644. package/dist/src/voice/stt/transcribe-core.js +1 -1
  645. package/dist/src/voice/tts/index.js +3 -3
  646. package/dist/src/voice/tts/merge-config.js +1 -1
  647. package/dist/src/voice/tts/payload.js +1 -1
  648. package/dist/src/voice/tts/providers/bailian-plan-speech.js +1 -1
  649. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  650. package/dist/src/voice/tts/speak-core.js +2 -2
  651. package/dist/src/work-discovery/service.js +6 -6
  652. package/package.json +3 -1
  653. package/dist/gateway/static/root/assets/block-editor-Cvy3D_4T.css +0 -1
  654. package/dist/gateway/static/root/assets/confirm-dialog-MHCmEEUZ.js +0 -1
  655. package/dist/gateway/static/root/assets/gateway-realtime-store-CTWm23Qi.js +0 -1
  656. package/dist/gateway/static/root/assets/index-B_TGvH_k.css +0 -1
  657. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-DlGDLJI2.js +0 -1
  658. package/dist/gateway/static/root/assets/messages-C7QSnTdg.js +0 -3
  659. package/dist/gateway/static/root/assets/note-detail-panel-uc-5k3a2.js +0 -7
  660. package/dist/gateway/static/root/assets/note-image-lightbox-Bvjumefe.js +0 -1
  661. package/dist/gateway/static/root/assets/product-automation-feedback-DdFoCDzG.js +0 -1
  662. package/dist/gateway/static/root/assets/recording-upload-plrQDkLa.js +0 -1
  663. package/dist/gateway/static/root/assets/settings-advanced-gate-Cq4HDQu2.js +0 -1
  664. package/dist/gateway/static/root/assets/voice-input-shortcut-events-DN-_rY5a.js +0 -1
  665. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CX8zX9eZ.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-DWZCzxY7.js","assets/rolldown-runtime-aKtaBQYM.js","assets/marked.esm-8VXEA2AD.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-DIIvxCDx.js","assets/locale-store-CHjsq5NR.js","assets/messages-C7QSnTdg.js","assets/dist-DlirbHVs.js","assets/es2015-CFqg57eW.js","assets/dist-CDSvxjOh.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/archive-Dz0hferG.js","assets/arrow-left-D880xG-P.js","assets/video-generation-Cec49Jwg.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-DdFoCDzG.js","assets/activity-YogQEteU.js","assets/bot-DjLkhyZL.js","assets/circle-check-C23XjkUj.js","assets/circle-pause-CN9jYH2s.js","assets/clock-3-DnrAnuyZ.js","assets/external-link-DjqjBmc3.js","assets/loader-circle-CifKLtgG.js","assets/message-square-fVE7Ghj1.js","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/rotate-ccw-JM1TBLpp.js","assets/rotate-cw-LIg3Am9S.js","assets/sparkles-DHlfQFAF.js","assets/triangle-alert-2JXFNNKU.js","assets/volume-2-BSJhAY97.js","assets/zap-dximCGjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/session-manager-C2MCS4C5.js","assets/schemas-CCWMleym.js","assets/turn-outcome-Dtw6OgwL.js","assets/product-delivery-4gEqUIsK.js","assets/session-api-CR3NLqvs.js","assets/gateway-startup-retry-DgmvR-hb.js","assets/local-session-drafts-CGSV1RQg.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BPYdUI6y.js","assets/agent-run-error-parser-DsXmcKt-.js","assets/gateway-realtime-CoIFB3im.js","assets/gateway-realtime-store-CTWm23Qi.js","assets/playback-coordinator-CWHIf0wr.js","assets/registry-api-CDpUAb2R.js","assets/agents-admin-api-DSr-PWuW.js","assets/gateway-config-swr-BD-ams0X.js","assets/vendor-swr-CdRzEUwF.js","assets/button-C5tRaJxt.js","assets/automation-api-D-gn6x5E.js","assets/earth-C9Z4bTTG.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/working-directory-picker-modal-DgM21YVT.js","assets/file-archive-DanfQJNe.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/settings-form-draft-Dy10ldo8.js","assets/popover-select-hRG1EzAY.js","assets/skeleton-DzdOeGYz.js","assets/dist-BSVQC3i_.js","assets/dist-DSRLZhL9.js","assets/floating-ui.dom-CiMnRY5O.js","assets/floating-ui.react-dom-Gx6CM22l.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-alert-BEjgurr2.js","assets/send-1f1Ntw6E.js","assets/circle-x-DFsCKeya.js","assets/circle-BoO4YvTx.js","assets/file-tree-utils-DJs1faGv.js","assets/copy-Dv6d4Dvw.js","assets/database-CjjeZfRG.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/file-code-corner-byQA1VfD.js","assets/file-image-CDUPkZvG.js","assets/file-text-D12HbeVy.js","assets/file-CStvVK2S.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-open-CyzJ19I9.js","assets/folder-CN-pC3XL.js","assets/git-branch-Dh9uxTot.js","assets/globe-DSSGFWFn.js","assets/history-DXH_9jsE.js","assets/notes-api-D5SvfybU.js","assets/markdown-view-ihzUc4ud.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/app-link-Ji4uewEG.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-Czi3_WHu.css","assets/chat-chart-block-B83s8HE9.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/link-2-D_ZKYUW7.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/mic-CuUb7zc-.js","assets/monitor-Af5eAvF7.js","assets/use-generated-media-CzRbgtcv.js","assets/install-connector-dialog-CntHi8Rh.js","assets/secret-input-DsjfQmDn.js","assets/eye-CABVeTq0.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-CRGq-TSw.js","assets/electron-env-DHOGevH3.js","assets/oauth-provider-connect-DGYky6ut.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-BrD6r5Qs.js","assets/oauth-api-DnMpUoyx.js","assets/connection-usage-guide-B9hoSOnN.js","assets/connection-usage-BhdQRWgQ.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/pin-off-BMRv-Kxr.js","assets/refresh-cw-BRlGaq2w.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/settings-2-D-csvaET.js","assets/settings-uiTATseT.js","assets/share-2-CnIB9PsV.js","assets/shield-check-BU58siTV.js","assets/smartphone-DSSsQFqA.js","assets/square-DMK_fB-3.js","assets/preview-runtime-FtWOW5i4.js","assets/use-async-resource-BHFGZCY2.js","assets/workspace-api-CQOuWbVv.js","assets/files-GdwDamkp.js","assets/index.module-Cd9ENXfk.js","assets/trash-2-DusmjVPV.js","assets/user-round-C9jxPhMR.js","assets/wifi-off-C35sMFUl.js","assets/share-link-dialog-2JjvWs0q.js","assets/copy-text-row-gqdh0Bg1.js","assets/wrench-DFb4r8bH.js","assets/tasks-CvOAtEHv.js","assets/specialists-xbB3xL9e.js","assets/api-CGrHK9ij.js","assets/session-identity-DRFdxntH.js","assets/new-session-preferences-gb411vZP.js","assets/composer-model-config-control-C2Bku39S.js","assets/model-selector-QFZY5XNN.js","assets/open-capability-settings-DQsmJxI7.js","assets/model-sort-_Tz8s_4N.js","assets/cloud-credits-B-nbtkqv.js","assets/space-api-_uKFiASp.js","assets/home-task-actions-_ZAc57Y7.js","assets/capabilities-DZrjA95P.js","assets/capabilities-CW-vdkz6.js","assets/right-workspace-store-Cehybf-G.js","assets/phone-workspace-store-DGaibcsi.js","assets/workspace-editor-agent-store-CX8zX9eZ.js","assets/chat-agents-api-CyvBfBbp.js","assets/middleware-Pd0e8Igk.js","assets/task-copy-CtcqCQ78.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/linkify-it-BkqEorO0.js","assets/tool-friendly-title-CJVFJ2Ud.js","assets/use-realtime-voice-CV3GIt_T.js","assets/voice-CUfqdnlR.js","assets/composer-notifications-MGKffwC7.js","assets/activity-store-hSe5Nbgk.js","assets/voice-call-context-BM2A4bLz.js","assets/app-chrome-BeB4KgOf.js","assets/page-header-store-NP7MCIaP.js","assets/new-chat-navigation-spnin196.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/extension-provider-D8_mIBI0.js","assets/theme-store-CvG266p8.js","assets/extension-message-router-B4I-Y6qs.js","assets/agent-avatar-display-D_UDgOr9.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/composer-handoff-params-DBpzHuNo.js","assets/agent-display-names-Bje7vfSn.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-MHCmEEUZ.js","assets/shares-api-BhWvN3LS.js","assets/dist-DaFr5KMw.js","assets/use-composer-attachments-BEuyorVm.js","assets/chevron-left-DqFhpbvK.js","assets/use-file-preview-expanded-Cehu0745.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/constants-D5Z-mUto.js","assets/sliding-tab-list-CmcrqRzN.js","assets/sliding-indicator-hwz0sx3h.js","assets/use-share-link-WKZLlEqr.js","assets/file-preview-surface-Da1xZiG6.js","assets/command-palette-api-UrqPvWR1.js","assets/skill-list-api-B26hHnXq.js","assets/skill-api-utils-C7V4JVXM.js","assets/composer-payload-handoff-a0quQ25p.js","assets/voice-input-shortcut-events-DN-_rY5a.js","assets/automation-task-card-C453Q-Wa.js","assets/automation-display-DaVDNZz8.js","assets/message-circle-Badhj-4D.js","assets/date-picker-DwITf4I2.js","assets/calendar-days-hw_Y-g-s.js","assets/time-picker-otHjbob1.js","assets/dev-view-store-DsjH8x76.js","assets/extension-iframe-host-CJV5JETm.js","assets/extension-authoritative-grants-DYp2nNol.js","assets/runtime-health-zDkHcOZO.js","assets/api-B3T06TLl.js","assets/terminal-panel-store-Cy90Ix5U.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-Bk7jVvAG.js","assets/management-api-FVu7eYXD.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{_ as a,f as o,t as s}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a as c,i as l,l as u,n as d}from"./locale-store-CHjsq5NR.js";import{t as f}from"./messages-C7QSnTdg.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-DlirbHVs.js";import{t as y}from"./activity-YogQEteU.js";import{t as b}from"./arrow-left-D880xG-P.js";import{a as x,c as S,f as C,i as ee,l as w,n as T,o as E,r as D,s as O,t as k,u as A}from"./automation-display-DaVDNZz8.js";import{i as j,n as M,r as N,t as P}from"./automation-run-list-CM59-qm5.js";import{t as F}from"./check-DUBLcKHA.js";import{t as te}from"./chevron-down-ccbiQQz_.js";import{t as ne}from"./chevron-right-BweFrslA.js";import{n as I,r as L}from"./popover-select-hRG1EzAY.js";import{t as re}from"./circle-alert-BEjgurr2.js";import{t as ie}from"./circle-check-C23XjkUj.js";import{t as R}from"./copy-Dv6d4Dvw.js";import{t as z}from"./ellipsis-0k4rZLoy.js";import{t as ae}from"./eye-CABVeTq0.js";import{t as B}from"./git-branch-Dh9uxTot.js";import{t as V}from"./list-filter-CIPvpfLA.js";import{t as H}from"./loader-circle-CifKLtgG.js";import{t as oe}from"./markdown-view-ihzUc4ud.js";import{t as se}from"./message-circle-Badhj-4D.js";import{t as ce}from"./pause-DuPxgSxk.js";import{t as U}from"./pencil-DmIY3Oa-.js";import{t as le}from"./play-kxZvpBg8.js";import{t as W}from"./plus-Q2yW6OE7.js";import{t as G}from"./refresh-cw-BRlGaq2w.js";import{t as K}from"./search-DA7gz22f.js";import{t as ue}from"./shield-check-BU58siTV.js";import{t as de}from"./sparkles-DHlfQFAF.js";import{t as fe}from"./square-pen-B8FsvqNu.js";import{t as pe}from"./trash-2-DusmjVPV.js";import{t as me}from"./x-B_N4OPjy.js";import{t as he}from"./zap-dximCGjy.js";import{t as q}from"./cn-0WouolD0.js";import{t as J}from"./skeleton-DzdOeGYz.js";import{d as ge}from"./api-CGrHK9ij.js";import{a as _e}from"./session-api-CR3NLqvs.js";import{k as ve}from"./session-manager-C2MCS4C5.js";import{a as ye,i as be,o as xe}from"./vendor-swr-CdRzEUwF.js";import{t as Se}from"./chat-agents-api-CyvBfBbp.js";import{t as Ce}from"./button-C5tRaJxt.js";import{t as we}from"./page-header-store-NP7MCIaP.js";import{t as Y}from"./automation-api-D-gn6x5E.js";import{n as Te}from"./agent-display-names-Bje7vfSn.js";import{t as X}from"./sliding-tab-list-CmcrqRzN.js";import{t as Ee}from"./refresh-button-DX7bULU5.js";import{a as De,c as Oe,d as ke,f as Ae,i as je,l as Me,m as Ne,o as Pe,p as Fe,r as Ie,s as Le,t as Re,u as ze}from"./dist-DaFr5KMw.js";import{n as Be}from"./model-selector-QFZY5XNN.js";import{a as Ve,c as He,d as Ue,f as We,h as Z,l as Ge,m as Ke,n as qe,o as Je,p as Ye,r as Xe,s as Ze,u as Qe}from"./automation-task-card-C453Q-Wa.js";import{t as $e}from"./time-picker-otHjbob1.js";import{t as et}from"./date-time-picker-ChG1CqR1.js";import{i as tt,n as nt,r as rt,t as it}from"./automation-result-state-B7hq0XOL.js";import{n as at}from"./routine-panel-n4IstC8Y.js";var ot=n(),Q=e(t(),1),$=r(),st=(0,Q.lazy)(()=>i(()=>import(`./chat-page-DWZCzxY7.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221])));function ct(e){let t=(0,ot.c)(110),{runId:n,automationId:r,projectId:i,language:a,onConfigure:o,onDetails:s,onBack:c}=e,l=a===`zh`,[u,d]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>g(e),t[0]=_):_=t[0];let v=_,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(!0),t[1]=y):y=t[1];let x=y,{mutate:S}=ye(),C=(0,Q.useRef)(!1),ee=i??``,w;t[2]!==r||t[3]!==n||t[4]!==ee?(w=[`automation-execution`,r,n,ee],t[2]=r,t[3]=n,t[4]=ee,t[5]=w):w=t[5];let T;t[6]!==r||t[7]!==i||t[8]!==n||t[9]!==l?(T=async()=>{let{run:e}=await Y.getRun(n);if(e.automationId!==r)throw Error(l?`执行记录不属于此自动化`:`Execution does not belong to this automation`);let{automation:t}=await Y.get(r);if(i&&t.projectId!==i)throw Error(l?`执行记录不属于此项目`:`Execution does not belong to this project`);return{run:e,automation:t}},t[6]=r,t[7]=i,t[8]=n,t[9]=l,t[10]=T):T=t[10];let E;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(E={refreshInterval:dt,shouldRetryOnError:!1},t[11]=E):E=t[11];let{data:D,error:O,mutate:k}=be(w,T,E),A=D?.run,j=A?.conversationId,N;t[12]===j?N=t[13]:(N=e=>!!(j&&(e.sessions[j]?.streaming||e.sessions[j]?.sending)),t[12]=j,t[13]=N);let P=ve(N),F;t[14]===j?F=t[15]:(F=j?[`automation-execution-session`,j]:null,t[14]=j,t[15]=F);let te;t[16]===j?te=t[17]:(te=()=>_e(j),t[16]=j,t[17]=te);let ne;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ne={shouldRetryOnError:!1},t[18]=ne):ne=t[18];let{data:I,error:L,mutate:re}=be(F,te,ne),ie=A?.conversationShared||D?.automation.conversationMode===`continuous`||I?.customData?.latestAutomationRunId!==void 0&&I.customData.latestAutomationRunId!==n,R=!!(I&&(!ie||u)),z=!O&&!!(A&&(!j||ie&&!u&&I&&!L&&(A?.summary||A?.error)||I&&!L&&p)),ae,B;if(t[19]!==z||t[20]!==k||t[21]!==S||t[22]!==A?(ae=()=>{!A||!z||M(A)||A.readAtMs!=null||C.current||(C.current=!0,Y.markRunRead(A.id).then(async()=>{await Promise.all([k(),S(ut)])}).catch(lt).finally(()=>{C.current=!1}))},B=[A,z,k,S],t[19]=z,t[20]=k,t[21]=S,t[22]=A,t[23]=ae,t[24]=B):(ae=t[23],B=t[24]),(0,Q.useEffect)(ae,B),O){let e=O instanceof Error?O.message:l?`执行记录加载失败`:`Could not load execution`,n;t[25]===e?n=t[26]:(n=(0,$.jsx)(`p`,{children:e}),t[25]=e,t[26]=n);let r;t[27]===k?r=t[28]:(r=()=>void k(),t[27]=k,t[28]=r);let i=l?`重试`:`Retry`,a;t[29]!==r||t[30]!==i?(a=(0,$.jsx)(Ce,{onClick:r,children:i}),t[29]=r,t[30]=i,t[31]=a):a=t[31];let o=l?`返回自动化`:`Back to automation`,s;t[32]!==c||t[33]!==o?(s=(0,$.jsx)(Ce,{onClick:c,children:o}),t[32]=c,t[33]=o,t[34]=s):s=t[34];let u;return t[35]!==n||t[36]!==a||t[37]!==s?(u=(0,$.jsxs)(`section`,{role:`alert`,className:`space-y-3 p-5`,children:[n,a,s]}),t[35]=n,t[36]=a,t[37]=s,t[38]=u):u=t[38],u}if(!A){let e;return t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-4 p-5`,"aria-busy":`true`,children:[(0,$.jsx)(J,{className:`h-6 w-2/3`}),(0,$.jsx)(J,{className:`h-20`})]}),t[39]=e):e=t[39],e}let V;t[40]===A?V=t[41]:(V=M(A),t[40]=A,t[41]=V);let H=V,se=l?`执行会话`:`Execution conversation`,ce=l?`返回自动化`:`Back to automation`,U;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(b,{className:`size-4`}),t[42]=U):U=t[42];let le;t[43]!==c||t[44]!==ce?(le=(0,$.jsx)(Ce,{variant:`ghost`,className:`shrink-0`,onClick:c,"aria-label":ce,children:U}),t[43]=c,t[44]=ce,t[45]=le):le=t[45];let W;t[46]===A.automationName?W=t[47]:(W=(0,$.jsx)(`h2`,{className:`truncate text-sm font-medium text-fg`,children:A.automationName}),t[46]=A.automationName,t[47]=W);let G;t[48]!==le||t[49]!==W?(G=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[le,W]}),t[48]=le,t[49]=W,t[50]=G):G=t[50];let K;t[51]!==A.createdAtMs||t[52]!==l?(K=new Date(A.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[51]=A.createdAtMs,t[52]=l,t[53]=K):K=t[53];let ue;t[54]===a?ue=t[55]:(ue=f(a),t[54]=a,t[55]=ue);let de=ue.automations.status[A.status],fe;t[56]!==K||t[57]!==de?(fe=(0,$.jsxs)(`span`,{children:[K,` · `,de]}),t[56]=K,t[57]=de,t[58]=fe):fe=t[58];let pe;t[59]!==s||t[60]!==A.id?(pe=()=>s(A.id),t[59]=s,t[60]=A.id,t[61]=pe):pe=t[61];let me=l?`运行详情`:`Run details`,he;t[62]!==pe||t[63]!==me?(he=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:pe,children:me}),t[62]=pe,t[63]=me,t[64]=he):he=t[64];let q;t[65]!==o||t[66]!==A?(q=()=>o(A),t[65]=o,t[66]=A,t[67]=q):q=t[67];let ge=l?`调整自动化`:`Adjust automation`,xe;t[68]!==q||t[69]!==ge?(xe=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:q,children:ge}),t[68]=q,t[69]=ge,t[70]=xe):xe=t[70];let Se;t[71]!==fe||t[72]!==he||t[73]!==xe?(Se=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[fe,he,xe]}),t[71]=fe,t[72]=he,t[73]=xe,t[74]=Se):Se=t[74];let we;t[75]!==D?.automation||t[76]!==ie||t[77]!==l?(we=ie?(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[l?`多次执行可能共用此会话;下方摘要对应所选执行。`:`Executions may share this conversation. The summary belongs to the selected execution.`,D?.automation.conversationMode===`continuous`?l?`追问会进入后续运行上下文。`:` Follow-ups become context for future runs.`:null]}):null,t[75]=D?.automation,t[76]=ie,t[77]=l,t[78]=we):we=t[78];let Te;t[79]!==h||t[80]!==u||t[81]!==l?(Te=u?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:h===!0?l?`已定位到所选执行的会话起点。`:`Located the selected execution in this conversation.`:h===!1?l?`旧记录缺少可用的执行定位信息,当前显示完整会话。`:`No matching turn was found in the available history. Showing the full conversation.`:l?`正在定位所选执行…`:`Locating the selected execution…`}):null,t[79]=h,t[80]=u,t[81]=l,t[82]=Te):Te=t[82];let X;t[83]!==H||t[84]!==l?(X=H?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`执行中,完成后可继续追问。`:`Execution in progress. Follow up after it finishes.`}):null,t[83]=H,t[84]=l,t[85]=X):X=t[85];let Ee;t[86]!==G||t[87]!==Se||t[88]!==we||t[89]!==Te||t[90]!==X?(Ee=(0,$.jsxs)(`header`,{className:`shrink-0 space-y-2 border-b border-edge px-4 py-3`,children:[G,Se,we,Te,X]}),t[86]=G,t[87]=Se,t[88]=we,t[89]=Te,t[90]=X,t[91]=Ee):Ee=t[91];let De;t[92]!==H||t[93]!==j||t[94]!==P||t[95]!==I||t[96]!==a||t[97]!==re||t[98]!==A.error||t[99]!==A.id||t[100]!==A.summary||t[101]!==L||t[102]!==ie||t[103]!==R||t[104]!==l?(De=R?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(J,{className:`m-5 h-40`}),children:(0,$.jsx)(st,{embedded:!0,automationExecution:!0,conversationId:j,readOnly:H||P,onHistoryReady:x,initialTurnId:ie?A.id:void 0,onInitialTurnLocated:v},j)}):(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[A.summary?(0,$.jsx)(oe,{content:A.summary}):null,A.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-danger`,children:A.error}):null,j?null:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:H?l?`等待执行会话,开始后会自动更新。`:`Waiting for the execution conversation. This view updates automatically.`:l?`本次执行没有关联会话,可查看运行结果和详情。`:`No conversation is associated with this execution. Results and diagnostics remain available.`}),j&&!I&&!L?(0,$.jsx)(J,{className:`h-24`}):null,L?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:L.status===404?l?`执行会话已删除,运行结果仍保留。`:`The execution conversation was deleted. Results are still available.`:l?`执行会话暂时无法读取,运行结果仍保留。`:`The conversation is unavailable. Results are still available.`}),(0,$.jsx)(Ce,{onClick:()=>void re(),children:l?`重试`:`Retry`})]}):null,ie&&I?(0,$.jsx)(Ce,{variant:`secondary`,onClick:()=>d(!0),children:l?`打开共享会话`:`Open shared conversation`}):null,H?null:(0,$.jsx)(tt,{runId:A.id,language:a})]}),t[92]=H,t[93]=j,t[94]=P,t[95]=I,t[96]=a,t[97]=re,t[98]=A.error,t[99]=A.id,t[100]=A.summary,t[101]=L,t[102]=ie,t[103]=R,t[104]=l,t[105]=De):De=t[105];let Oe;return t[106]!==se||t[107]!==Ee||t[108]!==De?(Oe=(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":se,children:[Ee,De]}),t[106]=se,t[107]=Ee,t[108]=De,t[109]=Oe):Oe=t[109],Oe}function lt(){}function ut(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-navigation-runs`].includes(String(e[0]))||e===`automations-global-system-source`}function dt(e){return e&&M(e.run)?3e3:15e3}function ft(e){let t=(0,ot.c)(44),{automation:n,language:r,busy:i,onEdit:a,onAction:o}=e,s=r===`zh`,c=n.management,l=s?`${n.name}的更多操作`:`More actions for ${n.name}`,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(z,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(Ne,{asChild:!0,children:(0,$.jsx)(Ce,{variant:`ghost`,className:`size-8 p-0`,"aria-label":l,children:u})}),t[1]=l,t[2]=d);let f;t[3]!==n||t[4]!==i||t[5]!==c||t[6]!==o||t[7]!==s?(f=(!c||c.editable.includes(`enabled`))&&!A(n)?(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:toggle`,()=>n.enabled?Y.pause(n.id):Y.resume(n.id)),children:[n.enabled?(0,$.jsx)(ce,{className:`size-4`}):(0,$.jsx)(le,{className:`size-4`}),n.enabled?s?`暂停`:`Pause`:s?`恢复`:`Resume`]}):null,t[3]=n,t[4]=i,t[5]=c,t[6]=o,t[7]=s,t[8]=f):f=t[8];let p;t[9]!==n.id||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==s?(p=!c||c.runnable?(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:run`,()=>Y.runNow(n.id)),children:[(0,$.jsx)(le,{className:`size-4`}),s?`立即运行`:`Run now`]}):null,t[9]=n.id,t[10]=i,t[11]=c,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==i||t[17]!==c||t[18]!==a||t[19]!==s?(m=!c||c.editable.includes(`trigger`)?(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>a(n),children:[(0,$.jsx)(U,{className:`size-4`}),s?`编辑`:`Edit`]}):null,t[15]=n,t[16]=i,t[17]=c,t[18]=a,t[19]=s,t[20]=m):m=t[20];let h;t[21]!==n.id||t[22]!==o||t[23]!==s?(h=()=>void o(`automation:${n.id}:copy-link`,()=>navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}#/automations?automation=${encodeURIComponent(n.id)}`),s?`任务链接已复制`:`Task link copied`),t[21]=n.id,t[22]=o,t[23]=s,t[24]=h):h=t[24];let g;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(R,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:h,children:[g,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.id||t[30]!==i||t[31]!==c||t[32]!==o||t[33]!==s?(y=!c||c.deletable?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ze,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50 text-danger`,disabled:i,onSelect:()=>{window.confirm(s?`删除这个定时任务?已保存的对话仍可查看。`:`Delete this scheduled task? Saved conversations will remain available.`)&&o(`automation:${n.id}:delete`,()=>Y.remove(n.id))},children:[(0,$.jsx)(pe,{className:`size-4`}),s?`删除`:`Delete`]})]}):null,t[29]=n.id,t[30]=i,t[31]=c,t[32]=o,t[33]=s,t[34]=y):y=t[34];let b;t[35]!==v||t[36]!==y||t[37]!==f||t[38]!==p||t[39]!==m?(b=(0,$.jsx)(Pe,{children:(0,$.jsxs)(Re,{align:`end`,sideOffset:4,className:`z-70 min-w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[f,p,m,v,y]})}),t[35]=v,t[36]=y,t[37]=f,t[38]=p,t[39]=m,t[40]=b):b=t[40];let x;return t[41]!==b||t[42]!==d?(x=(0,$.jsxs)(Me,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=x):x=t[43],x}function pt({automations:e,runs:t,labels:n,cronLabels:r,language:i,selectedAutomationId:a,selectedRunId:o,selectedRun:s,projectId:c,executionSummaries:l,onSelectRun:d,onOpenDetails:f,busy:p,onEdit:m,onAction:h}){let g=`xopc.automation-navigation:${u(e=>e.baseUrl)}:${u(e=>e.conversationId)??`local`}`,[_,v]=(0,Q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}});(0,Q.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);v(e&&typeof e==`object`&&!Array.isArray(e)?e:{})}catch{v({})}},[g]);let y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{!a||y.current===a||(y.current=a,v(e=>({...e,[a]:!0})))},[a]);let b=e=>v(t=>{let n={...t,[e]:!t[e]};try{localStorage.setItem(g,JSON.stringify(n))}catch{}return n});return e.length===0?(0,$.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:n.empty.filtered}):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:e.map(e=>{let u=t.filter(t=>t.automationId===e.id).sort((e,t)=>t.createdAtMs-e.createdAtMs),g=u.find(M);return(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-expanded":!!_[e.id],"aria-controls":`automation-runs-${e.id}`,"aria-label":i===`zh`?`${_[e.id]?`收起`:`展开`} ${e.name} 的执行记录`:`${_[e.id]?`Collapse`:`Expand`} executions for ${e.name}`,className:`absolute left-1 top-2 z-10 rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>b(e.id),children:_[e.id]?(0,$.jsx)(te,{className:`size-4`}):(0,$.jsx)(ne,{className:`size-4`})}),(0,$.jsxs)(`button`,{type:`button`,className:q(`block w-full p-3 pl-9 pr-10 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a===e.id&&!o&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 76px`},"aria-current":a===e.id&&!o?`true`:void 0,onClick:()=>f(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:q(`size-2 shrink-0 rounded-full`,g?`bg-blue-500`:nt(e,u)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:A(e)?i===`zh`?`已完成`:`Completed`:e.enabled?n.enabled:n.paused}),(l?.[e.id]?.unreadCount??0)>0?(0,$.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:n.filters.unread})}):null]}),(0,$.jsxs)(`p`,{className:`mt-1 truncate pl-4 text-xs leading-5 text-fg-muted`,children:[e.enabled?(0,$.jsxs)($.Fragment,{children:[D(e,n,i),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,ee(e.trigger,n,r,i)]}),nt(e,u)?(0,$.jsx)(`p`,{className:`mt-1 pl-4 text-xs text-red-700 dark:text-red-300`,children:n.dashboard.needsAttention}):null]}),(0,$.jsx)(`div`,{id:`automation-runs-${e.id}`,hidden:!_[e.id],children:(0,$.jsx)(P,{automationId:e.id,projectId:c,language:i,selectedRunId:o,selectedRun:s,enabled:!!_[e.id],onSelectRun:d})}),(0,$.jsx)(`div`,{className:`absolute right-1 top-2 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,$.jsx)(ft,{automation:e,language:i,busy:p,onEdit:m,onAction:h})})]},e.id)})})}var mt=`xopc.automations.listWidth`,ht=272,gt=200,_t=560;function vt({children:e,language:t,busy:n}){let r=(0,Q.useRef)(null),i=(0,Q.useRef)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(()=>{try{let e=Number(window.localStorage.getItem(mt));if(Number.isFinite(e)&&e>=gt&&e<=_t)return e}catch{}return ht});(0,Q.useEffect)(()=>{try{window.localStorage.setItem(mt,String(s))}catch{}},[s]),(0,Q.useEffect)(()=>{if(!a)return;let{cursor:e,userSelect:t}=document.body.style;return document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,()=>{document.body.style.cursor=e,document.body.style.userSelect=t}},[a]);let l=e=>{let t=r.current?.getBoundingClientRect().width??1e3,n=Math.max(gt,Math.min(_t,t*.6,t-292));return Math.round(Math.max(gt,Math.min(n,e)))},u=t===`zh`?`调整任务列表宽度`:`Resize task list`;return(0,$.jsxs)(`section`,{ref:r,"aria-busy":n,className:`grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-y-3 md:grid-cols-[minmax(0,min(var(--automation-list-width),60%))_0.75rem_minmax(0,1fr)] md:grid-rows-1 md:gap-y-0`,style:{"--automation-list-width":`${s}px`},children:[e[0],(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":u,"aria-valuemin":gt,"aria-valuemax":_t,"aria-valuenow":s,tabIndex:0,title:t===`zh`?`左右拖动调整宽度,双击恢复默认`:`Drag to resize, double-click to reset`,className:`relative hidden touch-none select-none cursor-col-resize focus-visible:outline-accent md:block`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e.currentTarget.previousElementSibling?.getBoundingClientRect().width??s;i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t},o(!0)},onPointerMove:e=>{let t=i.current;t?.pointerId===e.pointerId&&c(l(t.startWidth+e.clientX-t.startX))},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&(i.current=null,o(!1),e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{i.current=null,o(!1)},onLostPointerCapture:()=>{i.current=null,o(!1)},onDoubleClick:()=>c(ht),onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),c(l(e.key===`Home`?gt:e.key===`End`?_t:s+(e.key===`ArrowLeft`?-16:16))))}}),e[1]]})}var yt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-DWZCzxY7.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221])));function bt(e){let t=(0,ot.c)(51),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]!==c||t[1]!==r?(l=c&&!r?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=r,t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=()=>Y.openConfiguration({automationId:c}),t[3]=c,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[5]=d):d=t[5];let{data:p,error:m,mutate:h}=be(l,u,d),g;t[6]===r?g=t[7]:(g=r?[`automation-configuration`,r]:null,t[6]=r,t[7]=g);let _;t[8]===r?_=t[9]:(_=()=>Y.configuration(r),t[8]=r,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[10]=v):v=t[10];let{data:y}=be(g,_,v),b,x;t[11]!==n||t[12]!==s||t[13]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[11]=n,t[12]=s,t[13]=y,t[14]=b,t[15]=x):(b=t[14],x=t[15]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ye(),ee;t[16]===S?ee=t[17]:(ee=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[16]=S,t[17]=ee);let w=ve(ee),T=(0,Q.useRef)(!1),E,D;t[18]!==C||t[19]!==w?(E=()=>{T.current&&!w&&C(xt),T.current=w},D=[w,C],t[18]=C,t[19]=w,t[20]=E,t[21]=D):(E=t[20],D=t[21]),(0,Q.useEffect)(E,D);let O=a===`zh`,k;t[22]===a?k=t[23]:(k=f(a),t[22]=a,t[23]=k);let A=k,j;if(t[24]!==a||t[25]!==A.automations.status||t[26]!==o||t[27]!==i||t[28]!==O){let e;t[30]!==a||t[31]!==A.automations.status||t[32]!==o||t[33]!==O?(e=e=>({id:`automation-run:${e.id}`,timestamp:e.createdAtMs,content:(0,$.jsxs)(`article`,{className:`mx-auto w-full max-w-[var(--max-width-chat-frame)] space-y-3 py-3`,"aria-label":O?`任务运行结果`:`Task run result`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,$.jsxs)(`span`,{children:[new Date(e.createdAtMs).toLocaleString(O?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,A.automations.status[e.status]]}),(0,$.jsx)(`button`,{type:`button`,className:`rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>o(e.id),children:O?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:rt(e,a)}):e.summary?(0,$.jsx)(oe,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:O?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(qe,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)(tt,{runId:e.id,language:a})]})}),t[30]=a,t[31]=A.automations.status,t[32]=o,t[33]=O,t[34]=e):e=t[34],j=i.map(e),t[24]=a,t[25]=A.automations.status,t[26]=o,t[27]=i,t[28]=O,t[29]=j}else j=t[29];let M=j;if(m){let e=O?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[35]===e?n=t[36]:(n=(0,$.jsx)(`p`,{children:e}),t[35]=e,t[36]=n);let r;t[37]===h?r=t[38]:(r=()=>void h(),t[37]=h,t[38]=r);let i=O?`重试`:`Retry`,a;t[39]!==r||t[40]!==i?(a=(0,$.jsx)(Ce,{variant:`secondary`,onClick:r,children:i}),t[39]=r,t[40]=i,t[41]=a):a=t[41];let o;return t[42]!==n||t[43]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[42]=n,t[43]=a,t[44]=o):o=t[44],o}let N=O?`任务对话`:`Task conversation`,P;t[45]!==M||t[46]!==S?(P=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(J,{className:`m-5 h-40`}),children:(0,$.jsx)(yt,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:M},S)}):(0,$.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,$.jsx)(J,{className:`h-20 w-2/3`}),(0,$.jsx)(J,{className:`h-28`})]}),t[45]=M,t[46]=S,t[47]=P):P=t[47];let F;return t[48]!==N||t[49]!==P?(F=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":N,children:P}),t[48]=N,t[49]=P,t[50]=F):F=t[50],F}function xt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}var St=`relative flex min-h-9 cursor-pointer items-center rounded-md py-2 pl-3 pr-8 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,Ct=`z-70 max-h-[min(32rem,calc(100dvh-2rem))] min-w-52 overflow-y-auto rounded-xl border border-edge bg-surface-overlay p-1.5 shadow-popover`;function wt(e){let t=(0,ot.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(je,{className:`absolute right-2.5`,children:(0,$.jsx)(F,{className:`size-3.5`,"aria-hidden":!0})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,$.jsxs)(Oe,{value:n,className:St,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Tt(e){let t=(0,ot.c)(131),{language:n,labels:r,filter:i,ownership:a,source:o,projectId:s,projects:c,projectLocked:l,query:u,unreadCount:d,markReadBusy:f,onFilter:p,onOwnership:m,onSource:h,onProject:g,onQuery:_,onClear:v,onMarkAllRead:y}=e,b=n===`zh`,[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null),ee=(0,Q.useRef)(null),w=x||!!u,T=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,E;t[0]===_?E=t[1]:(E=()=>{_(``),S(!1),ee.current?.focus()},t[0]=_,t[1]=E);let D=E,O=b?`定时任务`:`Scheduled tasks`,k;t[2]===O?k=t[3]:(k=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:O}),t[2]=O,t[3]=k);let A=b?`筛选任务`:`Filter tasks`,M=b?`筛选任务`:`Filter tasks`,N=T&&`text-accent-fg`,P;t[4]===N?P=t[5]:(P=q(`relative rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-surface-hover`,N),t[4]=N,t[5]=P);let F;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(V,{className:`size-4`,"aria-hidden":!0}),t[6]=F):F=t[6];let te;t[7]!==T||t[8]!==b?(te=T?(0,$.jsx)(`span`,{className:`absolute right-1.5 top-1.5 size-1 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:b?`已应用筛选`:`Filters applied`})}):null,t[7]=T,t[8]=b,t[9]=te):te=t[9];let I;t[10]!==A||t[11]!==M||t[12]!==P||t[13]!==te?(I=(0,$.jsx)(Ne,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":A,title:M,className:P,children:[F,te]})}),t[10]=A,t[11]=M,t[12]=P,t[13]=te,t[14]=I):I=t[14];let L=b?`状态`:`Status`,re;t[15]===L?re=t[16]:(re=(0,$.jsx)(De,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:L}),t[15]=L,t[16]=re);let ie;t[17]===p?ie=t[18]:(ie=e=>p(e),t[17]=p,t[18]=ie);let R=b?`全部状态`:`All statuses`,z;t[19]===R?z=t[20]:(z=(0,$.jsx)(wt,{value:`all`,children:R}),t[19]=R,t[20]=z);let ae;t[21]===r.filters.active?ae=t[22]:(ae=(0,$.jsx)(wt,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=ae);let B;t[23]===r.paused?B=t[24]:(B=(0,$.jsx)(wt,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=B);let oe=b?`已完成`:`Completed`,se;t[25]===oe?se=t[26]:(se=(0,$.jsx)(wt,{value:`completed`,children:oe}),t[25]=oe,t[26]=se);let ce;t[27]===r.metrics.running?ce=t[28]:(ce=(0,$.jsx)(wt,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=ce);let U;t[29]===r.dashboard.needsAttention?U=t[30]:(U=(0,$.jsx)(wt,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=U);let le;t[31]!==i||t[32]!==ie||t[33]!==z||t[34]!==ae||t[35]!==B||t[36]!==se||t[37]!==ce||t[38]!==U?(le=(0,$.jsxs)(Le,{value:i,onValueChange:ie,children:[z,ae,B,se,ce,U]}),t[31]=i,t[32]=ie,t[33]=z,t[34]=ae,t[35]=B,t[36]=se,t[37]=ce,t[38]=U,t[39]=le):le=t[39];let W;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(ze,{className:`my-1 border-t border-edge`}),t[40]=W):W=t[40];let G=b?`归属`:`Owner`,ue;t[41]===G?ue=t[42]:(ue=(0,$.jsx)(De,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:G}),t[41]=G,t[42]=ue);let de;t[43]===m?de=t[44]:(de=e=>m(e),t[43]=m,t[44]=de);let fe=b?`我的任务`:`My tasks`,pe;t[45]===fe?pe=t[46]:(pe=(0,$.jsx)(wt,{value:`user`,children:fe}),t[45]=fe,t[46]=pe);let he=b?`系统任务`:`System tasks`,J;t[47]===he?J=t[48]:(J=(0,$.jsx)(wt,{value:`system`,children:he}),t[47]=he,t[48]=J);let ge;t[49]!==a||t[50]!==de||t[51]!==pe||t[52]!==J?(ge=(0,$.jsxs)(Le,{value:a,onValueChange:de,children:[pe,J]}),t[49]=a,t[50]=de,t[51]=pe,t[52]=J,t[53]=ge):ge=t[53];let _e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(ze,{className:`my-1 border-t border-edge`}),t[54]=_e):_e=t[54];let ve;t[55]!==r.filters.allProjects||t[56]!==g||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==b?(ve=l?null:(0,$.jsxs)(ke,{children:[(0,$.jsxs)(Fe,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[b?`项目`:`Project`,(0,$.jsx)(`span`,{className:`ml-auto max-w-28 truncate text-xs text-fg-muted`,children:c.find(e=>e.id===s)?.name??r.filters.allProjects}),(0,$.jsx)(ne,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(Pe,{children:(0,$.jsx)(Ae,{sideOffset:4,className:Ct,children:(0,$.jsxs)(Le,{value:s,onValueChange:g,children:[(0,$.jsx)(wt,{value:``,children:r.filters.allProjects}),c.map(Et)]})})})]}),t[55]=r.filters.allProjects,t[56]=g,t[57]=s,t[58]=l,t[59]=c,t[60]=b,t[61]=ve):ve=t[61];let ye=b?`任务类型`:`Task type`,be;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(ne,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0}),t[62]=be):be=t[62];let xe;t[63]===ye?xe=t[64]:(xe=(0,$.jsxs)(Fe,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[ye,be]}),t[63]=ye,t[64]=xe);let Se;t[65]===h?Se=t[66]:(Se=e=>h(e),t[65]=h,t[66]=Se);let Ce=b?`全部类型`:`All types`,we;t[67]===Ce?we=t[68]:(we=(0,$.jsx)(wt,{value:`all`,children:Ce}),t[67]=Ce,t[68]=we);let Y;t[69]===r.sources.agent?Y=t[70]:(Y=(0,$.jsx)(wt,{value:`agent`,children:r.sources.agent}),t[69]=r.sources.agent,t[70]=Y);let Te;t[71]===r.sources.task?Te=t[72]:(Te=(0,$.jsx)(wt,{value:`task_command`,children:r.sources.task}),t[71]=r.sources.task,t[72]=Te);let X;t[73]!==o||t[74]!==Se||t[75]!==we||t[76]!==Y||t[77]!==Te?(X=(0,$.jsx)(Pe,{children:(0,$.jsx)(Ae,{sideOffset:4,className:Ct,children:(0,$.jsxs)(Le,{value:o,onValueChange:Se,children:[we,Y,Te]})})}),t[73]=o,t[74]=Se,t[75]=we,t[76]=Y,t[77]=Te,t[78]=X):X=t[78];let Ee;t[79]!==xe||t[80]!==X?(Ee=(0,$.jsxs)(ke,{children:[xe,X]}),t[79]=xe,t[80]=X,t[81]=Ee):Ee=t[81];let Oe;t[82]!==T||t[83]!==v||t[84]!==u||t[85]!==b?(Oe=T||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ze,{className:`my-1 border-t border-edge`}),(0,$.jsx)(Ie,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:v,children:b?`重置筛选`:`Reset filters`})]}):null,t[82]=T,t[83]=v,t[84]=u,t[85]=b,t[86]=Oe):Oe=t[86];let je;t[87]!==re||t[88]!==le||t[89]!==ue||t[90]!==ge||t[91]!==ve||t[92]!==Ee||t[93]!==Oe?(je=(0,$.jsx)(Pe,{children:(0,$.jsxs)(Re,{align:`end`,sideOffset:6,className:Ct,children:[re,le,W,ue,ge,_e,ve,Ee,Oe]})}),t[87]=re,t[88]=le,t[89]=ue,t[90]=ge,t[91]=ve,t[92]=Ee,t[93]=Oe,t[94]=je):je=t[94];let Be;t[95]!==I||t[96]!==je?(Be=(0,$.jsxs)(Me,{children:[I,je]}),t[95]=I,t[96]=je,t[97]=Be):Be=t[97];let Ve=b?`搜索任务`:`Search tasks`,He=b?`搜索任务`:`Search tasks`,Ue;t[98]!==D||t[99]!==w?(Ue=()=>{w?D():(S(!0),requestAnimationFrame(()=>C.current?.focus()))},t[98]=D,t[99]=w,t[100]=Ue):Ue=t[100];let We=w&&`bg-surface-hover text-fg`,Z;t[101]===We?Z=t[102]:(Z=q(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,We),t[101]=We,t[102]=Z);let Ge;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,$.jsx)(K,{className:`size-4`,"aria-hidden":!0}),t[103]=Ge):Ge=t[103];let Ke;t[104]!==w||t[105]!==Ve||t[106]!==He||t[107]!==Ue||t[108]!==Z?(Ke=(0,$.jsx)(`button`,{ref:ee,type:`button`,"aria-label":Ve,title:He,"aria-expanded":w,onClick:Ue,className:Z,children:Ge}),t[104]=w,t[105]=Ve,t[106]=He,t[107]=Ue,t[108]=Z,t[109]=Ke):Ke=t[109];let qe;t[110]!==Be||t[111]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[Be,Ke]}),t[110]=Be,t[111]=Ke,t[112]=qe):qe=t[112];let Je;t[113]!==k||t[114]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[k,qe]}),t[113]=k,t[114]=qe,t[115]=Je):Je=t[115];let Ye;t[116]!==r.filters.markAllRead||t[117]!==f||t[118]!==y||t[119]!==d?(Ye=d>0?(0,$.jsxs)(`button`,{type:`button`,disabled:f,onClick:y,className:`flex min-h-9 w-full items-center gap-2 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50`,"aria-busy":f,children:[f?(0,$.jsx)(H,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(j,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.filters.markAllRead]}):null,t[116]=r.filters.markAllRead,t[117]=f,t[118]=y,t[119]=d,t[120]=Ye):Ye=t[120];let Xe;t[121]!==D||t[122]!==_||t[123]!==u||t[124]!==w||t[125]!==b?(Xe=w?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2.5 focus-within:border-accent`,children:[(0,$.jsx)(K,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:C,value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),D())},"aria-label":b?`搜索任务名称或内容`:`Search task names or content`,placeholder:b?`搜索任务…`:`Search tasks…`,className:`min-h-10 min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-subtle`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":b?`关闭搜索`:`Close search`,onClick:D,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(me,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[121]=D,t[122]=_,t[123]=u,t[124]=w,t[125]=b,t[126]=Xe):Xe=t[126];let Ze;return t[127]!==Je||t[128]!==Ye||t[129]!==Xe?(Ze=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Je,Ye,Xe]}),t[127]=Je,t[128]=Ye,t[129]=Xe,t[130]=Ze):Ze=t[130],Ze}function Et(e){return(0,$.jsx)(wt,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var Dt=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`Morning briefing`,`Start each day with your tasks and project updates.`,`每天早上帮我整理当天到期、逾期的任务和项目进展,给出今天的重点。`,`Each morning, summarize my due and overdue tasks and project progress, and suggest priorities.`],[`📝`,`每周工作回顾`,`回顾一周的成果和问题,为下周留出清晰的方向。`,`Weekly review`,`Review the week and find a clear direction for the next.`,`每周五帮我回顾本周完成的任务和项目进展,整理未解决的问题,建议下周的重点。`,`Every Friday, review completed tasks and project progress, unresolved issues, and priorities for next week.`],[`🌱`,`项目进展跟进`,`定期看看项目进度,找出需要你关注的事情。`,`Project check-in`,`Keep an eye on project progress and what needs attention.`,`定期帮我检查项目进度,整理延期、阻塞和需要我决策的事项。先和我确认关注哪个项目以及运行时间。`,`Regularly review a project for delays, blockers, and decisions I need to make. Ask which project and when to run.`],[`🔔`,`重要事项提醒`,`把容易忘记的事情交给提醒,安心专注眼前。`,`A timely reminder`,`Make room to focus by setting a reminder for later.`,`我想安排一个重要事项提醒。请先问我需要提醒什么、什么时候提醒,以及是否重复。`,`Help me schedule a reminder. Ask what to remember, when, and whether it should repeat.`],[`📚`,`笔记整理`,`回看新收集的想法,整理出值得继续推进的线索。`,`Notes roundup`,`Revisit recent ideas and surface useful next steps.`,`每周帮我回顾最近新增的笔记,按主题整理,找出值得继续推进的想法。请先确认时间和范围。`,`Each week, group my recent notes by topic and suggest ideas worth pursuing. Confirm the schedule and scope.`],[`🧭`,`明日工作计划`,`下班前梳理未完成的事,安排明天最重要的三件事。`,`Plan tomorrow`,`Wrap up loose ends and choose tomorrow’s top three priorities.`,`每个工作日下班前,帮我梳理未完成的任务,建议明天最重要的三件事。请先确认具体时间。`,`Before the end of each workday, review unfinished tasks and suggest tomorrow’s top three priorities. Confirm the time.`],[`🗓️`,`月度复盘`,`拉远一点看进展,发现反复出现的问题和新的机会。`,`Monthly reflection`,`Step back to spot progress, recurring problems, and opportunities.`,`每月月底帮我回顾项目和任务的进展,总结成果、反复出现的问题和下个月的重点。请确认运行时间。`,`At the end of each month, review project and task progress, achievements, recurring problems, and priorities. Confirm the schedule.`],[`🎯`,`逾期任务检查`,`定期发现被搁置的事项,让重要的事重新向前。`,`Overdue task check`,`Find neglected tasks and get important work moving again.`,`定期帮我检查逾期任务,按紧迫程度整理,并建议下一步。请先确认运行频率和时间。`,`Regularly review overdue tasks, prioritize them by urgency, and suggest next steps. Confirm the frequency and time.`]];function Ot(e=Math.random){let t=[...Dt];for(let n=t.length-1;n>0;n--){let r=Math.min(n,Math.max(0,Math.floor(e()*(n+1))));[t[n],t[r]]=[t[r],t[n]]}return t.slice(0,6)}function kt({language:e,projectId:t,onOpenConversation:n}){let r=o(),[i,a]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(``),l=async e=>{a(!0),c(``);try{let i=await Ke({projectId:t,prompt:e});n?n(i):r(i)}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}},u=e===`zh`,[d,f]=(0,Q.useState)(Ot),p=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-2 py-10 sm:px-6 md:py-20`,children:[(0,$.jsxs)(`div`,{className:`text-center`,children:[(0,$.jsx)(C,{className:`mx-auto size-10 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:u?`安排任务`:`Schedule a task`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:u?`说说你希望定期完成什么,我们一起安排好。`:`Tell us what you’d like done regularly. We’ll work out the details together.`})]}),(0,$.jsxs)(`div`,{className:`mb-3 mt-10 flex items-center justify-between text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:u?`也可以从这些想法开始`:`Or start with an idea`}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>f(Ot()),className:`flex items-center gap-1.5 rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(G,{className:`size-3.5`,"aria-hidden":!0}),u?`换一组`:`More ideas`]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:d.map(e=>(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>void l(u?e[5]:e[6]),className:`flex min-h-28 items-center gap-4 rounded-xl border border-dashed border-edge bg-surface-panel px-5 py-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-2xl`,"aria-hidden":!0,children:e[0]}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:u?e[1]:e[3]}),(0,$.jsx)(`span`,{className:`mt-1 block text-sm leading-5 text-fg-muted`,children:u?e[2]:e[4]})]})]},e[1]))}),(0,$.jsx)(`div`,{className:`mt-6 text-center`,children:(0,$.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void l(),className:`rounded-md px-3 py-2 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:u?`说说你想安排的其他任务`:`Describe another task`})}),s?(0,$.jsx)(`p`,{role:`alert`,className:`mt-3 text-center text-sm text-danger`,children:s}):null]});return(0,$.jsx)(`section`,{"aria-label":u?`安排任务`:`Schedule a task`,children:p})}function At(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function jt(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function Mt(e,t={}){let n=At(e.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-Bn44NcvF.js","assets/rolldown-runtime-aKtaBQYM.js","assets/marked.esm-8VXEA2AD.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-DIIvxCDx.js","assets/locale-store-DgbX5Azb.js","assets/messages-Clfka2Sx.js","assets/dist-DlirbHVs.js","assets/es2015-CFqg57eW.js","assets/dist-CDSvxjOh.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/archive-Dz0hferG.js","assets/arrow-left-D880xG-P.js","assets/video-generation-Cec49Jwg.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-Bb_lbw1l.js","assets/activity-YogQEteU.js","assets/bot-DjLkhyZL.js","assets/circle-check-C23XjkUj.js","assets/circle-pause-CN9jYH2s.js","assets/clock-3-DnrAnuyZ.js","assets/external-link-DjqjBmc3.js","assets/loader-circle-CifKLtgG.js","assets/message-square-fVE7Ghj1.js","assets/pause-DuPxgSxk.js","assets/play-kxZvpBg8.js","assets/rotate-ccw-JM1TBLpp.js","assets/rotate-cw-LIg3Am9S.js","assets/sparkles-DHlfQFAF.js","assets/triangle-alert-2JXFNNKU.js","assets/volume-2-BSJhAY97.js","assets/zap-dximCGjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/session-manager-DvIGR4Sw.js","assets/schemas-CCWMleym.js","assets/turn-outcome-Dtw6OgwL.js","assets/product-delivery-4gEqUIsK.js","assets/session-api-Dxhtjzoa.js","assets/gateway-startup-retry-D0dDJJQ4.js","assets/local-session-drafts-Z3PoR-8i.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BPYdUI6y.js","assets/agent-run-error-parser-DsXmcKt-.js","assets/gateway-realtime-egUNyhxi.js","assets/gateway-realtime-store-5YcWzAfG.js","assets/playback-coordinator-CWHIf0wr.js","assets/registry-api-Dz4umdY3.js","assets/agents-admin-api-BzpxMKwk.js","assets/gateway-config-swr-aAsaoOK1.js","assets/vendor-swr-CdRzEUwF.js","assets/button-C5tRaJxt.js","assets/automation-api-CaBLskwk.js","assets/earth-C9Z4bTTG.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/working-directory-picker-modal-DfyyBJpb.js","assets/file-archive-DanfQJNe.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/settings-form-draft-Dy10ldo8.js","assets/popover-select-hRG1EzAY.js","assets/skeleton-DzdOeGYz.js","assets/dist-BSVQC3i_.js","assets/dist-DSRLZhL9.js","assets/floating-ui.dom-CiMnRY5O.js","assets/floating-ui.react-dom-Gx6CM22l.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-alert-BEjgurr2.js","assets/send-1f1Ntw6E.js","assets/circle-x-DFsCKeya.js","assets/circle-BoO4YvTx.js","assets/file-tree-utils-DJs1faGv.js","assets/copy-Dv6d4Dvw.js","assets/database-CjjeZfRG.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/file-code-corner-byQA1VfD.js","assets/file-image-CDUPkZvG.js","assets/file-text-D12HbeVy.js","assets/file-CStvVK2S.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-open-CyzJ19I9.js","assets/folder-CN-pC3XL.js","assets/git-branch-Dh9uxTot.js","assets/globe-DSSGFWFn.js","assets/history-DXH_9jsE.js","assets/notes-api-FjHO1h6b.js","assets/markdown-view-lnMk_L03.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/app-link-Ji4uewEG.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-Czi3_WHu.css","assets/chat-chart-block-Dpolmx0-.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.js","assets/link-2-D_ZKYUW7.js","assets/list-checks-BbsExAoq.js","assets/list-todo-CTVRto8O.js","assets/messages-square-BckAJrEW.js","assets/mic-CuUb7zc-.js","assets/monitor-Af5eAvF7.js","assets/use-generated-media-Bx6BscUT.js","assets/install-connector-dialog-DNY-rpBC.js","assets/secret-input-DsjfQmDn.js","assets/eye-CABVeTq0.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-Dj9RbG9p.js","assets/electron-env-DHOGevH3.js","assets/oauth-provider-connect-Cy1Yy8aX.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-CjdnTF5z.js","assets/oauth-api-B1lbdI3v.js","assets/connection-usage-guide-C2qOP6Nx.js","assets/connection-usage-BhdQRWgQ.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/pin-off-BMRv-Kxr.js","assets/refresh-cw-BRlGaq2w.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/settings-2-D-csvaET.js","assets/settings-uiTATseT.js","assets/share-2-CnIB9PsV.js","assets/shield-check-BU58siTV.js","assets/smartphone-DSSsQFqA.js","assets/square-DMK_fB-3.js","assets/preview-runtime-Cl-SoLXg.js","assets/use-async-resource-BHFGZCY2.js","assets/workspace-api-B1JW3oZZ.js","assets/files-GdwDamkp.js","assets/index.module-Cd9ENXfk.js","assets/trash-2-DusmjVPV.js","assets/user-round-C9jxPhMR.js","assets/wifi-off-C35sMFUl.js","assets/share-link-dialog-Cvma1jxB.js","assets/copy-text-row-gqdh0Bg1.js","assets/wrench-DFb4r8bH.js","assets/tasks-CvOAtEHv.js","assets/specialists-xbB3xL9e.js","assets/api-D70-LnNE.js","assets/session-identity-DRFdxntH.js","assets/new-session-preferences-gb411vZP.js","assets/composer-model-config-control-BcWrGT5D.js","assets/model-selector-BolKz5sx.js","assets/open-capability-settings-DQsmJxI7.js","assets/model-sort-_Tz8s_4N.js","assets/cloud-credits-B-nbtkqv.js","assets/space-api-C_GoZOc_.js","assets/home-task-actions-iUYzLb18.js","assets/capabilities-DcD15BrU.js","assets/capabilities-CpwoMqtm.js","assets/right-workspace-store-B8ooYVOe.js","assets/phone-workspace-store-CeP3GXUk.js","assets/workspace-editor-agent-store-BbfHBVhA.js","assets/chat-agents-api-BfsNH-ht.js","assets/middleware-Pd0e8Igk.js","assets/task-copy-CtcqCQ78.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/linkify-it-BkqEorO0.js","assets/tool-friendly-title-CJVFJ2Ud.js","assets/use-realtime-voice-Bp81D6PV.js","assets/voice-CUfqdnlR.js","assets/composer-notifications-0fMBrXZD.js","assets/activity-store-CWGtissf.js","assets/voice-call-context-BM2A4bLz.js","assets/app-chrome-BeB4KgOf.js","assets/page-header-store-CYA4Isnf.js","assets/new-chat-navigation-spnin196.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/extension-provider-DZ97b5uA.js","assets/theme-store-Bij94a-6.js","assets/extension-message-router-GPlMiYyF.js","assets/agent-avatar-display-DWv7biOS.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/composer-handoff-params-DBpzHuNo.js","assets/agent-display-names-Bje7vfSn.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-yhRKgG72.js","assets/shares-api-BqIBNEtd.js","assets/dist-DaFr5KMw.js","assets/use-composer-attachments-rUl5n4_a.js","assets/chevron-left-DqFhpbvK.js","assets/use-file-preview-expanded-BRjXpRde.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/constants-D5Z-mUto.js","assets/sliding-tab-list-CmcrqRzN.js","assets/sliding-indicator-hwz0sx3h.js","assets/use-share-link-D5HNXEIt.js","assets/file-preview-surface-Da1xZiG6.js","assets/command-palette-api-H3lCPfK8.js","assets/skill-list-api-BvfKctht.js","assets/skill-api-utils-C7V4JVXM.js","assets/composer-payload-handoff-DCGudJjU.js","assets/voice-input-shortcut-events-JsEfJGJz.js","assets/automation-task-card-CLayJo0S.js","assets/automation-display-DaVDNZz8.js","assets/message-circle-Badhj-4D.js","assets/date-picker-BX5tr0IG.js","assets/calendar-days-hw_Y-g-s.js","assets/time-picker-otHjbob1.js","assets/dev-view-store-DrRxtile.js","assets/extension-iframe-host-Cv4PCSVv.js","assets/extension-authoritative-grants-WXYRv5nA.js","assets/runtime-health-zDkHcOZO.js","assets/api-SIYalfjE.js","assets/terminal-panel-store-CHQ2xJtk.js","assets/agents-app-path-ciChvpCS.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-M04A73Ul.js","assets/management-api-CJb5Vclf.js","assets/side-chat-shortcut-BIw-1TTD.js","assets/chat-page-zQeUaawJ.css"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{_ as a,f as o,t as s}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a as c,i as l,l as u,n as d}from"./locale-store-DgbX5Azb.js";import{t as f}from"./messages-Clfka2Sx.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-DlirbHVs.js";import{t as y}from"./activity-YogQEteU.js";import{t as b}from"./arrow-left-D880xG-P.js";import{a as x,c as S,f as C,i as ee,l as w,n as T,o as E,r as D,s as O,t as k,u as A}from"./automation-display-DaVDNZz8.js";import{i as j,n as M,r as N,t as P}from"./automation-run-list-DUpezxj4.js";import{t as F}from"./check-DUBLcKHA.js";import{t as te}from"./chevron-down-ccbiQQz_.js";import{t as ne}from"./chevron-right-BweFrslA.js";import{n as I,r as L}from"./popover-select-hRG1EzAY.js";import{t as re}from"./circle-alert-BEjgurr2.js";import{t as ie}from"./circle-check-C23XjkUj.js";import{t as R}from"./copy-Dv6d4Dvw.js";import{t as z}from"./ellipsis-0k4rZLoy.js";import{t as ae}from"./eye-CABVeTq0.js";import{t as B}from"./git-branch-Dh9uxTot.js";import{t as V}from"./list-filter-CIPvpfLA.js";import{t as H}from"./loader-circle-CifKLtgG.js";import{t as oe}from"./markdown-view-lnMk_L03.js";import{t as se}from"./message-circle-Badhj-4D.js";import{t as ce}from"./pause-DuPxgSxk.js";import{t as U}from"./pencil-DmIY3Oa-.js";import{t as le}from"./play-kxZvpBg8.js";import{t as W}from"./plus-Q2yW6OE7.js";import{t as G}from"./refresh-cw-BRlGaq2w.js";import{t as K}from"./search-DA7gz22f.js";import{t as ue}from"./shield-check-BU58siTV.js";import{t as de}from"./sparkles-DHlfQFAF.js";import{t as fe}from"./square-pen-B8FsvqNu.js";import{t as pe}from"./trash-2-DusmjVPV.js";import{t as me}from"./x-B_N4OPjy.js";import{t as he}from"./zap-dximCGjy.js";import{t as q}from"./cn-0WouolD0.js";import{t as J}from"./skeleton-DzdOeGYz.js";import{d as ge}from"./api-D70-LnNE.js";import{a as _e}from"./session-api-Dxhtjzoa.js";import{k as ve}from"./session-manager-DvIGR4Sw.js";import{a as ye,i as be,o as xe}from"./vendor-swr-CdRzEUwF.js";import{t as Se}from"./chat-agents-api-BfsNH-ht.js";import{t as Ce}from"./button-C5tRaJxt.js";import{t as we}from"./page-header-store-CYA4Isnf.js";import{t as Y}from"./automation-api-CaBLskwk.js";import{n as Te}from"./agent-display-names-Bje7vfSn.js";import{t as X}from"./sliding-tab-list-CmcrqRzN.js";import{t as Ee}from"./refresh-button-DX7bULU5.js";import{a as De,c as Oe,d as ke,f as Ae,i as je,l as Me,m as Ne,o as Pe,p as Fe,r as Ie,s as Le,t as Re,u as ze}from"./dist-DaFr5KMw.js";import{n as Be}from"./model-selector-BolKz5sx.js";import{a as Ve,c as He,d as Ue,f as We,h as Z,l as Ge,m as Ke,n as qe,o as Je,p as Ye,r as Xe,s as Ze,u as Qe}from"./automation-task-card-CLayJo0S.js";import{t as $e}from"./time-picker-otHjbob1.js";import{t as et}from"./date-time-picker-CdPsuK2A.js";import{i as tt,n as nt,r as rt,t as it}from"./automation-result-state-CeGtOXK0.js";import{n as at}from"./routine-panel-wJxaH-1V.js";var ot=n(),Q=e(t(),1),$=r(),st=(0,Q.lazy)(()=>i(()=>import(`./chat-page-Bn44NcvF.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221])));function ct(e){let t=(0,ot.c)(110),{runId:n,automationId:r,projectId:i,language:a,onConfigure:o,onDetails:s,onBack:c}=e,l=a===`zh`,[u,d]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>g(e),t[0]=_):_=t[0];let v=_,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(!0),t[1]=y):y=t[1];let x=y,{mutate:S}=ye(),C=(0,Q.useRef)(!1),ee=i??``,w;t[2]!==r||t[3]!==n||t[4]!==ee?(w=[`automation-execution`,r,n,ee],t[2]=r,t[3]=n,t[4]=ee,t[5]=w):w=t[5];let T;t[6]!==r||t[7]!==i||t[8]!==n||t[9]!==l?(T=async()=>{let{run:e}=await Y.getRun(n);if(e.automationId!==r)throw Error(l?`执行记录不属于此自动化`:`Execution does not belong to this automation`);let{automation:t}=await Y.get(r);if(i&&t.projectId!==i)throw Error(l?`执行记录不属于此项目`:`Execution does not belong to this project`);return{run:e,automation:t}},t[6]=r,t[7]=i,t[8]=n,t[9]=l,t[10]=T):T=t[10];let E;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(E={refreshInterval:dt,shouldRetryOnError:!1},t[11]=E):E=t[11];let{data:D,error:O,mutate:k}=be(w,T,E),A=D?.run,j=A?.conversationId,N;t[12]===j?N=t[13]:(N=e=>!!(j&&(e.sessions[j]?.streaming||e.sessions[j]?.sending)),t[12]=j,t[13]=N);let P=ve(N),F;t[14]===j?F=t[15]:(F=j?[`automation-execution-session`,j]:null,t[14]=j,t[15]=F);let te;t[16]===j?te=t[17]:(te=()=>_e(j),t[16]=j,t[17]=te);let ne;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ne={shouldRetryOnError:!1},t[18]=ne):ne=t[18];let{data:I,error:L,mutate:re}=be(F,te,ne),ie=A?.conversationShared||D?.automation.conversationMode===`continuous`||I?.customData?.latestAutomationRunId!==void 0&&I.customData.latestAutomationRunId!==n,R=!!(I&&(!ie||u)),z=!O&&!!(A&&(!j||ie&&!u&&I&&!L&&(A?.summary||A?.error)||I&&!L&&p)),ae,B;if(t[19]!==z||t[20]!==k||t[21]!==S||t[22]!==A?(ae=()=>{!A||!z||M(A)||A.readAtMs!=null||C.current||(C.current=!0,Y.markRunRead(A.id).then(async()=>{await Promise.all([k(),S(ut)])}).catch(lt).finally(()=>{C.current=!1}))},B=[A,z,k,S],t[19]=z,t[20]=k,t[21]=S,t[22]=A,t[23]=ae,t[24]=B):(ae=t[23],B=t[24]),(0,Q.useEffect)(ae,B),O){let e=O instanceof Error?O.message:l?`执行记录加载失败`:`Could not load execution`,n;t[25]===e?n=t[26]:(n=(0,$.jsx)(`p`,{children:e}),t[25]=e,t[26]=n);let r;t[27]===k?r=t[28]:(r=()=>void k(),t[27]=k,t[28]=r);let i=l?`重试`:`Retry`,a;t[29]!==r||t[30]!==i?(a=(0,$.jsx)(Ce,{onClick:r,children:i}),t[29]=r,t[30]=i,t[31]=a):a=t[31];let o=l?`返回自动化`:`Back to automation`,s;t[32]!==c||t[33]!==o?(s=(0,$.jsx)(Ce,{onClick:c,children:o}),t[32]=c,t[33]=o,t[34]=s):s=t[34];let u;return t[35]!==n||t[36]!==a||t[37]!==s?(u=(0,$.jsxs)(`section`,{role:`alert`,className:`space-y-3 p-5`,children:[n,a,s]}),t[35]=n,t[36]=a,t[37]=s,t[38]=u):u=t[38],u}if(!A){let e;return t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-4 p-5`,"aria-busy":`true`,children:[(0,$.jsx)(J,{className:`h-6 w-2/3`}),(0,$.jsx)(J,{className:`h-20`})]}),t[39]=e):e=t[39],e}let V;t[40]===A?V=t[41]:(V=M(A),t[40]=A,t[41]=V);let H=V,se=l?`执行会话`:`Execution conversation`,ce=l?`返回自动化`:`Back to automation`,U;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(b,{className:`size-4`}),t[42]=U):U=t[42];let le;t[43]!==c||t[44]!==ce?(le=(0,$.jsx)(Ce,{variant:`ghost`,className:`shrink-0`,onClick:c,"aria-label":ce,children:U}),t[43]=c,t[44]=ce,t[45]=le):le=t[45];let W;t[46]===A.automationName?W=t[47]:(W=(0,$.jsx)(`h2`,{className:`truncate text-sm font-medium text-fg`,children:A.automationName}),t[46]=A.automationName,t[47]=W);let G;t[48]!==le||t[49]!==W?(G=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[le,W]}),t[48]=le,t[49]=W,t[50]=G):G=t[50];let K;t[51]!==A.createdAtMs||t[52]!==l?(K=new Date(A.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[51]=A.createdAtMs,t[52]=l,t[53]=K):K=t[53];let ue;t[54]===a?ue=t[55]:(ue=f(a),t[54]=a,t[55]=ue);let de=ue.automations.status[A.status],fe;t[56]!==K||t[57]!==de?(fe=(0,$.jsxs)(`span`,{children:[K,` · `,de]}),t[56]=K,t[57]=de,t[58]=fe):fe=t[58];let pe;t[59]!==s||t[60]!==A.id?(pe=()=>s(A.id),t[59]=s,t[60]=A.id,t[61]=pe):pe=t[61];let me=l?`运行详情`:`Run details`,he;t[62]!==pe||t[63]!==me?(he=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:pe,children:me}),t[62]=pe,t[63]=me,t[64]=he):he=t[64];let q;t[65]!==o||t[66]!==A?(q=()=>o(A),t[65]=o,t[66]=A,t[67]=q):q=t[67];let ge=l?`调整自动化`:`Adjust automation`,xe;t[68]!==q||t[69]!==ge?(xe=(0,$.jsx)(`button`,{type:`button`,className:`rounded px-2 py-1.5 text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:q,children:ge}),t[68]=q,t[69]=ge,t[70]=xe):xe=t[70];let Se;t[71]!==fe||t[72]!==he||t[73]!==xe?(Se=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[fe,he,xe]}),t[71]=fe,t[72]=he,t[73]=xe,t[74]=Se):Se=t[74];let we;t[75]!==D?.automation||t[76]!==ie||t[77]!==l?(we=ie?(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[l?`多次执行可能共用此会话;下方摘要对应所选执行。`:`Executions may share this conversation. The summary belongs to the selected execution.`,D?.automation.conversationMode===`continuous`?l?`追问会进入后续运行上下文。`:` Follow-ups become context for future runs.`:null]}):null,t[75]=D?.automation,t[76]=ie,t[77]=l,t[78]=we):we=t[78];let Te;t[79]!==h||t[80]!==u||t[81]!==l?(Te=u?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:h===!0?l?`已定位到所选执行的会话起点。`:`Located the selected execution in this conversation.`:h===!1?l?`旧记录缺少可用的执行定位信息,当前显示完整会话。`:`No matching turn was found in the available history. Showing the full conversation.`:l?`正在定位所选执行…`:`Locating the selected execution…`}):null,t[79]=h,t[80]=u,t[81]=l,t[82]=Te):Te=t[82];let X;t[83]!==H||t[84]!==l?(X=H?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`执行中,完成后可继续追问。`:`Execution in progress. Follow up after it finishes.`}):null,t[83]=H,t[84]=l,t[85]=X):X=t[85];let Ee;t[86]!==G||t[87]!==Se||t[88]!==we||t[89]!==Te||t[90]!==X?(Ee=(0,$.jsxs)(`header`,{className:`shrink-0 space-y-2 border-b border-edge px-4 py-3`,children:[G,Se,we,Te,X]}),t[86]=G,t[87]=Se,t[88]=we,t[89]=Te,t[90]=X,t[91]=Ee):Ee=t[91];let De;t[92]!==H||t[93]!==j||t[94]!==P||t[95]!==I||t[96]!==a||t[97]!==re||t[98]!==A.error||t[99]!==A.id||t[100]!==A.summary||t[101]!==L||t[102]!==ie||t[103]!==R||t[104]!==l?(De=R?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(J,{className:`m-5 h-40`}),children:(0,$.jsx)(st,{embedded:!0,automationExecution:!0,conversationId:j,readOnly:H||P,onHistoryReady:x,initialTurnId:ie?A.id:void 0,onInitialTurnLocated:v},j)}):(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[A.summary?(0,$.jsx)(oe,{content:A.summary}):null,A.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-danger`,children:A.error}):null,j?null:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:H?l?`等待执行会话,开始后会自动更新。`:`Waiting for the execution conversation. This view updates automatically.`:l?`本次执行没有关联会话,可查看运行结果和详情。`:`No conversation is associated with this execution. Results and diagnostics remain available.`}),j&&!I&&!L?(0,$.jsx)(J,{className:`h-24`}):null,L?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:L.status===404?l?`执行会话已删除,运行结果仍保留。`:`The execution conversation was deleted. Results are still available.`:l?`执行会话暂时无法读取,运行结果仍保留。`:`The conversation is unavailable. Results are still available.`}),(0,$.jsx)(Ce,{onClick:()=>void re(),children:l?`重试`:`Retry`})]}):null,ie&&I?(0,$.jsx)(Ce,{variant:`secondary`,onClick:()=>d(!0),children:l?`打开共享会话`:`Open shared conversation`}):null,H?null:(0,$.jsx)(tt,{runId:A.id,language:a})]}),t[92]=H,t[93]=j,t[94]=P,t[95]=I,t[96]=a,t[97]=re,t[98]=A.error,t[99]=A.id,t[100]=A.summary,t[101]=L,t[102]=ie,t[103]=R,t[104]=l,t[105]=De):De=t[105];let Oe;return t[106]!==se||t[107]!==Ee||t[108]!==De?(Oe=(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":se,children:[Ee,De]}),t[106]=se,t[107]=Ee,t[108]=De,t[109]=Oe):Oe=t[109],Oe}function lt(){}function ut(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-navigation-runs`].includes(String(e[0]))||e===`automations-global-system-source`}function dt(e){return e&&M(e.run)?3e3:15e3}function ft(e){let t=(0,ot.c)(44),{automation:n,language:r,busy:i,onEdit:a,onAction:o}=e,s=r===`zh`,c=n.management,l=s?`${n.name}的更多操作`:`More actions for ${n.name}`,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(z,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(Ne,{asChild:!0,children:(0,$.jsx)(Ce,{variant:`ghost`,className:`size-8 p-0`,"aria-label":l,children:u})}),t[1]=l,t[2]=d);let f;t[3]!==n||t[4]!==i||t[5]!==c||t[6]!==o||t[7]!==s?(f=(!c||c.editable.includes(`enabled`))&&!A(n)?(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:toggle`,()=>n.enabled?Y.pause(n.id):Y.resume(n.id)),children:[n.enabled?(0,$.jsx)(ce,{className:`size-4`}):(0,$.jsx)(le,{className:`size-4`}),n.enabled?s?`暂停`:`Pause`:s?`恢复`:`Resume`]}):null,t[3]=n,t[4]=i,t[5]=c,t[6]=o,t[7]=s,t[8]=f):f=t[8];let p;t[9]!==n.id||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==s?(p=!c||c.runnable?(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>void o(`automation:${n.id}:run`,()=>Y.runNow(n.id)),children:[(0,$.jsx)(le,{className:`size-4`}),s?`立即运行`:`Run now`]}):null,t[9]=n.id,t[10]=i,t[11]=c,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==i||t[17]!==c||t[18]!==a||t[19]!==s?(m=!c||c.editable.includes(`trigger`)?(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,disabled:i,onSelect:()=>a(n),children:[(0,$.jsx)(U,{className:`size-4`}),s?`编辑`:`Edit`]}):null,t[15]=n,t[16]=i,t[17]=c,t[18]=a,t[19]=s,t[20]=m):m=t[20];let h;t[21]!==n.id||t[22]!==o||t[23]!==s?(h=()=>void o(`automation:${n.id}:copy-link`,()=>navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}#/automations?automation=${encodeURIComponent(n.id)}`),s?`任务链接已复制`:`Task link copied`),t[21]=n.id,t[22]=o,t[23]=s,t[24]=h):h=t[24];let g;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(R,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50`,onSelect:h,children:[g,_]}),t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.id||t[30]!==i||t[31]!==c||t[32]!==o||t[33]!==s?(y=!c||c.deletable?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ze,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(Ie,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover data-[disabled]:opacity-50 text-danger`,disabled:i,onSelect:()=>{window.confirm(s?`删除这个定时任务?已保存的对话仍可查看。`:`Delete this scheduled task? Saved conversations will remain available.`)&&o(`automation:${n.id}:delete`,()=>Y.remove(n.id))},children:[(0,$.jsx)(pe,{className:`size-4`}),s?`删除`:`Delete`]})]}):null,t[29]=n.id,t[30]=i,t[31]=c,t[32]=o,t[33]=s,t[34]=y):y=t[34];let b;t[35]!==v||t[36]!==y||t[37]!==f||t[38]!==p||t[39]!==m?(b=(0,$.jsx)(Pe,{children:(0,$.jsxs)(Re,{align:`end`,sideOffset:4,className:`z-70 min-w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[f,p,m,v,y]})}),t[35]=v,t[36]=y,t[37]=f,t[38]=p,t[39]=m,t[40]=b):b=t[40];let x;return t[41]!==b||t[42]!==d?(x=(0,$.jsxs)(Me,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=x):x=t[43],x}function pt({automations:e,runs:t,labels:n,cronLabels:r,language:i,selectedAutomationId:a,selectedRunId:o,selectedRun:s,projectId:c,executionSummaries:l,onSelectRun:d,onOpenDetails:f,busy:p,onEdit:m,onAction:h}){let g=`xopc.automation-navigation:${u(e=>e.baseUrl)}:${u(e=>e.conversationId)??`local`}`,[_,v]=(0,Q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}});(0,Q.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(g)??`{}`);v(e&&typeof e==`object`&&!Array.isArray(e)?e:{})}catch{v({})}},[g]);let y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{!a||y.current===a||(y.current=a,v(e=>({...e,[a]:!0})))},[a]);let b=e=>v(t=>{let n={...t,[e]:!t[e]};try{localStorage.setItem(g,JSON.stringify(n))}catch{}return n});return e.length===0?(0,$.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:n.empty.filtered}):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto divide-y divide-edge-subtle`,children:e.map(e=>{let u=t.filter(t=>t.automationId===e.id).sort((e,t)=>t.createdAtMs-e.createdAtMs),g=u.find(M);return(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-expanded":!!_[e.id],"aria-controls":`automation-runs-${e.id}`,"aria-label":i===`zh`?`${_[e.id]?`收起`:`展开`} ${e.name} 的执行记录`:`${_[e.id]?`Collapse`:`Expand`} executions for ${e.name}`,className:`absolute left-1 top-2 z-10 rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>b(e.id),children:_[e.id]?(0,$.jsx)(te,{className:`size-4`}):(0,$.jsx)(ne,{className:`size-4`})}),(0,$.jsxs)(`button`,{type:`button`,className:q(`block w-full p-3 pl-9 pr-10 text-left outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a===e.id&&!o&&`bg-surface-hover`),style:{contentVisibility:`auto`,containIntrinsicSize:`auto 76px`},"aria-current":a===e.id&&!o?`true`:void 0,onClick:()=>f(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:q(`size-2 shrink-0 rounded-full`,g?`bg-blue-500`:nt(e,u)?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-fg-subtle`)}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:A(e)?i===`zh`?`已完成`:`Completed`:e.enabled?n.enabled:n.paused}),(l?.[e.id]?.unreadCount??0)>0?(0,$.jsx)(`span`,{className:`ml-auto size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:n.filters.unread})}):null]}),(0,$.jsxs)(`p`,{className:`mt-1 truncate pl-4 text-xs leading-5 text-fg-muted`,children:[e.enabled?(0,$.jsxs)($.Fragment,{children:[D(e,n,i),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,ee(e.trigger,n,r,i)]}),nt(e,u)?(0,$.jsx)(`p`,{className:`mt-1 pl-4 text-xs text-red-700 dark:text-red-300`,children:n.dashboard.needsAttention}):null]}),(0,$.jsx)(`div`,{id:`automation-runs-${e.id}`,hidden:!_[e.id],children:(0,$.jsx)(P,{automationId:e.id,projectId:c,language:i,selectedRunId:o,selectedRun:s,enabled:!!_[e.id],onSelectRun:d})}),(0,$.jsx)(`div`,{className:`absolute right-1 top-2 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100`,children:(0,$.jsx)(ft,{automation:e,language:i,busy:p,onEdit:m,onAction:h})})]},e.id)})})}var mt=`xopc.automations.listWidth`,ht=272,gt=200,_t=560;function vt({children:e,language:t,busy:n}){let r=(0,Q.useRef)(null),i=(0,Q.useRef)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(()=>{try{let e=Number(window.localStorage.getItem(mt));if(Number.isFinite(e)&&e>=gt&&e<=_t)return e}catch{}return ht});(0,Q.useEffect)(()=>{try{window.localStorage.setItem(mt,String(s))}catch{}},[s]),(0,Q.useEffect)(()=>{if(!a)return;let{cursor:e,userSelect:t}=document.body.style;return document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,()=>{document.body.style.cursor=e,document.body.style.userSelect=t}},[a]);let l=e=>{let t=r.current?.getBoundingClientRect().width??1e3,n=Math.max(gt,Math.min(_t,t*.6,t-292));return Math.round(Math.max(gt,Math.min(n,e)))},u=t===`zh`?`调整任务列表宽度`:`Resize task list`;return(0,$.jsxs)(`section`,{ref:r,"aria-busy":n,className:`grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-y-3 md:grid-cols-[minmax(0,min(var(--automation-list-width),60%))_0.75rem_minmax(0,1fr)] md:grid-rows-1 md:gap-y-0`,style:{"--automation-list-width":`${s}px`},children:[e[0],(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":u,"aria-valuemin":gt,"aria-valuemax":_t,"aria-valuenow":s,tabIndex:0,title:t===`zh`?`左右拖动调整宽度,双击恢复默认`:`Drag to resize, double-click to reset`,className:`relative hidden touch-none select-none cursor-col-resize focus-visible:outline-accent md:block`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId);let t=e.currentTarget.previousElementSibling?.getBoundingClientRect().width??s;i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t},o(!0)},onPointerMove:e=>{let t=i.current;t?.pointerId===e.pointerId&&c(l(t.startWidth+e.clientX-t.startX))},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&(i.current=null,o(!1),e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{i.current=null,o(!1)},onLostPointerCapture:()=>{i.current=null,o(!1)},onDoubleClick:()=>c(ht),onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),c(l(e.key===`Home`?gt:e.key===`End`?_t:s+(e.key===`ArrowLeft`?-16:16))))}}),e[1]]})}var yt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-Bn44NcvF.js`).then(e=>e.n).then(e=>({default:e.ChatPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221])));function bt(e){let t=(0,ot.c)(51),{automation:n,conversationId:r,runs:i,language:a,onSelectRun:o,onConfigured:s}=e,c=n?.id,l;t[0]!==c||t[1]!==r?(l=c&&!r?[`automation-workspace-chat`,c]:null,t[0]=c,t[1]=r,t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=()=>Y.openConfiguration({automationId:c}),t[3]=c,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1},t[5]=d):d=t[5];let{data:p,error:m,mutate:h}=be(l,u,d),g;t[6]===r?g=t[7]:(g=r?[`automation-configuration`,r]:null,t[6]=r,t[7]=g);let _;t[8]===r?_=t[9]:(_=()=>Y.configuration(r),t[8]=r,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={refreshInterval:3e3},t[10]=v):v=t[10];let{data:y}=be(g,_,v),b,x;t[11]!==n||t[12]!==s||t[13]!==y?(b=()=>{!n&&y?.automation&&s?.(y.automation.id)},x=[n,y,s],t[11]=n,t[12]=s,t[13]=y,t[14]=b,t[15]=x):(b=t[14],x=t[15]),(0,Q.useEffect)(b,x);let S=r??p?.conversationId,{mutate:C}=ye(),ee;t[16]===S?ee=t[17]:(ee=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[16]=S,t[17]=ee);let w=ve(ee),T=(0,Q.useRef)(!1),E,D;t[18]!==C||t[19]!==w?(E=()=>{T.current&&!w&&C(xt),T.current=w},D=[w,C],t[18]=C,t[19]=w,t[20]=E,t[21]=D):(E=t[20],D=t[21]),(0,Q.useEffect)(E,D);let O=a===`zh`,k;t[22]===a?k=t[23]:(k=f(a),t[22]=a,t[23]=k);let A=k,j;if(t[24]!==a||t[25]!==A.automations.status||t[26]!==o||t[27]!==i||t[28]!==O){let e;t[30]!==a||t[31]!==A.automations.status||t[32]!==o||t[33]!==O?(e=e=>({id:`automation-run:${e.id}`,timestamp:e.createdAtMs,content:(0,$.jsxs)(`article`,{className:`mx-auto w-full max-w-[var(--max-width-chat-frame)] space-y-3 py-3`,"aria-label":O?`任务运行结果`:`Task run result`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-fg-muted`,children:[(0,$.jsxs)(`span`,{children:[new Date(e.createdAtMs).toLocaleString(O?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,A.automations.status[e.status]]}),(0,$.jsx)(`button`,{type:`button`,className:`rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>o(e.id),children:O?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:rt(e,a)}):e.summary?(0,$.jsx)(oe,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:O?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(qe,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)(tt,{runId:e.id,language:a})]})}),t[30]=a,t[31]=A.automations.status,t[32]=o,t[33]=O,t[34]=e):e=t[34],j=i.map(e),t[24]=a,t[25]=A.automations.status,t[26]=o,t[27]=i,t[28]=O,t[29]=j}else j=t[29];let M=j;if(m){let e=O?`暂时无法打开任务对话。`:`Could not open the task conversation.`,n;t[35]===e?n=t[36]:(n=(0,$.jsx)(`p`,{children:e}),t[35]=e,t[36]=n);let r;t[37]===h?r=t[38]:(r=()=>void h(),t[37]=h,t[38]=r);let i=O?`重试`:`Retry`,a;t[39]!==r||t[40]!==i?(a=(0,$.jsx)(Ce,{variant:`secondary`,onClick:r,children:i}),t[39]=r,t[40]=i,t[41]=a):a=t[41];let o;return t[42]!==n||t[43]!==a?(o=(0,$.jsxs)(`div`,{role:`alert`,className:`p-6 text-sm text-fg-muted`,children:[n,a]}),t[42]=n,t[43]=a,t[44]=o):o=t[44],o}let N=O?`任务对话`:`Task conversation`,P;t[45]!==M||t[46]!==S?(P=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(J,{className:`m-5 h-40`}),children:(0,$.jsx)(yt,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:M},S)}):(0,$.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,$.jsx)(J,{className:`h-20 w-2/3`}),(0,$.jsx)(J,{className:`h-28`})]}),t[45]=M,t[46]=S,t[47]=P):P=t[47];let F;return t[48]!==N||t[49]!==P?(F=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":N,children:P}),t[48]=N,t[49]=P,t[50]=F):F=t[50],F}function xt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}var St=`relative flex min-h-9 cursor-pointer items-center rounded-md py-2 pl-3 pr-8 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,Ct=`z-70 max-h-[min(32rem,calc(100dvh-2rem))] min-w-52 overflow-y-auto rounded-xl border border-edge bg-surface-overlay p-1.5 shadow-popover`;function wt(e){let t=(0,ot.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(je,{className:`absolute right-2.5`,children:(0,$.jsx)(F,{className:`size-3.5`,"aria-hidden":!0})}),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,$.jsxs)(Oe,{value:n,className:St,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Tt(e){let t=(0,ot.c)(131),{language:n,labels:r,filter:i,ownership:a,source:o,projectId:s,projects:c,projectLocked:l,query:u,unreadCount:d,markReadBusy:f,onFilter:p,onOwnership:m,onSource:h,onProject:g,onQuery:_,onClear:v,onMarkAllRead:y}=e,b=n===`zh`,[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null),ee=(0,Q.useRef)(null),w=x||!!u,T=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,E;t[0]===_?E=t[1]:(E=()=>{_(``),S(!1),ee.current?.focus()},t[0]=_,t[1]=E);let D=E,O=b?`定时任务`:`Scheduled tasks`,k;t[2]===O?k=t[3]:(k=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:O}),t[2]=O,t[3]=k);let A=b?`筛选任务`:`Filter tasks`,M=b?`筛选任务`:`Filter tasks`,N=T&&`text-accent-fg`,P;t[4]===N?P=t[5]:(P=q(`relative rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-surface-hover`,N),t[4]=N,t[5]=P);let F;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(V,{className:`size-4`,"aria-hidden":!0}),t[6]=F):F=t[6];let te;t[7]!==T||t[8]!==b?(te=T?(0,$.jsx)(`span`,{className:`absolute right-1.5 top-1.5 size-1 rounded-full bg-accent`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:b?`已应用筛选`:`Filters applied`})}):null,t[7]=T,t[8]=b,t[9]=te):te=t[9];let I;t[10]!==A||t[11]!==M||t[12]!==P||t[13]!==te?(I=(0,$.jsx)(Ne,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":A,title:M,className:P,children:[F,te]})}),t[10]=A,t[11]=M,t[12]=P,t[13]=te,t[14]=I):I=t[14];let L=b?`状态`:`Status`,re;t[15]===L?re=t[16]:(re=(0,$.jsx)(De,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:L}),t[15]=L,t[16]=re);let ie;t[17]===p?ie=t[18]:(ie=e=>p(e),t[17]=p,t[18]=ie);let R=b?`全部状态`:`All statuses`,z;t[19]===R?z=t[20]:(z=(0,$.jsx)(wt,{value:`all`,children:R}),t[19]=R,t[20]=z);let ae;t[21]===r.filters.active?ae=t[22]:(ae=(0,$.jsx)(wt,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=ae);let B;t[23]===r.paused?B=t[24]:(B=(0,$.jsx)(wt,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=B);let oe=b?`已完成`:`Completed`,se;t[25]===oe?se=t[26]:(se=(0,$.jsx)(wt,{value:`completed`,children:oe}),t[25]=oe,t[26]=se);let ce;t[27]===r.metrics.running?ce=t[28]:(ce=(0,$.jsx)(wt,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=ce);let U;t[29]===r.dashboard.needsAttention?U=t[30]:(U=(0,$.jsx)(wt,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=U);let le;t[31]!==i||t[32]!==ie||t[33]!==z||t[34]!==ae||t[35]!==B||t[36]!==se||t[37]!==ce||t[38]!==U?(le=(0,$.jsxs)(Le,{value:i,onValueChange:ie,children:[z,ae,B,se,ce,U]}),t[31]=i,t[32]=ie,t[33]=z,t[34]=ae,t[35]=B,t[36]=se,t[37]=ce,t[38]=U,t[39]=le):le=t[39];let W;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(ze,{className:`my-1 border-t border-edge`}),t[40]=W):W=t[40];let G=b?`归属`:`Owner`,ue;t[41]===G?ue=t[42]:(ue=(0,$.jsx)(De,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:G}),t[41]=G,t[42]=ue);let de;t[43]===m?de=t[44]:(de=e=>m(e),t[43]=m,t[44]=de);let fe=b?`我的任务`:`My tasks`,pe;t[45]===fe?pe=t[46]:(pe=(0,$.jsx)(wt,{value:`user`,children:fe}),t[45]=fe,t[46]=pe);let he=b?`系统任务`:`System tasks`,J;t[47]===he?J=t[48]:(J=(0,$.jsx)(wt,{value:`system`,children:he}),t[47]=he,t[48]=J);let ge;t[49]!==a||t[50]!==de||t[51]!==pe||t[52]!==J?(ge=(0,$.jsxs)(Le,{value:a,onValueChange:de,children:[pe,J]}),t[49]=a,t[50]=de,t[51]=pe,t[52]=J,t[53]=ge):ge=t[53];let _e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(ze,{className:`my-1 border-t border-edge`}),t[54]=_e):_e=t[54];let ve;t[55]!==r.filters.allProjects||t[56]!==g||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==b?(ve=l?null:(0,$.jsxs)(ke,{children:[(0,$.jsxs)(Fe,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[b?`项目`:`Project`,(0,$.jsx)(`span`,{className:`ml-auto max-w-28 truncate text-xs text-fg-muted`,children:c.find(e=>e.id===s)?.name??r.filters.allProjects}),(0,$.jsx)(ne,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(Pe,{children:(0,$.jsx)(Ae,{sideOffset:4,className:Ct,children:(0,$.jsxs)(Le,{value:s,onValueChange:g,children:[(0,$.jsx)(wt,{value:``,children:r.filters.allProjects}),c.map(Et)]})})})]}),t[55]=r.filters.allProjects,t[56]=g,t[57]=s,t[58]=l,t[59]=c,t[60]=b,t[61]=ve):ve=t[61];let ye=b?`任务类型`:`Task type`,be;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(ne,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0}),t[62]=be):be=t[62];let xe;t[63]===ye?xe=t[64]:(xe=(0,$.jsxs)(Fe,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-4 rounded-md px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,children:[ye,be]}),t[63]=ye,t[64]=xe);let Se;t[65]===h?Se=t[66]:(Se=e=>h(e),t[65]=h,t[66]=Se);let Ce=b?`全部类型`:`All types`,we;t[67]===Ce?we=t[68]:(we=(0,$.jsx)(wt,{value:`all`,children:Ce}),t[67]=Ce,t[68]=we);let Y;t[69]===r.sources.agent?Y=t[70]:(Y=(0,$.jsx)(wt,{value:`agent`,children:r.sources.agent}),t[69]=r.sources.agent,t[70]=Y);let Te;t[71]===r.sources.task?Te=t[72]:(Te=(0,$.jsx)(wt,{value:`task_command`,children:r.sources.task}),t[71]=r.sources.task,t[72]=Te);let X;t[73]!==o||t[74]!==Se||t[75]!==we||t[76]!==Y||t[77]!==Te?(X=(0,$.jsx)(Pe,{children:(0,$.jsx)(Ae,{sideOffset:4,className:Ct,children:(0,$.jsxs)(Le,{value:o,onValueChange:Se,children:[we,Y,Te]})})}),t[73]=o,t[74]=Se,t[75]=we,t[76]=Y,t[77]=Te,t[78]=X):X=t[78];let Ee;t[79]!==xe||t[80]!==X?(Ee=(0,$.jsxs)(ke,{children:[xe,X]}),t[79]=xe,t[80]=X,t[81]=Ee):Ee=t[81];let Oe;t[82]!==T||t[83]!==v||t[84]!==u||t[85]!==b?(Oe=T||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ze,{className:`my-1 border-t border-edge`}),(0,$.jsx)(Ie,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg-muted outline-none data-[highlighted]:bg-surface-hover`,onSelect:v,children:b?`重置筛选`:`Reset filters`})]}):null,t[82]=T,t[83]=v,t[84]=u,t[85]=b,t[86]=Oe):Oe=t[86];let je;t[87]!==re||t[88]!==le||t[89]!==ue||t[90]!==ge||t[91]!==ve||t[92]!==Ee||t[93]!==Oe?(je=(0,$.jsx)(Pe,{children:(0,$.jsxs)(Re,{align:`end`,sideOffset:6,className:Ct,children:[re,le,W,ue,ge,_e,ve,Ee,Oe]})}),t[87]=re,t[88]=le,t[89]=ue,t[90]=ge,t[91]=ve,t[92]=Ee,t[93]=Oe,t[94]=je):je=t[94];let Be;t[95]!==I||t[96]!==je?(Be=(0,$.jsxs)(Me,{children:[I,je]}),t[95]=I,t[96]=je,t[97]=Be):Be=t[97];let Ve=b?`搜索任务`:`Search tasks`,He=b?`搜索任务`:`Search tasks`,Ue;t[98]!==D||t[99]!==w?(Ue=()=>{w?D():(S(!0),requestAnimationFrame(()=>C.current?.focus()))},t[98]=D,t[99]=w,t[100]=Ue):Ue=t[100];let We=w&&`bg-surface-hover text-fg`,Z;t[101]===We?Z=t[102]:(Z=q(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,We),t[101]=We,t[102]=Z);let Ge;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,$.jsx)(K,{className:`size-4`,"aria-hidden":!0}),t[103]=Ge):Ge=t[103];let Ke;t[104]!==w||t[105]!==Ve||t[106]!==He||t[107]!==Ue||t[108]!==Z?(Ke=(0,$.jsx)(`button`,{ref:ee,type:`button`,"aria-label":Ve,title:He,"aria-expanded":w,onClick:Ue,className:Z,children:Ge}),t[104]=w,t[105]=Ve,t[106]=He,t[107]=Ue,t[108]=Z,t[109]=Ke):Ke=t[109];let qe;t[110]!==Be||t[111]!==Ke?(qe=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[Be,Ke]}),t[110]=Be,t[111]=Ke,t[112]=qe):qe=t[112];let Je;t[113]!==k||t[114]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[k,qe]}),t[113]=k,t[114]=qe,t[115]=Je):Je=t[115];let Ye;t[116]!==r.filters.markAllRead||t[117]!==f||t[118]!==y||t[119]!==d?(Ye=d>0?(0,$.jsxs)(`button`,{type:`button`,disabled:f,onClick:y,className:`flex min-h-9 w-full items-center gap-2 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50`,"aria-busy":f,children:[f?(0,$.jsx)(H,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(j,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.filters.markAllRead]}):null,t[116]=r.filters.markAllRead,t[117]=f,t[118]=y,t[119]=d,t[120]=Ye):Ye=t[120];let Xe;t[121]!==D||t[122]!==_||t[123]!==u||t[124]!==w||t[125]!==b?(Xe=w?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2.5 focus-within:border-accent`,children:[(0,$.jsx)(K,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:C,value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),D())},"aria-label":b?`搜索任务名称或内容`:`Search task names or content`,placeholder:b?`搜索任务…`:`Search tasks…`,className:`min-h-10 min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-subtle`}),(0,$.jsx)(`button`,{type:`button`,"aria-label":b?`关闭搜索`:`Close search`,onClick:D,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(me,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[121]=D,t[122]=_,t[123]=u,t[124]=w,t[125]=b,t[126]=Xe):Xe=t[126];let Ze;return t[127]!==Je||t[128]!==Ye||t[129]!==Xe?(Ze=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Je,Ye,Xe]}),t[127]=Je,t[128]=Ye,t[129]=Xe,t[130]=Ze):Ze=t[130],Ze}function Et(e){return(0,$.jsx)(wt,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var Dt=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`Morning briefing`,`Start each day with your tasks and project updates.`,`每天早上帮我整理当天到期、逾期的任务和项目进展,给出今天的重点。`,`Each morning, summarize my due and overdue tasks and project progress, and suggest priorities.`],[`📝`,`每周工作回顾`,`回顾一周的成果和问题,为下周留出清晰的方向。`,`Weekly review`,`Review the week and find a clear direction for the next.`,`每周五帮我回顾本周完成的任务和项目进展,整理未解决的问题,建议下周的重点。`,`Every Friday, review completed tasks and project progress, unresolved issues, and priorities for next week.`],[`🌱`,`项目进展跟进`,`定期看看项目进度,找出需要你关注的事情。`,`Project check-in`,`Keep an eye on project progress and what needs attention.`,`定期帮我检查项目进度,整理延期、阻塞和需要我决策的事项。先和我确认关注哪个项目以及运行时间。`,`Regularly review a project for delays, blockers, and decisions I need to make. Ask which project and when to run.`],[`🔔`,`重要事项提醒`,`把容易忘记的事情交给提醒,安心专注眼前。`,`A timely reminder`,`Make room to focus by setting a reminder for later.`,`我想安排一个重要事项提醒。请先问我需要提醒什么、什么时候提醒,以及是否重复。`,`Help me schedule a reminder. Ask what to remember, when, and whether it should repeat.`],[`📚`,`笔记整理`,`回看新收集的想法,整理出值得继续推进的线索。`,`Notes roundup`,`Revisit recent ideas and surface useful next steps.`,`每周帮我回顾最近新增的笔记,按主题整理,找出值得继续推进的想法。请先确认时间和范围。`,`Each week, group my recent notes by topic and suggest ideas worth pursuing. Confirm the schedule and scope.`],[`🧭`,`明日工作计划`,`下班前梳理未完成的事,安排明天最重要的三件事。`,`Plan tomorrow`,`Wrap up loose ends and choose tomorrow’s top three priorities.`,`每个工作日下班前,帮我梳理未完成的任务,建议明天最重要的三件事。请先确认具体时间。`,`Before the end of each workday, review unfinished tasks and suggest tomorrow’s top three priorities. Confirm the time.`],[`🗓️`,`月度复盘`,`拉远一点看进展,发现反复出现的问题和新的机会。`,`Monthly reflection`,`Step back to spot progress, recurring problems, and opportunities.`,`每月月底帮我回顾项目和任务的进展,总结成果、反复出现的问题和下个月的重点。请确认运行时间。`,`At the end of each month, review project and task progress, achievements, recurring problems, and priorities. Confirm the schedule.`],[`🎯`,`逾期任务检查`,`定期发现被搁置的事项,让重要的事重新向前。`,`Overdue task check`,`Find neglected tasks and get important work moving again.`,`定期帮我检查逾期任务,按紧迫程度整理,并建议下一步。请先确认运行频率和时间。`,`Regularly review overdue tasks, prioritize them by urgency, and suggest next steps. Confirm the frequency and time.`]];function Ot(e=Math.random){let t=[...Dt];for(let n=t.length-1;n>0;n--){let r=Math.min(n,Math.max(0,Math.floor(e()*(n+1))));[t[n],t[r]]=[t[r],t[n]]}return t.slice(0,6)}function kt({language:e,projectId:t,onOpenConversation:n}){let r=o(),[i,a]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(``),l=async e=>{a(!0),c(``);try{let i=await Ke({projectId:t,prompt:e});n?n(i):r(i)}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}},u=e===`zh`,[d,f]=(0,Q.useState)(Ot),p=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-2 py-10 sm:px-6 md:py-20`,children:[(0,$.jsxs)(`div`,{className:`text-center`,children:[(0,$.jsx)(C,{className:`mx-auto size-10 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:u?`安排任务`:`Schedule a task`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:u?`说说你希望定期完成什么,我们一起安排好。`:`Tell us what you’d like done regularly. We’ll work out the details together.`})]}),(0,$.jsxs)(`div`,{className:`mb-3 mt-10 flex items-center justify-between text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{children:u?`也可以从这些想法开始`:`Or start with an idea`}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>f(Ot()),className:`flex items-center gap-1.5 rounded-md px-2 py-1.5 hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(G,{className:`size-3.5`,"aria-hidden":!0}),u?`换一组`:`More ideas`]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:d.map(e=>(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>void l(u?e[5]:e[6]),className:`flex min-h-28 items-center gap-4 rounded-xl border border-dashed border-edge bg-surface-panel px-5 py-4 transition-colors hover:border-edge-strong hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-2xl`,"aria-hidden":!0,children:e[0]}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:u?e[1]:e[3]}),(0,$.jsx)(`span`,{className:`mt-1 block text-sm leading-5 text-fg-muted`,children:u?e[2]:e[4]})]})]},e[1]))}),(0,$.jsx)(`div`,{className:`mt-6 text-center`,children:(0,$.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>void l(),className:`rounded-md px-3 py-2 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:u?`说说你想安排的其他任务`:`Describe another task`})}),s?(0,$.jsx)(`p`,{role:`alert`,className:`mt-3 text-center text-sm text-danger`,children:s}):null]});return(0,$.jsx)(`section`,{"aria-label":u?`安排任务`:`Schedule a task`,children:p})}function At(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function jt(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function Mt(e,t={}){let n=At(e.split(`
3
3
  `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
4
4
  `));if(!n)return null;if(n.type===`text_delta`&&typeof n.delta==`string`)return t.onDelta?.(n.delta),null;if(n.type===`thinking_delta`&&typeof n.delta==`string`)return t.onThinkingDelta?.(n.delta),null;if(n.type===`done`&&typeof n.text==`string`)return n.text;if(n.type===`error`)throw Error(jt(n));return null}async function Nt(e,t={}){let n=await c(l(`/api/ai/text-assist`),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(e)});if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message;throw Error(t||`AI suggestion failed (${n.status})`)}if(!n.body){let e=await n.json().catch(()=>null);if(e?.text)return e;throw Error(`AI suggestion stream is empty`)}let r=n.body.getReader(),i=new TextDecoder,a=``,o=``,s=``;for(;;){let{done:e,value:n}=await r.read();if(n){a+=i.decode(n,{stream:!e});let r=a.split(/\r?\n\r?\n/);a=r.pop()??``;for(let e of r){let n=Mt(e,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});n!==null&&(o=n)}}if(e)break}if(a.trim()){let e=Mt(a,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});e!==null&&(o=e)}let u=o.trim();if(!u)throw Error(`AI returned an empty suggestion`);return{text:u,thinking:s.trim()||void 0}}function Pt(){let[e,t]=(0,Q.useState)(``),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null);return{suggestion:e,thinking:n,loading:i,error:o,generate:(0,Q.useCallback)(async e=>{a(!0),s(null),t(``),r(``);try{let n=await Nt(e,{onDelta:e=>{t(t=>t+e)},onThinkingDelta:e=>{r(t=>t+e)}});return t(n.text),r(n.thinking??``),n.text}catch(e){let t=e instanceof Error?e.message:`AI suggestion failed`;return s(t),null}finally{a(!1)}},[]),reset:(0,Q.useCallback)(()=>{t(``),r(``),s(null),a(!1)},[])}}var Ft=5;function It(e){return e.startsWith(`zh`)?{title:`AI 优化文案`,buttonTitle:`优化文案`,current:`当前内容`,suggestion:`AI 建议`,editedSuggestion:`审核并编辑建议`,thinking:`模型思考`,thinkingLoading:`思考中`,edit:`编辑`,preview:`预览`,loading:`正在生成建议...`,empty:`暂无内容`,generate:`生成建议`,regenerate:`重新生成`,applyCurrent:`应用当前内容`,replace:`替换`,append:`追加`,cancel:`取消`,close:`关闭`}:{title:`AI text assist`,buttonTitle:`Improve text`,current:`Current`,suggestion:`Suggestion`,editedSuggestion:`Review and edit suggestion`,thinking:`Model thinking`,thinkingLoading:`Thinking`,edit:`Edit`,preview:`Preview`,loading:`Generating suggestion...`,empty:`No content`,generate:`Generate suggestion`,regenerate:`Regenerate`,applyCurrent:`Apply current`,replace:`Replace`,append:`Append`,cancel:`Cancel`,close:`Close`}}function Lt(e){let t=(0,ot.c)(245),{value:n,onApply:r,fieldId:i,fieldLabel:a,scenario:o,format:s,intent:c,locale:l,context:u,disabled:d,className:f,showLabel:y}=e,b=o===void 0?`generic.text`:o,x=s===void 0?`plain`:s,S=c===void 0?`improve`:c,C=y===void 0||y,[ee,w]=(0,Q.useState)(!1),[T,E]=(0,Q.useState)(n),[D,O]=(0,Q.useState)(`preview`),[k,A]=(0,Q.useState)(``),[j,M]=(0,Q.useState)(`edit`),[N,P]=(0,Q.useState)(!0),[F,ne]=(0,Q.useState)(!1),[I,L]=(0,Q.useState)(null),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(!0),{suggestion:R,thinking:z,loading:B,error:V,generate:H,reset:se}=Pt(),ce;t[0]===l?ce=t[1]:(ce=It(l),t[0]=l,t[1]=ce);let U=ce,le;t[2]!==B||t[3]!==z?(le=B&&z.trim().length>0,t[2]=B,t[3]=z,t[4]=le):le=t[4];let W=le,K,ue;t[5]!==ee||t[6]!==n?(K=()=>{ee||E(n)},ue=[ee,n],t[5]=ee,t[6]=n,t[7]=K,t[8]=ue):(K=t[7],ue=t[8]),(0,Q.useEffect)(K,ue);let pe,he;t[9]===R?(pe=t[10],he=t[11]):(he=()=>{A(R)},pe=[R],t[9]=R,t[10]=pe,t[11]=he),(0,Q.useEffect)(he,pe);let J,ge;t[12]===z?(J=t[13],ge=t[14]):(J=()=>{z.trim()&&P(!0)},ge=[z],t[12]=z,t[13]=J,t[14]=ge),(0,Q.useEffect)(J,ge);let _e;t[15]!==W||t[16]!==N?(_e=()=>{let e=re.current;!e||!W||!N||ie.current&&(e.scrollTop=e.scrollHeight)},t[15]=W,t[16]=N,t[17]=_e):_e=t[17];let ve;t[18]!==W||t[19]!==z||t[20]!==N?(ve=[W,z,N],t[18]=W,t[19]=z,t[20]=N,t[21]=ve):ve=t[21],(0,Q.useLayoutEffect)(_e,ve);let ye;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>{let e=re.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;ie.current=t<=Ft},t[22]=ye):ye=t[22];let be=ye,xe;t[23]!==u||t[24]!==i||t[25]!==a||t[26]!==x||t[27]!==H||t[28]!==S||t[29]!==l||t[30]!==b?(xe=async e=>{M(`edit`),P(!0),ie.current=!0,await H({intent:S,scenario:b,input:e,locale:l,field:{id:i,label:a,format:x},context:u})},t[23]=u,t[24]=i,t[25]=a,t[26]=x,t[27]=H,t[28]=S,t[29]=l,t[30]=b,t[31]=xe):xe=t[31];let Se=xe,we;t[32]!==se||t[33]!==n?(we=e=>{ne(!!e.currentTarget.closest(`[role="dialog"]`)),L(document.querySelector(`.app-main-surface`)),E(n),O(`preview`),A(``),M(`edit`),P(!0),se(),w(!0)},t[32]=se,t[33]=n,t[34]=we):we=t[34];let Y=we,Te;t[35]!==T||t[36]!==Se?(Te=async()=>{await Se(T)},t[35]=T,t[36]=Se,t[37]=Te):Te=t[37];let Ee=Te,De;t[38]!==se||t[39]!==n?(De=()=>{w(!1),E(n),O(`preview`),A(``),M(`edit`),P(!0),se()},t[38]=se,t[39]=n,t[40]=De):De=t[40];let Oe=De,ke;t[41]!==Oe||t[42]!==T||t[43]!==r?(ke=()=>{r(T),Oe()},t[41]=Oe,t[42]=T,t[43]=r,t[44]=ke):ke=t[44];let Ae=ke,je;t[45]!==Oe||t[46]!==k||t[47]!==r?(je=()=>{k.trim()&&(r(k),Oe())},t[45]=Oe,t[46]=k,t[47]=r,t[48]=je):je=t[48];let Me=je,Ne;t[49]!==Oe||t[50]!==T||t[51]!==k||t[52]!==r?(Ne=()=>{if(!k.trim())return;let e=T.trimEnd();r(e?`${e}\n\n${k}`:k),Oe()},t[49]=Oe,t[50]=T,t[51]=k,t[52]=r,t[53]=Ne):Ne=t[53];let Pe=Ne,Fe;t[54]!==k||t[55]!==V||t[56]!==B?(Fe=!B&&!V&&k.trim().length>0,t[54]=k,t[55]=V,t[56]=B,t[57]=Fe):Fe=t[57];let Ie=Fe,Le=T!==n,Re;t[58]!==k||t[59]!==V||t[60]!==z?(Re=k.trim().length>0||z.trim().length>0||!!V,t[58]=k,t[59]=V,t[60]=z,t[61]=Re):Re=t[61];let ze=Re,Be=!C&&`size-7 p-0`,Ve;t[62]!==f||t[63]!==Be?(Ve=q(`h-7 gap-1 px-2 text-xs`,Be,f),t[62]=f,t[63]=Be,t[64]=Ve):Ve=t[64];let He=d||B,Ue;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,$.jsx)(de,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=Ue):Ue=t[65];let We=C?U.buttonTitle:null,Z;t[66]!==U.buttonTitle||t[67]!==Y||t[68]!==Ve||t[69]!==He||t[70]!==We?(Z=(0,$.jsxs)(Ce,{type:`button`,variant:`ghost`,className:Ve,title:U.buttonTitle,"aria-label":U.buttonTitle,disabled:He,onClick:Y,children:[Ue,We]}),t[66]=U.buttonTitle,t[67]=Y,t[68]=Ve,t[69]=He,t[70]=We,t[71]=Z):Z=t[71];let Ge;t[72]===Oe?Ge=t[73]:(Ge=e=>e?w(!0):Oe(),t[72]=Oe,t[73]=Ge);let Ke=I??void 0,qe=F?`bg-transparent`:`bg-scrim`,Je;t[74]===qe?Je=t[75]:(Je=q(`xopc-dialog-overlay absolute inset-0 z-[80]`,qe),t[74]=qe,t[75]=Je);let Ye;t[76]===Je?Ye=t[77]:(Ye=(0,$.jsx)(p,{className:Je}),t[76]=Je,t[77]=Ye);let Xe;t[78]===U.title?Xe=t[79]:(Xe=(0,$.jsx)(_,{className:`text-base font-semibold text-fg`,children:U.title}),t[78]=U.title,t[79]=Xe);let Ze;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,$.jsx)(me,{className:`size-5`,strokeWidth:1.75}),t[80]=Ze):Ze=t[80];let Qe;t[81]===U.close?Qe=t[82]:(Qe=(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(Ce,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":U.close,children:Ze})}),t[81]=U.close,t[82]=Qe);let $e;t[83]!==Xe||t[84]!==Qe?($e=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[Xe,Qe]}),t[83]=Xe,t[84]=Qe,t[85]=$e):$e=t[85];let et;t[86]===U.current?et=t[87]:(et=(0,$.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:U.current}),t[86]=U.current,t[87]=et);let tt=U.current,nt=D===`edit`,rt=D===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,it;t[88]===rt?it=t[89]:(it=q(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,rt),t[88]=rt,t[89]=it);let at,st;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(at=()=>O(`edit`),st=(0,$.jsx)(fe,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[90]=at,t[91]=st):(at=t[90],st=t[91]);let ct;t[92]!==U.edit||t[93]!==nt||t[94]!==it?(ct=(0,$.jsxs)(`button`,{"aria-pressed":nt,type:`button`,className:it,onClick:at,children:[st,U.edit]}),t[92]=U.edit,t[93]=nt,t[94]=it,t[95]=ct):ct=t[95];let lt=D===`preview`,ut=D===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,dt;t[96]===ut?dt=t[97]:(dt=q(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,ut),t[96]=ut,t[97]=dt);let ft,pt;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(ft=()=>O(`preview`),pt=(0,$.jsx)(ae,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[98]=ft,t[99]=pt):(ft=t[98],pt=t[99]);let mt;t[100]!==U.preview||t[101]!==lt||t[102]!==dt?(mt=(0,$.jsxs)(`button`,{"aria-pressed":lt,type:`button`,className:dt,onClick:ft,children:[pt,U.preview]}),t[100]=U.preview,t[101]=lt,t[102]=dt,t[103]=mt):mt=t[103];let ht;t[104]!==U.current||t[105]!==ct||t[106]!==mt?(ht=(0,$.jsxs)(X,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":tt,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[ct,mt]}),t[104]=U.current,t[105]=ct,t[106]=mt,t[107]=ht):ht=t[107];let gt;t[108]!==et||t[109]!==ht?(gt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[et,ht]}),t[108]=et,t[109]=ht,t[110]=gt):gt=t[110];let _t;t[111]!==T||t[112]!==D||t[113]!==x||t[114]!==U.current||t[115]!==U.empty?(_t=D===`preview`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:x===`markdown`?(0,$.jsx)(oe,{content:T||U.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:T||U.empty})}):(0,$.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25`,value:T,onChange:e=>E(e.currentTarget.value),placeholder:U.empty,"aria-label":U.current}),t[111]=T,t[112]=D,t[113]=x,t[114]=U.current,t[115]=U.empty,t[116]=_t):_t=t[116];let vt;t[117]!==gt||t[118]!==_t?(vt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[gt,_t]}),t[117]=gt,t[118]=_t,t[119]=vt):vt=t[119];let yt;t[120]===U.editedSuggestion?yt=t[121]:(yt=(0,$.jsx)(`span`,{children:U.editedSuggestion}),t[120]=U.editedSuggestion,t[121]=yt);let bt;t[122]!==U.loading||t[123]!==B?(bt=B?(0,$.jsx)(`span`,{className:`ml-2 font-normal`,children:U.loading}):null,t[122]=U.loading,t[123]=B,t[124]=bt):bt=t[124];let xt;t[125]!==yt||t[126]!==bt?(xt=(0,$.jsxs)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:[yt,bt]}),t[125]=yt,t[126]=bt,t[127]=xt):xt=t[127];let St=U.editedSuggestion,Ct=j===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,wt;t[128]===Ct?wt=t[129]:(wt=q(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ct),t[128]=Ct,t[129]=wt);let Tt=j===`edit`,Et,Dt;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>M(`edit`),Dt=(0,$.jsx)(fe,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[130]=Et,t[131]=Dt):(Et=t[130],Dt=t[131]);let Ot;t[132]!==U.edit||t[133]!==wt||t[134]!==Tt?(Ot=(0,$.jsxs)(`button`,{type:`button`,className:wt,"aria-pressed":Tt,onClick:Et,children:[Dt,U.edit]}),t[132]=U.edit,t[133]=wt,t[134]=Tt,t[135]=Ot):Ot=t[135];let kt=j===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,At;t[136]===kt?At=t[137]:(At=q(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,kt),t[136]=kt,t[137]=At);let jt=j===`preview`,Mt,Nt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=()=>M(`preview`),Nt=(0,$.jsx)(ae,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[138]=Mt,t[139]=Nt):(Mt=t[138],Nt=t[139]);let Lt;t[140]!==U.preview||t[141]!==At||t[142]!==jt?(Lt=(0,$.jsxs)(`button`,{type:`button`,className:At,"aria-pressed":jt,onClick:Mt,children:[Nt,U.preview]}),t[140]=U.preview,t[141]=At,t[142]=jt,t[143]=Lt):Lt=t[143];let Bt;t[144]!==U.editedSuggestion||t[145]!==Ot||t[146]!==Lt?(Bt=(0,$.jsxs)(X,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,role:`group`,"aria-label":St,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[Ot,Lt]}),t[144]=U.editedSuggestion,t[145]=Ot,t[146]=Lt,t[147]=Bt):Bt=t[147];let Vt;t[148]!==xt||t[149]!==Bt?(Vt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[xt,Bt]}),t[148]=xt,t[149]=Bt,t[150]=Vt):Vt=t[150];let Ht=W?`opacity-100`:`pointer-events-none opacity-0`,Ut;t[151]===Ht?Ut=t[152]:(Ut=q(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Ht),t[151]=Ht,t[152]=Ut);let Wt=!W,Gt;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=()=>P(Rt),t[153]=Gt):Gt=t[153];let Kt;t[154]!==U.thinkingLoading||t[155]!==B?(Kt=B?(0,$.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,U.thinkingLoading]}):null,t[154]=U.thinkingLoading,t[155]=B,t[156]=Kt):Kt=t[156];let qt;t[157]!==U.thinking||t[158]!==Kt?(qt=(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[U.thinking,Kt]}),t[157]=U.thinking,t[158]=Kt,t[159]=qt):qt=t[159];let Jt=N&&`rotate-180`,Yt;t[160]===Jt?Yt=t[161]:(Yt=q(`size-3.5 shrink-0 transition-transform`,Jt),t[160]=Jt,t[161]=Yt);let Xt;t[162]===Yt?Xt=t[163]:(Xt=(0,$.jsx)(te,{className:Yt,strokeWidth:1.75,"aria-hidden":!0}),t[162]=Yt,t[163]=Xt);let Zt;t[164]!==qt||t[165]!==Xt?(Zt=(0,$.jsxs)(`button`,{type:`button`,className:`flex shrink-0 items-center justify-between gap-2 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:text-fg`,onClick:Gt,children:[qt,Xt]}),t[164]=qt,t[165]=Xt,t[166]=Zt):Zt=t[166];let Qt;t[167]!==z||t[168]!==N?(Qt=N?(0,$.jsx)(`pre`,{ref:re,className:`min-h-0 flex-1 overflow-auto border-t border-edge px-2.5 py-2 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,onScroll:be,children:z}):null,t[167]=z,t[168]=N,t[169]=Qt):Qt=t[169];let $t;t[170]!==Zt||t[171]!==Qt?($t=(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col rounded-lg border border-edge bg-surface-inset/70`,children:[Zt,Qt]}),t[170]=Zt,t[171]=Qt,t[172]=$t):$t=t[172];let en;t[173]!==Ut||t[174]!==Wt||t[175]!==$t?(en=(0,$.jsx)(`div`,{className:Ut,"aria-hidden":Wt,children:$t}),t[173]=Ut,t[174]=Wt,t[175]=$t,t[176]=en):en=t[176];let tn=W?`pointer-events-none opacity-0`:`opacity-100`,nn;t[177]===tn?nn=t[178]:(nn=q(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,tn),t[177]=tn,t[178]=nn);let rn;t[179]!==k||t[180]!==V||t[181]!==x||t[182]!==U.empty||t[183]!==U.loading||t[184]!==U.suggestion||t[185]!==B||t[186]!==j?(rn=V?(0,$.jsx)(`pre`,{className:`h-full min-h-0 overflow-auto whitespace-pre-wrap rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg-muted`,children:V}):j===`preview`?(0,$.jsx)(`div`,{className:`h-full min-h-0 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:B&&!k.trim()?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:U.loading}):x===`markdown`?(0,$.jsx)(oe,{content:k||U.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:k||U.empty})}):(0,$.jsx)(`textarea`,{className:`h-full min-h-0 w-full resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25 disabled:text-fg-muted`,value:k,onChange:e=>A(e.currentTarget.value),disabled:B,placeholder:B?U.loading:U.empty,"aria-label":U.suggestion}),t[179]=k,t[180]=V,t[181]=x,t[182]=U.empty,t[183]=U.loading,t[184]=U.suggestion,t[185]=B,t[186]=j,t[187]=rn):rn=t[187];let an;t[188]!==nn||t[189]!==rn?(an=(0,$.jsx)(`div`,{className:nn,children:rn}),t[188]=nn,t[189]=rn,t[190]=an):an=t[190];let on;t[191]!==en||t[192]!==an?(on=(0,$.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[en,an]}),t[191]=en,t[192]=an,t[193]=on):on=t[193];let sn;t[194]!==Vt||t[195]!==on?(sn=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[Vt,on]}),t[194]=Vt,t[195]=on,t[196]=sn):sn=t[196];let cn;t[197]!==vt||t[198]!==sn?(cn=(0,$.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-hidden p-4 md:grid-cols-2`,children:[vt,sn]}),t[197]=vt,t[198]=sn,t[199]=cn):cn=t[199];let ln;t[200]!==Oe||t[201]!==U.cancel?(ln=(0,$.jsx)(Ce,{type:`button`,variant:`secondary`,onClick:Oe,children:U.cancel}),t[200]=Oe,t[201]=U.cancel,t[202]=ln):ln=t[202];let un=!Le,dn;t[203]!==Ae||t[204]!==U.applyCurrent||t[205]!==un?(dn=(0,$.jsx)(Ce,{type:`button`,variant:`secondary`,disabled:un,onClick:Ae,children:U.applyCurrent}),t[203]=Ae,t[204]=U.applyCurrent,t[205]=un,t[206]=dn):dn=t[206];let fn;t[207]===Ee?fn=t[208]:(fn=()=>void Ee(),t[207]=Ee,t[208]=fn);let pn;t[209]===ze?pn=t[210]:(pn=ze?(0,$.jsx)(G,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,$.jsx)(de,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[209]=ze,t[210]=pn);let mn=ze?U.regenerate:U.generate,hn;t[211]!==B||t[212]!==pn||t[213]!==mn||t[214]!==fn?(hn=(0,$.jsxs)(Ce,{type:`button`,variant:`secondary`,disabled:B,onClick:fn,children:[pn,mn]}),t[211]=B,t[212]=pn,t[213]=mn,t[214]=fn,t[215]=hn):hn=t[215];let gn=!Ie,_n;t[216]!==Pe||t[217]!==U.append||t[218]!==gn?(_n=(0,$.jsx)(Ce,{type:`button`,variant:`secondary`,disabled:gn,onClick:Pe,children:U.append}),t[216]=Pe,t[217]=U.append,t[218]=gn,t[219]=_n):_n=t[219];let vn=!Ie,yn;t[220]!==Me||t[221]!==U.replace||t[222]!==vn?(yn=(0,$.jsx)(Ce,{type:`button`,variant:`primary`,disabled:vn,onClick:Me,children:U.replace}),t[220]=Me,t[221]=U.replace,t[222]=vn,t[223]=yn):yn=t[223];let bn;t[224]!==hn||t[225]!==_n||t[226]!==yn||t[227]!==ln||t[228]!==dn?(bn=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[ln,dn,hn,_n,yn]}),t[224]=hn,t[225]=_n,t[226]=yn,t[227]=ln,t[228]=dn,t[229]=bn):bn=t[229];let xn;t[230]!==bn||t[231]!==$e||t[232]!==cn?(xn=(0,$.jsx)(`div`,{className:`absolute inset-0 z-[80] flex items-center justify-center p-4 pointer-events-none`,children:(0,$.jsxs)(g,{className:`xopc-dialog-content-pane pointer-events-auto flex h-[min(78vh,38rem)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,onOpenAutoFocus:zt,children:[$e,cn,bn]})}),t[230]=bn,t[231]=$e,t[232]=cn,t[233]=xn):xn=t[233];let Sn;t[234]!==xn||t[235]!==Ke||t[236]!==Ye?(Sn=(0,$.jsxs)(h,{container:Ke,children:[Ye,xn]}),t[234]=xn,t[235]=Ke,t[236]=Ye,t[237]=Sn):Sn=t[237];let Cn;t[238]!==ee||t[239]!==Sn||t[240]!==Ge?(Cn=(0,$.jsx)(v,{open:ee,onOpenChange:Ge,children:Sn}),t[238]=ee,t[239]=Sn,t[240]=Ge,t[241]=Cn):Cn=t[241];let wn;return t[242]!==Cn||t[243]!==Z?(wn=(0,$.jsxs)($.Fragment,{children:[Z,Cn]}),t[242]=Cn,t[243]=Z,t[244]=wn):wn=t[244],wn}function Rt(e){return!e}function zt(e){return e.preventDefault()}function Bt(e){return e.management!==void 0&&e.management.owner!==`observation`}function Vt(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...We,name:n.name,instruction:t===`reminder`?``:n.instruction,triggerMode:t===`reminder`?`once`:t===`review`?`weekly`:`daily`,time:t===`brief`?`08:30`:t===`review`?`17:00`:`09:00`,weekday:`5`,notificationPolicy:`all`}}})}var Ht=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-2 focus-visible:outline-accent`;function Ut(e){let t=(0,ot.c)(99),{form:n,setForm:r,labels:i,projects:a,projectLocked:o,source:s,requiresProject:c}=e,l;t[0]===r?l=t[1]:(l=e=>r(t=>({...t,...e})),t[0]=r,t[1]=l);let u=l,d;t[2]!==i.experience.source||t[3]!==s?(d=(0,$.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[i.experience.source,`: `,s]}),t[2]=i.experience.source,t[3]=s,t[4]=d):d=t[4];let f;t[5]===u?f=t[6]:(f=e=>u({name:e.target.value}),t[5]=u,t[6]=f);let p;t[7]!==n.name||t[8]!==f?(p=(0,$.jsx)(`input`,{className:Ht,value:n.name,onChange:f}),t[7]=n.name,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==i.form.name||t[11]!==p?(m=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.name,p]}),t[10]=i.form.name,t[11]=p,t[12]=m):m=t[12];let h;t[13]===u?h=t[14]:(h=e=>u({instruction:e.target.value}),t[13]=u,t[14]=h);let g;t[15]!==n.instruction||t[16]!==h?(g=(0,$.jsx)(`textarea`,{className:Ht,rows:5,value:n.instruction,onChange:h}),t[15]=n.instruction,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==i.info.task||t[19]!==g?(_=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.info.task,g]}),t[18]=i.info.task,t[19]=g,t[20]=_):_=t[20];let v;t[21]!==n.projectId||t[22]!==i.form.noProject||t[23]!==i.form.project||t[24]!==o||t[25]!==a||t[26]!==u?(v=!o&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.project,(0,$.jsxs)(I,{className:Ht,value:n.projectId,onChange:e=>u({projectId:e.target.value}),children:[(0,$.jsx)(L,{value:``,children:i.form.noProject}),a.map(Wt)]})]}),t[21]=n.projectId,t[22]=i.form.noProject,t[23]=i.form.project,t[24]=o,t[25]=a,t[26]=u,t[27]=v):v=t[27];let y;t[28]!==n.projectId||t[29]!==i.experience.projectRequired||t[30]!==c?(y=c&&!n.projectId?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:i.experience.projectRequired}):null,t[28]=n.projectId,t[29]=i.experience.projectRequired,t[30]=c,t[31]=y):y=t[31];let b;t[32]===u?b=t[33]:(b=e=>u({triggerMode:e.target.value}),t[32]=u,t[33]=b);let x;t[34]===i.trigger.once?x=t[35]:(x=(0,$.jsx)(L,{value:`once`,children:i.trigger.once}),t[34]=i.trigger.once,t[35]=x);let S;t[36]===i.trigger.daily?S=t[37]:(S=(0,$.jsx)(L,{value:`daily`,children:i.trigger.daily}),t[36]=i.trigger.daily,t[37]=S);let C;t[38]===i.trigger.weekly?C=t[39]:(C=(0,$.jsx)(L,{value:`weekly`,children:i.trigger.weekly}),t[38]=i.trigger.weekly,t[39]=C);let ee;t[40]!==n.triggerMode||t[41]!==b||t[42]!==x||t[43]!==S||t[44]!==C?(ee=(0,$.jsxs)(I,{className:Ht,value:n.triggerMode,onChange:b,children:[x,S,C]}),t[40]=n.triggerMode,t[41]=b,t[42]=x,t[43]=S,t[44]=C,t[45]=ee):ee=t[45];let w;t[46]!==i.form.trigger||t[47]!==ee?(w=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.trigger,ee]}),t[46]=i.form.trigger,t[47]=ee,t[48]=w):w=t[48];let T;t[49]!==n.onceAt||t[50]!==n.time||t[51]!==n.triggerMode||t[52]!==i.form.onceAt||t[53]!==i.form.time||t[54]!==u?(T=n.triggerMode===`once`?(0,$.jsx)(et,{label:i.form.onceAt,value:n.onceAt,defaultTime:n.time,onChange:e=>u({onceAt:e})}):(0,$.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:i.form.time}),(0,$.jsx)($e,{value:n.time,onChange:e=>u({time:e}),ariaLabel:i.form.time})]}),t[49]=n.onceAt,t[50]=n.time,t[51]=n.triggerMode,t[52]=i.form.onceAt,t[53]=i.form.time,t[54]=u,t[55]=T):T=t[55];let E;t[56]!==n.triggerMode||t[57]!==n.weekday||t[58]!==i.form.day||t[59]!==i.weekdays||t[60]!==u?(E=n.triggerMode===`weekly`&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,$.jsx)(I,{className:Ht,value:n.weekday,onChange:e=>u({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,$.jsx)(L,{value:String(t),children:i.weekdays[e]},e))})]}),t[56]=n.triggerMode,t[57]=n.weekday,t[58]=i.form.day,t[59]=i.weekdays,t[60]=u,t[61]=E):E=t[61];let D;t[62]!==w||t[63]!==T||t[64]!==E?(D=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[w,T,E]}),t[62]=w,t[63]=T,t[64]=E,t[65]=D):D=t[65];let O;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(O=n.triggerMode===`once`&&n.onceAt&&new Date(n.onceAt).getTime()<=Date.now()?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-red-700 dark:text-red-300`,children:i.experience.futureTime}):null,t[66]=n.onceAt,t[67]=n.triggerMode,t[68]=i.experience.futureTime,t[69]=O):O=t[69];let k;t[70]===i.experience.scheduleNote?k=t[71]:(k=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=k);let A;t[72]===u?A=t[73]:(A=e=>u({notificationPolicy:e.target.value}),t[72]=u,t[73]=A);let j;t[74]===i.draft.notifyAll?j=t[75]:(j=(0,$.jsx)(L,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=j);let M;t[76]===i.draft.notifyAttention?M=t[77]:(M=(0,$.jsx)(L,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=M);let N;t[78]===i.draft.notifyNone?N=t[79]:(N=(0,$.jsx)(L,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=N);let P;t[80]!==n.notificationPolicy||t[81]!==A||t[82]!==j||t[83]!==M||t[84]!==N?(P=(0,$.jsxs)(I,{className:Ht,value:n.notificationPolicy,onChange:A,children:[j,M,N]}),t[80]=n.notificationPolicy,t[81]=A,t[82]=j,t[83]=M,t[84]=N,t[85]=P):P=t[85];let F;t[86]!==i.draft.notifications||t[87]!==P?(F=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.draft.notifications,P]}),t[86]=i.draft.notifications,t[87]=P,t[88]=F):F=t[88];let te;return t[89]!==y||t[90]!==D||t[91]!==d||t[92]!==O||t[93]!==k||t[94]!==F||t[95]!==m||t[96]!==_||t[97]!==v?(te=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[d,m,_,v,y,D,O,k,F]}),t[89]=y,t[90]=D,t[91]=d,t[92]=O,t[93]=k,t[94]=F,t[95]=m,t[96]=_,t[97]=v,t[98]=te):te=t[98],te}function Wt(e){return(0,$.jsx)(L,{value:e.id,children:e.name},e.id)}var Gt=`xopc.automations.dismissedExecutionIssues`;function Kt(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(Gt)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function qt(e,t,n){return e?E(e,n):t.never}function Jt(e,t){return e.kind===`routine`?`Routine · v${e.version}`:e.kind===`system`?e.capability===`home.advisor.refresh`?`Home AI suggestions refresh`:e.capability===`memory.temporal_sweep`?`Memory temporal sweep`:e.capability===`memory.daily_reconciliation`?`Memory daily reconciliation`:`Memory weekly knowledge maintenance`:e.kind===`task_command`?t.action.taskWithId.replace(`{id}`,e.taskId):e.agentId?t.action.agentWithId.replace(`{id}`,e.agentId):t.action.agent}function Yt(e,t){return e===`task_command`?t.action.runTask:t.action.runAgent}function Xt(e){return e.safety?.mode??`auto_apply`}function Zt(e){return e===`succeeded`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`failed`||e===`timeout`?`bg-red-500/10 text-red-700 dark:text-red-300`:e===`running`||e===`queued`||e===`cancelling`?`bg-blue-500/10 text-blue-700 dark:text-blue-300`:`bg-surface-hover text-fg-muted`}function Qt(e,t){if(e==null)return t.never;if(e<1e3)return`${e}ms`;let n=Math.round(e/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m ${n%60}s`}function $t(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function en(e){return e.status===`failed`||e.status===`timeout`}function tn(e,t){return e.action.kind===`system`?Jt(e.action,t):e.action.kind===`agent`?e.action.instruction:(e.action.kind,Jt(e.action,t))}function nn(e){return e.description?.trim()??``}function rn(e){return $t(e)?0:en(e)?1:e.status===`succeeded`?2:3}function an(e){return[...e].sort((e,t)=>{let n=rn(e)-rn(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function on(){let e=(0,ot.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`section`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-edge-subtle bg-edge-subtle xl:grid-cols-4`,children:Array.from({length:4}).map(cn)}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,$.jsx)(J,{className:`h-4 w-36`}),(0,$.jsx)(J,{className:`h-3 w-56 max-w-full`})]}),(0,$.jsx)(J,{className:`h-7 w-20 rounded-full`})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-inset p-4`,children:[n,(0,$.jsx)(`div`,{className:`mt-4 grid gap-2`,children:Array.from({length:6}).map(sn)})]}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(J,{className:`h-4 w-32`}),a=(0,$.jsx)(J,{className:`mt-4 h-24 rounded-lg`}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let o;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4`,"aria-hidden":`true`,children:[t,(0,$.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-3 md:grid-cols-[15rem_minmax(0,1fr)] md:grid-rows-1 lg:grid-cols-[17rem_minmax(0,1fr)]`,children:[r,(0,$.jsxs)(`section`,{className:`hidden rounded-xl border border-edge-subtle p-4 xl:block`,children:[i,a,(0,$.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,$.jsx)(J,{className:`h-12 rounded-lg`}),(0,$.jsx)(J,{className:`h-12 rounded-lg`}),(0,$.jsx)(J,{className:`h-12 rounded-lg`})]})]})]})]}),e[5]=o):o=e[5],o}function sn(e,t){return(0,$.jsx)(`div`,{className:`rounded-lg p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(J,{className:`size-4 rounded-full`}),(0,$.jsx)(J,{className:`h-4 w-32`}),(0,$.jsx)(J,{className:`h-5 w-20 rounded-full`})]}),(0,$.jsx)(J,{className:`mt-3 h-4 w-full`}),(0,$.jsx)(J,{className:`mt-2 h-4 w-3/5`})]}),(0,$.jsx)(J,{className:`h-8 w-24 rounded-md`})]})},t)}function cn(e,t){return(0,$.jsxs)(`div`,{className:`flex min-h-12 items-center gap-2.5 bg-surface-base px-3 py-2.5`,children:[(0,$.jsx)(J,{className:`size-4 rounded-full`}),(0,$.jsx)(J,{className:`h-3 w-14`}),(0,$.jsx)(J,{className:`ml-auto h-4 w-10`})]},t)}function ln({projectId:e,embedded:t=!1,title:n,subtitle:r}){let i=d(e=>e.language),o=f(i),s=o.automations,c=o.productNavigation.sections[`automation-triggers`],l=o.cron,u=we(e=>e.setPageHeader),y=we(e=>e.clearPageHeader),[b,x]=a(),S=!t&&b.get(`view`)===`activity`,C=b.get(`run`)?.trim()??``,w=b.get(`view`)===`execution`&&!!C,T=b.get(`automation`)?.trim()??``,E=b.get(`new`)===`1`,D=b.get(`setupChat`)??void 0,O=b.get(`draft`)?.trim()??``,j=b.get(`action`)?.trim()??``,M=b.get(`taskId`)?.trim()??``,N=b.get(`projectId`)?.trim()??``,P=e?.trim()||N,F=!!e?.trim(),te=b.get(`autogenerate`)===`1`,ne=(0,Q.useRef)(``),I=b.get(`status`),L=I===`active`||I===`paused`||I===`completed`||I===`running`||I===`attention`?I:`all`,ie=b.get(`ownership`)===`system`?`system`:`user`,R=b.get(`source`),z=R===`agent`||R===`task_command`?R:`all`,ae=b.get(`q`)??``,B=e=>x(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),V=e=>x(t=>{let n=new URLSearchParams(t);return e===`user`?n.delete(`ownership`):n.set(`ownership`,e),n.delete(`automation`),n}),H=e=>x(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),oe=e=>x(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`source`):n.set(`source`,e),n.delete(`automation`),n}),se=()=>x(e=>{let t=new URLSearchParams(e);return t.delete(`status`),t.delete(`source`),t.delete(`q`),t.delete(`automation`),t}),[ce,U]=(0,Q.useState)(null),[le,G]=(0,Q.useState)(!1),[K,ue]=(0,Q.useState)(`blank`),[de,fe]=(0,Q.useState)(!1),[pe,J]=(0,Q.useState)(null),[_e,ve]=(0,Q.useState)(null),[ye,Te]=(0,Q.useState)(!1),[X,De]=(0,Q.useState)(We),[Oe,ke]=(0,Q.useState)(null),[Ae,je]=(0,Q.useState)(null),[Me,Ne]=(0,Q.useState)(!1),[Pe,Fe]=(0,Q.useState)(null),[Ie,Le]=(0,Q.useState)(``),[Re,ze]=(0,Q.useState)(null),[Be,Ve]=(0,Q.useState)(!1),[He,Z]=(0,Q.useState)(!1),[Ke,qe]=(0,Q.useState)(P),[$e,et]=(0,Q.useState)(`new_session`),[tt,rt]=(0,Q.useState)(`attention`),[at,ot]=(0,Q.useState)(null),[st,lt]=(0,Q.useState)(!1),[ut,dt]=(0,Q.useState)(!1),[ft,mt]=(0,Q.useState)(!1),[ht,gt]=(0,Q.useState)(null),[_t,yt]=(0,Q.useState)(Kt),xt=be([`automations`,P],()=>Y.list(P?{projectId:P}:void 0),{keepPreviousData:!0,refreshInterval:15e3}),St=be([`automation-runs`,P],()=>Y.runs(50,void 0,P?{projectId:P}:void 0),{keepPreviousData:!0,refreshInterval:1e4}),Ct=be(P?`automations-global-system-source`:null,()=>Y.list(),{keepPreviousData:!0,refreshInterval:15e3}),wt=be(P?`automation-runs-global-system-source`:null,()=>Y.runs(50),{keepPreviousData:!0,refreshInterval:1e4}),Et=be(Pe?[`automation-history`,Pe,P]:null,()=>Y.runs(50,Pe,P?{projectId:P}:void 0),{refreshInterval:1e4}),Dt=be(Ae?`automation-run-events:${Ae}`:null,()=>Y.runEvents(Ae),{refreshInterval:5e3}),Ot=be(Ae?[`automation-exact-run`,Ae]:null,()=>Y.getRun(Ae),{refreshInterval:3e3}),At=be(`automation-chat-agents`,Se),jt=be(`automation-tasks`,Y.tasks),Mt=be(`automation-projects`,()=>ge({sortBy:`name`,sortOrder:`asc`,limit:200})),Nt=xt.isLoading&&!xt.data||St.isLoading&&!St.data||!!P&&Ct.isLoading&&!Ct.data||!!P&&wt.isLoading&&!wt.data,Pt=!Nt&&(xt.isLoading||St.isLoading||Ct.isLoading||wt.isLoading),Ft=xt.data?.automations??[],It=P?Ct.data?.automations??[]:Ft,Lt=(0,Q.useMemo)(()=>an(St.data?.runs??[]),[St.data?.runs]),Rt=(0,Q.useMemo)(()=>P?an(wt.data?.runs??[]):Lt,[wt.data?.runs,P,Lt]),zt=(0,Q.useMemo)(()=>Ft.filter(e=>!Bt(e)),[Ft]),Ht=(0,Q.useMemo)(()=>It.filter(Bt),[It]),Wt=(0,Q.useMemo)(()=>[...zt,...Ht],[Ht,zt]),qt=(0,Q.useMemo)(()=>new Set(Ht.map(e=>e.id)),[Ht]),Jt=(0,Q.useMemo)(()=>Lt.filter(e=>!qt.has(e.automationId)),[Lt,qt]),Yt=(0,Q.useMemo)(()=>Rt.filter(e=>qt.has(e.automationId)),[Rt,qt]),Xt=(0,Q.useMemo)(()=>P?[...Lt,...Yt]:Lt,[P,Lt,Yt]),Zt=(0,Q.useMemo)(()=>Ot.data?.run?.id===Ae?Ot.data.run:Xt.find(e=>e.id===Ae)??Et.data?.runs.find(e=>e.id===Ae)??null,[Xt,Ae,Et.data,Ot.data]),Qt=(0,Q.useMemo)(()=>Wt.find(e=>e.id===Pe)??null,[Wt,Pe]),en=(0,Q.useMemo)(()=>Wt.find(e=>e.id===_e)??null,[Wt,_e]),rn=(0,Q.useMemo)(()=>[...Et.data?.runs??Xt].filter(e=>e.automationId===Pe).sort((e,t)=>t.createdAtMs-e.createdAtMs),[Xt,Pe,Et.data]),sn=Dt.data?.events??[],cn=(0,Q.useMemo)(()=>Jt.filter(e=>!$t(e)&&e.readAtMs==null),[Jt]),ln=zt.reduce((e,t)=>e+(xt.data?.executionSummaries?.[t.id]?.unreadCount??0),0),fn=ae.trim().toLocaleLowerCase(),pn=ie===`system`?Ht:zt,mn=ie===`system`?Yt:Jt,hn=(0,Q.useMemo)(()=>new Set(mn.filter($t).map(e=>e.automationId)),[mn]),_n=(0,Q.useMemo)(()=>pn.filter(e=>L===`attention`&&!nt(e,mn)||L===`running`&&!hn.has(e.id)||L===`active`&&!e.enabled||L===`paused`&&(e.enabled||A(e))||L===`completed`&&!A(e)||z!==`all`&&e.action.kind!==z?!1:!fn||[e.name,nn(e),tn(e,s),ee(e.trigger,s,l,i)].some(e=>e.toLocaleLowerCase().includes(fn))),[l,L,s,i,fn,pn,mn,hn,z]),vn=At.data?.items??[],yn=(0,Q.useMemo)(()=>(jt.data?.items??[]).map(e=>e.task),[jt.data]),Sn=Mt.data?.items??[],Cn=!!en?.management?.editable.includes(`trigger`),wn=[`daily`,`weekly`,`interval`,`cron`].includes(X.triggerMode)&&(![`daily`,`weekly`].includes(X.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(X.time))&&(X.triggerMode!==`interval`||k(X.intervalValue,X.intervalUnit)>=6e4)&&(X.triggerMode!==`cron`||!!X.cronExpr.trim()),Tn=Cn?wn:!!X.name.trim()&&(X.triggerMode!==`once`||Number.isFinite(new Date(X.onceAt).getTime())&&(!!en||new Date(X.onceAt).getTime()>Date.now()))&&(![`daily`,`weekly`].includes(X.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(X.time))&&(X.triggerMode!==`event`||!!X.eventType.trim()&&Ye(X.eventPayloadMatch))&&(X.actionMode===`task_command`?!!(X.taskId.trim()&&X.agentId.trim()):!!X.instruction.trim()),En=!0;try{[`daily`,`weekly`,`cron`].includes(X.triggerMode)&&Ze(X)}catch{En=!1}let Dn=Tn&&En,On=(0,Q.useMemo)(()=>Vt(s),[s]),kn=(0,Q.useMemo)(()=>zt.filter(e=>nt(e,Jt)),[zt,Jt]),jn=kn.some(e=>{let t=it(e,Jt);return t!==null&&_t[e.id]!==t}),Mn=(0,Q.useCallback)(()=>{yt(e=>{let t={...e};for(let e of kn){let n=it(e,Jt);n&&(t[e.id]=n)}try{window.localStorage.setItem(Gt,JSON.stringify(t))}catch{}return t})},[kn,Jt]);(0,Q.useEffect)(()=>{if(!Pt){if(E){Fe(null);return}if(T){Fe(T);return}if(_n.length===0){Fe(null);return}Pe&&_n.some(e=>e.id===Pe)||Fe(null)}},[T,_n,E,Pt,Pe]);let Nn=(0,Q.useCallback)(async()=>{await Promise.all([xt.mutate(),St.mutate(),Ct.mutate(),wt.mutate(),Et.mutate(),Dt.mutate(),xe(e=>Array.isArray(e)&&e[0]===`automation-navigation-runs`)])},[xt.mutate,Ct.mutate,wt.mutate,Dt.mutate,St.mutate,Et.mutate]),Pn=(0,Q.useCallback)(e=>{if(F){Fe(null),je(null);return}x(t=>{let n=new URLSearchParams(t);return e?n.set(`projectId`,e):n.delete(`projectId`),n.delete(`automation`),n.delete(`run`),n}),Fe(null),je(null)},[F,x]);(0,Q.useEffect)(()=>{F&&(qe(P),De(e=>e.projectId===P?e:{...e,projectId:P}))},[P,F]);let Fn=(0,Q.useCallback)(e=>{if(e===`blank`&&!M){fe(!0);return}if(ve(null),Te(!1),ke(null),ue(e),G(!0),e===`blank`){De({...We,projectId:P});return}Le(``),ze(null),Z(!1),qe(P),et(`new_session`),rt(`attention`)},[P,M]),In=e=>{U(e),De({...e.form,projectId:P}),ve(null),Te(!1),ke(null),ue(`quick`),G(!0)},Ln=(0,Q.useCallback)(e=>{if(e.action.kind===`agent`&&!e.management){J(e);return}De(Ue(e)),ve(e.id),Te(!1),Fe(null),ue(`blank`),G(!0)},[]),Rn=(0,Q.useCallback)(()=>{Re&&(De({...Ue(Re.automation),projectId:Ke,conversationMode:$e,notificationPolicy:tt}),ve(null),Te(!0),ue(`blank`))},[Re,$e,tt,Ke]),zn=(0,Q.useCallback)(async()=>{mt(!0),ke(null);try{await Nn()}catch(e){let t=e instanceof Error?e.message:String(e);ke(t)}finally{mt(!1)}},[s.feedback.actionFailed,Nn]);(0,Q.useEffect)(()=>{let e=Wt.find(e=>e.id===T);!e||!Bt(e)||ie===`system`||x(e=>{let t=new URLSearchParams(e);return t.set(`ownership`,`system`),t},{replace:!0})},[T,Wt,ie,x]),(0,Q.useEffect)(()=>{j===`create`&&(Fn(`blank`),M&&De(e=>({...e,actionMode:`task_command`,taskId:M,safetyMode:`auto_apply`})),x(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t.delete(`taskId`),t},{replace:!0}))},[j,Fn,x,M]),(0,Q.useEffect)(()=>{if(!O)return;let e=`${i}:${te?`auto`:`seed`}:${O}`;ne.current!==e&&(ne.current=e,Le(O),ze(null),Z(!1),qe(P),ue(`draft`),G(!0),x(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),te&&(ke(null),Ve(!0),Y.draft({prompt:O,language:i}).then(e=>{ze(e.draft),Z(!1)}).catch(e=>{ke(e instanceof Error?e.message:String(e))}).finally(()=>{Ve(!1)})))},[te,O,i,P,x]);let Bn=(0,Q.useCallback)(e=>{let t=Lt.find(t=>t.id===e)??Et.data?.runs.find(t=>t.id===e);if(!t||$t(t)||t.readAtMs!=null)return;let n=Date.now();St.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Et.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Y.markRunRead(e).catch(e=>{ke(e instanceof Error?e.message:String(e)),St.mutate(),Et.mutate()})},[Lt,St.mutate,Et.data,Et.mutate]),Vn=(0,Q.useCallback)(e=>{Bn(e),je(e),Ne(!0),x(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[Bn,x]),Hn=(0,Q.useCallback)(e=>{Fe(e),je(null),Ne(!1),x(t=>{let n=new URLSearchParams(t);n.set(`automation`,e);for(let e of[`new`,`setupChat`,`chatDraft`,`run`,`view`])n.delete(e);return n})},[x]),Un=(0,Q.useCallback)(e=>{Ne(!1),x(t=>{let n=new URLSearchParams(t);n.set(`automation`,e.automationId),n.set(`run`,e.id),n.set(`view`,`execution`);for(let e of[`new`,`setupChat`,`chatDraft`])n.delete(e);return n})},[x]);(0,Q.useEffect)(()=>{je(C||null),Ne(!!C&&!w)},[w,C]),(0,Q.useEffect)(()=>{C&&!w&&Bn(C)},[w,C,Bn]),(0,Q.useEffect)(()=>{ot(null),dt(!1)},[Ae]);async function Wn(){if(ke(null),X.triggerMode===`once`&&!en&&new Date(X.onceAt).getTime()<=Date.now()){ke(s.experience.futureTime);return}if(!(!Dn||ht)&&!(K===`quick`&&ce?.requiresProject&&!X.projectId)){if(ye&&Re){gt(`draft:edit`);try{let e=Qe(X),{simulation:t}=await Y.simulate(e);ze({...Re,automation:e,simulation:t}),qe(X.projectId),et(X.conversationMode),rt(X.notificationPolicy),Z(!1),Te(!1),ue(`draft`)}catch(e){let t=e instanceof Error?e.message:String(e);ke(t)}finally{gt(null)}return}if(en){let e=en.id;await Gn(`automation:${e}:edit`,()=>Y.update(e,{...Cn?{trigger:Ge(en,{...X,instruction:`managed`}).trigger}:Ge(en,X),expectedRevision:en.updatedAtMs}))&&(G(!1),ve(null),Fe(e));return}gt(`automation:create`);try{let e=Qe(X),{automation:t}=await Y.create(e);De(We),G(!1),x(e=>{let n=new URLSearchParams(e);return n.delete(`status`),n.delete(`q`),n.delete(`run`),n.delete(`new`),n.set(`automation`,t.id),F||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await Nn(),Fe(t.id)}catch(e){let t=e instanceof Error?e.message:String(e);ke(t)}finally{gt(null)}}}async function Gn(e,t){ke(null),gt(e);try{return await t(),await Nn(),!0}catch(e){let t=e instanceof Error?e.message:String(e);return ke(t),!1}finally{gt(null)}}async function Kn(){await Gn(`runs:read-all`,()=>Y.markAllRunsRead(P||void 0))}async function qn(){let e=Ie.trim();if(e){ke(null),Ve(!0);try{let t=await Y.draft({prompt:e,language:i});ze(t.draft),Z(!1)}catch(e){ke(e instanceof Error?e.message:String(e))}finally{Ve(!1)}}}async function Jn(){if(!Re)return;let e=``,t=``;await Gn(`draft:publish`,async()=>{let{automation:n}=await Y.create({...Re.automation,...Ke?{projectId:Ke}:{projectId:void 0},conversationMode:$e,delivery:{...Re.automation.delivery,notificationPolicy:tt}});ze(null),Le(``),Z(!1),G(!1),B(`all`),H(``),e=n.id,t=n.projectId??``})&&e&&(Pn(t),Hn(e))}async function Yn(){if(!Re)return;let e=``,t=``,n=``;await Gn(`draft:test`,async()=>{let{automation:r}=await Y.create({...Re.automation,...Ke?{projectId:Ke}:{projectId:void 0},conversationMode:$e,delivery:{...Re.automation.delivery,notificationPolicy:tt},enabled:!1}),{run:i}=await Y.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,ze(null),Le(``),Z(!1),G(!1),B(`all`),H(``)})&&e&&n&&(Pn(t),Hn(e),Vn(n))}async function Xn(e){ke(null),lt(!0),ot(null),dt(!1);try{let t=await Y.repairDraft(e.id,{language:i});ot(t.repair)}catch(e){ke(e instanceof Error?e.message:String(e))}finally{lt(!1)}}async function Zn(e){at&&await Gn(`run:${e.id}:repair`,async()=>{await Y.update(e.automationId,at.patch),ot(null),dt(!1)})}let Qn=(0,Q.useMemo)(()=>(0,$.jsx)(Ee,{className:`size-9 shrink-0 p-0`,loading:ft,label:s.refresh,onClick:zn}),[s.refresh,ft,zn]);return(0,Q.useLayoutEffect)(()=>{if(!t)return u({startExtra:null,main:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:c}),end:Qn}),()=>y()},[y,t,Qn,c,u]),(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,$.jsxs)(`div`,{className:q(`flex min-h-0 w-full flex-1 flex-col gap-4`,t?`py-1`:`px-4 pt-3 sm:px-9 lg:pt-4 xl:px-10`,!t&&(S?`overflow-y-auto`:`overflow-hidden`)),children:[t?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-xl bg-surface-base px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(he,{className:`size-4 text-accent-fg`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n||s.title})]}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:r||s.subtitle})]}),Qn]}):null,Oe||xt.error||St.error||Ct.error||wt.error?(0,$.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:Oe||s.feedback.actionFailed}):null,S?Nt?(0,$.jsx)(on,{}):(0,$.jsx)(gn,{runs:mn,ownership:ie,labels:s,language:i,unreadCount:ie===`user`?cn.length:0,loading:Pt||ft,onOwnershipChange:V,onRefresh:zn,onSelectRun:Vn}):(0,$.jsxs)($.Fragment,{children:[!Nt&&jn&&ie===`user`?(0,$.jsxs)(`div`,{className:`flex items-center rounded-lg border border-red-500/20 bg-red-500/5`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>B(`attention`),className:`flex min-w-0 flex-1 items-center gap-3 rounded-l-lg px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(re,{className:`size-4 shrink-0 text-red-700 dark:text-red-300`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 text-sm text-fg`,children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[s.experience.executionIssues,` · `,kn.length]}),(0,$.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:s.experience.issuesDescription})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:Mn,className:`mr-2 rounded-md p-2 text-fg-muted hover:bg-red-500/10 hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":s.close,title:s.close,children:(0,$.jsx)(me,{className:`size-4`,"aria-hidden":!0})})]}):null,Nt?(0,$.jsx)(on,{}):(0,$.jsxs)(vt,{language:i,busy:Pt,children:[(0,$.jsxs)(`aside`,{className:q(`max-h-[28vh] min-h-0 min-w-0 flex-col overflow-hidden rounded-xl bg-surface-inset md:flex md:h-full md:max-h-none`,w?`hidden`:`flex`),children:[(0,$.jsxs)(`div`,{className:`shrink-0 p-3`,children:[(0,$.jsx)(Tt,{language:i,labels:s,filter:L,ownership:ie,source:z,projectId:P,projects:Sn,projectLocked:F,query:ae,unreadCount:ie===`user`?ln:0,markReadBusy:ht===`runs:read-all`,onFilter:B,onOwnership:V,onSource:oe,onProject:Pn,onQuery:H,onClear:()=>{se(),V(`user`),F||Pn(``)},onMarkAllRead:()=>void Kn()}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>fe(!0),className:`mt-2 flex w-full items-center gap-2 rounded-lg px-2 py-2 text-sm text-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(W,{className:`size-4`,"aria-hidden":!0}),i===`zh`?`新建任务`:`New task`]})]}),T&&!_n.some(e=>e.id===T)?(0,$.jsxs)(`p`,{role:`status`,className:`px-3 pb-2 text-xs text-fg-muted`,children:[i===`zh`?`当前自动化不在筛选结果中。`:`The selected automation is outside these filters.`,(0,$.jsx)(`button`,{type:`button`,className:`ml-1 text-accent-fg underline`,onClick:se,children:i===`zh`?`清除筛选`:`Clear filters`})]}):null,(0,$.jsx)(pt,{automations:_n,runs:mn,labels:s,cronLabels:l,language:i,selectedAutomationId:E?null:Pe,selectedRunId:w?C:void 0,selectedRun:w?Zt:null,projectId:P||void 0,executionSummaries:(ie===`system`&&P?Ct.data:xt.data)?.executionSummaries,onSelectRun:Un,onOpenDetails:Hn,busy:ht!==null,onEdit:Ln,onAction:Gn})]}),w&&T?(0,$.jsx)(ct,{automationId:T,runId:C,projectId:P||void 0,language:i,onBack:()=>Hn(T),onDetails:()=>Ne(!0),onConfigure:e=>{Y.openConfiguration({automationId:e.automationId,runId:e.id}).then(({conversationId:t})=>{Ne(!1),x(n=>{let r=new URLSearchParams(n);return r.set(`automation`,e.automationId),r.set(`setupChat`,t),r.delete(`run`),r.delete(`view`),r})}).catch(e=>ke(e instanceof Error?e.message:String(e)))}},`${T}:${C}`):!E&&Qt&&!Qt.management&&Qt.action.kind!==`system`?(0,$.jsx)(bt,{automation:Qt,conversationId:D,runs:rn,language:i,onSelectRun:Vn},Qt.id):D?(0,$.jsx)(bt,{conversationId:D,runs:[],language:i,onSelectRun:Vn,onConfigured:Hn},D):!E&&Qt?(0,$.jsx)(xn,{automation:Qt,runs:rn,runsLoading:Et.isLoading,runsError:Et.error?s.feedback.actionFailed:void 0,labels:s,cronLabels:l,language:i,projects:Sn,agentOptions:vn,defaultAgentId:At.data?.defaultId,busyAction:ht,onEdit:Ln,onSelectRun:Vn,onAction:Gn},Qt.id):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto`,children:(0,$.jsx)(kt,{language:i,projectId:P,onOpenConversation:e=>{let t=new URL(e,window.location.origin),n=t.searchParams.get(`setupChat`);x(e=>{let r=new URLSearchParams(e);r.set(`new`,`1`),r.delete(`automation`),r.set(`setupChat`,n);let i=t.searchParams.get(`chatDraft`);return i?r.set(`chatDraft`,i):r.delete(`chatDraft`),r})}},P)})]})]})]}),de?(0,$.jsx)(Xe,{language:i,projectId:P,onClose:()=>fe(!1),onCreated:e=>{V(`user`),se(),Hn(e.id)}}):null,pe?(0,$.jsx)(Xe,{automation:pe,language:i,onClose:()=>J(null)}):null,(0,$.jsx)(v,{open:le,onOpenChange:e=>{G(e),e||(ve(null),Te(!1))},children:(0,$.jsxs)(h,{children:[(0,$.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(760px,calc(100vh-2rem))] w-[min(100%-2rem,64rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(_,{className:`text-base font-semibold text-fg`,children:K===`draft`?s.draft.title:en?s.editTitle:ye?s.draft.editTitle:s.createTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:K===`draft`?s.draft.subtitle:s.form.createFlowHint})]}),(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(Ce,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(me,{className:`size-4`})})})]}),Oe?(0,$.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:Oe}):null,K===`draft`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,$.jsx)(dn,{labels:s,prompt:Ie,draft:Re,loading:Be,approved:He,publishBusy:ht===`draft:publish`,testBusy:ht===`draft:test`,templates:On,projects:Sn,projectId:Ke,conversationMode:$e,notificationPolicy:tt,onPromptChange:Le,onGenerate:qn,onEdit:Rn,onPublish:Jn,onTest:Yn,onProjectChange:qe,onConversationModeChange:et,onNotificationPolicyChange:rt,projectLocked:F,onApprovedChange:Z,onDiscard:()=>{ze(null),Z(!1)},onTemplateSelect:e=>{In(e),De({...e.form,projectId:Ke})},onOpenAdvanced:()=>{De({...We,projectId:Ke,conversationMode:$e,notificationPolicy:tt}),ue(`blank`)}})}):(0,$.jsxs)($.Fragment,{children:[Cn?(0,$.jsx)(un,{form:X,setForm:De,labels:s}):K===`quick`&&ce?(0,$.jsx)(Ut,{form:X,setForm:De,labels:s,projects:Sn,projectLocked:F,source:ce.source,requiresProject:ce.requiresProject}):(0,$.jsx)(An,{form:X,labels:s,setForm:De,projects:Sn,agentOptions:vn,agentsLoading:At.isLoading,defaultAgentId:At.data?.defaultId??``,taskOptions:yn,tasksLoading:jt.isLoading,language:i,projectLocked:F}),Cn||K===`quick`?(0,$.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto px-5 pb-4`,children:(0,$.jsx)(Je,{form:X,onChange:e=>De(t=>({...t,...e})),language:i})}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t border-edge px-5 py-4`,children:[K===`quick`?(0,$.jsx)(Ce,{variant:`ghost`,onClick:()=>ue(`blank`),children:s.draft.advancedCreate}):null,ye?(0,$.jsx)(Ce,{variant:`ghost`,onClick:()=>{Te(!1),ue(`draft`)},children:s.cancel}):(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(Ce,{variant:`ghost`,children:s.cancel})}),(0,$.jsx)(Ce,{variant:`primary`,onClick:Wn,disabled:!Dn||!!ht||K===`quick`&&!!ce?.requiresProject&&!X.projectId,children:ht===`automation:create`||ht===`draft:edit`||en&&ht===`automation:${en.id}:edit`?s.feedback.working:en||ye?s.save:s.experience.createEnabled})]})]})]})]})}),(0,$.jsx)(v,{open:Me&&!!Zt,onOpenChange:e=>{Ne(e),!(e||w)&&x(e=>{let t=new URLSearchParams(e);return t.delete(`run`),t},{replace:!0})},children:(0,$.jsxs)(h,{children:[(0,$.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-65 bg-scrim backdrop-blur-[1px]`}),(0,$.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-66 flex h-[min(85vh,40rem)] w-[min(100%-2rem,32rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(_,{className:`truncate text-base font-semibold text-fg`,children:Zt?.automationName??s.dashboard.result}),(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(Ce,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(me,{className:`size-4`})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,$.jsx)(bn,{className:`rounded-none border-0`,run:Zt,events:sn,labels:s,cronLabels:l,language:i,loading:Dt.isLoading,repairDraft:at,repairLoading:st,repairApproved:ut,busyAction:ht,onRepairApprovedChange:dt,onSuggestRepair:Xn,onApplyRepair:Zn})})]})]})})]})}function un(e){let t=(0,ot.c)(48),{form:n,setForm:r,labels:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(t=>({...t,...e})),t[0]=r,t[1]=a);let o=a,s;t[2]===i.form.trigger?s=t[3]:(s=(0,$.jsx)(Nn,{title:i.form.trigger}),t[2]=i.form.trigger,t[3]=s);let c;t[4]===o?c=t[5]:(c=e=>o({triggerMode:e.target.value}),t[4]=o,t[5]=c);let l;t[6]===i.trigger.daily?l=t[7]:(l=(0,$.jsx)(L,{value:`daily`,children:i.trigger.daily}),t[6]=i.trigger.daily,t[7]=l);let u;t[8]===i.trigger.weekly?u=t[9]:(u=(0,$.jsx)(L,{value:`weekly`,children:i.trigger.weekly}),t[8]=i.trigger.weekly,t[9]=u);let d;t[10]===i.trigger.interval?d=t[11]:(d=(0,$.jsx)(L,{value:`interval`,children:i.trigger.interval}),t[10]=i.trigger.interval,t[11]=d);let f;t[12]===i.trigger.customCron?f=t[13]:(f=(0,$.jsx)(L,{value:`cron`,children:i.trigger.customCron}),t[12]=i.trigger.customCron,t[13]=f);let p;t[14]!==n.triggerMode||t[15]!==i.form.trigger||t[16]!==c||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==f?(p=(0,$.jsxs)(I,{"aria-label":i.form.trigger,className:Mn,value:n.triggerMode,onChange:c,children:[l,u,d,f]}),t[14]=n.triggerMode,t[15]=i.form.trigger,t[16]=c,t[17]=l,t[18]=u,t[19]=d,t[20]=f,t[21]=p):p=t[21];let m;t[22]!==n.time||t[23]!==n.triggerMode||t[24]!==n.weekday||t[25]!==i.form.day||t[26]!==i.form.time||t[27]!==i.weekdays||t[28]!==o?(m=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(Z,{label:i.form.time,children:(0,$.jsx)($e,{value:n.time,onChange:e=>o({time:e}),ariaLabel:i.form.time})}),n.triggerMode===`weekly`?(0,$.jsx)(Z,{label:i.form.day,children:(0,$.jsxs)(I,{className:Mn,value:n.weekday,onChange:e=>o({weekday:e.target.value}),children:[(0,$.jsx)(L,{value:`1`,children:i.weekdays.monday}),(0,$.jsx)(L,{value:`2`,children:i.weekdays.tuesday}),(0,$.jsx)(L,{value:`3`,children:i.weekdays.wednesday}),(0,$.jsx)(L,{value:`4`,children:i.weekdays.thursday}),(0,$.jsx)(L,{value:`5`,children:i.weekdays.friday}),(0,$.jsx)(L,{value:`6`,children:i.weekdays.saturday}),(0,$.jsx)(L,{value:`0`,children:i.weekdays.sunday})]})}):null]}):null,t[22]=n.time,t[23]=n.triggerMode,t[24]=n.weekday,t[25]=i.form.day,t[26]=i.form.time,t[27]=i.weekdays,t[28]=o,t[29]=m):m=t[29];let h;t[30]!==n.intervalUnit||t[31]!==n.intervalValue||t[32]!==n.triggerMode||t[33]!==i.form.intervalEvery||t[34]!==i.form.intervalUnits||t[35]!==o?(h=n.triggerMode===`interval`?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,$.jsx)(Z,{label:i.form.intervalEvery,children:(0,$.jsx)(`input`,{className:Mn,type:`number`,min:`1`,value:n.intervalValue,onChange:e=>o({intervalValue:e.target.value})})}),(0,$.jsx)(Z,{label:i.form.intervalUnits.minute,children:(0,$.jsxs)(I,{className:Mn,value:n.intervalUnit,onChange:e=>o({intervalUnit:e.target.value}),children:[(0,$.jsx)(L,{value:`minute`,children:i.form.intervalUnits.minute}),(0,$.jsx)(L,{value:`hour`,children:i.form.intervalUnits.hour}),(0,$.jsx)(L,{value:`day`,children:i.form.intervalUnits.day}),(0,$.jsx)(L,{value:`week`,children:i.form.intervalUnits.week})]})})]}):null,t[30]=n.intervalUnit,t[31]=n.intervalValue,t[32]=n.triggerMode,t[33]=i.form.intervalEvery,t[34]=i.form.intervalUnits,t[35]=o,t[36]=h):h=t[36];let g;t[37]!==n.cronExpr||t[38]!==n.triggerMode||t[39]!==i.form.expression||t[40]!==o?(g=n.triggerMode===`cron`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsx)(Z,{label:i.form.expression,children:(0,$.jsx)(`input`,{className:Mn,value:n.cronExpr,onChange:e=>o({cronExpr:e.target.value})})})}):null,t[37]=n.cronExpr,t[38]=n.triggerMode,t[39]=i.form.expression,t[40]=o,t[41]=g):g=t[41];let _;return t[42]!==h||t[43]!==g||t[44]!==s||t[45]!==p||t[46]!==m?(_=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[s,p,m,h,g]}),t[42]=h,t[43]=g,t[44]=s,t[45]=p,t[46]=m,t[47]=_):_=t[47],_}function dn(e){let t=(0,ot.c)(110),{labels:n,prompt:r,draft:i,loading:a,approved:o,publishBusy:s,testBusy:c,templates:l,projects:u,projectId:d,conversationMode:f,notificationPolicy:p,onPromptChange:m,onGenerate:h,onEdit:g,onPublish:_,onTest:v,onProjectChange:y,onConversationModeChange:b,onNotificationPolicyChange:x,onApprovedChange:S,onDiscard:C,onTemplateSelect:ee,onOpenAdvanced:w,projectLocked:T}=e,E=s!==void 0&&s,D=c!==void 0&&c,O=T!==void 0&&T,k=!!(i&&i.simulation.requiredConfirmations.length>0),A;t[0]!==i||t[1]!==n.draft.advancedCreate||t[2]!==n.draft.suggestions||t[3]!==n.draft.suggestionsDescription||t[4]!==n.experience||t[5]!==w||t[6]!==ee||t[7]!==l?(A=i?null:(0,$.jsxs)(`div`,{className:`mb-5 border-b border-edge-subtle pb-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.draft.suggestions}),(0,$.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:n.draft.suggestionsDescription})]}),(0,$.jsx)(Ce,{variant:`ghost`,onClick:w,children:n.draft.advancedCreate})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:l.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`focus-visible:ring-2 focus-visible:ring-accent rounded-lg bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>ee(e),children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.name}),(0,$.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:e.description}),(0,$.jsxs)(`div`,{className:`mt-2 text-xs text-fg-muted`,children:[n.experience.source,`: `,e.source]})]},e.name))})]}),t[0]=i,t[1]=n.draft.advancedCreate,t[2]=n.draft.suggestions,t[3]=n.draft.suggestionsDescription,t[4]=n.experience,t[5]=w,t[6]=ee,t[7]=l,t[8]=A):A=t[8];let j;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(de,{className:`size-4 text-accent`}),t[9]=j):j=t[9];let M;t[10]===n.draft.title?M=t[11]:(M=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[j,n.draft.title]}),t[10]=n.draft.title,t[11]=M);let N;t[12]===n.draft.subtitle?N=t[13]:(N=(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=N);let P;t[14]!==M||t[15]!==N?(P=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[M,N]}),t[14]=M,t[15]=N,t[16]=P):P=t[16];let F;t[17]!==a||t[18]!==r?(F=a||!r.trim(),t[17]=a,t[18]=r,t[19]=F):F=t[19];let te;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(de,{className:`size-4`}),t[20]=te):te=t[20];let ne=a?n.draft.generating:n.draft.generate,re;t[21]!==h||t[22]!==ne||t[23]!==F?(re=(0,$.jsxs)(Ce,{variant:`primary`,onClick:h,disabled:F,children:[te,ne]}),t[21]=h,t[22]=ne,t[23]=F,t[24]=re):re=t[24];let ie;t[25]!==re||t[26]!==P?(ie=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[P,re]}),t[25]=re,t[26]=P,t[27]=ie):ie=t[27];let R;t[28]===m?R=t[29]:(R=e=>m(e.target.value),t[28]=m,t[29]=R);let z;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==R?(z=(0,$.jsx)(`textarea`,{"aria-label":n.draft.title,className:`mt-4 min-h-20 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,value:r,onChange:R,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=R,t[34]=z):z=t[34];let ae=O?`sm:grid-cols-2`:`sm:grid-cols-3`,B;t[35]===ae?B=t[36]:(B=q(`mt-3 grid gap-3`,ae),t[35]=ae,t[36]=B);let V;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==y||t[40]!==d||t[41]!==O||t[42]!==u?(V=O?null:(0,$.jsx)(Z,{label:n.draft.project,children:(0,$.jsxs)(I,{className:Mn,value:d,onChange:e=>y(e.target.value),children:[(0,$.jsx)(L,{value:``,children:n.draft.noProject}),u.map(fn)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=y,t[40]=d,t[41]=O,t[42]=u,t[43]=V):V=t[43];let H;t[44]===b?H=t[45]:(H=e=>b(e.target.value),t[44]=b,t[45]=H);let oe;t[46]===n.draft.newConversation?oe=t[47]:(oe=(0,$.jsx)(L,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=oe);let se;t[48]===n.draft.continuousConversation?se=t[49]:(se=(0,$.jsx)(L,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=se);let ce;t[50]!==f||t[51]!==H||t[52]!==oe||t[53]!==se?(ce=(0,$.jsxs)(I,{className:Mn,value:f,onChange:H,children:[oe,se]}),t[50]=f,t[51]=H,t[52]=oe,t[53]=se,t[54]=ce):ce=t[54];let W;t[55]!==n.draft.conversation||t[56]!==ce?(W=(0,$.jsx)(Z,{label:n.draft.conversation,children:ce}),t[55]=n.draft.conversation,t[56]=ce,t[57]=W):W=t[57];let G;t[58]===x?G=t[59]:(G=e=>x(e.target.value),t[58]=x,t[59]=G);let K;t[60]===n.draft.notifyAttention?K=t[61]:(K=(0,$.jsx)(L,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=K);let ue;t[62]===n.draft.notifyAll?ue=t[63]:(ue=(0,$.jsx)(L,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=ue);let fe;t[64]===n.draft.notifyNone?fe=t[65]:(fe=(0,$.jsx)(L,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=fe);let pe;t[66]!==p||t[67]!==G||t[68]!==K||t[69]!==ue||t[70]!==fe?(pe=(0,$.jsxs)(I,{className:Mn,value:p,onChange:G,children:[K,ue,fe]}),t[66]=p,t[67]=G,t[68]=K,t[69]=ue,t[70]=fe,t[71]=pe):pe=t[71];let me;t[72]!==n.draft.notifications||t[73]!==pe?(me=(0,$.jsx)(Z,{label:n.draft.notifications,children:pe}),t[72]=n.draft.notifications,t[73]=pe,t[74]=me):me=t[74];let he;t[75]!==B||t[76]!==V||t[77]!==W||t[78]!==me?(he=(0,$.jsxs)(`div`,{className:B,children:[V,W,me]}),t[75]=B,t[76]=V,t[77]=W,t[78]=me,t[79]=he):he=t[79];let J;t[80]!==o||t[81]!==i||t[82]!==n.draft.approval||t[83]!==n.draft.assumptions||t[84]!==n.draft.discard||t[85]!==n.draft.edit||t[86]!==n.draft.publish||t[87]!==n.draft.review||t[88]!==n.draft.risks||t[89]!==n.draft.safety||t[90]!==n.draft.testOnce||t[91]!==n.draft.testing||t[92]!==n.feedback||t[93]!==n.info||t[94]!==n.none||t[95]!==S||t[96]!==C||t[97]!==g||t[98]!==_||t[99]!==v||t[100]!==E||t[101]!==k||t[102]!==D?(J=i?(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 rounded-lg bg-surface-base p-4 lg:grid-cols-[1fr_1fr]`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:i.automation.name}),i.automation.description?(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:i.automation.description}):null,(0,$.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm`,children:[(0,$.jsx)(On,{label:n.info.when,value:i.simulation.triggerSummary}),(0,$.jsx)(On,{label:n.info.run,value:i.simulation.actionSummary})]})]}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:n.draft.review}),(0,$.jsx)(pn,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,$.jsx)(pn,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,$.jsx)(pn,{title:n.draft.risks,items:i.risks,empty:n.none}),k?(0,$.jsxs)(`label`,{className:`mt-4 flex items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:o,onChange:e=>S(e.target.checked)}),(0,$.jsx)(`span`,{children:n.draft.approval})]}):null,(0,$.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,$.jsx)(Ce,{variant:`ghost`,onClick:C,children:n.draft.discard}),(0,$.jsxs)(Ce,{variant:`secondary`,onClick:g,children:[(0,$.jsx)(U,{className:`size-4`}),n.draft.edit]}),(0,$.jsxs)(Ce,{variant:`secondary`,onClick:v,disabled:D||E||k&&!o,children:[(0,$.jsx)(le,{className:`size-4`}),D?n.draft.testing:n.draft.testOnce]}),(0,$.jsx)(Ce,{variant:`primary`,onClick:_,disabled:E||k&&!o,children:E?n.feedback.working:n.draft.publish})]})]})]}):null,t[80]=o,t[81]=i,t[82]=n.draft.approval,t[83]=n.draft.assumptions,t[84]=n.draft.discard,t[85]=n.draft.edit,t[86]=n.draft.publish,t[87]=n.draft.review,t[88]=n.draft.risks,t[89]=n.draft.safety,t[90]=n.draft.testOnce,t[91]=n.draft.testing,t[92]=n.feedback,t[93]=n.info,t[94]=n.none,t[95]=S,t[96]=C,t[97]=g,t[98]=_,t[99]=v,t[100]=E,t[101]=k,t[102]=D,t[103]=J):J=t[103];let ge;return t[104]!==ie||t[105]!==z||t[106]!==he||t[107]!==J||t[108]!==A?(ge=(0,$.jsxs)(`section`,{className:`rounded-lg bg-surface-base p-4`,children:[A,ie,z,he,J]}),t[104]=ie,t[105]=z,t[106]=he,t[107]=J,t[108]=A,t[109]=ge):ge=t[109],ge}function fn(e){return(0,$.jsx)(L,{value:e.id,children:e.name},e.id)}function pn(e){let t=(0,ot.c)(10),{title:n,items:r,empty:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=a);let o;t[2]!==i||t[3]!==r?(o=r.length>0?r.map(mn):(0,$.jsx)(`li`,{className:`text-fg-muted`,children:i}),t[2]=i,t[3]=r,t[4]=o):o=t[4];let s;t[5]===o?s=t[6]:(s=(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm text-fg`,children:o}),t[5]=o,t[6]=s);let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`mt-3`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function mn(e){return(0,$.jsxs)(`li`,{children:[`- `,e]},e)}function hn(e){let t=(0,ot.c)(25),{icon:n,label:r,value:i,tone:a,active:o,onClick:s}=e,c=a===void 0?`default`:a,l=c===`danger`?`text-red-600 dark:text-red-300`:`text-fg-subtle`,u;t[0]===l?u=t[1]:(u=q(`shrink-0`,l),t[0]=l,t[1]=u);let d;t[2]!==n||t[3]!==u?(d=(0,$.jsx)(`span`,{className:u,children:n}),t[2]=n,t[3]=u,t[4]=d):d=t[4];let f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`truncate text-xs font-medium text-fg-muted`,children:r}),t[5]=r,t[6]=f);let p=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,m;t[7]===p?m=t[8]:(m=q(`ml-auto truncate text-sm font-semibold tabular-nums`,p),t[7]=p,t[8]=m);let h;t[9]!==m||t[10]!==i?(h=(0,$.jsx)(`span`,{className:m,children:i}),t[9]=m,t[10]=i,t[11]=h):h=t[11];let g;t[12]!==d||t[13]!==f||t[14]!==h?(g=(0,$.jsxs)($.Fragment,{children:[d,f,h]}),t[12]=d,t[13]=f,t[14]=h,t[15]=g):g=t[15];let _=g,v=o&&`bg-accent/8`,y=s&&`cursor-pointer hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,b;t[16]!==v||t[17]!==y?(b=q(`flex min-h-12 min-w-0 items-center gap-2.5 bg-surface-base px-3 py-2.5 text-left transition-colors`,v,y),t[16]=v,t[17]=y,t[18]=b):b=t[18];let x=b,S=`${r}: ${i}`,C;return t[19]!==S||t[20]!==o||t[21]!==x||t[22]!==_||t[23]!==s?(C=s?(0,$.jsx)(`button`,{type:`button`,className:x,onClick:s,"aria-label":S,"aria-pressed":o,children:_}):(0,$.jsx)(`div`,{className:x,"aria-label":S,children:_}),t[19]=S,t[20]=o,t[21]=x,t[22]=_,t[23]=s,t[24]=C):C=t[24],C}function gn(e){let t=(0,ot.c)(74),{runs:n,ownership:r,labels:i,language:a,unreadCount:o,loading:s,onOwnershipChange:c,onRefresh:l,onSelectRun:u}=e,d;t[0]===n?d=t[1]:(d=n.filter($t),t[0]=n,t[1]=d);let f=d.length,p;t[2]===n?p=t[3]:(p=n.filter(en),t[2]=n,t[3]=p);let m=p.length,h;t[4]===i.dashboard.activity?h=t[5]:(h=(0,$.jsx)(`h2`,{id:`automation-activity-title`,className:`text-sm font-semibold text-fg`,children:i.dashboard.activity}),t[4]=i.dashboard.activity,t[5]=h);let g;t[6]===i.dashboard.activityDescription?g=t[7]:(g=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:i.dashboard.activityDescription}),t[6]=i.dashboard.activityDescription,t[7]=g);let _;t[8]!==h||t[9]!==g?(_=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[h,g]}),t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=i.filters.ownership,b=r===`user`&&`bg-surface-base text-fg shadow-sm`,x;t[11]===b?x=t[12]:(x=q(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,b),t[11]=b,t[12]=x);let S;t[13]===c?S=t[14]:(S=()=>c(`user`),t[13]=c,t[14]=S);let C=r===`user`,ee;t[15]!==i.filters.userManaged||t[16]!==C||t[17]!==x||t[18]!==S?(ee=(0,$.jsx)(`button`,{type:`button`,className:x,onClick:S,"aria-pressed":C,children:i.filters.userManaged}),t[15]=i.filters.userManaged,t[16]=C,t[17]=x,t[18]=S,t[19]=ee):ee=t[19];let w=r===`system`&&`bg-surface-base text-fg shadow-sm`,T;t[20]===w?T=t[21]:(T=q(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,w),t[20]=w,t[21]=T);let E;t[22]===c?E=t[23]:(E=()=>c(`system`),t[22]=c,t[23]=E);let D=r===`system`,O;t[24]!==i.system.title||t[25]!==T||t[26]!==E||t[27]!==D?(O=(0,$.jsx)(`button`,{type:`button`,className:T,onClick:E,"aria-pressed":D,children:i.system.title}),t[24]=i.system.title,t[25]=T,t[26]=E,t[27]=D,t[28]=O):O=t[28];let k;t[29]!==i.filters.ownership||t[30]!==ee||t[31]!==O?(k=(0,$.jsxs)(X,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":v,indicatorClassName:`rounded-md bg-surface-base shadow-sm`,children:[ee,O]}),t[29]=i.filters.ownership,t[30]=ee,t[31]=O,t[32]=k):k=t[32];let A;t[33]!==i.refresh||t[34]!==s||t[35]!==l?(A=(0,$.jsx)(Ee,{className:`size-9 shrink-0 p-0`,loading:s,label:i.refresh,onClick:l}),t[33]=i.refresh,t[34]=s,t[35]=l,t[36]=A):A=t[36];let j;t[37]!==k||t[38]!==A?(j=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k,A]}),t[37]=k,t[38]=A,t[39]=j):j=t[39];let M;t[40]!==j||t[41]!==_?(M=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3 sm:px-5`,children:[_,j]}),t[40]=j,t[41]=_,t[42]=M):M=t[42];let N;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t[43]=N):N=t[43];let P=i.metrics.total,F=String(n.length),te;t[44]!==i.metrics.total||t[45]!==F?(te=(0,$.jsx)(hn,{icon:N,label:P,value:F}),t[44]=i.metrics.total,t[45]=F,t[46]=te):te=t[46];let ne;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(le,{className:`size-4`,"aria-hidden":!0}),t[47]=ne):ne=t[47];let I=i.metrics.running,L=String(f),R;t[48]!==i.metrics.running||t[49]!==L?(R=(0,$.jsx)(hn,{icon:ne,label:I,value:L}),t[48]=i.metrics.running,t[49]=L,t[50]=R):R=t[50];let z;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t[51]=z):z=t[51];let ae=i.dashboard.needsAttention,B=String(m),V=m>0?`danger`:`default`,H;t[52]!==i.dashboard.needsAttention||t[53]!==B||t[54]!==V?(H=(0,$.jsx)(hn,{icon:z,label:ae,value:B,tone:V}),t[52]=i.dashboard.needsAttention,t[53]=B,t[54]=V,t[55]=H):H=t[55];let oe;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),t[56]=oe):oe=t[56];let se=i.filters.unread,ce=String(o),U;t[57]!==i.filters.unread||t[58]!==ce?(U=(0,$.jsx)(hn,{icon:oe,label:se,value:ce}),t[57]=i.filters.unread,t[58]=ce,t[59]=U):U=t[59];let W;t[60]!==te||t[61]!==R||t[62]!==H||t[63]!==U?(W=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-b border-edge-subtle bg-edge-subtle lg:grid-cols-4`,children:[te,R,H,U]}),t[60]=te,t[61]=R,t[62]=H,t[63]=U,t[64]=W):W=t[64];let G;t[65]!==i||t[66]!==a||t[67]!==u||t[68]!==n?(G=n.length===0?(0,$.jsx)(kn,{className:`min-h-64 rounded-none border-0 shadow-none`,icon:(0,$.jsx)(y,{className:`size-5`}),title:i.empty.runs}):(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:n.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-3 px-4 py-3 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-5`,onClick:()=>u(e.id),children:[(0,$.jsx)(`span`,{className:q(`mt-1.5 size-2 shrink-0 rounded-full`,$t(e)?`bg-blue-500`:en(e)?`bg-red-500`:`bg-emerald-500`),"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.automationName}),e.readAtMs==null&&!$t(e)?(0,$.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-blue-500`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:i.filters.unread})}):null]}),(0,$.jsx)(`span`,{className:q(`mt-1 line-clamp-2 block text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||i.status[e.status]}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-fg-subtle`,children:qt(e.createdAtMs,i,a)})]}),(0,$.jsx)(`span`,{className:q(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Zt(e.status)),children:i.status[e.status]})]},e.id))}),t[65]=i,t[66]=a,t[67]=u,t[68]=n,t[69]=G):G=t[69];let K;return t[70]!==M||t[71]!==W||t[72]!==G?(K=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl bg-surface-base`,"aria-labelledby":`automation-activity-title`,children:[M,W,G]}),t[70]=M,t[71]=W,t[72]=G,t[73]=K):K=t[73],K}function _n(e,t){let n=t.events,r=e.data&&typeof e.data==`object`?e.data:{},i=typeof r.actionKind==`string`?r.actionKind:null,a=typeof r.status==`string`&&r.status in t.status?t.status[r.status]:null;switch(e.type){case`run.queued`:return e.message.toLowerCase().includes(`manual`)?n.manualQueued:e.message.toLowerCase().includes(`scheduled`)?n.scheduledQueued:n.eventQueued;case`run.started`:return n.runStarted;case`action.started`:return i?n.actionStarted.replace(`{kind}`,i):n.actionStartedFallback;case`action.completed`:return i?n.actionCompleted.replace(`{kind}`,i):n.actionCompletedFallback;case`action.failed`:return i?n.actionFailed.replace(`{kind}`,i):n.actionFailedFallback;case`run.completed`:return a?n.runCompleted.replace(`{status}`,a):n.runCompletedFallback;default:return e.message}}function vn(e){let t=(0,ot.c)(17),{value:n,labels:r,title:i,defaultExpanded:a}=e,[o,s]=(0,Q.useState)(a!==void 0&&a),c;t[0]===n?c=t[1]:(c=JSON.stringify(n,null,2),t[0]=n,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=l.split(`
5
5
  `),t[2]=l,t[3]=u);let d=u.length,f=l.length>720||d>18,p;t[4]!==f||t[5]!==l?(p=f?`${l.split(`
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/attachment-preview-renderer-_6GhoCYk.js","assets/preload-helper-Czpn1I53.js","assets/pdf-runtime-JnUAvfIa.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{t as a}from"./messages-C7QSnTdg.js";import{o,t as s}from"./attachment-utils-core-BPYdUI6y.js";import{t as c}from"./preview-open-alternatives-CY_hjK4b.js";import{t as l}from"./use-blob-object-url-D4BFuzZB.js";var u=e(t(),1),d=n();function f(e){let t=e.trim(),n=t.match(/^<pptx\s+filename="([^"]*)">\s*/),r=t;n&&(r=t.slice(n[0].length),r=r.replace(/\s*<\/pptx>\s*$/u,``).trim());let i=[],a=/<slide number="(\d+)">([\s\S]*?)<\/slide>/gu,o;for(;(o=a.exec(r))!==null;){let e=Number.parseInt(o[1],10),t=o[2].trim();i.push({slideNumber:e,text:t})}let s=[],c=/<!--([\s\S]*?)-->/gu,l;for(;(l=c.exec(r))!==null;)s.push(l[1].trim());return i.length===0?{ok:!1,raw:e}:{ok:!0,slides:i,notes:s}}var p=r();function m(e){let t=(0,d.c)(18),{text:n,targetSlide:r,slideLabel:i,emptySlideLabel:a}=e,o;t[0]===n?o=t[1]:(o=f(n),t[0]=n,t[1]=o);let s=o,c=(0,u.useRef)(null),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{c.current?.scrollIntoView({block:`nearest`})},t[2]=l):l=t[2];let m;if(t[3]!==s||t[4]!==r?(m=[r,s],t[3]=s,t[4]=r,t[5]=m):m=t[5],(0,u.useEffect)(l,m),!s.ok){let e;return t[6]===s.raw?e=t[7]:(e=(0,p.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg`,children:s.raw}),t[6]=s.raw,t[7]=e),e}let g;if(t[8]!==a||t[9]!==s.notes||t[10]!==s.slides||t[11]!==i||t[12]!==r){let e=[];if(s.notes.length>0){let n;t[14]===s.notes?n=t[15]:(n=s.notes.map(h),t[14]=s.notes,t[15]=n);let r;t[16]===n?r=t[17]:(r=(0,p.jsx)(`div`,{className:`mb-2 border-b border-edge-subtle pb-2 dark:border-edge`,role:`status`,children:n},`notes`),t[16]=n,t[17]=r),e.push(r)}for(let t of s.slides)e.push((0,p.jsxs)(`section`,{ref:t.slideNumber===r?c:void 0,className:`rounded-lg border border-edge-subtle bg-surface-panel p-3 dark:border-edge`,children:[(0,p.jsx)(`h3`,{className:`mb-2 text-sm font-semibold text-fg`,children:i(t.slideNumber)}),(0,p.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-fg`,children:t.text.length>0?t.text:a})]},t.slideNumber));g=(0,p.jsx)(`div`,{className:`flex flex-col gap-3`,children:e}),t[8]=a,t[9]=s.notes,t[10]=s.slides,t[11]=i,t[12]=r,t[13]=g}else g=t[13];return g}function h(e){return(0,p.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e},e)}function g(e,t){return t===`pdf`?a(e).chat.attachmentPreviewPdfRendering:e===`zh`?t===`excel`?`正在加载电子表格…`:`正在加载文档…`:t===`excel`?`Loading spreadsheet...`:`Loading document...`}function _(e,t){e.innerHTML=``;let n=document.createElement(`p`);n.className=`p-4 text-sm text-fg-muted`,n.textContent=t,e.appendChild(n)}function v({language:e,buffer:t,kind:n,fileKey:r,containerEl:o,onPdfPageCount:s,pdfPage:c,targetSheet:l,targetParagraph:d}){let[f,p]=(0,u.useState)(null),[m,h]=(0,u.useState)(!1),[v,y]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!v||!c||n!==`pdf`)return;let e=!0;return p(null),v(c).catch(t=>{e&&p(t instanceof Error?t.message:String(t))}),()=>{e=!1}},[n,v,c]),(0,u.useLayoutEffect)(()=>{if(p(null),h(!1),y(null),!t||!n||!o||!r)return;let c=!1,u,f=document.createElement(`div`);f.className=`flex min-h-0 flex-1 flex-col overflow-auto`,o.replaceChildren(f),_(f,g(e,n));let m=e=>{c?e():u=e};return(async()=>{try{let r=await i(()=>import(`./attachment-preview-renderer-_6GhoCYk.js`),__vite__mapDeps([0,1,2]));if(c)return;let o=a(e).chat;if(n===`pdf`){let{cleanup:e,goToPage:n}=await r.renderPdfInContainer(f,t,{loadingText:o.attachmentPreviewPdfRendering,loadMoreHint:o.attachmentPreviewPdfLoadMore,onPageCount:e=>{c||s?.(e)}});m(e),c||y(()=>n)}else if(n===`excel`){let{cleanup:e,truncated:n}=await r.renderExcelInContainer(f,t,{initialSheet:l,truncationNotice:o.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)});m(e),c||h(n)}else if(n===`docx`){let{cleanup:e}=await r.renderDocxInContainer(f,t);m(e),!c&&d&&f.querySelectorAll(`section.docx p`)[d-1]?.scrollIntoView({block:`nearest`})}}catch(e){c||p(e instanceof Error?e.message:String(e))}})(),()=>{c=!0,u?.(),f.remove()}},[t,n,o,r,e,s,d,l]),{error:f,excelTruncated:m}}function y(e){let t=(0,d.c)(12),{props:n,message:r}=e,i;t[0]===n.language?i=t[1]:(i=a(n.language),t[0]=n.language,t[1]=i);let o=i,s=n.descriptor.context===`workspace`,l=!!n.actions.onOpenWithSystemApp&&(n.actions.canOpenWithSystemApp??!0)&&s,u=s?o.workspace.openSystemApp:void 0,f=s?o.workspace.chooseApp:void 0,m;return t[2]!==o.chat.attachmentPreviewDownloadFull||t[3]!==r||t[4]!==n.actions.canChooseOpenWithApp||t[5]!==n.actions.onChooseOpenWithApp||t[6]!==n.actions.onDownload||t[7]!==n.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==f?(m=(0,p.jsx)(c,{message:r,downloadLabel:o.chat.attachmentPreviewDownloadFull,onDownload:n.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:n.actions.onOpenWithSystemApp,canOpenWithSystemApp:l,chooseAppLabel:f,onChooseOpenWithApp:n.actions.onChooseOpenWithApp,canChooseOpenWithApp:n.actions.canChooseOpenWithApp}),t[2]=o.chat.attachmentPreviewDownloadFull,t[3]=r,t[4]=n.actions.canChooseOpenWithApp,t[5]=n.actions.onChooseOpenWithApp,t[6]=n.actions.onDownload,t[7]=n.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function b(e){let t=a(e.language);return e.descriptor.context===`workspace`?t.workspace.openElsewhereHint:t.chat.attachmentPreviewOpenElsewhereHint}function x(e){let t=(0,d.c)(28),n;bb0:{if(!e.binaryBuffer){n=null;break bb0}let r;if(t[0]!==e.binaryBuffer||t[1]!==e.descriptor.fileName||t[2]!==e.descriptor.mimeType){let n=o(e.descriptor.fileName)??e.descriptor.mimeType??`image/png`;r=new Blob([e.binaryBuffer],{type:n}),t[0]=e.binaryBuffer,t[1]=e.descriptor.fileName,t[2]=e.descriptor.mimeType,t[3]=r}else r=t[3];n=r}let r=l(n),i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i={x:0,y:0},t[4]=i):i=t[4];let[a,s]=(0,u.useState)(i),c=(0,u.useRef)(null),f=(0,u.useRef)(null),m=e.controls?.zoom??1,h=e.controls?.rotation??0,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s({x:0,y:0})},t[5]=g):g=t[5];let _;if(t[6]!==e.descriptor.id||t[7]!==h?(_=[e.descriptor.id,h],t[6]=e.descriptor.id,t[7]=h,t[8]=_):_=t[8],(0,u.useEffect)(g,_),!r)return null;let v;t[9]!==a.x||t[10]!==a.y||t[11]!==e.onImageSwipe||t[12]!==m?(v=t=>{if(!t.isPrimary){c.current=null;return}t.button===0&&(c.current={pointerId:t.pointerId,x:t.clientX,y:t.clientY,ox:a.x,oy:a.y,swipe:t.pointerType===`touch`&&m<=1&&!!e.onImageSwipe},t.currentTarget.setPointerCapture(t.pointerId))},t[9]=a.x,t[10]=a.y,t[11]=e.onImageSwipe,t[12]=m,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||t.swipe||s({x:t.ox+e.clientX-t.x,y:t.oy+e.clientY-t.y})},t[14]=y):y=t[14];let b;t[15]===e?b=t[16]:(b=t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId)return;c.current=null;let r=t.clientX-n.x,i=t.clientY-n.y;n.swipe&&Math.abs(r)>=50&&Math.abs(r)>Math.abs(i)*1.5&&e.onImageSwipe?.(r<0?`next`:`previous`)},t[15]=e,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{c.current?.pointerId===e.pointerId&&(c.current=null)},t[17]=x):x=t[17];let S=`translate(${a.x}px, ${a.y}px) scale(${m}) rotate(${h}deg)`,C=m>1?`grab`:`default`,w;t[18]!==S||t[19]!==C?(w={transform:S,cursor:C},t[18]=S,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==r||t[22]!==w?(T=(0,p.jsx)(`img`,{src:r,alt:``,draggable:!1,className:`max-h-full max-w-full select-none object-contain transition-transform duration-100`,style:w}),t[21]=r,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==T||t[25]!==v||t[26]!==b?(E=(0,p.jsx)(`div`,{ref:f,className:`flex min-h-0 flex-1 touch-none items-center justify-center overflow-hidden bg-surface-base px-3 py-4 dark:bg-surface-hover/20`,onPointerDown:v,onPointerMove:y,onPointerUp:b,onPointerCancel:x,children:T}),t[24]=T,t[25]=v,t[26]=b,t[27]=E):E=t[27],E}function S(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`pdf`}),t[0]=e,t[1]=n),n}function C(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`docx`}),t[0]=e,t[1]=n),n}function w(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`excel`}),t[0]=e,t[1]=n),n}function T(e){let t=(0,d.c)(21),n=(0,u.useRef)(null),[r,i]=(0,u.useState)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{n.current=e,i(e)},t[0]=o):o=t[0];let s=o,c=e.kind===`pdf`?e.controls?.page??1:void 0,l=e.kind===`pdf`?e.controls?.setPageCount:void 0,f;t[1]!==r||t[2]!==c||t[3]!==e.binaryBuffer||t[4]!==e.descriptor.id||t[5]!==e.kind||t[6]!==e.language||t[7]!==e.targetParagraph||t[8]!==e.targetSheet||t[9]!==l?(f={language:e.language,buffer:e.binaryBuffer,kind:e.kind,fileKey:e.descriptor.id,containerEl:r,onPdfPageCount:l,pdfPage:c,targetSheet:e.targetSheet,targetParagraph:e.targetParagraph},t[1]=r,t[2]=c,t[3]=e.binaryBuffer,t[4]=e.descriptor.id,t[5]=e.kind,t[6]=e.language,t[7]=e.targetParagraph,t[8]=e.targetSheet,t[9]=l,t[10]=f):f=t[10];let{error:m,excelTruncated:h}=v(f),g=a(e.language),_=e.kind===`pdf`?e.controls?.zoom??1:1,x=e.kind===`pdf`?e.controls?.rotation??0:0,S,C;t[11]!==e.kind||t[12]!==x||t[13]!==_?(S=()=>{e.kind!==`pdf`||!n.current||(n.current.style.setProperty(`--xopc-preview-pdf-zoom`,String(_)),n.current.style.setProperty(`--xopc-preview-pdf-rotation`,`${x}deg`),n.current.querySelectorAll(`[data-pdf-page]`).forEach(e=>{let t=e.dataset.pdfBaseHeight??(e.offsetHeight>0?String(e.offsetHeight):void 0);t&&(e.dataset.pdfBaseHeight=t,e.style.height=`${Number(t)*_}px`),e.style.transformOrigin=`top center`,e.style.transform=`scale(${_}) rotate(${x}deg)`,e.style.marginBottom=_===1?``:`${Math.max(16,24*_)}px`}))},C=[e.kind,x,_],t[11]=e.kind,t[12]=x,t[13]=_,t[14]=S,t[15]=C):(S=t[14],C=t[15]),(0,u.useEffect)(S,C);let w=m?(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[(0,p.jsx)(y,{props:e,message:b(e)}),(0,p.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600 dark:text-red-400`,children:m})]}):e.kind===`excel`&&h?(0,p.jsx)(y,{props:e,message:g.chat.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)}):null,T=`${m?`hidden`:`flex`} docx-preview-host min-h-0 flex-1 flex-col overflow-auto rounded-lg border border-edge-subtle bg-surface-panel p-2 dark:border-edge`,E;t[16]===T?E=t[17]:(E=(0,p.jsx)(`div`,{ref:s,className:T}),t[16]=T,t[17]=E);let D;return t[18]!==w||t[19]!==E?(D=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:[w,E]}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D}function E(e){let t=(0,d.c)(24),n;t[0]===e.language?n=t[1]:(n=a(e.language),t[0]=e.language,t[1]=n);let r=n,i=e.extractedText||r.chat.attachmentPreviewNoText,o=!!e.extractedTextTruncated||i.length>3e5,c;t[2]===i?c=t[3]:(c=i.length>3e5?i.slice(0,s):i,t[2]=i,t[3]=c);let l=c,u;t[4]!==r.chat.attachmentPreviewOpenElsewhereTruncated||t[5]!==e||t[6]!==o?(u=o?(0,p.jsx)(y,{props:e,message:r.chat.attachmentPreviewOpenElsewhereTruncated}):null,t[4]=r.chat.attachmentPreviewOpenElsewhereTruncated,t[5]=e,t[6]=o,t[7]=u):u=t[7];let f;t[8]!==r.chat.attachmentPreviewPptxTruncated||t[9]!==o?(f=o?(0,p.jsx)(`p`,{className:`mb-2 border-b border-edge-subtle pb-2 text-xs text-fg-muted dark:border-edge`,children:r.chat.attachmentPreviewPptxTruncated}):null,t[8]=r.chat.attachmentPreviewPptxTruncated,t[9]=o,t[10]=f):f=t[10];let h;t[11]===r.chat.attachmentPreviewPptxSlide?h=t[12]:(h=e=>r.chat.attachmentPreviewPptxSlide.replaceAll(`{n}`,String(e)),t[11]=r.chat.attachmentPreviewPptxSlide,t[12]=h);let g;t[13]!==r.chat.attachmentPreviewPptxEmptySlide||t[14]!==e.targetSlide||t[15]!==h||t[16]!==l?(g=(0,p.jsx)(m,{text:l,targetSlide:e.targetSlide,slideLabel:h,emptySlideLabel:r.chat.attachmentPreviewPptxEmptySlide}),t[13]=r.chat.attachmentPreviewPptxEmptySlide,t[14]=e.targetSlide,t[15]=h,t[16]=l,t[17]=g):g=t[17];let _;t[18]!==f||t[19]!==g?(_=(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[f,g]}),t[18]=f,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==u||t[22]!==_?(v=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:[u,_]}),t[21]=u,t[22]=_,t[23]=v):v=t[23],v}export{C as DocxPreviewPluginView,x as InteractiveImagePreview,S as PdfPreviewPluginView,E as PptxPreviewPluginView,w as SpreadsheetPreviewPluginView};
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{t as a}from"./messages-Clfka2Sx.js";import{o,t as s}from"./attachment-utils-core-BPYdUI6y.js";import{t as c}from"./preview-open-alternatives-CY_hjK4b.js";import{t as l}from"./use-blob-object-url-D4BFuzZB.js";var u=e(t(),1),d=n();function f(e){let t=e.trim(),n=t.match(/^<pptx\s+filename="([^"]*)">\s*/),r=t;n&&(r=t.slice(n[0].length),r=r.replace(/\s*<\/pptx>\s*$/u,``).trim());let i=[],a=/<slide number="(\d+)">([\s\S]*?)<\/slide>/gu,o;for(;(o=a.exec(r))!==null;){let e=Number.parseInt(o[1],10),t=o[2].trim();i.push({slideNumber:e,text:t})}let s=[],c=/<!--([\s\S]*?)-->/gu,l;for(;(l=c.exec(r))!==null;)s.push(l[1].trim());return i.length===0?{ok:!1,raw:e}:{ok:!0,slides:i,notes:s}}var p=r();function m(e){let t=(0,d.c)(18),{text:n,targetSlide:r,slideLabel:i,emptySlideLabel:a}=e,o;t[0]===n?o=t[1]:(o=f(n),t[0]=n,t[1]=o);let s=o,c=(0,u.useRef)(null),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{c.current?.scrollIntoView({block:`nearest`})},t[2]=l):l=t[2];let m;if(t[3]!==s||t[4]!==r?(m=[r,s],t[3]=s,t[4]=r,t[5]=m):m=t[5],(0,u.useEffect)(l,m),!s.ok){let e;return t[6]===s.raw?e=t[7]:(e=(0,p.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-fg`,children:s.raw}),t[6]=s.raw,t[7]=e),e}let g;if(t[8]!==a||t[9]!==s.notes||t[10]!==s.slides||t[11]!==i||t[12]!==r){let e=[];if(s.notes.length>0){let n;t[14]===s.notes?n=t[15]:(n=s.notes.map(h),t[14]=s.notes,t[15]=n);let r;t[16]===n?r=t[17]:(r=(0,p.jsx)(`div`,{className:`mb-2 border-b border-edge-subtle pb-2 dark:border-edge`,role:`status`,children:n},`notes`),t[16]=n,t[17]=r),e.push(r)}for(let t of s.slides)e.push((0,p.jsxs)(`section`,{ref:t.slideNumber===r?c:void 0,className:`rounded-lg border border-edge-subtle bg-surface-panel p-3 dark:border-edge`,children:[(0,p.jsx)(`h3`,{className:`mb-2 text-sm font-semibold text-fg`,children:i(t.slideNumber)}),(0,p.jsx)(`div`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-fg`,children:t.text.length>0?t.text:a})]},t.slideNumber));g=(0,p.jsx)(`div`,{className:`flex flex-col gap-3`,children:e}),t[8]=a,t[9]=s.notes,t[10]=s.slides,t[11]=i,t[12]=r,t[13]=g}else g=t[13];return g}function h(e){return(0,p.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e},e)}function g(e,t){return t===`pdf`?a(e).chat.attachmentPreviewPdfRendering:e===`zh`?t===`excel`?`正在加载电子表格…`:`正在加载文档…`:t===`excel`?`Loading spreadsheet...`:`Loading document...`}function _(e,t){e.innerHTML=``;let n=document.createElement(`p`);n.className=`p-4 text-sm text-fg-muted`,n.textContent=t,e.appendChild(n)}function v({language:e,buffer:t,kind:n,fileKey:r,containerEl:o,onPdfPageCount:s,pdfPage:c,targetSheet:l,targetParagraph:d}){let[f,p]=(0,u.useState)(null),[m,h]=(0,u.useState)(!1),[v,y]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!v||!c||n!==`pdf`)return;let e=!0;return p(null),v(c).catch(t=>{e&&p(t instanceof Error?t.message:String(t))}),()=>{e=!1}},[n,v,c]),(0,u.useLayoutEffect)(()=>{if(p(null),h(!1),y(null),!t||!n||!o||!r)return;let c=!1,u,f=document.createElement(`div`);f.className=`flex min-h-0 flex-1 flex-col overflow-auto`,o.replaceChildren(f),_(f,g(e,n));let m=e=>{c?e():u=e};return(async()=>{try{let r=await i(()=>import(`./attachment-preview-renderer-_6GhoCYk.js`),__vite__mapDeps([0,1,2]));if(c)return;let o=a(e).chat;if(n===`pdf`){let{cleanup:e,goToPage:n}=await r.renderPdfInContainer(f,t,{loadingText:o.attachmentPreviewPdfRendering,loadMoreHint:o.attachmentPreviewPdfLoadMore,onPageCount:e=>{c||s?.(e)}});m(e),c||y(()=>n)}else if(n===`excel`){let{cleanup:e,truncated:n}=await r.renderExcelInContainer(f,t,{initialSheet:l,truncationNotice:o.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)});m(e),c||h(n)}else if(n===`docx`){let{cleanup:e}=await r.renderDocxInContainer(f,t);m(e),!c&&d&&f.querySelectorAll(`section.docx p`)[d-1]?.scrollIntoView({block:`nearest`})}}catch(e){c||p(e instanceof Error?e.message:String(e))}})(),()=>{c=!0,u?.(),f.remove()}},[t,n,o,r,e,s,d,l]),{error:f,excelTruncated:m}}function y(e){let t=(0,d.c)(12),{props:n,message:r}=e,i;t[0]===n.language?i=t[1]:(i=a(n.language),t[0]=n.language,t[1]=i);let o=i,s=n.descriptor.context===`workspace`,l=!!n.actions.onOpenWithSystemApp&&(n.actions.canOpenWithSystemApp??!0)&&s,u=s?o.workspace.openSystemApp:void 0,f=s?o.workspace.chooseApp:void 0,m;return t[2]!==o.chat.attachmentPreviewDownloadFull||t[3]!==r||t[4]!==n.actions.canChooseOpenWithApp||t[5]!==n.actions.onChooseOpenWithApp||t[6]!==n.actions.onDownload||t[7]!==n.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==f?(m=(0,p.jsx)(c,{message:r,downloadLabel:o.chat.attachmentPreviewDownloadFull,onDownload:n.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:n.actions.onOpenWithSystemApp,canOpenWithSystemApp:l,chooseAppLabel:f,onChooseOpenWithApp:n.actions.onChooseOpenWithApp,canChooseOpenWithApp:n.actions.canChooseOpenWithApp}),t[2]=o.chat.attachmentPreviewDownloadFull,t[3]=r,t[4]=n.actions.canChooseOpenWithApp,t[5]=n.actions.onChooseOpenWithApp,t[6]=n.actions.onDownload,t[7]=n.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function b(e){let t=a(e.language);return e.descriptor.context===`workspace`?t.workspace.openElsewhereHint:t.chat.attachmentPreviewOpenElsewhereHint}function x(e){let t=(0,d.c)(28),n;bb0:{if(!e.binaryBuffer){n=null;break bb0}let r;if(t[0]!==e.binaryBuffer||t[1]!==e.descriptor.fileName||t[2]!==e.descriptor.mimeType){let n=o(e.descriptor.fileName)??e.descriptor.mimeType??`image/png`;r=new Blob([e.binaryBuffer],{type:n}),t[0]=e.binaryBuffer,t[1]=e.descriptor.fileName,t[2]=e.descriptor.mimeType,t[3]=r}else r=t[3];n=r}let r=l(n),i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i={x:0,y:0},t[4]=i):i=t[4];let[a,s]=(0,u.useState)(i),c=(0,u.useRef)(null),f=(0,u.useRef)(null),m=e.controls?.zoom??1,h=e.controls?.rotation??0,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s({x:0,y:0})},t[5]=g):g=t[5];let _;if(t[6]!==e.descriptor.id||t[7]!==h?(_=[e.descriptor.id,h],t[6]=e.descriptor.id,t[7]=h,t[8]=_):_=t[8],(0,u.useEffect)(g,_),!r)return null;let v;t[9]!==a.x||t[10]!==a.y||t[11]!==e.onImageSwipe||t[12]!==m?(v=t=>{if(!t.isPrimary){c.current=null;return}t.button===0&&(c.current={pointerId:t.pointerId,x:t.clientX,y:t.clientY,ox:a.x,oy:a.y,swipe:t.pointerType===`touch`&&m<=1&&!!e.onImageSwipe},t.currentTarget.setPointerCapture(t.pointerId))},t[9]=a.x,t[10]=a.y,t[11]=e.onImageSwipe,t[12]=m,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||t.swipe||s({x:t.ox+e.clientX-t.x,y:t.oy+e.clientY-t.y})},t[14]=y):y=t[14];let b;t[15]===e?b=t[16]:(b=t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId)return;c.current=null;let r=t.clientX-n.x,i=t.clientY-n.y;n.swipe&&Math.abs(r)>=50&&Math.abs(r)>Math.abs(i)*1.5&&e.onImageSwipe?.(r<0?`next`:`previous`)},t[15]=e,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{c.current?.pointerId===e.pointerId&&(c.current=null)},t[17]=x):x=t[17];let S=`translate(${a.x}px, ${a.y}px) scale(${m}) rotate(${h}deg)`,C=m>1?`grab`:`default`,w;t[18]!==S||t[19]!==C?(w={transform:S,cursor:C},t[18]=S,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==r||t[22]!==w?(T=(0,p.jsx)(`img`,{src:r,alt:``,draggable:!1,className:`max-h-full max-w-full select-none object-contain transition-transform duration-100`,style:w}),t[21]=r,t[22]=w,t[23]=T):T=t[23];let E;return t[24]!==T||t[25]!==v||t[26]!==b?(E=(0,p.jsx)(`div`,{ref:f,className:`flex min-h-0 flex-1 touch-none items-center justify-center overflow-hidden bg-surface-base px-3 py-4 dark:bg-surface-hover/20`,onPointerDown:v,onPointerMove:y,onPointerUp:b,onPointerCancel:x,children:T}),t[24]=T,t[25]=v,t[26]=b,t[27]=E):E=t[27],E}function S(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`pdf`}),t[0]=e,t[1]=n),n}function C(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`docx`}),t[0]=e,t[1]=n),n}function w(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(T,{...e,kind:`excel`}),t[0]=e,t[1]=n),n}function T(e){let t=(0,d.c)(21),n=(0,u.useRef)(null),[r,i]=(0,u.useState)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{n.current=e,i(e)},t[0]=o):o=t[0];let s=o,c=e.kind===`pdf`?e.controls?.page??1:void 0,l=e.kind===`pdf`?e.controls?.setPageCount:void 0,f;t[1]!==r||t[2]!==c||t[3]!==e.binaryBuffer||t[4]!==e.descriptor.id||t[5]!==e.kind||t[6]!==e.language||t[7]!==e.targetParagraph||t[8]!==e.targetSheet||t[9]!==l?(f={language:e.language,buffer:e.binaryBuffer,kind:e.kind,fileKey:e.descriptor.id,containerEl:r,onPdfPageCount:l,pdfPage:c,targetSheet:e.targetSheet,targetParagraph:e.targetParagraph},t[1]=r,t[2]=c,t[3]=e.binaryBuffer,t[4]=e.descriptor.id,t[5]=e.kind,t[6]=e.language,t[7]=e.targetParagraph,t[8]=e.targetSheet,t[9]=l,t[10]=f):f=t[10];let{error:m,excelTruncated:h}=v(f),g=a(e.language),_=e.kind===`pdf`?e.controls?.zoom??1:1,x=e.kind===`pdf`?e.controls?.rotation??0:0,S,C;t[11]!==e.kind||t[12]!==x||t[13]!==_?(S=()=>{e.kind!==`pdf`||!n.current||(n.current.style.setProperty(`--xopc-preview-pdf-zoom`,String(_)),n.current.style.setProperty(`--xopc-preview-pdf-rotation`,`${x}deg`),n.current.querySelectorAll(`[data-pdf-page]`).forEach(e=>{let t=e.dataset.pdfBaseHeight??(e.offsetHeight>0?String(e.offsetHeight):void 0);t&&(e.dataset.pdfBaseHeight=t,e.style.height=`${Number(t)*_}px`),e.style.transformOrigin=`top center`,e.style.transform=`scale(${_}) rotate(${x}deg)`,e.style.marginBottom=_===1?``:`${Math.max(16,24*_)}px`}))},C=[e.kind,x,_],t[11]=e.kind,t[12]=x,t[13]=_,t[14]=S,t[15]=C):(S=t[14],C=t[15]),(0,u.useEffect)(S,C);let w=m?(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[(0,p.jsx)(y,{props:e,message:b(e)}),(0,p.jsx)(`p`,{role:`alert`,className:`text-sm text-red-600 dark:text-red-400`,children:m})]}):e.kind===`excel`&&h?(0,p.jsx)(y,{props:e,message:g.chat.attachmentPreviewExcelTruncated.replaceAll(`{rows}`,`500`).replaceAll(`{cols}`,`64`)}):null,T=`${m?`hidden`:`flex`} docx-preview-host min-h-0 flex-1 flex-col overflow-auto rounded-lg border border-edge-subtle bg-surface-panel p-2 dark:border-edge`,E;t[16]===T?E=t[17]:(E=(0,p.jsx)(`div`,{ref:s,className:T}),t[16]=T,t[17]=E);let D;return t[18]!==w||t[19]!==E?(D=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden`,children:[w,E]}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D}function E(e){let t=(0,d.c)(24),n;t[0]===e.language?n=t[1]:(n=a(e.language),t[0]=e.language,t[1]=n);let r=n,i=e.extractedText||r.chat.attachmentPreviewNoText,o=!!e.extractedTextTruncated||i.length>3e5,c;t[2]===i?c=t[3]:(c=i.length>3e5?i.slice(0,s):i,t[2]=i,t[3]=c);let l=c,u;t[4]!==r.chat.attachmentPreviewOpenElsewhereTruncated||t[5]!==e||t[6]!==o?(u=o?(0,p.jsx)(y,{props:e,message:r.chat.attachmentPreviewOpenElsewhereTruncated}):null,t[4]=r.chat.attachmentPreviewOpenElsewhereTruncated,t[5]=e,t[6]=o,t[7]=u):u=t[7];let f;t[8]!==r.chat.attachmentPreviewPptxTruncated||t[9]!==o?(f=o?(0,p.jsx)(`p`,{className:`mb-2 border-b border-edge-subtle pb-2 text-xs text-fg-muted dark:border-edge`,children:r.chat.attachmentPreviewPptxTruncated}):null,t[8]=r.chat.attachmentPreviewPptxTruncated,t[9]=o,t[10]=f):f=t[10];let h;t[11]===r.chat.attachmentPreviewPptxSlide?h=t[12]:(h=e=>r.chat.attachmentPreviewPptxSlide.replaceAll(`{n}`,String(e)),t[11]=r.chat.attachmentPreviewPptxSlide,t[12]=h);let g;t[13]!==r.chat.attachmentPreviewPptxEmptySlide||t[14]!==e.targetSlide||t[15]!==h||t[16]!==l?(g=(0,p.jsx)(m,{text:l,targetSlide:e.targetSlide,slideLabel:h,emptySlideLabel:r.chat.attachmentPreviewPptxEmptySlide}),t[13]=r.chat.attachmentPreviewPptxEmptySlide,t[14]=e.targetSlide,t[15]=h,t[16]=l,t[17]=g):g=t[17];let _;t[18]!==f||t[19]!==g?(_=(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[f,g]}),t[18]=f,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==u||t[22]!==_?(v=(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-2 pb-2 pt-1 sm:px-4`,children:[u,_]}),t[21]=u,t[22]=_,t[23]=v):v=t[23],v}export{C as DocxPreviewPluginView,x as InteractiveImagePreview,S as PdfPreviewPluginView,E as PptxPreviewPluginView,w as SpreadsheetPreviewPluginView};
@@ -0,0 +1 @@
1
+ .block-editor-content{overflow-wrap:anywhere;color:var(--color-fg);outline:none;padding-bottom:min(30dvh,12rem);font-size:.9375rem;line-height:1.7}.block-editor-content h1{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.75rem;font-weight:700;line-height:1.3}.block-editor-content h2{margin-top:1.25rem;margin-bottom:.4rem;font-size:1.375rem;font-weight:600;line-height:1.35}.block-editor-content h3{margin-top:1rem;margin-bottom:.3rem;font-size:1.125rem;font-weight:600;line-height:1.4}.block-editor-content p{margin-bottom:.5rem}.block-editor-content ul,.block-editor-content ol{margin-bottom:.5rem;padding-left:1.5rem}.block-editor-content ul{list-style-type:disc}.block-editor-content ol{list-style-type:decimal}.block-editor-content li{margin-bottom:.15rem}.block-editor-content li p{margin-bottom:0}.block-editor-content ul[data-type=taskList]{padding-left:0;list-style:none}.block-editor-content ul[data-type=taskList] li{align-items:flex-start;gap:.5rem;display:flex}.block-editor-content ul[data-type=taskList] li>label{flex-shrink:0;margin-top:.25rem}.block-editor-content ul[data-type=taskList] li>label input[type=checkbox]{width:1rem;height:1rem;accent-color:var(--color-accent);cursor:pointer}.block-editor-content ul[data-type=taskList] li>div{flex:1;min-width:0}.block-editor-content ul[data-type=taskList] li[data-checked=true]>div p{opacity:.6;text-decoration:line-through}.block-editor-content blockquote{border-left:3px solid var(--color-accent);color:var(--color-fg-muted);margin-bottom:.75rem;margin-left:0;padding-left:1rem;font-style:italic}.block-editor-content pre{background:var(--color-surface-inset);border:1px solid var(--color-edge);overflow-wrap:normal;font-family:var(--font-mono,ui-monospace, monospace);border-radius:.5rem;margin-bottom:.75rem;padding:.75rem 1rem;font-size:.8125rem;line-height:1.6;overflow-x:auto}.block-editor-content pre code{font-size:inherit;background:0 0;border:none;padding:0}.block-editor-content code{background:var(--color-surface-inset);border:1px solid var(--color-edge);font-family:var(--font-mono,ui-monospace, monospace);border-radius:.25rem;padding:.125rem .35rem;font-size:.8125rem}.block-editor-content hr{border:none;border-top:1px solid var(--color-edge);margin:1.25rem 0}.block-editor-link{color:var(--color-accent);text-underline-offset:2px;cursor:pointer;text-decoration:underline}.block-editor-link:hover{opacity:.8}.block-editor-image{border-radius:.5rem;max-width:100%;height:auto;margin:.75rem 0}.block-editor-content img.ProseMirror-selectednode{outline:2px solid var(--color-accent);outline-offset:2px;border-radius:.5rem}.block-editor-content p.is-editor-empty:first-child:before,.block-editor-content p.is-editor-empty:last-child:before{content:attr(data-placeholder);float:left;color:var(--color-fg-muted);opacity:.5;pointer-events:none;height:0}.block-editor-content .suggestion{color:var(--color-fg-muted)}.block-editor-content .ProseMirror-gapcursor:after{border-top-color:var(--color-fg)}.block-editor-math{min-width:0;max-width:100%}.block-editor-math [role=button]{cursor:text}.block-editor-math-edit{flex-wrap:wrap;gap:.5rem;display:flex}.block-editor-math-edit textarea{width:100%;min-height:5rem;font-family:var(--font-mono,monospace);border:1px solid var(--color-edge);border-radius:.5rem;padding:.5rem}.block-editor-math-edit button{border:1px solid var(--color-edge);border-radius:.25rem;padding:.25rem .5rem}