agim-cli 1.2.152 → 1.2.153

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 (188) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/web/public/assets/{a2a-DZL1sgVk.js → a2a-CIxNaIdE.js} +2 -2
  3. package/dist/web/public/assets/{a2a-DZL1sgVk.js.map → a2a-CIxNaIdE.js.map} +1 -1
  4. package/dist/web/public/assets/{activity-BsCuSHQd.js → activity-CrnWHC2j.js} +2 -2
  5. package/dist/web/public/assets/{activity-BsCuSHQd.js.map → activity-CrnWHC2j.js.map} +1 -1
  6. package/dist/web/public/assets/{admins-CyG_mVaa.js → admins-5BTRCU9u.js} +2 -2
  7. package/dist/web/public/assets/{admins-CyG_mVaa.js.map → admins-5BTRCU9u.js.map} +1 -1
  8. package/dist/web/public/assets/{agents-D2wSzcVZ.js → agents-B-s9gngh.js} +2 -2
  9. package/dist/web/public/assets/{agents-D2wSzcVZ.js.map → agents-B-s9gngh.js.map} +1 -1
  10. package/dist/web/public/assets/{approvals-C3uNQTdL.js → approvals-BSX2lsqu.js} +2 -2
  11. package/dist/web/public/assets/{approvals-C3uNQTdL.js.map → approvals-BSX2lsqu.js.map} +1 -1
  12. package/dist/web/public/assets/{arrow-down-CppegASc.js → arrow-down-D3lWOftw.js} +2 -2
  13. package/dist/web/public/assets/{arrow-down-CppegASc.js.map → arrow-down-D3lWOftw.js.map} +1 -1
  14. package/dist/web/public/assets/{arrow-up-8NH41ZQX.js → arrow-up-BGsin7FN.js} +2 -2
  15. package/dist/web/public/assets/{arrow-up-8NH41ZQX.js.map → arrow-up-BGsin7FN.js.map} +1 -1
  16. package/dist/web/public/assets/{asks-DiT_eq2x.js → asks-DfLaW3gA.js} +2 -2
  17. package/dist/web/public/assets/{asks-DiT_eq2x.js.map → asks-DfLaW3gA.js.map} +1 -1
  18. package/dist/web/public/assets/{audit-0T4jT2G0.js → audit-BWlwMCTk.js} +2 -2
  19. package/dist/web/public/assets/{audit-0T4jT2G0.js.map → audit-BWlwMCTk.js.map} +1 -1
  20. package/dist/web/public/assets/{bell-BoZsoN58.js → bell-Bf-FDztO.js} +2 -2
  21. package/dist/web/public/assets/{bell-BoZsoN58.js.map → bell-Bf-FDztO.js.map} +1 -1
  22. package/dist/web/public/assets/{bgjobs-DbHdPyhE.js → bgjobs-6dDxfEi7.js} +2 -2
  23. package/dist/web/public/assets/{bgjobs-DbHdPyhE.js.map → bgjobs-6dDxfEi7.js.map} +1 -1
  24. package/dist/web/public/assets/{brain-D-zbPJ7o.js → brain-Dl0NIztX.js} +2 -2
  25. package/dist/web/public/assets/{brain-D-zbPJ7o.js.map → brain-Dl0NIztX.js.map} +1 -1
  26. package/dist/web/public/assets/{briefcase-D3jWpfeB.js → briefcase-Bl6rZAmJ.js} +2 -2
  27. package/dist/web/public/assets/{briefcase-D3jWpfeB.js.map → briefcase-Bl6rZAmJ.js.map} +1 -1
  28. package/dist/web/public/assets/{chat-DrYeCiFH.js → chat-Cu8-EeJt.js} +2 -2
  29. package/dist/web/public/assets/{chat-DrYeCiFH.js.map → chat-Cu8-EeJt.js.map} +1 -1
  30. package/dist/web/public/assets/{chevron-left-D6-MKmUs.js → chevron-left-BtG3MZQX.js} +2 -2
  31. package/dist/web/public/assets/{chevron-left-D6-MKmUs.js.map → chevron-left-BtG3MZQX.js.map} +1 -1
  32. package/dist/web/public/assets/{chevron-right-CHtA6f0-.js → chevron-right-FytmF5Sd.js} +2 -2
  33. package/dist/web/public/assets/{chevron-right-CHtA6f0-.js.map → chevron-right-FytmF5Sd.js.map} +1 -1
  34. package/dist/web/public/assets/{circle-check-B9adx56J.js → circle-check-DggvG9Xs.js} +2 -2
  35. package/dist/web/public/assets/{circle-check-B9adx56J.js.map → circle-check-DggvG9Xs.js.map} +1 -1
  36. package/dist/web/public/assets/{circle-check-big-E1qhYcsu.js → circle-check-big-J5lVPTDz.js} +2 -2
  37. package/dist/web/public/assets/{circle-check-big-E1qhYcsu.js.map → circle-check-big-J5lVPTDz.js.map} +1 -1
  38. package/dist/web/public/assets/{circle-x-xB2tQMGw.js → circle-x-pYYyY1z2.js} +2 -2
  39. package/dist/web/public/assets/{circle-x-xB2tQMGw.js.map → circle-x-pYYyY1z2.js.map} +1 -1
  40. package/dist/web/public/assets/{clock-DFU9E0F0.js → clock-CQy6p5uP.js} +2 -2
  41. package/dist/web/public/assets/{clock-DFU9E0F0.js.map → clock-CQy6p5uP.js.map} +1 -1
  42. package/dist/web/public/assets/{confirm-dialog-C1w1040N.js → confirm-dialog-B3jno5Pb.js} +2 -2
  43. package/dist/web/public/assets/{confirm-dialog-C1w1040N.js.map → confirm-dialog-B3jno5Pb.js.map} +1 -1
  44. package/dist/web/public/assets/{copy-UOTkO-2l.js → copy-BK_JexVU.js} +2 -2
  45. package/dist/web/public/assets/{copy-UOTkO-2l.js.map → copy-BK_JexVU.js.map} +1 -1
  46. package/dist/web/public/assets/{data-table-CBTDQyFx.js → data-table-C3oIPQ_B.js} +2 -2
  47. package/dist/web/public/assets/{data-table-CBTDQyFx.js.map → data-table-C3oIPQ_B.js.map} +1 -1
  48. package/dist/web/public/assets/dialog-nb4ANHd4.js +2 -0
  49. package/dist/web/public/assets/dialog-nb4ANHd4.js.map +1 -0
  50. package/dist/web/public/assets/{download-BzDp4OCu.js → download-DtvF6Ngb.js} +2 -2
  51. package/dist/web/public/assets/{download-BzDp4OCu.js.map → download-DtvF6Ngb.js.map} +1 -1
  52. package/dist/web/public/assets/{email-BDd0tUm1.js → email-6PldVxPe.js} +2 -2
  53. package/dist/web/public/assets/{email-BDd0tUm1.js.map → email-6PldVxPe.js.map} +1 -1
  54. package/dist/web/public/assets/{empty-state-CKPzKsI5.js → empty-state-esNZG4Xa.js} +2 -2
  55. package/dist/web/public/assets/{empty-state-CKPzKsI5.js.map → empty-state-esNZG4Xa.js.map} +1 -1
  56. package/dist/web/public/assets/{external-link-Cx0ulEkb.js → external-link-Bzl-4lM6.js} +2 -2
  57. package/dist/web/public/assets/{external-link-Cx0ulEkb.js.map → external-link-Bzl-4lM6.js.map} +1 -1
  58. package/dist/web/public/assets/{eye-D9PD2xVj.js → eye-Cpc4c8vR.js} +2 -2
  59. package/dist/web/public/assets/{eye-D9PD2xVj.js.map → eye-Cpc4c8vR.js.map} +1 -1
  60. package/dist/web/public/assets/{facts-CRpGEODt.js → facts-CAc-sdKE.js} +2 -2
  61. package/dist/web/public/assets/{facts-CRpGEODt.js.map → facts-CAc-sdKE.js.map} +1 -1
  62. package/dist/web/public/assets/{goals-pyF71sFT.js → goals-iarR52LZ.js} +2 -2
  63. package/dist/web/public/assets/{goals-pyF71sFT.js.map → goals-iarR52LZ.js.map} +1 -1
  64. package/dist/web/public/assets/{health-_YLm7LIW.js → health-DPiNRwJP.js} +2 -2
  65. package/dist/web/public/assets/{health-_YLm7LIW.js.map → health-DPiNRwJP.js.map} +1 -1
  66. package/dist/web/public/assets/{heart-pulse-DyxG9jqH.js → heart-pulse-DTcvh4ER.js} +2 -2
  67. package/dist/web/public/assets/{heart-pulse-DyxG9jqH.js.map → heart-pulse-DTcvh4ER.js.map} +1 -1
  68. package/dist/web/public/assets/{heartbeat-bZfXp6Vm.js → heartbeat-B8tcKFzJ.js} +2 -2
  69. package/dist/web/public/assets/{heartbeat-bZfXp6Vm.js.map → heartbeat-B8tcKFzJ.js.map} +1 -1
  70. package/dist/web/public/assets/{hot-CSwCgYXw.js → hot-CqLT7AGh.js} +2 -2
  71. package/dist/web/public/assets/{hot-CSwCgYXw.js.map → hot-CqLT7AGh.js.map} +1 -1
  72. package/dist/web/public/assets/{index-D5DvetP5.js → index-BjUyDXLb.js} +30 -30
  73. package/dist/web/public/assets/index-BjUyDXLb.js.map +1 -0
  74. package/dist/web/public/assets/{injection-CYjttllI.js → injection-U1ms-Jjs.js} +2 -2
  75. package/dist/web/public/assets/{injection-CYjttllI.js.map → injection-U1ms-Jjs.js.map} +1 -1
  76. package/dist/web/public/assets/{installed-C6eNPXLl.js → installed-8FN6LLKG.js} +2 -2
  77. package/dist/web/public/assets/{installed-C6eNPXLl.js.map → installed-8FN6LLKG.js.map} +1 -1
  78. package/dist/web/public/assets/{jobs-CKQvijeH.js → jobs-B-MU_dkD.js} +2 -2
  79. package/dist/web/public/assets/{jobs-CKQvijeH.js.map → jobs-B-MU_dkD.js.map} +1 -1
  80. package/dist/web/public/assets/{layout-2S0YMTH_.js → layout-BVI4tkRG.js} +2 -2
  81. package/dist/web/public/assets/{layout-2S0YMTH_.js.map → layout-BVI4tkRG.js.map} +1 -1
  82. package/dist/web/public/assets/{layout-C9vch6up.js → layout-BgmJrSOb.js} +2 -2
  83. package/dist/web/public/assets/{layout-C9vch6up.js.map → layout-BgmJrSOb.js.map} +1 -1
  84. package/dist/web/public/assets/{layout-BQGP-bci.js → layout-CnddsqFT.js} +2 -2
  85. package/dist/web/public/assets/{layout-BQGP-bci.js.map → layout-CnddsqFT.js.map} +1 -1
  86. package/dist/web/public/assets/{layout-Y4GA9SyV.js → layout-DMOpWAPw.js} +2 -2
  87. package/dist/web/public/assets/{layout-Y4GA9SyV.js.map → layout-DMOpWAPw.js.map} +1 -1
  88. package/dist/web/public/assets/{layout-C4RTH7Mc.js → layout-DfE74Z47.js} +2 -2
  89. package/dist/web/public/assets/{layout-C4RTH7Mc.js.map → layout-DfE74Z47.js.map} +1 -1
  90. package/dist/web/public/assets/{llm-CJvopUnt.js → llm-5HpT83y2.js} +2 -2
  91. package/dist/web/public/assets/{llm-CJvopUnt.js.map → llm-5HpT83y2.js.map} +1 -1
  92. package/dist/web/public/assets/{loader-circle-CgLbYd3g.js → loader-circle-MnTMknNl.js} +2 -2
  93. package/dist/web/public/assets/{loader-circle-CgLbYd3g.js.map → loader-circle-MnTMknNl.js.map} +1 -1
  94. package/dist/web/public/assets/{map-pin-CdHDC52F.js → map-pin-BA0GTiIe.js} +2 -2
  95. package/dist/web/public/assets/{map-pin-CdHDC52F.js.map → map-pin-BA0GTiIe.js.map} +1 -1
  96. package/dist/web/public/assets/{mcp-SI73JwZR.js → mcp-C71xI5JH.js} +2 -2
  97. package/dist/web/public/assets/{mcp-SI73JwZR.js.map → mcp-C71xI5JH.js.map} +1 -1
  98. package/dist/web/public/assets/memos-BAuv2jwD.js +12 -0
  99. package/dist/web/public/assets/memos-BAuv2jwD.js.map +1 -0
  100. package/dist/web/public/assets/{messengers-CUz9DXB5.js → messengers-CmW1ts2s.js} +2 -2
  101. package/dist/web/public/assets/{messengers-CUz9DXB5.js.map → messengers-CmW1ts2s.js.map} +1 -1
  102. package/dist/web/public/assets/{mobile-CrdzyGXr.js → mobile-DpxLpRIf.js} +2 -2
  103. package/dist/web/public/assets/{mobile-CrdzyGXr.js.map → mobile-DpxLpRIf.js.map} +1 -1
  104. package/dist/web/public/assets/{native-agent-g8BpqzAo.js → native-agent-CNUBixLm.js} +2 -2
  105. package/dist/web/public/assets/{native-agent-g8BpqzAo.js.map → native-agent-CNUBixLm.js.map} +1 -1
  106. package/dist/web/public/assets/{network-DcpeRx8a.js → network-DVRgX5Mm.js} +2 -2
  107. package/dist/web/public/assets/{network-DcpeRx8a.js.map → network-DVRgX5Mm.js.map} +1 -1
  108. package/dist/web/public/assets/{outbox-uR6crgVJ.js → outbox-C8Gc0aa0.js} +2 -2
  109. package/dist/web/public/assets/{outbox-uR6crgVJ.js.map → outbox-C8Gc0aa0.js.map} +1 -1
  110. package/dist/web/public/assets/{pagination-CxK3lTYb.js → pagination-BWgXaluu.js} +2 -2
  111. package/dist/web/public/assets/{pagination-CxK3lTYb.js.map → pagination-BWgXaluu.js.map} +1 -1
  112. package/dist/web/public/assets/{persona-B1k5tc4U.js → persona--zQXx4oA.js} +2 -2
  113. package/dist/web/public/assets/{persona-B1k5tc4U.js.map → persona--zQXx4oA.js.map} +1 -1
  114. package/dist/web/public/assets/{plans-BWQSahSt.js → plans-mluEj2nt.js} +2 -2
  115. package/dist/web/public/assets/{plans-BWQSahSt.js.map → plans-mluEj2nt.js.map} +1 -1
  116. package/dist/web/public/assets/{play-D2VxB3QN.js → play-BLIwYTvQ.js} +2 -2
  117. package/dist/web/public/assets/{play-D2VxB3QN.js.map → play-BLIwYTvQ.js.map} +1 -1
  118. package/dist/web/public/assets/{plus-_XZVk5F_.js → plus-BOfhZkjh.js} +2 -2
  119. package/dist/web/public/assets/{plus-_XZVk5F_.js.map → plus-BOfhZkjh.js.map} +1 -1
  120. package/dist/web/public/assets/{policy-D77IdVzS.js → policy-C8CPYuH5.js} +2 -2
  121. package/dist/web/public/assets/{policy-D77IdVzS.js.map → policy-C8CPYuH5.js.map} +1 -1
  122. package/dist/web/public/assets/{qr-code-glvcd_3g.js → qr-code-CfdRXZZD.js} +2 -2
  123. package/dist/web/public/assets/{qr-code-glvcd_3g.js.map → qr-code-CfdRXZZD.js.map} +1 -1
  124. package/dist/web/public/assets/{refresh-ccw-MfejQvU6.js → refresh-ccw--XT-lrCo.js} +2 -2
  125. package/dist/web/public/assets/{refresh-ccw-MfejQvU6.js.map → refresh-ccw--XT-lrCo.js.map} +1 -1
  126. package/dist/web/public/assets/{reminders-CtKa3ECr.js → reminders-DJkMBSTZ.js} +2 -2
  127. package/dist/web/public/assets/{reminders-CtKa3ECr.js.map → reminders-DJkMBSTZ.js.map} +1 -1
  128. package/dist/web/public/assets/{save-Cha8EnUJ.js → save-9sLkRauh.js} +2 -2
  129. package/dist/web/public/assets/{save-Cha8EnUJ.js.map → save-9sLkRauh.js.map} +1 -1
  130. package/dist/web/public/assets/{schedules-CuQgG6hz.js → schedules-BEqyQYLb.js} +2 -2
  131. package/dist/web/public/assets/{schedules-CuQgG6hz.js.map → schedules-BEqyQYLb.js.map} +1 -1
  132. package/dist/web/public/assets/{search-BpyL8Spy.js → search-D4CzBwIp.js} +2 -2
  133. package/dist/web/public/assets/{search-BpyL8Spy.js.map → search-D4CzBwIp.js.map} +1 -1
  134. package/dist/web/public/assets/{search-BJqFnKP5.js → search-aWQWrzh3.js} +2 -2
  135. package/dist/web/public/assets/{search-BJqFnKP5.js.map → search-aWQWrzh3.js.map} +1 -1
  136. package/dist/web/public/assets/{security-Cw_yJiDX.js → security-B7KXMgM3.js} +2 -2
  137. package/dist/web/public/assets/{security-Cw_yJiDX.js.map → security-B7KXMgM3.js.map} +1 -1
  138. package/dist/web/public/assets/{service-CgSHzzZ2.js → service-1ZeT0cRY.js} +2 -2
  139. package/dist/web/public/assets/{service-CgSHzzZ2.js.map → service-1ZeT0cRY.js.map} +1 -1
  140. package/dist/web/public/assets/{shield-alert-C_TX7BBD.js → shield-alert-BJKgUDEG.js} +2 -2
  141. package/dist/web/public/assets/{shield-alert-C_TX7BBD.js.map → shield-alert-BJKgUDEG.js.map} +1 -1
  142. package/dist/web/public/assets/{status-badge-CLMCkv6R.js → status-badge-DJgvgFQk.js} +2 -2
  143. package/dist/web/public/assets/{status-badge-CLMCkv6R.js.map → status-badge-DJgvgFQk.js.map} +1 -1
  144. package/dist/web/public/assets/{subtasks-BpXUesU9.js → subtasks-Cq0R4U6Z.js} +2 -2
  145. package/dist/web/public/assets/{subtasks-BpXUesU9.js.map → subtasks-Cq0R4U6Z.js.map} +1 -1
  146. package/dist/web/public/assets/{table-B-dheE8t.js → table-CVYTRwUs.js} +2 -2
  147. package/dist/web/public/assets/{table-B-dheE8t.js.map → table-CVYTRwUs.js.map} +1 -1
  148. package/dist/web/public/assets/{topn-CIXROr87.js → topn--vv790Oy.js} +2 -2
  149. package/dist/web/public/assets/{topn-CIXROr87.js.map → topn--vv790Oy.js.map} +1 -1
  150. package/dist/web/public/assets/{trash-2-CiJPCsGG.js → trash-2-CeN2btBl.js} +2 -2
  151. package/dist/web/public/assets/{trash-2-CiJPCsGG.js.map → trash-2-CeN2btBl.js.map} +1 -1
  152. package/dist/web/public/assets/{use-agim-skills-DDOG9Vno.js → use-agim-skills-D5JvyrxB.js} +2 -2
  153. package/dist/web/public/assets/{use-agim-skills-DDOG9Vno.js.map → use-agim-skills-D5JvyrxB.js.map} +1 -1
  154. package/dist/web/public/assets/{use-background-tasks-BT6BkFMM.js → use-background-tasks-C6zGANI5.js} +2 -2
  155. package/dist/web/public/assets/{use-background-tasks-BT6BkFMM.js.map → use-background-tasks-C6zGANI5.js.map} +1 -1
  156. package/dist/web/public/assets/{use-llm-admin-C5QwblGu.js → use-llm-admin-CdqRAs0I.js} +2 -2
  157. package/dist/web/public/assets/{use-llm-admin-C5QwblGu.js.map → use-llm-admin-CdqRAs0I.js.map} +1 -1
  158. package/dist/web/public/assets/{use-memory-BaQLelYY.js → use-memory-Bg-C6FxV.js} +2 -2
  159. package/dist/web/public/assets/{use-memory-BaQLelYY.js.map → use-memory-Bg-C6FxV.js.map} +1 -1
  160. package/dist/web/public/assets/{use-observability-DiJjq_81.js → use-observability-CiyMLYeG.js} +2 -2
  161. package/dist/web/public/assets/{use-observability-DiJjq_81.js.map → use-observability-CiyMLYeG.js.map} +1 -1
  162. package/dist/web/public/assets/{use-settings-CTuwZEdY.js → use-settings-S6mSC9nP.js} +2 -2
  163. package/dist/web/public/assets/{use-settings-CTuwZEdY.js.map → use-settings-S6mSC9nP.js.map} +1 -1
  164. package/dist/web/public/assets/{use-workspace-42B5n8Aa.js → use-workspace-DRkCOO8P.js} +2 -2
  165. package/dist/web/public/assets/{use-workspace-42B5n8Aa.js.map → use-workspace-DRkCOO8P.js.map} +1 -1
  166. package/dist/web/public/assets/{useQuery-BLyYPRRA.js → useQuery-CvEVNuvH.js} +2 -2
  167. package/dist/web/public/assets/{useQuery-BLyYPRRA.js.map → useQuery-CvEVNuvH.js.map} +1 -1
  168. package/dist/web/public/assets/{vector-BlyEjpL_.js → vector-BlXq3jJE.js} +2 -2
  169. package/dist/web/public/assets/{vector-BlyEjpL_.js.map → vector-BlXq3jJE.js.map} +1 -1
  170. package/dist/web/public/assets/{viewer-nKB1rvkV.js → viewer-Daxh0dV4.js} +2 -2
  171. package/dist/web/public/assets/{viewer-nKB1rvkV.js.map → viewer-Daxh0dV4.js.map} +1 -1
  172. package/dist/web/public/assets/{workspace-C5xO2uoT.js → workspace-BO51vrkT.js} +2 -2
  173. package/dist/web/public/assets/{workspace-C5xO2uoT.js.map → workspace-BO51vrkT.js.map} +1 -1
  174. package/dist/web/public/assets/{workspaces-BncBOneY.js → workspaces-Chonjr-v.js} +2 -2
  175. package/dist/web/public/assets/{workspaces-BncBOneY.js.map → workspaces-Chonjr-v.js.map} +1 -1
  176. package/dist/web/public/assets/{x-De6HR8Q5.js → x-Dv1gbRhw.js} +2 -2
  177. package/dist/web/public/assets/{x-De6HR8Q5.js.map → x-Dv1gbRhw.js.map} +1 -1
  178. package/dist/web/public/index.html +1 -1
  179. package/dist/web/server.d.ts +2 -0
  180. package/dist/web/server.d.ts.map +1 -1
  181. package/dist/web/server.js +11 -1
  182. package/dist/web/server.js.map +1 -1
  183. package/package.json +1 -1
  184. package/dist/web/public/assets/dialog-CqBNfrYQ.js +0 -6
  185. package/dist/web/public/assets/dialog-CqBNfrYQ.js.map +0 -1
  186. package/dist/web/public/assets/index-D5DvetP5.js.map +0 -1
  187. package/dist/web/public/assets/memos-B-5cdUp2.js +0 -12
  188. package/dist/web/public/assets/memos-B-5cdUp2.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import{n as De,s as he,t as Pe,v as pe,j as o,P as T,w,x as U,y as Te,z as Ae,A as xe,D as Ut,E as Bt,F as Oe,G as oe,H as Vt,J as Yt,K as zt,M as qt,Q as Ht,U as Xt,V as Wt,W as Qt,X as Zt,Y as Jt,Z as ke,c as A,q as en,a as tn,b as nn,d as Fe,u as Le,e as on,k as rn,B as Ne,T as an,I as le,L as Ie,l as Ee,m as sn}from"./index-BjUyDXLb.js";import{r as a}from"./react-DlP5eolq.js";import{D as cn}from"./data-table-C3oIPQ_B.js";import{E as un}from"./empty-state-esNZG4Xa.js";import{C as ln}from"./confirm-dialog-B3jno5Pb.js";import{C as dn}from"./chevron-right-FytmF5Sd.js";import{u as pn}from"./useQuery-CvEVNuvH.js";import{T as fn}from"./trash-2-CeN2btBl.js";import{R as mn}from"./refresh-ccw--XT-lrCo.js";import{S as hn}from"./search-aWQWrzh3.js";import{M as xn}from"./map-pin-BA0GTiIe.js";import"./table-CVYTRwUs.js";import"./arrow-up-BGsin7FN.js";import"./arrow-down-D3lWOftw.js";import"./dialog-nb4ANHd4.js";import"./x-Dv1gbRhw.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 wn=De("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 vn=De("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},W="RovingFocusGroup",[fe,Ge,Mn]=Pe(W),[Cn,Ke]=he(W,[Mn]),[bn,_n]=Cn(W),$e=a.forwardRef((e,n)=>o.jsx(fe.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(fe.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(yn,{...e,ref:n})})}));$e.displayName=W;var yn=a.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:s=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:h,preventScrollOnEntryFocus:f=!1,...i}=e,x=a.useRef(null),M=U(n,x),v=Te(c),[N,g]=Ae({prop:l,defaultProp:d??null,onChange:m,caller:W}),[C,P]=a.useState(!1),b=xe(h),I=Ge(t),O=a.useRef(!1),[u,y]=a.useState(0);return a.useEffect(()=>{const _=x.current;if(_)return _.addEventListener(de,b),()=>_.removeEventListener(de,b)},[b]),o.jsx(bn,{scope:t,orientation:r,dir:v,loop:s,currentTabStopId:N,onItemFocus:a.useCallback(_=>g(_),[g]),onItemShiftTab:a.useCallback(()=>P(!0),[]),onFocusableItemAdd:a.useCallback(()=>y(_=>_+1),[]),onFocusableItemRemove:a.useCallback(()=>y(_=>_-1),[]),children:o.jsx(T.div,{tabIndex:C||u===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,_=>{const j=!O.current;if(_.target===_.currentTarget&&j&&!C){const k=new CustomEvent(de,gn);if(_.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,f)}}O.current=!1}),onBlur:w(e.onBlur,()=>P(!1))})})}),Ue="RovingFocusGroupItem",Be=a.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:s=!1,tabStopId:c,children:l,...d}=e,m=pe(),h=c||m,f=_n(Ue,t),i=f.currentTabStopId===h,x=Ge(t),{onFocusableItemAdd:M,onFocusableItemRemove:v,currentTabStopId:N}=f;return a.useEffect(()=>{if(r)return M(),()=>v()},[r,M,v]),o.jsx(fe.ItemSlot,{scope:t,id:h,focusable:r,active:s,children:o.jsx(T.span,{tabIndex:i?0:-1,"data-orientation":f.orientation,...d,ref:n,onMouseDown:w(e.onMouseDown,g=>{r?f.onItemFocus(h):g.preventDefault()}),onFocus:w(e.onFocus,()=>f.onItemFocus(h)),onKeyDown:w(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const C=In(g,f.orientation,f.dir);if(C!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.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(g.currentTarget);b=f.loop?En(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 Rn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nn(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function In(e,n,t){const r=Nn(e.key,t);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Rn[r]}function Ve(e,n=!1){const t=document.activeElement;for(const r of e)if(r===t||(r.focus({preventScroll:n}),document.activeElement!==t))return}function En(e,n){return e.map((t,r)=>e[(n+r)%e.length])}var Sn=$e,jn=Be,me=["Enter"," "],Dn=["ArrowDown","PageUp","Home"],Ye=["ArrowUp","PageDown","End"],Pn=[...Dn,...Ye],Tn={ltr:[...me,"ArrowRight"],rtl:[...me,"ArrowLeft"]},An={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Q="Menu",[H,On,kn]=Pe(Q),[L,ze]=he(Q,[kn,Oe,Ke]),re=Oe(),qe=Ke(),[Fn,G]=L(Q),[Ln,Z]=L(Q),He=e=>{const{__scopeMenu:n,open:t=!1,children:r,dir:s,onOpenChange:c,modal:l=!0}=e,d=re(n),[m,h]=a.useState(null),f=a.useRef(!1),i=xe(c),x=Te(s);return a.useEffect(()=>{const M=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",M,{capture:!0}),()=>{document.removeEventListener("keydown",M,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),a.useEffect(()=>{if(!t)return;const M=()=>i(!1);return window.addEventListener("blur",M),()=>window.removeEventListener("blur",M)},[t,i]),o.jsx(Ut,{...d,children:o.jsx(Fn,{scope:n,open:t,onOpenChange:i,content:m,onContentChange:h,children:o.jsx(Ln,{scope:n,onClose:a.useCallback(()=>i(!1),[i]),isUsingKeyboardRef:f,dir:x,modal:l,children:r})})})};He.displayName=Q;var Gn="MenuAnchor",we=a.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,s=re(t);return o.jsx(Bt,{...s,...r,ref:n})});we.displayName=Gn;var ve="MenuPortal",[Kn,Xe]=L(ve,{forceMount:void 0}),We=e=>{const{__scopeMenu:n,forceMount:t,children:r,container:s}=e,c=G(ve,n);return o.jsx(Kn,{scope:n,forceMount:t,children:o.jsx(oe,{present:t||c.open,children:o.jsx(Vt,{asChild:!0,container:s,children:r})})})};We.displayName=ve;var S="MenuContent",[$n,ge]=L(S),Qe=a.forwardRef((e,n)=>{const t=Xe(S,e.__scopeMenu),{forceMount:r=t.forceMount,...s}=e,c=G(S,e.__scopeMenu),l=Z(S,e.__scopeMenu);return o.jsx(H.Provider,{scope:e.__scopeMenu,children:o.jsx(oe,{present:r||c.open,children:o.jsx(H.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(Un,{...s,ref:n}):o.jsx(Bn,{...s,ref:n})})})})}),Un=a.forwardRef((e,n)=>{const t=G(S,e.__scopeMenu),r=a.useRef(null),s=U(n,r);return a.useEffect(()=>{const c=r.current;if(c)return Yt(c)},[]),o.jsx(Me,{...e,ref:s,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:w(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Bn=a.forwardRef((e,n)=>{const t=G(S,e.__scopeMenu);return o.jsx(Me,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Vn=Zt("MenuContent.ScrollLock"),Me=a.forwardRef((e,n)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:l,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:i,onInteractOutside:x,onDismiss:M,disableOutsideScroll:v,...N}=e,g=G(S,t),C=Z(S,t),P=re(t),b=qe(t),I=On(t),[O,u]=a.useState(null),y=a.useRef(null),_=U(n,y,g.onContentChange),j=a.useRef(0),k=a.useRef(""),B=a.useRef(0),V=a.useRef(null),J=a.useRef("right"),ee=a.useRef(0),ce=v?Ht:a.Fragment,D=v?{as:Vn,allowPinchZoom:!0}:void 0,$t=p=>{const $=k.current+p,F=I().filter(E=>!E.disabled),Y=document.activeElement,ie=F.find(E=>E.ref.current===Y)?.textValue,ue=F.map(E=>E.textValue),ye=no(ue,$,ie),z=F.find(E=>E.textValue===ye)?.ref.current;(function E(Re){k.current=Re,window.clearTimeout(j.current),Re!==""&&(j.current=window.setTimeout(()=>E(""),1e3))})($),z&&setTimeout(()=>z.focus())};a.useEffect(()=>()=>window.clearTimeout(j.current),[]),qt();const K=a.useCallback(p=>J.current===V.current?.side&&ro(p,V.current?.area),[]);return o.jsx($n,{scope:t,searchRef:k,onItemEnter:a.useCallback(p=>{K(p)&&p.preventDefault()},[K]),onItemLeave:a.useCallback(p=>{K(p)||(y.current?.focus(),u(null))},[K]),onTriggerLeave:a.useCallback(p=>{K(p)&&p.preventDefault()},[K]),pointerGraceTimerRef:B,onPointerGraceIntentChange:a.useCallback(p=>{V.current=p},[]),children:o.jsx(ce,{...D,children:o.jsx(Xt,{asChild:!0,trapped:s,onMountAutoFocus:w(c,p=>{p.preventDefault(),y.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Wt,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:i,onInteractOutside:x,onDismiss:M,children:o.jsx(Sn,{asChild:!0,...b,dir:C.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:u,onEntryFocus:w(m,p=>{C.isUsingKeyboardRef.current||p.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Qt,{role:"menu","aria-orientation":"vertical","data-state":ft(g.open),"data-radix-menu-content":"",dir:C.dir,...P,...N,ref:_,style:{outline:"none",...N.style},onKeyDown:w(N.onKeyDown,p=>{const F=p.target.closest("[data-radix-menu-content]")===p.currentTarget,Y=p.ctrlKey||p.altKey||p.metaKey,ie=p.key.length===1;F&&(p.key==="Tab"&&p.preventDefault(),!Y&&ie&&$t(p.key));const ue=y.current;if(p.target!==ue||!Pn.includes(p.key))return;p.preventDefault();const z=I().filter(E=>!E.disabled).map(E=>E.ref.current);Ye.includes(p.key)&&z.reverse(),eo(z)}),onBlur:w(e.onBlur,p=>{p.currentTarget.contains(p.target)||(window.clearTimeout(j.current),k.current="")}),onPointerMove:w(e.onPointerMove,X(p=>{const $=p.target,F=ee.current!==p.clientX;if(p.currentTarget.contains($)&&F){const Y=p.clientX>ee.current?"right":"left";J.current=Y,ee.current=p.clientX}}))})})})})})})});Qe.displayName=S;var Yn="MenuGroup",Ce=a.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return o.jsx(T.div,{role:"group",...r,ref:n})});Ce.displayName=Yn;var zn="MenuLabel",Ze=a.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return o.jsx(T.div,{...r,ref:n})});Ze.displayName=zn;var te="MenuItem",Se="menu.itemSelect",ae=a.forwardRef((e,n)=>{const{disabled:t=!1,onSelect:r,...s}=e,c=a.useRef(null),l=Z(te,e.__scopeMenu),d=ge(te,e.__scopeMenu),m=U(n,c),h=a.useRef(!1),f=()=>{const i=c.current;if(!t&&i){const x=new CustomEvent(Se,{bubbles:!0,cancelable:!0});i.addEventListener(Se,M=>r?.(M),{once:!0}),zt(i,x),x.defaultPrevented?h.current=!1:l.onClose()}};return o.jsx(Je,{...s,ref:m,disabled:t,onClick:w(e.onClick,f),onPointerDown:i=>{e.onPointerDown?.(i),h.current=!0},onPointerUp:w(e.onPointerUp,i=>{h.current||i.currentTarget?.click()}),onKeyDown:w(e.onKeyDown,i=>{const x=d.searchRef.current!=="";t||x&&i.key===" "||me.includes(i.key)&&(i.currentTarget.click(),i.preventDefault())})})});ae.displayName=te;var Je=a.forwardRef((e,n)=>{const{__scopeMenu:t,disabled:r=!1,textValue:s,...c}=e,l=ge(te,t),d=qe(t),m=a.useRef(null),h=U(n,m),[f,i]=a.useState(!1),[x,M]=a.useState("");return a.useEffect(()=>{const v=m.current;v&&M((v.textContent??"").trim())},[c.children]),o.jsx(H.ItemSlot,{scope:t,disabled:r,textValue:s??x,children:o.jsx(jn,{asChild:!0,...d,focusable:!r,children:o.jsx(T.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...c,ref:h,onPointerMove:w(e.onPointerMove,X(v=>{r?l.onItemLeave(v):(l.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:w(e.onPointerLeave,X(v=>l.onItemLeave(v))),onFocus:w(e.onFocus,()=>i(!0)),onBlur:w(e.onBlur,()=>i(!1))})})})}),qn="MenuCheckboxItem",et=a.forwardRef((e,n)=>{const{checked:t=!1,onCheckedChange:r,...s}=e;return o.jsx(at,{scope:e.__scopeMenu,checked:t,children:o.jsx(ae,{role:"menuitemcheckbox","aria-checked":ne(t)?"mixed":t,...s,ref:n,"data-state":_e(t),onSelect:w(s.onSelect,()=>r?.(ne(t)?!0:!t),{checkForDefaultPrevented:!1})})})});et.displayName=qn;var tt="MenuRadioGroup",[Hn,Xn]=L(tt,{value:void 0,onValueChange:()=>{}}),nt=a.forwardRef((e,n)=>{const{value:t,onValueChange:r,...s}=e,c=xe(r);return o.jsx(Hn,{scope:e.__scopeMenu,value:t,onValueChange:c,children:o.jsx(Ce,{...s,ref:n})})});nt.displayName=tt;var ot="MenuRadioItem",rt=a.forwardRef((e,n)=>{const{value:t,...r}=e,s=Xn(ot,e.__scopeMenu),c=t===s.value;return o.jsx(at,{scope:e.__scopeMenu,checked:c,children:o.jsx(ae,{role:"menuitemradio","aria-checked":c,...r,ref:n,"data-state":_e(c),onSelect:w(r.onSelect,()=>s.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});rt.displayName=ot;var be="MenuItemIndicator",[at,Wn]=L(be,{checked:!1}),st=a.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:r,...s}=e,c=Wn(be,t);return o.jsx(oe,{present:r||ne(c.checked)||c.checked===!0,children:o.jsx(T.span,{...s,ref:n,"data-state":_e(c.checked)})})});st.displayName=be;var Qn="MenuSeparator",ct=a.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return o.jsx(T.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});ct.displayName=Qn;var Zn="MenuArrow",it=a.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,s=re(t);return o.jsx(Jt,{...s,...r,ref:n})});it.displayName=Zn;var Jn="MenuSub",[xr,ut]=L(Jn),q="MenuSubTrigger",lt=a.forwardRef((e,n)=>{const t=G(q,e.__scopeMenu),r=Z(q,e.__scopeMenu),s=ut(q,e.__scopeMenu),c=ge(q,e.__scopeMenu),l=a.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=c,h={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return a.useEffect(()=>f,[f]),a.useEffect(()=>{const i=d.current;return()=>{window.clearTimeout(i),m(null)}},[d,m]),o.jsx(we,{asChild:!0,...h,children:o.jsx(Je,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":t.open?s.contentId:void 0,"data-state":ft(t.open),...e,ref:ke(n,s.onTriggerChange),onClick:i=>{e.onClick?.(i),!(e.disabled||i.defaultPrevented)&&(i.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:w(e.onPointerMove,X(i=>{c.onItemEnter(i),!i.defaultPrevented&&!e.disabled&&!t.open&&!l.current&&(c.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{t.onOpenChange(!0),f()},100))})),onPointerLeave:w(e.onPointerLeave,X(i=>{f();const x=t.content?.getBoundingClientRect();if(x){const M=t.content?.dataset.side,v=M==="right",N=v?-5:5,g=x[v?"left":"right"],C=x[v?"right":"left"];c.onPointerGraceIntentChange({area:[{x:i.clientX+N,y:i.clientY},{x:g,y:x.top},{x:C,y:x.top},{x:C,y:x.bottom},{x:g,y:x.bottom}],side:M}),window.clearTimeout(d.current),d.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===" "||Tn[r.dir].includes(i.key)&&(t.onOpenChange(!0),t.content?.focus(),i.preventDefault())})})})});lt.displayName=q;var dt="MenuSubContent",pt=a.forwardRef((e,n)=>{const t=Xe(S,e.__scopeMenu),{forceMount:r=t.forceMount,align:s="start",...c}=e,l=G(S,e.__scopeMenu),d=Z(S,e.__scopeMenu),m=ut(dt,e.__scopeMenu),h=a.useRef(null),f=U(n,h);return o.jsx(H.Provider,{scope:e.__scopeMenu,children:o.jsx(oe,{present:r||l.open,children:o.jsx(H.Slot,{scope:e.__scopeMenu,children:o.jsx(Me,{id:m.contentId,"aria-labelledby":m.triggerId,...c,ref:f,align:s,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:i=>{d.isUsingKeyboardRef.current&&h.current?.focus(),i.preventDefault()},onCloseAutoFocus:i=>i.preventDefault(),onFocusOutside:w(e.onFocusOutside,i=>{i.target!==m.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:w(e.onEscapeKeyDown,i=>{d.onClose(),i.preventDefault()}),onKeyDown:w(e.onKeyDown,i=>{const x=i.currentTarget.contains(i.target),M=An[d.dir].includes(i.key);x&&M&&(l.onOpenChange(!1),m.trigger?.focus(),i.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 eo(e){const n=document.activeElement;for(const t of e)if(t===n||(t.focus(),document.activeElement!==n))return}function to(e,n){return e.map((t,r)=>e[(n+r)%e.length])}function no(e,n,t){const s=n.length>1&&Array.from(n).every(h=>h===n[0])?n[0]:n,c=t?e.indexOf(t):-1;let l=to(e,Math.max(c,0));s.length===1&&(l=l.filter(h=>h!==t));const m=l.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return m!==t?m:void 0}function oo(e,n){const{x:t,y:r}=e;let s=!1;for(let c=0,l=n.length-1;c<n.length;l=c++){const d=n[c],m=n[l],h=d.x,f=d.y,i=m.x,x=m.y;f>r!=x>r&&t<(i-h)*(r-f)/(x-f)+h&&(s=!s)}return s}function ro(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return oo(t,n)}function X(e){return n=>n.pointerType==="mouse"?e(n):void 0}var ao=He,so=we,co=We,io=Qe,uo=Ce,lo=Ze,po=ae,fo=et,mo=nt,ho=rt,xo=st,wo=ct,vo=it,go=lt,Mo=pt,se="DropdownMenu",[Co]=he(se,[ze]),R=ze(),[bo,mt]=Co(se),ht=e=>{const{__scopeDropdownMenu:n,children:t,dir:r,open:s,defaultOpen:c,onOpenChange:l,modal:d=!0}=e,m=R(n),h=a.useRef(null),[f,i]=Ae({prop:s,defaultProp:c??!1,onChange:l,caller:se});return o.jsx(bo,{scope:n,triggerId:pe(),triggerRef:h,contentId:pe(),open:f,onOpenChange:i,onOpenToggle:a.useCallback(()=>i(x=>!x),[i]),modal:d,children:o.jsx(ao,{...m,open:f,onOpenChange:i,dir:r,modal:d,children:t})})};ht.displayName=se;var xt="DropdownMenuTrigger",wt=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,disabled:r=!1,...s}=e,c=mt(xt,t),l=R(t);return o.jsx(so,{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,...s,ref:ke(n,c.triggerRef),onPointerDown:w(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(c.onOpenToggle(),c.open||d.preventDefault())}),onKeyDown:w(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&c.onOpenToggle(),d.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});wt.displayName=xt;var _o="DropdownMenuPortal",vt=e=>{const{__scopeDropdownMenu:n,...t}=e,r=R(n);return o.jsx(co,{...r,...t})};vt.displayName=_o;var gt="DropdownMenuContent",Mt=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=mt(gt,t),c=R(t),l=a.useRef(!1);return o.jsx(io,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...r,ref:n,onCloseAutoFocus:w(e.onCloseAutoFocus,d=>{l.current||s.triggerRef.current?.focus(),l.current=!1,d.preventDefault()}),onInteractOutside:w(e.onInteractOutside,d=>{const m=d.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0,f=m.button===2||h;(!s.modal||f)&&(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=gt;var yo="DropdownMenuGroup",Ro=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(uo,{...s,...r,ref:n})});Ro.displayName=yo;var No="DropdownMenuLabel",Ct=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(lo,{...s,...r,ref:n})});Ct.displayName=No;var Io="DropdownMenuItem",bt=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(po,{...s,...r,ref:n})});bt.displayName=Io;var Eo="DropdownMenuCheckboxItem",_t=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(fo,{...s,...r,ref:n})});_t.displayName=Eo;var So="DropdownMenuRadioGroup",jo=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(mo,{...s,...r,ref:n})});jo.displayName=So;var Do="DropdownMenuRadioItem",yt=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(ho,{...s,...r,ref:n})});yt.displayName=Do;var Po="DropdownMenuItemIndicator",Rt=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(xo,{...s,...r,ref:n})});Rt.displayName=Po;var To="DropdownMenuSeparator",Nt=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(wo,{...s,...r,ref:n})});Nt.displayName=To;var Ao="DropdownMenuArrow",Oo=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(vo,{...s,...r,ref:n})});Oo.displayName=Ao;var ko="DropdownMenuSubTrigger",It=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(go,{...s,...r,ref:n})});It.displayName=ko;var Fo="DropdownMenuSubContent",Et=a.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...r}=e,s=R(t);return o.jsx(Mo,{...s,...r,ref:n,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=Fo;var Lo=ht,Go=wt,Ko=vt,St=Mt,jt=Ct,Dt=bt,Pt=_t,Tt=yt,At=Rt,Ot=Nt,kt=It,Ft=Et;const $o=Lo,Uo=Go,Bo=a.forwardRef(({className:e,inset:n,children:t,...r},s)=>o.jsxs(kt,{ref:s,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",n&&"pl-8",e),...r,children:[t,o.jsx(dn,{className:"ml-auto h-4 w-4"})]}));Bo.displayName=kt.displayName;const Vo=a.forwardRef(({className:e,...n},t)=>o.jsx(Ft,{ref: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}));Vo.displayName=Ft.displayName;const Lt=a.forwardRef(({className:e,sideOffset:n=4,...t},r)=>o.jsx(Ko,{children:o.jsx(St,{ref:r,sideOffset: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})}));Lt.displayName=St.displayName;const Gt=a.forwardRef(({className:e,inset:n,...t},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",n&&"pl-8",e),...t}));Gt.displayName=Dt.displayName;const Yo=a.forwardRef(({className:e,children:n,checked:t,...r},s)=>o.jsxs(Pt,{ref:s,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:t,...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(en,{className:"h-4 w-4"})})}),n]}));Yo.displayName=Pt.displayName;const zo=a.forwardRef(({className:e,children:n,...t},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),...t,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(wn,{className:"h-2 w-2 fill-current"})})}),n]}));zo.displayName=Tt.displayName;const qo=a.forwardRef(({className:e,inset:n,...t},r)=>o.jsx(jt,{ref:r,className:A("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",n&&"pl-8",e),...t}));qo.displayName=jt.displayName;const Ho=a.forwardRef(({className:e,...n},t)=>o.jsx(Ot,{ref:t,className:A("-mx-1 my-1 h-px bg-border",e),...n}));Ho.displayName=Ot.displayName;const Kt={all:["memos"],list:e=>["memos","list",e]};function Xo(e){return pn({queryKey:Kt.list(e),queryFn:()=>Fe.listMemos(e)})}function Wo(){const e=tn();return nn({mutationFn:n=>Fe.deleteMemo(n),onSuccess:()=>e.invalidateQueries({queryKey:Kt.all})})}const Qo=300;function wr(){const{t:e}=Le(["memos","common"]),[n,t]=on(),r=n.get("q")??"",s=n.get("who")??"",c=n.get("what")??"",l=n.get("has_location")==="1",d=n.get("include_expired")==="1",[m,h]=a.useState(r);a.useEffect(()=>{if(m===r)return;const u=window.setTimeout(()=>{b({q:m||null})},Qo);return()=>window.clearTimeout(u)},[m]);const f=a.useMemo(()=>({...r?{query:r}:{},...s?{who:s}:{},...c?{what:c}:{},...l?{has_location:!0}:{},...d?{include_expired:!0}:{},limit:200}),[r,s,c,l,d]),{data:i,isLoading:x,isFetching:M,refetch:v}=Xo(f),N=i?.memos??[],g=Wo(),[C,P]=a.useState(null);function b(u){const y=new URLSearchParams(n);for(const[_,j]of Object.entries(u))j==null||j===""?y.delete(_):y.set(_,j);t(y,{replace:!0})}async function I(){if(C!=null)try{await g.mutateAsync(C),Ee.success(e("toast.deleted"))}catch(u){const{message:y}=sn(u,e);throw Ee.error(y),u}}const O=a.useMemo(()=>[{id:"id",header:e("col.id"),cell:u=>o.jsxs("span",{className:"tabular-nums text-text-dim",children:["#",u.id]}),headClassName:"w-16"},{id:"what",header:e("col.what"),cell:u=>o.jsx("span",{className:"line-clamp-2",children:u.memo?o.jsx("span",{className:"text-text",children:u.memo}):o.jsx("span",{className:"font-medium text-text",children:u.what})}),asCardTitle:!0},{id:"who",header:e("col.who"),cell:u=>u.who?o.jsx(rn,{variant:"secondary",children:u.who}):o.jsx("span",{className:"text-text-muted",children:"—"}),headClassName:"w-32"},{id:"when",header:e("col.when"),cell:u=>o.jsx("span",{className:"text-text-dim",children:u.whenText||(u.whenAt?je(u.whenAt):"—")}),headClassName:"w-36"},{id:"where",header:e("col.where"),cell:u=>u.where_label||u.where_lat!=null&&u.where_lng!=null?o.jsx(Jo,{memo:u}):o.jsx("span",{className:"text-text-muted",children:"—"}),headClassName:"w-44"},{id:"platform",header:e("col.platform"),cell:u=>o.jsx("span",{className:"text-text-dim",children:u.platform}),headClassName:"w-24",hideOnMobile:!0},{id:"createdAt",header:e("col.createdAt"),cell:u=>o.jsx("span",{className:"text-text-dim",children:je(u.createdAt)}),headClassName:"w-36",hideOnMobile:!0},{id:"actions",header:"",cell:u=>o.jsx("div",{className:"flex justify-end",children:o.jsxs(Ne,{variant:"ghost",size:"sm",onClick:y=>{y.stopPropagation(),P(u.id)},disabled:g.isPending,"aria-label":e("action.delete"),children:[o.jsx(fn,{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,g.isPending]);return o.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[o.jsx(an,{}),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(Ne,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>v(),disabled:M,"aria-label":e("actions.refresh",{ns:"common"}),children:[o.jsx(mn,{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(hn,{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-text-muted"}),o.jsx(le,{value:m,onChange:u=>h(u.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(Ie,{htmlFor:"who-filter",className:"text-xs text-text-dim",children:e("search.who")}),o.jsx(le,{id:"who-filter",value:s,onChange:u=>b({who:u.target.value||null}),className:"w-36"})]}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Ie,{htmlFor:"what-filter",className:"text-xs text-text-dim",children:e("search.what")}),o.jsx(le,{id:"what-filter",value:c,onChange:u=>b({what:u.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:u=>b({has_location:u.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:d,onChange:u=>b({include_expired:u.target.checked?"1":null}),className:"h-4 w-4 accent-accent"}),e("search.includeExpired")]})]})]}),o.jsx(cn,{columns:O,rows:N,getRowId:u=>String(u.id),loading:x,emptyState:o.jsx(un,{icon:o.jsx(vn,{}),title:e("empty.title"),description:e("empty.description")})}),o.jsx(ln,{open:C!=null,onOpenChange:u=>{u||P(null)},title:e("action.confirmDelete"),description:e("action.confirmDeleteDesc"),intent:"danger",confirmLabel:e("action.delete"),onConfirm:I})]})]})}const Zo={baidu:"openMap.baidu",apple:"openMap.apple",google:"openMap.google",osm:"openMap.osm"};function Jo({memo:e}){const{t:n}=Le("memos"),t=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:t}):o.jsxs($o,{children:[o.jsx(Uo,{asChild:!0,children:o.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-sm text-text-dim hover:text-accent",onClick:s=>s.stopPropagation(),children:[o.jsx(xn,{className:"h-3 w-3"}),o.jsx("span",{className:"line-clamp-1 underline-offset-2 hover:underline",children:t})]})}),o.jsx(Lt,{children:r.map(([s,c])=>o.jsx(Gt,{asChild:!0,children:o.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:n(Zo[s]??"openMap.label",{defaultValue:s})})},s))})]})}function je(e){try{const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}export{wr as default};
12
+ //# sourceMappingURL=memos-BAuv2jwD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memos-BAuv2jwD.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/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","\"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 React.useEffect(() => {\n if (!open) {\n return;\n }\n const handleBlur = () => handleOpenChange(false);\n window.addEventListener(\"blur\", handleBlur);\n return () => window.removeEventListener(\"blur\", handleBlur);\n }, [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 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\": context.open ? subContext.contentId : void 0,\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, align = \"start\", ...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,\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","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","handleBlur","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","createSlot","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll","rovingFocusGroupScope","currentItemId","setCurrentItemId","contentRef","timerRef","searchRef","pointerGraceTimerRef","pointerGraceIntentRef","pointerDirRef","lastPointerXRef","ScrollLockWrapper","RemoveScroll","React.Fragment","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","composeRefs","contentRect","side","rightSide","bleed","contentNearEdge","contentFarEdge","SUB_CONTENT_NAME","MenuSubContent","align","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":"26BAAA;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,GAAgB,CAAE,QAAS,GAAO,WAAY,EAAI,EAClDC,EAAa,mBACb,CAACC,GAAYC,GAAeC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AoB,QAAO,GAC1B,SAAAmD,EAAAA,KAAC,SAAA,CACC,KAAK,SACL,UAAU,yEACV,QAAUiE,GAAMA,EAAE,gBAAA,EAElB,SAAA,CAAAta,EAAAA,IAACmb,GAAA,CAAO,UAAU,SAAA,CAAU,EAC5Bnb,EAAAA,IAAC,OAAA,CAAK,UAAU,kDAAmD,SAAAib,CAAA,CAAM,CAAA,CAAA,CAAA,EAE7E,EACAjb,EAAAA,IAACwT,GAAA,CACE,SAAA0H,EAAQ,IAAI,CAAC,CAACE,EAAUC,CAAG,IAC1Brb,EAAAA,IAACkU,GAAA,CAAgC,QAAO,GACtC,SAAAlU,EAAAA,IAAC,IAAA,CACC,KAAMqb,EACN,OAAO,SACP,IAAI,sBAEH,SAAArD,EAAE+C,GAAmBK,CAAQ,GAAK,gBAAiB,CAAE,aAAcA,EAAU,CAAA,CAAA,CAChF,EAPqBA,CAQvB,CACD,CAAA,CACH,CAAA,EACF,CAEJ,CAEA,SAASjB,GAAWmB,EAAqB,CACvC,GAAI,CACF,MAAMC,EAAI,IAAI,KAAKD,CAAG,EACtB,OAAI,OAAO,MAAMC,EAAE,QAAA,CAAS,EAAUD,EAC/BC,EAAE,eAAe,OAAW,CAAE,MAAO,QAAS,IAAK,UAAW,KAAM,UAAW,OAAQ,SAAA,CAAW,CAC3G,MAAQ,CACN,OAAOD,CACT,CACF","x_google_ignoreList":[0,1,2,3,4]}
@@ -1,2 +1,2 @@
1
- import{u as C,j as e,B as b,k as P,l as N,m as R,L as T,I as S}from"./index-D5DvetP5.js";import{r as f}from"./react-DlP5eolq.js";import{D as q,a as E,b as $,c as Q,d as B}from"./dialog-CqBNfrYQ.js";import{b as O,c as z,d as L,e as H}from"./use-settings-CTuwZEdY.js";import{L as I}from"./loader-circle-CgLbYd3g.js";import{R as W}from"./refresh-ccw-MfejQvU6.js";import{X as A}from"./x-De6HR8Q5.js";import{S as J}from"./save-Cha8EnUJ.js";import{Q as M}from"./qr-code-glvcd_3g.js";import"./useQuery-BLyYPRRA.js";function w(s){const i=new Set(s?.messengers??[]);return{"wechat-ilink":{enabled:i.has("wechat-ilink")},telegram:{enabled:i.has("telegram"),telegram:{...s?.telegram??{}}},feishu:{enabled:i.has("feishu"),feishu:{...s?.feishu??{}}},dingtalk:{enabled:i.has("dingtalk"),dingtalk:{...s?.dingtalk??{}}},discord:{enabled:i.has("discord"),discord:{...s?.discord??{}}}}}function _(s,i){const n=[];for(const d of Object.keys(s))s[d].enabled&&n.push(d);const l={messengers:n,...Object.fromEntries(Object.entries(i).filter(([d])=>!["messengers","telegram","feishu","dingtalk","discord"].includes(d)))};return s.telegram.enabled&&s.telegram.telegram&&(l.telegram=s.telegram.telegram),s.feishu.enabled&&s.feishu.feishu&&(l.feishu=s.feishu.feishu),s.dingtalk.enabled&&s.dingtalk.dingtalk&&(l.dingtalk=s.dingtalk.dingtalk),s.discord.enabled&&s.discord.discord&&(l.discord=s.discord.discord),l}function te(){const{t:s}=C(["settings","common"]),i=O(),n=z(),[l,d]=f.useState(()=>w(i.data)),[g,x]=f.useState(!1);f.useEffect(()=>{g||i.data&&(d(w(i.data)),x(!0))},[i.data,g]);const m=i.data,t=f.useMemo(()=>m?JSON.stringify(w(m))!==JSON.stringify(l):!1,[m,l]),[r,o]=f.useState(!1),p=new Set(m?.features?.blacklistedPlatforms??[]),h=a=>p.has(a);function c(a,v){d(F=>({...F,[a]:{...F[a],...v}}))}async function k(){if(m)try{await n.mutateAsync(_(l,m)),N.success(s("messengers.savedToast")),x(!1)}catch(a){N.error(R(a,s).message)}}function D(){m&&d(w(m))}return e.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-4",children:[e.jsxs("header",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("h1",{className:"text-xl font-semibold",children:s("messengers.title")}),e.jsxs(b,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>i.refetch(),disabled:i.isFetching,"aria-label":s("actions.refresh",{ns:"common"}),children:[i.isFetching?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(W,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("actions.refresh",{ns:"common"})})]})]}),e.jsx("p",{className:"text-sm text-text-dim",children:s("messengers.subtitle")})]}),e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:t?e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"info",children:s("messengers.dirtyHint")}),e.jsxs(b,{type:"button",variant:"secondary",size:"sm",onClick:D,disabled:n.isPending,children:[e.jsx(A,{className:"h-4 w-4"}),s("messengers.discardAll")]}),e.jsxs(b,{type:"button",size:"sm",onClick:()=>void k(),disabled:n.isPending,children:[n.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(J,{className:"h-4 w-4"}),n.isPending?s("messengers.saving"):s("messengers.saveAll")]})]}):e.jsx("span",{className:"text-xs text-text-muted",children:s("env.noChanges")})}),i.isLoading?e.jsx("div",{className:"h-96 rounded-md bg-surface-2 animate-pulse"}):m?e.jsxs("div",{className:"flex flex-col gap-3",children:[h("wechat-ilink")?null:e.jsx(y,{slot:"wechat-ilink",label:s("messengers.platform.wechat"),hint:s("messengers.hint.wechat"),enabled:l["wechat-ilink"].enabled,onToggle:a=>c("wechat-ilink",{enabled:a}),children:e.jsxs(b,{type:"button",variant:"secondary",size:"sm",onClick:()=>o(!0),children:[e.jsx(M,{className:"h-4 w-4"}),s("messengers.scanQr")]})}),m.features?.globalIm&&!h("telegram")?e.jsxs(y,{slot:"telegram",label:s("messengers.platform.telegram"),hint:s("messengers.hint.telegram"),enabled:l.telegram.enabled,onToggle:a=>c("telegram",{enabled:a}),children:[e.jsx(u,{id:"tg-token",label:s("messengers.fields.botToken"),value:l.telegram.telegram?.botToken??"",type:"password",onChange:a=>c("telegram",{telegram:{...l.telegram.telegram,botToken:a}})}),e.jsx(u,{id:"tg-channel",label:s("messengers.fields.channelId"),value:l.telegram.telegram?.channelId??"",onChange:a=>c("telegram",{telegram:{...l.telegram.telegram,channelId:a}})})]}):null,h("feishu")?null:e.jsxs(y,{slot:"feishu",label:s("messengers.platform.feishu"),hint:s("messengers.hint.feishu"),enabled:l.feishu.enabled,onToggle:a=>c("feishu",{enabled:a}),children:[e.jsx(u,{id:"fs-appid",label:s("messengers.fields.appId"),value:l.feishu.feishu?.appId??"",onChange:a=>c("feishu",{feishu:{...l.feishu.feishu,appId:a}})}),e.jsx(u,{id:"fs-secret",label:s("messengers.fields.appSecret"),value:l.feishu.feishu?.appSecret??"",type:"password",onChange:a=>c("feishu",{feishu:{...l.feishu.feishu,appSecret:a}})}),e.jsx(u,{id:"fs-channel",label:s("messengers.fields.channelId"),value:l.feishu.feishu?.channelId??"",onChange:a=>c("feishu",{feishu:{...l.feishu.feishu,channelId:a}})})]}),h("dingtalk")?null:e.jsxs(y,{slot:"dingtalk",label:s("messengers.platform.dingtalk"),hint:s("messengers.hint.dingtalk"),enabled:l.dingtalk.enabled,onToggle:a=>c("dingtalk",{enabled:a}),children:[e.jsx(u,{id:"dt-cid",label:s("messengers.fields.clientId"),value:l.dingtalk.dingtalk?.clientId??"",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,clientId:a}})}),e.jsx(u,{id:"dt-secret",label:s("messengers.fields.clientSecret"),value:l.dingtalk.dingtalk?.clientSecret??"",type:"password",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,clientSecret:a}})}),e.jsx(u,{id:"dt-channel",label:s("messengers.fields.channelId"),value:l.dingtalk.dingtalk?.channelId??"",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,channelId:a}})}),e.jsx(j,{id:"dt-dm-policy",label:s("messengers.dingtalk.dmPolicy"),value:l.dingtalk.dingtalk?.dmPolicy??"open",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,dmPolicy:a}}),options:[{value:"open",label:s("messengers.dingtalk.policy.open")},{value:"pairing",label:s("messengers.dingtalk.policy.pairing")},{value:"allowlist",label:s("messengers.dingtalk.policy.allowlist")}]}),e.jsx(j,{id:"dt-group-policy",label:s("messengers.dingtalk.groupPolicy"),value:l.dingtalk.dingtalk?.groupPolicy??"open",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,groupPolicy:a}}),options:[{value:"open",label:s("messengers.dingtalk.policy.open")},{value:"allowlist",label:s("messengers.dingtalk.policy.allowlist")},{value:"disabled",label:s("messengers.dingtalk.policy.disabled")}]}),e.jsx(u,{id:"dt-allow-from",label:s("messengers.dingtalk.allowFrom"),value:(l.dingtalk.dingtalk?.allowFrom??[]).join(","),onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,allowFrom:a.split(",").map(v=>v.trim()).filter(Boolean)}})}),e.jsx(u,{id:"dt-group-allow-from",label:s("messengers.dingtalk.groupAllowFrom"),value:(l.dingtalk.dingtalk?.groupAllowFrom??[]).join(","),onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,groupAllowFrom:a.split(",").map(v=>v.trim()).filter(Boolean)}})}),e.jsx(j,{id:"dt-ack",label:s("messengers.dingtalk.ackReaction"),value:l.dingtalk.dingtalk?.ackReaction??"off",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,ackReaction:a}}),options:[{value:"off",label:s("messengers.dingtalk.ack.off")},{value:"emoji",label:s("messengers.dingtalk.ack.emoji")},{value:"kaomoji",label:s("messengers.dingtalk.ack.kaomoji")}]}),e.jsx(V,{accounts:l.dingtalk.dingtalk?.accounts??{},onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,accounts:a}})})]}),m.features?.globalIm&&!h("discord")?e.jsxs(y,{slot:"discord",label:s("messengers.platform.discord"),hint:s("messengers.hint.discord"),enabled:l.discord.enabled,onToggle:a=>c("discord",{enabled:a}),children:[e.jsx(u,{id:"dc-token",label:s("messengers.fields.botToken"),value:l.discord.discord?.botToken??"",type:"password",onChange:a=>c("discord",{discord:{...l.discord.discord,botToken:a}})}),e.jsx(u,{id:"dc-channel",label:s("messengers.fields.channelId"),value:l.discord.discord?.channelId??"",onChange:a=>c("discord",{discord:{...l.discord.discord,channelId:a}})})]}):null]}):null,e.jsx(U,{open:r,onOpenChange:o,onConfirmed:()=>{i.refetch(),x(!1)}})]})}function y({label:s,hint:i,enabled:n,onToggle:l,children:d}){const{t:g}=C("settings");return e.jsxs("div",{className:"rounded-md border border-border bg-surface p-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-text",children:s}),e.jsx(P,{variant:n?"success":"outline",children:g(n?"messengers.enabled":"messengers.disabled")})]}),e.jsx("p",{className:"mt-1 text-xs text-text-dim",children:i})]}),e.jsx("label",{className:"inline-flex items-center gap-2 text-sm",children:e.jsx("input",{type:"checkbox",checked:n,onChange:x=>l(x.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"})})]}),n&&d&&e.jsx("div",{className:"mt-3 flex flex-col gap-2",children:d})]})}function u({id:s,label:i,value:n,onChange:l,type:d="text"}){return e.jsxs("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-[180px_1fr] sm:items-center sm:gap-2",children:[e.jsx(T,{htmlFor:s,className:"text-xs text-text-dim",children:i}),e.jsx(S,{id:s,type:d,value:n,onChange:g=>l(g.target.value),autoComplete:"off",className:"font-mono text-xs"})]})}function j({id:s,label:i,value:n,onChange:l,options:d}){return e.jsxs("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-[180px_1fr] sm:items-center sm:gap-2",children:[e.jsx(T,{htmlFor:s,className:"text-xs text-text-dim",children:i}),e.jsx("select",{id:s,value:n,onChange:g=>l(g.target.value),className:"rounded-md border border-input bg-background px-2 py-1 text-xs",children:d.map(g=>e.jsx("option",{value:g.value,children:g.label},g.value))})]})}function U({open:s,onOpenChange:i,onConfirmed:n}){const{t:l}=C(["settings","common"]),d=L(),[g,x]=f.useState(null),[m,t]=f.useState(null),[r,o]=f.useState(null);f.useEffect(()=>{if(!s){x(null),t(null),o(null);return}let c=!0;return d.mutateAsync().then(k=>{c&&(t(k.qrImage),x(k.qrToken))}).catch(k=>{c&&o(k instanceof Error?k.message:String(k))}),()=>{c=!1}},[s]);const h=H(s?g:null).data?.status;return f.useEffect(()=>{h==="confirmed"&&(N.success(l("messengers.qr.confirmed")),n(),i(!1)),h==="expired"&&N.error(l("messengers.qr.expired"))},[h]),e.jsx(q,{open:s,onOpenChange:i,children:e.jsxs(E,{children:[e.jsxs($,{children:[e.jsx(Q,{children:l("messengers.qr.title")}),e.jsx(B,{children:l("messengers.qr.description")})]}),e.jsx("div",{className:"flex flex-col items-center gap-3",children:d.isPending&&!m?e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"h-8 w-8 animate-spin text-text-dim"}),e.jsx("p",{className:"text-sm text-text-dim",children:l("messengers.qr.starting")})]}):r?e.jsxs("p",{className:"text-sm text-danger",children:[l("messengers.qr.loadFailed"),": ",r]}):m?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:m,alt:l("messengers.qr.title"),className:"rounded-md border border-border"}),h==="expired"?e.jsx("p",{className:"text-xs text-danger",children:l("messengers.qr.expired")}):e.jsx("p",{className:"text-xs text-text-dim",children:h?`· ${h} ·`:""})]}):null})]})})}function V({accounts:s,onChange:i}){const{t:n}=C(["settings","common"]),l=Object.entries(s),d=(t,r)=>{i({...s,[t]:{...s[t],...r}})},g=t=>{const r={...s};delete r[t],i(r)},x=(t,r)=>{if(!r||r===t)return;if(s[r]){N.error(n("messengers.dingtalk.accountRenameCollision",{id:r}));return}const o={};for(const[p,h]of Object.entries(s))o[p===t?r:p]=h;i(o)},m=()=>{let t=l.length+1,r=`account-${t}`;for(;s[r];)t+=1,r=`account-${t}`;i({...s,[r]:{enabled:!0}})};return e.jsxs("div",{className:"mt-3 border-t border-input pt-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("div",{className:"text-xs font-semibold text-text-dim",children:n("messengers.dingtalk.accountsTitle")}),e.jsxs(b,{type:"button",size:"sm",variant:"outline",onClick:m,children:["+ ",n("messengers.dingtalk.addAccount")]})]}),l.length===0?e.jsx("div",{className:"text-xs text-text-dim italic",children:n("messengers.dingtalk.accountsEmpty")}):e.jsx("div",{className:"space-y-3",children:l.map(([t,r])=>e.jsxs("div",{className:"rounded-md border border-input p-2",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(S,{id:`acct-id-${t}`,defaultValue:t,onBlur:o=>x(t,o.target.value.trim()),className:"font-mono text-xs w-40",placeholder:"account-id"}),e.jsx(S,{id:`acct-name-${t}`,value:r.name??"",onChange:o=>d(t,{name:o.target.value}),className:"text-xs flex-1",placeholder:n("messengers.dingtalk.accountName")}),e.jsxs("label",{className:"flex items-center gap-1 text-xs",children:[e.jsx("input",{type:"checkbox",checked:r.enabled!==!1,onChange:o=>d(t,{enabled:o.target.checked})}),n("messengers.enabled")]}),e.jsx(b,{type:"button",size:"sm",variant:"ghost",onClick:()=>g(t),className:"text-danger",children:e.jsx(A,{className:"size-4"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(u,{id:`acct-cid-${t}`,label:n("messengers.fields.clientId"),value:r.clientId??"",onChange:o=>d(t,{clientId:o})}),e.jsx(u,{id:`acct-secret-${t}`,label:n("messengers.fields.clientSecret"),value:r.clientSecret??"",type:"password",onChange:o=>d(t,{clientSecret:o})}),e.jsx(j,{id:`acct-dm-${t}`,label:n("messengers.dingtalk.dmPolicy"),value:r.dmPolicy??"open",onChange:o=>d(t,{dmPolicy:o}),options:[{value:"open",label:n("messengers.dingtalk.policy.open")},{value:"pairing",label:n("messengers.dingtalk.policy.pairing")},{value:"allowlist",label:n("messengers.dingtalk.policy.allowlist")}]}),e.jsx(j,{id:`acct-group-${t}`,label:n("messengers.dingtalk.groupPolicy"),value:r.groupPolicy??"open",onChange:o=>d(t,{groupPolicy:o}),options:[{value:"open",label:n("messengers.dingtalk.policy.open")},{value:"allowlist",label:n("messengers.dingtalk.policy.allowlist")},{value:"disabled",label:n("messengers.dingtalk.policy.disabled")}]}),e.jsx(u,{id:`acct-allow-${t}`,label:n("messengers.dingtalk.allowFrom"),value:(r.allowFrom??[]).join(","),onChange:o=>d(t,{allowFrom:o.split(",").map(p=>p.trim()).filter(Boolean)})}),e.jsx(u,{id:`acct-gallow-${t}`,label:n("messengers.dingtalk.groupAllowFrom"),value:(r.groupAllowFrom??[]).join(","),onChange:o=>d(t,{groupAllowFrom:o.split(",").map(p=>p.trim()).filter(Boolean)})}),e.jsx(j,{id:`acct-ack-${t}`,label:n("messengers.dingtalk.ackReaction"),value:r.ackReaction??"off",onChange:o=>d(t,{ackReaction:o}),options:[{value:"off",label:n("messengers.dingtalk.ack.off")},{value:"emoji",label:n("messengers.dingtalk.ack.emoji")},{value:"kaomoji",label:n("messengers.dingtalk.ack.kaomoji")}]})]})]},t))}),e.jsx("div",{className:"mt-1 text-xs text-text-dim",children:n("messengers.dingtalk.accountsHint")})]})}export{te as default};
2
- //# sourceMappingURL=messengers-CUz9DXB5.js.map
1
+ import{u as C,j as e,B as b,k as P,l as N,m as R,L as T,I as S}from"./index-BjUyDXLb.js";import{r as f}from"./react-DlP5eolq.js";import{D as q,a as E,b as $,c as Q,d as B}from"./dialog-nb4ANHd4.js";import{b as O,c as z,d as L,e as H}from"./use-settings-S6mSC9nP.js";import{L as I}from"./loader-circle-MnTMknNl.js";import{R as W}from"./refresh-ccw--XT-lrCo.js";import{X as A}from"./x-Dv1gbRhw.js";import{S as J}from"./save-9sLkRauh.js";import{Q as M}from"./qr-code-CfdRXZZD.js";import"./useQuery-CvEVNuvH.js";function w(s){const i=new Set(s?.messengers??[]);return{"wechat-ilink":{enabled:i.has("wechat-ilink")},telegram:{enabled:i.has("telegram"),telegram:{...s?.telegram??{}}},feishu:{enabled:i.has("feishu"),feishu:{...s?.feishu??{}}},dingtalk:{enabled:i.has("dingtalk"),dingtalk:{...s?.dingtalk??{}}},discord:{enabled:i.has("discord"),discord:{...s?.discord??{}}}}}function _(s,i){const n=[];for(const d of Object.keys(s))s[d].enabled&&n.push(d);const l={messengers:n,...Object.fromEntries(Object.entries(i).filter(([d])=>!["messengers","telegram","feishu","dingtalk","discord"].includes(d)))};return s.telegram.enabled&&s.telegram.telegram&&(l.telegram=s.telegram.telegram),s.feishu.enabled&&s.feishu.feishu&&(l.feishu=s.feishu.feishu),s.dingtalk.enabled&&s.dingtalk.dingtalk&&(l.dingtalk=s.dingtalk.dingtalk),s.discord.enabled&&s.discord.discord&&(l.discord=s.discord.discord),l}function te(){const{t:s}=C(["settings","common"]),i=O(),n=z(),[l,d]=f.useState(()=>w(i.data)),[g,x]=f.useState(!1);f.useEffect(()=>{g||i.data&&(d(w(i.data)),x(!0))},[i.data,g]);const m=i.data,t=f.useMemo(()=>m?JSON.stringify(w(m))!==JSON.stringify(l):!1,[m,l]),[r,o]=f.useState(!1),p=new Set(m?.features?.blacklistedPlatforms??[]),h=a=>p.has(a);function c(a,v){d(F=>({...F,[a]:{...F[a],...v}}))}async function k(){if(m)try{await n.mutateAsync(_(l,m)),N.success(s("messengers.savedToast")),x(!1)}catch(a){N.error(R(a,s).message)}}function D(){m&&d(w(m))}return e.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-4",children:[e.jsxs("header",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("h1",{className:"text-xl font-semibold",children:s("messengers.title")}),e.jsxs(b,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>i.refetch(),disabled:i.isFetching,"aria-label":s("actions.refresh",{ns:"common"}),children:[i.isFetching?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(W,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:s("actions.refresh",{ns:"common"})})]})]}),e.jsx("p",{className:"text-sm text-text-dim",children:s("messengers.subtitle")})]}),e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:t?e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"info",children:s("messengers.dirtyHint")}),e.jsxs(b,{type:"button",variant:"secondary",size:"sm",onClick:D,disabled:n.isPending,children:[e.jsx(A,{className:"h-4 w-4"}),s("messengers.discardAll")]}),e.jsxs(b,{type:"button",size:"sm",onClick:()=>void k(),disabled:n.isPending,children:[n.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(J,{className:"h-4 w-4"}),n.isPending?s("messengers.saving"):s("messengers.saveAll")]})]}):e.jsx("span",{className:"text-xs text-text-muted",children:s("env.noChanges")})}),i.isLoading?e.jsx("div",{className:"h-96 rounded-md bg-surface-2 animate-pulse"}):m?e.jsxs("div",{className:"flex flex-col gap-3",children:[h("wechat-ilink")?null:e.jsx(y,{slot:"wechat-ilink",label:s("messengers.platform.wechat"),hint:s("messengers.hint.wechat"),enabled:l["wechat-ilink"].enabled,onToggle:a=>c("wechat-ilink",{enabled:a}),children:e.jsxs(b,{type:"button",variant:"secondary",size:"sm",onClick:()=>o(!0),children:[e.jsx(M,{className:"h-4 w-4"}),s("messengers.scanQr")]})}),m.features?.globalIm&&!h("telegram")?e.jsxs(y,{slot:"telegram",label:s("messengers.platform.telegram"),hint:s("messengers.hint.telegram"),enabled:l.telegram.enabled,onToggle:a=>c("telegram",{enabled:a}),children:[e.jsx(u,{id:"tg-token",label:s("messengers.fields.botToken"),value:l.telegram.telegram?.botToken??"",type:"password",onChange:a=>c("telegram",{telegram:{...l.telegram.telegram,botToken:a}})}),e.jsx(u,{id:"tg-channel",label:s("messengers.fields.channelId"),value:l.telegram.telegram?.channelId??"",onChange:a=>c("telegram",{telegram:{...l.telegram.telegram,channelId:a}})})]}):null,h("feishu")?null:e.jsxs(y,{slot:"feishu",label:s("messengers.platform.feishu"),hint:s("messengers.hint.feishu"),enabled:l.feishu.enabled,onToggle:a=>c("feishu",{enabled:a}),children:[e.jsx(u,{id:"fs-appid",label:s("messengers.fields.appId"),value:l.feishu.feishu?.appId??"",onChange:a=>c("feishu",{feishu:{...l.feishu.feishu,appId:a}})}),e.jsx(u,{id:"fs-secret",label:s("messengers.fields.appSecret"),value:l.feishu.feishu?.appSecret??"",type:"password",onChange:a=>c("feishu",{feishu:{...l.feishu.feishu,appSecret:a}})}),e.jsx(u,{id:"fs-channel",label:s("messengers.fields.channelId"),value:l.feishu.feishu?.channelId??"",onChange:a=>c("feishu",{feishu:{...l.feishu.feishu,channelId:a}})})]}),h("dingtalk")?null:e.jsxs(y,{slot:"dingtalk",label:s("messengers.platform.dingtalk"),hint:s("messengers.hint.dingtalk"),enabled:l.dingtalk.enabled,onToggle:a=>c("dingtalk",{enabled:a}),children:[e.jsx(u,{id:"dt-cid",label:s("messengers.fields.clientId"),value:l.dingtalk.dingtalk?.clientId??"",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,clientId:a}})}),e.jsx(u,{id:"dt-secret",label:s("messengers.fields.clientSecret"),value:l.dingtalk.dingtalk?.clientSecret??"",type:"password",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,clientSecret:a}})}),e.jsx(u,{id:"dt-channel",label:s("messengers.fields.channelId"),value:l.dingtalk.dingtalk?.channelId??"",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,channelId:a}})}),e.jsx(j,{id:"dt-dm-policy",label:s("messengers.dingtalk.dmPolicy"),value:l.dingtalk.dingtalk?.dmPolicy??"open",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,dmPolicy:a}}),options:[{value:"open",label:s("messengers.dingtalk.policy.open")},{value:"pairing",label:s("messengers.dingtalk.policy.pairing")},{value:"allowlist",label:s("messengers.dingtalk.policy.allowlist")}]}),e.jsx(j,{id:"dt-group-policy",label:s("messengers.dingtalk.groupPolicy"),value:l.dingtalk.dingtalk?.groupPolicy??"open",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,groupPolicy:a}}),options:[{value:"open",label:s("messengers.dingtalk.policy.open")},{value:"allowlist",label:s("messengers.dingtalk.policy.allowlist")},{value:"disabled",label:s("messengers.dingtalk.policy.disabled")}]}),e.jsx(u,{id:"dt-allow-from",label:s("messengers.dingtalk.allowFrom"),value:(l.dingtalk.dingtalk?.allowFrom??[]).join(","),onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,allowFrom:a.split(",").map(v=>v.trim()).filter(Boolean)}})}),e.jsx(u,{id:"dt-group-allow-from",label:s("messengers.dingtalk.groupAllowFrom"),value:(l.dingtalk.dingtalk?.groupAllowFrom??[]).join(","),onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,groupAllowFrom:a.split(",").map(v=>v.trim()).filter(Boolean)}})}),e.jsx(j,{id:"dt-ack",label:s("messengers.dingtalk.ackReaction"),value:l.dingtalk.dingtalk?.ackReaction??"off",onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,ackReaction:a}}),options:[{value:"off",label:s("messengers.dingtalk.ack.off")},{value:"emoji",label:s("messengers.dingtalk.ack.emoji")},{value:"kaomoji",label:s("messengers.dingtalk.ack.kaomoji")}]}),e.jsx(V,{accounts:l.dingtalk.dingtalk?.accounts??{},onChange:a=>c("dingtalk",{dingtalk:{...l.dingtalk.dingtalk,accounts:a}})})]}),m.features?.globalIm&&!h("discord")?e.jsxs(y,{slot:"discord",label:s("messengers.platform.discord"),hint:s("messengers.hint.discord"),enabled:l.discord.enabled,onToggle:a=>c("discord",{enabled:a}),children:[e.jsx(u,{id:"dc-token",label:s("messengers.fields.botToken"),value:l.discord.discord?.botToken??"",type:"password",onChange:a=>c("discord",{discord:{...l.discord.discord,botToken:a}})}),e.jsx(u,{id:"dc-channel",label:s("messengers.fields.channelId"),value:l.discord.discord?.channelId??"",onChange:a=>c("discord",{discord:{...l.discord.discord,channelId:a}})})]}):null]}):null,e.jsx(U,{open:r,onOpenChange:o,onConfirmed:()=>{i.refetch(),x(!1)}})]})}function y({label:s,hint:i,enabled:n,onToggle:l,children:d}){const{t:g}=C("settings");return e.jsxs("div",{className:"rounded-md border border-border bg-surface p-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-text",children:s}),e.jsx(P,{variant:n?"success":"outline",children:g(n?"messengers.enabled":"messengers.disabled")})]}),e.jsx("p",{className:"mt-1 text-xs text-text-dim",children:i})]}),e.jsx("label",{className:"inline-flex items-center gap-2 text-sm",children:e.jsx("input",{type:"checkbox",checked:n,onChange:x=>l(x.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"})})]}),n&&d&&e.jsx("div",{className:"mt-3 flex flex-col gap-2",children:d})]})}function u({id:s,label:i,value:n,onChange:l,type:d="text"}){return e.jsxs("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-[180px_1fr] sm:items-center sm:gap-2",children:[e.jsx(T,{htmlFor:s,className:"text-xs text-text-dim",children:i}),e.jsx(S,{id:s,type:d,value:n,onChange:g=>l(g.target.value),autoComplete:"off",className:"font-mono text-xs"})]})}function j({id:s,label:i,value:n,onChange:l,options:d}){return e.jsxs("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-[180px_1fr] sm:items-center sm:gap-2",children:[e.jsx(T,{htmlFor:s,className:"text-xs text-text-dim",children:i}),e.jsx("select",{id:s,value:n,onChange:g=>l(g.target.value),className:"rounded-md border border-input bg-background px-2 py-1 text-xs",children:d.map(g=>e.jsx("option",{value:g.value,children:g.label},g.value))})]})}function U({open:s,onOpenChange:i,onConfirmed:n}){const{t:l}=C(["settings","common"]),d=L(),[g,x]=f.useState(null),[m,t]=f.useState(null),[r,o]=f.useState(null);f.useEffect(()=>{if(!s){x(null),t(null),o(null);return}let c=!0;return d.mutateAsync().then(k=>{c&&(t(k.qrImage),x(k.qrToken))}).catch(k=>{c&&o(k instanceof Error?k.message:String(k))}),()=>{c=!1}},[s]);const h=H(s?g:null).data?.status;return f.useEffect(()=>{h==="confirmed"&&(N.success(l("messengers.qr.confirmed")),n(),i(!1)),h==="expired"&&N.error(l("messengers.qr.expired"))},[h]),e.jsx(q,{open:s,onOpenChange:i,children:e.jsxs(E,{children:[e.jsxs($,{children:[e.jsx(Q,{children:l("messengers.qr.title")}),e.jsx(B,{children:l("messengers.qr.description")})]}),e.jsx("div",{className:"flex flex-col items-center gap-3",children:d.isPending&&!m?e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"h-8 w-8 animate-spin text-text-dim"}),e.jsx("p",{className:"text-sm text-text-dim",children:l("messengers.qr.starting")})]}):r?e.jsxs("p",{className:"text-sm text-danger",children:[l("messengers.qr.loadFailed"),": ",r]}):m?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:m,alt:l("messengers.qr.title"),className:"rounded-md border border-border"}),h==="expired"?e.jsx("p",{className:"text-xs text-danger",children:l("messengers.qr.expired")}):e.jsx("p",{className:"text-xs text-text-dim",children:h?`· ${h} ·`:""})]}):null})]})})}function V({accounts:s,onChange:i}){const{t:n}=C(["settings","common"]),l=Object.entries(s),d=(t,r)=>{i({...s,[t]:{...s[t],...r}})},g=t=>{const r={...s};delete r[t],i(r)},x=(t,r)=>{if(!r||r===t)return;if(s[r]){N.error(n("messengers.dingtalk.accountRenameCollision",{id:r}));return}const o={};for(const[p,h]of Object.entries(s))o[p===t?r:p]=h;i(o)},m=()=>{let t=l.length+1,r=`account-${t}`;for(;s[r];)t+=1,r=`account-${t}`;i({...s,[r]:{enabled:!0}})};return e.jsxs("div",{className:"mt-3 border-t border-input pt-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("div",{className:"text-xs font-semibold text-text-dim",children:n("messengers.dingtalk.accountsTitle")}),e.jsxs(b,{type:"button",size:"sm",variant:"outline",onClick:m,children:["+ ",n("messengers.dingtalk.addAccount")]})]}),l.length===0?e.jsx("div",{className:"text-xs text-text-dim italic",children:n("messengers.dingtalk.accountsEmpty")}):e.jsx("div",{className:"space-y-3",children:l.map(([t,r])=>e.jsxs("div",{className:"rounded-md border border-input p-2",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(S,{id:`acct-id-${t}`,defaultValue:t,onBlur:o=>x(t,o.target.value.trim()),className:"font-mono text-xs w-40",placeholder:"account-id"}),e.jsx(S,{id:`acct-name-${t}`,value:r.name??"",onChange:o=>d(t,{name:o.target.value}),className:"text-xs flex-1",placeholder:n("messengers.dingtalk.accountName")}),e.jsxs("label",{className:"flex items-center gap-1 text-xs",children:[e.jsx("input",{type:"checkbox",checked:r.enabled!==!1,onChange:o=>d(t,{enabled:o.target.checked})}),n("messengers.enabled")]}),e.jsx(b,{type:"button",size:"sm",variant:"ghost",onClick:()=>g(t),className:"text-danger",children:e.jsx(A,{className:"size-4"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(u,{id:`acct-cid-${t}`,label:n("messengers.fields.clientId"),value:r.clientId??"",onChange:o=>d(t,{clientId:o})}),e.jsx(u,{id:`acct-secret-${t}`,label:n("messengers.fields.clientSecret"),value:r.clientSecret??"",type:"password",onChange:o=>d(t,{clientSecret:o})}),e.jsx(j,{id:`acct-dm-${t}`,label:n("messengers.dingtalk.dmPolicy"),value:r.dmPolicy??"open",onChange:o=>d(t,{dmPolicy:o}),options:[{value:"open",label:n("messengers.dingtalk.policy.open")},{value:"pairing",label:n("messengers.dingtalk.policy.pairing")},{value:"allowlist",label:n("messengers.dingtalk.policy.allowlist")}]}),e.jsx(j,{id:`acct-group-${t}`,label:n("messengers.dingtalk.groupPolicy"),value:r.groupPolicy??"open",onChange:o=>d(t,{groupPolicy:o}),options:[{value:"open",label:n("messengers.dingtalk.policy.open")},{value:"allowlist",label:n("messengers.dingtalk.policy.allowlist")},{value:"disabled",label:n("messengers.dingtalk.policy.disabled")}]}),e.jsx(u,{id:`acct-allow-${t}`,label:n("messengers.dingtalk.allowFrom"),value:(r.allowFrom??[]).join(","),onChange:o=>d(t,{allowFrom:o.split(",").map(p=>p.trim()).filter(Boolean)})}),e.jsx(u,{id:`acct-gallow-${t}`,label:n("messengers.dingtalk.groupAllowFrom"),value:(r.groupAllowFrom??[]).join(","),onChange:o=>d(t,{groupAllowFrom:o.split(",").map(p=>p.trim()).filter(Boolean)})}),e.jsx(j,{id:`acct-ack-${t}`,label:n("messengers.dingtalk.ackReaction"),value:r.ackReaction??"off",onChange:o=>d(t,{ackReaction:o}),options:[{value:"off",label:n("messengers.dingtalk.ack.off")},{value:"emoji",label:n("messengers.dingtalk.ack.emoji")},{value:"kaomoji",label:n("messengers.dingtalk.ack.kaomoji")}]})]})]},t))}),e.jsx("div",{className:"mt-1 text-xs text-text-dim",children:n("messengers.dingtalk.accountsHint")})]})}export{te as default};
2
+ //# sourceMappingURL=messengers-CmW1ts2s.js.map