@xopcai/xopc 0.0.179 → 0.0.180

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 (221) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-A5FUMjeV.js → activity-store-DFKtQDgE.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-NghNiDWx.js → agent-avatar-dicebear-CcTvB_4W.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agents-Baq8Shzy.js → agents-DgGj9bu6.js} +1 -1
  6. package/dist/gateway/static/root/assets/{api-Bmzslx0Z.js → api-CUClAvuL.js} +1 -1
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-DDWS_BBJ.js → app-management-settings-panel-Ib-cWKHM.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-C6znvVtX.js → appearance-settings-CRSN8WuA.js} +1 -1
  9. package/dist/gateway/static/root/assets/{apps-page-d-Y0Jbe1.js → apps-page-B5xahuT-.js} +1 -1
  10. package/dist/gateway/static/root/assets/{archive-plugin-fvTZhPUr.js → archive-plugin-BBF9zspN.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-BFEgvg-Q.js → attachment-load-D3QQfA7w.js} +1 -1
  12. package/dist/gateway/static/root/assets/automations-page-BUYrvMmD.js +6 -0
  13. package/dist/gateway/static/root/assets/{binary-plugins-CuI2bOc7.js → binary-plugins-D78XOjJ3.js} +1 -1
  14. package/dist/gateway/static/root/assets/{block-editor-Z_k8W0al.js → block-editor-D_VVXlYX.js} +1 -1
  15. package/dist/gateway/static/root/assets/{browser-settings-page-CGApoYPr.js → browser-settings-page-Cjw07q9h.js} +1 -1
  16. package/dist/gateway/static/root/assets/{browser-workflow-inputs-gs6b5e9-.js → browser-workflow-inputs-_gu08MA4.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-workflows-page-Cq5qXStp.js → browser-workflows-page-58DBMXgG.js} +1 -1
  18. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BC-8n4Hl.js → capabilities-settings-panel-D_dfVxHY.js} +1 -1
  19. package/dist/gateway/static/root/assets/{capability-presets-api-BTKhPoDC.js → capability-presets-api-DhCn9rPv.js} +1 -1
  20. package/dist/gateway/static/root/assets/{capability-presets-settings-panel-D7WQ0oBN.js → capability-presets-settings-panel-LWWIYUT7.js} +1 -1
  21. package/dist/gateway/static/root/assets/{channel-recipient-api-TwMak0SE.js → channel-recipient-api-DYtoNV5A.js} +1 -1
  22. package/dist/gateway/static/root/assets/{channels-settings-DysELlO_.js → channels-settings-Cyj5OunL.js} +1 -1
  23. package/dist/gateway/static/root/assets/channels-status-swr-TEFnV0IG.js +1 -0
  24. package/dist/gateway/static/root/assets/{connector-logo-DBKotvNr.js → connector-logo-CxIXnifA.js} +1 -1
  25. package/dist/gateway/static/root/assets/{connectors-page-QH-0WnOo.js → connectors-page-0TobCpBB.js} +2 -2
  26. package/dist/gateway/static/root/assets/{desktop-pet-Dwml8znf.js → desktop-pet-CwVSLL6N.js} +1 -1
  27. package/dist/gateway/static/root/assets/{desktop-pet-settings-CyIg2jJp.js → desktop-pet-settings-BOIp4q0Z.js} +1 -1
  28. package/dist/gateway/static/root/assets/{directory-picker-path-field-B6fc_7SL.js → directory-picker-path-field-C8_lsW6S.js} +1 -1
  29. package/dist/gateway/static/root/assets/{dreaming-settings-CUQxGnDf.js → dreaming-settings-Da9FeWQl.js} +1 -1
  30. package/dist/gateway/static/root/assets/{extension-debug-page-AbRNi2ON.js → extension-debug-page-CMNnSJP6.js} +1 -1
  31. package/dist/gateway/static/root/assets/{extension-page-ClYfiLXC.js → extension-page-t0pJqLvM.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-settings-page-BGVP2hw1.js → extension-settings-page-aiR-tKnW.js} +1 -1
  33. package/dist/gateway/static/root/assets/{gateway-config-api-B7GqtklK.js → gateway-config-api-CkyQBD6r.js} +1 -1
  34. package/dist/gateway/static/root/assets/{gateway-settings-BMeK8igT.js → gateway-settings-BIZfAgfB.js} +1 -1
  35. package/dist/gateway/static/root/assets/{gateway-startup-retry-CKKL96r_.js → gateway-startup-retry-CSU7UvzG.js} +1 -1
  36. package/dist/gateway/static/root/assets/{goals-settings-Dj0ao2qA.js → goals-settings-Dx9uTyWF.js} +1 -1
  37. package/dist/gateway/static/root/assets/{heartbeat-settings-CTI2nPKa.js → heartbeat-settings-Cnr5ORXL.js} +1 -1
  38. package/dist/gateway/static/root/assets/{image-generation-api-BY3VQ5Mv.js → image-generation-api-BR6Kb77X.js} +1 -1
  39. package/dist/gateway/static/root/assets/{index-BDzspHrg.js → index-BA56bQ68.js} +8 -8
  40. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CELtDFz3.js → keyboard-shortcuts-settings-D76uYKeQ.js} +1 -1
  41. package/dist/gateway/static/root/assets/{local-app-workbench-page-m8CTSGix.js → local-app-workbench-page-DSUNtLHg.js} +1 -1
  42. package/dist/gateway/static/root/assets/{local-apps-page-CF5uUd1n.js → local-apps-page-BsLnojTh.js} +1 -1
  43. package/dist/gateway/static/root/assets/{locale-store-DIVc0AQs.js → locale-store-BNC8HUCI.js} +1 -1
  44. package/dist/gateway/static/root/assets/{logs-page-DmH7Tk4k.js → logs-page-yI8kpQtO.js} +1 -1
  45. package/dist/gateway/static/root/assets/{markdown-split-CN85EdB8.js → markdown-split-D6smTQWD.js} +1 -1
  46. package/dist/gateway/static/root/assets/{media-plugins-CxYEc-b8.js → media-plugins-D1TmMF0A.js} +1 -1
  47. package/dist/gateway/static/root/assets/{messages-DYqBwJAK.js → messages-H_iJjnEM.js} +3 -3
  48. package/dist/gateway/static/root/assets/{notes-page-Goab4781.js → notes-page-Vt-diFf0.js} +1 -1
  49. package/dist/gateway/static/root/assets/{notes-workbench-C4jDBVBN.js → notes-workbench-BD297EZt.js} +2 -2
  50. package/dist/gateway/static/root/assets/{outcome-detail-page-DNRfeLZp.js → outcome-detail-page-C5i_ZR9a.js} +1 -1
  51. package/dist/gateway/static/root/assets/{page-tabs-tQNQcAts.js → page-tabs-BnSzIjH0.js} +1 -1
  52. package/dist/gateway/static/root/assets/{preview-open-alternatives-BSTlgsDB.js → preview-open-alternatives-CF12Eqi4.js} +1 -1
  53. package/dist/gateway/static/root/assets/{product-open-page-iQ5gTCip.js → product-open-page-Du0TE_CU.js} +1 -1
  54. package/dist/gateway/static/root/assets/{project-detail-page-D7anK-eu.js → project-detail-page-D1HGz7Dy.js} +1 -1
  55. package/dist/gateway/static/root/assets/{projects-page-BePESKWy.js → projects-page-CqP2TnW-.js} +1 -1
  56. package/dist/gateway/static/root/assets/{remote-access-hub-CHrzBKIs.js → remote-access-hub-BXdVJLS3.js} +1 -1
  57. package/dist/gateway/static/root/assets/{save-bar-controls-BsPf5Gkk.js → save-bar-controls-B53UNtDM.js} +1 -1
  58. package/dist/gateway/static/root/assets/{schedule-field-kAytH7mq.js → schedule-field-C3dIMN5q.js} +1 -1
  59. package/dist/gateway/static/root/assets/{schema-form-Bbw8l2ri.js → schema-form-BKvpxqof.js} +1 -1
  60. package/dist/gateway/static/root/assets/{sessions-page-He5YAczL.js → sessions-page-CPAwDdl5.js} +1 -1
  61. package/dist/gateway/static/root/assets/settings-advanced-gate-C-jGsoft.js +1 -0
  62. package/dist/gateway/static/root/assets/{settings-form-section-BqbibcnJ.js → settings-form-section-kt6GIS32.js} +1 -1
  63. package/dist/gateway/static/root/assets/{settings-loading-skeleton-DNLNCEGT.js → settings-loading-skeleton-85eUPcKz.js} +1 -1
  64. package/dist/gateway/static/root/assets/{settings-page-BR6Ss0bK.js → settings-page-Di5x6Xrc.js} +1 -1
  65. package/dist/gateway/static/root/assets/{settings-page-layout-Cdb1e2Cz.js → settings-page-layout-CkkCee_x.js} +1 -1
  66. package/dist/gateway/static/root/assets/{setup-status-panel-moT-D-ia.js → setup-status-panel-uxEE6gAB.js} +1 -1
  67. package/dist/gateway/static/root/assets/{share-preview-page-CkrASny2.js → share-preview-page-BtLEstaI.js} +1 -1
  68. package/dist/gateway/static/root/assets/{shares-settings-X49zY21H.js → shares-settings-2mcsMWgn.js} +1 -1
  69. package/dist/gateway/static/root/assets/skill-reload-api-ocDwsrEt.js +1 -0
  70. package/dist/gateway/static/root/assets/skills-page-9_jfsFU5.js +2 -0
  71. package/dist/gateway/static/root/assets/{skills-page.utils-BG5dGkyA.js → skills-page.utils-C2SHvq8V.js} +1 -1
  72. package/dist/gateway/static/root/assets/{system-settings-panel-XdY8eyYf.js → system-settings-panel-CIJ66cUy.js} +1 -1
  73. package/dist/gateway/static/root/assets/{theme-store-DtwI_VLT.js → theme-store-ClDa_Bci.js} +1 -1
  74. package/dist/gateway/static/root/assets/{time-picker-UghsQu_I.js → time-picker-D0zAsHOo.js} +1 -1
  75. package/dist/gateway/static/root/assets/{typed-models-lib-DOnpwsrE.js → typed-models-lib-GsmwmB40.js} +1 -1
  76. package/dist/gateway/static/root/assets/{use-channel-catalog-BWDtfNvQ.js → use-channel-catalog-BQz3K7xj.js} +1 -1
  77. package/dist/gateway/static/root/assets/{user-context-page-BtNBEtKj.js → user-context-page-Bn4BLg4W.js} +1 -1
  78. package/dist/gateway/static/root/assets/{voice-api-key-field-DP80jW-W.js → voice-api-key-field-Blaxsbb3.js} +1 -1
  79. package/dist/gateway/static/root/assets/{work-copy-hQmivDgT.js → work-copy-Cwyan9Sn.js} +1 -1
  80. package/dist/gateway/static/root/assets/{work-discovery-page-CkDOVZBr.js → work-discovery-page-iJ9RBSpu.js} +1 -1
  81. package/dist/gateway/static/root/assets/{work-item-detail-page-CqvkcFcR.js → work-item-detail-page-CqTH7PQX.js} +1 -1
  82. package/dist/gateway/static/root/assets/{work-page-BL8TZW4Z.js → work-page-H3m99ccS.js} +1 -1
  83. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BLlVqKdA.js → workflow-run-setup-panel-CTG4RpRE.js} +1 -1
  84. package/dist/gateway/static/root/assets/{workflows-page-BgsdRu3_.js → workflows-page-BxZSKMfv.js} +1 -1
  85. package/dist/gateway/static/root/index.html +6 -6
  86. package/dist/package.js +1 -1
  87. package/dist/src/agent/agent-manager.d.ts +4 -1
  88. package/dist/src/agent/agent-manager.js +21 -7
  89. package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
  90. package/dist/src/agent/embedded/model-runtime.js +1 -1
  91. package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
  92. package/dist/src/agent/embedded/run-for-session.js +3 -1
  93. package/dist/src/agent/goals/post-turn.js +1 -1
  94. package/dist/src/agent/image/tool-model-config.js +1 -1
  95. package/dist/src/agent/inbound/turn-dispatcher.d.ts +6 -1
  96. package/dist/src/agent/inbound/turn-dispatcher.js +5 -2
  97. package/dist/src/agent/ipc/inbox.js +1 -1
  98. package/dist/src/agent/lifecycle/timeout-wrapper.d.ts +2 -0
  99. package/dist/src/agent/lifecycle/timeout-wrapper.js +39 -9
  100. package/dist/src/agent/mcp/bundle-mcp-materialize.js +2 -2
  101. package/dist/src/agent/mcp/bundle-mcp-runtime.js +6 -1
  102. package/dist/src/agent/mcp/bundle-mcp-types.d.ts +1 -1
  103. package/dist/src/agent/mcp/mcp-transport-config.d.ts +2 -0
  104. package/dist/src/agent/mcp/mcp-transport-config.js +10 -3
  105. package/dist/src/agent/mcp/mcp-transport.d.ts +1 -0
  106. package/dist/src/agent/mcp/mcp-transport.js +5 -2
  107. package/dist/src/agent/memory/dreaming/config.js +1 -1
  108. package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +1 -1
  109. package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +6 -2
  110. package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
  111. package/dist/src/agent/service/direct-turn-helpers.js +1 -0
  112. package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -0
  113. package/dist/src/agent/service/process-direct-one-shot.js +4 -1
  114. package/dist/src/agent/service.d.ts +1 -0
  115. package/dist/src/agent/service.js +5 -2
  116. package/dist/src/agent/session/session-inspector.js +1 -1
  117. package/dist/src/agent/skills/config.js +6 -0
  118. package/dist/src/agent/skills/filesystem-watcher.d.ts +4 -0
  119. package/dist/src/agent/skills/filesystem-watcher.js +16 -7
  120. package/dist/src/agent/skills/hub-lock.js +1 -1
  121. package/dist/src/agent/skills/index.d.ts +10 -7
  122. package/dist/src/agent/skills/index.js +56 -47
  123. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  124. package/dist/src/agent/skills/skill-manager.d.ts +5 -2
  125. package/dist/src/agent/skills/skill-manager.js +10 -5
  126. package/dist/src/agent/skills/skill-sources.d.ts +18 -0
  127. package/dist/src/agent/skills/skill-sources.js +143 -0
  128. package/dist/src/agent/skills/types.d.ts +25 -2
  129. package/dist/src/agent/tools/delegate-tool.js +2 -1
  130. package/dist/src/agent/tools/executor.d.ts +2 -0
  131. package/dist/src/agent/tools/executor.js +18 -11
  132. package/dist/src/agent/tools/factory.js +2 -0
  133. package/dist/src/agent/tools/index.d.ts +1 -0
  134. package/dist/src/agent/tools/index.js +2 -1
  135. package/dist/src/agent/tools/managed-job-tool.d.ts +2 -0
  136. package/dist/src/agent/tools/managed-job-tool.js +160 -0
  137. package/dist/src/agent/workspace-runtime/registry.d.ts +3 -0
  138. package/dist/src/agent/workspace-runtime/registry.js +3 -1
  139. package/dist/src/agent-runtime/index.js +1 -1
  140. package/dist/src/agent-runtime/runtime-profile.js +1 -1
  141. package/dist/src/auth/credentials.d.ts +9 -1
  142. package/dist/src/auth/credentials.js +112 -56
  143. package/dist/src/auth/model-credential-store.js +7 -22
  144. package/dist/src/auth/oauth-provider-lock.d.ts +5 -0
  145. package/dist/src/auth/oauth-provider-lock.js +91 -0
  146. package/dist/src/auth/profiles/store.js +1 -1
  147. package/dist/src/auth/sync-provider-auth.js +2 -2
  148. package/dist/src/automations/domain/defaults.d.ts +8 -1
  149. package/dist/src/automations/domain/defaults.js +9 -2
  150. package/dist/src/automations/domain/index.js +2 -2
  151. package/dist/src/automations/domain/types.d.ts +33 -7
  152. package/dist/src/automations/domain/validation.d.ts +8 -0
  153. package/dist/src/automations/domain/validation.js +2 -0
  154. package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -1
  155. package/dist/src/automations/index.js +2 -2
  156. package/dist/src/automations/service/action-executor.d.ts +2 -2
  157. package/dist/src/automations/service/action-executor.js +144 -34
  158. package/dist/src/automations/service/automation-service.d.ts +4 -0
  159. package/dist/src/automations/service/automation-service.js +197 -18
  160. package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
  161. package/dist/src/automations/storage/automation-run-repository.js +37 -7
  162. package/dist/src/automations/storage/index.js +2 -2
  163. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  164. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  165. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  166. package/dist/src/cli/commands/models.js +1 -1
  167. package/dist/src/cli/utils/oauth-login.js +1 -7
  168. package/dist/src/config/agent-profile.js +1 -1
  169. package/dist/src/config/index.js +4 -4
  170. package/dist/src/config/loader.js +1 -1
  171. package/dist/src/config/models-json.js +1 -1
  172. package/dist/src/config/schema.d.ts +3 -0
  173. package/dist/src/config/schema.js +2 -1
  174. package/dist/src/extensions/lockfile.js +1 -1
  175. package/dist/src/gateway/agents-admin.js +2 -2
  176. package/dist/src/gateway/file-path-classifier.js +1 -1
  177. package/dist/src/gateway/heartbeat/service.js +1 -1
  178. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  179. package/dist/src/gateway/hono/oauth-async.js +1 -7
  180. package/dist/src/gateway/hono/oauth.js +1 -7
  181. package/dist/src/gateway/hono/routes/models.js +1 -1
  182. package/dist/src/gateway/hono/routes/you.js +1 -1
  183. package/dist/src/gateway/service/config-coordinator.js +1 -1
  184. package/dist/src/gateway/service.js +3 -3
  185. package/dist/src/goals/goal-workflow-judge.js +1 -1
  186. package/dist/src/heartbeat/index.js +1 -1
  187. package/dist/src/notes/service.js +1 -1
  188. package/dist/src/projects/project-loop.js +3 -3
  189. package/dist/src/providers/auth-runtime/oauth.js +12 -0
  190. package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
  191. package/dist/src/providers/index.js +2 -2
  192. package/dist/src/providers/model-registry.js +1 -1
  193. package/dist/src/providers/register-runtime-providers.js +1 -1
  194. package/dist/src/storage/sqlite/migrations/088_automation_execution_deadlines.sql +5 -0
  195. package/dist/src/storage/sqlite/migrations/089_automation_run_leases.sql +8 -0
  196. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  197. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  198. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  199. package/dist/src/storage/sqlite/schema.js +1 -1
  200. package/dist/src/tui/backends/embedded-backend.d.ts +2 -0
  201. package/dist/src/tui/backends/embedded-backend.js +11 -7
  202. package/dist/src/tui/tui-backend.d.ts +2 -0
  203. package/dist/src/tui/tui-oauth-login.js +1 -7
  204. package/dist/src/tui/tui-picker-overlay.js +1 -0
  205. package/dist/src/tui/tui-picker-services.d.ts +1 -0
  206. package/dist/src/tui/tui-skills-autocomplete.d.ts +6 -2
  207. package/dist/src/tui/tui-skills-autocomplete.js +10 -6
  208. package/dist/src/tui/tui-startup-resources.d.ts +3 -1
  209. package/dist/src/tui/tui-startup-resources.js +4 -3
  210. package/dist/src/tui/tui.js +4 -1
  211. package/dist/src/work/home-query-service.d.ts +31 -2
  212. package/dist/src/work/home-query-service.js +4 -4
  213. package/dist/src/work/index.js +2 -2
  214. package/dist/src/workflows/service/workflow-run-service.js +1 -1
  215. package/dist/src/workflows/service/workflow-run-service.types.d.ts +3 -1
  216. package/package.json +1 -1
  217. package/dist/gateway/static/root/assets/automations-page-CFYOCBlQ.js +0 -6
  218. package/dist/gateway/static/root/assets/channels-status-swr-BAC-R8IK.js +0 -1
  219. package/dist/gateway/static/root/assets/settings-advanced-gate-2eAC9GCP.js +0 -1
  220. package/dist/gateway/static/root/assets/skill-reload-api-CjpnFfOH.js +0 -1
  221. package/dist/gateway/static/root/assets/skills-page-DEwfSOUE.js +0 -2
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{d as n}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as r}from"./notes-workbench-C4jDBVBN.js";var i=e(),a=t();function o(){let e=(0,i.c)(2),{noteId:t}=n(),o;return e[0]===t?o=e[1]:(o=(0,a.jsx)(r,{selectedNoteId:t,basePath:`/notes`,managePageHeader:!0,showLibrary:!0,allowMediaCapture:!0,listWidthStorageKey:`xopc.notes.listWidth`}),e[0]=t,e[1]=o),o}export{o as NotesPage};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{d as n}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as r}from"./notes-workbench-BD297EZt.js";var i=e(),a=t();function o(){let e=(0,i.c)(2),{noteId:t}=n(),o;return e[0]===t?o=e[1]:(o=(0,a.jsx)(r,{selectedNoteId:t,basePath:`/notes`,managePageHeader:!0,showLibrary:!0,allowMediaCapture:!0,listWidthStorageKey:`xopc.notes.listWidth`}),e[0]=t,e[1]=o),o}export{o as NotesPage};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-Z_k8W0al.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-BDzspHrg.js","assets/preload-helper-zJ_50EbN.js","assets/Combination-14nmIgxH.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-C230izr8.js","assets/chunk-KS7C4IRE-BMhrPKJC.js","assets/vendor-swr-BIWyz7Rc.js","assets/createLucideIcon-DPHK1VkS.js","assets/check-DUBLcKHA.js","assets/middleware-Pd0e8Igk.js","assets/locale-store-DIVc0AQs.js","assets/messages-DYqBwJAK.js","assets/cn-JdwAhgNB.js","assets/schemas-C6onAggk.js","assets/product-delivery-BVG-eWQO.js","assets/config-reload-event-Bjh2zoKp.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/gateway-startup-retry-CKKL96r_.js","assets/activity-store-A5FUMjeV.js","assets/theme-store-DtwI_VLT.js","assets/index-B0Tdge_q.css","assets/vendor-codemirror--gTq3YAI.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-D4ZIVQbk.css","assets/markdown-editor-BvUebh3C.js","assets/code-editor-D4_k-6QN.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{l as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as o}from"./cn-JdwAhgNB.js";import{t as s}from"./messages-DYqBwJAK.js";import{l as c,n as l}from"./locale-store-DIVc0AQs.js";import{i as u}from"./theme-store-DtwI_VLT.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{$c as f,B as p,Ci as m,Cl as h,Cr as g,Do as _,Du as v,Ei as y,Er as b,Fc as x,Go as S,Gs as C,Ho as w,Hu as T,Ic as E,Iu as D,Js as O,Ko as k,Lc as A,Mu as j,Nc as M,Ps as N,Qn as P,Ru as F,Si as I,Ti as L,Uo as ee,Vc as te,Vo as ne,Wl as R,Wo as re,Xn as z,Xs as ie,Yc as B,Yo as ae,Ys as V,Zn as oe,_ as H,_c as U,_r as W,ac as G,ar as se,as as ce,b as le,bl as ue,br as K,cc as de,cr as fe,dl as pe,dr as q,fr as me,g as he,gl as ge,gr as _e,hr as J,ir as Y,is as ve,iu as ye,jc as be,js as xe,jt as Se,lr as Ce,mr as we,mu as Te,nc as Ee,nl as X,nr as De,or as Oe,pr as ke,ql as Ae,qo as je,ro as Me,rr as Ne,sc as Pe,sr as Fe,tu as Ie,ur as Le,v as Re,vc as ze,vr as Be,wc as Ve,wi as He,wl as Ue,wr as We,xi as Ge,xl as Ke,xr as qe,y as Je,yr as Ye,zc as Xe,zl as Ze,zu as Qe}from"./index-BDzspHrg.js";var Z=n(),Q=e(t(),1),$=r(),$e=(0,Q.createContext)(null);function et(){let e=(0,Z.c)(1),t=(0,Q.useContext)($e);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:tt},e[0]=t):t=e[0],t}return t}function tt(){}function nt(e){let t=(0,Z.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,s]=(0,Q.useState)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(e,t)=>{s({src:e,alt:t})},t[0]=c):c=t[0];let l=c,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={openImage:l},t[1]=u):u=t[1];let d=u,f=a!==null,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e||s(null)},t[2]=p):p=t[2];let m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(S,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=m):m=t[3];let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=o(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=h):h=t[4];let g=a?.alt||`Image preview`,_;t[5]===g?_=t[6]:(_=(0,$.jsx)(je,{className:`sr-only`,children:g}),t[5]=g,t[6]=_);let v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(N,{className:`size-5`,"aria-hidden":!0}),t[7]=v):v=t[7];let y;t[8]===i?y=t[9]:(y=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":i,className:`absolute right-4 top-4 z-10 rounded-lg bg-surface-panel/80 p-2 text-fg-muted backdrop-blur transition-colors hover:bg-surface-hover hover:text-fg`,children:v})}),t[8]=i,t[9]=y);let b;t[10]===a?b=t[11]:(b=a?(0,$.jsx)(`img`,{src:a.src,alt:a.alt??``,className:`max-h-[min(90vh,900px)] max-w-[min(95vw,1200px)] rounded-lg object-contain shadow-lg`}):null,t[10]=a,t[11]=b);let x;t[12]!==y||t[13]!==b||t[14]!==_?(x=(0,$.jsxs)(k,{children:[m,(0,$.jsxs)(ee,{className:h,"aria-describedby":void 0,children:[_,y,b]})]}),t[12]=y,t[13]=b,t[14]=_,t[15]=x):x=t[15];let C;t[16]!==x||t[17]!==f?(C=(0,$.jsx)(ne,{open:f,onOpenChange:p,children:x}),t[16]=x,t[17]=f,t[18]=C):C=t[18];let T;return t[19]!==n||t[20]!==C?(T=(0,$.jsxs)($e.Provider,{value:d,children:[n,C]}),t[19]=n,t[20]=C,t[21]=T):T=t[21],T}function rt(e){let t=(0,Z.c)(15),{noteId:n,attachmentId:r,className:i}=e,[a,s]=(0,Q.useState)(!1),c;t[0]!==r||t[1]!==n?(c=b(n,r),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l=c;if(a){let e;t[3]===i?e=t[4]:(e=o(`flex size-12 shrink-0 items-center justify-center rounded-lg border border-edge-subtle bg-surface-hover text-fg-muted`,i),t[3]=i,t[4]=e);let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(h,{className:`size-4`}),t[5]=n):n=t[5];let r;return t[6]===e?r=t[7]:(r=(0,$.jsx)(`div`,{className:e,"aria-hidden":!0,children:n}),t[6]=e,t[7]=r),r}let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(!0),t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=o(`size-12 shrink-0 rounded-lg border border-edge-subtle bg-surface-hover object-cover`,i),t[9]=i,t[10]=d);let f;return t[11]!==n||t[12]!==l||t[13]!==d?(f=(0,$.jsx)(We,{src:l,expectedNoteId:n,alt:``,loading:`lazy`,draggable:!1,onLoadFailed:u,className:d}),t[11]=n,t[12]=l,t[13]=d,t[14]=f):f=t[14],f}var it=6e4,at=36e5,ot=864e5;function st(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function ct(e,t,n){let r=t-e;if(r<it)return n.justNow;if(r<at){let e=Math.floor(r/it);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=st(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(e>=i-ot)return n.yesterday+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(r<7*ot){let e=Math.floor(r/ot);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function lt(e,t,n){let r=st(t);if(e>=r)return n.today;if(e>=r-ot)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(void 0,{month:`long`,day:`numeric`}):i.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function ut(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function dt(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,`0`)}`}function ft(e){let t=(0,Z.c)(38),{noteId:n,attachmentId:r,durationSec:i,className:a}=e,{playing:s,loading:c,currentTime:l,duration:u,noteId:d,attachmentId:f}=P(),p=P(mt),m=d===n&&f===r,h=m&&s,g=m&&c,_=m?l:0,v=m&&u>0?u:i??0,y=v>0?Math.min(_/v*100,100):0,b;t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==p?(b=e=>{e.stopPropagation(),p(n,r,i)},t[0]=r,t[1]=i,t[2]=n,t[3]=p,t[4]=b):b=t[4];let x=b,S;t[5]!==r||t[6]!==i||t[7]!==n||t[8]!==p?(S=e=>{(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),p(n,r,i))},t[5]=r,t[6]=i,t[7]=n,t[8]=p,t[9]=S):S=t[9];let C=S,w;t[10]===a?w=t[11]:(w=o(`flex items-center gap-2`,a),t[10]=a,t[11]=w);let T=h?`bg-accent text-white`:`bg-accent/10 text-accent hover:bg-accent/20`,E;t[12]===T?E=t[13]:(E=o(`flex size-7 shrink-0 items-center justify-center rounded-full transition-colors`,T),t[12]=T,t[13]=E);let D=h?`Pause`:`Play`,O;t[14]!==g||t[15]!==h?(O=g?(0,$.jsx)(X,{className:`size-3.5 animate-spin`}):h?(0,$.jsx)(Xe,{className:`size-3.5`}):(0,$.jsx)(M,{className:`size-3.5 ml-0.5`}),t[14]=g,t[15]=h,t[16]=O):O=t[16];let k;t[17]!==x||t[18]!==C||t[19]!==E||t[20]!==D||t[21]!==O?(k=(0,$.jsx)(`button`,{type:`button`,onClick:x,onKeyDown:C,className:E,"aria-label":D,children:O}),t[17]=x,t[18]=C,t[19]=E,t[20]=D,t[21]=O,t[22]=k):k=t[22];let A=`${y}%`,j;t[23]===A?j=t[24]:(j=(0,$.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-accent/10`,children:(0,$.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width] duration-200 ease-linear`,style:{width:A}})}),t[23]=A,t[24]=j);let N;t[25]!==v||t[26]!==m||t[27]!==_?(N=dt(m&&_>0?_:v),t[25]=v,t[26]=m,t[27]=_,t[28]=N):N=t[28];let F;t[29]===N?F=t[30]:(F=(0,$.jsx)(`span`,{className:`text-[10px] tabular-nums text-fg-muted`,children:N}),t[29]=N,t[30]=F);let I;t[31]!==j||t[32]!==F?(I=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[j,F]}),t[31]=j,t[32]=F,t[33]=I):I=t[33];let L;return t[34]!==I||t[35]!==w||t[36]!==k?(L=(0,$.jsxs)(`div`,{className:w,onClick:pt,children:[k,I]}),t[34]=I,t[35]=w,t[36]=k,t[37]=L):L=t[37],L}function pt(e){return e.stopPropagation()}function mt(e){return e.toggle}function ht(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function gt(e){let t=(0,Z.c)(80),{note:n,selected:r,onPress:i,onPin:a,onArchive:s,onDelete:c,labels:l,timeLabels:u}=e,d=r===void 0?!1:r,f;t[0]!==l||t[1]!==n?(f=ht(n,l),t[0]=l,t[1]=n,t[2]=f):f=t[2];let p=f,h=!n.snippet?.trim(),[g]=(0,Q.useState)(bt),_;t[3]!==n.createdAt||t[4]!==g||t[5]!==u?(_=ct(n.createdAt,g,u),t[3]=n.createdAt,t[4]=g,t[5]=u,t[6]=_):_=t[6];let v=_,b,S;t[7]!==n.id||t[8]!==i?(b=()=>i(n.id),S=e=>{(e.key===`Enter`||e.key===` `)&&i(n.id)},t[7]=n.id,t[8]=i,t[9]=b,t[10]=S):(b=t[9],S=t[10]);let C=d?`bg-surface-active hover:bg-surface-active`:`bg-surface-base hover:bg-surface-hover`,w;t[11]===C?w=t[12]:(w=o(`group relative flex cursor-pointer flex-col gap-2 rounded-lg px-3 py-2.5`,`transition-colors duration-150 ease-out`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,C),t[11]=C,t[12]=w);let T=d?`true`:void 0,D;t[13]!==n.coverAttachmentId||t[14]!==n.id||t[15]!==n.kind||t[16]!==n.voiceAttachmentId||t[17]!==n.voiceDurationSec?(D=n.coverAttachmentId?(0,$.jsx)(rt,{noteId:n.id,attachmentId:n.coverAttachmentId}):n.kind===`voice`&&n.voiceAttachmentId?(0,$.jsx)(ft,{noteId:n.id,attachmentId:n.voiceAttachmentId,durationSec:n.voiceDurationSec,className:`mt-0.5 w-28 shrink-0`}):null,t[13]=n.coverAttachmentId,t[14]=n.id,t[15]=n.kind,t[16]=n.voiceAttachmentId,t[17]=n.voiceDurationSec,t[18]=D):D=t[18];let k;t[19]===n.title?k=t[20]:(k=n.title&&(0,$.jsx)(`h3`,{className:`mb-0.5 truncate text-sm font-semibold text-fg`,children:n.title}),t[19]=n.title,t[20]=k);let A=n.title?`text-fg-muted`:h?`italic text-fg-muted`:`text-fg`,j;t[21]===A?j=t[22]:(j=o(`truncate text-sm leading-5`,A),t[21]=A,t[22]=j);let M;t[23]!==p||t[24]!==j?(M=(0,$.jsx)(`p`,{className:j,children:p}),t[23]=p,t[24]=j,t[25]=M):M=t[25];let N;t[26]!==k||t[27]!==M?(N=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[k,M]}),t[26]=k,t[27]=M,t[28]=N):N=t[28];let P;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:yt,className:`shrink-0 rounded-md p-1 text-fg-muted opacity-0 transition-opacity group-hover:opacity-100 hover:bg-surface-panel focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":`Actions`,children:(0,$.jsx)(Ae,{className:`size-4`})})}),t[29]=P):P=t[29];let F;t[30]!==n.id||t[31]!==n.pinned||t[32]!==a?(F=()=>a(n.id,!n.pinned),t[30]=n.id,t[31]=n.pinned,t[32]=a,t[33]=F):F=t[33];let ee;t[34]===n.pinned?ee=t[35]:(ee=n.pinned?(0,$.jsx)(x,{className:`size-4`}):(0,$.jsx)(E,{className:`size-4`}),t[34]=n.pinned,t[35]=ee);let te=n.pinned?l.unpin:l.pin,ne;t[36]!==F||t[37]!==ee||t[38]!==te?(ne=(0,$.jsxs)(I,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:F,children:[ee,te]}),t[36]=F,t[37]=ee,t[38]=te,t[39]=ne):ne=t[39];let R;t[40]!==n.id||t[41]!==s?(R=()=>s(n.id),t[40]=n.id,t[41]=s,t[42]=R):R=t[42];let re;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(Qe,{className:`size-4`}),t[43]=re):re=t[43];let z;t[44]!==l.archive||t[45]!==R?(z=(0,$.jsxs)(I,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:R,children:[re,l.archive]}),t[44]=l.archive,t[45]=R,t[46]=z):z=t[46];let ie;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(L,{className:`my-1 h-px bg-edge-subtle`}),t[47]=ie):ie=t[47];let B;t[48]!==n.id||t[49]!==c?(B=()=>c(n.id),t[48]=n.id,t[49]=c,t[50]=B):B=t[50];let ae;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(O,{className:`size-4`}),t[51]=ae):ae=t[51];let V;t[52]!==l.delete||t[53]!==B?(V=(0,$.jsxs)(I,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-500 outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:B,children:[ae,l.delete]}),t[52]=l.delete,t[53]=B,t[54]=V):V=t[54];let oe;t[55]!==ne||t[56]!==z||t[57]!==V?(oe=(0,$.jsxs)(He,{children:[P,(0,$.jsx)(m,{children:(0,$.jsxs)(Ge,{className:`z-50 min-w-[140px] rounded-xl border border-edge bg-surface-panel p-1 shadow-lg`,sideOffset:4,align:`end`,onClick:vt,children:[ne,z,ie,V]})})]}),t[55]=ne,t[56]=z,t[57]=V,t[58]=oe):oe=t[58];let H;t[59]!==N||t[60]!==oe||t[61]!==D?(H=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[D,N,oe]}),t[59]=N,t[60]=oe,t[61]=D,t[62]=H):H=t[62];let U;t[63]===n.pinned?U=t[64]:(U=n.pinned&&(0,$.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs font-medium text-accent`,children:(0,$.jsx)(E,{className:`size-3`})}),t[63]=n.pinned,t[64]=U);let W;t[65]===n.tags?W=t[66]:(W=n.tags?.slice(0,2).map(_t),t[65]=n.tags,t[66]=W);let G;t[67]===v?G=t[68]:(G=(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:v}),t[67]=v,t[68]=G);let se;t[69]!==U||t[70]!==W||t[71]!==G?(se=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[U,W,G]}),t[69]=U,t[70]=W,t[71]=G,t[72]=se):se=t[72];let ce;return t[73]!==H||t[74]!==se||t[75]!==b||t[76]!==S||t[77]!==w||t[78]!==T?(ce=(0,$.jsxs)(`article`,{role:`button`,tabIndex:0,onClick:b,onKeyDown:S,className:w,"aria-current":T,children:[H,se]}),t[73]=H,t[74]=se,t[75]=b,t[76]=S,t[77]=w,t[78]=T,t[79]=ce):ce=t[79],ce}function _t(e){return(0,$.jsx)(`span`,{className:`max-w-24 truncate rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e)}function vt(e){return e.stopPropagation()}function yt(e){return e.stopPropagation()}function bt(){return Date.now()}function xt(e){let t=(0,Z.c)(45),{title:n,description:r,prompt:i,coverage:c,className:u,variant:f}=e,p=f===void 0?`card`:f,m=l(wt),h=s(m).automations.suggestions,g=s(m).automations,_=a(),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=v):v=t[0];let{data:y}=d(c?`automation-suggestion-coverage`:null,Ct,v),b=c?y?.automations.find(e=>Je(e,c)):void 0,x=b?H(b,g):[];if(p===`titleAction`){if(b){let e;t[1]===u?e=t[2]:(e=o(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,u),t[1]=u,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Te,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===_?r=t[5]:(r=()=>_(`/automations`),t[4]=_,t[5]=r),(0,$.jsxs)(`section`,{className:e,children:[n,(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:h.coveredTitle}),(0,$.jsx)(xe,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:h.manage})]})}let e;t[6]===u?e=t[7]:(e=o(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,u),t[6]=u,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(pe,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let s;t[9]!==r||t[10]!==n?(s=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=s):s=t[11];let c;t[12]!==_||t[13]!==i?(c=()=>{_(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=_,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(de,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,$.jsxs)(`section`,{className:e,children:[a,s,(0,$.jsxs)(xe,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,h.create]})]})}if(b){let e;t[16]===u?e=t[17]:(e=o(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,u),t[16]=u,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Te,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===_?r=t[20]:(r=()=>_(`/automations`),t[19]=_,t[20]=r);let i;return t[21]!==h||t[22]!==r?(i=(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsx)(xe,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:h.manage})}),t[21]=h,t[22]=r,t[23]=i):i=t[23],(0,$.jsxs)(`section`,{className:e,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:h.coveredTitle}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:Re(h.coveredDescription,{name:b.name})})]})]}),(0,$.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:g.explain.whyCovered}),(0,$.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(St)})]}),i]})}let S;t[24]===u?S=t[25]:(S=o(`rounded-lg bg-surface-panel p-3 shadow-surface`,u),t[24]=u,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(pe,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]===n?w=t[28]:(w=(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=w);let T;t[29]===r?T=t[30]:(T=(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=T);let E;t[31]!==w||t[32]!==T?(E=(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})]}),t[31]=w,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==_||t[35]!==i?(D=()=>{_(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=_,t[35]=i,t[36]=D):D=t[36];let O;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(de,{className:`size-3.5`,"aria-hidden":!0}),t[37]=O):O=t[37];let k;t[38]!==h.create||t[39]!==D?(k=(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsxs)(xe,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:D,children:[O,h.create]})}),t[38]=h.create,t[39]=D,t[40]=k):k=t[40];let A;return t[41]!==k||t[42]!==S||t[43]!==E?(A=(0,$.jsxs)(`section`,{className:S,children:[E,k]}),t[41]=k,t[42]=S,t[43]=E,t[44]=A):A=t[44],A}function St(e){return(0,$.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function Ct(){return le.list()}function wt(e){return e.language}function Tt(e){let t=(0,Z.c)(31),{noteId:n}=e,r=l(Dt),i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let a=i.notes.discussionCapture,o,c;t[2]===n?(o=t[3],c=t[4]):(o=[`note-discussion`,n],c=()=>De(n),t[2]=n,t[3]=o,t[4]=c);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={refreshInterval:5e3},t[5]=u):u=t[5];let{data:f,mutate:p}=d(o,c,u),m=f?.discussion,h=m?.status===`recording`||m?.status===`finalizing`,g=h?m.id:null,_;t[6]===g?_=t[7]:(_=g?[`note-discussion-transcript`,g]:null,t[6]=g,t[7]=_);let v=h?5e3:0,y;t[8]===v?y=t[9]:(y={refreshInterval:v},t[8]=v,t[9]=y);let{data:b,mutate:x}=d(_,Et,y),S,w;if(t[10]!==g||t[11]!==p||t[12]!==x?(S=()=>{if(!g)return;let e=()=>{p(),x()};return window.addEventListener(`discussion-updated`,e),window.addEventListener(`discussion-transcript-updated`,e),()=>{window.removeEventListener(`discussion-updated`,e),window.removeEventListener(`discussion-transcript-updated`,e)}},w=[g,p,x],t[10]=g,t[11]=p,t[12]=x,t[13]=S,t[14]=w):(S=t[13],w=t[14]),(0,Q.useEffect)(S,w),!h||!m)return null;let T=m.projectId&&m.projectInferenceSource!==`context`,E;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t[15]=E):E=t[15];let D=m.status===`recording`?a.draftTranscript:a.finalizing,O;t[16]===D?O=t[17]:(O=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[E,D]}),t[16]=D,t[17]=O);let k;t[18]!==a.undo||t[19]!==m.id||t[20]!==T||t[21]!==p?(k=T?(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-xs font-medium text-accent-fg`,onClick:async()=>p(await Y(m.id),{revalidate:!1}),children:[(0,$.jsx)(C,{className:`size-3`,"aria-hidden":!0}),a.undo]}):null,t[18]=a.undo,t[19]=m.id,t[20]=T,t[21]=p,t[22]=k):k=t[22];let A;t[23]!==O||t[24]!==k?(A=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[O,k]}),t[23]=O,t[24]=k,t[25]=A):A=t[25];let j=b?.text||a.waitingTranscript,M;t[26]===j?M=t[27]:(M=(0,$.jsx)(`p`,{className:`mt-2 max-h-36 overflow-y-auto whitespace-pre-wrap text-sm leading-6 text-fg`,children:j}),t[26]=j,t[27]=M);let N;return t[28]!==A||t[29]!==M?(N=(0,$.jsxs)(`section`,{className:`mb-3 shrink-0 rounded-xl border border-accent/25 bg-accent-soft px-4 py-3`,children:[A,M]}),t[28]=A,t[29]=M,t[30]=N):N=t[30],N}function Et(e){let[,t]=e;return Ne(t)}function Dt(e){return e.language}var Ot={edit:A,ai_edit:de,sync:Ve,restore:F};function kt(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function At({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=s(l(e=>e.language)).notes,c=a,{data:u}=d(e?[`note-history`,e]:null,()=>q(e)),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),g=(0,Q.useCallback)(async t=>{p(!0);try{await K(e,t),h(null),i()}catch{ae({type:`error`,title:a.restoreFailed})}finally{p(!1)}},[e,a.restoreSuccess,a.restoreFailed,i]),_=Date.now();return(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,$.jsx)(Ue,{className:`size-4`,"aria-hidden":!0}),a.history]}),(0,$.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,$.jsx)(N,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:u?.length?(0,$.jsx)(`ul`,{className:`divide-y divide-edge`,children:u.map(e=>{let r=Ot[e.trigger]??A,i=t===e.timestamp,s=m===e.timestamp;return(0,$.jsxs)(`li`,{children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:o(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:kt(e.trigger,a)}),(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:ct(e.timestamp,_,c)})]}),e.snippet&&(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,$.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:s?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:a.restoreConfirm}),(0,$.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),g(e.timestamp)},disabled:f,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:f?`...`:a.restore}),(0,$.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),h(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,$.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),h(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:a.restore})})]},e.timestamp)})}):(0,$.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:a.historyEmpty}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:a.historyEmptyDescription})]})})]})}function jt(e){let t=(0,Z.c)(10),{noteId:n,note:r,catalyzing:i,onCatalyze:c,onClose:u,noteThreads:p,openingChat:m,onOpenChat:h,onOpenNewChat:g}=e,_=s(l(Rt)).notes,v=a(),y=r?.aiDeep?.catalysis,b=y?.report??null,x;t[0]===n?x=t[1]:(x=n?[`note-agent-context-status`,n]:null,t[0]=n,t[1]=x);let S;t[2]===n?S=t[3]:(S=()=>Ce(n),t[2]=n,t[3]=S);let C;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[4]=C):C=t[4];let{data:w,mutate:T,isLoading:E}=d(x,S,C),O;t[5]===n?O=t[6]:(O=async e=>{try{await Ye(n,e)}catch{}},t[5]=n,t[6]=O);let k=O,A;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(de,{className:`size-4 text-accent`,"aria-hidden":!0}),t[7]=A):A=t[7];let j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(D,{className:`size-4 rotate-180`,"aria-hidden":!0}),t[8]=j):j=t[8];let M;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(f,{className:`size-4 text-accent`,"aria-hidden":!0}),t[9]=M):M=t[9],(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:_.catalysisSectionTitle})]}),(0,$.jsx)(`button`,{type:`button`,onClick:u,"aria-label":_.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:j})]}),(0,$.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,$.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:_.catalysisSectionDescription}),w?(0,$.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.contextStatusTitle}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void T(()=>Be(n),{revalidate:!1}),disabled:E,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:_.contextRebuild}),(0,$.jsx)(`span`,{className:o(`rounded-full px-2 py-0.5 text-[11px] font-medium`,w.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:w.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:w.status})]}),(0,$.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:_.contextStatusDetail.replace(`{{attachments}}`,String(w.attachments.length)).replace(`{{tokens}}`,String(w.tokenEstimate??0))}),w.attachments.length>0?(0,$.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:w.attachments.slice(0,5).map(Lt)}):null]}):null,(0,$.jsx)(`button`,{type:`button`,onClick:c,disabled:i,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:i?_.processing:b?_.recatalyze:_.catalyzeAction}),b?(0,$.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.valueHypothesis}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:b.valueHypothesis})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.targetUsers}),(0,$.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:b.targetUsers.slice(0,5).map(It)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.keyQuestions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.keyQuestions.slice(0,3).map(Ft)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.mvpPathLabel}),(0,$.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.mvpPath.slice(0,3).map(Pt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.risks}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.risks.slice(0,3).map(Nt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.nextActions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.nextActions.slice(0,4).map(Mt)})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:_.confidenceLabel.replace(`{{percent}}`,String(Math.round(b.confidence*100)))}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>void k(`helpful`),className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,y?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":_.feedbackHelpfulAria,children:(0,$.jsx)(V,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void k(`not_helpful`),className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,y?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":_.feedbackNotHelpfulAria,children:(0,$.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,$.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:_.noCatalysisReportHint}),(0,$.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[M,_.relatedThreadsTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:_.relatedThreadsDescription})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:h,disabled:m,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:m?_.openingChat:_.openThread}),(0,$.jsx)(`button`,{type:`button`,onClick:g,disabled:m,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:_.newThread})]})]}),p.length>0?(0,$.jsx)(`div`,{className:`space-y-2`,children:p.slice(0,5).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>v(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,$.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||_.noteDiscussionFallback}),(0,$.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:_.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,$.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:_.noThreads})]})]})]})}function Mt(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,$.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`)}function Nt(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,$.jsx)(`span`,{children:e})]},e)}function Pt(e,t){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,$.jsx)(`span`,{children:e})]},e)}function Ft(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,$.jsx)(`span`,{children:e})]},e)}function It(e){return(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e)}function Lt(e){return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,$.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId)}function Rt(e){return e.language}var zt=()=>i(()=>import(`./block-editor-Z_k8W0al.js`),__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])),Bt=()=>i(()=>import(`./markdown-editor-BvUebh3C.js`).then(e=>e.n),__vite__mapDeps([27,1,3,24,5,28])),Vt=(0,Q.lazy)(()=>zt().then(e=>({default:e.BlockEditor}))),Ht=(0,Q.lazy)(()=>Bt().then(e=>({default:e.MarkdownEditor})));function Ut(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,$.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function Wt(e){let t=(0,Z.c)(14),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:Ze},t[0]=i.edit,t[1]=a);let s;t[2]===i.source?s=t[3]:(s={id:`source`,label:i.source,Icon:Ie},t[2]=i.source,t[3]=s);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:R},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==s||t[8]!==c?(l=[a,s,c],t[6]=a,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=l,d;return t[10]!==n||t[11]!==u||t[12]!==r?(d=(0,$.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg border border-edge p-0.5`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r(t),onMouseEnter:()=>{t===`wysiwyg`&&zt(),t===`source`&&Bt()},onFocus:()=>{t===`wysiwyg`&&zt(),t===`source`&&Bt()},className:o(`inline-flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-medium transition-colors`,n===t?`bg-surface-hover text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,$.jsx)(a,{className:`size-3.5`,"aria-hidden":!0}),i]},t)})}),t[10]=n,t[11]=u,t[12]=r,t[13]=d):d=t[13],d}function Gt(e){let t=(0,Z.c)(15),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:c,onOpenSearch:u,autoFocus:d,onAutoFocusConsumed:f}=e,p=a===void 0?!0:a,m=c===void 0?!0:c,h=d===void 0?!1:d,g=l(Kt),_;t[0]===g?_=t[1]:(_=s(g),t[0]=g,t[1]=_);let v=_.notes.lightboxClose,y;t[2]!==h||t[3]!==o||t[4]!==m||t[5]!==n||t[6]!==f||t[7]!==r||t[8]!==u||t[9]!==i||t[10]!==p?(y=(0,$.jsx)(qt,{noteId:n,onBack:r,onSaved:i,showBackButton:p,backButtonClassName:o,clearHeaderOnCleanup:m,onOpenSearch:u,autoFocus:h,onAutoFocusConsumed:f}),t[2]=h,t[3]=o,t[4]=m,t[5]=n,t[6]=f,t[7]=r,t[8]=u,t[9]=i,t[10]=p,t[11]=y):y=t[11];let b;return t[12]!==v||t[13]!==y?(b=(0,$.jsx)(nt,{closeLabel:v,children:y}),t[12]=v,t[13]=y,t[14]=b):b=t[14],b}function Kt(e){return e.language}function qt({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:c=!0,onOpenSearch:m,autoFocus:h=!1,onAutoFocusConsumed:v}){let y=l(e=>e.language),b=s(y).notes,x=s(y).automations.suggestions,S=a(),C=u(e=>e.resolved)===`dark`,{openImage:w}=et(),[E,O]=(0,Q.useState)(`wysiwyg`),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[N,P]=(0,Q.useState)(!1),[F,I]=(0,Q.useState)(``),[L,ee]=(0,Q.useState)(360),[te,ne]=(0,Q.useState)(!1),[R,re]=(0,Q.useState)(!1),[ie,B]=(0,Q.useState)(!1),V=(0,Q.useRef)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useRef)(null),W=(0,Q.useRef)(null),G=(0,Q.useRef)(null),ce=(0,Q.useRef)(null),le=(0,Q.useRef)(null),ue=(0,Q.useRef)(null),K=(0,Q.useRef)(null),pe=(0,Q.useRef)(null),q=(0,Q.useRef)(null),ge=_(e=>e.setPageHeader),_e=_(e=>e.clearPageHeader),{data:J,mutate:Y}=d(e?[`note-detail`,e]:null,()=>fe(e)),{data:ve=[],mutate:ye}=d(e?[`note-threads`,e]:null,()=>me(e),{revalidateOnFocus:!1}),be=j!==null;(0,Q.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&Y()};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[Y,e]),(0,Q.useEffect)(()=>{V.current=!1,I(``),M(null),A(null),H.current=!1,q.current=null},[e]),(0,Q.useEffect)(()=>{!J||V.current||(I(J.title??``),V.current=!0)},[J]),(0,Q.useEffect)(()=>{if(!h||!J||be||q.current===e)return;let t=window.requestAnimationFrame(()=>{pe.current?.focus(),v?.()});return q.current=e,()=>window.cancelAnimationFrame(t)},[h,be,J,e,v]);let xe=J?new Date(J.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,Se=(0,Q.useMemo)(()=>r?(0,$.jsx)(`button`,{type:`button`,onClick:t,"aria-label":b.back,className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,T,i),children:(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0})}):null,[i,b.back,t,r]),Ce=(0,Q.useCallback)(t=>{I(t),e&&(ce.current=t,W.current&&clearTimeout(W.current),W.current=setTimeout(async()=>{let t=ce.current;if(ce.current=null,t!==null){P(!0);try{await qe(e,{title:t}),await Y(),n?.()}catch{}finally{P(!1)}}},600))},[e,Y,n]),Te=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:o(`flex min-w-0 items-center gap-2`,T),children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:F||xe||void 0,children:F||xe}),N?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:b.saving}):null]}),[b.saving,N,xe,F]),Ee=(0,Q.useCallback)(async(t=!1)=>{B(!0);try{let n=await we(e,{forceNew:t});await Y(),await ye(),S(`/chat/${encodeURIComponent(n.sessionKey)}`)}catch(e){ae({type:`error`,title:b.chatOpenFailedTitle,message:e instanceof Error?e.message:b.chatOpenFailedMessage})}finally{B(!1)}},[Y,ye,S,e,b.chatOpenFailedMessage,b.chatOpenFailedTitle]),X=(0,Q.useCallback)(async()=>{re(!0);try{await se(e),await Y()}catch(e){ae({type:`error`,title:b.catalysisFailed,message:e instanceof Error?e.message:b.chatOpenFailedMessage})}finally{re(!1)}},[Y,e]),De=(0,Q.useCallback)(()=>{A(k===`breakdown`?null:`breakdown`),!J?.aiDeep?.catalysis?.report&&!R&&X()},[k,R,X,J?.aiDeep?.catalysis?.report]),Oe=(0,Q.useCallback)(()=>{let t=j?.markdown??G.current??J?.markdown??``,n=j?.title??F,r=z([n,t].filter(Boolean).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-D_VVXlYX.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-BA56bQ68.js","assets/preload-helper-zJ_50EbN.js","assets/Combination-14nmIgxH.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-C230izr8.js","assets/chunk-KS7C4IRE-BMhrPKJC.js","assets/vendor-swr-BIWyz7Rc.js","assets/createLucideIcon-DPHK1VkS.js","assets/check-DUBLcKHA.js","assets/middleware-Pd0e8Igk.js","assets/locale-store-BNC8HUCI.js","assets/messages-H_iJjnEM.js","assets/cn-JdwAhgNB.js","assets/schemas-C6onAggk.js","assets/product-delivery-BVG-eWQO.js","assets/config-reload-event-Bjh2zoKp.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/gateway-startup-retry-CSU7UvzG.js","assets/activity-store-DFKtQDgE.js","assets/theme-store-ClDa_Bci.js","assets/index-B0Tdge_q.css","assets/vendor-codemirror--gTq3YAI.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-D4ZIVQbk.css","assets/markdown-editor-BvUebh3C.js","assets/code-editor-D4_k-6QN.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{l as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as o}from"./cn-JdwAhgNB.js";import{t as s}from"./messages-H_iJjnEM.js";import{l as c,n as l}from"./locale-store-BNC8HUCI.js";import{i as u}from"./theme-store-ClDa_Bci.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{$c as f,B as p,Ci as m,Cl as h,Cr as g,Do as _,Du as v,Ei as y,Er as b,Fc as x,Go as S,Gs as C,Ho as w,Hu as T,Ic as E,Iu as D,Js as O,Ko as k,Lc as A,Mu as j,Nc as M,Ps as N,Qn as P,Ru as F,Si as I,Ti as L,Uo as ee,Vc as te,Vo as ne,Wl as R,Wo as re,Xn as z,Xs as ie,Yc as B,Yo as ae,Ys as V,Zn as oe,_ as H,_c as U,_r as W,ac as G,ar as se,as as ce,b as le,bl as ue,br as K,cc as de,cr as fe,dl as pe,dr as q,fr as me,g as he,gl as ge,gr as _e,hr as J,ir as Y,is as ve,iu as ye,jc as be,js as xe,jt as Se,lr as Ce,mr as we,mu as Te,nc as Ee,nl as X,nr as De,or as Oe,pr as ke,ql as Ae,qo as je,ro as Me,rr as Ne,sc as Pe,sr as Fe,tu as Ie,ur as Le,v as Re,vc as ze,vr as Be,wc as Ve,wi as He,wl as Ue,wr as We,xi as Ge,xl as Ke,xr as qe,y as Je,yr as Ye,zc as Xe,zl as Ze,zu as Qe}from"./index-BA56bQ68.js";var Z=n(),Q=e(t(),1),$=r(),$e=(0,Q.createContext)(null);function et(){let e=(0,Z.c)(1),t=(0,Q.useContext)($e);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:tt},e[0]=t):t=e[0],t}return t}function tt(){}function nt(e){let t=(0,Z.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,s]=(0,Q.useState)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(e,t)=>{s({src:e,alt:t})},t[0]=c):c=t[0];let l=c,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={openImage:l},t[1]=u):u=t[1];let d=u,f=a!==null,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e||s(null)},t[2]=p):p=t[2];let m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(S,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=m):m=t[3];let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=o(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=h):h=t[4];let g=a?.alt||`Image preview`,_;t[5]===g?_=t[6]:(_=(0,$.jsx)(je,{className:`sr-only`,children:g}),t[5]=g,t[6]=_);let v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(N,{className:`size-5`,"aria-hidden":!0}),t[7]=v):v=t[7];let y;t[8]===i?y=t[9]:(y=(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":i,className:`absolute right-4 top-4 z-10 rounded-lg bg-surface-panel/80 p-2 text-fg-muted backdrop-blur transition-colors hover:bg-surface-hover hover:text-fg`,children:v})}),t[8]=i,t[9]=y);let b;t[10]===a?b=t[11]:(b=a?(0,$.jsx)(`img`,{src:a.src,alt:a.alt??``,className:`max-h-[min(90vh,900px)] max-w-[min(95vw,1200px)] rounded-lg object-contain shadow-lg`}):null,t[10]=a,t[11]=b);let x;t[12]!==y||t[13]!==b||t[14]!==_?(x=(0,$.jsxs)(k,{children:[m,(0,$.jsxs)(ee,{className:h,"aria-describedby":void 0,children:[_,y,b]})]}),t[12]=y,t[13]=b,t[14]=_,t[15]=x):x=t[15];let C;t[16]!==x||t[17]!==f?(C=(0,$.jsx)(ne,{open:f,onOpenChange:p,children:x}),t[16]=x,t[17]=f,t[18]=C):C=t[18];let T;return t[19]!==n||t[20]!==C?(T=(0,$.jsxs)($e.Provider,{value:d,children:[n,C]}),t[19]=n,t[20]=C,t[21]=T):T=t[21],T}function rt(e){let t=(0,Z.c)(15),{noteId:n,attachmentId:r,className:i}=e,[a,s]=(0,Q.useState)(!1),c;t[0]!==r||t[1]!==n?(c=b(n,r),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l=c;if(a){let e;t[3]===i?e=t[4]:(e=o(`flex size-12 shrink-0 items-center justify-center rounded-lg border border-edge-subtle bg-surface-hover text-fg-muted`,i),t[3]=i,t[4]=e);let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(h,{className:`size-4`}),t[5]=n):n=t[5];let r;return t[6]===e?r=t[7]:(r=(0,$.jsx)(`div`,{className:e,"aria-hidden":!0,children:n}),t[6]=e,t[7]=r),r}let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(!0),t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=o(`size-12 shrink-0 rounded-lg border border-edge-subtle bg-surface-hover object-cover`,i),t[9]=i,t[10]=d);let f;return t[11]!==n||t[12]!==l||t[13]!==d?(f=(0,$.jsx)(We,{src:l,expectedNoteId:n,alt:``,loading:`lazy`,draggable:!1,onLoadFailed:u,className:d}),t[11]=n,t[12]=l,t[13]=d,t[14]=f):f=t[14],f}var it=6e4,at=36e5,ot=864e5;function st(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function ct(e,t,n){let r=t-e;if(r<it)return n.justNow;if(r<at){let e=Math.floor(r/it);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=st(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(e>=i-ot)return n.yesterday+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(r<7*ot){let e=Math.floor(r/ot);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function lt(e,t,n){let r=st(t);if(e>=r)return n.today;if(e>=r-ot)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(void 0,{month:`long`,day:`numeric`}):i.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function ut(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function dt(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,`0`)}`}function ft(e){let t=(0,Z.c)(38),{noteId:n,attachmentId:r,durationSec:i,className:a}=e,{playing:s,loading:c,currentTime:l,duration:u,noteId:d,attachmentId:f}=P(),p=P(mt),m=d===n&&f===r,h=m&&s,g=m&&c,_=m?l:0,v=m&&u>0?u:i??0,y=v>0?Math.min(_/v*100,100):0,b;t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==p?(b=e=>{e.stopPropagation(),p(n,r,i)},t[0]=r,t[1]=i,t[2]=n,t[3]=p,t[4]=b):b=t[4];let x=b,S;t[5]!==r||t[6]!==i||t[7]!==n||t[8]!==p?(S=e=>{(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),p(n,r,i))},t[5]=r,t[6]=i,t[7]=n,t[8]=p,t[9]=S):S=t[9];let C=S,w;t[10]===a?w=t[11]:(w=o(`flex items-center gap-2`,a),t[10]=a,t[11]=w);let T=h?`bg-accent text-white`:`bg-accent/10 text-accent hover:bg-accent/20`,E;t[12]===T?E=t[13]:(E=o(`flex size-7 shrink-0 items-center justify-center rounded-full transition-colors`,T),t[12]=T,t[13]=E);let D=h?`Pause`:`Play`,O;t[14]!==g||t[15]!==h?(O=g?(0,$.jsx)(X,{className:`size-3.5 animate-spin`}):h?(0,$.jsx)(Xe,{className:`size-3.5`}):(0,$.jsx)(M,{className:`size-3.5 ml-0.5`}),t[14]=g,t[15]=h,t[16]=O):O=t[16];let k;t[17]!==x||t[18]!==C||t[19]!==E||t[20]!==D||t[21]!==O?(k=(0,$.jsx)(`button`,{type:`button`,onClick:x,onKeyDown:C,className:E,"aria-label":D,children:O}),t[17]=x,t[18]=C,t[19]=E,t[20]=D,t[21]=O,t[22]=k):k=t[22];let A=`${y}%`,j;t[23]===A?j=t[24]:(j=(0,$.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-accent/10`,children:(0,$.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width] duration-200 ease-linear`,style:{width:A}})}),t[23]=A,t[24]=j);let N;t[25]!==v||t[26]!==m||t[27]!==_?(N=dt(m&&_>0?_:v),t[25]=v,t[26]=m,t[27]=_,t[28]=N):N=t[28];let F;t[29]===N?F=t[30]:(F=(0,$.jsx)(`span`,{className:`text-[10px] tabular-nums text-fg-muted`,children:N}),t[29]=N,t[30]=F);let I;t[31]!==j||t[32]!==F?(I=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[j,F]}),t[31]=j,t[32]=F,t[33]=I):I=t[33];let L;return t[34]!==I||t[35]!==w||t[36]!==k?(L=(0,$.jsxs)(`div`,{className:w,onClick:pt,children:[k,I]}),t[34]=I,t[35]=w,t[36]=k,t[37]=L):L=t[37],L}function pt(e){return e.stopPropagation()}function mt(e){return e.toggle}function ht(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function gt(e){let t=(0,Z.c)(80),{note:n,selected:r,onPress:i,onPin:a,onArchive:s,onDelete:c,labels:l,timeLabels:u}=e,d=r===void 0?!1:r,f;t[0]!==l||t[1]!==n?(f=ht(n,l),t[0]=l,t[1]=n,t[2]=f):f=t[2];let p=f,h=!n.snippet?.trim(),[g]=(0,Q.useState)(bt),_;t[3]!==n.createdAt||t[4]!==g||t[5]!==u?(_=ct(n.createdAt,g,u),t[3]=n.createdAt,t[4]=g,t[5]=u,t[6]=_):_=t[6];let v=_,b,S;t[7]!==n.id||t[8]!==i?(b=()=>i(n.id),S=e=>{(e.key===`Enter`||e.key===` `)&&i(n.id)},t[7]=n.id,t[8]=i,t[9]=b,t[10]=S):(b=t[9],S=t[10]);let C=d?`bg-surface-active hover:bg-surface-active`:`bg-surface-base hover:bg-surface-hover`,w;t[11]===C?w=t[12]:(w=o(`group relative flex cursor-pointer flex-col gap-2 rounded-lg px-3 py-2.5`,`transition-colors duration-150 ease-out`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,C),t[11]=C,t[12]=w);let T=d?`true`:void 0,D;t[13]!==n.coverAttachmentId||t[14]!==n.id||t[15]!==n.kind||t[16]!==n.voiceAttachmentId||t[17]!==n.voiceDurationSec?(D=n.coverAttachmentId?(0,$.jsx)(rt,{noteId:n.id,attachmentId:n.coverAttachmentId}):n.kind===`voice`&&n.voiceAttachmentId?(0,$.jsx)(ft,{noteId:n.id,attachmentId:n.voiceAttachmentId,durationSec:n.voiceDurationSec,className:`mt-0.5 w-28 shrink-0`}):null,t[13]=n.coverAttachmentId,t[14]=n.id,t[15]=n.kind,t[16]=n.voiceAttachmentId,t[17]=n.voiceDurationSec,t[18]=D):D=t[18];let k;t[19]===n.title?k=t[20]:(k=n.title&&(0,$.jsx)(`h3`,{className:`mb-0.5 truncate text-sm font-semibold text-fg`,children:n.title}),t[19]=n.title,t[20]=k);let A=n.title?`text-fg-muted`:h?`italic text-fg-muted`:`text-fg`,j;t[21]===A?j=t[22]:(j=o(`truncate text-sm leading-5`,A),t[21]=A,t[22]=j);let M;t[23]!==p||t[24]!==j?(M=(0,$.jsx)(`p`,{className:j,children:p}),t[23]=p,t[24]=j,t[25]=M):M=t[25];let N;t[26]!==k||t[27]!==M?(N=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[k,M]}),t[26]=k,t[27]=M,t[28]=N):N=t[28];let P;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:yt,className:`shrink-0 rounded-md p-1 text-fg-muted opacity-0 transition-opacity group-hover:opacity-100 hover:bg-surface-panel focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":`Actions`,children:(0,$.jsx)(Ae,{className:`size-4`})})}),t[29]=P):P=t[29];let F;t[30]!==n.id||t[31]!==n.pinned||t[32]!==a?(F=()=>a(n.id,!n.pinned),t[30]=n.id,t[31]=n.pinned,t[32]=a,t[33]=F):F=t[33];let ee;t[34]===n.pinned?ee=t[35]:(ee=n.pinned?(0,$.jsx)(x,{className:`size-4`}):(0,$.jsx)(E,{className:`size-4`}),t[34]=n.pinned,t[35]=ee);let te=n.pinned?l.unpin:l.pin,ne;t[36]!==F||t[37]!==ee||t[38]!==te?(ne=(0,$.jsxs)(I,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:F,children:[ee,te]}),t[36]=F,t[37]=ee,t[38]=te,t[39]=ne):ne=t[39];let R;t[40]!==n.id||t[41]!==s?(R=()=>s(n.id),t[40]=n.id,t[41]=s,t[42]=R):R=t[42];let re;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(Qe,{className:`size-4`}),t[43]=re):re=t[43];let z;t[44]!==l.archive||t[45]!==R?(z=(0,$.jsxs)(I,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:R,children:[re,l.archive]}),t[44]=l.archive,t[45]=R,t[46]=z):z=t[46];let ie;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(L,{className:`my-1 h-px bg-edge-subtle`}),t[47]=ie):ie=t[47];let B;t[48]!==n.id||t[49]!==c?(B=()=>c(n.id),t[48]=n.id,t[49]=c,t[50]=B):B=t[50];let ae;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(O,{className:`size-4`}),t[51]=ae):ae=t[51];let V;t[52]!==l.delete||t[53]!==B?(V=(0,$.jsxs)(I,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-500 outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:B,children:[ae,l.delete]}),t[52]=l.delete,t[53]=B,t[54]=V):V=t[54];let oe;t[55]!==ne||t[56]!==z||t[57]!==V?(oe=(0,$.jsxs)(He,{children:[P,(0,$.jsx)(m,{children:(0,$.jsxs)(Ge,{className:`z-50 min-w-[140px] rounded-xl border border-edge bg-surface-panel p-1 shadow-lg`,sideOffset:4,align:`end`,onClick:vt,children:[ne,z,ie,V]})})]}),t[55]=ne,t[56]=z,t[57]=V,t[58]=oe):oe=t[58];let H;t[59]!==N||t[60]!==oe||t[61]!==D?(H=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[D,N,oe]}),t[59]=N,t[60]=oe,t[61]=D,t[62]=H):H=t[62];let U;t[63]===n.pinned?U=t[64]:(U=n.pinned&&(0,$.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs font-medium text-accent`,children:(0,$.jsx)(E,{className:`size-3`})}),t[63]=n.pinned,t[64]=U);let W;t[65]===n.tags?W=t[66]:(W=n.tags?.slice(0,2).map(_t),t[65]=n.tags,t[66]=W);let G;t[67]===v?G=t[68]:(G=(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:v}),t[67]=v,t[68]=G);let se;t[69]!==U||t[70]!==W||t[71]!==G?(se=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[U,W,G]}),t[69]=U,t[70]=W,t[71]=G,t[72]=se):se=t[72];let ce;return t[73]!==H||t[74]!==se||t[75]!==b||t[76]!==S||t[77]!==w||t[78]!==T?(ce=(0,$.jsxs)(`article`,{role:`button`,tabIndex:0,onClick:b,onKeyDown:S,className:w,"aria-current":T,children:[H,se]}),t[73]=H,t[74]=se,t[75]=b,t[76]=S,t[77]=w,t[78]=T,t[79]=ce):ce=t[79],ce}function _t(e){return(0,$.jsx)(`span`,{className:`max-w-24 truncate rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e)}function vt(e){return e.stopPropagation()}function yt(e){return e.stopPropagation()}function bt(){return Date.now()}function xt(e){let t=(0,Z.c)(45),{title:n,description:r,prompt:i,coverage:c,className:u,variant:f}=e,p=f===void 0?`card`:f,m=l(wt),h=s(m).automations.suggestions,g=s(m).automations,_=a(),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=v):v=t[0];let{data:y}=d(c?`automation-suggestion-coverage`:null,Ct,v),b=c?y?.automations.find(e=>Je(e,c)):void 0,x=b?H(b,g):[];if(p===`titleAction`){if(b){let e;t[1]===u?e=t[2]:(e=o(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,u),t[1]=u,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Te,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===_?r=t[5]:(r=()=>_(`/automations`),t[4]=_,t[5]=r),(0,$.jsxs)(`section`,{className:e,children:[n,(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:h.coveredTitle}),(0,$.jsx)(xe,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:h.manage})]})}let e;t[6]===u?e=t[7]:(e=o(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,u),t[6]=u,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(pe,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let s;t[9]!==r||t[10]!==n?(s=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=s):s=t[11];let c;t[12]!==_||t[13]!==i?(c=()=>{_(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=_,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(de,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,$.jsxs)(`section`,{className:e,children:[a,s,(0,$.jsxs)(xe,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,h.create]})]})}if(b){let e;t[16]===u?e=t[17]:(e=o(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,u),t[16]=u,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Te,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===_?r=t[20]:(r=()=>_(`/automations`),t[19]=_,t[20]=r);let i;return t[21]!==h||t[22]!==r?(i=(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsx)(xe,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:h.manage})}),t[21]=h,t[22]=r,t[23]=i):i=t[23],(0,$.jsxs)(`section`,{className:e,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:h.coveredTitle}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:Re(h.coveredDescription,{name:b.name})})]})]}),(0,$.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:g.explain.whyCovered}),(0,$.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(St)})]}),i]})}let S;t[24]===u?S=t[25]:(S=o(`rounded-lg bg-surface-panel p-3 shadow-surface`,u),t[24]=u,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(pe,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]===n?w=t[28]:(w=(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=w);let T;t[29]===r?T=t[30]:(T=(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=T);let E;t[31]!==w||t[32]!==T?(E=(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})]}),t[31]=w,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==_||t[35]!==i?(D=()=>{_(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=_,t[35]=i,t[36]=D):D=t[36];let O;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(de,{className:`size-3.5`,"aria-hidden":!0}),t[37]=O):O=t[37];let k;t[38]!==h.create||t[39]!==D?(k=(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsxs)(xe,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:D,children:[O,h.create]})}),t[38]=h.create,t[39]=D,t[40]=k):k=t[40];let A;return t[41]!==k||t[42]!==S||t[43]!==E?(A=(0,$.jsxs)(`section`,{className:S,children:[E,k]}),t[41]=k,t[42]=S,t[43]=E,t[44]=A):A=t[44],A}function St(e){return(0,$.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function Ct(){return le.list()}function wt(e){return e.language}function Tt(e){let t=(0,Z.c)(31),{noteId:n}=e,r=l(Dt),i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let a=i.notes.discussionCapture,o,c;t[2]===n?(o=t[3],c=t[4]):(o=[`note-discussion`,n],c=()=>De(n),t[2]=n,t[3]=o,t[4]=c);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={refreshInterval:5e3},t[5]=u):u=t[5];let{data:f,mutate:p}=d(o,c,u),m=f?.discussion,h=m?.status===`recording`||m?.status===`finalizing`,g=h?m.id:null,_;t[6]===g?_=t[7]:(_=g?[`note-discussion-transcript`,g]:null,t[6]=g,t[7]=_);let v=h?5e3:0,y;t[8]===v?y=t[9]:(y={refreshInterval:v},t[8]=v,t[9]=y);let{data:b,mutate:x}=d(_,Et,y),S,w;if(t[10]!==g||t[11]!==p||t[12]!==x?(S=()=>{if(!g)return;let e=()=>{p(),x()};return window.addEventListener(`discussion-updated`,e),window.addEventListener(`discussion-transcript-updated`,e),()=>{window.removeEventListener(`discussion-updated`,e),window.removeEventListener(`discussion-transcript-updated`,e)}},w=[g,p,x],t[10]=g,t[11]=p,t[12]=x,t[13]=S,t[14]=w):(S=t[13],w=t[14]),(0,Q.useEffect)(S,w),!h||!m)return null;let T=m.projectId&&m.projectInferenceSource!==`context`,E;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t[15]=E):E=t[15];let D=m.status===`recording`?a.draftTranscript:a.finalizing,O;t[16]===D?O=t[17]:(O=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[E,D]}),t[16]=D,t[17]=O);let k;t[18]!==a.undo||t[19]!==m.id||t[20]!==T||t[21]!==p?(k=T?(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-xs font-medium text-accent-fg`,onClick:async()=>p(await Y(m.id),{revalidate:!1}),children:[(0,$.jsx)(C,{className:`size-3`,"aria-hidden":!0}),a.undo]}):null,t[18]=a.undo,t[19]=m.id,t[20]=T,t[21]=p,t[22]=k):k=t[22];let A;t[23]!==O||t[24]!==k?(A=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[O,k]}),t[23]=O,t[24]=k,t[25]=A):A=t[25];let j=b?.text||a.waitingTranscript,M;t[26]===j?M=t[27]:(M=(0,$.jsx)(`p`,{className:`mt-2 max-h-36 overflow-y-auto whitespace-pre-wrap text-sm leading-6 text-fg`,children:j}),t[26]=j,t[27]=M);let N;return t[28]!==A||t[29]!==M?(N=(0,$.jsxs)(`section`,{className:`mb-3 shrink-0 rounded-xl border border-accent/25 bg-accent-soft px-4 py-3`,children:[A,M]}),t[28]=A,t[29]=M,t[30]=N):N=t[30],N}function Et(e){let[,t]=e;return Ne(t)}function Dt(e){return e.language}var Ot={edit:A,ai_edit:de,sync:Ve,restore:F};function kt(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function At({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=s(l(e=>e.language)).notes,c=a,{data:u}=d(e?[`note-history`,e]:null,()=>q(e)),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),g=(0,Q.useCallback)(async t=>{p(!0);try{await K(e,t),h(null),i()}catch{ae({type:`error`,title:a.restoreFailed})}finally{p(!1)}},[e,a.restoreSuccess,a.restoreFailed,i]),_=Date.now();return(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,$.jsx)(Ue,{className:`size-4`,"aria-hidden":!0}),a.history]}),(0,$.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,$.jsx)(N,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:u?.length?(0,$.jsx)(`ul`,{className:`divide-y divide-edge`,children:u.map(e=>{let r=Ot[e.trigger]??A,i=t===e.timestamp,s=m===e.timestamp;return(0,$.jsxs)(`li`,{children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:o(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:kt(e.trigger,a)}),(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:ct(e.timestamp,_,c)})]}),e.snippet&&(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,$.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:s?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:a.restoreConfirm}),(0,$.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),g(e.timestamp)},disabled:f,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:f?`...`:a.restore}),(0,$.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),h(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,$.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),h(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:a.restore})})]},e.timestamp)})}):(0,$.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:a.historyEmpty}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:a.historyEmptyDescription})]})})]})}function jt(e){let t=(0,Z.c)(10),{noteId:n,note:r,catalyzing:i,onCatalyze:c,onClose:u,noteThreads:p,openingChat:m,onOpenChat:h,onOpenNewChat:g}=e,_=s(l(Rt)).notes,v=a(),y=r?.aiDeep?.catalysis,b=y?.report??null,x;t[0]===n?x=t[1]:(x=n?[`note-agent-context-status`,n]:null,t[0]=n,t[1]=x);let S;t[2]===n?S=t[3]:(S=()=>Ce(n),t[2]=n,t[3]=S);let C;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[4]=C):C=t[4];let{data:w,mutate:T,isLoading:E}=d(x,S,C),O;t[5]===n?O=t[6]:(O=async e=>{try{await Ye(n,e)}catch{}},t[5]=n,t[6]=O);let k=O,A;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(de,{className:`size-4 text-accent`,"aria-hidden":!0}),t[7]=A):A=t[7];let j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(D,{className:`size-4 rotate-180`,"aria-hidden":!0}),t[8]=j):j=t[8];let M;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(f,{className:`size-4 text-accent`,"aria-hidden":!0}),t[9]=M):M=t[9],(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:_.catalysisSectionTitle})]}),(0,$.jsx)(`button`,{type:`button`,onClick:u,"aria-label":_.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:j})]}),(0,$.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,$.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:_.catalysisSectionDescription}),w?(0,$.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.contextStatusTitle}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void T(()=>Be(n),{revalidate:!1}),disabled:E,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:_.contextRebuild}),(0,$.jsx)(`span`,{className:o(`rounded-full px-2 py-0.5 text-[11px] font-medium`,w.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:w.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:w.status})]}),(0,$.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:_.contextStatusDetail.replace(`{{attachments}}`,String(w.attachments.length)).replace(`{{tokens}}`,String(w.tokenEstimate??0))}),w.attachments.length>0?(0,$.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:w.attachments.slice(0,5).map(Lt)}):null]}):null,(0,$.jsx)(`button`,{type:`button`,onClick:c,disabled:i,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:i?_.processing:b?_.recatalyze:_.catalyzeAction}),b?(0,$.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.valueHypothesis}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:b.valueHypothesis})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.targetUsers}),(0,$.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:b.targetUsers.slice(0,5).map(It)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.keyQuestions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.keyQuestions.slice(0,3).map(Ft)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.mvpPathLabel}),(0,$.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.mvpPath.slice(0,3).map(Pt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.risks}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.risks.slice(0,3).map(Nt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.nextActions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.nextActions.slice(0,4).map(Mt)})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:_.confidenceLabel.replace(`{{percent}}`,String(Math.round(b.confidence*100)))}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>void k(`helpful`),className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,y?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":_.feedbackHelpfulAria,children:(0,$.jsx)(V,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void k(`not_helpful`),className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,y?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":_.feedbackNotHelpfulAria,children:(0,$.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,$.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:_.noCatalysisReportHint}),(0,$.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[M,_.relatedThreadsTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:_.relatedThreadsDescription})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:h,disabled:m,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:m?_.openingChat:_.openThread}),(0,$.jsx)(`button`,{type:`button`,onClick:g,disabled:m,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:_.newThread})]})]}),p.length>0?(0,$.jsx)(`div`,{className:`space-y-2`,children:p.slice(0,5).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>v(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,$.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||_.noteDiscussionFallback}),(0,$.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:_.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,$.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:_.noThreads})]})]})]})}function Mt(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,$.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`)}function Nt(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,$.jsx)(`span`,{children:e})]},e)}function Pt(e,t){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,$.jsx)(`span`,{children:e})]},e)}function Ft(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,$.jsx)(`span`,{children:e})]},e)}function It(e){return(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e)}function Lt(e){return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,$.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId)}function Rt(e){return e.language}var zt=()=>i(()=>import(`./block-editor-D_VVXlYX.js`),__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])),Bt=()=>i(()=>import(`./markdown-editor-BvUebh3C.js`).then(e=>e.n),__vite__mapDeps([27,1,3,24,5,28])),Vt=(0,Q.lazy)(()=>zt().then(e=>({default:e.BlockEditor}))),Ht=(0,Q.lazy)(()=>Bt().then(e=>({default:e.MarkdownEditor})));function Ut(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,$.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function Wt(e){let t=(0,Z.c)(14),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:Ze},t[0]=i.edit,t[1]=a);let s;t[2]===i.source?s=t[3]:(s={id:`source`,label:i.source,Icon:Ie},t[2]=i.source,t[3]=s);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:R},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==s||t[8]!==c?(l=[a,s,c],t[6]=a,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=l,d;return t[10]!==n||t[11]!==u||t[12]!==r?(d=(0,$.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg border border-edge p-0.5`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r(t),onMouseEnter:()=>{t===`wysiwyg`&&zt(),t===`source`&&Bt()},onFocus:()=>{t===`wysiwyg`&&zt(),t===`source`&&Bt()},className:o(`inline-flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-medium transition-colors`,n===t?`bg-surface-hover text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,$.jsx)(a,{className:`size-3.5`,"aria-hidden":!0}),i]},t)})}),t[10]=n,t[11]=u,t[12]=r,t[13]=d):d=t[13],d}function Gt(e){let t=(0,Z.c)(15),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:c,onOpenSearch:u,autoFocus:d,onAutoFocusConsumed:f}=e,p=a===void 0?!0:a,m=c===void 0?!0:c,h=d===void 0?!1:d,g=l(Kt),_;t[0]===g?_=t[1]:(_=s(g),t[0]=g,t[1]=_);let v=_.notes.lightboxClose,y;t[2]!==h||t[3]!==o||t[4]!==m||t[5]!==n||t[6]!==f||t[7]!==r||t[8]!==u||t[9]!==i||t[10]!==p?(y=(0,$.jsx)(qt,{noteId:n,onBack:r,onSaved:i,showBackButton:p,backButtonClassName:o,clearHeaderOnCleanup:m,onOpenSearch:u,autoFocus:h,onAutoFocusConsumed:f}),t[2]=h,t[3]=o,t[4]=m,t[5]=n,t[6]=f,t[7]=r,t[8]=u,t[9]=i,t[10]=p,t[11]=y):y=t[11];let b;return t[12]!==v||t[13]!==y?(b=(0,$.jsx)(nt,{closeLabel:v,children:y}),t[12]=v,t[13]=y,t[14]=b):b=t[14],b}function Kt(e){return e.language}function qt({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:c=!0,onOpenSearch:m,autoFocus:h=!1,onAutoFocusConsumed:v}){let y=l(e=>e.language),b=s(y).notes,x=s(y).automations.suggestions,S=a(),C=u(e=>e.resolved)===`dark`,{openImage:w}=et(),[E,O]=(0,Q.useState)(`wysiwyg`),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[N,P]=(0,Q.useState)(!1),[F,I]=(0,Q.useState)(``),[L,ee]=(0,Q.useState)(360),[te,ne]=(0,Q.useState)(!1),[R,re]=(0,Q.useState)(!1),[ie,B]=(0,Q.useState)(!1),V=(0,Q.useRef)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useRef)(null),W=(0,Q.useRef)(null),G=(0,Q.useRef)(null),ce=(0,Q.useRef)(null),le=(0,Q.useRef)(null),ue=(0,Q.useRef)(null),K=(0,Q.useRef)(null),pe=(0,Q.useRef)(null),q=(0,Q.useRef)(null),ge=_(e=>e.setPageHeader),_e=_(e=>e.clearPageHeader),{data:J,mutate:Y}=d(e?[`note-detail`,e]:null,()=>fe(e)),{data:ve=[],mutate:ye}=d(e?[`note-threads`,e]:null,()=>me(e),{revalidateOnFocus:!1}),be=j!==null;(0,Q.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&Y()};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[Y,e]),(0,Q.useEffect)(()=>{V.current=!1,I(``),M(null),A(null),H.current=!1,q.current=null},[e]),(0,Q.useEffect)(()=>{!J||V.current||(I(J.title??``),V.current=!0)},[J]),(0,Q.useEffect)(()=>{if(!h||!J||be||q.current===e)return;let t=window.requestAnimationFrame(()=>{pe.current?.focus(),v?.()});return q.current=e,()=>window.cancelAnimationFrame(t)},[h,be,J,e,v]);let xe=J?new Date(J.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,Se=(0,Q.useMemo)(()=>r?(0,$.jsx)(`button`,{type:`button`,onClick:t,"aria-label":b.back,className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,T,i),children:(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0})}):null,[i,b.back,t,r]),Ce=(0,Q.useCallback)(t=>{I(t),e&&(ce.current=t,W.current&&clearTimeout(W.current),W.current=setTimeout(async()=>{let t=ce.current;if(ce.current=null,t!==null){P(!0);try{await qe(e,{title:t}),await Y(),n?.()}catch{}finally{P(!1)}}},600))},[e,Y,n]),Te=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:o(`flex min-w-0 items-center gap-2`,T),children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:F||xe||void 0,children:F||xe}),N?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:b.saving}):null]}),[b.saving,N,xe,F]),Ee=(0,Q.useCallback)(async(t=!1)=>{B(!0);try{let n=await we(e,{forceNew:t});await Y(),await ye(),S(`/chat/${encodeURIComponent(n.sessionKey)}`)}catch(e){ae({type:`error`,title:b.chatOpenFailedTitle,message:e instanceof Error?e.message:b.chatOpenFailedMessage})}finally{B(!1)}},[Y,ye,S,e,b.chatOpenFailedMessage,b.chatOpenFailedTitle]),X=(0,Q.useCallback)(async()=>{re(!0);try{await se(e),await Y()}catch(e){ae({type:`error`,title:b.catalysisFailed,message:e instanceof Error?e.message:b.chatOpenFailedMessage})}finally{re(!1)}},[Y,e]),De=(0,Q.useCallback)(()=>{A(k===`breakdown`?null:`breakdown`),!J?.aiDeep?.catalysis?.report&&!R&&X()},[k,R,X,J?.aiDeep?.catalysis?.report]),Oe=(0,Q.useCallback)(()=>{let t=j?.markdown??G.current??J?.markdown??``,n=j?.title??F,r=z([n,t].filter(Boolean).join(`
3
3
 
4
4
  `));return{source:{type:`note`,id:e,title:n||b.titlePlaceholder},text:r,language:oe(r,y)}},[y,b.titlePlaceholder,J?.markdown,e,j,F]),ke=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:o(`flex items-center gap-2`,T),children:[m?(0,$.jsx)(`button`,{type:`button`,onClick:m,"aria-label":b.searchDialogTitle,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsx)(ze,{className:`size-4`,"aria-hidden":!0})}):null,(0,$.jsx)(p,{input:Oe,labels:{read:b.readAloud,preparing:b.readAloudPreparing,pause:b.readAloudPause,resume:b.readAloudResume,retry:b.readAloudRetry},showLabel:!0}),(0,$.jsxs)(`button`,{type:`button`,onClick:De,disabled:R,"aria-label":b.catalysisSectionTitle,className:o(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,k===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,$.jsx)(de,{className:`size-3.5`,"aria-hidden":!0}),R?b.catalyzing:b.catalyzeButton]}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>Ee(!1),disabled:ie,className:o(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,`border border-edge text-fg-muted hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,$.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}),ie?b.openingChat:b.openChatButton]}),(0,$.jsx)(Wt,{mode:E,onModeChange:O,labels:{edit:b.modeEdit,source:b.modeSource,preview:b.modePreview}}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>A(k===`history`?null:`history`),"aria-label":b.history,className:o(`rounded-lg p-1.5 transition-colors`,k===`history`?`bg-accent/10 text-accent`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:(0,$.jsx)(Ue,{className:`size-4`,"aria-hidden":!0})})]}),[R,De,Ee,E,b.history,b.modeEdit,b.modePreview,b.modeSource,ie,k,m,b.searchDialogTitle,b.readAloud,b.readAloudPause,b.readAloudPreparing,b.readAloudResume,b.readAloudRetry,Oe]);(0,Q.useLayoutEffect)(()=>(ge({startExtra:Se,main:J?Te:null,end:J?ke:null}),()=>{c&&_e()}),[c,_e,ke,Te,Se,J,ge]);let Ae=(0,Q.useCallback)(t=>{e&&(G.current=t,U.current&&clearTimeout(U.current),U.current=setTimeout(async()=>{let t=G.current;if(G.current=null,t!==null){P(!0);try{await qe(e,{markdown:t}),await Y(),n?.()}catch(e){ae({type:`error`,title:b.saveFailed,message:e instanceof Error?e.message:b.saveFailedHint})}finally{P(!1)}}},600))},[e,Y,b.saveFailed,b.saveFailedHint,n]),je=(0,Q.useCallback)(t=>{Le(e,t.timestamp).then(e=>{e&&M(e)})},[e]),Me=(0,Q.useCallback)(()=>{A(null),M(null)},[]),Ne=(0,Q.useCallback)(()=>{A(null),M(null),Y(),n?.()},[Y,n]);if((0,Q.useEffect)(()=>()=>{U.current&&clearTimeout(U.current),W.current&&clearTimeout(W.current);let t=G.current,n=ce.current;G.current=null,ce.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&qe(e,r)},[e]),J===void 0)return(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,$.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-accent border-t-transparent`})});if(J===null)return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:b.notFoundTitle}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:b.notFoundDescription}),(0,$.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-lg border border-edge px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:b.back})]});let Pe=be?j.title??``:F,Fe=be?j.markdown??``:J.markdown??``,Ie=new Date(J.createdAt).getTime(),Re=Number.isFinite(Ie)&&Date.now()-Ie<3600*1e3?(0,$.jsx)(xt,{title:x.noteCreatedTitle,description:x.noteCreatedDescription,prompt:x.noteCreatedPrompt,coverage:{eventType:`note.created`,source:`notes`,eventPayload:{noteId:e}},variant:`titleAction`,className:`ml-3 hidden max-w-[18rem] shrink-0 md:flex`}):null;return(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(Tt,{noteId:e}),(0,$.jsx)(he,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,$.jsx)(he,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,$.jsx)(`div`,{ref:le,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:be?(0,$.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-4`,children:[Pe&&(0,$.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:Pe}),Fe?(0,$.jsx)(g,{noteId:e,content:Fe,className:`opacity-80`}):(0,$.jsx)(`p`,{className:`italic text-fg-muted`,children:b.emptyPreview})]}):(0,$.jsxs)($.Fragment,{children:[E===`wysiwyg`&&(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,$.jsx)(`input`,{ref:pe,type:`text`,value:F,onChange:e=>Ce(e.target.value),onCompositionStart:()=>{H.current=!0},onCompositionEnd:()=>{H.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!H.current&&!t.isComposing&&(e.preventDefault(),(le.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:b.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Re]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Ut,{}),children:(0,$.jsx)(Vt,{initialContent:J.markdown??``,onChange:Ae,noteId:e},`wysiwyg-${e}`)})})]}),E===`source`&&(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,$.jsx)(`input`,{ref:pe,type:`text`,value:F,onChange:e=>Ce(e.target.value),placeholder:b.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Re]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Ut,{}),children:(0,$.jsx)(Ht,{initialContent:J.markdown??``,onChange:Ae,isDark:C},`source-${e}`)})})]}),E===`preview`&&(0,$.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-4`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&w(t.currentSrc||t.src,t.alt)},children:[F&&(0,$.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:F}),J.markdown?(0,$.jsx)(g,{noteId:e,content:J.markdown,className:`[&_img]:cursor-zoom-in`}):(0,$.jsx)(`p`,{className:`italic text-fg-muted`,children:b.emptyPreview})]})]})})]}),(0,$.jsx)(`div`,{ref:ue,className:o(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!te&&`transition-[width] duration-300 ease-in-out`),style:{width:k?L:0},children:(0,$.jsxs)(`div`,{ref:K,className:`flex min-h-0 flex-1 flex-col`,style:{width:L},children:[(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),ne(!0);let n=e.clientX,r=L,i=e.pointerId,a=0,o=L,s=L,c=()=>{a=0,s=o,k&&ue.current?.style.setProperty(`width`,`${s}px`),K.current?.style.setProperty(`width`,`${s}px`)},l=e=>{let t=r-(e.clientX-n);o=Math.max(280,Math.min(600,Math.round(t))),a===0&&(a=window.requestAnimationFrame(c))},u=()=>{a!==0&&(window.cancelAnimationFrame(a),c());try{t.releasePointerCapture(i)}catch{}ne(!1),ee(s),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,u)},className:o(`absolute left-0 top-0 z-10 h-full w-2 -translate-x-1/2 cursor-col-resize`,`before:content-[''] before:pointer-events-none before:absolute before:left-1/2 before:top-0 before:h-full before:w-px before:-translate-x-1/2`,`before:bg-transparent before:transition-[background-color] before:duration-150`,`hover:before:bg-edge/65 dark:hover:before:bg-edge/75`,te&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:k===`history`?(0,$.jsx)(At,{noteId:e,activeTimestamp:j?.timestamp??null,onSelect:je,onClose:Me,onRestored:Ne}):k===`breakdown`?(0,$.jsx)(jt,{noteId:e,note:J??null,catalyzing:R,onCatalyze:X,onClose:()=>A(null),noteThreads:ve,openingChat:ie,onOpenChat:()=>Ee(!1),onOpenNewChat:()=>Ee(!0)}):null})]})})]})}var Jt=3e4;function Yt(){if(!(typeof MediaRecorder>`u`))return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function Xt({placeholder:e,sendLabel:t,onCapture:n,onImagePick:r,onVoiceCapture:i,recordingLabel:a=`Recording…`,imageDisabled:s=!1,voiceDisabled:c=!1,onDiscussionCapture:l,discussionCaptureLabel:u=`Record discussion`}){let[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(0),[y,b]=(0,Q.useState)(!1),x=(0,Q.useRef)(null),S=(0,Q.useRef)(null),C=(0,Q.useRef)(null),w=(0,Q.useRef)([]),T=(0,Q.useRef)(0),E=(0,Q.useRef)(null),D=(0,Q.useRef)(null),O=(0,Q.useCallback)(()=>{E.current&&=(clearInterval(E.current),null),D.current&&=(clearTimeout(D.current),null),C.current?.getTracks().forEach(e=>e.stop()),C.current=null,S.current=null,w.current=[],g(!1),v(0)},[]);(0,Q.useEffect)(()=>()=>O(),[O]);let k=(0,Q.useCallback)(async()=>{let e=S.current;if(!e||e.state!==`recording`)return;b(!0),await new Promise(t=>{e.addEventListener(`stop`,()=>t(),{once:!0}),e.stop()});let t=Math.max(1,Math.round((Date.now()-T.current)/1e3)),n=e.mimeType||Yt()||`audio/webm`,r=new Blob(w.current,{type:n});if(O(),r.size>0&&i){let e=n.includes(`mp4`)?`m4a`:n.includes(`ogg`)?`ogg`:`webm`,a=new File([r],`voice-${Date.now()}.${e}`,{type:n});try{await i(a,t)}finally{b(!1)}return}b(!1)},[O,i]),A=(0,Q.useCallback)(async()=>{if(!(!i||y||h)&&!(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`))try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=Yt(),n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);C.current=e,S.current=n,w.current=[],T.current=Date.now(),n.ondataavailable=e=>{e.data.size>0&&w.current.push(e.data)},n.start(),g(!0),v(0),E.current=setInterval(()=>{v(Math.round((Date.now()-T.current)/1e3))},250),D.current=setTimeout(()=>{k()},Jt)}catch{O()}},[O,i,h,k,y]),M=(0,Q.useCallback)(()=>{if(h){k();return}A()},[h,A,k]),N=(0,Q.useCallback)(async e=>{let t=d.trim();if(!(!t||p)){m(!0),f(``);try{await n(t,e)}catch{f(t)}finally{m(!1),x.current?.focus()}}},[d,p,n]),P=(0,Q.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),N()),e.key===`Enter`&&e.shiftKey&&(e.preventDefault(),N({navigate:!1}))},[N]),F=p||y;return(0,$.jsxs)(`div`,{className:o(`flex items-center gap-1.5 rounded-2xl border border-edge bg-surface-panel p-2 shadow-float dark:shadow-elevated`,`focus-within:border-accent focus-within:ring-1 focus-within:ring-accent`,h&&`border-danger ring-1 ring-danger/40`),children:[r&&(0,$.jsx)(`button`,{type:`button`,onClick:r,disabled:F||s||h,className:`shrink-0 rounded-lg p-2 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Image`,children:(0,$.jsx)(Ke,{className:`size-4`})}),i&&(0,$.jsx)(`button`,{type:`button`,onClick:M,disabled:F||c||p,className:o(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,h?`bg-danger-soft text-danger hover:bg-danger-soft`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),"aria-label":h?`Stop recording`:`Voice`,"aria-pressed":h,children:h?(0,$.jsx)(G,{className:`size-4 fill-current`}):(0,$.jsx)(B,{className:`size-4`})}),l&&!h?(0,$.jsx)(`button`,{type:`button`,onClick:l,disabled:F,className:`shrink-0 rounded-lg p-2 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":u,title:u,children:(0,$.jsx)(j,{className:`size-4`,"aria-hidden":!0})}):null,h?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate py-1.5 text-sm text-danger`,children:a.replace(`{{seconds}}`,String(_))}):(0,$.jsx)(`textarea`,{ref:x,value:d,onChange:e=>f(e.target.value),onKeyDown:P,placeholder:e,rows:1,disabled:F,className:`min-h-8 flex-1 resize-none bg-transparent py-1.5 text-sm leading-5 text-fg placeholder:text-fg-muted focus:outline-none disabled:opacity-60`,style:{fieldSizing:`content`}}),(0,$.jsx)(`button`,{type:`button`,disabled:!d.trim()||F||h,onClick:e=>void N({navigate:!e.shiftKey}),"aria-label":t,className:o(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,d.trim()&&!F&&!h?`text-accent hover:bg-accent-soft`:`text-fg-disabled`),children:(0,$.jsx)(U,{className:`size-4`})})]})}var Zt={statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1},Qt=240,$t=320,en=520,tn=560;function nn(e){if(globalThis.localStorage===void 0)return $t;try{let t=globalThis.localStorage.getItem(e);if(!t)return $t;let n=Number(t);return Number.isFinite(n)?n:$t}catch{return $t}}function rn(e,t){if(globalThis.localStorage!==void 0)try{globalThis.localStorage.setItem(e,String(Math.round(t)))}catch{}}var an={thought:Ee,todo:Pe,voice:B,media:Ke,bookmark:v,mixed:Ee,task:Pe};function on(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function sn(e,t){return e.statusFilter===t.patch.statusFilter&&e.kindFilter===t.patch.kindFilter&&e.pinnedOnly===t.patch.pinnedOnly}function cn(e,t){return`${e.replace(/\/$/,``)}/${encodeURIComponent(t)}`}function ln({selectedNoteId:e,basePath:t,managePageHeader:n=!1,showLibrary:r=!0,allowMediaCapture:i=!0,projectId:u,listTitle:f,listDescription:p,emptyText:m,emptyDescription:h,listWidthStorageKey:g=`xopc.notes.listWidth`}){let y=s(l(e=>e.language)).notes,b=!!c(e=>e.token),[x,C]=(0,Q.useReducer)(Se,Zt),[D,O]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(``),[M,P]=(0,Q.useState)(0),[F,I]=(0,Q.useState)(()=>nn(g)),[L,R]=(0,Q.useState)(!1),[z,ie]=(0,Q.useState)(!1),[V,oe]=(0,Q.useState)(!1),[H,U]=(0,Q.useState)(null),G=(0,Q.useRef)(null),se=(0,Q.useRef)(null),[le]=(0,Q.useState)(()=>Date.now()),K=a(),de=(0,Q.useCallback)(e=>{let t=G.current?.clientWidth??window.innerWidth,n=Math.max(Qt,t-tn);return Math.max(Qt,Math.min(Math.min(en,n),e))},[]),fe=(0,Q.useCallback)(e=>{let t=de(e);I(t),rn(g,t)},[de,g]);(0,Q.useLayoutEffect)(()=>{I(e=>de(e))},[de]);let{data:pe,mutate:q,isLoading:me}=d((0,Q.useMemo)(()=>b?[`notes-list`,u,x.statusFilter,x.kindFilter,x.pinnedOnly]:null,[b,u,x.statusFilter,x.kindFilter,x.pinnedOnly]),()=>ke({status:x.statusFilter===`all`?void 0:x.statusFilter,kind:x.kindFilter===`all`?void 0:x.kindFilter,projectId:u,pinned:x.pinnedOnly?!0:void 0,limit:100,sortBy:`createdAt`,sortOrder:`desc`}),{keepPreviousData:!0}),he=me&&!pe,Y=pe?.items??[],xe=pe?.total??0,Ce=A.trim(),{data:we,isLoading:Te}=d(b&&D&&Ce?[`notes-search`,u,Ce]:null,()=>ke({search:Ce,projectId:u,limit:30,sortBy:`updatedAt`,sortOrder:`desc`})),X=we?.items??[],De=e?Y.some(t=>t.id===e):!0;(0,Q.useEffect)(()=>{P(0)},[Ce]),(0,Q.useEffect)(()=>{M>=X.length&&P(Math.max(0,X.length-1))},[M,X.length]),(0,Q.useEffect)(()=>{let e=()=>{q()};return window.addEventListener(`note-updated`,e),()=>window.removeEventListener(`note-updated`,e)},[q]);let Ae=_(e=>e.setPageHeader),Ne=_(e=>e.clearPageHeader),Ie=xe>0?y.noteCount.replace(`{{count}}`,String(xe)):null,Le=y.searchDialogTitle,Re=y.searchClose,Be=y.searchClear,Ve=(0,Q.useMemo)(()=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>O(!0),className:o(`inline-flex h-9 items-center gap-2 rounded-lg border border-edge bg-surface-base px-3 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,T),"aria-label":Le,children:[(0,$.jsx)(ze,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:Le})]}),[Le]);(0,Q.useLayoutEffect)(()=>{if(n)return b?(Ae({startExtra:null,main:(0,$.jsxs)(`div`,{className:o(`flex min-w-0 items-center gap-2`,T),children:[(0,$.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold tracking-tight text-fg`,children:f??y.title}),Ie?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:Ie}):null]}),end:Ve}),()=>Ne()):(Ne(),()=>Ne())},[Ne,b,Ve,f,n,y.title,Ie,e,Ae]);let He=(0,Q.useMemo)(()=>({justNow:y.justNow,minutesAgo:y.minutesAgo,today:y.today,yesterday:y.yesterday,daysAgo:y.daysAgo}),[y.justNow,y.minutesAgo,y.today,y.yesterday,y.daysAgo]),Ue=(0,Q.useMemo)(()=>[{id:`recent`,label:y.viewRecent,description:y.viewRecentDescription,icon:ye,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1}},{id:`inbox`,label:y.filterInbox,description:y.viewInboxDescription,icon:ue,patch:{statusFilter:`inbox`,kindFilter:`all`,pinnedOnly:!1}},{id:`pinned`,label:y.pinned,description:y.viewPinnedDescription,icon:E,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!0}},{id:`tasks`,label:y.viewTasks,description:y.viewTasksDescription,icon:Pe,patch:{statusFilter:`all`,kindFilter:`todo`,pinnedOnly:!1}},{id:`voice`,label:y.kindVoice,description:y.viewVoiceDescription,icon:B,patch:{statusFilter:`all`,kindFilter:`voice`,pinnedOnly:!1}},{id:`media`,label:y.kindMedia,description:y.viewMediaDescription,icon:Ke,patch:{statusFilter:`all`,kindFilter:`media`,pinnedOnly:!1}},{id:`bookmarks`,label:y.kindBookmark,description:y.viewBookmarksDescription,icon:v,patch:{statusFilter:`all`,kindFilter:`bookmark`,pinnedOnly:!1}},{id:`processed`,label:y.filterProcessed,description:y.viewProcessedDescription,icon:ge,patch:{statusFilter:`processed`,kindFilter:`all`,pinnedOnly:!1}},{id:`archive`,label:y.filterArchived,description:y.viewArchiveDescription,icon:Qe,patch:{statusFilter:`archived`,kindFilter:`all`,pinnedOnly:!1}}],[y.filterArchived,y.filterInbox,y.filterProcessed,y.kindBookmark,y.kindMedia,y.kindVoice,y.pinned,y.viewArchiveDescription,y.viewBookmarksDescription,y.viewInboxDescription,y.viewMediaDescription,y.viewPinnedDescription,y.viewProcessedDescription,y.viewRecent,y.viewRecentDescription,y.viewTasks,y.viewTasksDescription,y.viewVoiceDescription]),We=Ue.find(e=>sn(x,e))??Ue[0],Ge=f??We.label,Je=p??We.description,Ye=(0,Q.useCallback)(async(e,n)=>{let r=u?await Oe({markdown:e,kind:`thought`,projectId:u,channel:`web`}):await J(e,`web`);await q(),n?.navigate!==!1&&K(cn(t,r.id))},[t,q,K,u]),Xe=(0,Q.useCallback)(async()=>{if(!V){oe(!0);try{let e=await Oe({markdown:``,kind:`thought`,projectId:u,channel:`web`});C({type:`patch`,patch:Zt}),await q(),U(e.id),K(cn(t,e.id))}catch(e){ae({type:`error`,title:y.createBlankFailed,message:e instanceof Error?e.message:y.createBlankFailedHint})}finally{oe(!1)}}},[t,V,q,y.createBlankFailed,y.createBlankFailedHint,K,u]),Ze=(0,Q.useCallback)(()=>{let e=document.createElement(`input`);e.type=`file`,e.accept=`image/*`,e.onchange=async()=>{let t=e.files?.[0];if(t)try{await _e(t,`web`),await q()}catch(e){ae({type:`error`,title:y.imageUploadFailed,message:e instanceof Error?e.message:y.imageUploadFailedHint})}},e.click()},[q,y.imageUploadFailed,y.imageUploadFailedHint]),Z=(0,Q.useCallback)(async(e,t)=>{try{await W(e,t,`web`),await q()}catch(e){ae({type:`error`,title:y.voiceUploadFailed,message:e instanceof Error?e.message:y.voiceUploadFailedHint})}},[q,y.voiceUploadFailed,y.voiceUploadFailedHint]),$e=(0,Q.useCallback)(async(e,t)=>{await qe(e,{pinned:t}),await q()},[q]),et=(0,Q.useCallback)(async e=>{await qe(e,{status:`archived`}),await q()},[q]),tt=(0,Q.useCallback)(async e=>{await Fe(e),await q()},[q]),nt=(0,Q.useCallback)(e=>{K(cn(t,e))},[t,K]),rt=(0,Q.useCallback)(e=>{K(cn(t,e)),O(!1)},[t,K]),it=(0,Q.useCallback)(e=>{if(X.length){if(e.key===`ArrowDown`)e.preventDefault(),P(e=>Math.min(X.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),P(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=X[M]??X[0];t&&rt(t.id)}}},[M,rt,X]),at=(0,Q.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=se.current;t.setPointerCapture(e.pointerId),R(!0);let r=G.current?.clientWidth??window.innerWidth,i=Math.max(Qt,r-tn),a=Math.min(en,i),o=e=>Math.max(Qt,Math.min(a,e)),s=e.clientX,c=o(F),l=e.pointerId,u=0,d=c,f=c;n&&(n.style.transition=`none`,n.style.width=`${c}px`);let p=()=>{u=0,f=d,n&&(n.style.width=`${f}px`)},m=e=>{d=o(c+e.clientX-s),u===0&&(u=window.requestAnimationFrame(p))},h=()=>{u!==0&&(window.cancelAnimationFrame(u),p());try{t.releasePointerCapture(l)}catch{}R(!1),G.current?.style.setProperty(`--notes-list-width`,`${f}px`),n&&(n.style.removeProperty(`transition`),n.style.removeProperty(`width`)),I(f),rn(g,f),window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h)};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)},[g,F]);(0,Q.useEffect)(()=>{let e=e=>{e.defaultPrevented||e.repeat||e.key.toLowerCase()!==`n`||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||(e.preventDefault(),Xe())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Xe]);let ot=(0,Q.useCallback)(e=>{e.key===`ArrowLeft`?(e.preventDefault(),fe(F-16)):e.key===`ArrowRight`?(e.preventDefault(),fe(F+16)):e.key===`Home`?(e.preventDefault(),fe(Qt)):e.key===`End`&&(e.preventDefault(),fe(en))},[fe,F]);return b?(0,$.jsxs)(`div`,{ref:G,className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,style:{"--notes-list-width":`${F}px`},children:[(0,$.jsxs)(`section`,{ref:se,className:o(`relative flex min-h-0 w-full shrink-0 flex-col overflow-hidden bg-surface-panel`,!L&&`lg:transition-[width] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,z?`lg:w-0 lg:min-w-0 lg:max-w-0 lg:pointer-events-none`:`lg:w-[var(--notes-list-width)]`,e&&`hidden lg:flex`),"aria-hidden":z?!0:void 0,children:[(0,$.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r?(0,$.jsx)(ve,{value:We.id,onChange:e=>{let t=Ue.find(t=>t.id===e.target.value);t&&C({type:`patch`,patch:t.patch})},className:`-ml-1 block max-w-44 truncate rounded-lg border border-transparent bg-transparent px-1 py-0.5 text-sm font-semibold text-fg transition-colors hover:border-edge hover:bg-surface-base focus:border-accent focus:bg-surface-base focus:outline-none focus:ring-1 focus:ring-accent`,"aria-label":y.libraryTitle,children:Ue.map(e=>(0,$.jsx)(ce,{value:e.id,children:e.label},e.id))}):(0,$.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:Ge}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:Ie??Je})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>ie(!0),className:`hidden size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent lg:inline-flex`,"aria-label":y.collapseNotesList,title:y.collapseNotesList,children:(0,$.jsx)(te,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:Xe,disabled:V,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":y.createBlankNote,title:y.createBlankShortcut,children:(0,$.jsx)(be,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>O(!0),className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":y.searchDialogTitle,children:(0,$.jsx)(ze,{className:`size-4`,"aria-hidden":!0})})]})]})}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-3 [scrollbar-gutter:stable]`,children:he?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2,3,4].map(e=>(0,$.jsx)(`div`,{className:`h-20 animate-pulse rounded-lg bg-surface-hover`},e))}):Y.length===0?(0,$.jsxs)(`div`,{className:`flex min-h-[min(40vh,20rem)] flex-col items-center justify-center gap-2 px-6 py-16 text-center`,children:[(0,$.jsx)(Ee,{className:`size-8 text-fg-muted`}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:e&&!De?y.noteOutsideCurrentView:m??y.noNotes}),e&&!De?null:(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:h??y.noNotesDescription})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e&&!De?(0,$.jsx)(`div`,{className:`mb-2 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 text-xs leading-5 text-fg-muted`,children:y.noteOutsideCurrentView}):null,Y.map((t,n)=>{let r=n>0?ut(Y[n-1].createdAt):null;return(0,$.jsxs)(`div`,{children:[ut(t.createdAt)!==r&&(0,$.jsx)(`div`,{className:o(`px-3 pb-1.5 pt-2 text-xs font-medium text-fg-muted`,n===0&&`pt-0`),children:lt(t.createdAt,le,He)}),(0,$.jsx)(gt,{note:t,selected:t.id===e,onPress:nt,onPin:$e,onArchive:et,onDelete:tt,timeLabels:He,labels:{pin:y.pin,unpin:y.unpin,archive:y.archive,delete:y.delete,imageNote:y.imageNote,noText:y.noText}})]},t.id)})]})}),(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:(0,$.jsx)(Xt,{placeholder:y.quickCapturePlaceholder,sendLabel:y.send,onCapture:Ye,onImagePick:i?Ze:void 0,onVoiceCapture:i?Z:void 0,recordingLabel:y.recording,discussionCaptureLabel:y.discussionCapture.title,onDiscussionCapture:()=>Me(u)})})]}),(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":y.resizeNotesList,"aria-valuemin":Qt,"aria-valuemax":en,"aria-valuenow":Math.round(F),tabIndex:0,onPointerDown:at,onDoubleClick:()=>fe($t),onKeyDown:ot,title:y.resizeNotesList,className:o(`group relative hidden shrink-0 cursor-col-resize touch-none select-none items-center justify-center lg:flex`,`lg:transition-[width,opacity] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,z?`lg:w-0 lg:opacity-0 lg:pointer-events-none`:`lg:w-3 lg:opacity-100`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-0`),children:(0,$.jsx)(`span`,{"aria-hidden":!0,className:o(`h-8 w-1 rounded-pill opacity-0 transition-[background-color,opacity,transform] duration-150`,`bg-edge-strong/55 group-hover:opacity-100 group-focus-visible:opacity-100`,`group-hover:scale-y-110 group-focus-visible:scale-y-110`,L&&`bg-accent opacity-100 scale-y-125`)})}),(0,$.jsxs)(`section`,{className:o(`relative min-w-0 flex-1 bg-surface-panel`,!e&&`hidden lg:flex`),children:[z?(0,$.jsx)(`button`,{type:`button`,onClick:()=>ie(!1),className:`absolute left-3 top-3 z-10 hidden size-8 items-center justify-center rounded-lg border border-edge bg-surface-base text-fg-muted shadow-surface transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent lg:inline-flex`,"aria-label":y.expandNotesList,title:y.expandNotesList,children:(0,$.jsx)(te,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}):null,e?(0,$.jsx)(Gt,{noteId:e,onBack:()=>K(t),onSaved:()=>void q(),backButtonClassName:`lg:hidden`,clearHeaderOnCleanup:!1,onOpenSearch:()=>O(!0),autoFocus:e===H,onAutoFocusConsumed:()=>U(null)}):(0,$.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 items-center justify-center px-8 text-center`,children:(0,$.jsxs)(`div`,{className:`max-w-sm`,children:[(0,$.jsx)(Ee,{className:`mx-auto size-9 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-base font-semibold text-fg`,children:y.emptyEditorTitle}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:y.emptyEditorDescription}),(0,$.jsxs)(`button`,{type:`button`,onClick:Xe,disabled:V,className:`mt-5 inline-flex items-center gap-2 rounded-lg bg-accent px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,$.jsx)(be,{className:`size-4`,"aria-hidden":!0}),V?y.creatingBlankNote:y.createBlankNote]})]})})]}),(0,$.jsx)(ne,{open:D,onOpenChange:O,children:(0,$.jsxs)(k,{children:[(0,$.jsx)(S,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(ee,{className:`fixed left-1/2 top-24 z-[90] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-float focus: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)(je,{className:`text-sm font-semibold text-fg`,children:Le}),(0,$.jsx)(re,{className:`sr-only`,children:y.searchPlaceholder}),(0,$.jsx)(w,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":Re,children:(0,$.jsx)(N,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`p-4`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(ze,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`input`,{type:`search`,value:A,onChange:e=>j(e.target.value),onKeyDown:it,placeholder:y.searchPlaceholder,className:`w-full rounded-lg border border-edge bg-surface-base py-2 pl-9 pr-10 text-sm text-fg placeholder:text-fg-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent`}),A?(0,$.jsx)(`button`,{type:`button`,onClick:()=>j(``),className:`absolute right-2 top-1/2 inline-flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":Be,children:(0,$.jsx)(N,{className:`size-3.5`,"aria-hidden":!0})}):null]}),(0,$.jsx)(`div`,{className:`mt-4 max-h-[min(28rem,calc(100vh-14rem))] overflow-y-auto [scrollbar-gutter:stable]`,children:Ce?Te&&!we?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2,3].map(e=>(0,$.jsx)(`div`,{className:`h-16 animate-pulse rounded-lg bg-surface-hover`},e))}):X.length===0?(0,$.jsxs)(`div`,{className:`flex min-h-40 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,$.jsx)(Ee,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:y.searchNoResults}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:y.searchNoResultsDescription})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`p`,{className:`px-2 pb-1 text-xs text-fg-muted`,children:y.searchResultsCount.replace(`{{count}}`,String(we?.total??X.length))}),X.map((e,t)=>{let n=an[e.kind]||Ee,r=on(e,{imageNote:y.imageNote,noText:y.noText});return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>rt(e.id),onMouseEnter:()=>P(t),className:o(`flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors`,t===M?`bg-surface-active`:`hover:bg-surface-hover`),children:[(0,$.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"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.title||r}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:ct(e.updatedAt,le,He)})]}),e.title?(0,$.jsx)(`span`,{className:`mt-0.5 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:r}):null,e.tags?.length?(0,$.jsx)(`span`,{className:`mt-1 flex min-w-0 flex-wrap gap-1`,children:e.tags.slice(0,3).map(e=>(0,$.jsx)(`span`,{className:`max-w-24 truncate rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]})]},e.id)})]}):(0,$.jsxs)(`div`,{className:`flex min-h-40 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,$.jsx)(ze,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:y.searchEmptyTitle}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:y.searchEmptyDescription})]})})]})]})]})})]}):(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,$.jsx)(Ee,{className:`size-10 text-fg-muted`}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y.needToken})]})}export{et as n,ln as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o}from"./locale-store-DIVc0AQs.js";import{o as s,r as c,t as l}from"./work-copy-hQmivDgT.js";import{Do as u,Hl as d,Iu as f,eo as p,fc as m,ht as h,js as g,mu as _}from"./index-BDzspHrg.js";var v=n(),y=e(t(),1),b=r();function x(){let e=(0,v.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,b.jsx)(p,{className:`h-28 rounded-2xl`}),(0,b.jsx)(p,{className:`h-52 rounded-2xl`}),(0,b.jsx)(p,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function S(e){let t=(0,v.c)(6),{items:n,empty:r}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,b.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let i;t[2]===n?i=t[3]:(i=n.map(C),t[2]=n,t[3]=i);let a;return t[4]===i?a=t[5]:(a=(0,b.jsx)(`ul`,{className:`space-y-2`,children:i}),t[4]=i,t[5]=a),a}function C(e){return(0,b.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,b.jsx)(_,{className:`mt-1 size-4 shrink-0 text-success`,"aria-hidden":!0}),(0,b.jsx)(`span`,{children:e})]},e)}function w(){let{outcomeId:e=``}=i(),t=o(e=>e.language),n=(0,y.useMemo)(()=>l(t),[t]),r=u(e=>e.setPageHeader),p=u(e=>e.clearPageHeader),[_,v]=(0,y.useState)(null),[C,w]=(0,y.useState)(null),[T,E]=(0,y.useState)(!1),D=async()=>{v(await s(e))};(0,y.useEffect)(()=>{let t=!0;return w(null),s(e).then(e=>{t&&v(e)}).catch(()=>{t&&w(n.outcomeNotFound)}),()=>{t=!1}},[n.outcomeNotFound,e]);let O=async t=>{E(!0),w(null);try{await c(e,t),await D()}catch{w(n.actionFailed)}finally{E(!1)}};return(0,y.useLayoutEffect)(()=>(r({startExtra:(0,b.jsx)(a,{to:`/work`,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n.backToWork,children:(0,b.jsx)(f,{className:`size-4`,"aria-hidden":!0})}),main:_?(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:_.outcome.objective}),(0,b.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.outcomeStatuses[_.outcome.userStatus]})]}):null,end:null}),()=>p()),[p,n.backToWork,n.outcomeStatuses,_,r]),(0,b.jsx)(`main`,{className:`mx-auto flex w-full max-w-4xl flex-1 flex-col gap-5 px-4 py-7 sm:px-6 lg:py-9`,children:C?(0,b.jsx)(`div`,{className:`rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:C}):_?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-panel p-5`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.outcomeStatuses[_.outcome.userStatus]}),(0,b.jsx)(`h2`,{className:`mt-2 text-xl font-semibold tracking-tight text-fg`,children:_.outcome.objective})]}),(0,b.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:n.outcomeStatuses[_.outcome.userStatus]})]}),_.outcome.internalStatus!==`completed`&&_.outcome.internalStatus!==`cancelled`?(0,b.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[_.outcome.internalStatus===`paused`?(0,b.jsx)(g,{type:`button`,variant:`primary`,disabled:T,onClick:()=>void O(`resume`),children:n.resumeOutcome}):_.outcome.internalStatus===`captured`?(0,b.jsx)(g,{type:`button`,variant:`primary`,disabled:T,onClick:()=>void O(`run`),children:n.runOutcome}):(0,b.jsx)(g,{type:`button`,variant:`secondary`,disabled:T,onClick:()=>void O(`pause`),children:n.pauseOutcome}),(0,b.jsx)(g,{type:`button`,variant:`ghost`,disabled:T,onClick:()=>void O(`cancel`),children:n.cancelOutcome})]}):null]}),(0,b.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-panel p-5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(m,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,b.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.successDefinition})]}),(0,b.jsxs)(`div`,{className:`mt-5 grid gap-6 md:grid-cols-2`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.successDefinition}),(0,b.jsx)(S,{items:_.outcome.contract?.acceptanceCriteria??[],empty:n.noDefinition})]}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.deliverables}),(0,b.jsx)(S,{items:_.outcome.contract?.deliverables??[],empty:n.noDefinition})]}),(_.outcome.contract?.constraints.length??0)>0?(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.constraints}),(0,b.jsx)(S,{items:_.outcome.contract?.constraints??[],empty:n.noDefinition})]}):null,(_.outcome.contract?.approvalRequired.length??0)>0?(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.approvalRequired}),(0,b.jsx)(S,{items:_.outcome.contract?.approvalRequired??[],empty:n.noDefinition})]}):null]})]}),(0,b.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-panel p-5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(d,{className:`size-4 text-success`,"aria-hidden":!0}),(0,b.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.executionReceipts})]}),_.receipts.length===0?(0,b.jsx)(`p`,{className:`mt-4 text-sm text-fg-muted`,children:n.noReceipts}):(0,b.jsx)(`div`,{className:`mt-4 divide-y divide-edge-subtle`,children:_.receipts.map(e=>(0,b.jsx)(`article`,{className:`py-4 first:pt-0 last:pb-0`,children:(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:e.summary}),(0,b.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.completedAt?h(new Date(e.completedAt)):n.outcomeStatuses.running})]}),(0,b.jsx)(`span`,{className:`shrink-0 text-xs font-medium text-fg-subtle`,children:n.verificationStatuses[e.verification.status]})]})},e.runId))})]})]}):(0,b.jsx)(x,{})})}export{w as OutcomeDetailPage};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o}from"./locale-store-BNC8HUCI.js";import{o as s,r as c,t as l}from"./work-copy-Cwyan9Sn.js";import{Do as u,Hl as d,Iu as f,eo as p,fc as m,ht as h,js as g,mu as _}from"./index-BA56bQ68.js";var v=n(),y=e(t(),1),b=r();function x(){let e=(0,v.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,b.jsx)(p,{className:`h-28 rounded-2xl`}),(0,b.jsx)(p,{className:`h-52 rounded-2xl`}),(0,b.jsx)(p,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function S(e){let t=(0,v.c)(6),{items:n,empty:r}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,b.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let i;t[2]===n?i=t[3]:(i=n.map(C),t[2]=n,t[3]=i);let a;return t[4]===i?a=t[5]:(a=(0,b.jsx)(`ul`,{className:`space-y-2`,children:i}),t[4]=i,t[5]=a),a}function C(e){return(0,b.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,b.jsx)(_,{className:`mt-1 size-4 shrink-0 text-success`,"aria-hidden":!0}),(0,b.jsx)(`span`,{children:e})]},e)}function w(){let{outcomeId:e=``}=i(),t=o(e=>e.language),n=(0,y.useMemo)(()=>l(t),[t]),r=u(e=>e.setPageHeader),p=u(e=>e.clearPageHeader),[_,v]=(0,y.useState)(null),[C,w]=(0,y.useState)(null),[T,E]=(0,y.useState)(!1),D=async()=>{v(await s(e))};(0,y.useEffect)(()=>{let t=!0;return w(null),s(e).then(e=>{t&&v(e)}).catch(()=>{t&&w(n.outcomeNotFound)}),()=>{t=!1}},[n.outcomeNotFound,e]);let O=async t=>{E(!0),w(null);try{await c(e,t),await D()}catch{w(n.actionFailed)}finally{E(!1)}};return(0,y.useLayoutEffect)(()=>(r({startExtra:(0,b.jsx)(a,{to:`/work`,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n.backToWork,children:(0,b.jsx)(f,{className:`size-4`,"aria-hidden":!0})}),main:_?(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:_.outcome.objective}),(0,b.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.outcomeStatuses[_.outcome.userStatus]})]}):null,end:null}),()=>p()),[p,n.backToWork,n.outcomeStatuses,_,r]),(0,b.jsx)(`main`,{className:`mx-auto flex w-full max-w-4xl flex-1 flex-col gap-5 px-4 py-7 sm:px-6 lg:py-9`,children:C?(0,b.jsx)(`div`,{className:`rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:C}):_?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-panel p-5`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.outcomeStatuses[_.outcome.userStatus]}),(0,b.jsx)(`h2`,{className:`mt-2 text-xl font-semibold tracking-tight text-fg`,children:_.outcome.objective})]}),(0,b.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:n.outcomeStatuses[_.outcome.userStatus]})]}),_.outcome.internalStatus!==`completed`&&_.outcome.internalStatus!==`cancelled`?(0,b.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[_.outcome.internalStatus===`paused`?(0,b.jsx)(g,{type:`button`,variant:`primary`,disabled:T,onClick:()=>void O(`resume`),children:n.resumeOutcome}):_.outcome.internalStatus===`captured`?(0,b.jsx)(g,{type:`button`,variant:`primary`,disabled:T,onClick:()=>void O(`run`),children:n.runOutcome}):(0,b.jsx)(g,{type:`button`,variant:`secondary`,disabled:T,onClick:()=>void O(`pause`),children:n.pauseOutcome}),(0,b.jsx)(g,{type:`button`,variant:`ghost`,disabled:T,onClick:()=>void O(`cancel`),children:n.cancelOutcome})]}):null]}),(0,b.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-panel p-5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(m,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,b.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.successDefinition})]}),(0,b.jsxs)(`div`,{className:`mt-5 grid gap-6 md:grid-cols-2`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.successDefinition}),(0,b.jsx)(S,{items:_.outcome.contract?.acceptanceCriteria??[],empty:n.noDefinition})]}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.deliverables}),(0,b.jsx)(S,{items:_.outcome.contract?.deliverables??[],empty:n.noDefinition})]}),(_.outcome.contract?.constraints.length??0)>0?(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.constraints}),(0,b.jsx)(S,{items:_.outcome.contract?.constraints??[],empty:n.noDefinition})]}):null,(_.outcome.contract?.approvalRequired.length??0)>0?(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`mb-3 text-xs font-medium text-fg-subtle`,children:n.approvalRequired}),(0,b.jsx)(S,{items:_.outcome.contract?.approvalRequired??[],empty:n.noDefinition})]}):null]})]}),(0,b.jsxs)(`section`,{className:`rounded-2xl border border-edge-subtle bg-surface-panel p-5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(d,{className:`size-4 text-success`,"aria-hidden":!0}),(0,b.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.executionReceipts})]}),_.receipts.length===0?(0,b.jsx)(`p`,{className:`mt-4 text-sm text-fg-muted`,children:n.noReceipts}):(0,b.jsx)(`div`,{className:`mt-4 divide-y divide-edge-subtle`,children:_.receipts.map(e=>(0,b.jsx)(`article`,{className:`py-4 first:pt-0 last:pb-0`,children:(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:e.summary}),(0,b.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.completedAt?h(new Date(e.completedAt)):n.outcomeStatuses.running})]}),(0,b.jsx)(`span`,{className:`shrink-0 text-xs font-medium text-fg-subtle`,children:n.verificationStatuses[e.verification.status]})]})},e.runId))})]})]}):(0,b.jsx)(x,{})})}export{w as OutcomeDetailPage};
@@ -1 +1 @@
1
- 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"./cn-JdwAhgNB.js";import{Ts as a}from"./index-BDzspHrg.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-accent-soft text-accent-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=n.findIndex(e=>e.id===r);t<0||l(n[(t+(e.key===`ArrowRight`?1:-1)+n.length)%n.length].id)},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-[10px] tabular-nums text-fg-subtle`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
1
+ 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"./cn-JdwAhgNB.js";import{Ts as a}from"./index-BA56bQ68.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-accent-soft text-accent-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=n.findIndex(e=>e.id===r);t<0||l(n[(t+(e.key===`ArrowRight`?1:-1)+n.length)%n.length].id)},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-[10px] tabular-nums text-fg-subtle`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./cn-JdwAhgNB.js";import{Gl as r,Jo as i,Ts as a,Yl as o}from"./index-BDzspHrg.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=i()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=i()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=n(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:n(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:n(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=n(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-white shadow-sm`,a.transition,a.press,a.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./cn-JdwAhgNB.js";import{Gl as r,Jo as i,Ts as a,Yl as o}from"./index-BA56bQ68.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=i()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=i()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=n(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:n(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:n(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=n(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-white shadow-sm`,a.transition,a.press,a.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{c as n,r,t as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as a}from"./locale-store-DIVc0AQs.js";import{i as o}from"./vendor-swr-BIWyz7Rc.js";import{a as s,r as c}from"./product-delivery-BVG-eWQO.js";import{eo as l}from"./index-BDzspHrg.js";import{n as u}from"./api-Bmzslx0Z.js";var d=e();function f(e){return e.installationState===`installed`&&e.enabled&&e.status===`installed`?`/extensions/${encodeURIComponent(e.extensionId)}`:`/local-apps/${encodeURIComponent(e.id)}`}var p=t();function m(){let e=(0,d.c)(14),t=n(),i=a(h)===`zh`,m=c(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=o(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=i?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[0]=t,e[1]=i,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=s({...m,title:m.id,capabilities:[`open`]}),n;return e[3]!==t||e[4]!==i?(n=t?(0,p.jsx)(r,{to:t,replace:!0}):(0,p.jsx)(g,{message:i?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:i}),e[3]=t,e[4]=i,e[5]=n):n=e[5],n}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?i?`找不到这个本地应用,它可能已被删除。`:`This local app was not found and may have been deleted.`:y instanceof Error?y.message:i?`无法打开这个本地应用。`:`Unable to open this local app.`,n;return e[6]!==t||e[7]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[6]=t,e[7]=i,e[8]=n):n=e[8],n}if(v){let t;e[9]===v?t=e[10]:(t=f(v),e[9]=v,e[10]=t);let n;return e[11]===t?n=e[12]:(n=(0,p.jsx)(r,{to:t,replace:!0}),e[11]=t,e[12]=n),n}let b;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,p.jsx)(l,{className:`h-6 w-48`}),(0,p.jsx)(l,{className:`h-32 rounded-xl`})]}),e[13]=b):b=e[13],b}function h(e){return e.language}function g(e){let t=(0,d.c)(7),{message:n,zh:r}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=r?`查看本地应用`:`View local apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(i,{className:`mt-3 inline-flex font-medium text-accent hover:underline`,to:`/local-apps`,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,p.jsxs)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,role:`alert`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}export{m as ProductOpenPage};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{c as n,r,t as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as a}from"./locale-store-BNC8HUCI.js";import{i as o}from"./vendor-swr-BIWyz7Rc.js";import{a as s,r as c}from"./product-delivery-BVG-eWQO.js";import{eo as l}from"./index-BA56bQ68.js";import{n as u}from"./api-CUClAvuL.js";var d=e();function f(e){return e.installationState===`installed`&&e.enabled&&e.status===`installed`?`/extensions/${encodeURIComponent(e.extensionId)}`:`/local-apps/${encodeURIComponent(e.id)}`}var p=t();function m(){let e=(0,d.c)(14),t=n(),i=a(h)===`zh`,m=c(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=o(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=i?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[0]=t,e[1]=i,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=s({...m,title:m.id,capabilities:[`open`]}),n;return e[3]!==t||e[4]!==i?(n=t?(0,p.jsx)(r,{to:t,replace:!0}):(0,p.jsx)(g,{message:i?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:i}),e[3]=t,e[4]=i,e[5]=n):n=e[5],n}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?i?`找不到这个本地应用,它可能已被删除。`:`This local app was not found and may have been deleted.`:y instanceof Error?y.message:i?`无法打开这个本地应用。`:`Unable to open this local app.`,n;return e[6]!==t||e[7]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[6]=t,e[7]=i,e[8]=n):n=e[8],n}if(v){let t;e[9]===v?t=e[10]:(t=f(v),e[9]=v,e[10]=t);let n;return e[11]===t?n=e[12]:(n=(0,p.jsx)(r,{to:t,replace:!0}),e[11]=t,e[12]=n),n}let b;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,p.jsx)(l,{className:`h-6 w-48`}),(0,p.jsx)(l,{className:`h-32 rounded-xl`})]}),e[13]=b):b=e[13],b}function h(e){return e.language}function g(e){let t=(0,d.c)(7),{message:n,zh:r}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=r?`查看本地应用`:`View local apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(i,{className:`mt-3 inline-flex font-medium text-accent hover:underline`,to:`/local-apps`,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,p.jsxs)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,role:`alert`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}export{m as ProductOpenPage};