@xopcai/xopc 0.0.441 → 0.0.442

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 (375) hide show
  1. package/README.md +2 -3
  2. package/README.zh-CN.md +1 -2
  3. package/dist/browser-ext/_locales/en/messages.json +0 -28
  4. package/dist/browser-ext/_locales/zh_CN/messages.json +0 -28
  5. package/dist/browser-ext/dist/assets/{sidepanel-CQeQB5vW.css → sidepanel-lpBGVKwZ.css} +0 -42
  6. package/dist/browser-ext/dist/background.js +247 -647
  7. package/dist/browser-ext/dist/sidepanel.html +2 -2
  8. package/dist/browser-ext/dist/sidepanel.js +105 -346
  9. package/dist/browser-ext/manifest.json +1 -1
  10. package/dist/extensions/telegram/xopc.extension.json +1 -1
  11. package/dist/gateway/static/root/assets/{activity-store-t5c6XavH.js → activity-store-CuPXAoLe.js} +1 -1
  12. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CSTtf3RI.js → agent-avatar-dicebear-D92uHOFV.js} +1 -1
  13. package/dist/gateway/static/root/assets/{agent-avatar-display-Cm0afn_O.js → agent-avatar-display-DINzeGs0.js} +2 -2
  14. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BMbsLf16.js → agent-defaults-settings-panel-Chneosh4.js} +1 -1
  15. package/dist/gateway/static/root/assets/{agent-plugin-dialog-DofyWKnP.js → agent-plugin-dialog-B2vXlrDW.js} +1 -1
  16. package/dist/gateway/static/root/assets/{agents-CAqwtADW.js → agents-DKfOY5z9.js} +3 -3
  17. package/dist/gateway/static/root/assets/{agents-admin-api-CewiIx4v.js → agents-admin-api-DPLtjJtX.js} +1 -1
  18. package/dist/gateway/static/root/assets/{api-CE6gdBWx.js → api-CEzBruRJ.js} +1 -1
  19. package/dist/gateway/static/root/assets/{api-DRyQFk9q.js → api-ClZ7BrD4.js} +1 -1
  20. package/dist/gateway/static/root/assets/app-link-CdD448kS.js +1 -0
  21. package/dist/gateway/static/root/assets/{app-management-settings-panel-BZfs2ydm.js → app-management-settings-panel-CONwDpqL.js} +1 -1
  22. package/dist/gateway/static/root/assets/{appearance-settings-BA7spRv6.js → appearance-settings-Bu7K-_ri.js} +1 -1
  23. package/dist/gateway/static/root/assets/{apps-page-B0qorxfq.js → apps-page-CBLj-m2k.js} +1 -1
  24. package/dist/gateway/static/root/assets/{archive-plugin-CPCI6nqQ.js → archive-plugin-CfLz9o-2.js} +1 -1
  25. package/dist/gateway/static/root/assets/{automation-api-paBg5ie6.js → automation-api-Dl9fi8t0.js} +1 -1
  26. package/dist/gateway/static/root/assets/{automation-result-state-Ds-59DdX.js → automation-result-state-BjjZCxee.js} +1 -1
  27. package/dist/gateway/static/root/assets/{automation-run-list-Crw5qn_I.js → automation-run-list-9IPHu_UC.js} +1 -1
  28. package/dist/gateway/static/root/assets/automation-task-card-DLg-LYCm.js +3 -0
  29. package/dist/gateway/static/root/assets/{automations-page-D3Cb5vfR.js → automations-page-CYngiwxI.js} +1 -1
  30. package/dist/gateway/static/root/assets/automations-workspace-zyhyqSdH.js +9 -0
  31. package/dist/gateway/static/root/assets/{binary-plugins-CFJCUpWH.js → binary-plugins-Bv4ixxo4.js} +1 -1
  32. package/dist/gateway/static/root/assets/{block-editor-DbG2QKd0.js → block-editor-CtaJSB9U.js} +1 -1
  33. package/dist/gateway/static/root/assets/browser-settings-page-CmBsnx24.js +8 -0
  34. package/dist/gateway/static/root/assets/capabilities-BpYi2fQO.js +1 -0
  35. package/dist/gateway/static/root/assets/{capabilities-DG0ckPuF.js → capabilities-oWWLfwf3.js} +1 -1
  36. package/dist/gateway/static/root/assets/capabilities-page-Dlgwv1dI.js +2 -0
  37. package/dist/gateway/static/root/assets/capabilities-settings-panel-CslXPIs8.js +8 -0
  38. package/dist/gateway/static/root/assets/capability-icon-CmvCZOJX.js +1 -0
  39. package/dist/gateway/static/root/assets/{capability-links-DeO34GIF.js → capability-links-MZdYfPKx.js} +1 -1
  40. package/dist/gateway/static/root/assets/{channels-OiT-5N_6.js → channels-P-xOLYBz.js} +1 -1
  41. package/dist/gateway/static/root/assets/{chat-agents-api-CTL8cwNk.js → chat-agents-api-BOB3dILf.js} +1 -1
  42. package/dist/gateway/static/root/assets/{chat-chart-block-Z41MRuzh.js → chat-chart-block-DsaCatBN.js} +1 -1
  43. package/dist/gateway/static/root/assets/chat-page-Cen4dGHa.js +72 -0
  44. package/dist/gateway/static/root/assets/{chat-terminal-dock-CEaFlZEs.js → chat-terminal-dock-DTQL2DBu.js} +1 -1
  45. package/dist/gateway/static/root/assets/{command-palette-api-C3G6veE2.js → command-palette-api-Cj0_7g9o.js} +1 -1
  46. package/dist/gateway/static/root/assets/{composer-payload-handoff-Ccq_KF1W.js → composer-payload-handoff-B1GFVFK_.js} +1 -1
  47. package/dist/gateway/static/root/assets/{computer-settings-page-CTkICYyM.js → computer-settings-page-DJ9BIOHC.js} +1 -1
  48. package/dist/gateway/static/root/assets/connected-providers-grid-sULM6YyQ.js +1 -0
  49. package/dist/gateway/static/root/assets/connection-usage-BhdQRWgQ.js +1 -0
  50. package/dist/gateway/static/root/assets/connection-usage-guide-bD1sKiAp.js +1 -0
  51. package/dist/gateway/static/root/assets/{connector-service-page-C6yeCQWW.js → connector-service-page-BEq3i3Vi.js} +1 -1
  52. package/dist/gateway/static/root/assets/{connectors-api-HFW1Iey5.js → connectors-api-DEExP6a7.js} +1 -1
  53. package/dist/gateway/static/root/assets/connectors-page-DN9BOiFk.js +1 -0
  54. package/dist/gateway/static/root/assets/{date-picker-C_tweuM0.js → date-picker-D2whl8Ci.js} +1 -1
  55. package/dist/gateway/static/root/assets/{desktop-pet-narrative-ChwjpnsG.js → desktop-pet-narrative-C8zQtMcw.js} +1 -1
  56. package/dist/gateway/static/root/assets/{desktop-pet-BAX0ZLyq.js → desktop-pet-qnIdmNnH.js} +1 -1
  57. package/dist/gateway/static/root/assets/{desktop-pet-settings-BIIsWpW9.js → desktop-pet-settings-C54b1FY4.js} +1 -1
  58. package/dist/gateway/static/root/assets/{dev-view-store-D4C_zjRq.js → dev-view-store-bryv5YRw.js} +1 -1
  59. package/dist/gateway/static/root/assets/{device-pairing-wizard-ZUE6wZ1X.js → device-pairing-wizard-Du-yOxZv.js} +1 -1
  60. package/dist/gateway/static/root/assets/{directory-picker-path-field-CFb2VFW-.js → directory-picker-path-field-GsMkjw59.js} +1 -1
  61. package/dist/gateway/static/root/assets/{discussion-annotation-sync-Bd4r2auZ.js → discussion-annotation-sync-CrpDiC7J.js} +1 -1
  62. package/dist/gateway/static/root/assets/earth-C9Z4bTTG.js +1 -0
  63. package/dist/gateway/static/root/assets/{extension-debug-page-DXGpnxwM.js → extension-debug-page-D2Dhtu6H.js} +1 -1
  64. package/dist/gateway/static/root/assets/{extension-iframe-host-DTwDBQQ9.js → extension-iframe-host-Dra7k_6o.js} +1 -1
  65. package/dist/gateway/static/root/assets/{extension-marketplace-api-Q6E4x8gu.js → extension-marketplace-api-D7Av-sOf.js} +1 -1
  66. package/dist/gateway/static/root/assets/{extension-page-BVBxNzys.js → extension-page-Dd16lQg-.js} +1 -1
  67. package/dist/gateway/static/root/assets/{extension-provider-D-Fa5PU-.js → extension-provider-C4WwnCxf.js} +1 -1
  68. package/dist/gateway/static/root/assets/{extension-settings-page-ycMuOpv3.js → extension-settings-page-BHwQ2ipj.js} +1 -1
  69. package/dist/gateway/static/root/assets/{file-preview-surface-D62ph0m0.js → file-preview-surface-Dtla5oAW.js} +1 -1
  70. package/dist/gateway/static/root/assets/{gateway-config-swr-BW6eBLIt.js → gateway-config-swr-B5THNdYK.js} +1 -1
  71. package/dist/gateway/static/root/assets/{gateway-realtime-Bg4Mf7HA.js → gateway-realtime-hnEaDFaA.js} +1 -1
  72. package/dist/gateway/static/root/assets/gateway-realtime-store-ugwtyD4q.js +1 -0
  73. package/dist/gateway/static/root/assets/{gateway-restart-BzrJNB4Q.js → gateway-restart-kwv0njYq.js} +1 -1
  74. package/dist/gateway/static/root/assets/{gateway-settings-BOW90CER.js → gateway-settings-CxYPJTy8.js} +1 -1
  75. package/dist/gateway/static/root/assets/{gateway-startup-retry-DCjREMIO.js → gateway-startup-retry-CqtCJzWJ.js} +1 -1
  76. package/dist/gateway/static/root/assets/{global-defaults-api-myAmGZ2_.js → global-defaults-api-BQMdHLlp.js} +1 -1
  77. package/dist/gateway/static/root/assets/{home-page-eXW3llb0.js → home-page-D-gy9LlQ.js} +2 -2
  78. package/dist/gateway/static/root/assets/{image-generation-api-CLkuZdsz.js → image-generation-api-G3tQFhif.js} +1 -1
  79. package/dist/gateway/static/root/assets/{imports-page-BFsLQu7n.js → imports-page-BmEqiunH.js} +1 -1
  80. package/dist/gateway/static/root/assets/index-CqQZfWRQ.js +11 -0
  81. package/dist/gateway/static/root/assets/index-D7Noveui.css +1 -0
  82. package/dist/gateway/static/root/assets/{install-connector-dialog-CVjCFdly.js → install-connector-dialog-BU4l6KJv.js} +1 -1
  83. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DdZfxLQb.js → keyboard-shortcuts-settings-CtNI6i7K.js} +1 -1
  84. package/dist/gateway/static/root/assets/{local-app-workbench-page-xV9a7McI.js → local-app-workbench-page-Drbzz4Lm.js} +1 -1
  85. package/dist/gateway/static/root/assets/{local-apps-page-buwr_S_-.js → local-apps-page-DqZT5hLH.js} +1 -1
  86. package/dist/gateway/static/root/assets/{local-session-drafts-v7v7Hb6T.js → local-session-drafts-Bt_e3A8f.js} +1 -1
  87. package/dist/gateway/static/root/assets/{locale-store-DGtk-KSF.js → locale-store-Bld7_m-Q.js} +1 -1
  88. package/dist/gateway/static/root/assets/{logs-page-D_VBpYkM.js → logs-page-CzajqK40.js} +1 -1
  89. package/dist/gateway/static/root/assets/{management-settings-BlRCdUF3.js → management-settings-BgdAP0kf.js} +1 -1
  90. package/dist/gateway/static/root/assets/{markdown-view-JXJ3e1CB.js → markdown-view-B3cFKCfO.js} +1 -1
  91. package/dist/gateway/static/root/assets/markdown-view-DG8DDkEA.css +1 -0
  92. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-Vr2dpowU.js → mcp-conversation-setup-page-ZcY1nqMO.js} +1 -1
  93. package/dist/gateway/static/root/assets/{media-plugins-DcN8Y0hJ.js → media-plugins-DSOplRhW.js} +1 -1
  94. package/dist/gateway/static/root/assets/messages-CGO1P4mz.js +3 -0
  95. package/dist/gateway/static/root/assets/{model-selector-zD2x0Sn6.js → model-selector-yAKlOR3O.js} +1 -1
  96. package/dist/gateway/static/root/assets/{models-hub-cache-DtZG5bA_.js → models-hub-cache-8V-ZpAIa.js} +1 -1
  97. package/dist/gateway/static/root/assets/{note-detail-panel-CVrfF6XL.js → note-detail-panel-BQdgpm0s.js} +3 -3
  98. package/dist/gateway/static/root/assets/note-image-lightbox-BbNYW2Rw.js +1 -0
  99. package/dist/gateway/static/root/assets/notes-api-CVQqqmGI.js +1 -0
  100. package/dist/gateway/static/root/assets/{notes-page-BOCURwg6.js → notes-page-IefutMyg.js} +3 -3
  101. package/dist/gateway/static/root/assets/{oauth-api-DYNQAQBx.js → oauth-api-DGa6PTuq.js} +1 -1
  102. package/dist/gateway/static/root/assets/{oauth-provider-connect-BvV6SP0k.js → oauth-provider-connect-Bc-KLH1e.js} +1 -1
  103. package/dist/gateway/static/root/assets/{page-context-capture-button-Dor5Y5Bf.js → page-context-capture-button-DDmLslYG.js} +1 -1
  104. package/dist/gateway/static/root/assets/{page-context-draft-B8DQ5lNT.js → page-context-draft-GveHK8e2.js} +1 -1
  105. package/dist/gateway/static/root/assets/page-header-store-YZfSLNTg.js +1 -0
  106. package/dist/gateway/static/root/assets/palette-CDI0VweW.js +1 -0
  107. package/dist/gateway/static/root/assets/{personal-avatar-CF6T0aTT.js → personal-avatar-Cu8lGBXZ.js} +1 -1
  108. package/dist/gateway/static/root/assets/personal-page-DkrDSJqk.js +1 -0
  109. package/dist/gateway/static/root/assets/{personal-settings-panel-BrQ94X_A.js → personal-settings-panel-awr10jTV.js} +1 -1
  110. package/dist/gateway/static/root/assets/{phone-dependencies-card-Zvbw-N0D.js → phone-dependencies-card-CAxn3usD.js} +1 -1
  111. package/dist/gateway/static/root/assets/{phone-model-connection-CQ4PhhE5.js → phone-model-connection-BBG3LxRP.js} +1 -1
  112. package/dist/gateway/static/root/assets/{phone-model-picker-BDBtemUm.js → phone-model-picker-CfPjKpnd.js} +1 -1
  113. package/dist/gateway/static/root/assets/{phone-settings-page-D2KXWcg1.js → phone-settings-page-C4dJdwRW.js} +1 -1
  114. package/dist/gateway/static/root/assets/{phone-workspace-store-BhJAeHdQ.js → phone-workspace-store-BKltFHtG.js} +1 -1
  115. package/dist/gateway/static/root/assets/{plugin-details-dialog-DpPtI0sI.js → plugin-details-dialog-BqcFfZFH.js} +1 -1
  116. package/dist/gateway/static/root/assets/{popover-select-CEMWIrtY.js → popover-select-CLsphyzA.js} +1 -1
  117. package/dist/gateway/static/root/assets/{preference-select-fields-Bx26yGRF.js → preference-select-fields-QlyIA8ve.js} +1 -1
  118. package/dist/gateway/static/root/assets/product-automation-feedback-CRsfuAXl.js +7 -0
  119. package/dist/gateway/static/root/assets/product-navigation-Dp-adLY_.js +1 -0
  120. package/dist/gateway/static/root/assets/{product-open-page-DSWELoz0.js → product-open-page-CQ4dk-_l.js} +1 -1
  121. package/dist/gateway/static/root/assets/{product-preview-content-DJb-OtMo.js → product-preview-content-COU6H_jO.js} +1 -1
  122. package/dist/gateway/static/root/assets/{product-preview-modal-DaQhXcev.js → product-preview-modal-Ct5q4tv6.js} +2 -2
  123. package/dist/gateway/static/root/assets/{project-detail-page-BHLOHrat.js → project-detail-page-CQj7nm6I.js} +1 -1
  124. package/dist/gateway/static/root/assets/{project-understanding-CjhVk8l-.js → project-understanding-CU2af95r.js} +1 -1
  125. package/dist/gateway/static/root/assets/{projects-page-sVWDuzmC.js → projects-page-sWxQJrFS.js} +1 -1
  126. package/dist/gateway/static/root/assets/{providers-api-gWGsgOOf.js → providers-api-CspehmSU.js} +1 -1
  127. package/dist/gateway/static/root/assets/recording-upload-BOZAOdCI.js +1 -0
  128. package/dist/gateway/static/root/assets/{registry-api-CRxE9kFY.js → registry-api-Bdp3UUyz.js} +1 -1
  129. package/dist/gateway/static/root/assets/{remote-access-hub-Bw__qp-v.js → remote-access-hub-Bos3uwAT.js} +1 -1
  130. package/dist/gateway/static/root/assets/{resource-unavailable-BaczkGfK.js → resource-unavailable-DJR3SCy6.js} +1 -1
  131. package/dist/gateway/static/root/assets/route-preload-CDQtPdgq.js +2 -0
  132. package/dist/gateway/static/root/assets/{runtime-tools-api-ygfM5FCT.js → runtime-tools-api-DsbahxzE.js} +1 -1
  133. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BWEK7BZS.js → runtime-tools-settings-panel-DW9_OFi2.js} +1 -1
  134. package/dist/gateway/static/root/assets/{schema-form-C-jw6Hid.js → schema-form-CtRM41Re.js} +1 -1
  135. package/dist/gateway/static/root/assets/{service-recommendation-list-DrgwXSEt.js → service-recommendation-list-Bd1JDO5T.js} +1 -1
  136. package/dist/gateway/static/root/assets/{session-api-CpZ24vrQ.js → session-api-DjnHJ-0n.js} +1 -1
  137. package/dist/gateway/static/root/assets/{session-manager-CZyY5Y87.js → session-manager-Czu9GpZX.js} +1 -1
  138. package/dist/gateway/static/root/assets/{sessions-page-DgXRw0_8.js → sessions-page-CGkbbrz-.js} +1 -1
  139. package/dist/gateway/static/root/assets/settings-advanced-gate-DyGT3o1e.js +1 -0
  140. package/dist/gateway/static/root/assets/{settings-advanced-section-DmCp3OWb.js → settings-advanced-section-CM44UlF8.js} +1 -1
  141. package/dist/gateway/static/root/assets/{settings-loading-skeleton-BTqvr_Fw.js → settings-loading-skeleton-CAoOV17i.js} +1 -1
  142. package/dist/gateway/static/root/assets/{settings-mode-store-fZ6mzf4A.js → settings-mode-store-Blc4C8aw.js} +1 -1
  143. package/dist/gateway/static/root/assets/{settings-page-header-4d1u-o-F.js → settings-page-header-BYFaTD8a.js} +1 -1
  144. package/dist/gateway/static/root/assets/{settings-page-layout-Cy9_VBag.js → settings-page-layout-CnUQSxT3.js} +1 -1
  145. package/dist/gateway/static/root/assets/{settings-page-SQwLKlTr.js → settings-page-zGjDXdHY.js} +1 -1
  146. package/dist/gateway/static/root/assets/{setup-interaction-page-OFU6DKgp.js → setup-interaction-page-DqaiLQ0I.js} +1 -1
  147. package/dist/gateway/static/root/assets/{setup-status-panel-KKAneNTe.js → setup-status-panel-iOYgfkoK.js} +1 -1
  148. package/dist/gateway/static/root/assets/{share-link-dialog-Apq3cegw.js → share-link-dialog-C_uYNUlp.js} +1 -1
  149. package/dist/gateway/static/root/assets/{share-preview-page-B6yMj5nG.js → share-preview-page-Bs3VjTGj.js} +1 -1
  150. package/dist/gateway/static/root/assets/{shares-api-Q5x_ty6F.js → shares-api-C2GDyqxP.js} +1 -1
  151. package/dist/gateway/static/root/assets/{shares-settings-vxTYg6Hp.js → shares-settings-BseSozxm.js} +1 -1
  152. package/dist/gateway/static/root/assets/skeleton-DzdOeGYz.js +1 -0
  153. package/dist/gateway/static/root/assets/{skill-api-CBFXDh9m.js → skill-api-BnpTSZGc.js} +1 -1
  154. package/dist/gateway/static/root/assets/{skill-list-api-C8tm-XxH.js → skill-list-api-7MY9ewiu.js} +1 -1
  155. package/dist/gateway/static/root/assets/{skill-reload-api-B-4Yj46U.js → skill-reload-api-DkDpu3Wd.js} +1 -1
  156. package/dist/gateway/static/root/assets/skills-page-sL2kGqHZ.js +2 -0
  157. package/dist/gateway/static/root/assets/{system-settings-panel-a4mBz4J2.js → system-settings-panel-BltKPJdb.js} +1 -1
  158. package/dist/gateway/static/root/assets/{task-detail-page-B9akf3i8.js → task-detail-page-CwMpmFVS.js} +1 -1
  159. package/dist/gateway/static/root/assets/{task-result-evidence-DFiu5SlL.js → task-result-evidence-BNhYqUAa.js} +1 -1
  160. package/dist/gateway/static/root/assets/{terminal-panel-store-BdOlpRkY.js → terminal-panel-store-DUEJoa1M.js} +1 -1
  161. package/dist/gateway/static/root/assets/{theme-store-D58tk8pq.js → theme-store-DsvYj7Vy.js} +1 -1
  162. package/dist/gateway/static/root/assets/tool-friendly-title-DEGpbye4.js +1 -0
  163. package/dist/gateway/static/root/assets/{tracing-settings-page-CO0-AiCl.js → tracing-settings-page-CMtFem_g.js} +1 -1
  164. package/dist/gateway/static/root/assets/{tunnel-api-DVRX9yW6.js → tunnel-api-B6BhWTh3.js} +1 -1
  165. package/dist/gateway/static/root/assets/{understanding-activity-store-B_-648uj.js → understanding-activity-store-B7rFXhDk.js} +1 -1
  166. package/dist/gateway/static/root/assets/{understanding-refresh-store-BXJ-kwzq.js → understanding-refresh-store-DCFASve5.js} +1 -1
  167. package/dist/gateway/static/root/assets/{usage-page-C76JnWR8.js → usage-page-BO2OFCoA.js} +1 -1
  168. package/dist/gateway/static/root/assets/{use-autosave-xytwr7Lc.js → use-autosave-DsqcLHV9.js} +1 -1
  169. package/dist/gateway/static/root/assets/use-composer-attachments-DA6SxZPQ.js +2 -0
  170. package/dist/gateway/static/root/assets/use-file-preview-expanded-g4SwMHbx.js +2 -0
  171. package/dist/gateway/static/root/assets/{use-personal-profile-BXHU0P8I.js → use-personal-profile-T2e6P5Ed.js} +1 -1
  172. package/dist/gateway/static/root/assets/{use-workspace-tree-CiLbOQHQ.js → use-workspace-tree-DG5ZMfaY.js} +1 -1
  173. package/dist/gateway/static/root/assets/user-model-page-B5_01fi_.js +2 -0
  174. package/dist/gateway/static/root/assets/{voice-api-key-field-Dn092u0X.js → voice-api-key-field-D7NPAc1E.js} +1 -1
  175. package/dist/gateway/static/root/assets/voice-call-context-CJ1ZiJWR.js +1 -0
  176. package/dist/gateway/static/root/assets/{voice-config-api-fqUzP-ZY.js → voice-config-api-UQDTh6hh.js} +1 -1
  177. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-D7QdPeuj.js → voice-input-shortcut-events-SD2gZVg8.js} +1 -1
  178. package/dist/gateway/static/root/assets/{voice-transcribe-api-NpNY_gsE.js → voice-transcribe-api-Cc92OabY.js} +1 -1
  179. package/dist/gateway/static/root/assets/{work-discovery-overlay-BARpCMZl.js → work-discovery-overlay-B41GOFXh.js} +1 -1
  180. package/dist/gateway/static/root/assets/{work-discovery-page-p0aVb8xr.js → work-discovery-page-NNhExALx.js} +1 -1
  181. package/dist/gateway/static/root/assets/{working-directory-picker-modal-7G-6icvh.js → working-directory-picker-modal-DeNWVFFK.js} +1 -1
  182. package/dist/gateway/static/root/assets/{workspace-api-BKbezgv-.js → workspace-api-fKmmIslV.js} +2 -2
  183. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CmSYxTmk.js +1 -0
  184. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-CS8-ZbVG.js → workspace-file-preview-dialog-C_0lUEsm.js} +1 -1
  185. package/dist/gateway/static/root/assets/{workspace-open-location-menu-BQrTy-8o.js → workspace-open-location-menu-BznuSmFZ.js} +1 -1
  186. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Bc5rXL-E.js → xopc-cloud-account-card-BlhFT1q9.js} +1 -1
  187. package/dist/gateway/static/root/index.html +95 -98
  188. package/dist/package.js +1 -1
  189. package/dist/packages/browser-control-contract/src/dom.js +79 -0
  190. package/dist/packages/browser-control-contract/src/index.js +2 -25
  191. package/dist/packages/gateway-contract/src/automations.js +0 -6
  192. package/dist/src/agent/agent-manager.d.ts +0 -1
  193. package/dist/src/agent/agent-manager.js +0 -1
  194. package/dist/src/agent/external-tools/index.d.ts +1 -1
  195. package/dist/src/agent/service.js +0 -1
  196. package/dist/src/agent/service.types.d.ts +0 -1
  197. package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
  198. package/dist/src/agent/tool-manuals/browser.js +0 -3
  199. package/dist/src/agent/tools/factory.d.ts +0 -2
  200. package/dist/src/agent/tools/factory.js +0 -2
  201. package/dist/src/agent/tools/find.d.ts +1 -1
  202. package/dist/src/agent/tools/grep.d.ts +1 -1
  203. package/dist/src/agent/tools/index.d.ts +0 -1
  204. package/dist/src/agent/tools/index.js +1 -2
  205. package/dist/src/agent/tools/metadata.d.ts +1 -1
  206. package/dist/src/auth/oauth/anthropic.d.ts +1 -7
  207. package/dist/src/auth/oauth/anthropic.js +6 -83
  208. package/dist/src/auth/oauth/index.d.ts +0 -2
  209. package/dist/src/auth/oauth/index.js +2 -6
  210. package/dist/src/auth/oauth/kimi-coding.d.ts +1 -6
  211. package/dist/src/auth/oauth/kimi-coding.js +5 -79
  212. package/dist/src/auth/oauth/openai.js +1 -1
  213. package/dist/src/auth/oauth/pi-oauth-adapter.d.ts +4 -0
  214. package/dist/src/auth/oauth/pi-oauth-adapter.js +53 -0
  215. package/dist/src/auth/oauth/registry.js +0 -9
  216. package/dist/src/automations/capabilities/write.d.ts +0 -12
  217. package/dist/src/automations/domain/defaults.d.ts +0 -1
  218. package/dist/src/automations/domain/defaults.js +2 -3
  219. package/dist/src/automations/domain/index.js +2 -2
  220. package/dist/src/automations/domain/types.d.ts +0 -26
  221. package/dist/src/automations/domain/validation.d.ts +0 -24
  222. package/dist/src/automations/domain/validation.js +0 -7
  223. package/dist/src/automations/draft/automation-draft-validator.d.ts +0 -6
  224. package/dist/src/automations/draft/automation-draft-validator.js +0 -1
  225. package/dist/src/automations/index.js +2 -2
  226. package/dist/src/automations/service/action-executor.d.ts +0 -1
  227. package/dist/src/automations/service/action-executor.js +0 -31
  228. package/dist/src/automations/service/automation-service.d.ts +0 -1
  229. package/dist/src/automations/service/automation-service.js +1 -13
  230. package/dist/src/browser/drivers/playwright-driver.js +1 -2
  231. package/dist/src/cli/commands/extension-dev.js +1 -1
  232. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  233. package/dist/src/cli/commands/extension.js +1 -1
  234. package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
  235. package/dist/src/cli/commands/models.js +1 -1
  236. package/dist/src/cli/commands/onboard/model.js +3 -3
  237. package/dist/src/cli/commands/tunnel.js +1 -1
  238. package/dist/src/cli/commands/update.js +1 -1
  239. package/dist/src/config/models-json.d.ts +24 -24
  240. package/dist/src/endpoint-tools/policy.js +3 -4
  241. package/dist/src/gateway/hono/app.js +1 -1
  242. package/dist/src/gateway/hono/middleware/auth.js +1 -1
  243. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
  244. package/dist/src/gateway/hono/routes/desktop-host.js +1 -1
  245. package/dist/src/gateway/hono/routes/exposure.js +1 -1
  246. package/dist/src/gateway/hono/routes/files.js +2 -2
  247. package/dist/src/gateway/hono/routes/imports.js +1 -1
  248. package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -16
  249. package/dist/src/gateway/hono/routes/local-apps.js +1 -1
  250. package/dist/src/gateway/hono/routes/logs.js +1 -1
  251. package/dist/src/gateway/hono/routes/models.js +5 -5
  252. package/dist/src/gateway/hono/routes/notes.js +1 -1
  253. package/dist/src/gateway/hono/routes/personal-agent.js +2 -2
  254. package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
  255. package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
  256. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  257. package/dist/src/gateway/hono/routes/shares.js +5 -5
  258. package/dist/src/gateway/hono/routes/status.js +1 -1
  259. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  260. package/dist/src/gateway/hono/routes/tunnel.js +2 -2
  261. package/dist/src/gateway/hono/routes/update.js +2 -2
  262. package/dist/src/gateway/hono/routes/voice.js +1 -1
  263. package/dist/src/gateway/index.js +2 -2
  264. package/dist/src/gateway/provider-model-setup.js +1 -1
  265. package/dist/src/gateway/run-loop.js +2 -2
  266. package/dist/src/gateway/security/audit.js +1 -1
  267. package/dist/src/gateway/security/gateway-scopes.js +0 -2
  268. package/dist/src/gateway/security/index.js +2 -2
  269. package/dist/src/gateway/server.js +1 -1
  270. package/dist/src/gateway/service/agent-runner.js +1 -1
  271. package/dist/src/gateway/service/run-gateway-agent.js +2 -2
  272. package/dist/src/gateway/service/sessions-api.js +1 -1
  273. package/dist/src/gateway/service.d.ts +0 -3
  274. package/dist/src/gateway/service.js +31 -46
  275. package/dist/src/gateway/side-chat/run-service.js +1 -1
  276. package/dist/src/home-intelligence/host.js +2 -2
  277. package/dist/src/infra/gateway-processes.js +1 -1
  278. package/dist/src/infra/update-restart.js +1 -1
  279. package/dist/src/infra/update-runner.js +2 -2
  280. package/dist/src/infra/update-startup.js +1 -1
  281. package/dist/src/notifications/service.js +2 -2
  282. package/dist/src/personal-agent/prompts.js +1 -1
  283. package/dist/src/personal-agent/reply-style.d.ts +2 -2
  284. package/dist/src/personal-agent/reply-style.js +10 -0
  285. package/dist/src/phone/stream-gateway.js +1 -1
  286. package/dist/src/providers/domestic-presets.d.ts +2 -310
  287. package/dist/src/providers/domestic-presets.js +2 -396
  288. package/dist/src/providers/env-keys.js +2 -6
  289. package/dist/src/providers/index.js +6 -13
  290. package/dist/src/providers/presentation.js +4 -6
  291. package/dist/src/providers/setup/profiles.js +1 -2
  292. package/dist/src/providers/setup/voice.js +1 -1
  293. package/dist/src/realtime/runtime.js +1 -1
  294. package/dist/src/remote-access/exposure-manager.js +1 -1
  295. package/dist/src/share/site-share-router.js +2 -2
  296. package/dist/src/storage/sqlite/schema.sql +0 -81
  297. package/dist/src/tasks/home-query-service.js +0 -1
  298. package/dist/src/tui/backends/embedded-backend.js +3 -3
  299. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  300. package/dist/src/voice/realtime/runtime.js +1 -1
  301. package/dist/src/work-discovery/index.js +2 -2
  302. package/dist/src/work-discovery/investigator.js +1 -1
  303. package/dist/src/work-discovery/service.js +3 -3
  304. package/package.json +9 -9
  305. package/dist/gateway/static/root/assets/app-link-DRy3-k7j.js +0 -1
  306. package/dist/gateway/static/root/assets/arrow-up-right-T72JbQ1Q.js +0 -1
  307. package/dist/gateway/static/root/assets/automation-task-card-BecBULES.js +0 -3
  308. package/dist/gateway/static/root/assets/automations-workspace-BBSTBucV.js +0 -9
  309. package/dist/gateway/static/root/assets/book-open-CCGtrT3R.js +0 -1
  310. package/dist/gateway/static/root/assets/browser-automation-inputs-DADzEaqe.js +0 -1
  311. package/dist/gateway/static/root/assets/browser-automations-page-V7_ZTcyU.js +0 -3
  312. package/dist/gateway/static/root/assets/browser-control-api-Bdr2nGCE.js +0 -6
  313. package/dist/gateway/static/root/assets/browser-settings-page-irOt8KDh.js +0 -3
  314. package/dist/gateway/static/root/assets/capabilities-CrAs-oqU.js +0 -1
  315. package/dist/gateway/static/root/assets/capabilities-page-CJLVUcD4.js +0 -2
  316. package/dist/gateway/static/root/assets/capabilities-settings-panel-D8t5F998.js +0 -8
  317. package/dist/gateway/static/root/assets/capability-icon-DVoZxEgW.js +0 -1
  318. package/dist/gateway/static/root/assets/chat-page-DBAezT9u.js +0 -72
  319. package/dist/gateway/static/root/assets/connected-providers-grid-CpO98SqR.js +0 -1
  320. package/dist/gateway/static/root/assets/connection-usage-Cm_McddI.js +0 -1
  321. package/dist/gateway/static/root/assets/connection-usage-guide-DOf2VWzv.js +0 -1
  322. package/dist/gateway/static/root/assets/connectors-page-Cbn4LSpC.js +0 -1
  323. package/dist/gateway/static/root/assets/earth-BMhZtzcj.js +0 -1
  324. package/dist/gateway/static/root/assets/gateway-realtime-store-xYMxjztG.js +0 -1
  325. package/dist/gateway/static/root/assets/index-CKIirf4W.css +0 -1
  326. package/dist/gateway/static/root/assets/index-CQ570IAI.js +0 -11
  327. package/dist/gateway/static/root/assets/markdown-view-C-DHb3Io.css +0 -1
  328. package/dist/gateway/static/root/assets/messages-DYDySzn1.js +0 -3
  329. package/dist/gateway/static/root/assets/note-image-lightbox-V4rmgfLB.js +0 -1
  330. package/dist/gateway/static/root/assets/notes-api-UXC3eyeM.js +0 -1
  331. package/dist/gateway/static/root/assets/page-header-store-f8XcAs9b.js +0 -1
  332. package/dist/gateway/static/root/assets/personal-page-DUykELZZ.js +0 -1
  333. package/dist/gateway/static/root/assets/product-automation-feedback-_K6grEOt.js +0 -7
  334. package/dist/gateway/static/root/assets/product-navigation-Co8pLbDP.js +0 -1
  335. package/dist/gateway/static/root/assets/recording-upload-CBefH7C5.js +0 -1
  336. package/dist/gateway/static/root/assets/route-preload-Coy9Gjyy.js +0 -2
  337. package/dist/gateway/static/root/assets/settings-advanced-gate-Ch9MNvvk.js +0 -1
  338. package/dist/gateway/static/root/assets/skeleton-BI5TyibZ.js +0 -1
  339. package/dist/gateway/static/root/assets/skills-page-Xbnh0-6I.js +0 -2
  340. package/dist/gateway/static/root/assets/star-BUWJqJ5c.js +0 -1
  341. package/dist/gateway/static/root/assets/tool-friendly-title-DcCc6g7o.js +0 -1
  342. package/dist/gateway/static/root/assets/use-composer-attachments-fK2PUQbB.js +0 -2
  343. package/dist/gateway/static/root/assets/use-file-preview-expanded-ivMxmMu1.js +0 -2
  344. package/dist/gateway/static/root/assets/user-model-page-BzpV1hq_.js +0 -2
  345. package/dist/gateway/static/root/assets/video-B6V0GFss.js +0 -1
  346. package/dist/gateway/static/root/assets/voice-call-context-BM2A4bLz.js +0 -1
  347. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CODAQqJn.js +0 -1
  348. package/dist/packages/browser-control-contract/src/automation.js +0 -213
  349. package/dist/src/agent/tools/browser-automation-tool.d.ts +0 -194
  350. package/dist/src/agent/tools/browser-automation-tool.js +0 -243
  351. package/dist/src/auth/oauth/minimax-cn.d.ts +0 -11
  352. package/dist/src/auth/oauth/minimax-cn.js +0 -95
  353. package/dist/src/auth/oauth/minimax.d.ts +0 -8
  354. package/dist/src/auth/oauth/minimax.js +0 -95
  355. package/dist/src/browser/automations/index.d.ts +0 -4
  356. package/dist/src/browser/automations/index.js +0 -4
  357. package/dist/src/browser/automations/repository.d.ts +0 -17
  358. package/dist/src/browser/automations/repository.js +0 -81
  359. package/dist/src/browser/automations/runner.d.ts +0 -17
  360. package/dist/src/browser/automations/runner.js +0 -265
  361. package/dist/src/browser/automations/runtime-service.d.ts +0 -8
  362. package/dist/src/browser/automations/runtime-service.js +0 -38
  363. package/dist/src/browser/automations/schema.d.ts +0 -227
  364. package/dist/src/browser/automations/schema.js +0 -201
  365. package/dist/src/browser/automations/service.d.ts +0 -232
  366. package/dist/src/browser/automations/service.js +0 -214
  367. package/dist/src/browser/automations/types.d.ts +0 -105
  368. package/dist/src/browser/automations/types.js +0 -1
  369. package/dist/src/browser/recordings/service.d.ts +0 -22
  370. package/dist/src/browser/recordings/service.js +0 -159
  371. package/dist/src/gateway/hono/routes/browser-automations.d.ts +0 -3
  372. package/dist/src/gateway/hono/routes/browser-automations.js +0 -93
  373. package/dist/src/gateway/hono/routes/browser-recordings.d.ts +0 -3
  374. package/dist/src/gateway/hono/routes/browser-recordings.js +0 -78
  375. package/dist/browser-ext/dist/assets/{page-context-DngcqfGf.js → auth-DAIwDtVp.js} +1368 -1368
@@ -1,9 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-page-DBAezT9u.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/locale-store-DGtk-KSF.js","assets/messages-DYDySzn1.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/archive-Dz0hferG.js","assets/arrow-left-D880xG-P.js","assets/arrow-up-right-T72JbQ1Q.js","assets/arrow-up-D5ZtR1QT.js","assets/product-automation-feedback-_K6grEOt.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/notes-api-UXC3eyeM.js","assets/markdown-view-JXJ3e1CB.js","assets/download-Dk-ZjtO6.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/app-link-DRy3-k7j.js","assets/product-delivery-DRyD9_Xq.js","assets/schemas-CCWMleym.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/chat-chart-block-Z41MRuzh.js","assets/check-DUBLcKHA.js","assets/copy-Dv6d4Dvw.js","assets/skeleton-BI5TyibZ.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/vendor-swr-CdRzEUwF.js","assets/button-Cc4hUNTt.js","assets/automation-api-paBg5ie6.js","assets/book-open-CCGtrT3R.js","assets/chevron-down-ccbiQQz_.js","assets/chevron-right-BweFrslA.js","assets/working-directory-picker-modal-7G-6icvh.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-CEMWIrtY.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-alert-BEjgurr2.js","assets/new-chat-navigation-B6NPQ4h4.js","assets/circle-x-DFsCKeya.js","assets/circle-BoO4YvTx.js","assets/file-tree-utils-DJs1faGv.js","assets/database-CjjeZfRG.js","assets/earth-BMhZtzcj.js","assets/ellipsis-0k4rZLoy.js","assets/file-BqMS_3DT.js","assets/file-text-D12HbeVy.js","assets/folder-kanban-CpLlFI1o.js","assets/folder-open-CyzJ19I9.js","assets/folder-CN-pC3XL.js","assets/use-file-preview-expanded-ivMxmMu1.js","assets/eye-CABVeTq0.js","assets/link-2-D_ZKYUW7.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/constants-DBtMsXdW.js","assets/session-api-CpZ24vrQ.js","assets/gateway-startup-retry-DCjREMIO.js","assets/attachment-utils-core-BIOUBrpT.js","assets/activity-store-t5c6XavH.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/sliding-tab-list-DuQyViqe.js","assets/sliding-indicator-hwz0sx3h.js","assets/index.module-Cd9ENXfk.js","assets/workspace-api-BKbezgv-.js","assets/files-BNL4kkSB.js","assets/dist-ZrL34Ps4.js","assets/git-branch-Dh9uxTot.js","assets/globe-DSSGFWFn.js","assets/history-DXH_9jsE.js","assets/key-round-DWbpyU2U.js","assets/laptop-CI3hBVrl.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/install-connector-dialog-CVjCFdly.js","assets/secret-input-Dryrns2s.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-HFW1Iey5.js","assets/gateway-config-swr-BW6eBLIt.js","assets/oauth-provider-connect-BvV6SP0k.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-DtZG5bA_.js","assets/registry-api-CRxE9kFY.js","assets/oauth-api-DYNQAQBx.js","assets/connection-usage-guide-DOf2VWzv.js","assets/connection-usage-Cm_McddI.js","assets/settings-2-D-csvaET.js","assets/settings-uiTATseT.js","assets/shield-check-BU58siTV.js","assets/smartphone-DSSsQFqA.js","assets/square-DMK_fB-3.js","assets/trash-2-DusmjVPV.js","assets/share-link-dialog-Apq3cegw.js","assets/copy-text-row-CpiRzq4G.js","assets/wrench-DFb4r8bH.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/api-DRyQFk9q.js","assets/session-manager-CZyY5Y87.js","assets/local-session-drafts-v7v7Hb6T.js","assets/tool-activity-BtJkgjFf.js","assets/personal-proactivity-DaRnbB1f.js","assets/gateway-realtime-Bg4Mf7HA.js","assets/gateway-realtime-store-xYMxjztG.js","assets/agents-admin-api-CewiIx4v.js","assets/new-session-preferences-gb411vZP.js","assets/extension-provider-D-Fa5PU-.js","assets/capabilities-CrAs-oqU.js","assets/theme-store-D58tk8pq.js","assets/middleware-Pd0e8Igk.js","assets/use-composer-attachments-fK2PUQbB.js","assets/chevron-left-DqFhpbvK.js","assets/capabilities-DG0ckPuF.js","assets/file-preview-surface-D62ph0m0.js","assets/phone-workspace-store-BhJAeHdQ.js","assets/shares-api-Q5x_ty6F.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/chat-agents-api-CTL8cwNk.js","assets/composer-payload-handoff-Ccq_KF1W.js","assets/voice-transcribe-api-NpNY_gsE.js","assets/open-capability-settings-Cvb65hQB.js","assets/workspace-editor-agent-store-CODAQqJn.js","assets/voice-input-shortcut-events-D7QdPeuj.js","assets/chunk-D32TOXHM-DQIy-Baq.js","assets/tool-friendly-title-DcCc6g7o.js","assets/voice-call-context-BM2A4bLz.js","assets/page-header-store-f8XcAs9b.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/agent-avatar-display-Cm0afn_O.js","assets/use-directory-picker-C4p7AgWY.js","assets/confirm-dialog-D7dQJytv.js","assets/command-palette-api-C3G6veE2.js","assets/skill-list-api-C8tm-XxH.js","assets/skill-api-utils-C7V4JVXM.js","assets/model-selector-zD2x0Sn6.js","assets/model-sort-_Tz8s_4N.js","assets/dev-view-store-D4C_zjRq.js","assets/extension-iframe-host-DTwDBQQ9.js","assets/automation-task-card-BecBULES.js","assets/calendar-clock-D-quYVPe.js","assets/message-circle-Badhj-4D.js","assets/date-picker-C_tweuM0.js","assets/calendar-days-hw_Y-g-s.js","assets/api-CE6gdBWx.js","assets/runtime-health-D2TDFLLq.js","assets/terminal-panel-store-BdOlpRkY.js","assets/agents-app-path-ciChvpCS.js","assets/agent-display-names-Bje7vfSn.js","assets/use-media-query-ady-FgjK.js","assets/oauth-authorization-window-o6URRos4.js","assets/page-context-draft-B8DQ5lNT.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{m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as c,i as l,l as u,n as d}from"./locale-store-DGtk-KSF.js";import{t as f}from"./messages-DYDySzn1.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{t as y}from"./activity-YogQEteU.js";import{t as b}from"./arrow-left-D880xG-P.js";import{t as x}from"./calendar-clock-D-quYVPe.js";import{i as S,n as C,r as w,t as T}from"./automation-run-list-Crw5qn_I.js";import{t as E}from"./check-DUBLcKHA.js";import{t as D}from"./chevron-down-ccbiQQz_.js";import{t as O}from"./chevron-right-BweFrslA.js";import{n as k,r as A}from"./popover-select-CEMWIrtY.js";import{t as j}from"./circle-alert-BEjgurr2.js";import{t as M}from"./circle-check-C23XjkUj.js";import{t as N}from"./copy-Dv6d4Dvw.js";import{t as P}from"./ellipsis-0k4rZLoy.js";import{t as F}from"./eye-CABVeTq0.js";import{t as I}from"./git-branch-Dh9uxTot.js";import{t as L}from"./list-filter-CIPvpfLA.js";import{t as R}from"./loader-circle-CifKLtgG.js";import{t as z}from"./markdown-view-JXJ3e1CB.js";import{t as ee}from"./message-circle-Badhj-4D.js";import{t as te}from"./pause-DuPxgSxk.js";import{t as ne}from"./pencil-DmIY3Oa-.js";import{t as re}from"./play-kxZvpBg8.js";import{t as ie}from"./plus-Q2yW6OE7.js";import{t as ae}from"./refresh-cw-BRlGaq2w.js";import{t as oe}from"./search-DA7gz22f.js";import{t as B}from"./shield-check-BU58siTV.js";import{t as se}from"./sparkles-DHlfQFAF.js";import{t as V}from"./square-pen-B8FsvqNu.js";import{t as H}from"./trash-2-DusmjVPV.js";import{t as ce}from"./x-B_N4OPjy.js";import{t as U}from"./zap-dximCGjy.js";import{t as le}from"./cn-0WouolD0.js";import{t as W}from"./skeleton-BI5TyibZ.js";import{d as G}from"./api-DRyQFk9q.js";import{a as ue}from"./session-api-CpZ24vrQ.js";import{T as K}from"./session-manager-CZyY5Y87.js";import{a as de,i as q,o as fe}from"./vendor-swr-CdRzEUwF.js";import{t as pe}from"./chat-agents-api-CTL8cwNk.js";import{t as me}from"./button-Cc4hUNTt.js";import{t as he}from"./page-header-store-f8XcAs9b.js";import{t as J}from"./automation-api-paBg5ie6.js";import{t as ge}from"./sliding-tab-list-DuQyViqe.js";import{t as _e}from"./refresh-button-DiWdGAaX.js";import{a as ve,c as ye,d as be,f as xe,i as Se,l as Ce,m as we,o as Y,p as Te,r as Ee,s as X,t as De,u as Oe}from"./dist-ZrL34Ps4.js";import{n as ke}from"./model-selector-zD2x0Sn6.js";import{C as Ae,S as je,T as Z,_ as Me,a as Ne,b as Pe,c as Fe,d as Ie,f as Le,g as Re,h as ze,l as Be,m as Ve,n as He,o as Ue,p as We,r as Ge,s as Ke,u as qe,v as Je,w as Ye,x as Xe,y as Ze}from"./automation-task-card-BecBULES.js";import{n as Qe}from"./agent-display-names-Bje7vfSn.js";import{i as $e,n as et,r as tt,t as nt}from"./automation-result-state-Ds-59DdX.js";import{i as rt,n as it,r as at,t as ot}from"./browser-automation-inputs-DADzEaqe.js";var st=n(),Q=e(t(),1),$=r(),ct=(0,Q.lazy)(()=>i(()=>import(`./chat-page-DBAezT9u.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])));function lt(e){let t=(0,st.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}=de(),w=(0,Q.useRef)(!1),T=i??``,E;t[2]!==r||t[3]!==n||t[4]!==T?(E=[`automation-execution`,r,n,T],t[2]=r,t[3]=n,t[4]=T,t[5]=E):E=t[5];let D;t[6]!==r||t[7]!==i||t[8]!==n||t[9]!==l?(D=async()=>{let{run:e}=await J.getRun(n);if(e.automationId!==r)throw Error(l?`执行记录不属于此自动化`:`Execution does not belong to this automation`);let{automation:t}=await J.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]=D):D=t[10];let O;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(O={refreshInterval:ft,shouldRetryOnError:!1},t[11]=O):O=t[11];let{data:k,error:A,mutate:j}=q(E,D,O),M=k?.run,N=M?.conversationId,P;t[12]===N?P=t[13]:(P=e=>!!(N&&(e.sessions[N]?.streaming||e.sessions[N]?.sending)),t[12]=N,t[13]=P);let F=K(P),I;t[14]===N?I=t[15]:(I=N?[`automation-execution-session`,N]:null,t[14]=N,t[15]=I);let L;t[16]===N?L=t[17]:(L=()=>ue(N),t[16]=N,t[17]=L);let R;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(R={shouldRetryOnError:!1},t[18]=R):R=t[18];let{data:ee,error:te,mutate:ne}=q(I,L,R),re=M?.conversationShared||k?.automation.conversationMode===`continuous`||ee?.customData?.latestAutomationRunId!==void 0&&ee.customData.latestAutomationRunId!==n,ie=!!(ee&&(!re||u)),ae=!A&&!!(M&&(!N||re&&!u&&ee&&!te&&(M?.summary||M?.error)||ee&&!te&&p)),oe,B;if(t[19]!==ae||t[20]!==j||t[21]!==S||t[22]!==M?(oe=()=>{!M||!ae||C(M)||M.readAtMs!=null||w.current||(w.current=!0,J.markRunRead(M.id).then(async()=>{await Promise.all([j(),S(dt)])}).catch(ut).finally(()=>{w.current=!1}))},B=[M,ae,j,S],t[19]=ae,t[20]=j,t[21]=S,t[22]=M,t[23]=oe,t[24]=B):(oe=t[23],B=t[24]),(0,Q.useEffect)(oe,B),A){let e=A instanceof Error?A.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]===j?r=t[28]:(r=()=>void j(),t[27]=j,t[28]=r);let i=l?`重试`:`Retry`,a;t[29]!==r||t[30]!==i?(a=(0,$.jsx)(me,{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)(me,{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(!M){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)(W,{className:`h-6 w-2/3`}),(0,$.jsx)(W,{className:`h-20`})]}),t[39]=e):e=t[39],e}let se;t[40]===M?se=t[41]:(se=C(M),t[40]=M,t[41]=se);let V=se,H=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)(me,{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 G;t[46]===M.automationName?G=t[47]:(G=(0,$.jsx)(`h2`,{className:`truncate text-sm font-medium text-fg`,children:M.automationName}),t[46]=M.automationName,t[47]=G);let fe;t[48]!==le||t[49]!==G?(fe=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[le,G]}),t[48]=le,t[49]=G,t[50]=fe):fe=t[50];let pe;t[51]!==M.createdAtMs||t[52]!==l?(pe=new Date(M.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[51]=M.createdAtMs,t[52]=l,t[53]=pe):pe=t[53];let he;t[54]===a?he=t[55]:(he=f(a),t[54]=a,t[55]=he);let ge=he.automations.status[M.status],_e;t[56]!==pe||t[57]!==ge?(_e=(0,$.jsxs)(`span`,{children:[pe,` · `,ge]}),t[56]=pe,t[57]=ge,t[58]=_e):_e=t[58];let ve;t[59]!==s||t[60]!==M.id?(ve=()=>s(M.id),t[59]=s,t[60]=M.id,t[61]=ve):ve=t[61];let ye=l?`运行详情`:`Run details`,be;t[62]!==ve||t[63]!==ye?(be=(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:ve,children:ye}),t[62]=ve,t[63]=ye,t[64]=be):be=t[64];let xe;t[65]!==o||t[66]!==M?(xe=()=>o(M),t[65]=o,t[66]=M,t[67]=xe):xe=t[67];let Se=l?`调整自动化`:`Adjust automation`,Ce;t[68]!==xe||t[69]!==Se?(Ce=(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:xe,children:Se}),t[68]=xe,t[69]=Se,t[70]=Ce):Ce=t[70];let we;t[71]!==_e||t[72]!==be||t[73]!==Ce?(we=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-fg-muted`,children:[_e,be,Ce]}),t[71]=_e,t[72]=be,t[73]=Ce,t[74]=we):we=t[74];let Y;t[75]!==k?.automation||t[76]!==re||t[77]!==l?(Y=re?(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[l?`多次执行可能共用此会话;下方摘要对应所选执行。`:`Executions may share this conversation. The summary belongs to the selected execution.`,k?.automation.conversationMode===`continuous`?l?`追问会进入后续运行上下文。`:` Follow-ups become context for future runs.`:null]}):null,t[75]=k?.automation,t[76]=re,t[77]=l,t[78]=Y):Y=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 Ee;t[83]!==V||t[84]!==l?(Ee=V?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`执行中,完成后可继续追问。`:`Execution in progress. Follow up after it finishes.`}):null,t[83]=V,t[84]=l,t[85]=Ee):Ee=t[85];let X;t[86]!==fe||t[87]!==we||t[88]!==Y||t[89]!==Te||t[90]!==Ee?(X=(0,$.jsxs)(`header`,{className:`shrink-0 space-y-2 border-b border-edge px-4 py-3`,children:[fe,we,Y,Te,Ee]}),t[86]=fe,t[87]=we,t[88]=Y,t[89]=Te,t[90]=Ee,t[91]=X):X=t[91];let De;t[92]!==V||t[93]!==N||t[94]!==F||t[95]!==ee||t[96]!==a||t[97]!==ne||t[98]!==M.error||t[99]!==M.id||t[100]!==M.summary||t[101]!==te||t[102]!==re||t[103]!==ie||t[104]!==l?(De=ie?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(W,{className:`m-5 h-40`}),children:(0,$.jsx)(ct,{embedded:!0,automationExecution:!0,conversationId:N,readOnly:V||F,onHistoryReady:x,initialTurnId:re?M.id:void 0,onInitialTurnLocated:v},N)}):(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:[M.summary?(0,$.jsx)(z,{content:M.summary}):null,M.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-danger`,children:M.error}):null,N?null:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:V?l?`等待执行会话,开始后会自动更新。`:`Waiting for the execution conversation. This view updates automatically.`:l?`本次执行没有关联会话,可查看运行结果和详情。`:`No conversation is associated with this execution. Results and diagnostics remain available.`}),N&&!ee&&!te?(0,$.jsx)(W,{className:`h-24`}):null,te?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:te.status===404?l?`执行会话已删除,运行结果仍保留。`:`The execution conversation was deleted. Results are still available.`:l?`执行会话暂时无法读取,运行结果仍保留。`:`The conversation is unavailable. Results are still available.`}),(0,$.jsx)(me,{onClick:()=>void ne(),children:l?`重试`:`Retry`})]}):null,re&&ee?(0,$.jsx)(me,{variant:`secondary`,onClick:()=>d(!0),children:l?`打开共享会话`:`Open shared conversation`}):null,V?null:(0,$.jsx)($e,{runId:M.id,language:a})]}),t[92]=V,t[93]=N,t[94]=F,t[95]=ee,t[96]=a,t[97]=ne,t[98]=M.error,t[99]=M.id,t[100]=M.summary,t[101]=te,t[102]=re,t[103]=ie,t[104]=l,t[105]=De):De=t[105];let Oe;return t[106]!==H||t[107]!==X||t[108]!==De?(Oe=(0,$.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":H,children:[X,De]}),t[106]=H,t[107]=X,t[108]=De,t[109]=Oe):Oe=t[109],Oe}function ut(){}function dt(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-navigation-runs`].includes(String(e[0]))||e===`automations-global-system-source`}function ft(e){return e&&C(e.run)?3e3:15e3}function pt(e){let t=(0,st.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)(P,{className:`size-4`}),t[0]=u):u=t[0];let d;t[1]===l?d=t[2]:(d=(0,$.jsx)(we,{asChild:!0,children:(0,$.jsx)(me,{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`))&&!Ae(n)?(0,$.jsxs)(Ee,{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?J.pause(n.id):J.resume(n.id)),children:[n.enabled?(0,$.jsx)(te,{className:`size-4`}):(0,$.jsx)(re,{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)(Ee,{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`,()=>J.runNow(n.id)),children:[(0,$.jsx)(re,{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)(Ee,{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)(ne,{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)(N,{className:`size-4`}),t[25]=g):g=t[25];let _=s?`复制任务链接`:`Copy task link`,v;t[26]!==h||t[27]!==_?(v=(0,$.jsxs)(Ee,{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)(Oe,{className:`my-1 h-px bg-edge-subtle`}),(0,$.jsxs)(Ee,{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`,()=>J.remove(n.id))},children:[(0,$.jsx)(H,{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)(Y,{children:(0,$.jsxs)(De,{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)(Ce,{children:[d,b]}),t[41]=b,t[42]=d,t[43]=x):x=t[43],x}function mt({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(C);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)(D,{className:`size-4`}):(0,$.jsx)(O,{className:`size-4`})}),(0,$.jsxs)(`button`,{type:`button`,className:le(`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:le(`size-2 shrink-0 rounded-full`,g?`bg-blue-500`:et(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:Ae(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:[Re(e,n,i),(0,$.jsx)(`span`,{className:`mx-1.5`,children:`·`})]}):null,Me(e.trigger,n,r,i)]}),et(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)(T,{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)(pt,{automation:e,language:i,busy:p,onEdit:m,onAction:h})})]},e.id)})})}var ht=`xopc.automations.listWidth`,gt=272,_t=200,vt=560;function yt({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(ht));if(Number.isFinite(e)&&e>=_t&&e<=vt)return e}catch{}return gt});(0,Q.useEffect)(()=>{try{window.localStorage.setItem(ht,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(_t,Math.min(vt,t*.6,t-292));return Math.round(Math.max(_t,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":_t,"aria-valuemax":vt,"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(gt),onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),c(l(e.key===`Home`?_t:e.key===`End`?vt:s+(e.key===`ArrowLeft`?-16:16))))}}),e[1]]})}var bt=(0,Q.lazy)(()=>i(()=>import(`./chat-page-DBAezT9u.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])));function xt(e){let t=(0,st.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=()=>J.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}=q(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]:(_=()=>J.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}=q(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}=de(),w;t[16]===S?w=t[17]:(w=e=>!!(S&&(e.sessions[S]?.streaming||e.sessions[S]?.sending)),t[16]=S,t[17]=w);let T=K(w),E=(0,Q.useRef)(!1),D,O;t[18]!==C||t[19]!==T?(D=()=>{E.current&&!T&&C(St),E.current=T},O=[T,C],t[18]=C,t[19]=T,t[20]=D,t[21]=O):(D=t[20],O=t[21]),(0,Q.useEffect)(D,O);let k=a===`zh`,A;t[22]===a?A=t[23]:(A=f(a),t[22]=a,t[23]=A);let j=A,M;if(t[24]!==a||t[25]!==j.automations.status||t[26]!==o||t[27]!==i||t[28]!==k){let e;t[30]!==a||t[31]!==j.automations.status||t[32]!==o||t[33]!==k?(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":k?`任务运行结果`:`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(k?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}),` · `,j.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:k?`查看详情`:`View details`})]}),e.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-danger`,children:tt(e,a)}):e.summary?(0,$.jsx)(z,{content:e.summary}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k?`正在执行,结果会显示在这里。`:`Running. The result will appear here.`}),e.status===`failed`||e.status===`timeout`?(0,$.jsx)(He,{automationId:e.automationId,runId:e.id,language:a,variant:`secondary`}):null,[`queued`,`running`,`cancelling`].includes(e.status)?null:(0,$.jsx)($e,{runId:e.id,language:a})]})}),t[30]=a,t[31]=j.automations.status,t[32]=o,t[33]=k,t[34]=e):e=t[34],M=i.map(e),t[24]=a,t[25]=j.automations.status,t[26]=o,t[27]=i,t[28]=k,t[29]=M}else M=t[29];let N=M;if(m){let e=k?`暂时无法打开任务对话。`:`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=k?`重试`:`Retry`,a;t[39]!==r||t[40]!==i?(a=(0,$.jsx)(me,{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 P=k?`任务对话`:`Task conversation`,F;t[45]!==N||t[46]!==S?(F=S?(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(W,{className:`m-5 h-40`}),children:(0,$.jsx)(bt,{embedded:!0,conversationId:S,automationWorkspace:!0,automationTimelineEntries:N},S)}):(0,$.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,$.jsx)(W,{className:`h-20 w-2/3`}),(0,$.jsx)(W,{className:`h-28`})]}),t[45]=N,t[46]=S,t[47]=F):F=t[47];let I;return t[48]!==P||t[49]!==F?(I=(0,$.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,"aria-label":P,children:F}),t[48]=P,t[49]=F,t[50]=I):I=t[50],I}function St(e){return Array.isArray(e)&&[`automations`,`automation-runs`,`automation-history`,`automation-configuration`].includes(String(e[0]))}var Ct=`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`,wt=`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 Tt(e){let t=(0,st.c)(4),{value:n,children:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(Se,{className:`absolute right-2.5`,children:(0,$.jsx)(E,{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)(ye,{value:n,className:Ct,children:[i,r]}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Et(e){let t=(0,st.c)(134),{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,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=x||!!u,D=i!==`all`||o!==`all`||a!==`user`||!l&&!!s,k;t[0]===_?k=t[1]:(k=()=>{_(``),C(!1),T.current?.focus()},t[0]=_,t[1]=k);let A=k,j=b?`定时任务`:`Scheduled tasks`,M;t[2]===j?M=t[3]:(M=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:j}),t[2]=j,t[3]=M);let N=b?`筛选任务`:`Filter tasks`,P=b?`筛选任务`:`Filter tasks`,F=D&&`text-accent-fg`,I;t[4]===F?I=t[5]:(I=le(`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`,F),t[4]=F,t[5]=I);let z;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(L,{className:`size-4`,"aria-hidden":!0}),t[6]=z):z=t[6];let ee;t[7]!==D||t[8]!==b?(ee=D?(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]=D,t[8]=b,t[9]=ee):ee=t[9];let te;t[10]!==N||t[11]!==P||t[12]!==I||t[13]!==ee?(te=(0,$.jsx)(we,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"aria-label":N,title:P,className:I,children:[z,ee]})}),t[10]=N,t[11]=P,t[12]=I,t[13]=ee,t[14]=te):te=t[14];let ne=b?`状态`:`Status`,re;t[15]===ne?re=t[16]:(re=(0,$.jsx)(ve,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:ne}),t[15]=ne,t[16]=re);let ie;t[17]===p?ie=t[18]:(ie=e=>p(e),t[17]=p,t[18]=ie);let ae=b?`全部状态`:`All statuses`,B;t[19]===ae?B=t[20]:(B=(0,$.jsx)(Tt,{value:`all`,children:ae}),t[19]=ae,t[20]=B);let se;t[21]===r.filters.active?se=t[22]:(se=(0,$.jsx)(Tt,{value:`active`,children:r.filters.active}),t[21]=r.filters.active,t[22]=se);let V;t[23]===r.paused?V=t[24]:(V=(0,$.jsx)(Tt,{value:`paused`,children:r.paused}),t[23]=r.paused,t[24]=V);let H=b?`已完成`:`Completed`,U;t[25]===H?U=t[26]:(U=(0,$.jsx)(Tt,{value:`completed`,children:H}),t[25]=H,t[26]=U);let W;t[27]===r.metrics.running?W=t[28]:(W=(0,$.jsx)(Tt,{value:`running`,children:r.metrics.running}),t[27]=r.metrics.running,t[28]=W);let G;t[29]===r.dashboard.needsAttention?G=t[30]:(G=(0,$.jsx)(Tt,{value:`attention`,children:r.dashboard.needsAttention}),t[29]=r.dashboard.needsAttention,t[30]=G);let ue;t[31]!==i||t[32]!==ie||t[33]!==B||t[34]!==se||t[35]!==V||t[36]!==U||t[37]!==W||t[38]!==G?(ue=(0,$.jsxs)(X,{value:i,onValueChange:ie,children:[B,se,V,U,W,G]}),t[31]=i,t[32]=ie,t[33]=B,t[34]=se,t[35]=V,t[36]=U,t[37]=W,t[38]=G,t[39]=ue):ue=t[39];let K;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),t[40]=K):K=t[40];let de=b?`归属`:`Owner`,q;t[41]===de?q=t[42]:(q=(0,$.jsx)(ve,{className:`px-3 py-1.5 text-xs text-fg-subtle`,children:de}),t[41]=de,t[42]=q);let fe;t[43]===m?fe=t[44]:(fe=e=>m(e),t[43]=m,t[44]=fe);let pe=b?`我的任务`:`My tasks`,me;t[45]===pe?me=t[46]:(me=(0,$.jsx)(Tt,{value:`user`,children:pe}),t[45]=pe,t[46]=me);let he=b?`系统任务`:`System tasks`,J;t[47]===he?J=t[48]:(J=(0,$.jsx)(Tt,{value:`system`,children:he}),t[47]=he,t[48]=J);let ge;t[49]!==a||t[50]!==fe||t[51]!==me||t[52]!==J?(ge=(0,$.jsxs)(X,{value:a,onValueChange:fe,children:[me,J]}),t[49]=a,t[50]=fe,t[51]=me,t[52]=J,t[53]=ge):ge=t[53];let _e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),t[54]=_e):_e=t[54];let ye;t[55]!==r.filters.allProjects||t[56]!==g||t[57]!==s||t[58]!==l||t[59]!==c||t[60]!==b?(ye=l?null:(0,$.jsxs)(be,{children:[(0,$.jsxs)(Te,{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)(O,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0})]}),(0,$.jsx)(Y,{children:(0,$.jsx)(xe,{sideOffset:4,className:wt,children:(0,$.jsxs)(X,{value:s,onValueChange:g,children:[(0,$.jsx)(Tt,{value:``,children:r.filters.allProjects}),c.map(Dt)]})})})]}),t[55]=r.filters.allProjects,t[56]=g,t[57]=s,t[58]=l,t[59]=c,t[60]=b,t[61]=ye):ye=t[61];let Se=b?`任务类型`:`Task type`,ke;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,$.jsx)(O,{className:`size-3.5 text-fg-subtle`,"aria-hidden":!0}),t[62]=ke):ke=t[62];let Ae;t[63]===Se?Ae=t[64]:(Ae=(0,$.jsxs)(Te,{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:[Se,ke]}),t[63]=Se,t[64]=Ae);let je;t[65]===h?je=t[66]:(je=e=>h(e),t[65]=h,t[66]=je);let Z=b?`全部类型`:`All types`,Me;t[67]===Z?Me=t[68]:(Me=(0,$.jsx)(Tt,{value:`all`,children:Z}),t[67]=Z,t[68]=Me);let Ne;t[69]===r.sources.agent?Ne=t[70]:(Ne=(0,$.jsx)(Tt,{value:`agent`,children:r.sources.agent}),t[69]=r.sources.agent,t[70]=Ne);let Pe;t[71]===r.sources.task?Pe=t[72]:(Pe=(0,$.jsx)(Tt,{value:`task_command`,children:r.sources.task}),t[71]=r.sources.task,t[72]=Pe);let Fe;t[73]===r.sources.browser?Fe=t[74]:(Fe=(0,$.jsx)(Tt,{value:`browser_automation`,children:r.sources.browser}),t[73]=r.sources.browser,t[74]=Fe);let Ie;t[75]!==o||t[76]!==je||t[77]!==Me||t[78]!==Ne||t[79]!==Pe||t[80]!==Fe?(Ie=(0,$.jsx)(Y,{children:(0,$.jsx)(xe,{sideOffset:4,className:wt,children:(0,$.jsxs)(X,{value:o,onValueChange:je,children:[Me,Ne,Pe,Fe]})})}),t[75]=o,t[76]=je,t[77]=Me,t[78]=Ne,t[79]=Pe,t[80]=Fe,t[81]=Ie):Ie=t[81];let Le;t[82]!==Ae||t[83]!==Ie?(Le=(0,$.jsxs)(be,{children:[Ae,Ie]}),t[82]=Ae,t[83]=Ie,t[84]=Le):Le=t[84];let Re;t[85]!==D||t[86]!==v||t[87]!==u||t[88]!==b?(Re=D||u?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Oe,{className:`my-1 border-t border-edge`}),(0,$.jsx)(Ee,{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[85]=D,t[86]=v,t[87]=u,t[88]=b,t[89]=Re):Re=t[89];let ze;t[90]!==re||t[91]!==ue||t[92]!==q||t[93]!==ge||t[94]!==ye||t[95]!==Le||t[96]!==Re?(ze=(0,$.jsx)(Y,{children:(0,$.jsxs)(De,{align:`end`,sideOffset:6,className:wt,children:[re,ue,K,q,ge,_e,ye,Le,Re]})}),t[90]=re,t[91]=ue,t[92]=q,t[93]=ge,t[94]=ye,t[95]=Le,t[96]=Re,t[97]=ze):ze=t[97];let Be;t[98]!==te||t[99]!==ze?(Be=(0,$.jsxs)(Ce,{children:[te,ze]}),t[98]=te,t[99]=ze,t[100]=Be):Be=t[100];let Ve=b?`搜索任务`:`Search tasks`,He=b?`搜索任务`:`Search tasks`,Ue;t[101]!==A||t[102]!==E?(Ue=()=>{E?A():(C(!0),requestAnimationFrame(()=>w.current?.focus()))},t[101]=A,t[102]=E,t[103]=Ue):Ue=t[103];let We=E&&`bg-surface-hover text-fg`,Ge;t[104]===We?Ge=t[105]:(Ge=le(`rounded-md p-2 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,We),t[104]=We,t[105]=Ge);let Ke;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,$.jsx)(oe,{className:`size-4`,"aria-hidden":!0}),t[106]=Ke):Ke=t[106];let qe;t[107]!==E||t[108]!==Ve||t[109]!==He||t[110]!==Ue||t[111]!==Ge?(qe=(0,$.jsx)(`button`,{ref:T,type:`button`,"aria-label":Ve,title:He,"aria-expanded":E,onClick:Ue,className:Ge,children:Ke}),t[107]=E,t[108]=Ve,t[109]=He,t[110]=Ue,t[111]=Ge,t[112]=qe):qe=t[112];let Je;t[113]!==Be||t[114]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[Be,qe]}),t[113]=Be,t[114]=qe,t[115]=Je):Je=t[115];let Ye;t[116]!==M||t[117]!==Je?(Ye=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[M,Je]}),t[116]=M,t[117]=Je,t[118]=Ye):Ye=t[118];let Xe;t[119]!==r.filters.markAllRead||t[120]!==f||t[121]!==y||t[122]!==d?(Xe=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)(R,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(S,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.filters.markAllRead]}):null,t[119]=r.filters.markAllRead,t[120]=f,t[121]=y,t[122]=d,t[123]=Xe):Xe=t[123];let Ze;t[124]!==A||t[125]!==_||t[126]!==u||t[127]!==E||t[128]!==b?(Ze=E?(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)(oe,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),(0,$.jsx)(`input`,{ref:w,value:u,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),A())},"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:A,className:`rounded-md p-1 text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0})})]}):null,t[124]=A,t[125]=_,t[126]=u,t[127]=E,t[128]=b,t[129]=Ze):Ze=t[129];let Qe;return t[130]!==Ye||t[131]!==Xe||t[132]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Ye,Xe,Ze]}),t[130]=Ye,t[131]=Xe,t[132]=Ze,t[133]=Qe):Qe=t[133],Qe}function Dt(e){return(0,$.jsx)(Tt,{value:e.id,children:(0,$.jsx)(`span`,{className:`max-w-56 truncate`,children:e.name})},e.id)}var Ot=[[`☀️`,`晨间简报`,`每天开始工作前,整理今天值得关注的任务与进展。`,`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 kt(e=Math.random){let t=[...Ot];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 At({language:e,projectId:t,onOpenConversation:n}){let r=s(),[i,a]=(0,Q.useState)(!1),[o,c]=(0,Q.useState)(``),l=async e=>{a(!0),c(``);try{let i=await We({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)(kt),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)(x,{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(kt()),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)(ae,{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`})}),o?(0,$.jsx)(`p`,{role:`alert`,className:`mt-3 text-center text-sm text-danger`,children:o}):null]});return(0,$.jsx)(`section`,{"aria-label":u?`安排任务`:`Schedule a task`,children:p})}function jt(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function Mt(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 Nt(e,t={}){let n=jt(e.split(`
3
- `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
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(Mt(n));return null}async function Pt(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=Nt(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=Nt(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 Ft(){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 Pt(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 It=5;function Lt(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 Rt(e){let t=(0,st.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,[w,T]=(0,Q.useState)(!1),[E,O]=(0,Q.useState)(n),[k,A]=(0,Q.useState)(`preview`),[j,M]=(0,Q.useState)(``),[N,P]=(0,Q.useState)(`edit`),[I,L]=(0,Q.useState)(!0),[R,ee]=(0,Q.useState)(!1),[te,ne]=(0,Q.useState)(null),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(!0),{suggestion:oe,thinking:B,loading:H,error:U,generate:W,reset:G}=Ft(),ue;t[0]===l?ue=t[1]:(ue=Lt(l),t[0]=l,t[1]=ue);let K=ue,de;t[2]!==H||t[3]!==B?(de=H&&B.trim().length>0,t[2]=H,t[3]=B,t[4]=de):de=t[4];let q=de,fe,pe;t[5]!==w||t[6]!==n?(fe=()=>{w||O(n)},pe=[w,n],t[5]=w,t[6]=n,t[7]=fe,t[8]=pe):(fe=t[7],pe=t[8]),(0,Q.useEffect)(fe,pe);let he,J;t[9]===oe?(he=t[10],J=t[11]):(J=()=>{M(oe)},he=[oe],t[9]=oe,t[10]=he,t[11]=J),(0,Q.useEffect)(J,he);let _e,ve;t[12]===B?(_e=t[13],ve=t[14]):(_e=()=>{B.trim()&&L(!0)},ve=[B],t[12]=B,t[13]=_e,t[14]=ve),(0,Q.useEffect)(_e,ve);let ye;t[15]!==q||t[16]!==I?(ye=()=>{let e=re.current;!e||!q||!I||ie.current&&(e.scrollTop=e.scrollHeight)},t[15]=q,t[16]=I,t[17]=ye):ye=t[17];let be;t[18]!==q||t[19]!==B||t[20]!==I?(be=[q,B,I],t[18]=q,t[19]=B,t[20]=I,t[21]=be):be=t[21],(0,Q.useLayoutEffect)(ye,be);let xe;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>{let e=re.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;ie.current=t<=It},t[22]=xe):xe=t[22];let Se=xe,Ce;t[23]!==u||t[24]!==i||t[25]!==a||t[26]!==x||t[27]!==W||t[28]!==S||t[29]!==l||t[30]!==b?(Ce=async e=>{P(`edit`),L(!0),ie.current=!0,await W({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]=W,t[28]=S,t[29]=l,t[30]=b,t[31]=Ce):Ce=t[31];let we=Ce,Y;t[32]!==G||t[33]!==n?(Y=e=>{ee(!!e.currentTarget.closest(`[role="dialog"]`)),ne(document.querySelector(`.app-main-surface`)),O(n),A(`preview`),M(``),P(`edit`),L(!0),G(),T(!0)},t[32]=G,t[33]=n,t[34]=Y):Y=t[34];let Te=Y,Ee;t[35]!==E||t[36]!==we?(Ee=async()=>{await we(E)},t[35]=E,t[36]=we,t[37]=Ee):Ee=t[37];let X=Ee,De;t[38]!==G||t[39]!==n?(De=()=>{T(!1),O(n),A(`preview`),M(``),P(`edit`),L(!0),G()},t[38]=G,t[39]=n,t[40]=De):De=t[40];let Oe=De,ke;t[41]!==Oe||t[42]!==E||t[43]!==r?(ke=()=>{r(E),Oe()},t[41]=Oe,t[42]=E,t[43]=r,t[44]=ke):ke=t[44];let Ae=ke,je;t[45]!==Oe||t[46]!==j||t[47]!==r?(je=()=>{j.trim()&&(r(j),Oe())},t[45]=Oe,t[46]=j,t[47]=r,t[48]=je):je=t[48];let Z=je,Me;t[49]!==Oe||t[50]!==E||t[51]!==j||t[52]!==r?(Me=()=>{if(!j.trim())return;let e=E.trimEnd();r(e?`${e}\n\n${j}`:j),Oe()},t[49]=Oe,t[50]=E,t[51]=j,t[52]=r,t[53]=Me):Me=t[53];let Ne=Me,Pe;t[54]!==j||t[55]!==U||t[56]!==H?(Pe=!H&&!U&&j.trim().length>0,t[54]=j,t[55]=U,t[56]=H,t[57]=Pe):Pe=t[57];let Fe=Pe,Ie=E!==n,Le;t[58]!==j||t[59]!==U||t[60]!==B?(Le=j.trim().length>0||B.trim().length>0||!!U,t[58]=j,t[59]=U,t[60]=B,t[61]=Le):Le=t[61];let Re=Le,ze=!C&&`size-7 p-0`,Be;t[62]!==f||t[63]!==ze?(Be=le(`h-7 gap-1 px-2 text-xs`,ze,f),t[62]=f,t[63]=ze,t[64]=Be):Be=t[64];let Ve=d||H,He;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,$.jsx)(se,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=He):He=t[65];let Ue=C?K.buttonTitle:null,We;t[66]!==K.buttonTitle||t[67]!==Te||t[68]!==Be||t[69]!==Ve||t[70]!==Ue?(We=(0,$.jsxs)(me,{type:`button`,variant:`ghost`,className:Be,title:K.buttonTitle,"aria-label":K.buttonTitle,disabled:Ve,onClick:Te,children:[He,Ue]}),t[66]=K.buttonTitle,t[67]=Te,t[68]=Be,t[69]=Ve,t[70]=Ue,t[71]=We):We=t[71];let Ge;t[72]===Oe?Ge=t[73]:(Ge=e=>e?T(!0):Oe(),t[72]=Oe,t[73]=Ge);let Ke=te??void 0,qe=R?`bg-transparent`:`bg-scrim`,Je;t[74]===qe?Je=t[75]:(Je=le(`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]===K.title?Xe=t[79]:(Xe=(0,$.jsx)(_,{className:`text-base font-semibold text-fg`,children:K.title}),t[78]=K.title,t[79]=Xe);let Ze;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,$.jsx)(ce,{className:`size-5`,strokeWidth:1.75}),t[80]=Ze):Ze=t[80];let Qe;t[81]===K.close?Qe=t[82]:(Qe=(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(me,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":K.close,children:Ze})}),t[81]=K.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]===K.current?et=t[87]:(et=(0,$.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:K.current}),t[86]=K.current,t[87]=et);let tt=K.current,nt=k===`edit`,rt=k===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,it;t[88]===rt?it=t[89]:(it=le(`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,ot;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(at=()=>A(`edit`),ot=(0,$.jsx)(V,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[90]=at,t[91]=ot):(at=t[90],ot=t[91]);let ct;t[92]!==K.edit||t[93]!==nt||t[94]!==it?(ct=(0,$.jsxs)(`button`,{"aria-pressed":nt,type:`button`,className:it,onClick:at,children:[ot,K.edit]}),t[92]=K.edit,t[93]=nt,t[94]=it,t[95]=ct):ct=t[95];let lt=k===`preview`,ut=k===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,dt;t[96]===ut?dt=t[97]:(dt=le(`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=()=>A(`preview`),pt=(0,$.jsx)(F,{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]!==K.preview||t[101]!==lt||t[102]!==dt?(mt=(0,$.jsxs)(`button`,{"aria-pressed":lt,type:`button`,className:dt,onClick:ft,children:[pt,K.preview]}),t[100]=K.preview,t[101]=lt,t[102]=dt,t[103]=mt):mt=t[103];let ht;t[104]!==K.current||t[105]!==ct||t[106]!==mt?(ht=(0,$.jsxs)(ge,{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]=K.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]!==E||t[112]!==k||t[113]!==x||t[114]!==K.current||t[115]!==K.empty?(_t=k===`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)(z,{content:E||K.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:E||K.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:E,onChange:e=>O(e.currentTarget.value),placeholder:K.empty,"aria-label":K.current}),t[111]=E,t[112]=k,t[113]=x,t[114]=K.current,t[115]=K.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]===K.editedSuggestion?yt=t[121]:(yt=(0,$.jsx)(`span`,{children:K.editedSuggestion}),t[120]=K.editedSuggestion,t[121]=yt);let bt;t[122]!==K.loading||t[123]!==H?(bt=H?(0,$.jsx)(`span`,{className:`ml-2 font-normal`,children:K.loading}):null,t[122]=K.loading,t[123]=H,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=K.editedSuggestion,Ct=N===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,wt;t[128]===Ct?wt=t[129]:(wt=le(`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=N===`edit`,Et,Dt;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>P(`edit`),Dt=(0,$.jsx)(V,{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]!==K.edit||t[133]!==wt||t[134]!==Tt?(Ot=(0,$.jsxs)(`button`,{type:`button`,className:wt,"aria-pressed":Tt,onClick:Et,children:[Dt,K.edit]}),t[132]=K.edit,t[133]=wt,t[134]=Tt,t[135]=Ot):Ot=t[135];let kt=N===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,At;t[136]===kt?At=t[137]:(At=le(`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=N===`preview`,Mt,Nt;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=()=>P(`preview`),Nt=(0,$.jsx)(F,{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 Pt;t[140]!==K.preview||t[141]!==At||t[142]!==jt?(Pt=(0,$.jsxs)(`button`,{type:`button`,className:At,"aria-pressed":jt,onClick:Mt,children:[Nt,K.preview]}),t[140]=K.preview,t[141]=At,t[142]=jt,t[143]=Pt):Pt=t[143];let Rt;t[144]!==K.editedSuggestion||t[145]!==Ot||t[146]!==Pt?(Rt=(0,$.jsxs)(ge,{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,Pt]}),t[144]=K.editedSuggestion,t[145]=Ot,t[146]=Pt,t[147]=Rt):Rt=t[147];let Vt;t[148]!==xt||t[149]!==Rt?(Vt=(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[xt,Rt]}),t[148]=xt,t[149]=Rt,t[150]=Vt):Vt=t[150];let Ht=q?`opacity-100`:`pointer-events-none opacity-0`,Ut;t[151]===Ht?Ut=t[152]:(Ut=le(`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=!q,Gt;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=()=>L(zt),t[153]=Gt):Gt=t[153];let Kt;t[154]!==K.thinkingLoading||t[155]!==H?(Kt=H?(0,$.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,K.thinkingLoading]}):null,t[154]=K.thinkingLoading,t[155]=H,t[156]=Kt):Kt=t[156];let qt;t[157]!==K.thinking||t[158]!==Kt?(qt=(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[K.thinking,Kt]}),t[157]=K.thinking,t[158]=Kt,t[159]=qt):qt=t[159];let Jt=I&&`rotate-180`,Yt;t[160]===Jt?Yt=t[161]:(Yt=le(`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)(D,{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]!==B||t[168]!==I?(Qt=I?(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:Se,children:B}):null,t[167]=B,t[168]=I,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=q?`pointer-events-none opacity-0`:`opacity-100`,nn;t[177]===tn?nn=t[178]:(nn=le(`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]!==j||t[180]!==U||t[181]!==x||t[182]!==K.empty||t[183]!==K.loading||t[184]!==K.suggestion||t[185]!==H||t[186]!==N?(rn=U?(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:U}):N===`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:H&&!j.trim()?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:K.loading}):x===`markdown`?(0,$.jsx)(z,{content:j||K.empty,compact:!0,className:`text-sm`}):(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:j||K.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:j,onChange:e=>M(e.currentTarget.value),disabled:H,placeholder:H?K.loading:K.empty,"aria-label":K.suggestion}),t[179]=j,t[180]=U,t[181]=x,t[182]=K.empty,t[183]=K.loading,t[184]=K.suggestion,t[185]=H,t[186]=N,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]!==K.cancel?(ln=(0,$.jsx)(me,{type:`button`,variant:`secondary`,onClick:Oe,children:K.cancel}),t[200]=Oe,t[201]=K.cancel,t[202]=ln):ln=t[202];let un=!Ie,dn;t[203]!==Ae||t[204]!==K.applyCurrent||t[205]!==un?(dn=(0,$.jsx)(me,{type:`button`,variant:`secondary`,disabled:un,onClick:Ae,children:K.applyCurrent}),t[203]=Ae,t[204]=K.applyCurrent,t[205]=un,t[206]=dn):dn=t[206];let fn;t[207]===X?fn=t[208]:(fn=()=>void X(),t[207]=X,t[208]=fn);let pn;t[209]===Re?pn=t[210]:(pn=Re?(0,$.jsx)(ae,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,$.jsx)(se,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[209]=Re,t[210]=pn);let mn=Re?K.regenerate:K.generate,hn;t[211]!==H||t[212]!==pn||t[213]!==mn||t[214]!==fn?(hn=(0,$.jsxs)(me,{type:`button`,variant:`secondary`,disabled:H,onClick:fn,children:[pn,mn]}),t[211]=H,t[212]=pn,t[213]=mn,t[214]=fn,t[215]=hn):hn=t[215];let gn=!Fe,_n;t[216]!==Ne||t[217]!==K.append||t[218]!==gn?(_n=(0,$.jsx)(me,{type:`button`,variant:`secondary`,disabled:gn,onClick:Ne,children:K.append}),t[216]=Ne,t[217]=K.append,t[218]=gn,t[219]=_n):_n=t[219];let vn=!Fe,yn;t[220]!==Z||t[221]!==K.replace||t[222]!==vn?(yn=(0,$.jsx)(me,{type:`button`,variant:`primary`,disabled:vn,onClick:Z,children:K.replace}),t[220]=Z,t[221]=K.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:Bt,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]!==w||t[239]!==Sn||t[240]!==Ge?(Cn=(0,$.jsx)(v,{open:w,onOpenChange:Ge,children:Sn}),t[238]=w,t[239]=Sn,t[240]=Ge,t[241]=Cn):Cn=t[241];let wn;return t[242]!==Cn||t[243]!==We?(wn=(0,$.jsxs)($.Fragment,{children:[We,Cn]}),t[242]=Cn,t[243]=We,t[244]=wn):wn=t[244],wn}function zt(e){return!e}function Bt(e){return e.preventDefault()}function Vt(e){return e.management!==void 0}function Ht(e){return[`reminder`,`brief`,`review`,`followUp`].map(t=>{let n=e.scenarios[t];return{...n,requiresProject:t===`followUp`,form:{...Ie,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 Ut=`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 Wt(e){let t=(0,st.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:Ut,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:Ut,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)(k,{className:Ut,value:n.projectId,onChange:e=>u({projectId:e.target.value}),children:[(0,$.jsx)(A,{value:``,children:i.form.noProject}),a.map(Gt)]})]}),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)(A,{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)(A,{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)(A,{value:`weekly`,children:i.trigger.weekly}),t[38]=i.trigger.weekly,t[39]=C);let w;t[40]!==n.triggerMode||t[41]!==b||t[42]!==x||t[43]!==S||t[44]!==C?(w=(0,$.jsxs)(k,{className:Ut,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]=w):w=t[45];let T;t[46]!==i.form.trigger||t[47]!==w?(T=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.trigger,w]}),t[46]=i.form.trigger,t[47]=w,t[48]=T):T=t[48];let E;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?(E=n.triggerMode===`once`?(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.onceAt,(0,$.jsx)(`input`,{type:`datetime-local`,className:Ut,value:n.onceAt,onChange:e=>u({onceAt:e.target.value})})]}):(0,$.jsxs)(`div`,{className:`grid gap-2 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:i.form.time}),(0,$.jsx)(Ye,{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]=E):E=t[55];let D;t[56]!==n.triggerMode||t[57]!==n.weekday||t[58]!==i.form.day||t[59]!==i.weekdays||t[60]!==u?(D=n.triggerMode===`weekly`&&(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.form.day,(0,$.jsx)(k,{className:Ut,value:n.weekday,onChange:e=>u({weekday:e.target.value}),children:[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`].map((e,t)=>(0,$.jsx)(A,{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]=D):D=t[61];let O;t[62]!==T||t[63]!==E||t[64]!==D?(O=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[T,E,D]}),t[62]=T,t[63]=E,t[64]=D,t[65]=O):O=t[65];let j;t[66]!==n.onceAt||t[67]!==n.triggerMode||t[68]!==i.experience.futureTime?(j=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]=j):j=t[69];let M;t[70]===i.experience.scheduleNote?M=t[71]:(M=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.experience.scheduleNote}),t[70]=i.experience.scheduleNote,t[71]=M);let N;t[72]===u?N=t[73]:(N=e=>u({notificationPolicy:e.target.value}),t[72]=u,t[73]=N);let P;t[74]===i.draft.notifyAll?P=t[75]:(P=(0,$.jsx)(A,{value:`all`,children:i.draft.notifyAll}),t[74]=i.draft.notifyAll,t[75]=P);let F;t[76]===i.draft.notifyAttention?F=t[77]:(F=(0,$.jsx)(A,{value:`attention`,children:i.draft.notifyAttention}),t[76]=i.draft.notifyAttention,t[77]=F);let I;t[78]===i.draft.notifyNone?I=t[79]:(I=(0,$.jsx)(A,{value:`none`,children:i.draft.notifyNone}),t[78]=i.draft.notifyNone,t[79]=I);let L;t[80]!==n.notificationPolicy||t[81]!==N||t[82]!==P||t[83]!==F||t[84]!==I?(L=(0,$.jsxs)(k,{className:Ut,value:n.notificationPolicy,onChange:N,children:[P,F,I]}),t[80]=n.notificationPolicy,t[81]=N,t[82]=P,t[83]=F,t[84]=I,t[85]=L):L=t[85];let R;t[86]!==i.draft.notifications||t[87]!==L?(R=(0,$.jsxs)(`label`,{className:`grid gap-2 text-sm text-fg`,children:[i.draft.notifications,L]}),t[86]=i.draft.notifications,t[87]=L,t[88]=R):R=t[88];let z;return t[89]!==y||t[90]!==O||t[91]!==d||t[92]!==j||t[93]!==M||t[94]!==R||t[95]!==m||t[96]!==_||t[97]!==v?(z=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[d,m,_,v,y,O,j,M,R]}),t[89]=y,t[90]=O,t[91]=d,t[92]=j,t[93]=M,t[94]=R,t[95]=m,t[96]=_,t[97]=v,t[98]=z):z=t[98],z}function Gt(e){return(0,$.jsx)(A,{value:e.id,children:e.name},e.id)}var Kt=`xopc.automations.dismissedExecutionIssues`;function qt(){if(typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(Kt)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function Jt(e,t,n){return e?Ze(e,n):t.never}function Yt(e,t){return 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===`browser_automation`?`Browser automation: ${e.automationId}`:e.kind===`task_command`?t.action.taskWithId.replace(`{id}`,e.taskId):e.agentId?t.action.agentWithId.replace(`{id}`,e.agentId):t.action.agent}function Xt(e,t){return e===`browser_automation`?t.sources.browser:e===`task_command`?t.action.runTask:t.action.runAgent}function Zt(e){return e.safety?.mode??`auto_apply`}function Qt(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 $t(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 en(e){return e.status===`running`||e.status===`queued`||e.status===`cancelling`}function tn(e){return e.status===`failed`||e.status===`timeout`}function nn(e,t){return e.action.kind===`system`?Yt(e.action,t):e.action.kind===`agent`?e.action.instruction:(e.action.kind,Yt(e.action,t))}function rn(e){return e.description?.trim()??``}function an(e){return en(e)?0:tn(e)?1:e.status===`succeeded`?2:3}function on(e){return[...e].sort((e,t)=>{let n=an(e)-an(t);return n===0?t.createdAtMs-e.createdAtMs:n})}function sn(){let e=(0,st.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(ln)}),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)(W,{className:`h-4 w-36`}),(0,$.jsx)(W,{className:`h-3 w-56 max-w-full`})]}),(0,$.jsx)(W,{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-panel p-4 shadow-surface`,children:[n,(0,$.jsx)(`div`,{className:`mt-4 grid gap-2`,children:Array.from({length:6}).map(cn)})]}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(W,{className:`h-4 w-32`}),a=(0,$.jsx)(W,{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 bg-surface-panel p-4 shadow-surface xl:block`,children:[i,a,(0,$.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,$.jsx)(W,{className:`h-12 rounded-lg`}),(0,$.jsx)(W,{className:`h-12 rounded-lg`}),(0,$.jsx)(W,{className:`h-12 rounded-lg`})]})]})]})]}),e[5]=o):o=e[5],o}function cn(e,t){return(0,$.jsx)(`div`,{className:`rounded-lg bg-surface-base 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)(W,{className:`size-4 rounded-full`}),(0,$.jsx)(W,{className:`h-4 w-32`}),(0,$.jsx)(W,{className:`h-5 w-20 rounded-full`})]}),(0,$.jsx)(W,{className:`mt-3 h-4 w-full`}),(0,$.jsx)(W,{className:`mt-2 h-4 w-3/5`})]}),(0,$.jsx)(W,{className:`h-8 w-24 rounded-md`})]})},t)}function ln(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)(W,{className:`size-4 rounded-full`}),(0,$.jsx)(W,{className:`h-3 w-14`}),(0,$.jsx)(W,{className:`ml-auto h-4 w-10`})]},t)}function un({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=he(e=>e.setPageHeader),y=he(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()??``,k=b.get(`action`)?.trim()??``,A=b.get(`taskId`)?.trim()??``,M=b.get(`projectId`)?.trim()??``,N=e?.trim()||M,P=!!e?.trim(),F=b.get(`autogenerate`)===`1`,I=(0,Q.useRef)(``),L=b.get(`status`),R=L===`active`||L===`paused`||L===`completed`||L===`running`||L===`attention`?L:`all`,z=b.get(`ownership`)===`system`?`system`:`user`,ee=b.get(`source`),te=ee===`agent`||ee===`task_command`||ee===`browser_automation`?ee:`all`,ne=b.get(`q`)??``,re=e=>x(t=>{let n=new URLSearchParams(t);return e===`all`?n.delete(`status`):n.set(`status`,e),n.delete(`automation`),n}),ae=e=>x(t=>{let n=new URLSearchParams(t);return e===`user`?n.delete(`ownership`):n.set(`ownership`,e),n.delete(`automation`),n}),oe=e=>x(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n.delete(`automation`),n},{replace:!0}),B=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}),[V,H]=(0,Q.useState)(null),[W,ue]=(0,Q.useState)(!1),[K,de]=(0,Q.useState)(`blank`),[ge,ve]=(0,Q.useState)(!1),[ye,be]=(0,Q.useState)(null),[xe,Se]=(0,Q.useState)(null),[Ce,we]=(0,Q.useState)(!1),[Y,Te]=(0,Q.useState)(Ie),[Ee,X]=(0,Q.useState)(null),[De,Oe]=(0,Q.useState)(null),[ke,je]=(0,Q.useState)(!1),[Z,Pe]=(0,Q.useState)(null),[Re,ze]=(0,Q.useState)(``),[He,We]=(0,Q.useState)(null),[Ke,Je]=(0,Q.useState)(!1),[Ye,Xe]=(0,Q.useState)(!1),[Ze,Qe]=(0,Q.useState)(N),[$e,tt]=(0,Q.useState)(`new_session`),[at,ot]=(0,Q.useState)(`attention`),[st,ct]=(0,Q.useState)(null),[ut,dt]=(0,Q.useState)(!1),[ft,pt]=(0,Q.useState)(!1),[ht,gt]=(0,Q.useState)(!1),[_t,vt]=(0,Q.useState)(null),[bt,St]=(0,Q.useState)(qt),Ct=q([`automations`,N],()=>J.list(N?{projectId:N}:void 0),{keepPreviousData:!0,refreshInterval:15e3}),wt=q([`automation-runs`,N],()=>J.runs(50,void 0,N?{projectId:N}:void 0),{keepPreviousData:!0,refreshInterval:1e4}),Tt=q(N?`automations-global-system-source`:null,()=>J.list(),{keepPreviousData:!0,refreshInterval:15e3}),Dt=q(N?`automation-runs-global-system-source`:null,()=>J.runs(50),{keepPreviousData:!0,refreshInterval:1e4}),Ot=q(Z?[`automation-history`,Z,N]:null,()=>J.runs(50,Z,N?{projectId:N}:void 0),{refreshInterval:1e4}),kt=q(De?`automation-run-events:${De}`:null,()=>J.runEvents(De),{refreshInterval:5e3}),jt=q(De?[`automation-exact-run`,De]:null,()=>J.getRun(De),{refreshInterval:3e3}),Mt=q(`automation-browser-automations`,()=>rt.list()),Nt=q(`automation-chat-agents`,pe),Pt=q(`automation-tasks`,J.tasks),Ft=q(`automation-projects`,()=>G({sortBy:`name`,sortOrder:`asc`,limit:200})),It=Ct.isLoading&&!Ct.data||wt.isLoading&&!wt.data||!!N&&Tt.isLoading&&!Tt.data||!!N&&Dt.isLoading&&!Dt.data,Lt=!It&&(Ct.isLoading||wt.isLoading||Tt.isLoading||Dt.isLoading),Rt=Ct.data?.automations??[],zt=N?Tt.data?.automations??[]:Rt,Bt=(0,Q.useMemo)(()=>on(wt.data?.runs??[]),[wt.data?.runs]),Ut=(0,Q.useMemo)(()=>N?on(Dt.data?.runs??[]):Bt,[Dt.data?.runs,N,Bt]),Gt=(0,Q.useMemo)(()=>Rt.filter(e=>!Vt(e)),[Rt]),Jt=(0,Q.useMemo)(()=>zt.filter(Vt),[zt]),Yt=(0,Q.useMemo)(()=>[...Gt,...Jt],[Jt,Gt]),Xt=(0,Q.useMemo)(()=>new Set(Jt.map(e=>e.id)),[Jt]),Zt=(0,Q.useMemo)(()=>Bt.filter(e=>!Xt.has(e.automationId)),[Bt,Xt]),Qt=(0,Q.useMemo)(()=>Ut.filter(e=>Xt.has(e.automationId)),[Ut,Xt]),$t=(0,Q.useMemo)(()=>N?[...Bt,...Qt]:Bt,[N,Bt,Qt]),tn=(0,Q.useMemo)(()=>jt.data?.run?.id===De?jt.data.run:$t.find(e=>e.id===De)??Ot.data?.runs.find(e=>e.id===De)??null,[$t,De,Ot.data,jt.data]),an=(0,Q.useMemo)(()=>Yt.find(e=>e.id===Z)??null,[Yt,Z]),cn=(0,Q.useMemo)(()=>Yt.find(e=>e.id===xe)??null,[Yt,xe]),ln=(0,Q.useMemo)(()=>[...Ot.data?.runs??$t].filter(e=>e.automationId===Z).sort((e,t)=>t.createdAtMs-e.createdAtMs),[$t,Z,Ot.data]),un=kt.data?.events??[],pn=(0,Q.useMemo)(()=>Zt.filter(e=>!en(e)&&e.readAtMs==null),[Zt]),mn=Gt.reduce((e,t)=>e+(Ct.data?.executionSummaries?.[t.id]?.unreadCount??0),0),hn=ne.trim().toLocaleLowerCase(),gn=z===`system`?Jt:Gt,vn=z===`system`?Qt:Zt,yn=(0,Q.useMemo)(()=>new Set(vn.filter(en).map(e=>e.automationId)),[vn]),bn=(0,Q.useMemo)(()=>gn.filter(e=>R===`attention`&&!et(e,vn)||R===`running`&&!yn.has(e.id)||R===`active`&&!e.enabled||R===`paused`&&(e.enabled||Ae(e))||R===`completed`&&!Ae(e)||te!==`all`&&e.action.kind!==te?!1:!hn||[e.name,rn(e),nn(e,s),Me(e.trigger,s,l,i)].some(e=>e.toLocaleLowerCase().includes(hn))),[l,R,s,i,hn,gn,vn,yn,te]),Cn=(0,Q.useMemo)(()=>(Mt.data?.automations??[]).filter(e=>e.enabled),[Mt.data]),wn=Nt.data?.items??[],Tn=(0,Q.useMemo)(()=>(Pt.data?.items??[]).map(e=>e.task),[Pt.data]),En=Ft.data?.items??[],Dn=(0,Q.useMemo)(()=>Cn.find(e=>e.id===Y.browserAutomationId.trim())??null,[Cn,Y.browserAutomationId]),On=!!cn?.management?.editable.includes(`trigger`),kn=[`daily`,`weekly`,`interval`,`cron`].includes(Y.triggerMode)&&(![`daily`,`weekly`].includes(Y.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(Y.time))&&(Y.triggerMode!==`interval`||Ve(Y.intervalValue,Y.intervalUnit)>=6e4)&&(Y.triggerMode!==`cron`||!!Y.cronExpr.trim()),An=On?kn:!!Y.name.trim()&&(Y.triggerMode!==`once`||Number.isFinite(new Date(Y.onceAt).getTime())&&(!!cn||new Date(Y.onceAt).getTime()>Date.now()))&&(![`daily`,`weekly`].includes(Y.triggerMode)||/^(?:[01]\d|2[0-3]):[0-5]\d$/.test(Y.time))&&(Y.triggerMode!==`event`||!!Y.eventType.trim()&&Le(Y.eventPayloadMatch))&&(Y.actionMode===`browser_automation`?Dn!==null&&it(Dn,Y.browserAutomationInputs):Y.actionMode===`task_command`?!!(Y.taskId.trim()&&Y.agentId.trim()):!!Y.instruction.trim()),Mn=!0;try{[`daily`,`weekly`,`cron`].includes(Y.triggerMode)&&Ue(Y)}catch{Mn=!1}let Nn=An&&Mn,Pn=(0,Q.useMemo)(()=>Ht(s),[s]),Fn=(0,Q.useMemo)(()=>Gt.filter(e=>et(e,Zt)),[Gt,Zt]),In=Fn.some(e=>{let t=nt(e,Zt);return t!==null&&bt[e.id]!==t}),Ln=(0,Q.useCallback)(()=>{St(e=>{let t={...e};for(let e of Fn){let n=nt(e,Zt);n&&(t[e.id]=n)}try{window.localStorage.setItem(Kt,JSON.stringify(t))}catch{}return t})},[Fn,Zt]);(0,Q.useEffect)(()=>{if(!Lt){if(E){Pe(null);return}if(T){Pe(T);return}if(bn.length===0){Pe(null);return}Z&&bn.some(e=>e.id===Z)||Pe(null)}},[T,bn,E,Lt,Z]);let Rn=(0,Q.useCallback)(async()=>{await Promise.all([Ct.mutate(),wt.mutate(),Tt.mutate(),Dt.mutate(),Ot.mutate(),kt.mutate(),fe(e=>Array.isArray(e)&&e[0]===`automation-navigation-runs`)])},[Ct.mutate,Tt.mutate,Dt.mutate,kt.mutate,wt.mutate,Ot.mutate]),zn=(0,Q.useCallback)(e=>{if(P){Pe(null),Oe(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}),Pe(null),Oe(null)},[P,x]);(0,Q.useEffect)(()=>{P&&(Qe(N),Te(e=>e.projectId===N?e:{...e,projectId:N}))},[N,P]);let Bn=(0,Q.useCallback)(e=>{if(e===`blank`&&!A){ve(!0);return}if(Se(null),we(!1),X(null),de(e),ue(!0),e===`blank`){Te({...Ie,projectId:N});return}ze(``),We(null),Xe(!1),Qe(N),tt(`new_session`),ot(`attention`)},[N,A]),Vn=e=>{H(e),Te({...e.form,projectId:N}),Se(null),we(!1),X(null),de(`quick`),ue(!0)},Hn=(0,Q.useCallback)(e=>{if(e.action.kind===`agent`&&!e.management){be(e);return}Te(qe(e)),Se(e.id),we(!1),Pe(null),de(`blank`),ue(!0)},[]),Un=(0,Q.useCallback)(()=>{He&&(Te({...qe(He.automation),projectId:Ze,conversationMode:$e,notificationPolicy:at}),Se(null),we(!0),de(`blank`))},[He,$e,at,Ze]),Wn=(0,Q.useCallback)(async()=>{gt(!0),X(null);try{await Rn()}catch(e){let t=e instanceof Error?e.message:String(e);X(t)}finally{gt(!1)}},[s.feedback.actionFailed,Rn]);(0,Q.useEffect)(()=>{let e=Yt.find(e=>e.id===T);!e||!Vt(e)||z===`system`||x(e=>{let t=new URLSearchParams(e);return t.set(`ownership`,`system`),t},{replace:!0})},[T,Yt,z,x]),(0,Q.useEffect)(()=>{k===`create`&&(Bn(`blank`),A&&Te(e=>({...e,actionMode:`task_command`,taskId:A,safetyMode:`auto_apply`})),x(e=>{let t=new URLSearchParams(e);return t.delete(`action`),t.delete(`taskId`),t},{replace:!0}))},[k,Bn,x,A]),(0,Q.useEffect)(()=>{if(!O)return;let e=`${i}:${F?`auto`:`seed`}:${O}`;I.current!==e&&(I.current=e,ze(O),We(null),Xe(!1),Qe(N),de(`draft`),ue(!0),x(e=>{let t=new URLSearchParams(e);return t.delete(`draft`),t.delete(`autogenerate`),t},{replace:!0}),F&&(X(null),Je(!0),J.draft({prompt:O,language:i}).then(e=>{We(e.draft),Xe(!1)}).catch(e=>{X(e instanceof Error?e.message:String(e))}).finally(()=>{Je(!1)})))},[F,O,i,N,x]);let Gn=(0,Q.useCallback)(e=>{let t=Bt.find(t=>t.id===e)??Ot.data?.runs.find(t=>t.id===e);if(!t||en(t)||t.readAtMs!=null)return;let n=Date.now();wt.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),Ot.mutate(t=>t&&{...t,runs:t.runs.map(t=>t.id===e?{...t,readAtMs:n}:t)},!1),J.markRunRead(e).catch(e=>{X(e instanceof Error?e.message:String(e)),wt.mutate(),Ot.mutate()})},[Bt,wt.mutate,Ot.data,Ot.mutate]),Kn=(0,Q.useCallback)(e=>{Gn(e),Oe(e),je(!0),x(t=>{let n=new URLSearchParams(t);return n.set(`run`,e),n},{replace:!0})},[Gn,x]),qn=(0,Q.useCallback)(e=>{Pe(e),Oe(null),je(!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]),Jn=(0,Q.useCallback)(e=>{je(!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)(()=>{Oe(C||null),je(!!C&&!w)},[w,C]),(0,Q.useEffect)(()=>{C&&!w&&Gn(C)},[w,C,Gn]),(0,Q.useEffect)(()=>{ct(null),pt(!1)},[De]);async function Yn(){if(X(null),Y.triggerMode===`once`&&!cn&&new Date(Y.onceAt).getTime()<=Date.now()){X(s.experience.futureTime);return}if(!(!Nn||_t)&&!(K===`quick`&&V?.requiresProject&&!Y.projectId)){if(Ce&&He){vt(`draft:edit`);try{let e=Be(Y),{simulation:t}=await J.simulate(e);We({...He,automation:e,simulation:t}),Qe(Y.projectId),tt(Y.conversationMode),ot(Y.notificationPolicy),Xe(!1),we(!1),de(`draft`)}catch(e){let t=e instanceof Error?e.message:String(e);X(t)}finally{vt(null)}return}if(cn){let e=cn.id;await Xn(`automation:${e}:edit`,()=>J.update(e,{...On?{trigger:Fe(cn,{...Y,instruction:`managed`}).trigger}:Fe(cn,Y),expectedRevision:cn.updatedAtMs}))&&(ue(!1),Se(null),Pe(e));return}vt(`automation:create`);try{let e=Be(Y),{automation:t}=await J.create(e);Te(Ie),ue(!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),P||(t.projectId?n.set(`projectId`,t.projectId):n.delete(`projectId`)),n}),await Rn(),Pe(t.id)}catch(e){let t=e instanceof Error?e.message:String(e);X(t)}finally{vt(null)}}}async function Xn(e,t){X(null),vt(e);try{return await t(),await Rn(),!0}catch(e){let t=e instanceof Error?e.message:String(e);return X(t),!1}finally{vt(null)}}async function Zn(){await Xn(`runs:read-all`,()=>J.markAllRunsRead(N||void 0))}async function Qn(){let e=Re.trim();if(e){X(null),Je(!0);try{let t=await J.draft({prompt:e,language:i});We(t.draft),Xe(!1)}catch(e){X(e instanceof Error?e.message:String(e))}finally{Je(!1)}}}async function $n(){if(!He)return;let e=``,t=``;await Xn(`draft:publish`,async()=>{let{automation:n}=await J.create({...He.automation,...Ze?{projectId:Ze}:{projectId:void 0},conversationMode:$e,delivery:{...He.automation.delivery,notificationPolicy:at}});We(null),ze(``),Xe(!1),ue(!1),re(`all`),oe(``),e=n.id,t=n.projectId??``})&&e&&(zn(t),qn(e))}async function er(){if(!He)return;let e=``,t=``,n=``;await Xn(`draft:test`,async()=>{let{automation:r}=await J.create({...He.automation,...Ze?{projectId:Ze}:{projectId:void 0},conversationMode:$e,delivery:{...He.automation.delivery,notificationPolicy:at},enabled:!1}),{run:i}=await J.runNow(r.id);e=r.id,t=r.projectId??``,n=i.id,We(null),ze(``),Xe(!1),ue(!1),re(`all`),oe(``)})&&e&&n&&(zn(t),qn(e),Kn(n))}async function tr(e){X(null),dt(!0),ct(null),pt(!1);try{let t=await J.repairDraft(e.id,{language:i});ct(t.repair)}catch(e){X(e instanceof Error?e.message:String(e))}finally{dt(!1)}}async function nr(e){st&&await Xn(`run:${e.id}:repair`,async()=>{await J.update(e.automationId,st.patch),ct(null),pt(!1)})}let rr=(0,Q.useMemo)(()=>(0,$.jsx)(_e,{className:`size-9 shrink-0 p-0`,loading:ht,label:s.refresh,onClick:Wn}),[s.refresh,ht,Wn]);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:rr}),()=>y()},[y,t,rr,c,u]),(0,$.jsxs)(`div`,{className:le(`flex min-h-0 min-w-0 flex-1 flex-col`,t?`bg-transparent`:`bg-surface-panel`),children:[(0,$.jsxs)(`div`,{className:le(`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 border border-edge-subtle bg-surface-base px-4 py-3 shadow-surface`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(U,{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})]}),rr]}):null,Ee||Ct.error||wt.error||Tt.error||Dt.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:Ee||s.feedback.actionFailed}):null,S?It?(0,$.jsx)(sn,{}):(0,$.jsx)(_n,{runs:vn,ownership:z,labels:s,language:i,unreadCount:z===`user`?pn.length:0,loading:Lt||ht,onOwnershipChange:ae,onRefresh:Wn,onSelectRun:Kn}):(0,$.jsxs)($.Fragment,{children:[!It&&In&&z===`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:()=>re(`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)(j,{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,` · `,Fn.length]}),(0,$.jsx)(`span`,{className:`ml-2 text-fg-muted`,children:s.experience.issuesDescription})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:Ln,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)(ce,{className:`size-4`,"aria-hidden":!0})})]}):null,It?(0,$.jsx)(sn,{}):(0,$.jsxs)(yt,{language:i,busy:Lt,children:[(0,$.jsxs)(`aside`,{className:le(`max-h-[28vh] min-h-0 min-w-0 flex-col overflow-hidden rounded-xl bg-surface-base md:flex md:h-full md:max-h-none`,w?`hidden`:`flex`),children:[(0,$.jsxs)(`div`,{className:`shrink-0 p-3`,children:[(0,$.jsx)(Et,{language:i,labels:s,filter:R,ownership:z,source:te,projectId:N,projects:En,projectLocked:P,query:ne,unreadCount:z===`user`?mn:0,markReadBusy:_t===`runs:read-all`,onFilter:re,onOwnership:ae,onSource:B,onProject:zn,onQuery:oe,onClear:()=>{se(),ae(`user`),P||zn(``)},onMarkAllRead:()=>void Zn()}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>ve(!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)(ie,{className:`size-4`,"aria-hidden":!0}),i===`zh`?`新建任务`:`New task`]})]}),T&&!bn.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)(mt,{automations:bn,runs:vn,labels:s,cronLabels:l,language:i,selectedAutomationId:E?null:Z,selectedRunId:w?C:void 0,selectedRun:w?tn:null,projectId:N||void 0,executionSummaries:(z===`system`&&N?Tt.data:Ct.data)?.executionSummaries,onSelectRun:Jn,onOpenDetails:qn,busy:_t!==null,onEdit:Hn,onAction:Xn})]}),w&&T?(0,$.jsx)(lt,{automationId:T,runId:C,projectId:N||void 0,language:i,onBack:()=>qn(T),onDetails:()=>je(!0),onConfigure:e=>{J.openConfiguration({automationId:e.automationId,runId:e.id}).then(({conversationId:t})=>{je(!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=>X(e instanceof Error?e.message:String(e)))}},`${T}:${C}`):!E&&an&&!an.management&&an.action.kind!==`system`?(0,$.jsx)(xt,{automation:an,conversationId:D,runs:ln,language:i,onSelectRun:Kn},an.id):D?(0,$.jsx)(xt,{conversationId:D,runs:[],language:i,onSelectRun:Kn,onConfigured:qn},D):!E&&an?(0,$.jsx)(Sn,{automation:an,runs:ln,runsLoading:Ot.isLoading,runsError:Ot.error?s.feedback.actionFailed:void 0,labels:s,cronLabels:l,language:i,projects:En,busyAction:_t,onEdit:Hn,onSelectRun:Kn,onAction:Xn},an.id):(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto`,children:(0,$.jsx)(At,{language:i,projectId:N,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})}},N)})]})]})]}),ge?(0,$.jsx)(Ge,{language:i,projectId:N,onClose:()=>ve(!1),onCreated:e=>{ae(`user`),se(),qn(e.id)}}):null,ye?(0,$.jsx)(Ge,{automation:ye,language:i,onClose:()=>be(null)}):null,(0,$.jsx)(v,{open:W,onOpenChange:e=>{ue(e),e||(Se(null),we(!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:cn?s.editTitle:Ce?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)(me,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(ce,{className:`size-4`})})})]}),Ee?(0,$.jsx)(`p`,{role:`alert`,className:`px-5 py-2 text-sm text-red-700 dark:text-red-300`,children:Ee}):null,K===`draft`?(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,$.jsx)(fn,{labels:s,prompt:Re,draft:He,loading:Ke,approved:Ye,publishBusy:_t===`draft:publish`,testBusy:_t===`draft:test`,templates:Pn,projects:En,projectId:Ze,conversationMode:$e,notificationPolicy:at,onPromptChange:ze,onGenerate:Qn,onEdit:Un,onPublish:$n,onTest:er,onProjectChange:Qe,onConversationModeChange:tt,onNotificationPolicyChange:ot,projectLocked:P,onApprovedChange:Xe,onDiscard:()=>{We(null),Xe(!1)},onTemplateSelect:e=>{Vn(e),Te({...e.form,projectId:Ze})},onOpenAdvanced:()=>{Te({...Ie,projectId:Ze,conversationMode:$e,notificationPolicy:at}),de(`blank`)}})}):(0,$.jsxs)($.Fragment,{children:[On?(0,$.jsx)(dn,{form:Y,setForm:Te,labels:s}):K===`quick`&&V?(0,$.jsx)(Wt,{form:Y,setForm:Te,labels:s,projects:En,projectLocked:P,source:V.source,requiresProject:V.requiresProject}):(0,$.jsx)(jn,{form:Y,labels:s,setForm:Te,projects:En,browserAutomations:Cn,selectedBrowserAutomation:Dn,browserAutomationsLoading:Mt.isLoading,agentOptions:wn,agentsLoading:Nt.isLoading,defaultAgentId:Nt.data?.defaultId??``,taskOptions:Tn,tasksLoading:Pt.isLoading,language:i,projectLocked:P}),On||K===`quick`?(0,$.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto px-5 pb-4`,children:(0,$.jsx)(Ne,{form:Y,onChange:e=>Te(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)(me,{variant:`ghost`,onClick:()=>de(`blank`),children:s.draft.advancedCreate}):null,Ce?(0,$.jsx)(me,{variant:`ghost`,onClick:()=>{we(!1),de(`draft`)},children:s.cancel}):(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(me,{variant:`ghost`,children:s.cancel})}),(0,$.jsx)(me,{variant:`primary`,onClick:Yn,disabled:!Nn||!!_t||K===`quick`&&!!V?.requiresProject&&!Y.projectId,children:_t===`automation:create`||_t===`draft:edit`||cn&&_t===`automation:${cn.id}:edit`?s.feedback.working:cn||Ce?s.save:s.experience.createEnabled})]})]})]})]})}),(0,$.jsx)(v,{open:ke&&!!tn,onOpenChange:e=>{je(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:tn?.automationName??s.dashboard.result}),(0,$.jsx)(m,{asChild:!0,children:(0,$.jsx)(me,{variant:`ghost`,"aria-label":s.close,children:(0,$.jsx)(ce,{className:`size-4`})})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,$.jsx)(xn,{className:`rounded-none border-0`,run:tn,events:un,labels:s,cronLabels:l,language:i,loading:kt.isLoading,repairDraft:st,repairLoading:ut,repairApproved:ft,busyAction:_t,onRepairApprovedChange:pt,onSuggestRepair:tr,onApplyRepair:nr})})]})]})})]})}function dn(e){let t=(0,st.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)(Fn,{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)(A,{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)(A,{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)(A,{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)(A,{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)(k,{"aria-label":i.form.trigger,className:Pn,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)(Ye,{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)(k,{className:Pn,value:n.weekday,onChange:e=>o({weekday:e.target.value}),children:[(0,$.jsx)(A,{value:`1`,children:i.weekdays.monday}),(0,$.jsx)(A,{value:`2`,children:i.weekdays.tuesday}),(0,$.jsx)(A,{value:`3`,children:i.weekdays.wednesday}),(0,$.jsx)(A,{value:`4`,children:i.weekdays.thursday}),(0,$.jsx)(A,{value:`5`,children:i.weekdays.friday}),(0,$.jsx)(A,{value:`6`,children:i.weekdays.saturday}),(0,$.jsx)(A,{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:Pn,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)(k,{className:Pn,value:n.intervalUnit,onChange:e=>o({intervalUnit:e.target.value}),children:[(0,$.jsx)(A,{value:`minute`,children:i.form.intervalUnits.minute}),(0,$.jsx)(A,{value:`hour`,children:i.form.intervalUnits.hour}),(0,$.jsx)(A,{value:`day`,children:i.form.intervalUnits.day}),(0,$.jsx)(A,{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:Pn,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 fn(e){let t=(0,st.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:w,onOpenAdvanced:T,projectLocked:E}=e,D=s!==void 0&&s,O=c!==void 0&&c,j=E!==void 0&&E,M=!!(i&&i.simulation.requiredConfirmations.length>0),N;t[0]!==i||t[1]!==n.draft.advancedCreate||t[2]!==n.draft.suggestions||t[3]!==n.draft.suggestionsDescription||t[4]!==n.experience||t[5]!==T||t[6]!==w||t[7]!==l?(N=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)(me,{variant:`ghost`,onClick:T,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 border border-edge-subtle bg-surface-panel p-3 text-left hover:bg-surface-hover`,onClick:()=>w(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]=T,t[6]=w,t[7]=l,t[8]=N):N=t[8];let P;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(se,{className:`size-4 text-accent`}),t[9]=P):P=t[9];let F;t[10]===n.draft.title?F=t[11]:(F=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[P,n.draft.title]}),t[10]=n.draft.title,t[11]=F);let I;t[12]===n.draft.subtitle?I=t[13]:(I=(0,$.jsx)(`div`,{className:`mt-1 text-sm text-fg-muted`,children:n.draft.subtitle}),t[12]=n.draft.subtitle,t[13]=I);let L;t[14]!==F||t[15]!==I?(L=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[F,I]}),t[14]=F,t[15]=I,t[16]=L):L=t[16];let R;t[17]!==a||t[18]!==r?(R=a||!r.trim(),t[17]=a,t[18]=r,t[19]=R):R=t[19];let z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(se,{className:`size-4`}),t[20]=z):z=t[20];let ee=a?n.draft.generating:n.draft.generate,te;t[21]!==h||t[22]!==ee||t[23]!==R?(te=(0,$.jsxs)(me,{variant:`primary`,onClick:h,disabled:R,children:[z,ee]}),t[21]=h,t[22]=ee,t[23]=R,t[24]=te):te=t[24];let ie;t[25]!==te||t[26]!==L?(ie=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[L,te]}),t[25]=te,t[26]=L,t[27]=ie):ie=t[27];let ae;t[28]===m?ae=t[29]:(ae=e=>m(e.target.value),t[28]=m,t[29]=ae);let oe;t[30]!==n.draft.placeholder||t[31]!==n.draft.title||t[32]!==r||t[33]!==ae?(oe=(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:ae,placeholder:n.draft.placeholder}),t[30]=n.draft.placeholder,t[31]=n.draft.title,t[32]=r,t[33]=ae,t[34]=oe):oe=t[34];let B=j?`sm:grid-cols-2`:`sm:grid-cols-3`,V;t[35]===B?V=t[36]:(V=le(`mt-3 grid gap-3`,B),t[35]=B,t[36]=V);let H;t[37]!==n.draft.noProject||t[38]!==n.draft.project||t[39]!==y||t[40]!==d||t[41]!==j||t[42]!==u?(H=j?null:(0,$.jsx)(Z,{label:n.draft.project,children:(0,$.jsxs)(k,{className:Pn,value:d,onChange:e=>y(e.target.value),children:[(0,$.jsx)(A,{value:``,children:n.draft.noProject}),u.map(pn)]})}),t[37]=n.draft.noProject,t[38]=n.draft.project,t[39]=y,t[40]=d,t[41]=j,t[42]=u,t[43]=H):H=t[43];let ce;t[44]===b?ce=t[45]:(ce=e=>b(e.target.value),t[44]=b,t[45]=ce);let U;t[46]===n.draft.newConversation?U=t[47]:(U=(0,$.jsx)(A,{value:`new_session`,children:n.draft.newConversation}),t[46]=n.draft.newConversation,t[47]=U);let W;t[48]===n.draft.continuousConversation?W=t[49]:(W=(0,$.jsx)(A,{value:`continuous`,children:n.draft.continuousConversation}),t[48]=n.draft.continuousConversation,t[49]=W);let G;t[50]!==f||t[51]!==ce||t[52]!==U||t[53]!==W?(G=(0,$.jsxs)(k,{className:Pn,value:f,onChange:ce,children:[U,W]}),t[50]=f,t[51]=ce,t[52]=U,t[53]=W,t[54]=G):G=t[54];let ue;t[55]!==n.draft.conversation||t[56]!==G?(ue=(0,$.jsx)(Z,{label:n.draft.conversation,children:G}),t[55]=n.draft.conversation,t[56]=G,t[57]=ue):ue=t[57];let K;t[58]===x?K=t[59]:(K=e=>x(e.target.value),t[58]=x,t[59]=K);let de;t[60]===n.draft.notifyAttention?de=t[61]:(de=(0,$.jsx)(A,{value:`attention`,children:n.draft.notifyAttention}),t[60]=n.draft.notifyAttention,t[61]=de);let q;t[62]===n.draft.notifyAll?q=t[63]:(q=(0,$.jsx)(A,{value:`all`,children:n.draft.notifyAll}),t[62]=n.draft.notifyAll,t[63]=q);let fe;t[64]===n.draft.notifyNone?fe=t[65]:(fe=(0,$.jsx)(A,{value:`none`,children:n.draft.notifyNone}),t[64]=n.draft.notifyNone,t[65]=fe);let pe;t[66]!==p||t[67]!==K||t[68]!==de||t[69]!==q||t[70]!==fe?(pe=(0,$.jsxs)(k,{className:Pn,value:p,onChange:K,children:[de,q,fe]}),t[66]=p,t[67]=K,t[68]=de,t[69]=q,t[70]=fe,t[71]=pe):pe=t[71];let he;t[72]!==n.draft.notifications||t[73]!==pe?(he=(0,$.jsx)(Z,{label:n.draft.notifications,children:pe}),t[72]=n.draft.notifications,t[73]=pe,t[74]=he):he=t[74];let J;t[75]!==V||t[76]!==H||t[77]!==ue||t[78]!==he?(J=(0,$.jsxs)(`div`,{className:V,children:[H,ue,he]}),t[75]=V,t[76]=H,t[77]=ue,t[78]=he,t[79]=J):J=t[79];let ge;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]!==D||t[101]!==M||t[102]!==O?(ge=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)(kn,{label:n.info.when,value:i.simulation.triggerSummary}),(0,$.jsx)(kn,{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)(mn,{title:n.draft.safety,items:[...i.simulation.safetyNotes,...i.simulation.requiredConfirmations],empty:n.none}),(0,$.jsx)(mn,{title:n.draft.assumptions,items:i.assumptions,empty:n.none}),(0,$.jsx)(mn,{title:n.draft.risks,items:i.risks,empty:n.none}),M?(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)(me,{variant:`ghost`,onClick:C,children:n.draft.discard}),(0,$.jsxs)(me,{variant:`secondary`,onClick:g,children:[(0,$.jsx)(ne,{className:`size-4`}),n.draft.edit]}),(0,$.jsxs)(me,{variant:`secondary`,onClick:v,disabled:O||D||M&&!o,children:[(0,$.jsx)(re,{className:`size-4`}),O?n.draft.testing:n.draft.testOnce]}),(0,$.jsx)(me,{variant:`primary`,onClick:_,disabled:D||M&&!o,children:D?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]=D,t[101]=M,t[102]=O,t[103]=ge):ge=t[103];let _e;return t[104]!==ie||t[105]!==oe||t[106]!==J||t[107]!==ge||t[108]!==N?(_e=(0,$.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[N,ie,oe,J,ge]}),t[104]=ie,t[105]=oe,t[106]=J,t[107]=ge,t[108]=N,t[109]=_e):_e=t[109],_e}function pn(e){return(0,$.jsx)(A,{value:e.id,children:e.name},e.id)}function mn(e){let t=(0,st.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(hn):(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 hn(e){return(0,$.jsxs)(`li`,{children:[`- `,e]},e)}function gn(e){let t=(0,st.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=le(`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=le(`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=le(`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 _n(e){let t=(0,st.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(en),t[0]=n,t[1]=d);let f=d.length,p;t[2]===n?p=t[3]:(p=n.filter(tn),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=le(`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`,w;t[15]!==i.filters.userManaged||t[16]!==C||t[17]!==x||t[18]!==S?(w=(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]=w):w=t[19];let T=r===`system`&&`bg-surface-base text-fg shadow-sm`,E;t[20]===T?E=t[21]:(E=le(`rounded-md px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:text-fg`,T),t[20]=T,t[21]=E);let D;t[22]===c?D=t[23]:(D=()=>c(`system`),t[22]=c,t[23]=D);let O=r===`system`,k;t[24]!==i.system.title||t[25]!==E||t[26]!==D||t[27]!==O?(k=(0,$.jsx)(`button`,{type:`button`,className:E,onClick:D,"aria-pressed":O,children:i.system.title}),t[24]=i.system.title,t[25]=E,t[26]=D,t[27]=O,t[28]=k):k=t[28];let A;t[29]!==i.filters.ownership||t[30]!==w||t[31]!==k?(A=(0,$.jsxs)(ge,{className:`flex rounded-lg bg-surface-panel p-0.5`,role:`group`,"aria-label":v,indicatorClassName:`rounded-md bg-surface-base shadow-sm`,children:[w,k]}),t[29]=i.filters.ownership,t[30]=w,t[31]=k,t[32]=A):A=t[32];let N;t[33]!==i.refresh||t[34]!==s||t[35]!==l?(N=(0,$.jsx)(_e,{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]=N):N=t[36];let P;t[37]!==A||t[38]!==N?(P=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,N]}),t[37]=A,t[38]=N,t[39]=P):P=t[39];let F;t[40]!==P||t[41]!==_?(F=(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:[_,P]}),t[40]=P,t[41]=_,t[42]=F):F=t[42];let I;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t[43]=I):I=t[43];let L=i.metrics.total,R=String(n.length),z;t[44]!==i.metrics.total||t[45]!==R?(z=(0,$.jsx)(gn,{icon:I,label:L,value:R}),t[44]=i.metrics.total,t[45]=R,t[46]=z):z=t[46];let ee;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(re,{className:`size-4`,"aria-hidden":!0}),t[47]=ee):ee=t[47];let te=i.metrics.running,ne=String(f),ie;t[48]!==i.metrics.running||t[49]!==ne?(ie=(0,$.jsx)(gn,{icon:ee,label:te,value:ne}),t[48]=i.metrics.running,t[49]=ne,t[50]=ie):ie=t[50];let ae;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(j,{className:`size-4`,"aria-hidden":!0}),t[51]=ae):ae=t[51];let oe=i.dashboard.needsAttention,B=String(m),se=m>0?`danger`:`default`,V;t[52]!==i.dashboard.needsAttention||t[53]!==B||t[54]!==se?(V=(0,$.jsx)(gn,{icon:ae,label:oe,value:B,tone:se}),t[52]=i.dashboard.needsAttention,t[53]=B,t[54]=se,t[55]=V):V=t[55];let H;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(M,{className:`size-4`,"aria-hidden":!0}),t[56]=H):H=t[56];let ce=i.filters.unread,U=String(o),W;t[57]!==i.filters.unread||t[58]!==U?(W=(0,$.jsx)(gn,{icon:H,label:ce,value:U}),t[57]=i.filters.unread,t[58]=U,t[59]=W):W=t[59];let G;t[60]!==z||t[61]!==ie||t[62]!==V||t[63]!==W?(G=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-b border-edge-subtle bg-edge-subtle lg:grid-cols-4`,children:[z,ie,V,W]}),t[60]=z,t[61]=ie,t[62]=V,t[63]=W,t[64]=G):G=t[64];let ue;t[65]!==i||t[66]!==a||t[67]!==u||t[68]!==n?(ue=n.length===0?(0,$.jsx)(An,{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:le(`mt-1.5 size-2 shrink-0 rounded-full`,en(e)?`bg-blue-500`:tn(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&&!en(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:le(`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:Jt(e.createdAtMs,i,a)})]}),(0,$.jsx)(`span`,{className:le(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Qt(e.status)),children:i.status[e.status]})]},e.id))}),t[65]=i,t[66]=a,t[67]=u,t[68]=n,t[69]=ue):ue=t[69];let K;return t[70]!==F||t[71]!==G||t[72]!==ue?(K=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,"aria-labelledby":`automation-activity-title`,children:[F,G,ue]}),t[70]=F,t[71]=G,t[72]=ue,t[73]=K):K=t[73],K}function vn(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 yn(e){let t=(0,st.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
- `),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(`
6
- `).slice(0,10).join(`
7
- `).trimEnd()}...`:l,t[4]=f,t[5]=l,t[6]=p):p=t[6];let m=p,h;t[7]!==o||t[8]!==f||t[9]!==r||t[10]!==i?(h=f?(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>s(bn),"aria-expanded":o,children:[(0,$.jsx)(`span`,{children:i}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-accent-fg`,children:[o?r.details.hideDetails:r.details.showDetails,(0,$.jsx)(D,{className:le(`size-3.5 transition-transform`,o&&`rotate-180`),"aria-hidden":!0})]})]}):(0,$.jsx)(`div`,{className:`px-2.5 py-2 text-xs font-medium text-fg-muted`,children:i}),t[7]=o,t[8]=f,t[9]=r,t[10]=i,t[11]=h):h=t[11];let g=o||!f?l:m,_;t[12]===g?_=t[13]:(_=(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap break-all px-2.5 pb-2 text-xs leading-relaxed text-fg-muted`,children:g}),t[12]=g,t[13]=_);let v;return t[14]!==h||t[15]!==_?(v=(0,$.jsxs)(`div`,{className:`mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[h,_]}),t[14]=h,t[15]=_,t[16]=v):v=t[16],v}function bn(e){return!e}function xn(e){let t=(0,st.c)(152),{className:n,run:r,events:i,labels:a,cronLabels:s,language:c,loading:l,repairDraft:u,repairLoading:d,repairApproved:f,busyAction:p,onRepairApprovedChange:m,onSuggestRepair:h,onApplyRepair:g}=e;if(!r){let e;t[0]===n?e=t[1]:(e=le(`flex min-h-64 flex-col justify-center rounded-lg border border-edge-subtle bg-surface-base px-4 text-center text-sm text-fg-muted shadow-surface`,n),t[0]=n,t[1]=e);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(y,{className:`mx-auto size-5`}),t[2]=r):r=t[2];let i;t[3]===a.selectRun?i=t[4]:(i=(0,$.jsx)(`div`,{className:`mt-2`,children:a.selectRun}),t[3]=a.selectRun,t[4]=i);let o;return t[5]!==e||t[6]!==i?(o=(0,$.jsxs)(`aside`,{className:e,children:[r,i]}),t[5]=e,t[6]=i,t[7]=o):o=t[7],o}let _;t[8]!==c||t[9]!==r?(_=r.error?tt(r,c):r.summary,t[8]=c,t[9]=r,t[10]=_):_=t[10];let v=_,b=r.conversationId?`/chat/${encodeURIComponent(r.conversationId)}`:null,x=(r.conversationId,a.runDetail.openConversation),S=r.conversationId?ee:I,C=en(r)?y:r.status===`succeeded`?M:j,T;t[11]===n?T=t[12]:(T=le(`rounded-lg border border-edge-subtle bg-surface-base shadow-surface`,n),t[11]=n,t[12]=T);let E;t[13]===r.automationName?E=t[14]:(E=(0,$.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,children:r.automationName}),t[13]=r.automationName,t[14]=E);let k;t[15]===r.id?k=t[16]:(k=r.id.slice(0,8),t[15]=r.id,t[16]=k);let A;t[17]===k?A=t[18]:(A=(0,$.jsx)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:k}),t[17]=k,t[18]=A);let N;t[19]!==E||t[20]!==A?(N=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[E,A]}),t[19]=E,t[20]=A,t[21]=N):N=t[21];let P;t[22]===r.status?P=t[23]:(P=le(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Qt(r.status)),t[22]=r.status,t[23]=P);let F=a.status[r.status],L;t[24]!==P||t[25]!==F?(L=(0,$.jsx)(`span`,{className:P,children:F}),t[24]=P,t[25]=F,t[26]=L):L=t[26];let R;t[27]!==N||t[28]!==L?(R=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[N,L]}),t[27]=N,t[28]=L,t[29]=R):R=t[29];let te;t[30]!==a||t[31]!==c||t[32]!==r.createdAtMs?(te=Jt(r.createdAtMs,a,c),t[30]=a,t[31]=c,t[32]=r.createdAtMs,t[33]=te):te=t[33];let ne;t[34]===te?ne=t[35]:(ne=(0,$.jsx)(`span`,{children:te}),t[34]=te,t[35]=ne);let re;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t[36]=re):re=t[36];let ie=a.details.duration,ae;t[37]!==a||t[38]!==r.durationMs?(ae=$t(r.durationMs,a),t[37]=a,t[38]=r.durationMs,t[39]=ae):ae=t[39];let oe;t[40]!==a.details.duration||t[41]!==ae?(oe=(0,$.jsxs)(`span`,{children:[ie,` `,ae]}),t[40]=a.details.duration,t[41]=ae,t[42]=oe):oe=t[42];let B;t[43]!==ne||t[44]!==oe?(B=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-muted`,children:[ne,re,oe]}),t[43]=ne,t[44]=oe,t[45]=B):B=t[45];let V;t[46]!==a.repair||t[47]!==c||t[48]!==h||t[49]!==d||t[50]!==r?(V=r.status===`failed`||r.status===`timeout`||r.status===`cancelled`?(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:r.actionSnapshot.kind===`system`?(0,$.jsxs)(me,{variant:`secondary`,onClick:()=>h(r),disabled:d,children:[(0,$.jsx)(se,{className:`size-4`}),d?a.repair.generating:a.repair.suggest]}):(0,$.jsx)(He,{automationId:r.automationId,runId:r.id,language:c})}):null,t[46]=a.repair,t[47]=c,t[48]=h,t[49]=d,t[50]=r,t[51]=V):V=t[51];let H;t[52]!==R||t[53]!==B||t[54]!==V?(H=(0,$.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[R,B,V]}),t[52]=R,t[53]=B,t[54]=V,t[55]=H):H=t[55];let ce;t[56]===r?ce=t[57]:(ce=en(r)?`text-blue-500`:tn(r)?`text-red-500`:r.status===`succeeded`?`text-emerald-500`:`text-fg-muted`,t[56]=r,t[57]=ce);let U;t[58]===ce?U=t[59]:(U=le(`size-4`,ce),t[58]=ce,t[59]=U);let G;t[60]!==C||t[61]!==U?(G=(0,$.jsx)(C,{className:U}),t[60]=C,t[61]=U,t[62]=G):G=t[62];let ue;t[63]!==a.runDetail.resultTitle||t[64]!==G?(ue=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[G,a.runDetail.resultTitle]}),t[63]=a.runDetail.resultTitle,t[64]=G,t[65]=ue):ue=t[65];let K;t[66]!==S||t[67]!==x||t[68]!==b?(K=b?(0,$.jsx)(me,{asChild:!0,variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,children:(0,$.jsxs)(o,{to:b,children:[(0,$.jsx)(S,{className:`size-3.5`}),x,(0,$.jsx)(O,{className:`size-3.5`})]})}):null,t[66]=S,t[67]=x,t[68]=b,t[69]=K):K=t[69];let de;t[70]!==ue||t[71]!==K?(de=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[ue,K]}),t[70]=ue,t[71]=K,t[72]=de):de=t[72];let q=r.error&&`border-red-500/25 bg-red-500/5`,fe;t[73]===q?fe=t[74]:(fe=le(`mt-3 max-h-80 overflow-y-auto rounded-lg border border-edge/70 bg-surface-inset/25 p-3`,q),t[73]=q,t[74]=fe);let pe;t[75]!==a.runDetail.noResult||t[76]!==a.runDetail.resultPending||t[77]!==v||t[78]!==r?(pe=v?r.error?(0,$.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-red-700 dark:text-red-300`,children:v}):(0,$.jsx)(z,{content:v,compact:!0,className:`text-sm`}):(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:en(r)?a.runDetail.resultPending:a.runDetail.noResult}),t[75]=a.runDetail.noResult,t[76]=a.runDetail.resultPending,t[77]=v,t[78]=r,t[79]=pe):pe=t[79];let he;t[80]!==fe||t[81]!==pe?(he=(0,$.jsx)(`div`,{className:fe,children:pe}),t[80]=fe,t[81]=pe,t[82]=he):he=t[82];let J;t[83]!==de||t[84]!==he?(J=(0,$.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[de,he]}),t[83]=de,t[84]=he,t[85]=J):J=t[85];let ge;t[86]===a.runDetail.runInfo?ge=t[87]:(ge=(0,$.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:a.runDetail.runInfo}),t[86]=a.runDetail.runInfo,t[87]=ge);let _e;t[88]!==s||t[89]!==a||t[90]!==c||t[91]!==r.manual||t[92]!==r.triggerSnapshot?(_e=r.manual?a.trigger.manual:Me(r.triggerSnapshot,a,s,c),t[88]=s,t[89]=a,t[90]=c,t[91]=r.manual,t[92]=r.triggerSnapshot,t[93]=_e):_e=t[93];let ve;t[94]!==a.explain.whyRan||t[95]!==_e?(ve=(0,$.jsx)(Dn,{label:a.explain.whyRan,value:_e}),t[94]=a.explain.whyRan,t[95]=_e,t[96]=ve):ve=t[96];let ye=a.details.started,be;t[97]!==a||t[98]!==c||t[99]!==r.startedAtMs?(be=Jt(r.startedAtMs,a,c),t[97]=a,t[98]=c,t[99]=r.startedAtMs,t[100]=be):be=t[100];let xe;t[101]!==a.details.started||t[102]!==be?(xe=(0,$.jsx)(Dn,{label:ye,value:be}),t[101]=a.details.started,t[102]=be,t[103]=xe):xe=t[103];let Se;t[104]!==a.details.model||t[105]!==r.model?(Se=r.model?(0,$.jsx)(Dn,{label:a.details.model,value:r.model}):null,t[104]=a.details.model,t[105]=r.model,t[106]=Se):Se=t[106];let Ce;t[107]!==ve||t[108]!==xe||t[109]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-fg-muted`,children:[ve,xe,Se]}),t[107]=ve,t[108]=xe,t[109]=Se,t[110]=Ce):Ce=t[110];let we;t[111]!==ge||t[112]!==Ce?(we=(0,$.jsxs)(`section`,{className:`border-b border-edge p-4`,children:[ge,Ce]}),t[111]=ge,t[112]=Ce,t[113]=we):we=t[113];let Y;t[114]!==p||t[115]!==a||t[116]!==g||t[117]!==m||t[118]!==f||t[119]!==u||t[120]!==r?(Y=u?(0,$.jsxs)(`div`,{className:`border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`div`,{className:`text-xs font-semibold uppercase text-fg-muted`,children:a.repair.title}),(0,$.jsx)(`div`,{className:`mt-2 text-sm text-fg`,children:u.explanation}),u.expectedEffect?(0,$.jsx)(`div`,{className:`mt-2 text-sm text-fg-muted`,children:u.expectedEffect}):null,(0,$.jsx)(mn,{title:a.repair.risks,items:u.risks,empty:a.none}),(0,$.jsx)(yn,{value:u.patch,labels:a,title:a.details.repairPatch}),u.requiresApproval?(0,$.jsxs)(`label`,{className:`mt-3 flex items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:f,onChange:e=>m(e.target.checked)}),(0,$.jsx)(`span`,{children:a.repair.approval})]}):null,(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsx)(me,{variant:`primary`,onClick:()=>g(r),disabled:p===`run:${r.id}:repair`||u.requiresApproval&&!f,children:p===`run:${r.id}:repair`?a.feedback.working:a.repair.apply})})]}):null,t[114]=p,t[115]=a,t[116]=g,t[117]=m,t[118]=f,t[119]=u,t[120]=r,t[121]=Y):Y=t[121];let Te;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,$.jsx)(w,{className:`size-4 shrink-0`}),t[122]=Te):Te=t[122];let Ee;t[123]===a.runDetail.technicalEvents?Ee=t[124]:(Ee=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium text-fg-muted`,children:[Te,a.runDetail.technicalEvents]}),t[123]=a.runDetail.technicalEvents,t[124]=Ee);let X;t[125]!==i.length||t[126]!==a.runDetail.eventCount?(X=a.runDetail.eventCount.replace(`{count}`,String(i.length)),t[125]=i.length,t[126]=a.runDetail.eventCount,t[127]=X):X=t[127];let De;t[128]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,$.jsx)(D,{className:`size-4 transition-transform group-open:rotate-180`}),t[128]=De):De=t[128];let Oe;t[129]===X?Oe=t[130]:(Oe=(0,$.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-fg-muted`,children:[X,De]}),t[129]=X,t[130]=Oe);let ke;t[131]!==Ee||t[132]!==Oe?(ke=(0,$.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 rounded-md outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[Ee,Oe]}),t[131]=Ee,t[132]=Oe,t[133]=ke):ke=t[133];let Ae;t[134]===a.runDetail.technicalEventsDescription?Ae=t[135]:(Ae=(0,$.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:a.runDetail.technicalEventsDescription}),t[134]=a.runDetail.technicalEventsDescription,t[135]=Ae);let je;t[136]!==i||t[137]!==a||t[138]!==c||t[139]!==l?(je=(0,$.jsx)(`div`,{className:`mt-4`,children:l?(0,$.jsxs)(`div`,{className:`space-y-3`,"aria-label":a.loading,children:[(0,$.jsx)(W,{className:`h-10 w-full`}),(0,$.jsx)(W,{className:`h-10 w-4/5`}),(0,$.jsx)(W,{className:`h-10 w-11/12`})]}):i.length===0?(0,$.jsx)(`div`,{className:`text-sm text-fg-muted`,children:a.empty.events}):(0,$.jsx)(`ol`,{className:`space-y-3`,children:i.map(e=>(0,$.jsxs)(`li`,{className:`grid grid-cols-[0.75rem_1fr] gap-3`,children:[(0,$.jsx)(`span`,{className:le(`mt-1 size-2 rounded-full`,On(e.type))}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-sm text-fg`,children:vn(e,a)}),(0,$.jsxs)(`div`,{className:`mt-1 text-xs text-fg-muted`,children:[Jt(e.createdAtMs,a,c),` · `,e.type]}),e.data&&typeof e.data==`object`?(0,$.jsxs)(`details`,{className:`group/event mt-2 rounded-md border border-edge/70 bg-surface-inset/35`,children:[(0,$.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 px-2.5 py-2 text-xs font-medium text-fg-muted outline-none hover:text-fg`,children:[a.details.eventData,(0,$.jsx)(D,{className:`size-3.5 transition-transform group-open/event:rotate-180`})]}),(0,$.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-all border-t border-edge/70 px-2.5 py-2 text-xs leading-relaxed text-fg-muted`,children:JSON.stringify(e.data,null,2)})]}):null]})]},e.id))})}),t[136]=i,t[137]=a,t[138]=c,t[139]=l,t[140]=je):je=t[140];let Z;t[141]!==ke||t[142]!==Ae||t[143]!==je?(Z=(0,$.jsxs)(`details`,{className:`group px-4 py-3`,children:[ke,Ae,je]}),t[141]=ke,t[142]=Ae,t[143]=je,t[144]=Z):Z=t[144];let Ne;return t[145]!==H||t[146]!==T||t[147]!==J||t[148]!==we||t[149]!==Y||t[150]!==Z?(Ne=(0,$.jsxs)(`aside`,{className:T,children:[H,J,we,Y,Z]}),t[145]=H,t[146]=T,t[147]=J,t[148]=we,t[149]=Y,t[150]=Z,t[151]=Ne):Ne=t[151],Ne}function Sn(e){let t=(0,st.c)(138),{automation:n,runs:r,runsLoading:i,runsError:a,labels:o,cronLabels:s,language:c,projects:l,busyAction:u,onEdit:d,onSelectRun:f,onAction:p}=e,m=u===`automation:${n.id}:run`,h=u===`automation:${n.id}:toggle`,g=u===`automation:${n.id}:delete`,_;t[0]===n?_=t[1]:(_=!Ae(n)&&(!n.management||n.management.editable.includes(`enabled`)),t[0]=n,t[1]=_);let v=_,b=!n.management||n.management.runnable,S;t[2]===n.management?S=t[3]:(S=!n.management||n.management.editable.includes(`trigger`),t[2]=n.management,t[3]=S);let C=S,w=!n.management||n.management.deletable,T;t[4]===n.name?T=t[5]:(T=(0,$.jsx)(`h2`,{className:`truncate text-lg font-semibold text-fg`,children:n.name}),t[4]=n.name,t[5]=T);let E=n.enabled?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`bg-surface-hover text-fg-muted`,D;t[6]===E?D=t[7]:(D=le(`shrink-0 rounded-full px-2 py-0.5 text-xs`,E),t[6]=E,t[7]=D);let O=Ae(n)?c===`zh`?`已完成`:`Completed`:n.enabled?o.enabled:o.paused,k;t[8]!==D||t[9]!==O?(k=(0,$.jsx)(`span`,{className:D,children:O}),t[8]=D,t[9]=O,t[10]=k):k=t[10];let A;t[11]!==T||t[12]!==k?(A=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[T,k]}),t[11]=T,t[12]=k,t[13]=A):A=t[13];let j;t[14]===n?j=t[15]:(j=rn(n)?(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:rn(n)}):null,t[14]=n,t[15]=j);let N;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(x,{className:`size-3.5`,"aria-hidden":!0}),t[16]=N):N=t[16];let F;t[17]!==n.trigger||t[18]!==s||t[19]!==o||t[20]!==c?(F=Me(n.trigger,o,s,c),t[17]=n.trigger,t[18]=s,t[19]=o,t[20]=c,t[21]=F):F=t[21];let I;t[22]===F?I=t[23]:(I=(0,$.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-edge-subtle bg-surface-base px-2 py-1`,children:[N,F]})}),t[22]=F,t[23]=I);let L;t[24]!==I||t[25]!==A||t[26]!==j?(L=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[A,j,I]}),t[24]=I,t[25]=A,t[26]=j,t[27]=L):L=t[27];let R;t[28]!==n||t[29]!==u||t[30]!==w||t[31]!==C||t[32]!==b||t[33]!==v||t[34]!==g||t[35]!==o.dashboard.delete||t[36]!==o.dashboard.deleted||t[37]!==o.dashboard.pause||t[38]!==o.dashboard.resume||t[39]!==o.dashboard.resumed||t[40]!==o.dashboard.runNow||t[41]!==o.details||t[42]!==o.edit||t[43]!==o.experience.deleteConfirm||t[44]!==o.feedback||t[45]!==c||t[46]!==p||t[47]!==d||t[48]!==m||t[49]!==r[0]||t[50]!==h?(R=v||b||C||w?(0,$.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-2`,children:[C&&!Vt(n)?(0,$.jsx)(He,{automationId:n.id,language:c,runId:r[0]&&[`failed`,`timeout`].includes(r[0].status)?r[0].id:void 0}):null,v?(0,$.jsxs)(me,{variant:`secondary`,disabled:u!==null,onClick:()=>void p(`automation:${n.id}:toggle`,()=>n.enabled?J.pause(n.id):J.resume(n.id),n.enabled?o.feedback.paused:o.dashboard.resumed),children:[h?(0,$.jsx)(ae,{className:`size-4 animate-spin`}):n.enabled?(0,$.jsx)(te,{className:`size-4`}):(0,$.jsx)(re,{className:`size-4`}),n.enabled?o.dashboard.pause:o.dashboard.resume]}):null,b?(0,$.jsxs)(me,{variant:`secondary`,disabled:u!==null,onClick:()=>void p(`automation:${n.id}:run`,()=>J.runNow(n.id),o.feedback.rerunQueued),children:[m?(0,$.jsx)(ae,{className:`size-4 animate-spin`}):(0,$.jsx)(re,{className:`size-4`}),o.dashboard.runNow]}):null,C||w?(0,$.jsxs)(Ce,{children:[(0,$.jsx)(we,{asChild:!0,children:(0,$.jsx)(me,{variant:`ghost`,className:`size-9 p-0`,"aria-label":o.details.moreActions,children:(0,$.jsx)(P,{className:`size-4`})})}),(0,$.jsx)(Y,{children:(0,$.jsxs)(De,{align:`end`,className:`z-70 min-w-40 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover`,children:[C?(0,$.jsxs)(Ee,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover`,onSelect:()=>d(n),children:[(0,$.jsx)(ne,{className:`size-4`}),o.edit]}):null,w?(0,$.jsxs)(Ee,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-red-700 outline-none hover:bg-red-500/10 dark:text-red-300`,disabled:u!==null,onSelect:()=>{window.confirm(o.experience.deleteConfirm)&&p(`automation:${n.id}:delete`,()=>J.remove(n.id),o.dashboard.deleted)},children:[g?(0,$.jsx)(ae,{className:`size-4 animate-spin`}):(0,$.jsx)(H,{className:`size-4`}),o.dashboard.delete]}):null]})})]}):null]}):null,t[28]=n,t[29]=u,t[30]=w,t[31]=C,t[32]=b,t[33]=v,t[34]=g,t[35]=o.dashboard.delete,t[36]=o.dashboard.deleted,t[37]=o.dashboard.pause,t[38]=o.dashboard.resume,t[39]=o.dashboard.resumed,t[40]=o.dashboard.runNow,t[41]=o.details,t[42]=o.edit,t[43]=o.experience.deleteConfirm,t[44]=o.feedback,t[45]=c,t[46]=p,t[47]=d,t[48]=m,t[49]=r[0],t[50]=h,t[51]=R):R=t[51];let ee;t[52]!==L||t[53]!==R?(ee=(0,$.jsxs)(`header`,{className:`flex flex-col items-start gap-3 border-b border-edge px-5 py-4`,children:[L,R]}),t[52]=L,t[53]=R,t[54]=ee):ee=t[54];let ie;t[55]!==n.action.instruction||t[56]!==n.action.kind||t[57]!==c?(ie=n.action.kind===`agent`?(0,$.jsxs)(`section`,{"aria-label":c===`zh`?`要做的事`:`What this task does`,children:[(0,$.jsx)(`h3`,{className:`mb-2 text-sm font-semibold text-fg`,children:c===`zh`?`要做的事`:`What this task does`}),(0,$.jsx)(`div`,{className:`max-h-48 overflow-y-auto text-sm leading-6 text-fg-muted`,children:(0,$.jsx)(z,{content:n.action.instruction,compact:!0})})]}):null,t[55]=n.action.instruction,t[56]=n.action.kind,t[57]=c,t[58]=ie):ie=t[58];let oe;t[59]===o.dashboard.latestResult?oe=t[60]:(oe=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.latestResult}),t[59]=o.dashboard.latestResult,t[60]=oe);let B;t[61]!==o.experience.viewResult||t[62]!==f||t[63]!==r[0]?(B=r[0]?(0,$.jsx)(me,{variant:`secondary`,onClick:()=>f(r[0].id),children:o.experience.viewResult}):null,t[61]=o.experience.viewResult,t[62]=f,t[63]=r[0],t[64]=B):B=t[64];let se;t[65]!==oe||t[66]!==B?(se=(0,$.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[oe,B]}),t[65]=oe,t[66]=B,t[67]=se):se=t[67];let V;t[68]!==o||t[69]!==c||t[70]!==r[0]||t[71]!==a||t[72]!==i?(V=a?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-red-700 dark:text-red-300`,children:a}):i?(0,$.jsx)(W,{className:`h-28 w-full`}):r[0]?(0,$.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge-subtle bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`span`,{className:le(`rounded-full px-2 py-0.5`,Qt(r[0].status)),children:o.status[r[0].status]}),Jt(r[0].createdAtMs,o,c)]}),(0,$.jsx)(z,{content:r[0].error||r[0].summary||(en(r[0])?o.runDetail.resultPending:o.runDetail.noResult),compact:!0})]}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.experience.noRuns}),t[68]=o,t[69]=c,t[70]=r[0],t[71]=a,t[72]=i,t[73]=V):V=t[73];let ce;t[74]!==c||t[75]!==r[0]?(ce=r[0]&&!en(r[0])?(0,$.jsx)($e,{runId:r[0].id,language:c}):null,t[74]=c,t[75]=r[0],t[76]=ce):ce=t[76];let U;t[77]!==n||t[78]!==o||t[79]!==c?(U=n.enabled?`${o.next}: ${Re(n,o,c)}`:Ae(n)?c===`zh`?`已按计划完成`:`Completed as scheduled`:o.paused,t[77]=n,t[78]=o,t[79]=c,t[80]=U):U=t[80];let G;t[81]===U?G=t[82]:(G=(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:U}),t[81]=U,t[82]=G);let ue;t[83]!==se||t[84]!==V||t[85]!==ce||t[86]!==G?(ue=(0,$.jsxs)(`section`,{children:[se,V,ce,G]}),t[83]=se,t[84]=V,t[85]=ce,t[86]=G,t[87]=ue):ue=t[87];let K;t[88]===o.dashboard.runHistory?K=t[89]:(K=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.dashboard.runHistory}),t[88]=o.dashboard.runHistory,t[89]=K);let de;t[90]===o.dashboard.runHistoryDescription?de=t[91]:(de=(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:o.dashboard.runHistoryDescription}),t[90]=o.dashboard.runHistoryDescription,t[91]=de);let q;t[92]!==K||t[93]!==de?(q=(0,$.jsxs)(`div`,{children:[K,de]}),t[92]=K,t[93]=de,t[94]=q):q=t[94];let fe;t[95]===r.length?fe=t[96]:(fe=(0,$.jsx)(`span`,{className:`rounded-full bg-surface-base px-2.5 py-1 text-xs text-fg-muted`,children:r.length}),t[95]=r.length,t[96]=fe);let pe;t[97]!==q||t[98]!==fe?(pe=(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[q,fe]}),t[97]=q,t[98]=fe,t[99]=pe):pe=t[99];let he;t[100]!==o||t[101]!==c||t[102]!==f||t[103]!==r||t[104]!==i?(he=i?(0,$.jsx)(W,{className:`h-24 w-full`}):r.length===0?null:(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge-subtle bg-surface-base`,children:r.slice(0,8).map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`block w-full p-3 text-left hover:bg-surface-hover`,onClick:()=>f(e.id),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.status===`succeeded`?(0,$.jsx)(M,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-300`}):(0,$.jsx)(y,{className:`size-4 shrink-0 text-fg-muted`}),(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:Jt(e.createdAtMs,o,c)})]}),(0,$.jsx)(`span`,{className:le(`shrink-0 rounded-full px-2 py-0.5 text-xs`,Qt(e.status)),children:o.status[e.status]})]}),(0,$.jsx)(`p`,{className:le(`mt-1 line-clamp-2 pl-6 text-sm text-fg-muted`,e.error&&`text-red-700 dark:text-red-300`),children:e.error||e.summary||Yt(e.actionSnapshot,o)})]},e.id))}),t[100]=o,t[101]=c,t[102]=f,t[103]=r,t[104]=i,t[105]=he):he=t[105];let ge;t[106]!==pe||t[107]!==he?(ge=(0,$.jsxs)(`section`,{className:`min-w-0`,children:[pe,he]}),t[106]=pe,t[107]=he,t[108]=ge):ge=t[108];let _e;t[109]===o.experience.settings?_e=t[110]:(_e=(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:o.experience.settings}),t[109]=o.experience.settings,t[110]=_e);let ve;t[111]!==n||t[112]!==o?(ve=nn(n,o),t[111]=n,t[112]=o,t[113]=ve):ve=t[113];let ye;t[114]===ve?ye=t[115]:(ye=(0,$.jsx)(z,{content:ve,compact:!0}),t[114]=ve,t[115]=ye);let be;t[116]!==n||t[117]!==s||t[118]!==o||t[119]!==c||t[120]!==l?(be=(0,$.jsx)(wn,{automation:n,labels:o,cronLabels:s,language:c,projects:l}),t[116]=n,t[117]=s,t[118]=o,t[119]=c,t[120]=l,t[121]=be):be=t[121];let xe;t[122]!==ye||t[123]!==be?(xe=(0,$.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[ye,be]}),t[122]=ye,t[123]=be,t[124]=xe):xe=t[124];let Se;t[125]!==_e||t[126]!==xe?(Se=(0,$.jsxs)(`details`,{className:`rounded-lg border border-edge-subtle p-4`,children:[_e,xe]}),t[125]=_e,t[126]=xe,t[127]=Se):Se=t[127];let Te;t[128]!==ge||t[129]!==Se?(Te=(0,$.jsxs)(`div`,{className:`grid gap-5`,children:[ge,Se]}),t[128]=ge,t[129]=Se,t[130]=Te):Te=t[130];let X;t[131]!==ie||t[132]!==ue||t[133]!==Te?(X=(0,$.jsxs)(`div`,{className:`grid gap-5 p-5`,children:[ie,ue,Te]}),t[131]=ie,t[132]=ue,t[133]=Te,t[134]=X):X=t[134];let Oe;return t[135]!==ee||t[136]!==X?(Oe=(0,$.jsxs)(`article`,{className:`min-w-0 overflow-hidden bg-surface-panel`,children:[ee,X]}),t[135]=ee,t[136]=X,t[137]=Oe):Oe=t[137],Oe}function Cn(e,t){return e===`suggest_only`?t.safety.suggestOnlyDescription:e===`ask_before_apply`?t.safety.askBeforeApplyDescription:t.safety.autoApplyDescription}function wn(e){let t=(0,st.c)(146),{automation:n,labels:r,cronLabels:i,language:a,projects:o}=e,s,c,l,u,d,f,p,m,h,g,_;if(t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a){let e=Zt(n),o;t[15]!==n||t[16]!==r||t[17]!==a?(o=Re(n,r,a),t[15]=n,t[16]=r,t[17]=a,t[18]=o):o=t[18];let v=o,y;t[19]!==n.state.nextRunAtMs||t[20]!==a?(y=n.state.nextRunAtMs?Ze(n.state.nextRunAtMs,a):void 0,t[19]=n.state.nextRunAtMs,t[20]=a,t[21]=y):y=t[21];let b=y;if(t[22]!==n.trigger.eventType||t[23]!==n.trigger.kind||t[24]!==n.trigger.schedule||t[25]!==n.trigger.secretId||t[26]!==n.trigger.source||t[27]!==r.info.anchor||t[28]!==r.info.calendarSchedule||t[29]!==r.info.eventSource||t[30]!==r.info.eventType||t[31]!==r.info.expression||t[32]!==r.info.fixedInterval||t[33]!==r.info.oneTimeSchedule||t[34]!==r.info.rawInterval||t[35]!==r.info.scheduleType||t[36]!==r.info.timezone||t[37]!==r.info.webhookSecret||t[38]!==a){if(_=[],n.trigger.kind===`schedule`){let e=n.trigger.schedule,i=e.kind===`interval`?r.info.fixedInterval:e.kind===`cron`?r.info.calendarSchedule:r.info.oneTimeSchedule,o;if(t[40]!==r.info.scheduleType||t[41]!==i?(o={label:r.info.scheduleType,value:i},t[40]=r.info.scheduleType,t[41]=i,t[42]=o):o=t[42],_.push(o),e.kind===`interval`){let n=`${e.everyMs} ms`,i;if(t[43]!==r.info.rawInterval||t[44]!==n?(i={label:r.info.rawInterval,value:n},t[43]=r.info.rawInterval,t[44]=n,t[45]=i):i=t[45],_.push(i),e.anchorMs){let n=r.info.anchor,i;t[46]!==a||t[47]!==e.anchorMs?(i=Ze(e.anchorMs,a),t[46]=a,t[47]=e.anchorMs,t[48]=i):i=t[48];let o;t[49]!==r.info.anchor||t[50]!==i?(o={label:n,value:i},t[49]=r.info.anchor,t[50]=i,t[51]=o):o=t[51],_.push(o)}}else if(e.kind===`cron`){let n;if(t[52]!==r.info.expression||t[53]!==e.expr?(n={label:r.info.expression,value:e.expr},t[52]=r.info.expression,t[53]=e.expr,t[54]=n):n=t[54],_.push(n),e.tz){let n;t[55]!==r.info.timezone||t[56]!==e.tz?(n={label:r.info.timezone,value:e.tz},t[55]=r.info.timezone,t[56]=e.tz,t[57]=n):n=t[57],_.push(n)}}else{let n;t[58]!==r.info.oneTimeSchedule||t[59]!==e.at?(n={label:r.info.oneTimeSchedule,value:e.at},t[58]=r.info.oneTimeSchedule,t[59]=e.at,t[60]=n):n=t[60],_.push(n)}}else if(n.trigger.kind===`event`){let e;if(t[61]!==n.trigger.eventType||t[62]!==r.info.eventType?(e={label:r.info.eventType,value:n.trigger.eventType},t[61]=n.trigger.eventType,t[62]=r.info.eventType,t[63]=e):e=t[63],_.push(e),n.trigger.source){let e;t[64]!==n.trigger.source||t[65]!==r.info.eventSource?(e={label:r.info.eventSource,value:n.trigger.source},t[64]=n.trigger.source,t[65]=r.info.eventSource,t[66]=e):e=t[66],_.push(e)}}else if(n.trigger.kind===`webhook`&&n.trigger.secretId){let e;t[67]!==n.trigger.secretId||t[68]!==r.info.webhookSecret?(e={label:r.info.webhookSecret,value:n.trigger.secretId},t[67]=n.trigger.secretId,t[68]=r.info.webhookSecret,t[69]=e):e=t[69],_.push(e)}t[22]=n.trigger.eventType,t[23]=n.trigger.kind,t[24]=n.trigger.schedule,t[25]=n.trigger.secretId,t[26]=n.trigger.source,t[27]=r.info.anchor,t[28]=r.info.calendarSchedule,t[29]=r.info.eventSource,t[30]=r.info.eventType,t[31]=r.info.expression,t[32]=r.info.fixedInterval,t[33]=r.info.oneTimeSchedule,t[34]=r.info.rawInterval,t[35]=r.info.scheduleType,t[36]=r.info.timezone,t[37]=r.info.webhookSecret,t[38]=a,t[39]=_}else _=t[39];h=`h-fit overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,t[70]===r.info.overview?g=t[71]:(g=(0,$.jsx)(`div`,{className:`border-b border-edge-subtle px-4 py-3`,children:(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:r.info.overview})}),t[70]=r.info.overview,t[71]=g),f=`grid gap-4 p-4`;let S;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(x,{className:`size-4`,"aria-hidden":!0}),t[72]=S):S=t[72];let C=r.info.schedule,T;t[73]!==n.trigger||t[74]!==i||t[75]!==r||t[76]!==a?(T=Me(n.trigger,r,i,a),t[73]=n.trigger,t[74]=i,t[75]=r,t[76]=a,t[77]=T):T=t[77];let E=n.enabled?`${r.info.nextRun}:${v}`:v;t[78]!==r.info.schedule||t[79]!==b||t[80]!==T||t[81]!==E?(p=(0,$.jsx)(En,{icon:S,label:C,value:T,description:E,descriptionTitle:b}),t[78]=r.info.schedule,t[79]=b,t[80]=T,t[81]=E,t[82]=p):p=t[82];let D;t[83]===n.action.kind?D=t[84]:(D=n.action.kind===`browser_automation`?(0,$.jsx)(w,{className:`size-4`,"aria-hidden":!0}):n.action.kind===`task_command`?(0,$.jsx)(M,{className:`size-4`,"aria-hidden":!0}):(0,$.jsx)(U,{className:`size-4`,"aria-hidden":!0}),t[83]=n.action.kind,t[84]=D);let O=r.info.action,k;t[85]!==n.action||t[86]!==r?(k=Yt(n.action,r),t[85]=n.action,t[86]=r,t[87]=k):k=t[87],t[88]!==r.info.action||t[89]!==D||t[90]!==k?(m=(0,$.jsx)(En,{icon:D,label:O,value:k}),t[88]=r.info.action,t[89]=D,t[90]=k,t[91]=m):m=t[91],s=En,t[92]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t[92]=c):c=t[92],l=r.info.permission,u=r.safety[e],d=Cn(e,r),t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_}else s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14];let v;t[93]!==s||t[94]!==c||t[95]!==l||t[96]!==u||t[97]!==d?(v=(0,$.jsx)(s,{icon:c,label:l,value:u,description:d}),t[93]=s,t[94]=c,t[95]=l,t[96]=u,t[97]=d,t[98]=v):v=t[98];let b;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(I,{className:`size-4`,"aria-hidden":!0}),t[99]=b):b=t[99];let S;t[100]!==n.projectId||t[101]!==r.info.noProject||t[102]!==o?(S=o.find(e=>e.id===n.projectId)?.name??r.info.noProject,t[100]=n.projectId,t[101]=r.info.noProject,t[102]=o,t[103]=S):S=t[103];let C;t[104]!==r.info.project||t[105]!==S?(C=(0,$.jsx)(En,{icon:b,label:r.info.project,value:S}),t[104]=r.info.project,t[105]=S,t[106]=C):C=t[106];let T;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[107]=T):T=t[107];let E=n.conversationMode===`continuous`?r.info.continuousConversation:r.info.newConversation,O;t[108]!==r.info.conversation||t[109]!==E?(O=(0,$.jsx)(En,{icon:T,label:r.info.conversation,value:E}),t[108]=r.info.conversation,t[109]=E,t[110]=O):O=t[110];let k;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(j,{className:`size-4`,"aria-hidden":!0}),t[111]=k):k=t[111];let A=n.delivery.notificationPolicy===`all`?r.info.notifyAll:n.delivery.notificationPolicy===`none`?r.info.notifyNone:r.info.notifyAttention,N;t[112]!==r.info.notifications||t[113]!==A?(N=(0,$.jsx)(En,{icon:k,label:r.info.notifications,value:A}),t[112]=r.info.notifications,t[113]=A,t[114]=N):N=t[114];let P;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(y,{className:`size-4`,"aria-hidden":!0}),t[115]=P):P=t[115];let F=r.info.lastRun,L;t[116]!==n||t[117]!==r||t[118]!==a?(L=ze(n,r,a),t[116]=n,t[117]=r,t[118]=a,t[119]=L):L=t[119];let R=n.state.lastRunStatus===`failed`||n.state.lastRunStatus===`timeout`?`danger`:`default`,z;t[120]!==r.info.lastRun||t[121]!==L||t[122]!==R?(z=(0,$.jsx)(En,{icon:P,label:F,value:L,valueTone:R}),t[120]=r.info.lastRun,t[121]=L,t[122]=R,t[123]=z):z=t[123];let te;t[124]!==n.state.consecutiveFailures||t[125]!==n.state.lastError||t[126]!==r.dashboard?(te=n.state.consecutiveFailures?(0,$.jsxs)(`div`,{className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-700 dark:text-red-300`,children:[r.dashboard.failures,`:`,n.state.consecutiveFailures,n.state.lastError?(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs`,children:n.state.lastError}):null]}):n.state.lastError?(0,$.jsx)(`p`,{className:`break-words text-sm text-red-700 dark:text-red-300`,children:n.state.lastError}):null,t[124]=n.state.consecutiveFailures,t[125]=n.state.lastError,t[126]=r.dashboard,t[127]=te):te=t[127];let ne;t[128]!==r.info.technicalDetails||t[129]!==_?(ne=_.length>0?(0,$.jsxs)(`details`,{className:`group border-t border-edge-subtle pt-3`,children:[(0,$.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 text-sm text-fg-muted outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,$.jsx)(`span`,{children:r.info.technicalDetails}),(0,$.jsx)(D,{className:`size-4 transition-transform group-open:rotate-180`,"aria-hidden":!0})]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-2`,children:_.map(Tn)})]}):null,t[128]=r.info.technicalDetails,t[129]=_,t[130]=ne):ne=t[130];let re;t[131]!==v||t[132]!==C||t[133]!==O||t[134]!==N||t[135]!==z||t[136]!==te||t[137]!==ne||t[138]!==f||t[139]!==p||t[140]!==m?(re=(0,$.jsxs)(`div`,{className:f,children:[p,m,v,C,O,N,z,te,ne]}),t[131]=v,t[132]=C,t[133]=O,t[134]=N,t[135]=z,t[136]=te,t[137]=ne,t[138]=f,t[139]=p,t[140]=m,t[141]=re):re=t[141];let ie;return t[142]!==re||t[143]!==h||t[144]!==g?(ie=(0,$.jsxs)(`aside`,{className:h,children:[g,re]}),t[142]=re,t[143]=h,t[144]=g,t[145]=ie):ie=t[145],ie}function Tn(e){return(0,$.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e.label}),(0,$.jsx)(`span`,{className:`break-all font-mono text-xs text-fg-muted`,children:e.value})]},`${e.label}:${e.value}`)}function En(e){let t=(0,st.c)(19),{icon:n,label:r,value:i,description:a,descriptionTitle:o,valueTone:s}=e,c=s===void 0?`default`:s,l;t[0]===n?l=t[1]:(l=(0,$.jsx)(`span`,{className:`mt-0.5 text-fg-subtle`,children:n}),t[0]=n,t[1]=l);let u;t[2]===r?u=t[3]:(u=(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r}),t[2]=r,t[3]=u);let d=c===`danger`?`text-red-700 dark:text-red-300`:`text-fg`,f;t[4]===d?f=t[5]:(f=le(`mt-1 text-sm font-medium leading-5`,d),t[4]=d,t[5]=f);let p;t[6]!==f||t[7]!==i?(p=(0,$.jsx)(`div`,{className:f,children:i}),t[6]=f,t[7]=i,t[8]=p):p=t[8];let m;t[9]!==a||t[10]!==o?(m=a?(0,$.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,title:o,children:a}):null,t[9]=a,t[10]=o,t[11]=m):m=t[11];let h;t[12]!==u||t[13]!==p||t[14]!==m?(h=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,p,m]}),t[12]=u,t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==l||t[17]!==h?(g=(0,$.jsxs)(`div`,{className:`grid grid-cols-[1.25rem_1fr] gap-2.5`,children:[l,h]}),t[16]=l,t[17]=h,t[18]=g):g=t[18],g}function Dn(e){let t=(0,st.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(`div`,{className:`grid grid-cols-[5rem_1fr] gap-2`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function On(e){return e.endsWith(`.failed`)?`bg-red-500`:e.endsWith(`.completed`)?`bg-emerald-500`:e.endsWith(`.started`)?`bg-blue-500`:`bg-fg-muted`}function kn(e){let t=(0,st.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(`div`,{className:`text-xs font-medium uppercase text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,$.jsx)(`div`,{className:`mt-1 truncate text-sm text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function An(e){let t=(0,st.c)(8),{className:n,icon:r,title:i}=e,a;t[0]===n?a=t[1]:(a=le(`flex min-h-48 flex-col items-center justify-center text-fg-muted`,n),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,$.jsx)(`div`,{className:`mt-2 text-sm`,children:i}),t[2]=i,t[3]=o);let s;return t[4]!==r||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:a,children:[r,o]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function jn(e){let t=(0,st.c)(319),{form:n,labels:r,setForm:i,projects:a,browserAutomations:o,selectedBrowserAutomation:s,browserAutomationsLoading:c,agentOptions:l,agentsLoading:u,defaultAgentId:d,taskOptions:p,tasksLoading:m,language:h,projectLocked:g}=e,_=g!==void 0&&g,v=f(h).agentsSettings,y;t[0]===i?y=t[1]:(y=e=>i(t=>({...t,...e})),t[0]=i,t[1]=y);let b=y,x=Ve(n.intervalValue,n.intervalUnit),S=Date.now(),C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=[1,2,3],t[2]=C):C=t[2];let w;t[3]!==x||t[4]!==S||t[5]!==h?(w=C.map(e=>je(S+x*e,h,S)),t[3]=x,t[4]=S,t[5]=h,t[6]=w):w=t[6];let T=w,E;if(t[7]!==n.projectId||t[8]!==n.taskId||t[9]!==p){let e;t[11]!==n.projectId||t[12]!==n.taskId?(e=e=>e.id===n.taskId||e.phase!==`closed`&&(!n.projectId||e.projectId===n.projectId),t[11]=n.projectId,t[12]=n.taskId,t[13]=e):e=t[13],E=p.filter(e),t[7]=n.projectId,t[8]=n.taskId,t[9]=p,t[10]=E}else E=t[10];let O=E,j,M;t[14]!==d||t[15]!==n.actionMode||t[16]!==n.agentId||t[17]!==i?(j=()=>{n.actionMode!==`task_command`||n.agentId.trim()||!d||i(e=>({...e,agentId:d}))},M=[d,n.actionMode,n.agentId,i],t[14]=d,t[15]=n.actionMode,t[16]=n.agentId,t[17]=i,t[18]=j,t[19]=M):(j=t[18],M=t[19]),(0,Q.useEffect)(j,M);let N,P;t[20]!==o||t[21]!==n.actionMode||t[22]!==n.browserAutomationId||t[23]!==i?(N=()=>{if(n.actionMode!==`browser_automation`||n.browserAutomationId.trim())return;let e=o[0];e&&i(t=>({...t,browserAutomationId:e.id,browserAutomationInputs:at(e)}))},P=[o,n.actionMode,n.browserAutomationId,i],t[20]=o,t[21]=n.actionMode,t[22]=n.browserAutomationId,t[23]=i,t[24]=N,t[25]=P):(N=t[24],P=t[25]),(0,Q.useEffect)(N,P);let F;t[26]===b?F=t[27]:(F=e=>b({name:e.target.value}),t[26]=b,t[27]=F);let I;t[28]!==n.name||t[29]!==F?(I=(0,$.jsx)(`input`,{className:Pn,value:n.name,onChange:F}),t[28]=n.name,t[29]=F,t[30]=I):I=t[30];let L;t[31]!==r.form.name||t[32]!==I?(L=(0,$.jsx)(Z,{label:r.form.name,children:I}),t[31]=r.form.name,t[32]=I,t[33]=L):L=t[33];let R;t[34]!==n.actionMode||t[35]!==n.agentId||t[36]!==n.description||t[37]!==n.instruction||t[38]!==n.model||t[39]!==n.name||t[40]!==n.triggerMode||t[41]!==r.form.instruction||t[42]!==h||t[43]!==b?(R=n.actionMode===`agent`?(0,$.jsxs)(`section`,{"aria-label":r.form.instruction,className:`space-y-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r.form.instruction}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:h===`zh`?`写下希望它完成的事情,以及你期待收到的结果。`:`Describe what to do and the result you expect.`})]}),(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(Rt,{value:n.instruction,onApply:e=>b({instruction:e}),fieldId:`automation.instruction`,fieldLabel:r.form.instruction,scenario:`automation.instruction`,locale:h,context:{automationName:n.name,automationDescription:n.description,triggerMode:n.triggerMode,agentId:n.agentId,model:n.model},showLabel:!1})}),(0,$.jsx)(`textarea`,{"aria-label":r.form.instruction,className:le(Pn,`min-h-36 resize-y leading-6`),value:n.instruction,onChange:e=>b({instruction:e.target.value})})]}):null,t[34]=n.actionMode,t[35]=n.agentId,t[36]=n.description,t[37]=n.instruction,t[38]=n.model,t[39]=n.name,t[40]=n.triggerMode,t[41]=r.form.instruction,t[42]=h,t[43]=b,t[44]=R):R=t[44];let z;t[45]===r.form.trigger?z=t[46]:(z=(0,$.jsx)(Fn,{title:r.form.trigger}),t[45]=r.form.trigger,t[46]=z);let ee;t[47]===b?ee=t[48]:(ee=e=>b({triggerMode:e.target.value}),t[47]=b,t[48]=ee);let te;t[49]===r.trigger.manual?te=t[50]:(te=(0,$.jsx)(A,{value:`manual`,children:r.trigger.manual}),t[49]=r.trigger.manual,t[50]=te);let ne;t[51]===r.trigger.once?ne=t[52]:(ne=(0,$.jsx)(A,{value:`once`,children:r.trigger.once}),t[51]=r.trigger.once,t[52]=ne);let re;t[53]===r.trigger.daily?re=t[54]:(re=(0,$.jsx)(A,{value:`daily`,children:r.trigger.daily}),t[53]=r.trigger.daily,t[54]=re);let ie;t[55]===r.trigger.weekly?ie=t[56]:(ie=(0,$.jsx)(A,{value:`weekly`,children:r.trigger.weekly}),t[55]=r.trigger.weekly,t[56]=ie);let ae;t[57]===r.trigger.interval?ae=t[58]:(ae=(0,$.jsx)(A,{value:`interval`,children:r.trigger.interval}),t[57]=r.trigger.interval,t[58]=ae);let oe;t[59]===r.trigger.customCron?oe=t[60]:(oe=(0,$.jsx)(A,{value:`cron`,children:r.trigger.customCron}),t[59]=r.trigger.customCron,t[60]=oe);let B;t[61]===r.trigger.webhook?B=t[62]:(B=(0,$.jsx)(A,{value:`webhook`,children:r.trigger.webhook}),t[61]=r.trigger.webhook,t[62]=B);let se;t[63]===r.trigger.taskBlocked?se=t[64]:(se=(0,$.jsx)(A,{value:`taskBlocked`,children:r.trigger.taskBlocked}),t[63]=r.trigger.taskBlocked,t[64]=se);let V;t[65]===r.trigger.noteCreated?V=t[66]:(V=(0,$.jsx)(A,{value:`noteCreated`,children:r.trigger.noteCreated}),t[65]=r.trigger.noteCreated,t[66]=V);let H;t[67]===r.trigger.sessionUpdated?H=t[68]:(H=(0,$.jsx)(A,{value:`sessionUpdated`,children:r.trigger.sessionUpdated}),t[67]=r.trigger.sessionUpdated,t[68]=H);let ce;t[69]===r.trigger.customEvent?ce=t[70]:(ce=(0,$.jsx)(A,{value:`event`,children:r.trigger.customEvent}),t[69]=r.trigger.customEvent,t[70]=ce);let U;t[71]!==n.triggerMode||t[72]!==r.form.trigger||t[73]!==ee||t[74]!==te||t[75]!==ne||t[76]!==re||t[77]!==ie||t[78]!==ae||t[79]!==oe||t[80]!==B||t[81]!==se||t[82]!==V||t[83]!==H||t[84]!==ce?(U=(0,$.jsxs)(k,{"aria-label":r.form.trigger,className:Pn,value:n.triggerMode,onChange:ee,children:[te,ne,re,ie,ae,oe,B,se,V,H,ce]}),t[71]=n.triggerMode,t[72]=r.form.trigger,t[73]=ee,t[74]=te,t[75]=ne,t[76]=re,t[77]=ie,t[78]=ae,t[79]=oe,t[80]=B,t[81]=se,t[82]=V,t[83]=H,t[84]=ce,t[85]=U):U=t[85];let W;t[86]!==n.onceAt||t[87]!==n.triggerMode||t[88]!==r.form.onceAt||t[89]!==b?(W=n.triggerMode===`once`?(0,$.jsx)(Z,{label:r.form.onceAt,children:(0,$.jsx)(`input`,{className:Pn,type:`datetime-local`,value:n.onceAt,onChange:e=>b({onceAt:e.target.value})})}):null,t[86]=n.onceAt,t[87]=n.triggerMode,t[88]=r.form.onceAt,t[89]=b,t[90]=W):W=t[90];let G;t[91]!==n.time||t[92]!==n.triggerMode||t[93]!==n.weekday||t[94]!==r.form.day||t[95]!==r.form.time||t[96]!==r.weekdays||t[97]!==b?(G=n.triggerMode===`daily`||n.triggerMode===`weekly`?(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(Z,{label:r.form.time,children:(0,$.jsx)(Ye,{value:n.time,onChange:e=>b({time:e}),ariaLabel:r.form.time})}),n.triggerMode===`weekly`?(0,$.jsx)(Z,{label:r.form.day,children:(0,$.jsxs)(k,{className:Pn,value:n.weekday,onChange:e=>b({weekday:e.target.value}),children:[(0,$.jsx)(A,{value:`1`,children:r.weekdays.monday}),(0,$.jsx)(A,{value:`2`,children:r.weekdays.tuesday}),(0,$.jsx)(A,{value:`3`,children:r.weekdays.wednesday}),(0,$.jsx)(A,{value:`4`,children:r.weekdays.thursday}),(0,$.jsx)(A,{value:`5`,children:r.weekdays.friday}),(0,$.jsx)(A,{value:`6`,children:r.weekdays.saturday}),(0,$.jsx)(A,{value:`0`,children:r.weekdays.sunday})]})}):null]}):null,t[91]=n.time,t[92]=n.triggerMode,t[93]=n.weekday,t[94]=r.form.day,t[95]=r.form.time,t[96]=r.weekdays,t[97]=b,t[98]=G):G=t[98];let ue=n.triggerMode===`interval`?(0,$.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,$.jsx)(Z,{label:r.form.intervalEvery,children:(0,$.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,$.jsx)(`input`,{className:Pn,type:`number`,min:6e4/Ve(1,n.intervalUnit),step:`any`,inputMode:`decimal`,"aria-label":r.form.intervalEvery,value:n.intervalValue,onChange:e=>b({intervalValue:e.target.value})}),(0,$.jsxs)(k,{className:Pn,"aria-label":h===`zh`?`间隔单位`:`Interval unit`,value:n.intervalUnit,onChange:e=>{let t=e.target.value;b({intervalValue:Je(n.intervalValue,n.intervalUnit,t),intervalUnit:t})},children:[(0,$.jsx)(A,{value:`minute`,children:r.form.intervalUnits.minute}),(0,$.jsx)(A,{value:`hour`,children:r.form.intervalUnits.hour}),(0,$.jsx)(A,{value:`day`,children:r.form.intervalUnits.day}),(0,$.jsx)(A,{value:`week`,children:r.form.intervalUnits.week})]})]})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.form.commonIntervals}),(0,$.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Ke.map(e=>{let t=Ve(e.value,e.unit),n=t===x;return(0,$.jsx)(`button`,{type:`button`,"aria-pressed":n,className:le(`rounded-full border px-2.5 py-1 text-xs transition-colors`,n?`border-accent bg-accent/10 text-accent`:`border-edge-subtle text-fg-muted hover:border-edge hover:bg-surface-hover hover:text-fg`),onClick:()=>b({intervalValue:e.value,intervalUnit:e.unit}),children:Pe(t,h)},`${e.value}:${e.unit}`)})})]}),(0,$.jsxs)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2.5`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:Xe(x,h)}),(0,$.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:[r.form.nextThreeRuns,`:`,T.join(h===`zh`?`、`:`, `)]}),(0,$.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:r.form.fixedIntervalHint})]})]}):null,K;t[99]!==n.cronExpr||t[100]!==n.triggerMode||t[101]!==r.form.expression||t[102]!==b?(K=n.triggerMode===`cron`?(0,$.jsx)(Z,{label:r.form.expression,children:(0,$.jsx)(`input`,{className:Pn,value:n.cronExpr,onChange:e=>b({cronExpr:e.target.value})})}):null,t[99]=n.cronExpr,t[100]=n.triggerMode,t[101]=r.form.expression,t[102]=b,t[103]=K):K=t[103];let de;t[104]!==n.triggerMode||t[105]!==n.webhookSecretId||t[106]!==r.form.secretId||t[107]!==b?(de=n.triggerMode===`webhook`?(0,$.jsx)(Z,{label:r.form.secretId,children:(0,$.jsx)(`input`,{className:Pn,value:n.webhookSecretId,onChange:e=>b({webhookSecretId:e.target.value})})}):null,t[104]=n.triggerMode,t[105]=n.webhookSecretId,t[106]=r.form.secretId,t[107]=b,t[108]=de):de=t[108];let q;t[109]!==n.eventPayloadMatch||t[110]!==n.eventSource||t[111]!==n.eventType||t[112]!==n.triggerMode||t[113]!==r.form.eventPayloadMatch||t[114]!==r.form.eventSource||t[115]!==r.form.eventType||t[116]!==r.form.invalidJsonObject||t[117]!==b?(q=n.triggerMode===`event`?(0,$.jsxs)(`div`,{className:`grid gap-3 rounded-lg border border-edge-subtle bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(Z,{label:r.form.eventType,children:(0,$.jsx)(`input`,{className:Pn,value:n.eventType,onChange:e=>b({eventType:e.target.value})})}),(0,$.jsx)(Z,{label:r.form.eventSource,children:(0,$.jsx)(`input`,{className:Pn,value:n.eventSource,onChange:e=>b({eventSource:e.target.value})})})]}),(0,$.jsxs)(Z,{label:r.form.eventPayloadMatch,children:[(0,$.jsx)(`textarea`,{className:le(Pn,`min-h-24 resize-y font-mono text-xs`),value:n.eventPayloadMatch,onChange:e=>b({eventPayloadMatch:e.target.value}),placeholder:`{
8
- "status": "blocked"
9
- }`}),Le(n.eventPayloadMatch)?null:(0,$.jsx)(`span`,{className:`text-xs text-red-700 dark:text-red-300`,children:r.form.invalidJsonObject})]})]}):null,t[109]=n.eventPayloadMatch,t[110]=n.eventSource,t[111]=n.eventType,t[112]=n.triggerMode,t[113]=r.form.eventPayloadMatch,t[114]=r.form.eventSource,t[115]=r.form.eventType,t[116]=r.form.invalidJsonObject,t[117]=b,t[118]=q):q=t[118];let fe;t[119]!==n||t[120]!==h||t[121]!==b?(fe=(0,$.jsx)(Ne,{form:n,onChange:b,language:h}),t[119]=n,t[120]=h,t[121]=b,t[122]=fe):fe=t[122];let pe;t[123]!==z||t[124]!==U||t[125]!==W||t[126]!==G||t[127]!==ue||t[128]!==K||t[129]!==de||t[130]!==q||t[131]!==fe?(pe=(0,$.jsxs)(`section`,{className:`grid gap-3 rounded-xl border border-edge p-4`,children:[z,U,W,G,ue,K,de,q,fe]}),t[123]=z,t[124]=U,t[125]=W,t[126]=G,t[127]=ue,t[128]=K,t[129]=de,t[130]=q,t[131]=fe,t[132]=pe):pe=t[132];let me=h===`zh`?`执行设置`:`Execution settings`,he;t[133]!==n.actionMode||t[134]!==r?(he=Xt(n.actionMode,r),t[133]=n.actionMode,t[134]=r,t[135]=he):he=t[135];let J;t[136]===he?J=t[137]:(J=(0,$.jsx)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:he}),t[136]=he,t[137]=J);let ge;t[138]!==me||t[139]!==J?(ge=(0,$.jsx)(`summary`,{className:`flex cursor-pointer items-center justify-between gap-3 px-4 py-3 text-sm font-medium text-fg focus-visible:outline-accent`,children:(0,$.jsxs)(`span`,{children:[me,J]})}),t[138]=me,t[139]=J,t[140]=ge):ge=t[140];let _e;t[141]===b?_e=t[142]:(_e=e=>b({description:e.target.value}),t[141]=b,t[142]=_e);let ve;t[143]!==n.description||t[144]!==_e?(ve=(0,$.jsx)(`input`,{className:Pn,value:n.description,onChange:_e}),t[143]=n.description,t[144]=_e,t[145]=ve):ve=t[145];let ye;t[146]!==r.form.description||t[147]!==ve?(ye=(0,$.jsx)(Z,{label:r.form.description,children:ve}),t[146]=r.form.description,t[147]=ve,t[148]=ye):ye=t[148];let be;t[149]!==n.projectId||t[150]!==r.form.noProject||t[151]!==r.form.project||t[152]!==_||t[153]!==a||t[154]!==b?(be=_?null:(0,$.jsx)(Z,{label:r.form.project,children:(0,$.jsxs)(k,{className:Pn,value:n.projectId,onChange:e=>b({projectId:e.target.value}),children:[(0,$.jsx)(A,{value:``,children:r.form.noProject}),a.map(Nn)]})}),t[149]=n.projectId,t[150]=r.form.noProject,t[151]=r.form.project,t[152]=_,t[153]=a,t[154]=b,t[155]=be):be=t[155];let xe;t[156]!==n.timeoutSeconds||t[157]!==b?(xe=e=>{let t=e.target.value,r=Number.parseInt(n.timeoutSeconds,10);b({actionMode:t,...r===600||r===1800?{timeoutSeconds:t===`browser_automation`?`600`:`1800`}:{},...t===`browser_automation`||t===`task_command`?{safetyMode:`auto_apply`}:{}})},t[156]=n.timeoutSeconds,t[157]=b,t[158]=xe):xe=t[158];let Se;t[159]===r.action.runAgent?Se=t[160]:(Se=(0,$.jsx)(A,{value:`agent`,children:r.action.runAgent}),t[159]=r.action.runAgent,t[160]=Se);let Ce;t[161]===r.action.runTask?Ce=t[162]:(Ce=(0,$.jsx)(A,{value:`task_command`,children:r.action.runTask}),t[161]=r.action.runTask,t[162]=Ce);let we=h===`zh`?`浏览器自动化`:`Browser automation`,Y;t[163]===we?Y=t[164]:(Y=(0,$.jsx)(A,{value:`browser_automation`,children:we}),t[163]=we,t[164]=Y);let Te;t[165]!==n.actionMode||t[166]!==r.form.action||t[167]!==xe||t[168]!==Se||t[169]!==Ce||t[170]!==Y?(Te=(0,$.jsxs)(k,{className:Pn,"aria-label":r.form.action,value:n.actionMode,onChange:xe,children:[Se,Ce,Y]}),t[165]=n.actionMode,t[166]=r.form.action,t[167]=xe,t[168]=Se,t[169]=Ce,t[170]=Y,t[171]=Te):Te=t[171];let Ee=n.actionMode===`browser_automation`?null:(0,$.jsx)(Z,{label:r.form.agent,children:(0,$.jsxs)(k,{className:Pn,value:n.agentId,onChange:e=>b({agentId:e.target.value}),children:[(0,$.jsx)(A,{value:``,children:u?r.form.loadingAgents:r.form.defaultAgent}),l.map(e=>(0,$.jsx)(A,{value:e.id,children:Qe(e,v)},e.id))]})}),X;t[172]!==O||t[173]!==o||t[174]!==c||t[175]!==n.actionMode||t[176]!==n.browserAutomationId||t[177]!==n.browserAutomationInputs||t[178]!==n.model||t[179]!==n.taskId||t[180]!==r.form.defaultModel||t[181]!==r.form.loadingTasks||t[182]!==r.form.model||t[183]!==r.form.modelHint||t[184]!==r.form.noModels||t[185]!==r.form.noTasks||t[186]!==r.form.searchModels||t[187]!==r.form.task||t[188]!==r.form.taskClosed||t[189]!==r.form.taskContextHint||t[190]!==h||t[191]!==s||t[192]!==m||t[193]!==b?(X=n.actionMode===`agent`?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(Z,{label:r.form.model,children:[(0,$.jsx)(ke,{value:n.model,onChange:e=>b({model:e}),placeholder:r.form.defaultModel,emptyLabel:r.form.defaultModel,searchPlaceholder:r.form.searchModels,noMatches:r.form.noModels,allowEmpty:!0,showProviderSettingsFooter:!0,contentAlign:`start`,className:`w-full`,ariaLabel:r.form.model}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:r.form.modelHint})]})}):n.actionMode===`task_command`?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(Z,{label:r.form.task,children:[(0,$.jsxs)(k,{className:Pn,value:n.taskId,onChange:e=>b({taskId:e.target.value}),disabled:m||O.length===0,children:[m?(0,$.jsx)(A,{value:``,children:r.form.loadingTasks}):null,!m&&O.length===0?(0,$.jsx)(A,{value:``,children:r.form.noTasks}):null,O.map(e=>(0,$.jsxs)(A,{value:e.id,disabled:e.phase===`closed`,children:[e.title,e.phase===`closed`?` · ${r.form.taskClosed}`:``]},e.id))]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r.form.taskContextHint})]})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Z,{label:h===`zh`?`浏览器自动化`:`Browser automation`,children:(0,$.jsxs)(k,{className:Pn,value:n.browserAutomationId,onChange:e=>{let t=o.find(t=>t.id===e.target.value);b({browserAutomationId:e.target.value,browserAutomationInputs:t?at(t):{}})},disabled:c||o.length===0,children:[o.length===0?(0,$.jsx)(A,{value:``,children:h===`zh`?`没有已启用的浏览器自动化`:`No enabled browser automations`}):null,o.map(Mn)]})}),s&&Object.keys(s.inputs).length>0?(0,$.jsx)(Z,{label:h===`zh`?`运行时填写`:`Run inputs`,children:(0,$.jsx)(ot,{automation:s,values:n.browserAutomationInputs,language:h,onChange:e=>b({browserAutomationInputs:e})})}):null]}),t[172]=O,t[173]=o,t[174]=c,t[175]=n.actionMode,t[176]=n.browserAutomationId,t[177]=n.browserAutomationInputs,t[178]=n.model,t[179]=n.taskId,t[180]=r.form.defaultModel,t[181]=r.form.loadingTasks,t[182]=r.form.model,t[183]=r.form.modelHint,t[184]=r.form.noModels,t[185]=r.form.noTasks,t[186]=r.form.searchModels,t[187]=r.form.task,t[188]=r.form.taskClosed,t[189]=r.form.taskContextHint,t[190]=h,t[191]=s,t[192]=m,t[193]=b,t[194]=X):X=t[194];let De;t[195]!==ye||t[196]!==be||t[197]!==Te||t[198]!==Ee||t[199]!==X?(De=(0,$.jsxs)(`div`,{className:`grid gap-4 border-t border-edge p-4`,children:[ye,be,Te,Ee,X]}),t[195]=ye,t[196]=be,t[197]=Te,t[198]=Ee,t[199]=X,t[200]=De):De=t[200];let Oe;t[201]!==ge||t[202]!==De?(Oe=(0,$.jsxs)(`details`,{className:`group rounded-xl border border-edge`,children:[ge,De]}),t[201]=ge,t[202]=De,t[203]=Oe):Oe=t[203];let Ae;t[204]===r.form.advancedDescription?Ae=t[205]:(Ae=(0,$.jsx)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:r.form.advancedDescription}),t[204]=r.form.advancedDescription,t[205]=Ae);let Me;t[206]!==r.form.advanced||t[207]!==Ae?(Me=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,$.jsxs)(`span`,{children:[r.form.advanced,Ae]})}),t[206]=r.form.advanced,t[207]=Ae,t[208]=Me):Me=t[208];let Fe;t[209]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,$.jsx)(D,{className:`size-4 transition-transform group-open:rotate-180`}),t[209]=Fe):Fe=t[209];let Ie;t[210]===Me?Ie=t[211]:(Ie=(0,$.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[Me,Fe]}),t[210]=Me,t[211]=Ie);let Re;t[212]!==n.actionMode||t[213]!==n.safetyMode||t[214]!==r.form.safety||t[215]!==r.safety||t[216]!==b?(Re=n.actionMode!==`browser_automation`&&n.actionMode!==`task_command`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fn,{title:r.form.safety}),(0,$.jsxs)(Z,{label:r.form.safety,children:[(0,$.jsxs)(k,{className:Pn,value:n.safetyMode,onChange:e=>{let t=e.target.value;b({safetyMode:t})},children:[(0,$.jsx)(A,{value:`suggest_only`,children:r.safety.suggest_only}),(0,$.jsx)(A,{value:`ask_before_apply`,children:r.safety.ask_before_apply}),(0,$.jsx)(A,{value:`auto_apply`,children:r.safety.auto_apply})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.safetyMode===`suggest_only`?r.safety.suggestOnlyDescription:n.safetyMode===`ask_before_apply`?r.safety.askBeforeApplyDescription:r.safety.autoApplyDescription})]})]}):null,t[212]=n.actionMode,t[213]=n.safetyMode,t[214]=r.form.safety,t[215]=r.safety,t[216]=b,t[217]=Re):Re=t[217];let ze;t[218]===r.form.results?ze=t[219]:(ze=(0,$.jsx)(Fn,{title:r.form.results}),t[218]=r.form.results,t[219]=ze);let Be;t[220]===b?Be=t[221]:(Be=e=>b({conversationMode:e.target.value}),t[220]=b,t[221]=Be);let He;t[222]===r.form.newConversation?He=t[223]:(He=(0,$.jsx)(A,{value:`new_session`,children:r.form.newConversation}),t[222]=r.form.newConversation,t[223]=He);let Ue;t[224]===r.form.continuousConversation?Ue=t[225]:(Ue=(0,$.jsx)(A,{value:`continuous`,children:r.form.continuousConversation}),t[224]=r.form.continuousConversation,t[225]=Ue);let We;t[226]!==n.conversationMode||t[227]!==Be||t[228]!==He||t[229]!==Ue?(We=(0,$.jsxs)(k,{className:Pn,value:n.conversationMode,onChange:Be,children:[He,Ue]}),t[226]=n.conversationMode,t[227]=Be,t[228]=He,t[229]=Ue,t[230]=We):We=t[230];let Ge;t[231]!==r.form.conversation||t[232]!==We?(Ge=(0,$.jsx)(Z,{label:r.form.conversation,children:We}),t[231]=r.form.conversation,t[232]=We,t[233]=Ge):Ge=t[233];let qe;t[234]===b?qe=t[235]:(qe=e=>b({notificationPolicy:e.target.value}),t[234]=b,t[235]=qe);let Ze;t[236]===r.form.notifyAttention?Ze=t[237]:(Ze=(0,$.jsx)(A,{value:`attention`,children:r.form.notifyAttention}),t[236]=r.form.notifyAttention,t[237]=Ze);let $e;t[238]===r.form.notifyAll?$e=t[239]:($e=(0,$.jsx)(A,{value:`all`,children:r.form.notifyAll}),t[238]=r.form.notifyAll,t[239]=$e);let et;t[240]===r.form.notifyNone?et=t[241]:(et=(0,$.jsx)(A,{value:`none`,children:r.form.notifyNone}),t[240]=r.form.notifyNone,t[241]=et);let tt;t[242]!==n.notificationPolicy||t[243]!==qe||t[244]!==Ze||t[245]!==$e||t[246]!==et?(tt=(0,$.jsxs)(k,{className:Pn,value:n.notificationPolicy,onChange:qe,children:[Ze,$e,et]}),t[242]=n.notificationPolicy,t[243]=qe,t[244]=Ze,t[245]=$e,t[246]=et,t[247]=tt):tt=t[247];let nt;t[248]!==r.form.notifications||t[249]!==tt?(nt=(0,$.jsx)(Z,{label:r.form.notifications,children:tt}),t[248]=r.form.notifications,t[249]=tt,t[250]=nt):nt=t[250];let rt;t[251]===b?rt=t[252]:(rt=e=>b({resultWebhookEndpoint:e.target.value}),t[251]=b,t[252]=rt);let it;t[253]!==n.resultWebhookEndpoint||t[254]!==r.form.resultWebhookEndpoint||t[255]!==rt?(it=(0,$.jsx)(`input`,{"aria-label":r.form.resultWebhookEndpoint,className:Pn,value:n.resultWebhookEndpoint,onChange:rt}),t[253]=n.resultWebhookEndpoint,t[254]=r.form.resultWebhookEndpoint,t[255]=rt,t[256]=it):it=t[256];let ct;t[257]===b?ct=t[258]:(ct=e=>b({resultWebhookSecretId:e.target.value}),t[257]=b,t[258]=ct);let lt;t[259]!==n.resultWebhookSecretId||t[260]!==r.form.resultWebhookSecretId||t[261]!==ct?(lt=(0,$.jsx)(`input`,{"aria-label":r.form.resultWebhookSecretId,className:Pn,value:n.resultWebhookSecretId,onChange:ct,placeholder:r.form.resultWebhookSecretId}),t[259]=n.resultWebhookSecretId,t[260]=r.form.resultWebhookSecretId,t[261]=ct,t[262]=lt):lt=t[262];let ut;t[263]!==it||t[264]!==lt?(ut=(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[it,lt]}),t[263]=it,t[264]=lt,t[265]=ut):ut=t[265];let dt;t[266]!==r.form.resultWebhookEndpoint||t[267]!==ut?(dt=(0,$.jsx)(Z,{label:r.form.resultWebhookEndpoint,children:ut}),t[266]=r.form.resultWebhookEndpoint,t[267]=ut,t[268]=dt):dt=t[268];let ft;t[269]===r.form.reliability?ft=t[270]:(ft=(0,$.jsx)(Fn,{title:r.form.reliability}),t[269]=r.form.reliability,t[270]=ft);let pt;t[271]===b?pt=t[272]:(pt=e=>b({timeoutSeconds:e.target.value}),t[271]=b,t[272]=pt);let mt;t[273]!==n.timeoutSeconds||t[274]!==pt?(mt=(0,$.jsx)(`input`,{className:Pn,inputMode:`numeric`,value:n.timeoutSeconds,onChange:pt}),t[273]=n.timeoutSeconds,t[274]=pt,t[275]=mt):mt=t[275];let ht;t[276]!==r.form.timeoutSeconds||t[277]!==mt?(ht=(0,$.jsx)(Z,{label:r.form.timeoutSeconds,children:mt}),t[276]=r.form.timeoutSeconds,t[277]=mt,t[278]=ht):ht=t[278];let gt;t[279]===b?gt=t[280]:(gt=e=>b({disableAfterFailures:e.target.value}),t[279]=b,t[280]=gt);let _t;t[281]!==n.disableAfterFailures||t[282]!==gt?(_t=(0,$.jsx)(`input`,{className:Pn,inputMode:`numeric`,value:n.disableAfterFailures,onChange:gt}),t[281]=n.disableAfterFailures,t[282]=gt,t[283]=_t):_t=t[283];let vt;t[284]!==r.form.disableAfterFailures||t[285]!==_t?(vt=(0,$.jsx)(Z,{label:r.form.disableAfterFailures,children:_t}),t[284]=r.form.disableAfterFailures,t[285]=_t,t[286]=vt):vt=t[286];let yt;t[287]!==ht||t[288]!==vt?(yt=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[ht,vt]}),t[287]=ht,t[288]=vt,t[289]=yt):yt=t[289];let bt;t[290]===r.form.effectivePolicy?bt=t[291]:(bt=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:r.form.effectivePolicy}),t[290]=r.form.effectivePolicy,t[291]=bt);let xt=n.timeoutSeconds||`—`,St;t[292]!==r.form.executionDeadline||t[293]!==xt?(St=(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[r.form.executionDeadline,`: `,xt,`s`]}),t[292]=r.form.executionDeadline,t[293]=xt,t[294]=St):St=t[294];let Ct;t[295]===r.form.downstreamTimeoutHint?Ct=t[296]:(Ct=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-relaxed text-fg-subtle`,children:r.form.downstreamTimeoutHint}),t[295]=r.form.downstreamTimeoutHint,t[296]=Ct);let wt;t[297]!==bt||t[298]!==St||t[299]!==Ct?(wt=(0,$.jsxs)(`div`,{className:`rounded-lg border border-edge bg-surface-inset/40 px-3 py-2.5`,children:[bt,St,Ct]}),t[297]=bt,t[298]=St,t[299]=Ct,t[300]=wt):wt=t[300];let Tt;t[301]!==Re||t[302]!==ze||t[303]!==Ge||t[304]!==nt||t[305]!==dt||t[306]!==ft||t[307]!==yt||t[308]!==wt?(Tt=(0,$.jsxs)(`div`,{className:`grid gap-4 border-t border-edge-subtle p-4`,children:[Re,ze,Ge,nt,dt,ft,yt,wt]}),t[301]=Re,t[302]=ze,t[303]=Ge,t[304]=nt,t[305]=dt,t[306]=ft,t[307]=yt,t[308]=wt,t[309]=Tt):Tt=t[309];let Et;t[310]!==Ie||t[311]!==Tt?(Et=(0,$.jsxs)(`details`,{className:`group rounded-xl border border-edge-subtle bg-surface-base`,children:[Ie,Tt]}),t[310]=Ie,t[311]=Tt,t[312]=Et):Et=t[312];let Dt;return t[313]!==L||t[314]!==R||t[315]!==pe||t[316]!==Oe||t[317]!==Et?(Dt=(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`grid gap-4`,children:[L,R,pe,Oe,Et]})}),t[313]=L,t[314]=R,t[315]=pe,t[316]=Oe,t[317]=Et,t[318]=Dt):Dt=t[318],Dt}function Mn(e){return(0,$.jsx)(A,{value:e.id,children:e.name},e.id)}function Nn(e){return(0,$.jsx)(A,{value:e.id,children:e.name},e.id)}var Pn=`min-h-11 w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-base sm:min-h-0 sm:text-sm text-fg outline-none focus:border-accent`;function Fn(e){let t=(0,st.c)(12),{title:n,step:r,description:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,$.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent-fg`,children:r}):(0,$.jsx)(I,{className:`mt-0.5 size-4 text-fg-muted`}),t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[2]=n,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-muted`,children:i}):null,t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,$.jsxs)(`div`,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-start gap-2 pt-2`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}export{un as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]);export{t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n,o as r}from"./locale-store-DGtk-KSF.js";import{t as i}from"./popover-select-CEMWIrtY.js";function a(e){return{id:e.id,name:e.definition.name,description:e.definition.description,verified:e.verified,revision:e.revision,enabled:e.status===`enabled`,risk:e.definition.risk,domains:e.definition.allowedDomains,inputs:e.definition.inputs,createdAtMs:e.createdAtMs,updatedAtMs:e.updatedAtMs}}var o={recordingAvailability:()=>r(n(`/api/browser/recordings/availability`)),recording:(e,t)=>r(n(`/api/browser/recordings/control`),{method:`POST`,body:JSON.stringify({operation:e,endpointId:t})}),list:async()=>({automations:(await r(n(`/api/browser/automations`))).automations.map(a)}),setEnabled:async(e,t)=>({automation:a((await r(n(`/api/browser/automations/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({status:t?`enabled`:`disabled`})})).automation)}),remove:e=>r(n(`/api/browser/automations/${encodeURIComponent(e)}`),{method:`DELETE`}),run:(e,t)=>r(n(`/api/browser/automations/${encodeURIComponent(e)}/run`),{method:`POST`,body:JSON.stringify({inputs:t,clientRequestId:crypto.randomUUID()})}),getRun:e=>r(n(`/api/browser/automation-runs/${encodeURIComponent(e)}`)),listRuns:e=>r(n(`/api/browser/automation-runs?automationId=${encodeURIComponent(e)}`)),cancel:e=>r(n(`/api/browser/automation-runs/${encodeURIComponent(e)}/cancel`),{method:`POST`})};function s(e){return Object.fromEntries(Object.entries(e.inputs).flatMap(([e,t])=>t.default===void 0?[]:[[e,t.default]]))}function c(e,t){return!Object.entries(e.inputs).some(([e,n])=>n.required&&(t[e]===void 0||t[e]===``))}var l=e(),u=t();function d(e){let t=(0,l.c)(53),{name:n,input:r,value:a,yes:o,no:s,onChange:c}=e,d;t[0]!==r.description||t[1]!==n?(d=r.description?.trim()||n,t[0]=r.description,t[1]=n,t[2]=d):d=t[2];let p=d;if(r.choices?.length){let e;t[3]===r.choices?e=t[4]:(e=r.choices.map(f),t[3]=r.choices,t[4]=e);let n=e,o=r.required?` *`:``,s;t[5]!==p||t[6]!==o?(s=(0,u.jsxs)(`span`,{className:`mb-1.5 block font-medium`,children:[p,o]}),t[5]=p,t[6]=o,t[7]=s):s=t[7];let l;t[8]===a?l=t[9]:(l=a===void 0?``:JSON.stringify(a),t[8]=a,t[9]=l);let d;t[10]===c?d=t[11]:(d=e=>c(JSON.parse(e)),t[10]=c,t[11]=d);let m;t[12]!==p||t[13]!==n||t[14]!==l||t[15]!==d?(m=(0,u.jsx)(i,{value:l,options:n,placeholder:p,onChange:d}),t[12]=p,t[13]=n,t[14]=l,t[15]=d,t[16]=m):m=t[16];let h;return t[17]!==s||t[18]!==m?(h=(0,u.jsxs)(`label`,{className:`block text-sm text-fg`,children:[s,m]}),t[17]=s,t[18]=m,t[19]=h):h=t[19],h}if(r.type===`boolean`){let e=r.required?` *`:``,n;t[20]!==p||t[21]!==e?(n=(0,u.jsxs)(`span`,{className:`mb-1.5 block font-medium`,children:[p,e]}),t[20]=p,t[21]=e,t[22]=n):n=t[22];let l=typeof a==`boolean`?String(a):``,d;t[23]===o?d=t[24]:(d={value:`true`,label:o},t[23]=o,t[24]=d);let f;t[25]===s?f=t[26]:(f={value:`false`,label:s},t[25]=s,t[26]=f);let m;t[27]!==d||t[28]!==f?(m=[d,f],t[27]=d,t[28]=f,t[29]=m):m=t[29];let h;t[30]===c?h=t[31]:(h=e=>c(e===`true`),t[30]=c,t[31]=h);let g;t[32]!==p||t[33]!==l||t[34]!==m||t[35]!==h?(g=(0,u.jsx)(i,{value:l,options:m,placeholder:p,onChange:h}),t[32]=p,t[33]=l,t[34]=m,t[35]=h,t[36]=g):g=t[36];let _;return t[37]!==n||t[38]!==g?(_=(0,u.jsxs)(`label`,{className:`block text-sm text-fg`,children:[n,g]}),t[37]=n,t[38]=g,t[39]=_):_=t[39],_}let m=r.type===`number`,h=r.required?` *`:``,g;t[40]!==p||t[41]!==h?(g=(0,u.jsxs)(`span`,{className:`mb-1.5 block font-medium`,children:[p,h]}),t[40]=p,t[41]=h,t[42]=g):g=t[42];let _=m?`number`:`text`,v=a===void 0?``:String(a),y;t[43]!==m||t[44]!==c?(y=e=>c(m?e.target.value===``?void 0:Number(e.target.value):e.target.value),t[43]=m,t[44]=c,t[45]=y):y=t[45];let b;t[46]!==_||t[47]!==v||t[48]!==y?(b=(0,u.jsx)(`input`,{type:_,value:v,onChange:y,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg outline-none focus:border-accent`}),t[46]=_,t[47]=v,t[48]=y,t[49]=b):b=t[49];let x;return t[50]!==g||t[51]!==b?(x=(0,u.jsxs)(`label`,{className:`block text-sm text-fg`,children:[g,b]}),t[50]=g,t[51]=b,t[52]=x):x=t[52],x}function f(e){return{value:JSON.stringify(e),label:String(e)}}function p(e){let t=(0,l.c)(7),{automation:n,values:r,language:i,onChange:a}=e,o;t[0]===n.inputs?o=t[1]:(o=Object.entries(n.inputs),t[0]=n.inputs,t[1]=o);let s;return t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==r?(s=(0,u.jsx)(`div`,{className:`grid gap-4`,children:o.map(e=>{let[t,n]=e;return(0,u.jsx)(d,{name:t,input:n,value:r[t],yes:i===`zh`?`是`:`Yes`,no:i===`zh`?`否`:`No`,onChange:e=>a({...r,[t]:e})},t)})}),t[2]=i,t[3]=a,t[4]=o,t[5]=r,t[6]=s):s=t[6],s}export{o as i,c as n,s as r,p as t};
@@ -1,3 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{u as r}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i,n as a,o}from"./locale-store-DGtk-KSF.js";import{t as s}from"./bot-DjLkhyZL.js";import{t as c}from"./popover-select-CEMWIrtY.js";import{t as l}from"./circle-pause-CN9jYH2s.js";import{n as u,t as d}from"./video-B6V0GFss.js";import{t as f}from"./clock-3-DnrAnuyZ.js";import{t as p}from"./earth-BMhZtzcj.js";import{t as ee}from"./loader-circle-CifKLtgG.js";import{t as m}from"./pencil-DmIY3Oa-.js";import{t as h}from"./play-kxZvpBg8.js";import{t as g}from"./puzzle-BptcPjKI.js";import{t as _}from"./square-DMK_fB-3.js";import{t as v}from"./trash-2-DusmjVPV.js";import{t as y}from"./x-B_N4OPjy.js";import{t as b}from"./skeleton-BI5TyibZ.js";import{t as x}from"./button-Cc4hUNTt.js";import{t as S}from"./page-header-store-f8XcAs9b.js";import{a as C,r as w}from"./browser-control-api-Bdr2nGCE.js";import{i as T,n as E,r as D,t as O}from"./browser-automation-inputs-DADzEaqe.js";var k=e(t(),1),A=n();function j({availability:e,endpointId:t,recordingBusy:n,onSelect:s,onRefresh:l,onStart:u,onClose:d}){let f=a(e=>e.language)===`zh`,p=r(),[m,h]=(0,k.useState)(),[_,v]=(0,k.useState)(!0),[S,T]=(0,k.useState)(!1),[E,D]=(0,k.useState)(``),[O,j]=(0,k.useState)(!1),M=e.endpoints.length>0,N=e.state===`update_required`;(0,k.useEffect)(()=>{let e=!1;if(M){v(!1);return}return o(i(`/api/browser/extension-status`)).then(t=>{e||h(t)}).catch(t=>{e||D(t instanceof Error?t.message:String(t))}).finally(()=>{e||v(!1)}),()=>{e=!0}},[M]);let P=async()=>{T(!0),D(``);try{(N||!m?.artifacts?.installed||m.artifacts.needsRefresh)&&await w(N||!!m?.artifacts?.needsRefresh),await C(m?.artifacts?.installed?`chrome`:`both`),j(!0),await l()}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(!1)}};return(0,A.jsxs)(`section`,{role:`status`,"aria-live":`polite`,className:`mb-4 shrink-0 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(g,{className:`mt-0.5 size-5 shrink-0 text-accent`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:M?f?`浏览器已连接`:`Browser connected`:N?f?`更新扩展后即可录制`:`Update the extension to record`:f?`连接 Chrome,录制你的操作`:`Connect Chrome to record your actions`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:M?f?`在 Chrome 中切换到要录制的网页,然后开始录制。`:`Switch to the website you want to record in Chrome, then start recording.`:N?f?`当前扩展还不支持录制。更新扩展文件后,在 Chrome 扩展页重新加载 xopc。`:`Your connected extension does not support recording yet. Update its files, then reload xopc in Chrome Extensions.`:f?`录制需要 xopc Chrome 扩展。已有扩展请打开 xopc 侧栏,它会自动连接本机服务。`:`Recording uses the xopc Chrome extension. If already installed, open its side panel to connect to your local Gateway.`})]}),(0,A.jsx)(`button`,{type:`button`,disabled:S||n,onClick:d,"aria-label":f?`收起连接引导`:`Close connection guide`,className:`rounded p-1 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(y,{className:`size-4`})})]}),O&&!M&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:m?.artifacts?.installed?f?`重新加载后打开 xopc 侧栏。连接状态会自动更新。`:`After reloading, open the xopc side panel. Connection status updates automatically.`:f?`在 Chrome 扩展页开启开发者模式,点击“加载已解压的扩展程序”,选择已打开的扩展目录,再打开 xopc 侧栏。连接状态会自动更新。`:`Enable Developer mode in Chrome Extensions, choose Load unpacked and select the opened extension folder, then open the xopc side panel. Connection status updates automatically.`}),M&&e.endpoints.length>1&&(0,A.jsx)(`div`,{className:`mt-3 max-w-sm`,children:(0,A.jsx)(c,{value:t??``,ariaLabel:f?`选择录制浏览器`:`Choose a browser to record`,placeholder:f?`选择浏览器`:`Choose a browser`,allowEmpty:!1,options:e.endpoints.map(e=>({value:e.endpointId,label:e.displayName})),onChange:s})}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[M?(0,A.jsx)(x,{onClick:u,disabled:n||!t&&e.endpoints.length>1,children:f?`开始录制`:`Start recording`}):_?(0,A.jsx)(b,{className:`h-9 w-32 rounded-lg`}):m?.artifacts?.extensionDir?(0,A.jsxs)(x,{onClick:()=>void P(),disabled:S,children:[S&&(0,A.jsx)(ee,{className:`size-4 animate-spin`}),N?f?`更新并打开扩展页`:`Update and open extensions`:m.artifacts.installed?f?`打开 Chrome 扩展页`:`Open Chrome Extensions`:f?`安装 Chrome 扩展`:`Install Chrome extension`]}):(0,A.jsx)(x,{onClick:()=>p(`/settings/agent-browser`),children:f?`设置浏览器连接`:`Set up browser connection`}),!M&&(0,A.jsx)(x,{variant:`secondary`,disabled:S,onClick:()=>void l().catch(e=>D(e instanceof Error?e.message:String(e))),children:f?`检查连接`:`Check connection`})]}),E&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-danger`,role:`alert`,children:E})]})}var M={en:{record:`Record my actions`,finishRecording:`Finish and save`,recording:`Recording`,syncing:`Saved locally, syncing…`,verified:`Result verified`,saved:`Saved draft`,unknown:`Check the business result before repeating`,title:`Browser automations`,subtitle:`Let your assistant repeat routine actions on the web.`,emptyTitle:`No browser automations yet`,emptyBody:`Tell your assistant what to do on the web. Once it works, save it and run it again whenever you need.`,create:`Create with assistant`,edit:`Edit with assistant`,run:`Run now`,stop:`Stop`,enable:`Enable`,pause:`Pause`,enabled:`Enabled`,paused:`Paused`,inputs:`Before running`,noInputs:`This automation is ready to run.`,history:`Recent activity`,delete:`Delete automation`,confirmDelete:`Delete this browser automation?`,required:`Please complete all required fields.`,queued:`Waiting to start`,running:`Running`,succeeded:`Completed`,failed:`Needs attention`,cancelled:`Stopped`,result:`Result`,read:`Reads information`,draft:`Edits the page locally`,external_effect:`Affects an external system`,destructive:`Destructive action`,sensitive:`Sensitive action`,createPrompt:`Help me create a reusable browser automation. Ask what I want the browser to do, perform it once with me, then save the successful steps. Keep all technical details hidden.`,editPrompt:`Help me update the browser automation "{name}" (id: {id}). Ask what should change, test the new browser steps, then save it.`},zh:{record:`录制我的操作`,finishRecording:`完成并保存`,recording:`正在录制`,syncing:`已保存到本机,正在同步…`,verified:`结果已验证`,saved:`已保存草稿`,unknown:`结果待检查,请先检查业务结果再重复运行`,title:`浏览器自动化`,subtitle:`让助手自动重复完成网页上的固定操作。`,emptyTitle:`还没有浏览器自动化`,emptyBody:`告诉助手你希望在网页上自动完成什么。成功执行一次后,即可保存并重复运行。`,create:`让助手帮我创建`,edit:`让助手帮我修改`,run:`立即运行`,stop:`停止`,enable:`启用`,pause:`暂停`,enabled:`已启用`,paused:`已暂停`,inputs:`运行前需要填写`,noInputs:`这个自动化可以直接运行。`,history:`最近运行`,delete:`删除自动化`,confirmDelete:`确定删除这个浏览器自动化吗?`,required:`请填写所有必填内容。`,queued:`等待开始`,running:`正在运行`,succeeded:`已完成`,failed:`需要处理`,cancelled:`已停止`,result:`运行结果`,read:`仅读取信息`,draft:`仅在页面内编辑`,external_effect:`会影响外部系统`,destructive:`破坏性操作`,sensitive:`包含敏感操作`,createPrompt:`请帮我创建一个可重复运行的浏览器自动化。先询问我希望浏览器完成什么,陪我实际执行成功一次,然后保存成功步骤。不要让我处理技术细节。`,editPrompt:`请帮我修改浏览器自动化“{name}”(id:{id})。先询问我要修改什么,实际测试新的浏览器步骤,然后保存。`}};function N(e){return e!==`queued`&&e!==`running`}function P(e){return e==null?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(e=>`• ${P(e)}`).join(`
2
- `):typeof e==`object`?Object.entries(e).map(([e,t])=>`${e}: ${P(t)}`).join(`
3
- `):String(e)}function F(){let e=a(e=>e.language),t=M[e],n=r(),i=S(e=>e.setPageHeader),o=S(e=>e.clearPageHeader),[c,ee]=(0,k.useState)(null),[g,y]=(0,k.useState)(),[C,w]=(0,k.useState)({}),[F,I]=(0,k.useState)([]),[L,R]=(0,k.useState)(),[z,B]=(0,k.useState)(``),[V,H]=(0,k.useState)(!1),[U,W]=(0,k.useState)(),[G,K]=(0,k.useState)(),[q,J]=(0,k.useState)(),Y=(0,k.useMemo)(()=>c?.find(e=>e.id===g),[g,c]),X=(0,k.useCallback)(async()=>{let e=await T.list();ee(e.automations),y(t=>t&&e.automations.some(e=>e.id===t)?t:e.automations[0]?.id)},[]);(0,k.useEffect)(()=>{X().catch(e=>B(String(e)))},[X]),(0,k.useEffect)(()=>{Y&&(w(D(Y)),R(void 0),B(``),T.listRuns(Y.id).then(e=>I(e.runs)).catch(e=>B(String(e))))},[Y?.id,Y?.revision]),(0,k.useEffect)(()=>{if(!L||N(L.status))return;let e=window.setInterval(()=>{T.getRun(L.id).then(({run:e})=>{R(e),N(e.status)&&Y&&(T.listRuns(Y.id).then(e=>I(e.runs)),X())}).catch(e=>B(String(e)))},700);return()=>window.clearInterval(e)},[L,Y]);let Z=(0,k.useCallback)(async()=>{H(!0),B(``);try{let e=U&&[`recording`,`paused`].includes(U.state),t=G;if(!e){let e=await T.recordingAvailability();if(e.endpoints.length===1?t=e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)||(t=void 0),K(t),!t){J(e);return}}let n=await T.recording(e?`finish`:`start`,t);W(n.value),K(n.endpointId),J(void 0)}catch(e){let t=e.body;t?.code&&[`connect_required`,`update_required`,`choose_browser`].includes(t.code)?J({state:t.code,endpoints:t.endpoints??[]}):B(e instanceof Error?e.message:String(e))}finally{H(!1)}},[U,G]),te=(0,k.useCallback)(async()=>{let e=await T.recordingAvailability();J(e),K(t=>e.endpoints.length===1?e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)?t:void 0)},[]);(0,k.useEffect)(()=>{if(!q)return;let e=!1,t=window.setInterval(()=>{T.recordingAvailability().then(t=>{e||(J(t),K(e=>t.endpoints.length===1?t.endpoints[0].endpointId:t.endpoints.some(t=>t.endpointId===e)?e:void 0))}).catch(()=>void 0)},3e3);return()=>{e=!0,window.clearInterval(t)}},[!!q]),(0,k.useEffect)(()=>{if(!U||U.automationId)return;let e=!1,t=window.setInterval(()=>{T.recording(`status`,G).then(async t=>{let n=t.value.find(e=>e.id===U.id);!e&&n&&(W(n),n.automationId&&(await X(),e||y(n.automationId)))}).catch(t=>{e||B(String(t))})},1500);return()=>{e=!0,window.clearInterval(t)}},[U,G,X]);let Q=(0,k.useCallback)(e=>{n(`/chat/new?draft=${encodeURIComponent(e)}`)},[n]),ne=(0,k.useMemo)(()=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[z&&(0,A.jsx)(`span`,{role:`alert`,className:`max-w-64 truncate text-xs text-red-600`,title:z,children:z}),U?.state===`stopped`&&!U.automationId&&(0,A.jsx)(`span`,{role:`status`,className:`text-xs text-fg-muted`,children:U.error||t.syncing}),(0,A.jsxs)(x,{variant:`secondary`,disabled:V,onClick:()=>void Z(),children:[(0,A.jsx)(d,{className:`size-4`}),U&&[`recording`,`paused`].includes(U.state)?t.finishRecording:t.record]}),(0,A.jsxs)(x,{onClick:()=>Q(t.createPrompt),children:[(0,A.jsx)(s,{className:`size-4`}),t.create]})]}),[Q,t,V,Z,U,z]);(0,k.useLayoutEffect)(()=>(i({startExtra:null,main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),end:ne}),()=>o()),[o,ne,i,t.title]);let re=async()=>{if(Y){H(!0);try{await T.setEnabled(Y.id,!Y.enabled),await X()}catch(e){B(String(e))}finally{H(!1)}}},ie=async()=>{if(Y){if(!E(Y,C)){B(t.required);return}H(!0);try{let{run:e}=await T.run(Y.id,C);R(e),B(``)}catch(e){B(String(e))}finally{H(!1)}}},ae=async()=>{if(!(!Y||!window.confirm(t.confirmDelete))){H(!0);try{await T.remove(Y.id),y(void 0),I([]),await X()}catch(e){B(String(e))}finally{H(!1)}}},$=q&&(0,A.jsx)(j,{availability:q,endpointId:G,recordingBusy:V,onSelect:K,onRefresh:te,onStart:()=>void Z(),onClose:()=>J(void 0)});return c===null?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(b,{className:`h-[420px] rounded-xl`}),(0,A.jsx)(b,{className:`h-[420px] rounded-xl`})]})]}):c.length===0?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`m-auto max-w-md py-12 text-center`,children:[(0,A.jsx)(s,{className:`mx-auto size-10 text-accent`}),(0,A.jsx)(`h2`,{className:`mt-4 text-lg font-semibold text-fg`,children:t.emptyTitle}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:t.emptyBody}),(0,A.jsxs)(x,{className:`mt-5`,onClick:()=>Q(t.createPrompt),children:[(0,A.jsx)(s,{className:`size-4`}),t.create]})]})]}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-2`,children:c.map(e=>(0,A.jsxs)(`button`,{onClick:()=>y(e.id),className:`mb-1 w-full rounded-lg p-3 text-left ${g===e.id?`bg-accent-soft text-accent-fg`:`hover:bg-surface-hover`}`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,A.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-xs text-fg-muted`,children:[e.enabled?(0,A.jsx)(u,{className:`size-3.5 text-emerald-600`}):(0,A.jsx)(l,{className:`size-3.5`}),e.enabled?t.enabled:t.paused]})]},e.id))}),Y&&(0,A.jsxs)(`main`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-5 sm:p-6`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:Y.name}),Y.description&&(0,A.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:Y.description}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:t[Y.risk]}),(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:Y.verified?t.verified:t.saved}),Y.domains.map(e=>(0,A.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:[(0,A.jsx)(p,{className:`size-3`}),e]},e))]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(x,{variant:`secondary`,disabled:V,onClick:()=>void re(),children:[Y.enabled?(0,A.jsx)(l,{className:`size-4`}):(0,A.jsx)(u,{className:`size-4`}),Y.enabled?t.pause:t.enable]}),(0,A.jsxs)(x,{variant:`secondary`,onClick:()=>Q(t.editPrompt.replace(`{name}`,Y.name).replace(`{id}`,Y.id)),children:[(0,A.jsx)(m,{className:`size-4`}),t.edit]})]})]}),(0,A.jsxs)(`section`,{className:`mt-7 max-w-xl`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:Object.keys(Y.inputs).length===0?e===`zh`?`运行准备完成`:`Ready to run`:`${t.inputs} · ${Object.keys(Y.inputs).length}`}),Object.keys(Y.inputs).length===0?(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.noInputs}):(0,A.jsx)(`div`,{className:`mt-3`,children:(0,A.jsx)(O,{automation:Y,values:C,language:e,onChange:w})}),(0,A.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,A.jsxs)(x,{variant:`primary`,disabled:!Y.enabled||V||!!(L&&!N(L.status)),onClick:()=>void ie(),children:[(0,A.jsx)(h,{className:`size-4`}),t.run]}),L&&!N(L.status)&&(0,A.jsxs)(x,{variant:`secondary`,onClick:()=>void T.cancel(L.id),children:[(0,A.jsx)(_,{className:`size-4`}),t.stop]})]}),z&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-red-700 dark:text-red-300`,children:z})]}),L&&(0,A.jsxs)(`section`,{className:`mt-7 rounded-xl border border-edge bg-surface-inset p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,A.jsx)(f,{className:`size-4`}),L.businessOutcome===`verified`?t.verified:t[L.status]]}),L.businessOutcome===`unknown`&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.unknown}),L.error&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-red-700 dark:text-red-300`,children:L.error}),L.status===`succeeded`&&L.result!==void 0&&(0,A.jsxs)(`div`,{className:`mt-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:t.result}),(0,A.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-fg`,children:P(L.result)})]})]}),(0,A.jsxs)(`section`,{className:`mt-8`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.history}),(0,A.jsx)(`div`,{className:`mt-2 divide-y divide-edge`,children:F.slice(0,10).map(e=>(0,A.jsxs)(`button`,{className:`flex w-full items-center justify-between gap-3 py-3 text-left text-sm hover:text-accent`,onClick:()=>R(e),children:[(0,A.jsx)(`span`,{children:t[e.status]}),(0,A.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[new Date(e.createdAtMs).toLocaleString(),e.durationMs?` · ${Math.max(1,Math.round(e.durationMs/1e3))}s`:``]})]},e.id))})]}),(0,A.jsx)(`div`,{className:`mt-8 border-t border-edge pt-4`,children:(0,A.jsxs)(x,{variant:`ghost`,className:`text-red-700 dark:text-red-300`,disabled:V,onClick:()=>void ae(),children:[(0,A.jsx)(v,{className:`size-4`}),t.delete]})})]})]})]})}export{F as BrowserAutomationsPage};
@@ -1,6 +0,0 @@
1
- import{a as e,i as t,o as n}from"./locale-store-DGtk-KSF.js";function r(){return n(t(`/api/browser/status`))}function i(){return n(t(`/api/browser/test`),{method:`POST`})}function a(e=!1){return n(t(`/api/browser/extension/install`),{method:`POST`,body:JSON.stringify({force:e})})}function o(e){return n(t(`/api/browser/extension/open`),{method:`POST`,body:JSON.stringify({action:e})})}async function s(n,r){let i=await e(t(`/api/browser/playwright/install/stream`),{method:`POST`,headers:{Accept:`text/event-stream`},signal:r});if(!i.ok||!i.body)throw Error(`Chromium install request failed (HTTP ${i.status}).`);let a=i.body.getReader(),o=new TextDecoder,s=``,c;try{for(;!c;){let e=await a.read();if(e.done)break;s+=o.decode(e.value,{stream:!0}),s=s.replace(/\r\n/g,`
2
- `);let t=s.split(`
3
-
4
- `);s=t.pop()??``;for(let e of t){let t=e.split(`
5
- `).find(e=>e.startsWith(`event:`))?.slice(6).trim(),r=e.split(`
6
- `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(``);r&&(t===`progress`&&n(JSON.parse(r)),t===`result`&&(c=JSON.parse(r)))}}}finally{a.releaseLock()}if(!c)throw Error(`Chromium installer ended without a result.`);return c}async function c(){await n(t(`/api/browser/playwright/install/cancel`),{method:`POST`})}export{o as a,s as i,r as n,i as o,a as r,c as t};