agim-cli 1.2.144 → 1.2.147

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 (266) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/dist/cli-ui/setup-llm.d.ts.map +1 -1
  3. package/dist/cli-ui/setup-llm.js +3 -1
  4. package/dist/cli-ui/setup-llm.js.map +1 -1
  5. package/dist/core/circuit-breaker.d.ts +28 -0
  6. package/dist/core/circuit-breaker.d.ts.map +1 -1
  7. package/dist/core/circuit-breaker.js +45 -0
  8. package/dist/core/circuit-breaker.js.map +1 -1
  9. package/dist/core/intent.d.ts.map +1 -1
  10. package/dist/core/intent.js +3 -1
  11. package/dist/core/intent.js.map +1 -1
  12. package/dist/core/llm/agent-loop.d.ts +9 -1
  13. package/dist/core/llm/agent-loop.d.ts.map +1 -1
  14. package/dist/core/llm/agent-loop.js +80 -1
  15. package/dist/core/llm/agent-loop.js.map +1 -1
  16. package/dist/core/llm/anthropic-provider.d.ts.map +1 -1
  17. package/dist/core/llm/anthropic-provider.js +18 -4
  18. package/dist/core/llm/anthropic-provider.js.map +1 -1
  19. package/dist/core/llm/hallucination-detector.d.ts +33 -0
  20. package/dist/core/llm/hallucination-detector.d.ts.map +1 -0
  21. package/dist/core/llm/hallucination-detector.js +103 -0
  22. package/dist/core/llm/hallucination-detector.js.map +1 -0
  23. package/dist/core/llm/imhub-dispatcher.d.ts.map +1 -1
  24. package/dist/core/llm/imhub-dispatcher.js +7 -0
  25. package/dist/core/llm/imhub-dispatcher.js.map +1 -1
  26. package/dist/core/llm/provider-base.d.ts +9 -0
  27. package/dist/core/llm/provider-base.d.ts.map +1 -1
  28. package/dist/core/llm/provider-base.js.map +1 -1
  29. package/dist/core/memory-distill.d.ts.map +1 -1
  30. package/dist/core/memory-distill.js +18 -3
  31. package/dist/core/memory-distill.js.map +1 -1
  32. package/dist/core/memory.d.ts +14 -0
  33. package/dist/core/memory.d.ts.map +1 -1
  34. package/dist/core/memory.js +39 -0
  35. package/dist/core/memory.js.map +1 -1
  36. package/dist/core/message-sink.d.ts +6 -0
  37. package/dist/core/message-sink.d.ts.map +1 -1
  38. package/dist/core/message-sink.js +18 -3
  39. package/dist/core/message-sink.js.map +1 -1
  40. package/dist/core/outbox.d.ts +30 -2
  41. package/dist/core/outbox.d.ts.map +1 -1
  42. package/dist/core/outbox.js +102 -10
  43. package/dist/core/outbox.js.map +1 -1
  44. package/dist/core/reminders.d.ts.map +1 -1
  45. package/dist/core/reminders.js +11 -1
  46. package/dist/core/reminders.js.map +1 -1
  47. package/dist/core/router.d.ts.map +1 -1
  48. package/dist/core/router.js +16 -4
  49. package/dist/core/router.js.map +1 -1
  50. package/dist/core/schedule.d.ts +18 -0
  51. package/dist/core/schedule.d.ts.map +1 -1
  52. package/dist/core/schedule.js +80 -17
  53. package/dist/core/schedule.js.map +1 -1
  54. package/dist/core/sensitive-paths.d.ts.map +1 -1
  55. package/dist/core/sensitive-paths.js +53 -9
  56. package/dist/core/sensitive-paths.js.map +1 -1
  57. package/dist/core/types.d.ts +6 -0
  58. package/dist/core/types.d.ts.map +1 -1
  59. package/dist/plugins/agents/native/index.d.ts +47 -8
  60. package/dist/plugins/agents/native/index.d.ts.map +1 -1
  61. package/dist/plugins/agents/native/index.js +253 -102
  62. package/dist/plugins/agents/native/index.js.map +1 -1
  63. package/dist/plugins/agents/native/tool-registry.d.ts +33 -0
  64. package/dist/plugins/agents/native/tool-registry.d.ts.map +1 -0
  65. package/dist/plugins/agents/native/tool-registry.js +82 -0
  66. package/dist/plugins/agents/native/tool-registry.js.map +1 -0
  67. package/dist/plugins/messengers/dingtalk/dingtalk-client.d.ts.map +1 -1
  68. package/dist/plugins/messengers/dingtalk/dingtalk-client.js +11 -11
  69. package/dist/plugins/messengers/dingtalk/dingtalk-client.js.map +1 -1
  70. package/dist/plugins/messengers/feishu/feishu-adapter.d.ts.map +1 -1
  71. package/dist/plugins/messengers/feishu/feishu-adapter.js +9 -5
  72. package/dist/plugins/messengers/feishu/feishu-adapter.js.map +1 -1
  73. package/dist/plugins/messengers/wechat/ilink-adapter.d.ts.map +1 -1
  74. package/dist/plugins/messengers/wechat/ilink-adapter.js +11 -1
  75. package/dist/plugins/messengers/wechat/ilink-adapter.js.map +1 -1
  76. package/dist/web/public/assets/{a2a-DczMMkbl.js → a2a-Cll3P4QN.js} +2 -2
  77. package/dist/web/public/assets/{a2a-DczMMkbl.js.map → a2a-Cll3P4QN.js.map} +1 -1
  78. package/dist/web/public/assets/{activity-cbLHkzca.js → activity-B7T7YFlD.js} +2 -2
  79. package/dist/web/public/assets/{activity-cbLHkzca.js.map → activity-B7T7YFlD.js.map} +1 -1
  80. package/dist/web/public/assets/{admins-C-YsGMj7.js → admins-CN7P018S.js} +2 -2
  81. package/dist/web/public/assets/{admins-C-YsGMj7.js.map → admins-CN7P018S.js.map} +1 -1
  82. package/dist/web/public/assets/{agents-BWfov_1-.js → agents-Bqgq7GBF.js} +2 -2
  83. package/dist/web/public/assets/{agents-BWfov_1-.js.map → agents-Bqgq7GBF.js.map} +1 -1
  84. package/dist/web/public/assets/{approvals-HSssmXKS.js → approvals-C8IUJQ_A.js} +2 -2
  85. package/dist/web/public/assets/{approvals-HSssmXKS.js.map → approvals-C8IUJQ_A.js.map} +1 -1
  86. package/dist/web/public/assets/{arrow-down-BXvC8Al2.js → arrow-down-SLWKqtDc.js} +2 -2
  87. package/dist/web/public/assets/{arrow-down-BXvC8Al2.js.map → arrow-down-SLWKqtDc.js.map} +1 -1
  88. package/dist/web/public/assets/{arrow-up-63xELY5Q.js → arrow-up-BOADc9ce.js} +2 -2
  89. package/dist/web/public/assets/{arrow-up-63xELY5Q.js.map → arrow-up-BOADc9ce.js.map} +1 -1
  90. package/dist/web/public/assets/{asks-COLEFOvK.js → asks-C-j-DypC.js} +2 -2
  91. package/dist/web/public/assets/{asks-COLEFOvK.js.map → asks-C-j-DypC.js.map} +1 -1
  92. package/dist/web/public/assets/{audit-D4ZEiZub.js → audit-DQb-RuXh.js} +2 -2
  93. package/dist/web/public/assets/{audit-D4ZEiZub.js.map → audit-DQb-RuXh.js.map} +1 -1
  94. package/dist/web/public/assets/{bell-Cg2Bvv06.js → bell-CV88-ul6.js} +2 -2
  95. package/dist/web/public/assets/{bell-Cg2Bvv06.js.map → bell-CV88-ul6.js.map} +1 -1
  96. package/dist/web/public/assets/{bgjobs-CEjCzwtd.js → bgjobs-CDrK0d-W.js} +2 -2
  97. package/dist/web/public/assets/{bgjobs-CEjCzwtd.js.map → bgjobs-CDrK0d-W.js.map} +1 -1
  98. package/dist/web/public/assets/{brain-euvl6F6C.js → brain-B7HtSOQU.js} +2 -2
  99. package/dist/web/public/assets/{brain-euvl6F6C.js.map → brain-B7HtSOQU.js.map} +1 -1
  100. package/dist/web/public/assets/{briefcase-DPWLbCnA.js → briefcase-mdzuIa__.js} +2 -2
  101. package/dist/web/public/assets/{briefcase-DPWLbCnA.js.map → briefcase-mdzuIa__.js.map} +1 -1
  102. package/dist/web/public/assets/{browser-ponyfill-BUutOaRz.js → browser-ponyfill-DBWdeCTC.js} +2 -2
  103. package/dist/web/public/assets/{browser-ponyfill-BUutOaRz.js.map → browser-ponyfill-DBWdeCTC.js.map} +1 -1
  104. package/dist/web/public/assets/{chat-Dz9kfaxH.js → chat-CSjtY2rN.js} +3 -3
  105. package/dist/web/public/assets/{chat-Dz9kfaxH.js.map → chat-CSjtY2rN.js.map} +1 -1
  106. package/dist/web/public/assets/{chevron-left-BeIh5thq.js → chevron-left-uSfPn636.js} +2 -2
  107. package/dist/web/public/assets/{chevron-left-BeIh5thq.js.map → chevron-left-uSfPn636.js.map} +1 -1
  108. package/dist/web/public/assets/{chevron-right-uP_l9MMb.js → chevron-right-CtelqacW.js} +2 -2
  109. package/dist/web/public/assets/{chevron-right-uP_l9MMb.js.map → chevron-right-CtelqacW.js.map} +1 -1
  110. package/dist/web/public/assets/{circle-check-CewnjFgv.js → circle-check-8dbL-u7O.js} +2 -2
  111. package/dist/web/public/assets/{circle-check-CewnjFgv.js.map → circle-check-8dbL-u7O.js.map} +1 -1
  112. package/dist/web/public/assets/{circle-check-big-C2RTc48c.js → circle-check-big-D8-svk9a.js} +2 -2
  113. package/dist/web/public/assets/{circle-check-big-C2RTc48c.js.map → circle-check-big-D8-svk9a.js.map} +1 -1
  114. package/dist/web/public/assets/{circle-x-Ccg1HyV-.js → circle-x-rUxzIz5P.js} +2 -2
  115. package/dist/web/public/assets/{circle-x-Ccg1HyV-.js.map → circle-x-rUxzIz5P.js.map} +1 -1
  116. package/dist/web/public/assets/{clock-qxbYSynv.js → clock-CG5dlBGB.js} +2 -2
  117. package/dist/web/public/assets/{clock-qxbYSynv.js.map → clock-CG5dlBGB.js.map} +1 -1
  118. package/dist/web/public/assets/{confirm-dialog-DmJq4Td9.js → confirm-dialog-DlUsSur3.js} +2 -2
  119. package/dist/web/public/assets/{confirm-dialog-DmJq4Td9.js.map → confirm-dialog-DlUsSur3.js.map} +1 -1
  120. package/dist/web/public/assets/{copy-DxSHRdbc.js → copy-DnC76wFT.js} +2 -2
  121. package/dist/web/public/assets/{copy-DxSHRdbc.js.map → copy-DnC76wFT.js.map} +1 -1
  122. package/dist/web/public/assets/{data-table-S7rIjwdO.js → data-table-DswkWUfG.js} +2 -2
  123. package/dist/web/public/assets/{data-table-S7rIjwdO.js.map → data-table-DswkWUfG.js.map} +1 -1
  124. package/dist/web/public/assets/dialog-Ceo4YuXy.js +6 -0
  125. package/dist/web/public/assets/dialog-Ceo4YuXy.js.map +1 -0
  126. package/dist/web/public/assets/{download-OhsGtnO-.js → download-DF-46tS4.js} +2 -2
  127. package/dist/web/public/assets/{download-OhsGtnO-.js.map → download-DF-46tS4.js.map} +1 -1
  128. package/dist/web/public/assets/{email-C1-HxWLF.js → email-CZee26-_.js} +3 -3
  129. package/dist/web/public/assets/{email-C1-HxWLF.js.map → email-CZee26-_.js.map} +1 -1
  130. package/dist/web/public/assets/{empty-state-C-qjOHyu.js → empty-state-D9Hi0Atm.js} +2 -2
  131. package/dist/web/public/assets/{empty-state-C-qjOHyu.js.map → empty-state-D9Hi0Atm.js.map} +1 -1
  132. package/dist/web/public/assets/{external-link-DRVp9-lb.js → external-link-D64iZa9P.js} +2 -2
  133. package/dist/web/public/assets/{external-link-DRVp9-lb.js.map → external-link-D64iZa9P.js.map} +1 -1
  134. package/dist/web/public/assets/{eye-CFhg5BTa.js → eye-sY6WZb7D.js} +2 -2
  135. package/dist/web/public/assets/{eye-CFhg5BTa.js.map → eye-sY6WZb7D.js.map} +1 -1
  136. package/dist/web/public/assets/{facts-CGaLWhzi.js → facts-B7bGGwvi.js} +2 -2
  137. package/dist/web/public/assets/{facts-CGaLWhzi.js.map → facts-B7bGGwvi.js.map} +1 -1
  138. package/dist/web/public/assets/{goals-C-dJANmn.js → goals-BfQbsvZv.js} +2 -2
  139. package/dist/web/public/assets/{goals-C-dJANmn.js.map → goals-BfQbsvZv.js.map} +1 -1
  140. package/dist/web/public/assets/{health-CWcti5h3.js → health-Ba_mY0Ts.js} +2 -2
  141. package/dist/web/public/assets/{health-CWcti5h3.js.map → health-Ba_mY0Ts.js.map} +1 -1
  142. package/dist/web/public/assets/{heart-pulse-DmGhKR2W.js → heart-pulse-BjikOVwU.js} +2 -2
  143. package/dist/web/public/assets/{heart-pulse-DmGhKR2W.js.map → heart-pulse-BjikOVwU.js.map} +1 -1
  144. package/dist/web/public/assets/{heartbeat-kLoGBNCo.js → heartbeat-BM8LlPes.js} +2 -2
  145. package/dist/web/public/assets/{heartbeat-kLoGBNCo.js.map → heartbeat-BM8LlPes.js.map} +1 -1
  146. package/dist/web/public/assets/{hot-BITDoax1.js → hot-BtuLL6n8.js} +2 -2
  147. package/dist/web/public/assets/{hot-BITDoax1.js.map → hot-BtuLL6n8.js.map} +1 -1
  148. package/dist/web/public/assets/index-DEWFfW_Z.js +199 -0
  149. package/dist/web/public/assets/index-DEWFfW_Z.js.map +1 -0
  150. package/dist/web/public/assets/{installed-Co9WrtQ7.js → installed-Xr8p31ij.js} +2 -2
  151. package/dist/web/public/assets/{installed-Co9WrtQ7.js.map → installed-Xr8p31ij.js.map} +1 -1
  152. package/dist/web/public/assets/{jobs-hdHhBEvi.js → jobs-Ddy81Udm.js} +2 -2
  153. package/dist/web/public/assets/{jobs-hdHhBEvi.js.map → jobs-Ddy81Udm.js.map} +1 -1
  154. package/dist/web/public/assets/{layout-CQtbOBag.js → layout-BL74fT-L.js} +2 -2
  155. package/dist/web/public/assets/{layout-CQtbOBag.js.map → layout-BL74fT-L.js.map} +1 -1
  156. package/dist/web/public/assets/{layout-bDMXIKIR.js → layout-Bn2qUxcK.js} +2 -2
  157. package/dist/web/public/assets/{layout-bDMXIKIR.js.map → layout-Bn2qUxcK.js.map} +1 -1
  158. package/dist/web/public/assets/{layout-BMXC1Uh1.js → layout-Bp4SAA8_.js} +2 -2
  159. package/dist/web/public/assets/{layout-BMXC1Uh1.js.map → layout-Bp4SAA8_.js.map} +1 -1
  160. package/dist/web/public/assets/{layout-CysVsySh.js → layout-CZ9pGnW8.js} +2 -2
  161. package/dist/web/public/assets/{layout-CysVsySh.js.map → layout-CZ9pGnW8.js.map} +1 -1
  162. package/dist/web/public/assets/{layout-CyBGneZ9.js → layout-pasFRkKV.js} +2 -2
  163. package/dist/web/public/assets/{layout-CyBGneZ9.js.map → layout-pasFRkKV.js.map} +1 -1
  164. package/dist/web/public/assets/llm-yp7b5xxL.js +7 -0
  165. package/dist/web/public/assets/llm-yp7b5xxL.js.map +1 -0
  166. package/dist/web/public/assets/{loader-circle-9VUMGitw.js → loader-circle-Bbw4pEyE.js} +2 -2
  167. package/dist/web/public/assets/{loader-circle-9VUMGitw.js.map → loader-circle-Bbw4pEyE.js.map} +1 -1
  168. package/dist/web/public/assets/{map-pin-BXYvvHry.js → map-pin-DIXHUQgM.js} +2 -2
  169. package/dist/web/public/assets/{map-pin-BXYvvHry.js.map → map-pin-DIXHUQgM.js.map} +1 -1
  170. package/dist/web/public/assets/{mcp-BgLdlwSn.js → mcp-DyaljIM_.js} +2 -2
  171. package/dist/web/public/assets/{mcp-BgLdlwSn.js.map → mcp-DyaljIM_.js.map} +1 -1
  172. package/dist/web/public/assets/memos-Dkoc157i.js +12 -0
  173. package/dist/web/public/assets/memos-Dkoc157i.js.map +1 -0
  174. package/dist/web/public/assets/{messengers-7Phqea62.js → messengers-CcyGDeUI.js} +2 -2
  175. package/dist/web/public/assets/{messengers-7Phqea62.js.map → messengers-CcyGDeUI.js.map} +1 -1
  176. package/dist/web/public/assets/{mobile-CV5b6D2W.js → mobile-DqzIv4Xb.js} +2 -2
  177. package/dist/web/public/assets/{mobile-CV5b6D2W.js.map → mobile-DqzIv4Xb.js.map} +1 -1
  178. package/dist/web/public/assets/{native-agent-QvIa6LjE.js → native-agent-BQ7WaRGK.js} +2 -2
  179. package/dist/web/public/assets/{native-agent-QvIa6LjE.js.map → native-agent-BQ7WaRGK.js.map} +1 -1
  180. package/dist/web/public/assets/{network-BXhEjGhE.js → network-B_yUFAqC.js} +2 -2
  181. package/dist/web/public/assets/{network-BXhEjGhE.js.map → network-B_yUFAqC.js.map} +1 -1
  182. package/dist/web/public/assets/{outbox-DHQL7TQb.js → outbox-l8aVOZqO.js} +2 -2
  183. package/dist/web/public/assets/{outbox-DHQL7TQb.js.map → outbox-l8aVOZqO.js.map} +1 -1
  184. package/dist/web/public/assets/{pagination-VKuPb1Ot.js → pagination-BAKRGKa9.js} +2 -2
  185. package/dist/web/public/assets/{pagination-VKuPb1Ot.js.map → pagination-BAKRGKa9.js.map} +1 -1
  186. package/dist/web/public/assets/{persona-CWug2GLR.js → persona-D3VL9Rg1.js} +2 -2
  187. package/dist/web/public/assets/{persona-CWug2GLR.js.map → persona-D3VL9Rg1.js.map} +1 -1
  188. package/dist/web/public/assets/{plans-CZoEs5SY.js → plans-BBB5e9my.js} +2 -2
  189. package/dist/web/public/assets/{plans-CZoEs5SY.js.map → plans-BBB5e9my.js.map} +1 -1
  190. package/dist/web/public/assets/{play-CfSn5Vdl.js → play-7-Wd369f.js} +2 -2
  191. package/dist/web/public/assets/{play-CfSn5Vdl.js.map → play-7-Wd369f.js.map} +1 -1
  192. package/dist/web/public/assets/{plus-Z8l4CiqJ.js → plus-B0sfZy-j.js} +2 -2
  193. package/dist/web/public/assets/{plus-Z8l4CiqJ.js.map → plus-B0sfZy-j.js.map} +1 -1
  194. package/dist/web/public/assets/{policy-CutDSEPW.js → policy-BM1WRXH0.js} +2 -2
  195. package/dist/web/public/assets/{policy-CutDSEPW.js.map → policy-BM1WRXH0.js.map} +1 -1
  196. package/dist/web/public/assets/{qr-code-DgU5aiM6.js → qr-code-DcKs5fi3.js} +2 -2
  197. package/dist/web/public/assets/{qr-code-DgU5aiM6.js.map → qr-code-DcKs5fi3.js.map} +1 -1
  198. package/dist/web/public/assets/{react-Cb2sDjhD.js → react-DlP5eolq.js} +2 -2
  199. package/dist/web/public/assets/{react-Cb2sDjhD.js.map → react-DlP5eolq.js.map} +1 -1
  200. package/dist/web/public/assets/{refresh-ccw-D2CWiyU_.js → refresh-ccw-uNKeBeRl.js} +2 -2
  201. package/dist/web/public/assets/{refresh-ccw-D2CWiyU_.js.map → refresh-ccw-uNKeBeRl.js.map} +1 -1
  202. package/dist/web/public/assets/{reminders-Cb6Izedg.js → reminders-DHM8K0_O.js} +2 -2
  203. package/dist/web/public/assets/{reminders-Cb6Izedg.js.map → reminders-DHM8K0_O.js.map} +1 -1
  204. package/dist/web/public/assets/{save-DB0BDYTs.js → save-qwJa5_SA.js} +2 -2
  205. package/dist/web/public/assets/{save-DB0BDYTs.js.map → save-qwJa5_SA.js.map} +1 -1
  206. package/dist/web/public/assets/{schedules-8mSjE14D.js → schedules-Bcd0wbT4.js} +2 -2
  207. package/dist/web/public/assets/{schedules-8mSjE14D.js.map → schedules-Bcd0wbT4.js.map} +1 -1
  208. package/dist/web/public/assets/{search-Con69NhG.js → search-BUlzNWrj.js} +2 -2
  209. package/dist/web/public/assets/{search-Con69NhG.js.map → search-BUlzNWrj.js.map} +1 -1
  210. package/dist/web/public/assets/{search-B4fHilZ0.js → search-i1tP2maJ.js} +2 -2
  211. package/dist/web/public/assets/{search-B4fHilZ0.js.map → search-i1tP2maJ.js.map} +1 -1
  212. package/dist/web/public/assets/{security-BTe3zUg8.js → security-DgJyTT4g.js} +2 -2
  213. package/dist/web/public/assets/{security-BTe3zUg8.js.map → security-DgJyTT4g.js.map} +1 -1
  214. package/dist/web/public/assets/{service-C7SqcwfL.js → service-A0Hzear0.js} +2 -2
  215. package/dist/web/public/assets/{service-C7SqcwfL.js.map → service-A0Hzear0.js.map} +1 -1
  216. package/dist/web/public/assets/{shield-alert-CKFVsGgI.js → shield-alert-DrnN6fz_.js} +2 -2
  217. package/dist/web/public/assets/{shield-alert-CKFVsGgI.js.map → shield-alert-DrnN6fz_.js.map} +1 -1
  218. package/dist/web/public/assets/{status-badge-BSkpyN4D.js → status-badge-Ryzf96Pl.js} +2 -2
  219. package/dist/web/public/assets/{status-badge-BSkpyN4D.js.map → status-badge-Ryzf96Pl.js.map} +1 -1
  220. package/dist/web/public/assets/{subtasks-Bel-I1Sk.js → subtasks-Bzh3o3EF.js} +2 -2
  221. package/dist/web/public/assets/{subtasks-Bel-I1Sk.js.map → subtasks-Bzh3o3EF.js.map} +1 -1
  222. package/dist/web/public/assets/{table-CPn1MRcy.js → table-BbAOSyc8.js} +2 -2
  223. package/dist/web/public/assets/{table-CPn1MRcy.js.map → table-BbAOSyc8.js.map} +1 -1
  224. package/dist/web/public/assets/{topn-Ba3RjcK1.js → topn-DkhYw-Gp.js} +2 -2
  225. package/dist/web/public/assets/{topn-Ba3RjcK1.js.map → topn-DkhYw-Gp.js.map} +1 -1
  226. package/dist/web/public/assets/{trash-2-Dfov8aHD.js → trash-2-CA0cLpnU.js} +2 -2
  227. package/dist/web/public/assets/{trash-2-Dfov8aHD.js.map → trash-2-CA0cLpnU.js.map} +1 -1
  228. package/dist/web/public/assets/{use-background-tasks-BQrEeUwY.js → use-background-tasks-B64YjlA8.js} +2 -2
  229. package/dist/web/public/assets/{use-background-tasks-BQrEeUwY.js.map → use-background-tasks-B64YjlA8.js.map} +1 -1
  230. package/dist/web/public/assets/{use-event-stream-DgGpGKop.js → use-event-stream-I1lMFEfh.js} +2 -2
  231. package/dist/web/public/assets/{use-event-stream-DgGpGKop.js.map → use-event-stream-I1lMFEfh.js.map} +1 -1
  232. package/dist/web/public/assets/{use-llm-admin-DYekqogG.js → use-llm-admin-DY2axI4D.js} +2 -2
  233. package/dist/web/public/assets/{use-llm-admin-DYekqogG.js.map → use-llm-admin-DY2axI4D.js.map} +1 -1
  234. package/dist/web/public/assets/{use-memory-DbJ4pP2Z.js → use-memory-BYEjVWbU.js} +2 -2
  235. package/dist/web/public/assets/{use-memory-DbJ4pP2Z.js.map → use-memory-BYEjVWbU.js.map} +1 -1
  236. package/dist/web/public/assets/{use-observability-C2M6WZ9W.js → use-observability-Coj02yDo.js} +2 -2
  237. package/dist/web/public/assets/{use-observability-C2M6WZ9W.js.map → use-observability-Coj02yDo.js.map} +1 -1
  238. package/dist/web/public/assets/{use-settings-DMdaoWsB.js → use-settings-i1MhlkyC.js} +2 -2
  239. package/dist/web/public/assets/{use-settings-DMdaoWsB.js.map → use-settings-i1MhlkyC.js.map} +1 -1
  240. package/dist/web/public/assets/{use-workspace-BHG7h3jQ.js → use-workspace-DgEM35PY.js} +2 -2
  241. package/dist/web/public/assets/{use-workspace-BHG7h3jQ.js.map → use-workspace-DgEM35PY.js.map} +1 -1
  242. package/dist/web/public/assets/{useQuery-PdiC7-sY.js → useQuery-CY2iazjN.js} +2 -2
  243. package/dist/web/public/assets/{useQuery-PdiC7-sY.js.map → useQuery-CY2iazjN.js.map} +1 -1
  244. package/dist/web/public/assets/{vector-DnZM3OXU.js → vector-Ic76u2hY.js} +2 -2
  245. package/dist/web/public/assets/{vector-DnZM3OXU.js.map → vector-Ic76u2hY.js.map} +1 -1
  246. package/dist/web/public/assets/{viewer-Dz6k0YKp.js → viewer-BXbUN1Rl.js} +2 -2
  247. package/dist/web/public/assets/{viewer-Dz6k0YKp.js.map → viewer-BXbUN1Rl.js.map} +1 -1
  248. package/dist/web/public/assets/{workspace-BnXrWS3j.js → workspace-CUg0JPn6.js} +3 -3
  249. package/dist/web/public/assets/{workspace-BnXrWS3j.js.map → workspace-CUg0JPn6.js.map} +1 -1
  250. package/dist/web/public/assets/{workspaces-CSS_UBEi.js → workspaces-C-wb5FQj.js} +2 -2
  251. package/dist/web/public/assets/{workspaces-CSS_UBEi.js.map → workspaces-C-wb5FQj.js.map} +1 -1
  252. package/dist/web/public/assets/{x-DG-JKVw_.js → x-D1iSuoqg.js} +2 -2
  253. package/dist/web/public/assets/{x-DG-JKVw_.js.map → x-D1iSuoqg.js.map} +1 -1
  254. package/dist/web/public/index.html +2 -2
  255. package/dist/web/server.d.ts.map +1 -1
  256. package/dist/web/server.js +6 -0
  257. package/dist/web/server.js.map +1 -1
  258. package/package.json +1 -1
  259. package/dist/web/public/assets/dialog-bAIDaO-6.js +0 -6
  260. package/dist/web/public/assets/dialog-bAIDaO-6.js.map +0 -1
  261. package/dist/web/public/assets/index-O0BQoyzo.js +0 -199
  262. package/dist/web/public/assets/index-O0BQoyzo.js.map +0 -1
  263. package/dist/web/public/assets/llm-CPIRNQU2.js +0 -7
  264. package/dist/web/public/assets/llm-CPIRNQU2.js.map +0 -1
  265. package/dist/web/public/assets/memos-CfneX9DH.js +0 -12
  266. package/dist/web/public/assets/memos-CfneX9DH.js.map +0 -1
@@ -1,7 +0,0 @@
1
- import{n as I,u as k,j as e,B as y,k as T,L as f,S as L,f as B,g as H,h as E,i as R,I as N,l as m}from"./index-O0BQoyzo.js";import{r as b}from"./react-Cb2sDjhD.js";import{T as _,a as $,b as U,c as j,d as z,e as g}from"./table-CPn1MRcy.js";import{u as q,a as F,b as M,c as O,d as V}from"./use-llm-admin-DYekqogG.js";import{L as K}from"./loader-circle-9VUMGitw.js";import{R as D}from"./refresh-ccw-D2CWiyU_.js";import{T as W}from"./trash-2-Dfov8aHD.js";import{P as Z}from"./plus-Z8l4CiqJ.js";import"./useQuery-PdiC7-sY.js";/**
2
- * @license lucide-react v0.469.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Q=I("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Y=["cheap","evaluator","native-chat"],P="__unbind__",w=["deepseek","moonshot","zhipu","openai","anthropic","custom"],v=[{provider:"openai-compat",baseUrl:"https://api.deepseek.com/v1",modelHint:"deepseek-chat"},{provider:"openai-compat",baseUrl:"https://api.moonshot.cn/v1",modelHint:"moonshot-v1-8k"},{provider:"openai-compat",baseUrl:"https://open.bigmodel.cn/api/paas/v4",modelHint:"glm-4-air"},{provider:"openai-compat",baseUrl:"https://api.openai.com/v1",modelHint:"gpt-4o-mini"},{provider:"anthropic",baseUrl:"https://api.anthropic.com/v1",modelHint:"claude-3-5-sonnet-20241022"},{provider:"openai-compat",baseUrl:"",modelHint:""}];function ce(){const{t:a}=k(["settings","common"]),s=q();return e.jsxs("div",{className:"mx-auto flex max-w-5xl flex-col gap-6",children:[e.jsxs("header",{className:"flex items-center gap-3",children:[e.jsx("h1",{className:"text-xl font-semibold",children:a("llm.title")}),e.jsxs(y,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>void s.refetch(),disabled:s.isFetching,"aria-label":a("actions.refresh",{ns:"common"}),children:[s.isFetching?e.jsx(K,{className:"h-4 w-4 animate-spin"}):e.jsx(D,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:a("llm.refresh")})]})]}),e.jsx("p",{className:"text-sm text-text-dim",children:a("llm.subtitle")}),s.isLoading?e.jsx("div",{className:"h-64 rounded-md bg-surface-2 animate-pulse"}):e.jsxs(e.Fragment,{children:[e.jsx(G,{data:s.data}),e.jsx(J,{data:s.data}),e.jsx(X,{})]})]})}function G({data:a}){const{t:s}=k(["settings","common"]),x=F(),p=M(),[i,h]=b.useState({});async function r(t){if(confirm(s("llm.removeConfirm",{name:t})))try{const l=await x.mutateAsync(t);m.success(s("llm.removedToast",{count:l.removedRoles}))}catch(l){m.error(l?.message??String(l))}}async function o(t){h(l=>({...l,[t]:s("llm.pinging")}));try{const l=await p.mutateAsync(t),u=l.ok?`✓ ${l.durationMs}ms · tokens ${l.tokensIn}→${l.tokensOut}`:`✗ ${l.error}`;h(S=>({...S,[t]:u}))}catch(l){h(u=>({...u,[t]:`✗ ${l?.message??String(l)}`}))}}const d=a?.backends??[];return d.length===0?e.jsx("section",{className:"rounded-md border border-border bg-surface p-6 text-center text-sm text-text-dim",children:s("llm.backendsEmpty")}):e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsx("header",{className:"border-b border-border px-4 py-3",children:e.jsx("h2",{className:"text-sm font-semibold",children:s("llm.backendsTitle",{count:d.length})})}),e.jsxs(_,{children:[e.jsx($,{children:e.jsxs(U,{children:[e.jsx(j,{children:s("llm.col.name")}),e.jsx(j,{children:s("llm.col.provider")}),e.jsx(j,{children:s("llm.col.model")}),e.jsx(j,{children:s("llm.col.baseUrl")}),e.jsx(j,{children:s("llm.col.apiKey")}),e.jsx(j,{children:s("llm.col.actions")})]})}),e.jsx(z,{children:d.map(t=>{const l=t.secret.source==="none"?e.jsx(T,{variant:"outline",children:s("llm.secretMissing")}):e.jsx(T,{variant:"success",children:t.secret.source});return e.jsxs(U,{children:[e.jsx(g,{className:"font-mono text-xs",children:t.name}),e.jsx(g,{children:t.provider}),e.jsx(g,{className:"font-mono text-xs",children:t.model}),e.jsx(g,{className:"break-all font-mono text-[11px] text-text-dim",children:t.baseUrl??"—"}),e.jsx(g,{children:l}),e.jsxs(g,{className:"flex flex-col gap-1 sm:flex-row sm:items-center",children:[e.jsxs(y,{variant:"ghost",size:"sm",onClick:()=>void o(t.name),disabled:p.isPending||t.secret.source==="none",title:t.secret.source==="none"?s("llm.setKeyFirst"):s("llm.pingHint"),children:[e.jsx(Q,{className:"h-4 w-4"}),e.jsx("span",{children:s("llm.ping")})]}),e.jsxs(y,{variant:"ghost",size:"sm",onClick:()=>void r(t.name),disabled:x.isPending,className:"text-danger hover:text-danger",children:[e.jsx(W,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("llm.remove")})]}),i[t.name]&&e.jsx("span",{className:"ml-2 text-[11px] text-text-dim",children:i[t.name]})]})]},t.name)})})]})]})}function J({data:a}){const{t:s}=k(["settings","common"]),x=O(),p=(a?.backends??[]).map(r=>r.name),i=a?.roles??{};async function h(r,o){const d={[r]:o===P?null:o};try{await x.mutateAsync(d),m.success(s("llm.roleUpdated",{role:r}))}catch(t){m.error(t?.message??String(t))}}return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsx("header",{className:"border-b border-border px-4 py-3",children:e.jsx("h2",{className:"text-sm font-semibold",children:s("llm.rolesTitle")})}),e.jsx("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-3",children:Y.map(r=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(f,{className:"text-xs font-medium",children:r}),e.jsxs(L,{value:i[r]??P,onValueChange:o=>void h(r,o),disabled:p.length===0||x.isPending,children:[e.jsx(B,{className:"font-mono text-xs",children:e.jsx(H,{placeholder:s("llm.unset")})}),e.jsxs(E,{children:[e.jsx(R,{value:P,children:s("llm.unbound")}),p.map(o=>e.jsx(R,{value:o,children:o},o))]})]}),e.jsx("p",{className:"text-[11px] text-text-dim",children:s(`llm.roleHint.${r}`)})]},r))})]})}function X(){const{t:a}=k(["settings","common"]),s=V(),[x,p]=b.useState(0),[i,h]=b.useState(""),[r,o]=b.useState(v[0]?.baseUrl??""),[d,t]=b.useState(v[0]?.modelHint??""),[l,u]=b.useState("");function S(n){p(n);const c=v[n];c&&(o(c.baseUrl),t(c.modelHint))}async function A(n){n.preventDefault();const c=v[x];if(!c){m.error(a("llm.invalidPreset"));return}if(!i.trim()){m.error(a("llm.nameRequired"));return}if(!r.trim()){m.error(a("llm.baseUrlRequired"));return}if(!d.trim()){m.error(a("llm.modelRequired"));return}try{await s.mutateAsync({name:i.trim(),provider:c.provider,baseUrl:r.trim(),model:d.trim(),...l.trim()?{apiKey:l.trim()}:{}}),m.success(l.trim()?a("llm.addedWithKey",{name:i.trim()}):a("llm.addedNoKey",{name:i.trim()})),h(""),u("")}catch(C){m.error(C?.message??String(C))}}return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsx("header",{className:"border-b border-border px-4 py-3",children:e.jsx("h2",{className:"text-sm font-semibold",children:a("llm.addTitle")})}),e.jsxs("form",{onSubmit:n=>void A(n),className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(f,{className:"text-xs font-medium",children:a("llm.preset")}),e.jsxs(L,{value:String(x),onValueChange:n=>S(Number(n)),children:[e.jsx(B,{children:e.jsx(H,{})}),e.jsx(E,{children:v.map((n,c)=>e.jsx(R,{value:String(c),children:a(`llm.presets.${w[c]}`)},w[c]))})]})]}),e.jsxs("div",{children:[e.jsx(f,{className:"text-xs font-medium",children:a("llm.name")}),e.jsx(N,{value:i,onChange:n=>h(n.target.value),placeholder:a("llm.namePlaceholder"),className:"font-mono text-xs"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(f,{className:"text-xs font-medium",children:a("llm.baseUrl")}),e.jsx(N,{value:r,onChange:n=>o(n.target.value),placeholder:a("llm.baseUrlPlaceholder"),className:"font-mono text-xs"})]}),e.jsxs("div",{children:[e.jsx(f,{className:"text-xs font-medium",children:a("llm.model")}),e.jsx(N,{value:d,onChange:n=>t(n.target.value),placeholder:a("llm.modelPlaceholder"),className:"font-mono text-xs"})]}),e.jsxs("div",{children:[e.jsx(f,{className:"text-xs font-medium",children:a("llm.apiKeyOptional")}),e.jsx(N,{type:"password",value:l,onChange:n=>u(n.target.value),placeholder:a("llm.apiKeyPlaceholder"),className:"font-mono text-xs",autoComplete:"off"})]}),e.jsx("div",{className:"sm:col-span-2 flex",children:e.jsxs(y,{type:"submit",disabled:s.isPending,className:"ml-auto",children:[s.isPending?e.jsx(K,{className:"h-4 w-4 animate-spin"}):e.jsx(Z,{className:"h-4 w-4"}),a("llm.addBackend")]})})]})]})}export{ce as default};
7
- //# sourceMappingURL=llm-CPIRNQU2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"llm-CPIRNQU2.js","sources":["../../node_modules/lucide-react/dist/esm/icons/zap.js","../../src/routes/settings/llm.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.469.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Zap = createLucideIcon(\"Zap\", [\n [\n \"path\",\n {\n d: \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\",\n key: \"1xq2db\"\n }\n ]\n]);\n\nexport { Zap as default };\n//# sourceMappingURL=zap.js.map\n","/**\n * /settings/llm — native LLM backends + role bindings (Stage 6).\n *\n * Front-end for the `/api/llm/*` REST surface that landed in Stage 4.\n * Operators add an OpenAI-compatible or Anthropic backend, paste an\n * API key, bind it to a role (cheap / evaluator / native-chat), and\n * ping-test the connection — all without hand-editing\n * ~/.agim/config.json.\n *\n * Intentionally minimal styling — focused on doing the job; matches\n * the existing settings pages' shadcn look without bespoke chrome.\n */\n\nimport { useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { toast } from 'sonner'\nimport { CheckCircle2, Loader2, Plus, RefreshCcw, Trash2, Zap } from 'lucide-react'\n\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Input } from '@/components/ui/input'\nimport { Label } from '@/components/ui/label'\nimport {\n Select, SelectContent, SelectItem, SelectTrigger, SelectValue,\n} from '@/components/ui/select'\nimport {\n Table, TableBody, TableCell, TableHead, TableHeader, TableRow,\n} from '@/components/ui/table'\nimport {\n useLlmList, useLlmAddBackend, useLlmRemoveBackend, useLlmPutRoles, useLlmPing,\n} from '@/hooks/use-llm-admin'\n\nconst KNOWN_ROLES = ['cheap', 'evaluator', 'native-chat'] as const\nconst UNBIND_SENTINEL = '__unbind__'\n\ninterface ProviderPreset {\n provider: 'openai-compat' | 'anthropic'\n baseUrl: string\n modelHint: string\n}\n\nconst PRESET_KEYS = ['deepseek', 'moonshot', 'zhipu', 'openai', 'anthropic', 'custom'] as const\n\nconst PRESETS: ProviderPreset[] = [\n { provider: 'openai-compat',\n baseUrl: 'https://api.deepseek.com/v1', modelHint: 'deepseek-chat' },\n { provider: 'openai-compat',\n baseUrl: 'https://api.moonshot.cn/v1', modelHint: 'moonshot-v1-8k' },\n { provider: 'openai-compat',\n baseUrl: 'https://open.bigmodel.cn/api/paas/v4', modelHint: 'glm-4-air' },\n { provider: 'openai-compat',\n baseUrl: 'https://api.openai.com/v1', modelHint: 'gpt-4o-mini' },\n { provider: 'anthropic',\n baseUrl: 'https://api.anthropic.com/v1', modelHint: 'claude-3-5-sonnet-20241022' },\n { provider: 'openai-compat',\n baseUrl: '', modelHint: '' },\n]\n\nexport default function SettingsLlmRoute(): JSX.Element {\n const { t } = useTranslation(['settings', 'common'])\n const listQuery = useLlmList()\n return (\n <div className=\"mx-auto flex max-w-5xl flex-col gap-6\">\n <header className=\"flex items-center gap-3\">\n <h1 className=\"text-xl font-semibold\">{t('llm.title')}</h1>\n <Button\n variant=\"ghost\" size=\"sm\" className=\"ml-auto\"\n onClick={() => void listQuery.refetch()}\n disabled={listQuery.isFetching}\n aria-label={t('actions.refresh', { ns: 'common' })}\n >\n {listQuery.isFetching\n ? <Loader2 className=\"h-4 w-4 animate-spin\" />\n : <RefreshCcw className=\"h-4 w-4\" />}\n <span className=\"hidden sm:inline\">{t('llm.refresh')}</span>\n </Button>\n </header>\n <p className=\"text-sm text-text-dim\">{t('llm.subtitle')}</p>\n\n {listQuery.isLoading ? (\n <div className=\"h-64 rounded-md bg-surface-2 animate-pulse\" />\n ) : (\n <>\n <BackendsCard data={listQuery.data} />\n <RolesCard data={listQuery.data} />\n <AddBackendCard />\n </>\n )}\n </div>\n )\n}\n\n/* ─────────────── Backends list ─────────────── */\n\nfunction BackendsCard({ data }: { data: ReturnType<typeof useLlmList>['data'] }): JSX.Element {\n const { t } = useTranslation(['settings', 'common'])\n const removeBackend = useLlmRemoveBackend()\n const ping = useLlmPing()\n const [pingResults, setPingResults] = useState<Record<string, string>>({})\n\n async function onRemove(name: string): Promise<void> {\n if (!confirm(t('llm.removeConfirm', { name }))) return\n try {\n const r = await removeBackend.mutateAsync(name)\n toast.success(t('llm.removedToast', { count: r.removedRoles }))\n } catch (err) {\n toast.error(((err as Error)?.message ?? String(err)))\n }\n }\n\n async function onPing(name: string): Promise<void> {\n setPingResults((m) => ({ ...m, [name]: t('llm.pinging') }))\n try {\n const r = await ping.mutateAsync(name)\n const msg = r.ok\n ? `✓ ${r.durationMs}ms · tokens ${r.tokensIn}→${r.tokensOut}`\n : `✗ ${r.error}`\n setPingResults((m) => ({ ...m, [name]: msg }))\n } catch (err) {\n setPingResults((m) => ({ ...m, [name]: `✗ ${((err as Error)?.message ?? String(err))}` }))\n }\n }\n\n const rows = data?.backends ?? []\n if (rows.length === 0) {\n return (\n <section className=\"rounded-md border border-border bg-surface p-6 text-center text-sm text-text-dim\">\n {t('llm.backendsEmpty')}\n </section>\n )\n }\n\n return (\n <section className=\"rounded-md border border-border bg-surface\">\n <header className=\"border-b border-border px-4 py-3\">\n <h2 className=\"text-sm font-semibold\">{t('llm.backendsTitle', { count: rows.length })}</h2>\n </header>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>{t('llm.col.name')}</TableHead>\n <TableHead>{t('llm.col.provider')}</TableHead>\n <TableHead>{t('llm.col.model')}</TableHead>\n <TableHead>{t('llm.col.baseUrl')}</TableHead>\n <TableHead>{t('llm.col.apiKey')}</TableHead>\n <TableHead>{t('llm.col.actions')}</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map((b) => {\n const keyBadge = b.secret.source === 'none'\n ? <Badge variant=\"outline\">{t('llm.secretMissing')}</Badge>\n : <Badge variant=\"success\">{b.secret.source}</Badge>\n return (\n <TableRow key={b.name}>\n <TableCell className=\"font-mono text-xs\">{b.name}</TableCell>\n <TableCell>{b.provider}</TableCell>\n <TableCell className=\"font-mono text-xs\">{b.model}</TableCell>\n <TableCell className=\"break-all font-mono text-[11px] text-text-dim\">{b.baseUrl ?? '—'}</TableCell>\n <TableCell>{keyBadge}</TableCell>\n <TableCell className=\"flex flex-col gap-1 sm:flex-row sm:items-center\">\n <Button\n variant=\"ghost\" size=\"sm\"\n onClick={() => void onPing(b.name)}\n disabled={ping.isPending || b.secret.source === 'none'}\n title={b.secret.source === 'none' ? t('llm.setKeyFirst') : t('llm.pingHint')}\n >\n <Zap className=\"h-4 w-4\" />\n <span>{t('llm.ping')}</span>\n </Button>\n <Button\n variant=\"ghost\" size=\"sm\"\n onClick={() => void onRemove(b.name)}\n disabled={removeBackend.isPending}\n className=\"text-danger hover:text-danger\"\n >\n <Trash2 className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">{t('llm.remove')}</span>\n </Button>\n {pingResults[b.name] && (\n <span className=\"ml-2 text-[11px] text-text-dim\">{pingResults[b.name]}</span>\n )}\n </TableCell>\n </TableRow>\n )\n })}\n </TableBody>\n </Table>\n </section>\n )\n}\n\n/* ─────────────── Role bindings ─────────────── */\n\nfunction RolesCard({ data }: { data: ReturnType<typeof useLlmList>['data'] }): JSX.Element {\n const { t } = useTranslation(['settings', 'common'])\n const putRoles = useLlmPutRoles()\n const backendNames = (data?.backends ?? []).map((b) => b.name)\n const current = data?.roles ?? {}\n\n async function onChangeRole(role: string, value: string): Promise<void> {\n const next: Record<string, string | null> = {\n [role]: value === UNBIND_SENTINEL ? null : value,\n }\n try {\n await putRoles.mutateAsync(next)\n toast.success(t('llm.roleUpdated', { role }))\n } catch (err) {\n toast.error(((err as Error)?.message ?? String(err)))\n }\n }\n\n return (\n <section className=\"rounded-md border border-border bg-surface\">\n <header className=\"border-b border-border px-4 py-3\">\n <h2 className=\"text-sm font-semibold\">{t('llm.rolesTitle')}</h2>\n </header>\n <div className=\"grid grid-cols-1 gap-3 p-4 sm:grid-cols-3\">\n {KNOWN_ROLES.map((role) => (\n <div key={role} className=\"flex flex-col gap-1\">\n <Label className=\"text-xs font-medium\">{role}</Label>\n <Select\n value={current[role] ?? UNBIND_SENTINEL}\n onValueChange={(v) => void onChangeRole(role, v)}\n disabled={backendNames.length === 0 || putRoles.isPending}\n >\n <SelectTrigger className=\"font-mono text-xs\">\n <SelectValue placeholder={t('llm.unset')} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={UNBIND_SENTINEL}>{t('llm.unbound')}</SelectItem>\n {backendNames.map((n) => (\n <SelectItem key={n} value={n}>{n}</SelectItem>\n ))}\n </SelectContent>\n </Select>\n <p className=\"text-[11px] text-text-dim\">\n {t(`llm.roleHint.${role}`)}\n </p>\n </div>\n ))}\n </div>\n </section>\n )\n}\n\n/* ─────────────── Add backend form ─────────────── */\n\nfunction AddBackendCard(): JSX.Element {\n const { t } = useTranslation(['settings', 'common'])\n const addBackend = useLlmAddBackend()\n const [presetIdx, setPresetIdx] = useState(0)\n const [name, setName] = useState('')\n const [baseUrl, setBaseUrl] = useState(PRESETS[0]?.baseUrl ?? '')\n const [model, setModel] = useState(PRESETS[0]?.modelHint ?? '')\n const [apiKey, setApiKey] = useState('')\n\n function onPickPreset(idx: number): void {\n setPresetIdx(idx)\n const p = PRESETS[idx]\n if (!p) return\n setBaseUrl(p.baseUrl)\n setModel(p.modelHint)\n }\n\n async function onSubmit(e: React.FormEvent): Promise<void> {\n e.preventDefault()\n const p = PRESETS[presetIdx]\n if (!p) { toast.error(t('llm.invalidPreset')); return }\n if (!name.trim()) { toast.error(t('llm.nameRequired')); return }\n if (!baseUrl.trim()) { toast.error(t('llm.baseUrlRequired')); return }\n if (!model.trim()) { toast.error(t('llm.modelRequired')); return }\n try {\n await addBackend.mutateAsync({\n name: name.trim(),\n provider: p.provider,\n baseUrl: baseUrl.trim(),\n model: model.trim(),\n ...(apiKey.trim() ? { apiKey: apiKey.trim() } : {}),\n })\n toast.success(\n apiKey.trim()\n ? t('llm.addedWithKey', { name: name.trim() })\n : t('llm.addedNoKey', { name: name.trim() }),\n )\n setName(''); setApiKey('')\n } catch (err) {\n toast.error(((err as Error)?.message ?? String(err)))\n }\n }\n\n return (\n <section className=\"rounded-md border border-border bg-surface\">\n <header className=\"border-b border-border px-4 py-3\">\n <h2 className=\"text-sm font-semibold\">{t('llm.addTitle')}</h2>\n </header>\n <form onSubmit={(e) => void onSubmit(e)} className=\"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2\">\n <div>\n <Label className=\"text-xs font-medium\">{t('llm.preset')}</Label>\n <Select value={String(presetIdx)} onValueChange={(v) => onPickPreset(Number(v))}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {PRESETS.map((_p, i) => (\n <SelectItem key={PRESET_KEYS[i]} value={String(i)}>\n {t(`llm.presets.${PRESET_KEYS[i]}`)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div>\n <Label className=\"text-xs font-medium\">{t('llm.name')}</Label>\n <Input\n value={name} onChange={(e) => setName(e.target.value)}\n placeholder={t('llm.namePlaceholder')}\n className=\"font-mono text-xs\"\n />\n </div>\n <div className=\"sm:col-span-2\">\n <Label className=\"text-xs font-medium\">{t('llm.baseUrl')}</Label>\n <Input\n value={baseUrl} onChange={(e) => setBaseUrl(e.target.value)}\n placeholder={t('llm.baseUrlPlaceholder')}\n className=\"font-mono text-xs\"\n />\n </div>\n <div>\n <Label className=\"text-xs font-medium\">{t('llm.model')}</Label>\n <Input\n value={model} onChange={(e) => setModel(e.target.value)}\n placeholder={t('llm.modelPlaceholder')}\n className=\"font-mono text-xs\"\n />\n </div>\n <div>\n <Label className=\"text-xs font-medium\">{t('llm.apiKeyOptional')}</Label>\n <Input\n type=\"password\"\n value={apiKey} onChange={(e) => setApiKey(e.target.value)}\n placeholder={t('llm.apiKeyPlaceholder')}\n className=\"font-mono text-xs\"\n autoComplete=\"off\"\n />\n </div>\n <div className=\"sm:col-span-2 flex\">\n <Button\n type=\"submit\"\n disabled={addBackend.isPending}\n className=\"ml-auto\"\n >\n {addBackend.isPending ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <Plus className=\"h-4 w-4\" />}\n {t('llm.addBackend')}\n </Button>\n </div>\n </form>\n </section>\n )\n}\n\n/* helper — toast tag passthrough */\nfunction _unused(): typeof CheckCircle2 { return CheckCircle2 }\nvoid _unused\n"],"names":["Zap","createLucideIcon","KNOWN_ROLES","UNBIND_SENTINEL","PRESET_KEYS","PRESETS","SettingsLlmRoute","t","useTranslation","listQuery","useLlmList","jsxs","jsx","Button","Loader2","RefreshCcw","Fragment","BackendsCard","RolesCard","AddBackendCard","data","removeBackend","useLlmRemoveBackend","ping","useLlmPing","pingResults","setPingResults","useState","onRemove","name","r","toast","err","onPing","m","msg","rows","Table","TableHeader","TableRow","TableHead","TableBody","b","keyBadge","Badge","TableCell","Trash2","putRoles","useLlmPutRoles","backendNames","current","onChangeRole","role","value","next","Label","Select","v","SelectTrigger","SelectValue","SelectContent","SelectItem","n","addBackend","useLlmAddBackend","presetIdx","setPresetIdx","setName","baseUrl","setBaseUrl","model","setModel","apiKey","setApiKey","onPickPreset","idx","p","onSubmit","e","_p","i","Input","Plus"],"mappings":"ygBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,EAAMC,EAAiB,MAAO,CAClC,CACE,OACA,CACE,EAAG,8JACH,IAAK,QACX,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AW,gBAAajD,EAAA,CAAQ,UAAU,uBAAuB,EAAKF,EAAAA,IAACsE,EAAA,CAAK,UAAU,SAAA,CAAU,EAChG3E,EAAE,gBAAgB,CAAA,CAAA,CAAA,CACrB,CACF,CAAA,CAAA,CACF,CAAA,EACF,CAEJ","x_google_ignoreList":[0]}
@@ -1,12 +0,0 @@
1
- import{n as Pe,s as he,t as Te,v as pe,j as o,P as T,w,x as U,y as Ae,z as Oe,A as xe,D as we,E as Ut,F as Bt,G as ke,H as oe,J as Vt,K as Yt,M as zt,Q as Ht,U as Wt,V as qt,W as Xt,X as Qt,Y as Zt,c as A,q as Jt,a as en,b as tn,d as Fe,u as Le,e as nn,k as on,B as Ie,T as rn,I as ue,L as Ee,l as Se,m as an}from"./index-O0BQoyzo.js";import{r as s}from"./react-Cb2sDjhD.js";import{D as sn}from"./data-table-S7rIjwdO.js";import{E as cn}from"./empty-state-C-qjOHyu.js";import{C as ln}from"./confirm-dialog-DmJq4Td9.js";import{C as un}from"./chevron-right-uP_l9MMb.js";import{u as dn}from"./useQuery-PdiC7-sY.js";import{T as pn}from"./trash-2-Dfov8aHD.js";import{R as fn}from"./refresh-ccw-D2CWiyU_.js";import{S as mn}from"./search-B4fHilZ0.js";import{M as hn}from"./map-pin-BXYvvHry.js";import"./table-CPn1MRcy.js";import"./arrow-up-63xELY5Q.js";import"./arrow-down-BXvC8Al2.js";import"./dialog-bAIDaO-6.js";import"./x-DG-JKVw_.js";/**
2
- * @license lucide-react v0.469.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const xn=Pe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
7
- * @license lucide-react v0.469.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const wn=Pe("NotebookText",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M9.5 8h5",key:"11mslq"}],["path",{d:"M9.5 12H16",key:"ktog6x"}],["path",{d:"M9.5 16H14",key:"p1seyn"}]]);var de="rovingFocusGroup.onEntryFocus",gn={bubbles:!1,cancelable:!0},X="RovingFocusGroup",[fe,Ge,vn]=Te(X),[Mn,Ke]=he(X,[vn]),[Cn,bn]=Mn(X),$e=s.forwardRef((e,t)=>o.jsx(fe.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(fe.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(yn,{...e,ref:t})})}));$e.displayName=X;var yn=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:d=!1,...i}=e,x=s.useRef(null),M=U(t,x),g=Ae(c),[N,v]=Oe({prop:l,defaultProp:u??null,onChange:f,caller:X}),[C,P]=s.useState(!1),b=xe(m),I=Ge(n),O=s.useRef(!1),[p,_]=s.useState(0);return s.useEffect(()=>{const y=x.current;if(y)return y.addEventListener(de,b),()=>y.removeEventListener(de,b)},[b]),o.jsx(Cn,{scope:n,orientation:r,dir:g,loop:a,currentTabStopId:N,onItemFocus:s.useCallback(y=>v(y),[v]),onItemShiftTab:s.useCallback(()=>P(!0),[]),onFocusableItemAdd:s.useCallback(()=>_(y=>y+1),[]),onFocusableItemRemove:s.useCallback(()=>_(y=>y-1),[]),children:o.jsx(T.div,{tabIndex:C||p===0?-1:0,"data-orientation":r,...i,ref:M,style:{outline:"none",...e.style},onMouseDown:w(e.onMouseDown,()=>{O.current=!0}),onFocus:w(e.onFocus,y=>{const j=!O.current;if(y.target===y.currentTarget&&j&&!C){const k=new CustomEvent(de,gn);if(y.currentTarget.dispatchEvent(k),!k.defaultPrevented){const B=I().filter(D=>D.focusable),V=B.find(D=>D.active),J=B.find(D=>D.id===N),ce=[V,J,...B].filter(Boolean).map(D=>D.ref.current);Ve(ce,d)}}O.current=!1}),onBlur:w(e.onBlur,()=>P(!1))})})}),Ue="RovingFocusGroupItem",Be=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:c,children:l,...u}=e,f=pe(),m=c||f,d=bn(Ue,n),i=d.currentTabStopId===m,x=Ge(n),{onFocusableItemAdd:M,onFocusableItemRemove:g,currentTabStopId:N}=d;return s.useEffect(()=>{if(r)return M(),()=>g()},[r,M,g]),o.jsx(fe.ItemSlot,{scope:n,id:m,focusable:r,active:a,children:o.jsx(T.span,{tabIndex:i?0:-1,"data-orientation":d.orientation,...u,ref:t,onMouseDown:w(e.onMouseDown,v=>{r?d.onItemFocus(m):v.preventDefault()}),onFocus:w(e.onFocus,()=>d.onItemFocus(m)),onKeyDown:w(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const C=Nn(v,d.orientation,d.dir);if(C!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=x().filter(I=>I.focusable).map(I=>I.ref.current);if(C==="last")b.reverse();else if(C==="prev"||C==="next"){C==="prev"&&b.reverse();const I=b.indexOf(v.currentTarget);b=d.loop?In(b,I+1):b.slice(I+1)}setTimeout(()=>Ve(b))}}),children:typeof l=="function"?l({isCurrentTabStop:i,hasTabStop:N!=null}):l})})});Be.displayName=Ue;var _n={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Rn(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Nn(e,t,n){const r=Rn(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _n[r]}function Ve(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function In(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var En=$e,Sn=Be;function jn(e){const t=Dn(e),n=s.forwardRef((r,a)=>{const{children:c,...l}=r,u=s.Children.toArray(c),f=u.find(Tn);if(f){const m=f.props.children,d=u.map(i=>i===f?s.Children.count(m)>1?s.Children.only(null):s.isValidElement(m)?m.props.children:null:i);return o.jsx(t,{...l,ref:a,children:s.isValidElement(m)?s.cloneElement(m,void 0,d):null})}return o.jsx(t,{...l,ref:a,children:c})});return n.displayName=`${e}.Slot`,n}function Dn(e){const t=s.forwardRef((n,r)=>{const{children:a,...c}=n;if(s.isValidElement(a)){const l=On(a),u=An(c,a.props);return a.type!==s.Fragment&&(u.ref=r?we(r,l):l),s.cloneElement(a,u)}return s.Children.count(a)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pn=Symbol("radix.slottable");function Tn(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pn}function An(e,t){const n={...t};for(const r in t){const a=e[r],c=t[r];/^on[A-Z]/.test(r)?a&&c?n[r]=(...u)=>{const f=c(...u);return a(...u),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...c}:r==="className"&&(n[r]=[a,c].filter(Boolean).join(" "))}return{...e,...n}}function On(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var me=["Enter"," "],kn=["ArrowDown","PageUp","Home"],Ye=["ArrowUp","PageDown","End"],Fn=[...kn,...Ye],Ln={ltr:[...me,"ArrowRight"],rtl:[...me,"ArrowLeft"]},Gn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Q="Menu",[W,Kn,$n]=Te(Q),[L,ze]=he(Q,[$n,ke,Ke]),re=ke(),He=Ke(),[Un,G]=L(Q),[Bn,Z]=L(Q),We=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:c,modal:l=!0}=e,u=re(t),[f,m]=s.useState(null),d=s.useRef(!1),i=xe(c),x=Ae(a);return s.useEffect(()=>{const M=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",M,{capture:!0}),()=>{document.removeEventListener("keydown",M,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),o.jsx(Ut,{...u,children:o.jsx(Un,{scope:t,open:n,onOpenChange:i,content:f,onContentChange:m,children:o.jsx(Bn,{scope:t,onClose:s.useCallback(()=>i(!1),[i]),isUsingKeyboardRef:d,dir:x,modal:l,children:r})})})};We.displayName=Q;var Vn="MenuAnchor",ge=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=re(n);return o.jsx(Bt,{...a,...r,ref:t})});ge.displayName=Vn;var ve="MenuPortal",[Yn,qe]=L(ve,{forceMount:void 0}),Xe=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,c=G(ve,t);return o.jsx(Yn,{scope:t,forceMount:n,children:o.jsx(oe,{present:n||c.open,children:o.jsx(Vt,{asChild:!0,container:a,children:r})})})};Xe.displayName=ve;var S="MenuContent",[zn,Me]=L(S),Qe=s.forwardRef((e,t)=>{const n=qe(S,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,c=G(S,e.__scopeMenu),l=Z(S,e.__scopeMenu);return o.jsx(W.Provider,{scope:e.__scopeMenu,children:o.jsx(oe,{present:r||c.open,children:o.jsx(W.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(Hn,{...a,ref:t}):o.jsx(Wn,{...a,ref:t})})})})}),Hn=s.forwardRef((e,t)=>{const n=G(S,e.__scopeMenu),r=s.useRef(null),a=U(t,r);return s.useEffect(()=>{const c=r.current;if(c)return Yt(c)},[]),o.jsx(Ce,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:w(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Wn=s.forwardRef((e,t)=>{const n=G(S,e.__scopeMenu);return o.jsx(Ce,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qn=jn("MenuContent.ScrollLock"),Ce=s.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:d,onFocusOutside:i,onInteractOutside:x,onDismiss:M,disableOutsideScroll:g,...N}=e,v=G(S,n),C=Z(S,n),P=re(n),b=He(n),I=Kn(n),[O,p]=s.useState(null),_=s.useRef(null),y=U(t,_,v.onContentChange),j=s.useRef(0),k=s.useRef(""),B=s.useRef(0),V=s.useRef(null),J=s.useRef("right"),ee=s.useRef(0),ce=g?Wt:s.Fragment,D=g?{as:qn,allowPinchZoom:!0}:void 0,$t=h=>{const $=k.current+h,F=I().filter(E=>!E.disabled),Y=document.activeElement,ie=F.find(E=>E.ref.current===Y)?.textValue,le=F.map(E=>E.textValue),Re=co(le,$,ie),z=F.find(E=>E.textValue===Re)?.ref.current;(function E(Ne){k.current=Ne,window.clearTimeout(j.current),Ne!==""&&(j.current=window.setTimeout(()=>E(""),1e3))})($),z&&setTimeout(()=>z.focus())};s.useEffect(()=>()=>window.clearTimeout(j.current),[]),Ht();const K=s.useCallback(h=>J.current===V.current?.side&&lo(h,V.current?.area),[]);return o.jsx(zn,{scope:n,searchRef:k,onItemEnter:s.useCallback(h=>{K(h)&&h.preventDefault()},[K]),onItemLeave:s.useCallback(h=>{K(h)||(_.current?.focus(),p(null))},[K]),onTriggerLeave:s.useCallback(h=>{K(h)&&h.preventDefault()},[K]),pointerGraceTimerRef:B,onPointerGraceIntentChange:s.useCallback(h=>{V.current=h},[]),children:o.jsx(ce,{...D,children:o.jsx(qt,{asChild:!0,trapped:a,onMountAutoFocus:w(c,h=>{h.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Xt,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:d,onFocusOutside:i,onInteractOutside:x,onDismiss:M,children:o.jsx(En,{asChild:!0,...b,dir:C.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:p,onEntryFocus:w(f,h=>{C.isUsingKeyboardRef.current||h.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Qt,{role:"menu","aria-orientation":"vertical","data-state":ft(v.open),"data-radix-menu-content":"",dir:C.dir,...P,...N,ref:y,style:{outline:"none",...N.style},onKeyDown:w(N.onKeyDown,h=>{const F=h.target.closest("[data-radix-menu-content]")===h.currentTarget,Y=h.ctrlKey||h.altKey||h.metaKey,ie=h.key.length===1;F&&(h.key==="Tab"&&h.preventDefault(),!Y&&ie&&$t(h.key));const le=_.current;if(h.target!==le||!Fn.includes(h.key))return;h.preventDefault();const z=I().filter(E=>!E.disabled).map(E=>E.ref.current);Ye.includes(h.key)&&z.reverse(),ao(z)}),onBlur:w(e.onBlur,h=>{h.currentTarget.contains(h.target)||(window.clearTimeout(j.current),k.current="")}),onPointerMove:w(e.onPointerMove,q(h=>{const $=h.target,F=ee.current!==h.clientX;if(h.currentTarget.contains($)&&F){const Y=h.clientX>ee.current?"right":"left";J.current=Y,ee.current=h.clientX}}))})})})})})})});Qe.displayName=S;var Xn="MenuGroup",be=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(T.div,{role:"group",...r,ref:t})});be.displayName=Xn;var Qn="MenuLabel",Ze=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(T.div,{...r,ref:t})});Ze.displayName=Qn;var te="MenuItem",je="menu.itemSelect",ae=s.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,c=s.useRef(null),l=Z(te,e.__scopeMenu),u=Me(te,e.__scopeMenu),f=U(t,c),m=s.useRef(!1),d=()=>{const i=c.current;if(!n&&i){const x=new CustomEvent(je,{bubbles:!0,cancelable:!0});i.addEventListener(je,M=>r?.(M),{once:!0}),zt(i,x),x.defaultPrevented?m.current=!1:l.onClose()}};return o.jsx(Je,{...a,ref:f,disabled:n,onClick:w(e.onClick,d),onPointerDown:i=>{e.onPointerDown?.(i),m.current=!0},onPointerUp:w(e.onPointerUp,i=>{m.current||i.currentTarget?.click()}),onKeyDown:w(e.onKeyDown,i=>{const x=u.searchRef.current!=="";n||x&&i.key===" "||me.includes(i.key)&&(i.currentTarget.click(),i.preventDefault())})})});ae.displayName=te;var Je=s.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...c}=e,l=Me(te,n),u=He(n),f=s.useRef(null),m=U(t,f),[d,i]=s.useState(!1),[x,M]=s.useState("");return s.useEffect(()=>{const g=f.current;g&&M((g.textContent??"").trim())},[c.children]),o.jsx(W.ItemSlot,{scope:n,disabled:r,textValue:a??x,children:o.jsx(Sn,{asChild:!0,...u,focusable:!r,children:o.jsx(T.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...c,ref:m,onPointerMove:w(e.onPointerMove,q(g=>{r?l.onItemLeave(g):(l.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:w(e.onPointerLeave,q(g=>l.onItemLeave(g))),onFocus:w(e.onFocus,()=>i(!0)),onBlur:w(e.onBlur,()=>i(!1))})})})}),Zn="MenuCheckboxItem",et=s.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return o.jsx(at,{scope:e.__scopeMenu,checked:n,children:o.jsx(ae,{role:"menuitemcheckbox","aria-checked":ne(n)?"mixed":n,...a,ref:t,"data-state":_e(n),onSelect:w(a.onSelect,()=>r?.(ne(n)?!0:!n),{checkForDefaultPrevented:!1})})})});et.displayName=Zn;var tt="MenuRadioGroup",[Jn,eo]=L(tt,{value:void 0,onValueChange:()=>{}}),nt=s.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,c=xe(r);return o.jsx(Jn,{scope:e.__scopeMenu,value:n,onValueChange:c,children:o.jsx(be,{...a,ref:t})})});nt.displayName=tt;var ot="MenuRadioItem",rt=s.forwardRef((e,t)=>{const{value:n,...r}=e,a=eo(ot,e.__scopeMenu),c=n===a.value;return o.jsx(at,{scope:e.__scopeMenu,checked:c,children:o.jsx(ae,{role:"menuitemradio","aria-checked":c,...r,ref:t,"data-state":_e(c),onSelect:w(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});rt.displayName=ot;var ye="MenuItemIndicator",[at,to]=L(ye,{checked:!1}),st=s.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,c=to(ye,n);return o.jsx(oe,{present:r||ne(c.checked)||c.checked===!0,children:o.jsx(T.span,{...a,ref:t,"data-state":_e(c.checked)})})});st.displayName=ye;var no="MenuSeparator",ct=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(T.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ct.displayName=no;var oo="MenuArrow",it=s.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=re(n);return o.jsx(Zt,{...a,...r,ref:t})});it.displayName=oo;var ro="MenuSub",[Cr,lt]=L(ro),H="MenuSubTrigger",ut=s.forwardRef((e,t)=>{const n=G(H,e.__scopeMenu),r=Z(H,e.__scopeMenu),a=lt(H,e.__scopeMenu),c=Me(H,e.__scopeMenu),l=s.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=c,m={__scopeMenu:e.__scopeMenu},d=s.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return s.useEffect(()=>d,[d]),s.useEffect(()=>{const i=u.current;return()=>{window.clearTimeout(i),f(null)}},[u,f]),o.jsx(ge,{asChild:!0,...m,children:o.jsx(Je,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":ft(n.open),...e,ref:we(t,a.onTriggerChange),onClick:i=>{e.onClick?.(i),!(e.disabled||i.defaultPrevented)&&(i.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:w(e.onPointerMove,q(i=>{c.onItemEnter(i),!i.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(c.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:w(e.onPointerLeave,q(i=>{d();const x=n.content?.getBoundingClientRect();if(x){const M=n.content?.dataset.side,g=M==="right",N=g?-5:5,v=x[g?"left":"right"],C=x[g?"right":"left"];c.onPointerGraceIntentChange({area:[{x:i.clientX+N,y:i.clientY},{x:v,y:x.top},{x:C,y:x.top},{x:C,y:x.bottom},{x:v,y:x.bottom}],side:M}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(i),i.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:w(e.onKeyDown,i=>{const x=c.searchRef.current!=="";e.disabled||x&&i.key===" "||Ln[r.dir].includes(i.key)&&(n.onOpenChange(!0),n.content?.focus(),i.preventDefault())})})})});ut.displayName=H;var dt="MenuSubContent",pt=s.forwardRef((e,t)=>{const n=qe(S,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,c=G(S,e.__scopeMenu),l=Z(S,e.__scopeMenu),u=lt(dt,e.__scopeMenu),f=s.useRef(null),m=U(t,f);return o.jsx(W.Provider,{scope:e.__scopeMenu,children:o.jsx(oe,{present:r||c.open,children:o.jsx(W.Slot,{scope:e.__scopeMenu,children:o.jsx(Ce,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:m,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{l.isUsingKeyboardRef.current&&f.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:w(e.onFocusOutside,d=>{d.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:w(e.onEscapeKeyDown,d=>{l.onClose(),d.preventDefault()}),onKeyDown:w(e.onKeyDown,d=>{const i=d.currentTarget.contains(d.target),x=Gn[l.dir].includes(d.key);i&&x&&(c.onOpenChange(!1),u.trigger?.focus(),d.preventDefault())})})})})})});pt.displayName=dt;function ft(e){return e?"open":"closed"}function ne(e){return e==="indeterminate"}function _e(e){return ne(e)?"indeterminate":e?"checked":"unchecked"}function ao(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function so(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function co(e,t,n){const a=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,c=n?e.indexOf(n):-1;let l=so(e,Math.max(c,0));a.length===1&&(l=l.filter(m=>m!==n));const f=l.find(m=>m.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function io(e,t){const{x:n,y:r}=e;let a=!1;for(let c=0,l=t.length-1;c<t.length;l=c++){const u=t[c],f=t[l],m=u.x,d=u.y,i=f.x,x=f.y;d>r!=x>r&&n<(i-m)*(r-d)/(x-d)+m&&(a=!a)}return a}function lo(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return io(n,t)}function q(e){return t=>t.pointerType==="mouse"?e(t):void 0}var uo=We,po=ge,fo=Xe,mo=Qe,ho=be,xo=Ze,wo=ae,go=et,vo=nt,Mo=rt,Co=st,bo=ct,yo=it,_o=ut,Ro=pt,se="DropdownMenu",[No]=he(se,[ze]),R=ze(),[Io,mt]=No(se),ht=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:c,onOpenChange:l,modal:u=!0}=e,f=R(t),m=s.useRef(null),[d,i]=Oe({prop:a,defaultProp:c??!1,onChange:l,caller:se});return o.jsx(Io,{scope:t,triggerId:pe(),triggerRef:m,contentId:pe(),open:d,onOpenChange:i,onOpenToggle:s.useCallback(()=>i(x=>!x),[i]),modal:u,children:o.jsx(uo,{...f,open:d,onOpenChange:i,dir:r,modal:u,children:n})})};ht.displayName=se;var xt="DropdownMenuTrigger",wt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,c=mt(xt,n),l=R(n);return o.jsx(po,{asChild:!0,...l,children:o.jsx(T.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:we(t,c.triggerRef),onPointerDown:w(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(c.onOpenToggle(),c.open||u.preventDefault())}),onKeyDown:w(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&c.onOpenToggle(),u.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});wt.displayName=xt;var Eo="DropdownMenuPortal",gt=e=>{const{__scopeDropdownMenu:t,...n}=e,r=R(t);return o.jsx(fo,{...r,...n})};gt.displayName=Eo;var vt="DropdownMenuContent",Mt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=mt(vt,n),c=R(n),l=s.useRef(!1);return o.jsx(mo,{id:a.contentId,"aria-labelledby":a.triggerId,...c,...r,ref:t,onCloseAutoFocus:w(e.onCloseAutoFocus,u=>{l.current||a.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:w(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,d=f.button===2||m;(!a.modal||d)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mt.displayName=vt;var So="DropdownMenuGroup",jo=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(ho,{...a,...r,ref:t})});jo.displayName=So;var Do="DropdownMenuLabel",Ct=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(xo,{...a,...r,ref:t})});Ct.displayName=Do;var Po="DropdownMenuItem",bt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(wo,{...a,...r,ref:t})});bt.displayName=Po;var To="DropdownMenuCheckboxItem",yt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(go,{...a,...r,ref:t})});yt.displayName=To;var Ao="DropdownMenuRadioGroup",Oo=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(vo,{...a,...r,ref:t})});Oo.displayName=Ao;var ko="DropdownMenuRadioItem",_t=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(Mo,{...a,...r,ref:t})});_t.displayName=ko;var Fo="DropdownMenuItemIndicator",Rt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(Co,{...a,...r,ref:t})});Rt.displayName=Fo;var Lo="DropdownMenuSeparator",Nt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(bo,{...a,...r,ref:t})});Nt.displayName=Lo;var Go="DropdownMenuArrow",Ko=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(yo,{...a,...r,ref:t})});Ko.displayName=Go;var $o="DropdownMenuSubTrigger",It=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(_o,{...a,...r,ref:t})});It.displayName=$o;var Uo="DropdownMenuSubContent",Et=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=R(n);return o.jsx(Ro,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Et.displayName=Uo;var Bo=ht,Vo=wt,Yo=gt,St=Mt,jt=Ct,Dt=bt,Pt=yt,Tt=_t,At=Rt,Ot=Nt,kt=It,Ft=Et;const zo=Bo,Ho=Vo,Wo=s.forwardRef(({className:e,inset:t,children:n,...r},a)=>o.jsxs(kt,{ref:a,className:A("flex cursor-default select-none items-center gap-2 rounded px-2 py-1.5 text-sm outline-none","focus:bg-surface-hover data-[state=open]:bg-surface-hover",t&&"pl-8",e),...r,children:[n,o.jsx(un,{className:"ml-auto h-4 w-4"})]}));Wo.displayName=kt.displayName;const qo=s.forwardRef(({className:e,...t},n)=>o.jsx(Ft,{ref:n,className:A("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...t}));qo.displayName=Ft.displayName;const Lt=s.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(Yo,{children:o.jsx(St,{ref:r,sideOffset:t,className:A("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...n})}));Lt.displayName=St.displayName;const Gt=s.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(Dt,{ref:r,className:A("relative flex cursor-default select-none items-center gap-2 rounded px-2 py-1.5 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Gt.displayName=Dt.displayName;const Xo=s.forwardRef(({className:e,children:t,checked:n,...r},a)=>o.jsxs(Pt,{ref:a,className:A("relative flex cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(At,{children:o.jsx(Jt,{className:"h-4 w-4"})})}),t]}));Xo.displayName=Pt.displayName;const Qo=s.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Tt,{ref:r,className:A("relative flex cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(At,{children:o.jsx(xn,{className:"h-2 w-2 fill-current"})})}),t]}));Qo.displayName=Tt.displayName;const Zo=s.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(jt,{ref:r,className:A("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",t&&"pl-8",e),...n}));Zo.displayName=jt.displayName;const Jo=s.forwardRef(({className:e,...t},n)=>o.jsx(Ot,{ref:n,className:A("-mx-1 my-1 h-px bg-border",e),...t}));Jo.displayName=Ot.displayName;const Kt={all:["memos"],list:e=>["memos","list",e]};function er(e){return dn({queryKey:Kt.list(e),queryFn:()=>Fe.listMemos(e)})}function tr(){const e=en();return tn({mutationFn:t=>Fe.deleteMemo(t),onSuccess:()=>e.invalidateQueries({queryKey:Kt.all})})}const nr=300;function br(){const{t:e}=Le(["memos","common"]),[t,n]=nn(),r=t.get("q")??"",a=t.get("who")??"",c=t.get("what")??"",l=t.get("has_location")==="1",u=t.get("include_expired")==="1",[f,m]=s.useState(r);s.useEffect(()=>{if(f===r)return;const p=window.setTimeout(()=>{b({q:f||null})},nr);return()=>window.clearTimeout(p)},[f]);const d=s.useMemo(()=>({...r?{query:r}:{},...a?{who:a}:{},...c?{what:c}:{},...l?{has_location:!0}:{},...u?{include_expired:!0}:{},limit:200}),[r,a,c,l,u]),{data:i,isLoading:x,isFetching:M,refetch:g}=er(d),N=i?.memos??[],v=tr(),[C,P]=s.useState(null);function b(p){const _=new URLSearchParams(t);for(const[y,j]of Object.entries(p))j==null||j===""?_.delete(y):_.set(y,j);n(_,{replace:!0})}async function I(){if(C!=null)try{await v.mutateAsync(C),Se.success(e("toast.deleted"))}catch(p){const{message:_}=an(p,e);throw Se.error(_),p}}const O=s.useMemo(()=>[{id:"id",header:e("col.id"),cell:p=>o.jsxs("span",{className:"tabular-nums text-text-dim",children:["#",p.id]}),headClassName:"w-16"},{id:"what",header:e("col.what"),cell:p=>o.jsx("span",{className:"line-clamp-2",children:p.memo?o.jsx("span",{className:"text-text",children:p.memo}):o.jsx("span",{className:"font-medium text-text",children:p.what})}),asCardTitle:!0},{id:"who",header:e("col.who"),cell:p=>p.who?o.jsx(on,{variant:"secondary",children:p.who}):o.jsx("span",{className:"text-text-muted",children:"—"}),headClassName:"w-32"},{id:"when",header:e("col.when"),cell:p=>o.jsx("span",{className:"text-text-dim",children:p.whenText||(p.whenAt?De(p.whenAt):"—")}),headClassName:"w-36"},{id:"where",header:e("col.where"),cell:p=>p.where_label||p.where_lat!=null&&p.where_lng!=null?o.jsx(rr,{memo:p}):o.jsx("span",{className:"text-text-muted",children:"—"}),headClassName:"w-44"},{id:"platform",header:e("col.platform"),cell:p=>o.jsx("span",{className:"text-text-dim",children:p.platform}),headClassName:"w-24",hideOnMobile:!0},{id:"createdAt",header:e("col.createdAt"),cell:p=>o.jsx("span",{className:"text-text-dim",children:De(p.createdAt)}),headClassName:"w-36",hideOnMobile:!0},{id:"actions",header:"",cell:p=>o.jsx("div",{className:"flex justify-end",children:o.jsxs(Ie,{variant:"ghost",size:"sm",onClick:_=>{_.stopPropagation(),P(p.id)},disabled:v.isPending,"aria-label":e("action.delete"),children:[o.jsx(pn,{className:"h-3 w-3"}),o.jsx("span",{className:"sr-only sm:not-sr-only sm:ml-1",children:e("action.delete")})]})}),headClassName:"w-24"}],[e,v.isPending]);return o.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[o.jsx(rn,{}),o.jsxs("main",{className:"mx-auto flex w-full max-w-7xl flex-1 flex-col gap-4 px-3 py-4 sm:px-4 pb-safe",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx("h1",{className:"text-xl font-semibold",children:e("pageTitle")}),o.jsxs(Ie,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>g(),disabled:M,"aria-label":e("actions.refresh",{ns:"common"}),children:[o.jsx(fn,{className:`h-4 w-4 ${M?"animate-spin":""}`}),o.jsx("span",{className:"hidden sm:inline",children:e("actions.refresh",{ns:"common"})})]})]}),o.jsx("p",{className:"text-sm text-text-dim",children:e("subtitle")})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[o.jsxs("div",{className:"relative flex-1 max-w-md",children:[o.jsx(mn,{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-text-muted"}),o.jsx(ue,{value:f,onChange:p=>m(p.target.value),placeholder:e("search.placeholder"),className:"pl-7"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:items-end",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Ee,{htmlFor:"who-filter",className:"text-xs text-text-dim",children:e("search.who")}),o.jsx(ue,{id:"who-filter",value:a,onChange:p=>b({who:p.target.value||null}),className:"w-36"})]}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Ee,{htmlFor:"what-filter",className:"text-xs text-text-dim",children:e("search.what")}),o.jsx(ue,{id:"what-filter",value:c,onChange:p=>b({what:p.target.value||null}),className:"w-36"})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("label",{className:"inline-flex items-center gap-1 text-sm text-text-dim",children:[o.jsx("input",{type:"checkbox",checked:l,onChange:p=>b({has_location:p.target.checked?"1":null}),className:"h-4 w-4 accent-accent"}),e("search.hasLocation")]}),o.jsxs("label",{className:"inline-flex items-center gap-1 text-sm text-text-dim",children:[o.jsx("input",{type:"checkbox",checked:u,onChange:p=>b({include_expired:p.target.checked?"1":null}),className:"h-4 w-4 accent-accent"}),e("search.includeExpired")]})]})]}),o.jsx(sn,{columns:O,rows:N,getRowId:p=>String(p.id),loading:x,emptyState:o.jsx(cn,{icon:o.jsx(wn,{}),title:e("empty.title"),description:e("empty.description")})}),o.jsx(ln,{open:C!=null,onOpenChange:p=>{p||P(null)},title:e("action.confirmDelete"),description:e("action.confirmDeleteDesc"),intent:"danger",confirmLabel:e("action.delete"),onConfirm:I})]})]})}const or={baidu:"openMap.baidu",apple:"openMap.apple",google:"openMap.google",osm:"openMap.osm"};function rr({memo:e}){const{t}=Le("memos"),n=e.where_label||`${e.where_lat}, ${e.where_lng}`,r=Object.entries(e.mapUrls??{});return r.length===0?o.jsx("span",{className:"text-text-dim",children:n}):o.jsxs(zo,{children:[o.jsx(Ho,{asChild:!0,children:o.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-sm text-text-dim hover:text-accent",onClick:a=>a.stopPropagation(),children:[o.jsx(hn,{className:"h-3 w-3"}),o.jsx("span",{className:"line-clamp-1 underline-offset-2 hover:underline",children:n})]})}),o.jsx(Lt,{children:r.map(([a,c])=>o.jsx(Gt,{asChild:!0,children:o.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:t(or[a]??"openMap.label",{defaultValue:a})})},a))})]})}function De(e){try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}export{br as default};
12
- //# sourceMappingURL=memos-CfneX9DH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memos-CfneX9DH.js","sources":["../../node_modules/lucide-react/dist/esm/icons/circle.js","../../node_modules/lucide-react/dist/esm/icons/notebook-text.js","../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs","../../node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.mjs","../../node_modules/@radix-ui/react-menu/dist/index.mjs","../../node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs","../../src/components/ui/dropdown-menu.tsx","../../src/hooks/use-memos.ts","../../src/routes/memos.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.469.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Circle = createLucideIcon(\"Circle\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n]);\n\nexport { Circle as default };\n//# sourceMappingURL=circle.js.map\n","/**\n * @license lucide-react v0.469.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst NotebookText = createLucideIcon(\"NotebookText\", [\n [\"path\", { d: \"M2 6h4\", key: \"aawbzj\" }],\n [\"path\", { d: \"M2 10h4\", key: \"l0bgd4\" }],\n [\"path\", { d: \"M2 14h4\", key: \"1gsvsf\" }],\n [\"path\", { d: \"M2 18h4\", key: \"1bu2t1\" }],\n [\"rect\", { width: \"16\", height: \"20\", x: \"4\", y: \"2\", rx: \"2\", key: \"1nb95v\" }],\n [\"path\", { d: \"M9.5 8h5\", key: \"11mslq\" }],\n [\"path\", { d: \"M9.5 12H16\", key: \"ktog6x\" }],\n [\"path\", { d: \"M9.5 16H14\", key: \"p1seyn\" }]\n]);\n\nexport { NotebookText as default };\n//# sourceMappingURL=notebook-text.js.map\n","\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs, composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SELECTION_KEYS = [\"Enter\", \" \"];\nvar FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nvar LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nvar FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nvar SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nvar SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nvar MENU_NAME = \"Menu\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);\nvar [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope\n]);\nvar usePopperScope = createPopperScope();\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\nvar [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\nvar Menu = (props) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, { capture: true, once: true });\n document.addEventListener(\"pointermove\", handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope: __scopeMenu,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children\n }\n )\n }\n ) });\n};\nMenu.displayName = MENU_NAME;\nvar ANCHOR_NAME = \"MenuAnchor\";\nvar MenuAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nMenuAnchor.displayName = ANCHOR_NAME;\nvar PORTAL_NAME = \"MenuPortal\";\nvar [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar MenuPortal = (props) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"MenuContent\";\nvar [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);\nvar MenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });\n }\n);\nvar MenuRootContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: true,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n }\n);\nvar MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n});\nvar Slot = createSlot(\"MenuContent.ScrollLock\");\nvar MenuContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n useFocusGuards();\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope: __scopeMenu,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n }),\n preventScrollOnEntryFocus: true,\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-radix-menu-content\": \"\",\n dir: rootContext.dir,\n ...popperScope,\n ...contentProps,\n ref: composedRefs,\n style: { outline: \"none\", ...contentProps.style },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-radix-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n }),\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n )\n }\n )\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"MenuGroup\";\nvar MenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", ...groupProps, ref: forwardedRef });\n }\n);\nMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"MenuLabel\";\nvar MenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });\n }\n);\nMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"MenuItem\";\nvar ITEM_SELECT = \"menu.itemSelect\";\nvar MenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n ref: composedRefs,\n disabled,\n onClick: composeEventHandlers(props.onClick, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n event.preventDefault();\n }\n })\n }\n );\n }\n);\nMenuItem.displayName = ITEM_NAME;\nvar MenuItemImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeMenu,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event))\n ),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n ) })\n }\n );\n }\n);\nvar CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\nvar MenuCheckboxItem = React.forwardRef(\n (props, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemcheckbox\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"MenuRadioGroup\";\nvar [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: void 0, onValueChange: () => {\n } }\n);\nvar MenuRadioGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });\n }\n);\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"MenuRadioItem\";\nvar MenuRadioItem = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemradio\",\n \"aria-checked\": checked,\n ...radioItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\nvar [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false }\n);\nvar MenuItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(\n Presence,\n {\n present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n )\n }\n );\n }\n);\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SEPARATOR_NAME = \"MenuSeparator\";\nvar MenuSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n ...separatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"MenuArrow\";\nvar MenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nMenuArrow.displayName = ARROW_NAME;\nvar SUB_NAME = \"MenuSub\";\nvar [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\nvar MenuSub = (props) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope: __scopeMenu,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n ) });\n};\nMenuSub.displayName = SUB_NAME;\nvar SUB_TRIGGER_NAME = \"MenuSubTrigger\";\nvar MenuSubTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onClick: (event) => {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const side = context.content?.dataset.side;\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n });\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n })\n ),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n context.content?.focus();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"MenuSubContent\";\nvar MenuSubContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n align: \"start\",\n side: rootContext.dir === \"rtl\" ? \"left\" : \"right\",\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n },\n onCloseAutoFocus: (event) => event.preventDefault(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n event.preventDefault();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(event.target);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus();\n event.preventDefault();\n }\n })\n }\n ) }) }) });\n }\n);\nMenuSubContent.displayName = SUB_CONTENT_NAME;\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i];\n const jj = polygon[j];\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nvar Root3 = Menu;\nvar Anchor2 = MenuAnchor;\nvar Portal = MenuPortal;\nvar Content2 = MenuContent;\nvar Group = MenuGroup;\nvar Label = MenuLabel;\nvar Item2 = MenuItem;\nvar CheckboxItem = MenuCheckboxItem;\nvar RadioGroup = MenuRadioGroup;\nvar RadioItem = MenuRadioItem;\nvar ItemIndicator = MenuItemIndicator;\nvar Separator = MenuSeparator;\nvar Arrow2 = MenuArrow;\nvar Sub = MenuSub;\nvar SubTrigger = MenuSubTrigger;\nvar SubContent = MenuSubContent;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n CheckboxItem,\n Content2 as Content,\n Group,\n Item2 as Item,\n ItemIndicator,\n Label,\n Menu,\n MenuAnchor,\n MenuArrow,\n MenuCheckboxItem,\n MenuContent,\n MenuGroup,\n MenuItem,\n MenuItemIndicator,\n MenuLabel,\n MenuPortal,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuSub,\n MenuSubContent,\n MenuSubTrigger,\n Portal,\n RadioGroup,\n RadioItem,\n Root3 as Root,\n Separator,\n Sub,\n SubContent,\n SubTrigger,\n createMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/dropdown-menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as MenuPrimitive from \"@radix-ui/react-menu\";\nimport { createMenuScope } from \"@radix-ui/react-menu\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DROPDOWN_MENU_NAME = \"DropdownMenu\";\nvar [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nvar useMenuScope = createMenuScope();\nvar [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);\nvar DropdownMenu = (props) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DROPDOWN_MENU_NAME\n });\n return /* @__PURE__ */ jsx(\n DropdownMenuProvider,\n {\n scope: __scopeDropdownMenu,\n triggerId: useId(),\n triggerRef,\n contentId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })\n }\n );\n};\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\nvar TRIGGER_NAME = \"DropdownMenuTrigger\";\nvar DropdownMenuTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n id: context.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"data-state\": context.open ? \"open\" : \"closed\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n ...triggerProps,\n ref: composeRefs(forwardedRef, context.triggerRef),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n if (!context.open) event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if ([\"Enter\", \" \"].includes(event.key)) context.onOpenToggle();\n if (event.key === \"ArrowDown\") context.onOpenChange(true);\n if ([\"Enter\", \" \", \"ArrowDown\"].includes(event.key)) event.preventDefault();\n })\n }\n ) });\n }\n);\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DropdownMenuPortal\";\nvar DropdownMenuPortal = (props) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps });\n};\nDropdownMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"DropdownMenuContent\";\nvar DropdownMenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.Content,\n {\n id: context.contentId,\n \"aria-labelledby\": context.triggerId,\n ...menuScope,\n ...contentProps,\n ref: forwardedRef,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n event.preventDefault();\n }),\n onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n }),\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n }\n);\nDropdownMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"DropdownMenuGroup\";\nvar DropdownMenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });\n }\n);\nDropdownMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"DropdownMenuLabel\";\nvar DropdownMenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });\n }\n);\nDropdownMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"DropdownMenuItem\";\nvar DropdownMenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });\n }\n);\nDropdownMenuItem.displayName = ITEM_NAME;\nvar CHECKBOX_ITEM_NAME = \"DropdownMenuCheckboxItem\";\nvar DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });\n});\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"DropdownMenuRadioGroup\";\nvar DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });\n});\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"DropdownMenuRadioItem\";\nvar DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });\n});\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar INDICATOR_NAME = \"DropdownMenuItemIndicator\";\nvar DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });\n});\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\nvar SEPARATOR_NAME = \"DropdownMenuSeparator\";\nvar DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });\n});\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"DropdownMenuArrow\";\nvar DropdownMenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });\n }\n);\nDropdownMenuArrow.displayName = ARROW_NAME;\nvar DropdownMenuSub = (props) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: \"DropdownMenuSub\"\n });\n return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });\n};\nvar SUB_TRIGGER_NAME = \"DropdownMenuSubTrigger\";\nvar DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });\n});\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"DropdownMenuSubContent\";\nvar DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.SubContent,\n {\n ...menuScope,\n ...subContentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\nvar Root2 = DropdownMenu;\nvar Trigger = DropdownMenuTrigger;\nvar Portal2 = DropdownMenuPortal;\nvar Content2 = DropdownMenuContent;\nvar Group2 = DropdownMenuGroup;\nvar Label2 = DropdownMenuLabel;\nvar Item2 = DropdownMenuItem;\nvar CheckboxItem2 = DropdownMenuCheckboxItem;\nvar RadioGroup2 = DropdownMenuRadioGroup;\nvar RadioItem2 = DropdownMenuRadioItem;\nvar ItemIndicator2 = DropdownMenuItemIndicator;\nvar Separator2 = DropdownMenuSeparator;\nvar Arrow2 = DropdownMenuArrow;\nvar Sub2 = DropdownMenuSub;\nvar SubTrigger2 = DropdownMenuSubTrigger;\nvar SubContent2 = DropdownMenuSubContent;\nexport {\n Arrow2 as Arrow,\n CheckboxItem2 as CheckboxItem,\n Content2 as Content,\n DropdownMenu,\n DropdownMenuArrow,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuItemIndicator,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n Group2 as Group,\n Item2 as Item,\n ItemIndicator2 as ItemIndicator,\n Label2 as Label,\n Portal2 as Portal,\n RadioGroup2 as RadioGroup,\n RadioItem2 as RadioItem,\n Root2 as Root,\n Separator2 as Separator,\n Sub2 as Sub,\n SubContent2 as SubContent,\n SubTrigger2 as SubTrigger,\n Trigger,\n createDropdownMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n","/**\n * DropdownMenu — Radix-backed menu for row actions, agent picker, etc.\n * The check / radio item variants ship below; we don't import every\n * Radix sub-primitive eagerly to keep the bundle small if a page\n * doesn't need them.\n */\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-react'\nimport { cn } from '@/lib/utils'\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded px-2 py-1.5 text-sm outline-none',\n 'focus:bg-surface-hover data-[state=open]:bg-surface-hover',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded px-2 py-1.5 text-sm outline-none',\n 'focus:bg-surface-hover focus:text-text',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none',\n 'focus:bg-surface-hover',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none',\n 'focus:bg-surface-hover',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): JSX.Element => (\n <span\n className={cn('ml-auto text-xs tracking-widest text-text-muted', className)}\n {...props}\n />\n)\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n","/**\n * useMemos — react-query wrappers for memos search + delete.\n *\n * useMemos(query) — search/list\n * useDeleteMemo() — DELETE /api/memos/:id\n *\n * No SSE channel for memos (they're operator-created from chat, not\n * from autonomous agent activity), and no background poll: the page\n * shows search results which are inherently user-triggered.\n * Mutation onSuccess invalidates so a delete removes the row\n * immediately without a manual refresh.\n */\n\nimport { useQueryClient, useQuery, useMutation } from '@tanstack/react-query'\nimport { api } from '@/lib/api/endpoints'\nimport type {\n DeleteMemoResponse,\n ListMemosQuery,\n ListMemosResponse,\n} from '@/types/api'\n\nexport const memosKeys = {\n all: ['memos'] as const,\n list: (q: ListMemosQuery) => ['memos', 'list', q] as const,\n}\n\nexport function useMemos(query: ListMemosQuery) {\n return useQuery<ListMemosResponse>({\n queryKey: memosKeys.list(query),\n queryFn: () => api.listMemos(query),\n })\n}\n\nexport function useInvalidateMemos() {\n const qc = useQueryClient()\n return () => qc.invalidateQueries({ queryKey: memosKeys.all })\n}\n\nexport function useDeleteMemo() {\n const qc = useQueryClient()\n return useMutation<DeleteMemoResponse, Error, number>({\n mutationFn: (id) => api.deleteMemo(id),\n onSuccess: () => qc.invalidateQueries({ queryKey: memosKeys.all }),\n })\n}\n","/**\n * /memos — searchable memo list. Free-form text + who/what filters +\n * has-location toggle. Delete is the one mutation.\n *\n * Memos with location surface a small \"Open map\" dropdown that\n * routes to the provider URLs the backend prepared in `mapUrls`\n * (Baidu / Apple / Google / OSM).\n *\n * Searches are user-triggered (input + debounce) rather than poll-\n * driven — the query is read straight from URL params so deep-link\n * sharing works (\"memos about taxes between Jan and April\").\n *\n * Debounce: 300ms between the last keystroke and URL/query commit\n * — keeps the backend's FTS5 from running on every keypress.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport { useSearchParams } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { toast } from 'sonner'\nimport { MapPin, NotebookText, RefreshCcw, Search, Trash2 } from 'lucide-react'\n\nimport { Topbar } from '@/components/shell/topbar'\nimport { DataTable, type DataTableColumn } from '@/components/common/data-table'\nimport { EmptyState } from '@/components/common/empty-state'\nimport { ConfirmDialog } from '@/components/common/confirm-dialog'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Input } from '@/components/ui/input'\nimport { Label } from '@/components/ui/label'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu'\nimport { useMemos, useDeleteMemo } from '@/hooks/use-memos'\nimport { describeError } from '@/lib/api/errors'\nimport type { Memo, ListMemosQuery } from '@/types/api'\n\nconst SEARCH_DEBOUNCE_MS = 300\n\nexport default function MemosRoute(): JSX.Element {\n const { t } = useTranslation(['memos', 'common'])\n const [params, setParams] = useSearchParams()\n\n // URL-driven filter state (read once per render).\n const q = params.get('q') ?? ''\n const who = params.get('who') ?? ''\n const what = params.get('what') ?? ''\n const hasLoc = params.get('has_location') === '1'\n const incExpired = params.get('include_expired') === '1'\n\n // Local-only echo of the text input. Effects below sync the URL\n // after the debounce so each keypress doesn't kick a fetch.\n const [qDraft, setQDraft] = useState(q)\n\n useEffect(() => {\n if (qDraft === q) return\n const timer = window.setTimeout(() => {\n patchParams({ q: qDraft || null })\n }, SEARCH_DEBOUNCE_MS)\n return () => window.clearTimeout(timer)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [qDraft])\n\n const query: ListMemosQuery = useMemo(\n () => ({\n ...(q ? { query: q } : {}),\n ...(who ? { who } : {}),\n ...(what ? { what } : {}),\n ...(hasLoc ? { has_location: true } : {}),\n ...(incExpired ? { include_expired: true } : {}),\n limit: 200,\n }),\n [q, who, what, hasLoc, incExpired],\n )\n\n const { data, isLoading, isFetching, refetch } = useMemos(query)\n const memos = data?.memos ?? []\n\n const del = useDeleteMemo()\n const [confirmDeleteId, setConfirmDeleteId] = useState<number | null>(null)\n\n function patchParams(patch: Record<string, string | null>): void {\n const next = new URLSearchParams(params)\n for (const [k, v] of Object.entries(patch)) {\n if (v == null || v === '') next.delete(k)\n else next.set(k, v)\n }\n setParams(next, { replace: true })\n }\n\n async function onConfirmDelete(): Promise<void> {\n if (confirmDeleteId == null) return\n try {\n await del.mutateAsync(confirmDeleteId)\n toast.success(t('toast.deleted'))\n } catch (err) {\n const { message } = describeError(err, t)\n toast.error(message)\n throw err\n }\n }\n\n const columns: DataTableColumn<Memo>[] = useMemo(\n () => [\n {\n id: 'id',\n header: t('col.id'),\n cell: (r) => <span className=\"tabular-nums text-text-dim\">#{r.id}</span>,\n headClassName: 'w-16',\n },\n {\n id: 'what',\n header: t('col.what'),\n cell: (r) => (\n <span className=\"line-clamp-2\">\n {r.memo ? <span className=\"text-text\">{r.memo}</span> : <span className=\"font-medium text-text\">{r.what}</span>}\n </span>\n ),\n asCardTitle: true,\n },\n {\n id: 'who',\n header: t('col.who'),\n cell: (r) =>\n r.who ? (\n <Badge variant=\"secondary\">{r.who}</Badge>\n ) : (\n <span className=\"text-text-muted\">—</span>\n ),\n headClassName: 'w-32',\n },\n {\n id: 'when',\n header: t('col.when'),\n cell: (r) => (\n <span className=\"text-text-dim\">\n {r.whenText || (r.whenAt ? formatTime(r.whenAt) : '—')}\n </span>\n ),\n headClassName: 'w-36',\n },\n {\n id: 'where',\n header: t('col.where'),\n cell: (r) =>\n r.where_label || (r.where_lat != null && r.where_lng != null) ? (\n <MapCell memo={r} />\n ) : (\n <span className=\"text-text-muted\">—</span>\n ),\n headClassName: 'w-44',\n },\n {\n id: 'platform',\n header: t('col.platform'),\n cell: (r) => <span className=\"text-text-dim\">{r.platform}</span>,\n headClassName: 'w-24',\n hideOnMobile: true,\n },\n {\n id: 'createdAt',\n header: t('col.createdAt'),\n cell: (r) => <span className=\"text-text-dim\">{formatTime(r.createdAt)}</span>,\n headClassName: 'w-36',\n hideOnMobile: true,\n },\n {\n id: 'actions',\n header: '',\n cell: (r) => (\n <div className=\"flex justify-end\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(e) => {\n e.stopPropagation()\n setConfirmDeleteId(r.id)\n }}\n disabled={del.isPending}\n aria-label={t('action.delete')}\n >\n <Trash2 className=\"h-3 w-3\" />\n <span className=\"sr-only sm:not-sr-only sm:ml-1\">{t('action.delete')}</span>\n </Button>\n </div>\n ),\n headClassName: 'w-24',\n },\n ],\n [t, del.isPending],\n )\n\n return (\n <div className=\"flex min-h-dvh flex-col bg-bg\">\n <Topbar />\n\n <main className=\"mx-auto flex w-full max-w-7xl flex-1 flex-col gap-4 px-3 py-4 sm:px-4 pb-safe\">\n <header className=\"flex flex-col gap-1\">\n <div className=\"flex flex-wrap items-center gap-3\">\n <h1 className=\"text-xl font-semibold\">{t('pageTitle')}</h1>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"ml-auto\"\n onClick={() => refetch()}\n disabled={isFetching}\n aria-label={t('actions.refresh', { ns: 'common' })}\n >\n <RefreshCcw className={`h-4 w-4 ${isFetching ? 'animate-spin' : ''}`} />\n <span className=\"hidden sm:inline\">{t('actions.refresh', { ns: 'common' })}</span>\n </Button>\n </div>\n <p className=\"text-sm text-text-dim\">{t('subtitle')}</p>\n </header>\n\n {/* Search bar */}\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-end\">\n <div className=\"relative flex-1 max-w-md\">\n <Search className=\"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-text-muted\" />\n <Input\n value={qDraft}\n onChange={(e) => setQDraft(e.target.value)}\n placeholder={t('search.placeholder')}\n className=\"pl-7\"\n />\n </div>\n <div className=\"grid grid-cols-2 gap-2 sm:flex sm:items-end\">\n <div className=\"flex flex-col gap-1\">\n <Label htmlFor=\"who-filter\" className=\"text-xs text-text-dim\">\n {t('search.who')}\n </Label>\n <Input\n id=\"who-filter\"\n value={who}\n onChange={(e) => patchParams({ who: e.target.value || null })}\n className=\"w-36\"\n />\n </div>\n <div className=\"flex flex-col gap-1\">\n <Label htmlFor=\"what-filter\" className=\"text-xs text-text-dim\">\n {t('search.what')}\n </Label>\n <Input\n id=\"what-filter\"\n value={what}\n onChange={(e) => patchParams({ what: e.target.value || null })}\n className=\"w-36\"\n />\n </div>\n </div>\n <div className=\"flex items-center gap-3\">\n <label className=\"inline-flex items-center gap-1 text-sm text-text-dim\">\n <input\n type=\"checkbox\"\n checked={hasLoc}\n onChange={(e) => patchParams({ has_location: e.target.checked ? '1' : null })}\n className=\"h-4 w-4 accent-accent\"\n />\n {t('search.hasLocation')}\n </label>\n <label className=\"inline-flex items-center gap-1 text-sm text-text-dim\">\n <input\n type=\"checkbox\"\n checked={incExpired}\n onChange={(e) => patchParams({ include_expired: e.target.checked ? '1' : null })}\n className=\"h-4 w-4 accent-accent\"\n />\n {t('search.includeExpired')}\n </label>\n </div>\n </div>\n\n <DataTable\n columns={columns}\n rows={memos}\n getRowId={(r) => String(r.id)}\n loading={isLoading}\n emptyState={\n <EmptyState\n icon={<NotebookText />}\n title={t('empty.title')}\n description={t('empty.description')}\n />\n }\n />\n\n <ConfirmDialog\n open={confirmDeleteId != null}\n onOpenChange={(open) => {\n if (!open) setConfirmDeleteId(null)\n }}\n title={t('action.confirmDelete')}\n description={t('action.confirmDeleteDesc')}\n intent=\"danger\"\n confirmLabel={t('action.delete')}\n onConfirm={onConfirmDelete}\n />\n </main>\n </div>\n )\n}\n\ninterface MapCellProps {\n memo: Memo\n}\n\nconst PROVIDER_LABEL_KEY: Record<string, string> = {\n baidu: 'openMap.baidu',\n apple: 'openMap.apple',\n google: 'openMap.google',\n osm: 'openMap.osm',\n}\n\nfunction MapCell({ memo }: MapCellProps): JSX.Element {\n const { t } = useTranslation('memos')\n const label = memo.where_label || `${memo.where_lat}, ${memo.where_lng}`\n const entries = Object.entries(memo.mapUrls ?? {})\n if (entries.length === 0) {\n return <span className=\"text-text-dim\">{label}</span>\n }\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 text-sm text-text-dim hover:text-accent\"\n onClick={(e) => e.stopPropagation()}\n >\n <MapPin className=\"h-3 w-3\" />\n <span className=\"line-clamp-1 underline-offset-2 hover:underline\">{label}</span>\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n {entries.map(([provider, url]) => (\n <DropdownMenuItem key={provider} asChild>\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {t(PROVIDER_LABEL_KEY[provider] ?? 'openMap.label', { defaultValue: provider })}\n </a>\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n\nfunction formatTime(iso: string): string {\n try {\n const d = new Date(iso)\n if (Number.isNaN(d.getTime())) return iso\n return d.toLocaleString(undefined, { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' })\n } catch {\n return iso\n }\n}\n"],"names":["Circle","createLucideIcon","NotebookText","ENTRY_FOCUS","EVENT_OPTIONS","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React.forwardRef","props","forwardedRef","jsx","RovingFocusGroupImpl","__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","ref","React.useRef","composedRefs","useComposedRefs","direction","useDirection","currentTabStopId","setCurrentTabStopId","useControllableState","isTabbingBackOut","setIsTabbingBackOut","React.useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","React.useEffect","node","React.useCallback","tabStopId","prevCount","Primitive","composeEventHandlers","event","isKeyboardFocus","entryFocusEvent","items","item","activeItem","currentItem","candidateNodes","focusFirst","ITEM_NAME","RovingFocusGroupItem","focusable","active","children","itemProps","autoId","useId","id","context","isCurrentTabStop","onFocusableItemAdd","onFocusableItemRemove","focusIntent","getFocusIntent","currentIndex","wrapArray","MAP_KEY_TO_FOCUS_INTENT","getDirectionAwareKey","key","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","candidate","array","startIndex","_","index","Root","Item","createSlot","ownerName","SlotClone","createSlotClone","Slot2","slotProps","childrenArray","React.Children","slottable","isSlottable","newElement","newChildren","child","React.isValidElement","React.cloneElement","childrenRef","getElementRef","props2","mergeProps","React.Fragment","composeRefs","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","element","getter","mayWarn","SELECTION_KEYS","FIRST_KEYS","LAST_KEYS","FIRST_LAST_KEYS","SUB_OPEN_KEYS","SUB_CLOSE_KEYS","MENU_NAME","createMenuContext","createMenuScope","createPopperScope","usePopperScope","useRovingFocusGroupScope","MenuProvider","useMenuContext","MenuRootProvider","useMenuRootContext","Menu","__scopeMenu","open","onOpenChange","modal","popperScope","content","setContent","isUsingKeyboardRef","handleOpenChange","handleKeyDown","handlePointer","PopperPrimitive.Root","ANCHOR_NAME","MenuAnchor","anchorProps","PopperPrimitive.Anchor","PORTAL_NAME","PortalProvider","usePortalContext","MenuPortal","forceMount","container","Presence","PortalPrimitive","CONTENT_NAME","MenuContentProvider","useMenuContentContext","MenuContent","portalContext","contentProps","rootContext","MenuRootContentModal","MenuRootContentNonModal","hideOthers","MenuContentImpl","Slot","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll","rovingFocusGroupScope","currentItemId","setCurrentItemId","contentRef","timerRef","searchRef","pointerGraceTimerRef","pointerGraceIntentRef","pointerDirRef","lastPointerXRef","ScrollLockWrapper","RemoveScroll","scrollLockWrapperProps","handleTypeaheadSearch","search","currentMatch","values","nextMatch","getNextMatch","newItem","updateSearch","value","useFocusGuards","isPointerMovingToSubmenu","isPointerInGraceArea","intent","FocusScope","DismissableLayer","RovingFocusGroup.Root","PopperPrimitive.Content","getOpenState","isKeyDownInside","isModifierKey","isCharacterKey","whenMouse","target","pointerXHasChanged","newDir","MenuGroup","LABEL_NAME","MenuLabel","labelProps","ITEM_SELECT","MenuItem","disabled","onSelect","contentContext","isPointerDownRef","handleSelect","menuItem","itemSelectEvent","dispatchDiscreteCustomEvent","MenuItemImpl","isTypingAhead","textValue","isFocused","setIsFocused","textContent","setTextContent","RovingFocusGroup.Item","CHECKBOX_ITEM_NAME","MenuCheckboxItem","checked","onCheckedChange","checkboxItemProps","ItemIndicatorProvider","isIndeterminate","getCheckedState","RADIO_GROUP_NAME","RadioGroupProvider","useRadioGroupContext","MenuRadioGroup","onValueChange","handleValueChange","RADIO_ITEM_NAME","MenuRadioItem","radioItemProps","ITEM_INDICATOR_NAME","useItemIndicatorContext","MenuItemIndicator","itemIndicatorProps","indicatorContext","SEPARATOR_NAME","MenuSeparator","separatorProps","ARROW_NAME","MenuArrow","arrowProps","PopperPrimitive.Arrow","SUB_NAME","MenuSubProvider","useMenuSubContext","SUB_TRIGGER_NAME","MenuSubTrigger","subContext","openTimerRef","onPointerGraceIntentChange","scope","clearOpenTimer","pointerGraceTimer","contentRect","side","rightSide","bleed","contentNearEdge","contentFarEdge","SUB_CONTENT_NAME","MenuSubContent","subContentProps","isCloseKey","normalizedSearch","char","currentMatchIndex","wrappedValues","v","isPointInPolygon","point","polygon","x","y","inside","i","j","ii","jj","xi","yi","xj","yj","area","cursorPos","handler","Root3","Anchor2","Portal","Content2","Group","Label","Item2","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow2","SubTrigger","SubContent","DROPDOWN_MENU_NAME","createDropdownMenuContext","useMenuScope","DropdownMenuProvider","useDropdownMenuContext","DropdownMenu","__scopeDropdownMenu","openProp","defaultOpen","menuScope","triggerRef","setOpen","prevOpen","MenuPrimitive.Root","TRIGGER_NAME","DropdownMenuTrigger","triggerProps","MenuPrimitive.Anchor","DropdownMenuPortal","portalProps","MenuPrimitive.Portal","DropdownMenuContent","hasInteractedOutsideRef","MenuPrimitive.Content","originalEvent","ctrlLeftClick","isRightClick","DropdownMenuGroup","MenuPrimitive.Group","DropdownMenuLabel","MenuPrimitive.Label","DropdownMenuItem","MenuPrimitive.Item","DropdownMenuCheckboxItem","MenuPrimitive.CheckboxItem","DropdownMenuRadioGroup","radioGroupProps","MenuPrimitive.RadioGroup","DropdownMenuRadioItem","MenuPrimitive.RadioItem","INDICATOR_NAME","DropdownMenuItemIndicator","MenuPrimitive.ItemIndicator","DropdownMenuSeparator","MenuPrimitive.Separator","DropdownMenuArrow","MenuPrimitive.Arrow","DropdownMenuSubTrigger","subTriggerProps","MenuPrimitive.SubTrigger","DropdownMenuSubContent","MenuPrimitive.SubContent","Root2","Trigger","Portal2","Label2","CheckboxItem2","RadioItem2","ItemIndicator2","Separator2","SubTrigger2","SubContent2","DropdownMenuPrimitive.Root","DropdownMenuPrimitive.Trigger","className","inset","jsxs","DropdownMenuPrimitive.SubTrigger","cn","ChevronRight","DropdownMenuPrimitive.SubContent","sideOffset","DropdownMenuPrimitive.Portal","DropdownMenuPrimitive.Content","DropdownMenuPrimitive.Item","DropdownMenuPrimitive.CheckboxItem","DropdownMenuPrimitive.ItemIndicator","Check","DropdownMenuPrimitive.RadioItem","DropdownMenuPrimitive.Label","DropdownMenuPrimitive.Separator","memosKeys","q","useMemos","query","useQuery","api","useDeleteMemo","qc","useQueryClient","useMutation","SEARCH_DEBOUNCE_MS","MemosRoute","t","useTranslation","params","setParams","useSearchParams","who","what","hasLoc","incExpired","qDraft","setQDraft","useState","useEffect","timer","patchParams","useMemo","data","isLoading","isFetching","refetch","memos","del","confirmDeleteId","setConfirmDeleteId","patch","next","k","onConfirmDelete","toast","err","message","describeError","columns","r","Badge","formatTime","MapCell","Button","e","Trash2","Topbar","RefreshCcw","Search","Input","DataTable","EmptyState","ConfirmDialog","PROVIDER_LABEL_KEY","memo","label","entries","MapPin","provider","url","iso","d"],"mappings":"m6BAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,GAASC,GAAiB,SAAU,CACxC,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,KAAM,IAAK,QAAQ,CAAE,CAC3D,CAAC,ECXD;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMC,GAAeD,GAAiB,eAAgB,CACpD,CAAC,OAAQ,CAAE,EAAG,SAAU,IAAK,QAAQ,CAAE,EACvC,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,OAAQ,CAAE,MAAO,KAAM,OAAQ,KAAM,EAAG,IAAK,EAAG,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC9E,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAQ,CAAE,EACzC,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,QAAQ,CAAE,EAC3C,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,QAAQ,CAAE,CAC7C,CAAC,ECJD,IAAIE,GAAc,gCACdC,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