@geminilight/mindos 0.6.59 → 0.6.60

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 (347) hide show
  1. package/_standalone/.mindos-build-version +1 -1
  2. package/_standalone/.next/BUILD_ID +1 -1
  3. package/_standalone/.next/app-path-routes-manifest.json +20 -19
  4. package/_standalone/.next/build-manifest.json +2 -2
  5. package/_standalone/.next/cache/.previewinfo +1 -1
  6. package/_standalone/.next/cache/.rscinfo +1 -1
  7. package/_standalone/.next/cache/config.json +3 -3
  8. package/_standalone/.next/prerender-manifest.json +3 -3
  9. package/_standalone/.next/routes-manifest.json +6 -0
  10. package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  11. package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/_standalone/.next/server/app/_global-error.html +2 -2
  13. package/_standalone/.next/server/app/_global-error.rsc +1 -1
  14. package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  15. package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  16. package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  17. package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  19. package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/_standalone/.next/server/app/_not-found/page.js +1 -1
  21. package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
  24. package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  25. package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  26. package/_standalone/.next/server/app/agents/page.js +1 -1
  27. package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
  28. package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  29. package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
  30. package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
  31. package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
  32. package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
  33. package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  34. package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  35. package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  36. package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  37. package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  38. package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  39. package/_standalone/.next/server/app/api/agents/copy-skill/route.js +1 -0
  40. package/_standalone/.next/server/app/api/agents/copy-skill/route.js.nft.json +1 -0
  41. package/_standalone/.next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -0
  42. package/_standalone/.next/server/app/api/agents/custom/detect/route.js +1 -1
  43. package/_standalone/.next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
  44. package/_standalone/.next/server/app/api/agents/custom/route.js +1 -1
  45. package/_standalone/.next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
  46. package/_standalone/.next/server/app/api/ask/route.js +17 -6
  47. package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  48. package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  49. package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  50. package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  51. package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  52. package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  53. package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
  54. package/_standalone/.next/server/app/api/extract-pdf/route.js +2 -2
  55. package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  56. package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  57. package/_standalone/.next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
  58. package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
  59. package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  60. package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  61. package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  62. package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  63. package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  64. package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  65. package/_standalone/.next/server/app/api/mcp/agents/route.js +1 -1
  66. package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  67. package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  68. package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  69. package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  70. package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  71. package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
  72. package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  73. package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  74. package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  75. package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  76. package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  77. package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  78. package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  79. package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  80. package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  81. package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  82. package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  83. package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  84. package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  85. package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  86. package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  87. package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  88. package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  89. package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  90. package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  91. package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  92. package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  93. package/_standalone/.next/server/app/changes/page.js +2 -2
  94. package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
  95. package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
  96. package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
  97. package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
  98. package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  99. package/_standalone/.next/server/app/echo/page.js +1 -1
  100. package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
  101. package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
  102. package/_standalone/.next/server/app/explore/page.js +1 -1
  103. package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
  104. package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
  105. package/_standalone/.next/server/app/help/page.js +1 -1
  106. package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
  107. package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  108. package/_standalone/.next/server/app/inbox/history/page.js +1 -1
  109. package/_standalone/.next/server/app/inbox/history/page.js.nft.json +1 -1
  110. package/_standalone/.next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
  111. package/_standalone/.next/server/app/login/page.js +1 -1
  112. package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
  113. package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  114. package/_standalone/.next/server/app/page.js +1 -1
  115. package/_standalone/.next/server/app/page.js.nft.json +1 -1
  116. package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  117. package/_standalone/.next/server/app/setup/page.js +1 -1
  118. package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
  119. package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  120. package/_standalone/.next/server/app/trash/page.js +3 -3
  121. package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
  122. package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
  123. package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
  124. package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  125. package/_standalone/.next/server/app/wiki/page.js +1 -1
  126. package/_standalone/.next/server/app/wiki/page.js.nft.json +1 -1
  127. package/_standalone/.next/server/app/wiki/page_client-reference-manifest.js +1 -1
  128. package/_standalone/.next/server/app-paths-manifest.json +20 -19
  129. package/_standalone/.next/server/chunks/1550.js +1 -1
  130. package/_standalone/.next/server/chunks/3484.js +1 -1
  131. package/_standalone/.next/server/chunks/530.js +35 -35
  132. package/_standalone/.next/server/chunks/{8343.js → 9753.js} +2 -2
  133. package/_standalone/.next/server/pages/500.html +2 -2
  134. package/_standalone/.next/server/server-reference-manifest.js +1 -1
  135. package/_standalone/.next/server/server-reference-manifest.json +1 -1
  136. package/_standalone/.next/static/K3wZNf5bj_AFYwtqcRXIf/_buildManifest.js +1 -0
  137. package/_standalone/.next/static/chunks/1369-7d0ac5d1564eed1e.js +1 -0
  138. package/_standalone/.next/static/chunks/{5581-dac72e9f16e5ea29.js → 5581-974dfb26d1d1b38f.js} +2 -2
  139. package/_standalone/.next/static/chunks/7249-b0a9c77b9a84b11c.js +11 -0
  140. package/_standalone/.next/static/chunks/7637-904b0a381dc3ec02.js +1 -0
  141. package/_standalone/.next/static/chunks/8520-76d1b05072178b43.js +22 -0
  142. package/_standalone/.next/static/chunks/9186-ead47513192f658b.js +1 -0
  143. package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/{route-2f4705aa66819b86.js → route-2ceea6eabf25b1f2.js} +1 -1
  144. package/_standalone/.next/static/chunks/app/_global-error/{page-2f4705aa66819b86.js → page-2ceea6eabf25b1f2.js} +1 -1
  145. package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-0ea3571c8fbae823.js +1 -0
  146. package/_standalone/.next/static/chunks/app/agents/{page-b172ea3743adb047.js → page-66858acbcd1d4bf8.js} +1 -1
  147. package/_standalone/.next/static/chunks/app/api/a2a/agents/{route-2f4705aa66819b86.js → route-2ceea6eabf25b1f2.js} +1 -1
  148. package/_standalone/.next/static/chunks/app/api/a2a/delegations/{route-2f4705aa66819b86.js → route-2ceea6eabf25b1f2.js} +1 -1
  149. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-2ceea6eabf25b1f2.js +1 -0
  150. package/_standalone/.next/static/chunks/app/api/a2a/route-2ceea6eabf25b1f2.js +1 -0
  151. package/_standalone/.next/static/chunks/app/api/acp/config/route-2ceea6eabf25b1f2.js +1 -0
  152. package/_standalone/.next/static/chunks/app/api/acp/detect/route-2ceea6eabf25b1f2.js +1 -0
  153. package/_standalone/.next/static/chunks/app/api/acp/install/route-2ceea6eabf25b1f2.js +1 -0
  154. package/_standalone/.next/static/chunks/app/api/acp/registry/route-2ceea6eabf25b1f2.js +1 -0
  155. package/_standalone/.next/static/chunks/app/api/acp/session/route-2ceea6eabf25b1f2.js +1 -0
  156. package/_standalone/.next/static/chunks/app/api/agent-activity/route-2ceea6eabf25b1f2.js +1 -0
  157. package/_standalone/.next/static/chunks/app/api/agents/copy-skill/route-2ceea6eabf25b1f2.js +1 -0
  158. package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-2ceea6eabf25b1f2.js +1 -0
  159. package/_standalone/.next/static/chunks/app/api/agents/custom/route-2ceea6eabf25b1f2.js +1 -0
  160. package/_standalone/.next/static/chunks/app/api/ask/route-2ceea6eabf25b1f2.js +1 -0
  161. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-2ceea6eabf25b1f2.js +1 -0
  162. package/_standalone/.next/static/chunks/app/api/auth/route-2ceea6eabf25b1f2.js +1 -0
  163. package/_standalone/.next/static/chunks/app/api/backlinks/route-2ceea6eabf25b1f2.js +1 -0
  164. package/_standalone/.next/static/chunks/app/api/bootstrap/route-2ceea6eabf25b1f2.js +1 -0
  165. package/_standalone/.next/static/chunks/app/api/changes/route-2ceea6eabf25b1f2.js +1 -0
  166. package/_standalone/.next/static/chunks/app/api/export/route-2ceea6eabf25b1f2.js +1 -0
  167. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-2ceea6eabf25b1f2.js +1 -0
  168. package/_standalone/.next/static/chunks/app/api/file/import/route-2ceea6eabf25b1f2.js +1 -0
  169. package/_standalone/.next/static/chunks/app/api/file/raw/route-2ceea6eabf25b1f2.js +1 -0
  170. package/_standalone/.next/static/chunks/app/api/file/route-2ceea6eabf25b1f2.js +1 -0
  171. package/_standalone/.next/static/chunks/app/api/files/route-2ceea6eabf25b1f2.js +1 -0
  172. package/_standalone/.next/static/chunks/app/api/git/route-2ceea6eabf25b1f2.js +1 -0
  173. package/_standalone/.next/static/chunks/app/api/graph/route-2ceea6eabf25b1f2.js +1 -0
  174. package/_standalone/.next/static/chunks/app/api/health/route-2ceea6eabf25b1f2.js +1 -0
  175. package/_standalone/.next/static/chunks/app/api/inbox/route-2ceea6eabf25b1f2.js +1 -0
  176. package/_standalone/.next/static/chunks/app/api/init/route-2ceea6eabf25b1f2.js +1 -0
  177. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-2ceea6eabf25b1f2.js +1 -0
  178. package/_standalone/.next/static/chunks/app/api/mcp/install/route-2ceea6eabf25b1f2.js +1 -0
  179. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-2ceea6eabf25b1f2.js +1 -0
  180. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-2ceea6eabf25b1f2.js +1 -0
  181. package/_standalone/.next/static/chunks/app/api/mcp/status/route-2ceea6eabf25b1f2.js +1 -0
  182. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-2ceea6eabf25b1f2.js +1 -0
  183. package/_standalone/.next/static/chunks/app/api/monitoring/route-2ceea6eabf25b1f2.js +1 -0
  184. package/_standalone/.next/static/chunks/app/api/recent-files/route-2ceea6eabf25b1f2.js +1 -0
  185. package/_standalone/.next/static/chunks/app/api/restart/route-2ceea6eabf25b1f2.js +1 -0
  186. package/_standalone/.next/static/chunks/app/api/search/route-2ceea6eabf25b1f2.js +1 -0
  187. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-2ceea6eabf25b1f2.js +1 -0
  188. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-2ceea6eabf25b1f2.js +1 -0
  189. package/_standalone/.next/static/chunks/app/api/settings/route-2ceea6eabf25b1f2.js +1 -0
  190. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-2ceea6eabf25b1f2.js +1 -0
  191. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-2ceea6eabf25b1f2.js +1 -0
  192. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-2ceea6eabf25b1f2.js +1 -0
  193. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-2ceea6eabf25b1f2.js +1 -0
  194. package/_standalone/.next/static/chunks/app/api/setup/ls/route-2ceea6eabf25b1f2.js +1 -0
  195. package/_standalone/.next/static/chunks/app/api/setup/route-2ceea6eabf25b1f2.js +1 -0
  196. package/_standalone/.next/static/chunks/app/api/skills/route-2ceea6eabf25b1f2.js +1 -0
  197. package/_standalone/.next/static/chunks/app/api/sync/route-2ceea6eabf25b1f2.js +1 -0
  198. package/_standalone/.next/static/chunks/app/api/tree-version/route-2ceea6eabf25b1f2.js +1 -0
  199. package/_standalone/.next/static/chunks/app/api/uninstall/route-2ceea6eabf25b1f2.js +1 -0
  200. package/_standalone/.next/static/chunks/app/api/update/route-2ceea6eabf25b1f2.js +1 -0
  201. package/_standalone/.next/static/chunks/app/api/update-check/route-2ceea6eabf25b1f2.js +1 -0
  202. package/_standalone/.next/static/chunks/app/api/update-status/route-2ceea6eabf25b1f2.js +1 -0
  203. package/_standalone/.next/static/chunks/app/api/workflows/route-2ceea6eabf25b1f2.js +1 -0
  204. package/_standalone/.next/static/chunks/app/changes/page-dd0b00a7b81f74e2.js +1 -0
  205. package/_standalone/.next/static/chunks/app/echo/[segment]/{page-84b95256f6e38aae.js → page-bf5c290fa3ccff09.js} +1 -1
  206. package/_standalone/.next/static/chunks/app/echo/page-2ceea6eabf25b1f2.js +1 -0
  207. package/_standalone/.next/static/chunks/app/inbox/history/{page-26e71fb6f716a4c4.js → page-3279585360df132c.js} +1 -1
  208. package/_standalone/.next/static/chunks/app/{layout-b89b0d955f39a753.js → layout-6a0169582db11a08.js} +24 -24
  209. package/_standalone/.next/static/chunks/app/loading-2ceea6eabf25b1f2.js +1 -0
  210. package/_standalone/.next/static/chunks/app/{page-a8e6f085f38388bf.js → page-6a1f8d21c12b829e.js} +1 -1
  211. package/_standalone/.next/static/chunks/app/trash/page-ed7ba3b0b50223a6.js +1 -0
  212. package/_standalone/.next/static/chunks/app/view/[...path]/loading-2ceea6eabf25b1f2.js +1 -0
  213. package/_standalone/.next/static/chunks/app/view/[...path]/page-678139779971cfcb.js +12 -0
  214. package/_standalone/.next/static/chunks/app/wiki/page-194ae9af2d461481.js +1 -0
  215. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-2ceea6eabf25b1f2.js +1 -0
  216. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-2ceea6eabf25b1f2.js +1 -0
  217. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-2ceea6eabf25b1f2.js +1 -0
  218. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2ceea6eabf25b1f2.js +1 -0
  219. package/_standalone/.next/static/css/9c558c42831fae58.css +1 -0
  220. package/_standalone/.next/trace +65 -64
  221. package/_standalone/.next/types/routes.d.ts +2 -1
  222. package/_standalone/.next/types/validator.ts +9 -0
  223. package/_standalone/__tests__/api/mcp-install.test.ts +4 -2
  224. package/_standalone/components/AskFab.tsx +7 -1
  225. package/_standalone/components/FileTree.tsx +83 -1
  226. package/_standalone/components/Panel.tsx +6 -1
  227. package/_standalone/components/agents/AgentsOverviewSection.tsx +13 -11
  228. package/_standalone/components/agents/CustomAgentModal.tsx +72 -18
  229. package/_standalone/components/ask/AskContent.tsx +19 -3
  230. package/_standalone/components/ask/FileChip.tsx +93 -12
  231. package/_standalone/components/changes/ChangesBanner.tsx +1 -1
  232. package/_standalone/components/walkthrough/WalkthroughTooltip.tsx +3 -1
  233. package/_standalone/components/walkthrough/steps.ts +1 -1
  234. package/_standalone/hooks/useAskChat.ts +10 -8
  235. package/_standalone/hooks/useFileUpload.ts +97 -43
  236. package/_standalone/hooks/useImageUpload.ts +1 -1
  237. package/_standalone/lib/inbox-upload.ts +86 -0
  238. package/_standalone/package-lock.json +2 -2
  239. package/_standalone/package.json +1 -1
  240. package/_standalone/scripts/extract-pdf.cjs +110 -3
  241. package/_standalone/tsconfig.tsbuildinfo +1 -1
  242. package/app/app/api/agents/copy-skill/route.ts +110 -0
  243. package/app/app/api/agents/custom/detect/route.ts +16 -1
  244. package/app/app/api/ask/route.ts +7 -1
  245. package/app/app/api/extract-pdf/route.ts +12 -5
  246. package/app/app/api/mcp/agents/route.ts +64 -2
  247. package/app/components/AskFab.tsx +7 -1
  248. package/app/components/FileTree.tsx +83 -1
  249. package/app/components/HomeContent.tsx +14 -6
  250. package/app/components/Panel.tsx +6 -1
  251. package/app/components/agents/AgentDetailContent.tsx +58 -1
  252. package/app/components/agents/AgentsOverviewSection.tsx +13 -11
  253. package/app/components/agents/CustomAgentModal.tsx +72 -18
  254. package/app/components/ask/AskContent.tsx +19 -3
  255. package/app/components/ask/FileChip.tsx +93 -12
  256. package/app/components/changes/ChangesBanner.tsx +1 -1
  257. package/app/components/changes/ChangesContentPage.tsx +368 -168
  258. package/app/components/walkthrough/WalkthroughTooltip.tsx +3 -1
  259. package/app/components/walkthrough/steps.ts +1 -1
  260. package/app/hooks/useAskChat.ts +10 -8
  261. package/app/hooks/useFileUpload.ts +97 -43
  262. package/app/hooks/useImageUpload.ts +1 -1
  263. package/app/lib/agent/prompt.ts +15 -4
  264. package/app/lib/custom-agents.ts +109 -1
  265. package/app/lib/file-ops.ts +58 -0
  266. package/app/lib/i18n/modules/ai-chat.ts +37 -0
  267. package/app/lib/i18n/modules/knowledge.ts +2 -0
  268. package/app/lib/inbox-upload.ts +86 -0
  269. package/app/lib/mcp-agents.ts +21 -1
  270. package/app/lib/types.ts +12 -0
  271. package/app/package.json +1 -1
  272. package/app/scripts/extract-pdf.cjs +110 -3
  273. package/package.json +1 -1
  274. package/_standalone/.next/static/chunks/4237-ffc6e7c15d4007b6.js +0 -1
  275. package/_standalone/.next/static/chunks/6878-e2c5459e1c608f89.js +0 -1
  276. package/_standalone/.next/static/chunks/7249-6cf8f2b78718c59e.js +0 -11
  277. package/_standalone/.next/static/chunks/8520-56ec9ff087c15204.js +0 -22
  278. package/_standalone/.next/static/chunks/9286-5b09baa5200318c2.js +0 -1
  279. package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-35ea6de1af2be3b5.js +0 -1
  280. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-2f4705aa66819b86.js +0 -1
  281. package/_standalone/.next/static/chunks/app/api/a2a/route-2f4705aa66819b86.js +0 -1
  282. package/_standalone/.next/static/chunks/app/api/acp/config/route-2f4705aa66819b86.js +0 -1
  283. package/_standalone/.next/static/chunks/app/api/acp/detect/route-2f4705aa66819b86.js +0 -1
  284. package/_standalone/.next/static/chunks/app/api/acp/install/route-2f4705aa66819b86.js +0 -1
  285. package/_standalone/.next/static/chunks/app/api/acp/registry/route-2f4705aa66819b86.js +0 -1
  286. package/_standalone/.next/static/chunks/app/api/acp/session/route-2f4705aa66819b86.js +0 -1
  287. package/_standalone/.next/static/chunks/app/api/agent-activity/route-2f4705aa66819b86.js +0 -1
  288. package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-2f4705aa66819b86.js +0 -1
  289. package/_standalone/.next/static/chunks/app/api/agents/custom/route-2f4705aa66819b86.js +0 -1
  290. package/_standalone/.next/static/chunks/app/api/ask/route-2f4705aa66819b86.js +0 -1
  291. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-2f4705aa66819b86.js +0 -1
  292. package/_standalone/.next/static/chunks/app/api/auth/route-2f4705aa66819b86.js +0 -1
  293. package/_standalone/.next/static/chunks/app/api/backlinks/route-2f4705aa66819b86.js +0 -1
  294. package/_standalone/.next/static/chunks/app/api/bootstrap/route-2f4705aa66819b86.js +0 -1
  295. package/_standalone/.next/static/chunks/app/api/changes/route-2f4705aa66819b86.js +0 -1
  296. package/_standalone/.next/static/chunks/app/api/export/route-2f4705aa66819b86.js +0 -1
  297. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-2f4705aa66819b86.js +0 -1
  298. package/_standalone/.next/static/chunks/app/api/file/import/route-2f4705aa66819b86.js +0 -1
  299. package/_standalone/.next/static/chunks/app/api/file/raw/route-2f4705aa66819b86.js +0 -1
  300. package/_standalone/.next/static/chunks/app/api/file/route-2f4705aa66819b86.js +0 -1
  301. package/_standalone/.next/static/chunks/app/api/files/route-2f4705aa66819b86.js +0 -1
  302. package/_standalone/.next/static/chunks/app/api/git/route-2f4705aa66819b86.js +0 -1
  303. package/_standalone/.next/static/chunks/app/api/graph/route-2f4705aa66819b86.js +0 -1
  304. package/_standalone/.next/static/chunks/app/api/health/route-2f4705aa66819b86.js +0 -1
  305. package/_standalone/.next/static/chunks/app/api/inbox/route-2f4705aa66819b86.js +0 -1
  306. package/_standalone/.next/static/chunks/app/api/init/route-2f4705aa66819b86.js +0 -1
  307. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-2f4705aa66819b86.js +0 -1
  308. package/_standalone/.next/static/chunks/app/api/mcp/install/route-2f4705aa66819b86.js +0 -1
  309. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-2f4705aa66819b86.js +0 -1
  310. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-2f4705aa66819b86.js +0 -1
  311. package/_standalone/.next/static/chunks/app/api/mcp/status/route-2f4705aa66819b86.js +0 -1
  312. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-2f4705aa66819b86.js +0 -1
  313. package/_standalone/.next/static/chunks/app/api/monitoring/route-2f4705aa66819b86.js +0 -1
  314. package/_standalone/.next/static/chunks/app/api/recent-files/route-2f4705aa66819b86.js +0 -1
  315. package/_standalone/.next/static/chunks/app/api/restart/route-2f4705aa66819b86.js +0 -1
  316. package/_standalone/.next/static/chunks/app/api/search/route-2f4705aa66819b86.js +0 -1
  317. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-2f4705aa66819b86.js +0 -1
  318. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-2f4705aa66819b86.js +0 -1
  319. package/_standalone/.next/static/chunks/app/api/settings/route-2f4705aa66819b86.js +0 -1
  320. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-2f4705aa66819b86.js +0 -1
  321. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-2f4705aa66819b86.js +0 -1
  322. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-2f4705aa66819b86.js +0 -1
  323. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-2f4705aa66819b86.js +0 -1
  324. package/_standalone/.next/static/chunks/app/api/setup/ls/route-2f4705aa66819b86.js +0 -1
  325. package/_standalone/.next/static/chunks/app/api/setup/route-2f4705aa66819b86.js +0 -1
  326. package/_standalone/.next/static/chunks/app/api/skills/route-2f4705aa66819b86.js +0 -1
  327. package/_standalone/.next/static/chunks/app/api/sync/route-2f4705aa66819b86.js +0 -1
  328. package/_standalone/.next/static/chunks/app/api/tree-version/route-2f4705aa66819b86.js +0 -1
  329. package/_standalone/.next/static/chunks/app/api/uninstall/route-2f4705aa66819b86.js +0 -1
  330. package/_standalone/.next/static/chunks/app/api/update/route-2f4705aa66819b86.js +0 -1
  331. package/_standalone/.next/static/chunks/app/api/update-check/route-2f4705aa66819b86.js +0 -1
  332. package/_standalone/.next/static/chunks/app/api/update-status/route-2f4705aa66819b86.js +0 -1
  333. package/_standalone/.next/static/chunks/app/api/workflows/route-2f4705aa66819b86.js +0 -1
  334. package/_standalone/.next/static/chunks/app/changes/page-6d2f49651c0061f7.js +0 -1
  335. package/_standalone/.next/static/chunks/app/echo/page-2f4705aa66819b86.js +0 -1
  336. package/_standalone/.next/static/chunks/app/loading-2f4705aa66819b86.js +0 -1
  337. package/_standalone/.next/static/chunks/app/trash/page-f92b728b78ac0f7e.js +0 -1
  338. package/_standalone/.next/static/chunks/app/view/[...path]/loading-2f4705aa66819b86.js +0 -1
  339. package/_standalone/.next/static/chunks/app/view/[...path]/page-f87f4901b5e1a88f.js +0 -12
  340. package/_standalone/.next/static/chunks/app/wiki/page-641edb1f3cff2f93.js +0 -1
  341. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-2f4705aa66819b86.js +0 -1
  342. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-2f4705aa66819b86.js +0 -1
  343. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-2f4705aa66819b86.js +0 -1
  344. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2f4705aa66819b86.js +0 -1
  345. package/_standalone/.next/static/css/6c104b118d3bc9b7.css +0 -1
  346. package/_standalone/.next/static/u8p6oIRTcr_ns-ElNZ9rl/_buildManifest.js +0 -1
  347. /package/_standalone/.next/static/{u8p6oIRTcr_ns-ElNZ9rl → K3wZNf5bj_AFYwtqcRXIf}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9336],{21362:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},22356:(e,t,r)=>{"use strict";r.d(t,{h:()=>s,n:()=>n});class s extends Error{constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.code=r}}async function n(e,t={}){let r,a,l,{timeout:o=3e4,signal:i,...d}=t;if((o>0||i)&&(r=new AbortController),o>0&&r&&(a=setTimeout(()=>{r.abort(Error(`Request timed out after ${Math.round(o/1e3)}s`))},o)),i&&r)if(i.aborted)r.abort();else{let e=()=>r?.abort();i.addEventListener("abort",e,{once:!0}),l=()=>{i.removeEventListener("abort",e)}}let c=r?.signal??i;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,r=`Request failed (${t.status})`;try{let s=await t.json();s?.error?.code&&s?.error?.message?(r=s.error.message,e=s.error.code):s?.error&&(r="string"==typeof s.error?s.error:s.error.message??r)}catch{}throw new s(r,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),l&&l()}}},27996:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(95155),n=r(12115),a=r(47650),l=r(94514),o=r(66088);function i(e){return"options"in e}function d({value:e,onChange:t,options:r,className:d="",size:c="md",placeholder:u}){let[m,x]=(0,n.useState)(!1),[p,h]=(0,n.useState)(-1),[f,g]=(0,n.useState)(null),b=(0,n.useRef)(null),v=(0,n.useRef)(null),y=(0,n.useMemo)(()=>(function(e){let t=[];for(let r of e)i(r)?t.push(...r.options):t.push(r);return t})(r),[r]),j=(0,n.useMemo)(()=>y.find(t=>t.value===e)??null,[y,e]),w=(0,n.useCallback)(()=>{x(!1),h(-1)},[]),N=(0,n.useCallback)(e=>{t(e),w()},[t,w]);(0,n.useEffect)(()=>{if(!m)return;let e=e=>{b.current&&!b.current.contains(e.target)&&v.current&&!v.current.contains(e.target)&&w()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m,w]),(0,n.useEffect)(()=>{if(!m)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),w(),b.current?.focus();break;case"ArrowDown":e.preventDefault(),h(e=>Math.min(e+1,y.length-1));break;case"ArrowUp":e.preventDefault(),h(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),p>=0&&p<y.length&&(N(y[p].value),b.current?.focus())}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m,w,p,y,N]),(0,n.useEffect)(()=>{if(!m||!v.current||p<0)return;let e=v.current.querySelector(`[data-idx="${p}"]`);e&&e.scrollIntoView({block:"nearest"})},[m,p]);let k=(0,n.useCallback)(()=>{if(!b.current)return;let e=b.current.getBoundingClientRect(),t="sm"===c?200:260,r=window.innerHeight-e.bottom,s=e.top;g({top:r<t+8&&s>r?e.top:e.bottom,left:e.left,width:e.width,flipUp:r<t+8&&s>r})},[c]);(0,n.useEffect)(()=>{if(!m)return void g(null);let t=y.findIndex(t=>t.value===e);return h(t>=0?t:0),k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[m,y,e,k]);let C="sm"===c,A=C?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${d}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${d}`,E=C?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",M=-1;function S(t){let r=++M,n=t.value===e,a=r===p;return(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":n,"data-idx":r,onClick:()=>N(t.value),onMouseEnter:()=>h(r),className:`${E} ${a?"bg-muted text-foreground":"text-foreground"}`,children:[t.icon,(0,s.jsx)("span",{className:"flex-1 truncate",children:t.label}),t.suffix,n&&(0,s.jsx)(l.A,{size:C?10:12,className:"shrink-0 text-[var(--amber)]"})]},t.value)}let $=m&&f&&(0,a.createPortal)((0,s.jsx)("div",{ref:v,className:C?"fixed z-[9999] overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-[9999] overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:f.left,minWidth:f.width,maxHeight:C?200:260,...f.flipUp?{bottom:window.innerHeight-f.top+4}:{top:f.top+4}},children:r.map((e,t)=>i(e)?(0,s.jsxs)("div",{children:[t>0&&(0,s.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,s.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${C?"px-2":"px-3"}`,children:e.label}),e.options.map(S)]},e.label):S(e))}),document.body);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{ref:b,type:"button",onClick:()=>x(e=>!e),"aria-haspopup":"listbox","aria-expanded":m,className:A,children:[j?.icon,(0,s.jsx)("span",{className:"flex-1 truncate text-left",children:j?.label??u??"—"}),j?.suffix,(0,s.jsx)(o.A,{size:C?12:14,className:`${C?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),$]})}},50538:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},87180:(e,t,r)=>{"use strict";r.d(t,{default:()=>h});var s=r(95155),n=r(12115),a=r(98500),l=r.n(a),o=r(50538),i=r(91958),d=r(66088),c=r(21362),u=r(22356),m=r(35581),x=r(27996),p=r(97631);function h({initialPath:e=""}){let{t}=(0,m.Y)(),[r,a]=(0,n.useState)(e),[h,f]=(0,n.useState)("all"),[g,b]=(0,n.useState)("all"),[v,y]=(0,n.useState)(""),[j,w]=(0,n.useState)([]),[N,k]=(0,n.useState)({unreadCount:0,totalCount:0}),[C,A]=(0,n.useState)({}),[E,M]=(0,n.useState)(!0),[S,$]=(0,n.useState)(null),L=(0,n.useCallback)(async()=>{M(!0),$(null);try{let e=new URLSearchParams({op:"list",limit:"120"});r.trim()&&e.set("path",r.trim()),"all"!==h&&e.set("source",h),"all"!==g&&e.set("event_op",g),v.trim()&&e.set("q",v.trim());let t=`/api/changes?${e.toString()}`,[s,n]=await Promise.all([(0,u.n)(t),(0,u.n)("/api/changes?op=summary")]);w(s.events),k(n)}catch(e){$(e instanceof Error?e.message:"Failed to load changes")}finally{M(!1)}},[r,h,g,v]);(0,n.useEffect)(()=>{L()},[L]);let z=(0,n.useCallback)(async()=>{await (0,u.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})}),await L()},[L]),P=(0,n.useMemo)(()=>t.changes.eventsCount(j.length),[j.length,t]),q=(0,n.useMemo)(()=>{let e=Array.from(new Set(j.map(e=>e.op))).sort((e,t)=>e.localeCompare(t));return"all"===g||e.includes(g)||e.unshift(g),["all",...e]},[j,g]),T=(0,n.useMemo)(()=>[{value:"all",label:t.changes.filters.all},{value:"agent",label:t.changes.filters.agent},{value:"user",label:t.changes.filters.user},{value:"system",label:t.changes.filters.system}],[t]),_=(0,n.useMemo)(()=>q.map(e=>({value:e,label:"all"===e?t.changes.filters.operationAll:e})),[q,t]),R=(0,n.useCallback)(e=>"agent"===e?t.changes.filters.agent:"user"===e?t.changes.filters.user:t.changes.filters.system,[t]),D=(0,n.useCallback)(e=>t.changes.operations?.[e]??e,[t]);return(0,s.jsxs)("div",{className:"min-h-screen",children:[(0,s.jsx)("div",{className:"px-4 md:px-6 pt-6 md:pt-8",children:(0,s.jsx)("div",{className:"content-width xl:mr-[220px] rounded-xl border border-border bg-card px-4 py-3 md:px-5 md:py-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,s.jsx)(o.A,{size:15}),t.changes.title]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t.changes.subtitle}),(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:P}),(0,s.jsx)("span",{className:"rounded-full bg-[var(--amber-dim)] px-2 py-0.5 text-[var(--amber)]",children:t.changes.unreadCount(N.unreadCount)})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>void L(),className:"px-2.5 py-1.5 rounded-md text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,s.jsx)(i.A,{size:12})," ",t.changes.refresh]})}),(0,s.jsx)("button",{type:"button",onClick:()=>void z(),className:"px-2.5 py-1.5 rounded-md text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:t.changes.markAllRead})]})]})})}),(0,s.jsx)("div",{className:"px-4 md:px-6 py-4 md:py-6",children:(0,s.jsxs)("div",{className:"content-width xl:mr-[220px] space-y-3",children:[(0,s.jsx)("div",{className:"rounded-lg border border-border bg-card p-3",children:(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2.5",children:[(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t.changes.filters.filePath}),(0,s.jsx)("input",{value:r,onChange:e=>a(e.target.value),placeholder:t.changes.filters.filePathPlaceholder,className:"mt-1 w-full px-2.5 py-1.5 text-sm bg-background border border-border rounded-lg text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring"})]}),(0,s.jsxs)("div",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t.changes.filters.source}),(0,s.jsx)(x.A,{value:h,onChange:e=>f(e),options:T,className:"mt-1"})]}),(0,s.jsxs)("div",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t.changes.filters.operation}),(0,s.jsx)(x.A,{value:g,onChange:b,options:_,className:"mt-1"})]}),(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t.changes.filters.keyword}),(0,s.jsx)("input",{value:v,onChange:e=>y(e.target.value),placeholder:t.changes.filters.keywordPlaceholder,className:"mt-1 w-full px-2.5 py-1.5 text-sm bg-background border border-border rounded-lg text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring"})]})]})}),E&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t.changes.loading}),S&&(0,s.jsx)("p",{className:"text-sm text-error",children:S}),!E&&!S&&0===j.length&&(0,s.jsx)("div",{className:"rounded-lg border border-border bg-card p-6 text-center text-sm text-muted-foreground",children:t.changes.empty}),!E&&!S&&j.map(e=>{var r;let n,a,o=!!C[e.id],i=(0,p.m)(e.before??"",e.after??""),u=(0,p.S)(i),m=i.filter(e=>"insert"===e.type).length,x=i.filter(e=>"delete"===e.type).length;return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[(0,s.jsx)("button",{type:"button",onClick:()=>A(t=>({...t,[e.id]:!t[e.id]})),className:"w-full px-3 py-3 text-left hover:bg-muted/30 focus-visible:ring-2 focus-visible:ring-ring",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"pt-0.5 text-muted-foreground",children:o?(0,s.jsx)(d.A,{size:14}):(0,s.jsx)(c.A,{size:14})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-foreground font-display",children:e.summary}),(m>0||x>0)&&(0,s.jsxs)("span",{className:"text-xs font-mono text-muted-foreground",children:[m>0&&(0,s.jsxs)("span",{className:"text-success",children:["+",m]}),m>0&&x>0&&" ",x>0&&(0,s.jsxs)("span",{className:"text-error",children:["-",x]})]})]}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"rounded-md px-2 py-0.5 font-medium",style:{background:"color-mix(in srgb, var(--amber) 16%, var(--muted))",color:"var(--foreground)",border:"1px solid color-mix(in srgb, var(--amber) 36%, var(--border))"},children:e.path}),(0,s.jsx)("span",{className:(r=e.op).startsWith("create")||"import_file"===r?"text-success":r.startsWith("delete")?"text-error":r.startsWith("rename")||r.startsWith("move")?"text-muted-foreground":"",children:D(e.op)}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("span",{children:R(e.source)}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("span",{children:function(e,t){let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<1)return t.changes.relativeTime.justNow;if(r<60)return t.changes.relativeTime.minutesAgo(r);let s=Math.floor(r/60);return s<24?t.changes.relativeTime.hoursAgo(s):t.changes.relativeTime.daysAgo(Math.floor(s/24))}(e.ts,t)})]})]}),(0,s.jsx)(l(),{href:`/view/${e.path.split("/").map(encodeURIComponent).join("/")}`,className:"inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] focus-visible:ring-2 focus-visible:ring-ring hover:opacity-90",onClick:e=>e.stopPropagation(),children:t.changes.open})]})}),o&&(n=1,a=1,(0,s.jsx)("div",{className:"border-t border-border bg-background/70 max-h-80 overflow-y-auto",children:u.map((r,l)=>{if("gap"===r.type)return n+=r.count,a+=r.count,(0,s.jsx)("div",{className:"px-3 py-1 text-2xs text-muted-foreground/60 border-y border-border/30 bg-muted/20 text-center",children:t.changes.unchangedLines(r.count)},`${e.id}-gap-${l}`);let o="insert"===r.type?"+":"delete"===r.type?"-":" ",i="insert"!==r.type?n:"",d="delete"!==r.type?a:"";return"insert"!==r.type&&n++,"delete"!==r.type&&a++,(0,s.jsxs)("div",{className:`flex items-start text-xs font-mono ${"insert"===r.type?"bg-success/8":"delete"===r.type?"bg-error/8":""}`,children:[(0,s.jsx)("span",{className:"w-8 shrink-0 text-right pr-1 select-none text-muted-foreground/40 text-2xs leading-5",children:i}),(0,s.jsx)("span",{className:"w-8 shrink-0 text-right pr-1 select-none text-muted-foreground/40 text-2xs leading-5",children:d}),(0,s.jsx)("span",{className:`w-3 shrink-0 text-center select-none leading-5 ${"insert"===r.type?"text-success":"delete"===r.type?"text-error":"text-muted-foreground/30"}`,children:o}),(0,s.jsx)("span",{className:`px-1 py-0.5 whitespace-pre-wrap break-all flex-1 ${"insert"===r.type?"text-success":"delete"===r.type?"text-error":"text-muted-foreground"}`,children:r.text||"\xa0"})]},`${e.id}-${l}`)})}))]},e.id)})]})})]})}},91958:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},97631:(e,t,r)=>{"use strict";function s(e,t){let r=e.split("\n"),s=t.split("\n"),n=r.length,a=s.length,l=Array.from({length:n+1},()=>Array(a+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=a-1;t>=0;t--)l[e][t]=r[e]===s[t]?1+l[e+1][t+1]:Math.max(l[e+1][t],l[e][t+1]);let o=[],i=0,d=0;for(;i<n||d<a;){if(i<n&&d<a&&r[i]===s[d]){o.push({type:"equal",text:r[i]}),i+=1,d+=1;continue}if(d<a&&(i>=n||l[i][d+1]>=l[i+1][d])){o.push({type:"insert",text:s[d]}),d+=1;continue}o.push({type:"delete",text:r[i]}),i+=1}return o}function n(e,t=2){let r=new Set;e.forEach((s,n)=>{if("equal"!==s.type)for(let s=Math.max(0,n-t);s<=Math.min(e.length-1,n+t);s++)r.add(s)});let s=[],a=-1;for(let t=0;t<e.length;t++){if(r.has(t)){-1!==a&&(s.push({type:"gap",count:t-a}),a=-1),s.push(e[t]);continue}-1===a&&(a=t)}return -1!==a&&s.push({type:"gap",count:e.length-a}),s}r.d(t,{S:()=>n,m:()=>s})},98330:(e,t,r)=>{Promise.resolve().then(r.bind(r,87180))}},e=>{e.O(0,[4237,5581,8441,3794,7358],()=>e(e.s=98330)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1227],{1934:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});var s=r(12115);let a=e=>{let t,r=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,l={setState:s,getState:a,getInitialState:()=>i,subscribe:e=>(r.add(e),()=>r.delete(e))},i=t=e(s,a,l);return l},l=e=>{let t=e?a(e):a,r=e=>(function(e,t=e=>e){let r=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},i=e=>e?l(e):l},6296:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9199:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},9339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={callServer:function(){return l.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let l=r(77304),i=r(4060),n=r(77197)},31806:(e,t,r)=>{"use strict";r.d(t,{default:()=>j});var s=r(95155),a=r(12115),l=r(68459),i=r(38798),n=r(33078),d=r(48368),c=r(41585),o=r(6296),u=r(9199),m=r(33210),h=r(73321),x=r(35581),f=r(9339);let p=(0,f.createServerReference)("6099aeef0ea0986634a1692974c32cf406a07d5bec",f.callServer,void 0,f.findSourceMapURL,"restoreFromTrashAction"),b=(0,f.createServerReference)("40a0adbb5b837e5ccc1bd44d76b4644d662aee8e6c",f.callServer,void 0,f.findSourceMapURL,"permanentlyDeleteAction"),v=(0,f.createServerReference)("00ab6550efcaaf4a024da9657190e2a7842c8612bc",f.callServer,void 0,f.findSourceMapURL,"emptyTrashAction");var g=r(39498),y=r(4235);function j({initialItems:e}){let{t}=(0,x.Y)(),r=(0,h.useRouter)(),[f,j]=(0,a.useState)(e),[N,k]=(0,a.useTransition)(),[A,w]=(0,a.useState)(!1),[M,C]=(0,a.useState)(null),[S,R]=(0,a.useState)(null),[z,P]=(0,a.useState)(null),L=(0,a.useCallback)(async e=>{P(e.id);try{let s=await p(e.id,"restore");s.success?(j(t=>t.filter(t=>t.id!==e.id)),y.oR.success(t.trash.restored),r.refresh()):s.conflict?R(e):y.oR.error(s.error??t.trash.restoreFailed)}finally{P(null)}},[t,r]),T=(0,a.useCallback)(async e=>{if(!S)return;let s=await p(S.id,e);s.success?(j(e=>e.filter(e=>e.id!==S.id)),y.oR.success(t.trash.restored),R(null),r.refresh()):y.oR.error(s.error??t.trash.restoreFailed)},[S,t,r]),_=(0,a.useCallback)(async()=>{if(!M)return;let e=await b(M.id);e.success?(j(e=>e.filter(e=>e.id!==M.id)),y.oR.success(t.trash.deleted)):y.oR.error(e.error??t.trash.deleteFailed),C(null)},[M,t]),E=(0,a.useCallback)(async()=>{k(async()=>{let e=await v();e.success?(j([]),y.oR.success(t.trash.emptied(e.count??0))):y.oR.error(e.error??t.trash.emptyFailed),w(!1)})},[t]);return(0,s.jsxs)("div",{className:"min-h-screen",children:[(0,s.jsx)("div",{className:"px-4 md:px-6 pt-6 md:pt-8",children:(0,s.jsx)("div",{className:"content-width xl:mr-[220px] rounded-xl border border-border bg-card px-4 py-3 md:px-5 md:py-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,s.jsx)(l.A,{size:15}),t.trash.title]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t.trash.subtitle}),f.length>0&&(0,s.jsx)("div",{className:"mt-2 text-xs text-muted-foreground",children:t.trash.itemCount(f.length)})]}),f.length>0&&(0,s.jsx)("button",{type:"button",onClick:()=>w(!0),disabled:N,className:"px-2.5 py-1.5 rounded-md text-xs font-medium bg-error/10 text-error hover:bg-error/20 transition-colors disabled:opacity-50",children:t.trash.emptyTrash})]})})}),(0,s.jsx)("div",{className:"px-4 md:px-6 py-4 md:py-6",children:(0,s.jsx)("div",{className:"content-width xl:mr-[220px]",children:0===f.length?(0,s.jsxs)("div",{className:"rounded-xl border border-border/40 bg-card/30 p-12 text-center",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-muted/60 mb-4",children:(0,s.jsx)(l.A,{size:22,className:"text-muted-foreground/40"})}),(0,s.jsx)("p",{className:"text-sm font-medium text-muted-foreground/70",children:t.trash.empty}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1 max-w-xs mx-auto leading-relaxed",children:t.trash.emptySubtext})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:f.map(e=>{let r=Math.max(0,Math.ceil((new Date(e.expiresAt).getTime()-Date.now())/864e5)),a=r<=3;return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 flex flex-col gap-3 hover:border-border/80 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-lg bg-muted/50 flex items-center justify-center shrink-0",children:e.isDirectory?(0,s.jsx)(i.A,{size:16,className:"text-muted-foreground"}):e.fileName.endsWith(".csv")?(0,s.jsx)(n.A,{size:16,className:"text-success"}):(0,s.jsx)(d.A,{size:16,className:"text-muted-foreground"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground truncate",title:e.fileName,children:e.fileName}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",title:e.originalPath,children:[t.trash.from,": ",e.originalPath.split("/").slice(0,-1).join("/")||"/"]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",children:t.trash.deletedAgo(function(e,t){let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<1)return t.justNow??"just now";if(r<60)return t.minutesAgo?.(r)??`${r}m ago`;let s=Math.floor(r/60);if(s<24)return t.hoursAgo?.(s)??`${s}h ago`;let a=Math.floor(s/24);return t.daysAgo?.(a)??`${a}d ago`}(e.deletedAt,t.trash))}),(0,s.jsxs)("span",{className:`text-2xs ${a?"text-error":"text-muted-foreground/60"}`,children:[a&&(0,s.jsx)(c.A,{size:9,className:"inline mr-0.5"}),t.trash.expiresIn(r)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>L(e),disabled:z===e.id,className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium bg-success/10 text-success hover:bg-success/20 transition-colors disabled:opacity-50",children:[z===e.id?(0,s.jsx)(o.A,{size:11,className:"animate-spin"}):(0,s.jsx)(u.A,{size:11}),t.trash.restore]}),(0,s.jsx)("button",{type:"button",onClick:()=>C(e),className:"p-1 rounded-md text-muted-foreground hover:text-error hover:bg-error/10 transition-colors",title:t.trash.deletePermanently,children:(0,s.jsx)(m.A,{size:13})})]})]})]},e.id)})})})}),(0,s.jsx)(g.TM,{open:A,title:t.trash.emptyTrash,message:t.trash.emptyTrashConfirm,confirmLabel:t.trash.emptyTrash,cancelLabel:t.trash.cancel??"Cancel",onConfirm:()=>void E(),onCancel:()=>w(!1),variant:"destructive"}),(0,s.jsx)(g.TM,{open:!!M,title:t.trash.deletePermanently,message:M?t.trash.deletePermanentlyConfirm(M.fileName):"",confirmLabel:t.trash.deletePermanently,cancelLabel:t.trash.cancel??"Cancel",onConfirm:()=>void _(),onCancel:()=>C(null),variant:"destructive"}),S&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:(0,s.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-xl max-w-sm w-full mx-4 p-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)(c.A,{size:16,className:"text-[var(--amber)]"}),(0,s.jsx)("h3",{className:"text-sm font-semibold",children:t.trash.restoreConflict})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground mb-4",children:['"',S.fileName,'" — ',S.originalPath]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,s.jsx)("button",{type:"button",onClick:()=>R(null),className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:t.trash.cancel??"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:()=>void T("copy"),className:"px-3 py-1.5 rounded-md text-xs font-medium bg-muted text-foreground hover:bg-muted/80 transition-colors",children:t.trash.saveAsCopy}),(0,s.jsx)("button",{type:"button",onClick:()=>void T("overwrite"),className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:t.trash.overwrite})]})]})})]})}},33078:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]])},33210:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},38798:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},41585:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},48368:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},51914:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},54839:(e,t,r)=>{Promise.resolve().then(r.bind(r,31806))},68459:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},73321:(e,t,r)=>{"use strict";var s=r(74645);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},90425:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(12115);let a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),l=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,s.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:n="",children:d,iconNode:c,...o},u)=>(0,s.createElement)("svg",{ref:u,...i,width:t,height:t,stroke:e,strokeWidth:l?24*Number(r)/Number(t):r,className:a("lucide",n),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(o)&&{"aria-hidden":"true"},...o},[...c.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(d)?d:[d]])),d=(e,t)=>{let r=(0,s.forwardRef)(({className:r,...i},d)=>(0,s.createElement)(n,{ref:d,iconNode:t,className:a(`lucide-${l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...i}));return r.displayName=l(e),r}}},e=>{e.O(0,[5581,8252,8441,3794,7358],()=>e(e.s=54839)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1,12 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3637,9508],{7337:(e,t,r)=>{"use strict";function s(e){if(/^(https?|file):\/\//.test(e))return e;if(e.startsWith("/")){let t=e.slice(1);return`/api/file/raw?path=${encodeURIComponent(t)}`}return e}r.d(t,{X:()=>s})},7834:(e,t,r)=>{"use strict";async function s(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return!1}}r.d(t,{l:()=>s})},9921:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},10377:(e,t,r)=>{"use strict";r.d(t,{Z:()=>h});var s=r(12115);let n="mindos-pinned-files",a="mindos:pins-changed";function o(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):[]}catch{return[]}}function l(){return c}let i=[];function d(){return i}let c=[],u=!1;function m(){u||(c=o(),u=!0)}function x(e){m();let t=t=>{t.key===n&&(c=o(),e())},r=()=>{c=o(),e()};return window.addEventListener("storage",t),window.addEventListener(a,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,r)}}function p(e){c=e;try{localStorage.setItem(n,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){m();let e=(0,s.useSyncExternalStore)(x,l,d),t=(0,s.useCallback)(t=>e.includes(t),[e]),r=(0,s.useCallback)(e=>{let t=o(),r=t.indexOf(e);r>=0?t.splice(r,1):t.unshift(e),p(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:r,reorderPins:(0,s.useCallback)(e=>{p(e)},[]),removePin:(0,s.useCallback)(e=>{p(o().filter(t=>t!==e))},[])}}},16416:(e,t,r)=>{"use strict";r.d(t,{default:()=>ef});var s=r(95155),n=r(12115),a=r(73321),o=r(80723),l=r(95057),i=r(90425);let d=(0,i.A)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var c=r(37618),u=r(33210),m=r(6296),x=r(55243),p=r(94290),h=r(60285),f=r(48368);let g=(0,i.A)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);var v=r(6962),b=r(67635),y=r(49387),j=r(68459),w=r(63637);function N({content:e}){let t=(0,n.useMemo)(()=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},[e]);return(0,s.jsx)("pre",{className:"rounded-xl border border-border bg-card px-4 py-3 overflow-x-auto text-sm leading-relaxed font-display",children:(0,s.jsx)("code",{suppressHydrationWarning:!0,children:t})})}var k=r(59386),C=r.n(k),A=r(9921),E=r(66088),S=r(56563),z=r(51914);function M(e,t){return C().unparse([e,...t])}function L({value:e,editable:t,onCommit:r}){let[a,o]=(0,n.useState)(!1),[l,i]=(0,n.useState)(e),d=(0,n.useRef)(null);function c(){o(!1),l!==e&&r(l)}return((0,n.useEffect)(()=>{a&&d.current?.select()},[a]),a)?(0,s.jsx)("input",{ref:d,value:l,onChange:e=>i(e.target.value),onBlur:c,onKeyDown:t=>{"Enter"===t.key&&c(),"Escape"===t.key&&(i(e),o(!1))},className:"w-full bg-transparent outline-none text-sm",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60},onClick:e=>e.stopPropagation()}):(0,s.jsx)("div",{className:`truncate text-sm ${t?"cursor-text":""}`,style:{color:"var(--foreground)",minWidth:60},onClick:t?function(){t&&(i(e),o(!0))}:void 0,title:e,children:e||(0,s.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.4},children:"—"})})}function T({headers:e,onAdd:t,onCancel:r}){let[a,o]=(0,n.useState)(()=>Array(e.length).fill("")),l=(0,n.useRef)(null);return(0,s.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[e.map((e,n)=>(0,s.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,s.jsx)("input",{ref:0===n?l:void 0,autoFocus:0===n,value:a[n],onChange:e=>{var t;return t=e.target.value,void o(e=>{let r=[...e];return r[n]=t,r})},onKeyDown:e=>{"Enter"===e.key&&t(a),"Escape"===e.key&&r()},placeholder:e,className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},n)),(0,s.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function R({content:e,appendAction:t,saveAction:r}){let[a,o]=(0,n.useState)(e),[l,i]=(0,n.useState)(null),[d,c]=(0,n.useState)(null),[u,x]=(0,n.useState)(!1),[p,h]=(0,n.useState)(!1),f=(0,n.useMemo)(()=>C().parse(a,{skipEmptyLines:!0}).data,[a]),g=f[0]||[],v=f.slice(1),b=(0,n.useMemo)(()=>null===l||null===d?v:[...v].sort((e,t)=>{let r=e[l]??"",s=t[l]??"",n=parseFloat(r),a=parseFloat(s);return isNaN(n)||isNaN(a)?"asc"===d?r.localeCompare(s):s.localeCompare(r):"asc"===d?n-a:a-n}),[v,l,d]),y=(0,n.useCallback)(async(e,t,s)=>{if(!r)return;let n=M(g,v.map(r=>r===b[e]?r.map((e,r)=>r===t?s:e):r));o(n),h(!0);try{await r(n)}catch(e){console.error("[CsvView] Cell save failed:",e)}finally{h(!1)}},[r,v,b,g]),w=(0,n.useCallback)(async e=>{if(!r||p)return;let t=b[e],s=M(g,v.filter(e=>e!==t));o(s),h(!0);try{await r(s)}catch(e){console.error("[CsvView] Row delete failed:",e)}finally{h(!1)}},[r,v,b,g,p]),N=(0,n.useCallback)(async e=>{h(!0);try{if(t){let r=await t(e);o(r.newContent)}else if(r){let t=M(g,[...v,e]);o(t),await r(t)}x(!1)}catch(e){console.error("[CsvView] Add row failed:",e)}finally{h(!1)}},[t,r,g,v]),k=!!r||!!t;return 0===g.length?(0,s.jsx)("div",{className:"text-sm py-4",style:{color:"var(--muted-foreground)"},children:"Empty CSV file"}):(0,s.jsxs)("div",{className:"w-full rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{style:{background:"var(--muted)"},children:[g.map((e,t)=>(0,s.jsx)("th",{onClick:()=>(function(e){if(l!==e){i(e),c("asc");return}"asc"===d?c("desc"):(i(null),c(null))})(t),className:"px-4 py-2.5 text-left font-semibold cursor-pointer select-none whitespace-nowrap transition-colors hover:bg-accent",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)",fontSize:"0.75rem",letterSpacing:"0.04em",textTransform:"uppercase"},children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{children:e}),l===t?"asc"===d?(0,s.jsx)(A.A,{size:11,style:{color:"var(--amber)"}}):(0,s.jsx)(E.A,{size:11,style:{color:"var(--amber)"}}):(0,s.jsx)(S.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.4}})]})},t)),k&&(0,s.jsx)("th",{className:"w-8",style:{borderBottom:"1px solid var(--border)",background:"var(--muted)"}})]})}),(0,s.jsxs)("tbody",{children:[b.map((e,t)=>(0,s.jsxs)("tr",{className:"group transition-colors",style:{background:t%2==0?"var(--background)":"var(--card)"},onMouseEnter:e=>e.currentTarget.style.background="var(--muted)",onMouseLeave:e=>e.currentTarget.style.background=t%2==0?"var(--background)":"var(--card)",children:[g.map((n,a)=>(0,s.jsx)("td",{className:"px-4 py-2.5 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,s.jsx)(L,{value:e[a]??"",editable:!!r,onCommit:e=>y(t,a,e)})},a)),k&&(0,s.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:r&&(0,s.jsx)("button",{onClick:()=>w(t),disabled:p,className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10 disabled:opacity-30",style:{color:"var(--muted-foreground)"},title:p?"Saving...":"Delete row",children:(0,s.jsx)(j.A,{size:12})})})]},t)),u&&(0,s.jsx)(T,{headers:g,onAdd:N,onCancel:()=>x(!1)})]})]})}),(0,s.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,s.jsxs)("span",{className:"text-xs font-display flex items-center gap-1.5",style:{color:"var(--muted-foreground)"},children:[v.length," rows \xb7 ",g.length," cols",p&&(0,s.jsx)(m.A,{size:10,className:"animate-spin",style:{color:"var(--amber)"}})]}),k&&!u&&(0,s.jsxs)("button",{onClick:()=>x(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md transition-colors font-display",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,s.jsx)(z.A,{size:12}),"Add row"]}),u&&(0,s.jsx)("button",{onClick:()=>x(!1),className:"text-xs px-2.5 py-1 rounded-md transition-colors font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]})}var P=r(98500),$=r.n(P);let I=(0,i.A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var D=r(35581),F=r(22356);function O({filePath:e}){let[t,r]=(0,n.useState)([]),[a,o]=(0,n.useState)(!0),{t:l}=(0,D.Y)();return((0,n.useEffect)(()=>{o(!0),(0,F.n)(`/api/backlinks?path=${encodeURIComponent(e)}`).then(e=>{r(Array.isArray(e)?e:[]),o(!1)}).catch(()=>{r([]),o(!1)})},[e]),a||0!==t.length)?(0,s.jsxs)("div",{className:"mt-12 pt-8 border-t border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6 text-muted-foreground",children:[(0,s.jsx)(I,{size:16,className:"text-[var(--amber)]/70"}),(0,s.jsx)("h3",{className:"text-sm font-semibold tracking-wider uppercase",children:l.common?.relatedFiles||"Related Files"}),(0,s.jsx)("span",{className:"text-xs bg-muted px-1.5 py-0.5 rounded-full font-mono",children:t.length})]}),(0,s.jsx)("div",{className:"grid gap-3",children:a?(0,s.jsx)("div",{className:"space-y-3",children:[1,2].map(e=>(0,s.jsx)("div",{className:"h-20 bg-muted/30 rounded-lg animate-pulse"},e))}):t.map(e=>(0,s.jsx)($(),{href:`/view/${e.filePath.split("/").map(encodeURIComponent).join("/")}`,className:"group block p-4 rounded-xl border border-border/50 bg-card/30 hover:bg-muted/30 hover:border-[var(--amber)]/30 transition-all duration-200",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-1 p-1.5 rounded-md bg-muted group-hover:bg-[var(--amber)]/10 transition-colors",children:(0,s.jsx)(f.A,{size:14,className:"text-muted-foreground group-hover:text-[var(--amber)]"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-sm text-foreground group-hover:text-[var(--amber)] transition-colors truncate mb-1",title:e.filePath,children:e.filePath}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed italic opacity-80 group-hover:opacity-100 transition-opacity",title:e.snippets[0]||"",children:e.snippets[0]||""})]})]})},e.filePath))})]}):null}var H=r(77148),V=r(44406),W=r(37206),U=r(8434);let B=(0,i.A)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);var Y=r(7915);let _=(0,W.default)(()=>Promise.all([r.e(6079),r.e(1477),r.e(362)]).then(r.bind(r,90362)),{loadableGenerated:{webpack:()=>[90362]},ssr:!1,loading:()=>(0,s.jsx)("div",{className:"h-full w-full min-h-[400px] rounded-lg border border-border bg-background flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[(0,s.jsx)("div",{className:"w-4 h-4 border-2 border-border border-t-foreground rounded-full animate-spin"}),(0,s.jsx)("span",{children:"Loading editor..."})]})})}),q=(0,W.default)(()=>Promise.all([r.e(5004),r.e(277),r.e(2647),r.e(6087)]).then(r.bind(r,16087)),{loadableGenerated:{webpack:()=>[16087]},ssr:!1}),K=[{id:"wysiwyg",icon:(0,s.jsx)(y.A,{size:12}),label:"WYSIWYG"},{id:"split",icon:(0,s.jsx)(U.A,{size:12}),label:"Split"},{id:"source",icon:(0,s.jsx)(B,{size:12}),label:"Source"},{id:"preview",icon:(0,s.jsx)(Y.A,{size:12}),label:"Preview"}];function G({value:e,onChange:t,viewMode:r,onViewModeChange:n}){return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex items-center gap-1 p-1 bg-muted rounded-lg self-start",children:K.map(e=>(0,s.jsxs)("button",{onClick:()=>n(e.id),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded text-xs font-medium transition-colors ${r===e.id?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.icon,e.label]},e.id))}),(0,s.jsxs)("div",{className:"rounded-xl overflow-hidden border border-border flex",style:{height:"calc(100vh - 160px)"},children:["wysiwyg"===r&&(0,s.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,s.jsx)(q,{value:e,onChange:t})}),"split"===r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"w-1/2 h-full overflow-auto border-r border-border",children:(0,s.jsx)(_,{value:e,onChange:t,language:"markdown"})}),(0,s.jsx)("div",{className:"w-1/2 h-full overflow-auto bg-background",children:(0,s.jsx)("div",{className:"px-6 py-5",children:(0,s.jsx)(w.default,{content:e})})})]}),"source"===r&&(0,s.jsx)("div",{className:"w-full h-full overflow-auto",children:(0,s.jsx)(_,{value:e,onChange:t,language:"markdown"})}),"preview"===r&&(0,s.jsx)("div",{className:"w-full h-full overflow-auto bg-background",children:(0,s.jsx)("div",{className:"px-6 py-5",children:(0,s.jsx)(w.default,{content:e})})})]})]})}var J=r(21362),Z=r(36306),X=r(91337);function Q({content:e}){let{t}=(0,D.Y)(),{headings:r,minLevel:a}=(0,n.useMemo)(()=>{let t=function(e){let t=new Z.A,r=e.split("\n"),s=[],n=!1;for(let e of r){if(/^(`{3,}|~{3,})/.test(e)){n=!n;continue}if(n)continue;let r=e.match(/^(#{1,4})\s+(.+)/);if(r){let e=r[1].length,n=r[2].trim(),a=t.slug(n);s.push({id:a,text:n,level:e})}}return s}(e);return{headings:t,minLevel:t.length>0?Math.min(...t.map(e=>e.level)):1}},[e]),[o,l]=(0,n.useState)(""),[i,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=document.documentElement.style;return e.setProperty("--toc-width",i?"0px":"212px"),i?e.removeProperty("--toc-margin"):e.setProperty("--toc-margin","220px"),()=>{e.removeProperty("--toc-width"),e.removeProperty("--toc-margin")}},[i]);let c=(0,n.useRef)(null),u=(0,n.useRef)(null),m=(0,n.useRef)(new Map),x=(0,n.useCallback)(e=>{let t=m.current.get(e),r=u.current;if(!t||!r||!t.isConnected)return;let s=r.getBoundingClientRect(),n=t.getBoundingClientRect(),a=n.top<s.top+40,o=n.bottom>s.bottom-40;(a||o)&&t.scrollIntoView({block:"center",behavior:"auto"})},[]);return((0,n.useEffect)(()=>{if(0===r.length)return;let e=setTimeout(()=>{let e=r.map(e=>document.getElementById(e.id)).filter(Boolean);0!==e.length&&(c.current?.disconnect(),c.current=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){l(t.target.id),x(t.target.id);break}},{rootMargin:"-56px 0% -70% 0%",threshold:0}),e.forEach(e=>c.current?.observe(e)))},150);return()=>{clearTimeout(e),c.current?.disconnect()}},[r]),r.length<2)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>d(e=>!e),className:"hidden xl:flex fixed z-10 top-[50px] flex items-center justify-center w-5 h-8 rounded-l-md border border-r-0 border-border hover:bg-muted transition-colors",style:{right:`calc(var(--right-panel-width, 0px) + ${212*!i}px)`,background:"var(--background)",transition:"right 200ms ease-in-out"},title:i?t.view.tocExpand:t.view.tocCollapse,children:(0,s.jsx)(J.A,{size:11,className:"text-muted-foreground/60 transition-transform duration-200",style:{transform:i?"rotate(180deg)":"rotate(0deg)"}})}),(0,s.jsx)("aside",{className:"hidden xl:flex flex-col fixed z-10 overflow-hidden",style:{top:44,height:"calc(100vh - 44px)",width:212,right:"var(--right-panel-width, 0px)",transform:i?"translateX(212px)":"translateX(0)",transition:"transform 200ms ease-in-out, right 200ms ease-out"},children:(0,s.jsxs)("nav",{ref:u,"aria-label":t.view.tocTitle,className:"flex flex-col gap-0.5 overflow-y-auto min-h-0 flex-1 py-5 pl-2 pr-3 border-l border-border",style:{background:"var(--background)"},children:[(0,s.jsx)("p",{className:"text-2xs font-semibold uppercase tracking-wider px-2 mb-1 text-muted-foreground/50 shrink-0",children:t.view.tocTitle}),r.map((e,t)=>{let r=(e.level-a)*14,n=o===e.id,i=e.level>a;return(0,s.jsx)("a",{ref:t=>{t?m.current.set(e.id,t):m.current.delete(e.id)},href:`#${e.id}`,onClick:t=>((e,t)=>{e.preventDefault();let r=document.getElementById(t);if(!r)return;let s=r.getBoundingClientRect().top+window.scrollY-56;window.scrollTo({top:s,behavior:"smooth"}),l(t)})(t,e.id),className:(0,X.cn)("block text-xs py-1 rounded transition-colors duration-100 leading-snug shrink-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",n&&"font-medium"),style:{paddingLeft:`${8+r}px`,paddingRight:"8px",borderLeft:"2px solid",borderLeftColor:n?"var(--amber)":i?"var(--border)":"transparent",marginLeft:i?"7px":"0",...n?{color:"var(--amber)",background:"var(--amber-dim)"}:{color:"var(--muted-foreground)"}},title:e.text,children:(0,s.jsx)("span",{className:"line-clamp-2",suppressHydrationWarning:!0,children:e.text})},`${e.id}-${t}`)})]})})]})}let ee="findip-highlight",et="findip-active";function er({containerRef:e,onClose:t}){let{t:r}=(0,D.Y)(),[a,o]=(0,n.useState)(""),[l,i]=(0,n.useState)(0),d=(0,n.useRef)(null),c=(0,n.useRef)([]);(0,n.useEffect)(()=>{d.current?.focus()},[]);let m=(0,n.useCallback)(()=>{for(let e of c.current){let t=e.parentNode;t&&(t.replaceChild(document.createTextNode(e.textContent||""),e),t.normalize())}c.current=[]},[]);(0,n.useEffect)(()=>{m(),i(0);let t=e.current;if(!t||!a.trim())return;let r=a.toLowerCase(),s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.parentElement?.closest("[data-find-in-page]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),n=[];for(;s.nextNode();)n.push(s.currentNode);let o=[];for(let e of n){let t=e.textContent||"",s=t.toLowerCase(),n=0,a=[];for(;;){let e=s.indexOf(r,n);if(-1===e)break;a.push(e),n=e+r.length}if(0===a.length)continue;let l=e.parentNode;if(!l)continue;let i=document.createDocumentFragment(),d=0;for(let e of a){e>d&&i.appendChild(document.createTextNode(t.slice(d,e)));let s=document.createElement("mark");s.className=ee,s.textContent=t.slice(e,e+r.length),i.appendChild(s),o.push(s),d=e+r.length}d<t.length&&i.appendChild(document.createTextNode(t.slice(d))),l.replaceChild(i,e)}return c.current=o,i(+(o.length>0)),o.length>0&&(o[0].classList.add(et),o[0].scrollIntoView({block:"center",behavior:"smooth"})),()=>{}},[a,e,m]),(0,n.useEffect)(()=>()=>{m()},[m]);let x=c.current.length,p=(0,n.useCallback)(e=>{let t=c.current;if(0===t.length)return;for(let e of t)e.classList.remove(et);let r=((e-1)%t.length+t.length)%t.length;t[r].classList.add(et),t[r].scrollIntoView({block:"center",behavior:"smooth"}),i(r+1)},[]),h=(0,n.useCallback)(()=>p(l+1),[l,p]),f=(0,n.useCallback)(()=>p(l-1),[l,p]),g=(0,n.useCallback)(e=>{"Escape"===e.key?(e.preventDefault(),t()):"Enter"===e.key&&(e.preventDefault(),e.shiftKey?f():h())},[t,h,f]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:`
2
- mark.${ee} {
3
- background: rgba(250, 204, 21, 0.3);
4
- color: inherit;
5
- border-radius: 2px;
6
- padding: 0;
7
- }
8
- mark.${et} {
9
- background: rgba(250, 204, 21, 0.7);
10
- outline: 2px solid rgba(250, 204, 21, 0.5);
11
- }
12
- `}),(0,s.jsx)("div",{className:"sticky top-[96px] md:top-[44px] z-30 flex justify-end px-4 md:px-6 pointer-events-none","data-find-in-page":!0,children:(0,s.jsxs)("div",{className:"pointer-events-auto flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card shadow-lg",children:[(0,s.jsx)("input",{ref:d,type:"text",value:a,onChange:e=>o(e.target.value),onKeyDown:g,placeholder:r.findInPage.placeholder,className:"w-[180px] sm:w-[220px] px-2 py-1 text-sm bg-transparent text-foreground placeholder:text-muted-foreground outline-none"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0 min-w-[48px] text-center font-display",children:a.trim()?x>0?r.findInPage.matchCount(l,x):r.findInPage.noResults:""}),(0,s.jsx)("button",{onClick:f,disabled:0===x,className:"p-1 rounded text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors","aria-label":"Previous match",children:(0,s.jsx)(A.A,{size:14})}),(0,s.jsx)("button",{onClick:h,disabled:0===x,className:"p-1 rounded text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors","aria-label":"Next match",children:(0,s.jsx)(E.A,{size:14})}),(0,s.jsx)("button",{onClick:t,className:"p-1 rounded text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close find",children:(0,s.jsx)(u.A,{size:14})})]})})]})}var es=r(46838),en=r(70620),ea=r(60802),eo=r(71496),el=r(92534),ei=r(4235),ed=r(39498),ec=r(97631),eu=r(10377),em=r(24332),ex=r(92451),ep=r(94514);function eh({open:e,onClose:t,filePath:r,isDirectory:a,fileName:o}){let{t:l}=(0,D.Y)(),[i,d]=(0,n.useState)(a?"zip":"md"),[c,x]=(0,n.useState)("idle"),[p,h]=(0,n.useState)(""),g=(0,n.useRef)(null),b=(0,n.useCallback)(()=>{x("exporting"),h("");let e=new AbortController;g.current=e,fetch(`/api/export?path=${encodeURIComponent(r)}&format=${i}`,{signal:e.signal}).then(e=>{if(!e.ok){if((e.headers.get("content-type")??"").includes("json"))return e.json().then(e=>{throw Error(e.error||"Export failed")});throw Error(`Export failed (${e.status})`)}return e.blob().then(t=>({blob:t,res:e}))}).then(({blob:e,res:t})=>{let r=(t.headers.get("Content-Disposition")??"").match(/filename="?([^"]+)"?/),s=r?decodeURIComponent(r[1]):o,n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=s,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(n.href),x("done"),ei.oR.success(l.export?.downloaded??"Downloaded")}).catch(e=>{"AbortError"!==e.name&&(x("error"),h(e.message??"Export failed"))}).finally(()=>{g.current=null})},[r,i,o,l]),y=(0,n.useCallback)(()=>{g.current&&(g.current.abort(),g.current=null),x("idle"),h("")},[]),j=(0,n.useCallback)(()=>{x("idle"),h("")},[]),w=(0,n.useCallback)(()=>{g.current&&g.current.abort(),g.current=null,x("idle"),h(""),t()},[t]);if(!e)return null;let N=a?[{value:"zip",label:l.export?.formatZipMd??"Markdown ZIP",desc:l.export?.formatZipMdDesc??"All files in original format",icon:(0,s.jsx)(em.A,{size:14})},{value:"zip-html",label:l.export?.formatZipHtml??"HTML ZIP",desc:l.export?.formatZipHtmlDesc??"All files as webpages",icon:(0,s.jsx)(ex.A,{size:14})}]:[{value:"md",label:l.export?.formatMd??"Markdown (.md)",desc:l.export?.formatMdDesc??"Original format, editable",icon:(0,s.jsx)(f.A,{size:14})},{value:"html",label:l.export?.formatHtml??"HTML (.html)",desc:l.export?.formatHtmlDesc??"Static webpage, shareable",icon:(0,s.jsx)(ex.A,{size:14})}];return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:"exporting"===c?void 0:w,children:(0,s.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-xl max-w-md w-full mx-4 animate-in fade-in-0 zoom-in-95 duration-200",role:"dialog","aria-modal":"true","aria-labelledby":"export-modal-title",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(v.A,{size:15,className:"text-[var(--amber)]"}),(0,s.jsx)("h3",{id:"export-modal-title",className:"text-sm font-semibold",children:a?l.export?.exportSpace??"Export Space":l.export?.exportFile??"Export File"})]}),(0,s.jsx)("button",{onClick:w,className:"p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":l.export?.cancel??"Close",children:(0,s.jsx)(u.A,{size:14})})]}),(0,s.jsx)("div",{className:"px-5 py-4",children:"done"===c?(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-full bg-success/10 flex items-center justify-center mx-auto mb-3",children:(0,s.jsx)(ep.A,{size:20,className:"text-success"})}),(0,s.jsx)("p",{className:"text-sm font-medium",children:l.export?.done??"Export Complete"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:o})]}):"error"===c?(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-error",children:l.export?.error??"Export failed"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:p})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-3 truncate",title:r,children:r}),(0,s.jsx)("p",{className:"text-xs font-medium text-foreground mb-2",children:l.export?.chooseFormat??"Choose format"}),(0,s.jsx)("div",{className:"space-y-1.5",children:N.map(e=>(0,s.jsxs)("label",{className:`flex items-start gap-3 p-3 rounded-lg border cursor-pointer transition-all ${i===e.value?"border-[var(--amber)]/40 bg-[var(--amber-dim)]":"border-border hover:border-border/80 hover:bg-muted/30"} ${e.disabled?"opacity-40 cursor-not-allowed":""}`,children:[(0,s.jsx)("input",{type:"radio",name:"export-format",value:e.value,checked:i===e.value,onChange:()=>!e.disabled&&d(e.value),disabled:e.disabled,className:"sr-only"}),(0,s.jsx)("span",{className:`mt-0.5 ${i===e.value?"text-[var(--amber)]":"text-muted-foreground"}`,children:e.icon}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground block mt-0.5",children:e.desc})]})]},e.value))})]})}),(0,s.jsx)("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border",children:"done"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:j,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.downloadAgain??"Download Again"}),(0,s.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:l.export?.close??"Done"})]}):"error"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.cancel??"Cancel"}),(0,s.jsx)("button",{onClick:j,className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:l.export?.retry??"Retry"})]}):"exporting"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:y,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.cancel??"Cancel"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium text-[var(--amber-text)] opacity-70",children:[(0,s.jsx)(m.A,{size:12,className:"animate-spin"})," ",l.export?.exporting??"Exporting..."]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.cancel??"Cancel"}),(0,s.jsxs)("button",{onClick:b,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:[(0,s.jsx)(v.A,{size:12})," ",l.export?.exportButton??"Export"]})]})})]})})}function ef({filePath:e,content:t,extension:r,saveAction:i,appendRowAction:k,initialEditing:C=!1,isDraft:A=!1,draftDirectories:E=[],createDraftAction:S}){let{t:z}=(0,D.Y)(),{isPinned:M,togglePin:L}=(0,eu.Z)(),T=M(e),[P,$]=(0,n.useState)(!1),I=(0,n.useSyncExternalStore)(()=>()=>{},()=>!0,()=>!1),[F,W]=(0,H.Un)("_raw",e,!1),[U,B]=(0,n.useState)(!1),Y=(0,a.useRouter)(),_=["pdf","png","jpg","jpeg","gif","webp","svg","bmp","ico","mp3","wav","m4a","ogg","flac","aac","mp4","webm","mov","mkv"].includes(r),[q,K]=(0,n.useState)(!_&&(C||""===t)),[J,Z]=(0,n.useState)(t),[ee,et]=(0,n.useState)(t);(0,n.useEffect)(()=>{q||et(t)},[t,q]);let[em,ex]=(0,n.useTransition)(),[ep,ef]=(0,n.useState)(null),[eg,ev]=(0,n.useState)(!1),[eb,ey]=(0,n.useState)("wysiwyg"),[ej,ew]=(0,n.useState)(!1),eN=(0,n.useRef)(null),[ek,eC]=(0,n.useState)(!1),eA=(0,n.useRef)(null),eE=(0,n.useRef)(null),[eS,ez]=(0,n.useState)(!1),[eM,eL]=(0,n.useState)(!1),[eT,eR]=(0,n.useState)(""),[,eP]=(0,n.useTransition)(),e$=e.split("/").pop()||"Untitled.md",[eI,eD]=(0,n.useState)(A),[eF,eO]=(0,n.useState)(""),[eH,eV]=(0,n.useState)(e$);(0,n.useEffect)(()=>{if(!ek)return;let e=e=>{eA.current&&!eA.current.contains(e.target)&&eE.current&&!eE.current.contains(e.target)&&eC(!1)},t=e=>{"Escape"===e.key&&eC(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[ek]);let eW=(0,n.useCallback)(()=>{navigator.clipboard.writeText(e).catch(()=>{}),eC(!1)},[e]),eU=(0,n.useCallback)(()=>{eC(!1),eR(e.split("/").pop()??""),eL(!0)},[e]),eB=(0,n.useCallback)(()=>{let t=eT.trim();t&&t!==e.split("/").pop()?eP(async()=>{let r=await (0,ea.f)(e,t);eL(!1),r.success&&r.newPath&&(Y.push(`/view/${(0,X.O0)(r.newPath)}`),Y.refresh(),window.dispatchEvent(new Event("mindos:files-changed")))}):eL(!1)},[eT,e,Y]),eY=(0,n.useCallback)(()=>{ez(!1);let t=e.split("/").pop()??e;ex(async()=>{let r=await (0,eo.i)(e);if(r.success){if(r.trashId){let e=r.trashId;ei.oR.undo(`${z.trash?.movedToTrash??"Deleted"} ${t}`,async()=>{let t=await (0,el.Y)(e);t.success?(Y.refresh(),window.dispatchEvent(new Event("mindos:files-changed"))):ei.oR.error(t.error??"Undo failed")},{label:z.trash?.undo??"Undo"})}Y.push("/"),Y.refresh(),window.dispatchEvent(new Event("mindos:files-changed"))}})},[e,Y,z]),e_=!!I&&F,eq=(0,n.useCallback)(()=>{W(e=>!e)},[W]),eK=(0,n.useCallback)(()=>{B(e=>!e)},[B]),eG=(0,es.YB)(e,r),eJ="md"===r&&U?(0,es.YB)(e,r,"graph"):void 0,eZ=eJ||eG,eX="csv"===r,eQ=!q&&!!eZ&&(!e_||!!eJ),e0=(0,n.useMemo)(()=>eZ?eZ.component?eZ.component:eZ.load?(0,n.lazy)(eZ.load):null:null,[eZ]),e1=(0,n.useCallback)(()=>{Z(ee),K(!0),ef(null),ev(!1)},[ee]),e2=(0,n.useCallback)(()=>{A?Y.push("/"):(K(!1),ef(null))},[A,Y]),e5=(0,n.useCallback)(()=>{let e=eH.trim();if(!e)return void ef("Please enter a file name");if(/[/\\:*?"<>|]/.test(e)||e.includes(".."))return void ef("File name contains invalid characters");if(!S)return void ef("Draft save is not available");let t=e.endsWith(".md")||e.endsWith(".csv")?e:`${e}.md`,r=eF?`${eF}/${t}`:t;ef(null),ex(async()=>{try{await S(r,J),et(J),K(!1),eD(!1),ev(!0),setTimeout(()=>ev(!1),2500),Y.push(`/view/${(0,X.O0)(r)}`),Y.refresh()}catch(e){ef(e instanceof Error?e.message:"Failed to save")}})},[eH,S,eF,J,Y]),e3=(0,n.useCallback)(()=>{if(eX){K(!1),ev(!0),setTimeout(()=>ev(!1),2500);return}A?eD(!0):(ef(null),ex(async()=>{try{await i(J),et(J),K(!1),ev(!0),setTimeout(()=>ev(!1),2500)}catch(e){ef(e instanceof Error?e.message:"Failed to save")}}))},[eX,A,i,J]),e4=(0,n.useCallback)(async e=>{await i(e),et(e)},[i]);(0,n.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),q&&e3()),(e.metaKey||e.ctrlKey)&&"f"===e.key&&!q&&(e.preventDefault(),ew(!0)),"e"!==e.key||q||_||document.activeElement?.tagName!=="BODY"||e1(),"Escape"===e.key&&q&&e2()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,e3,e1,e2]);let[e6,e8]=(0,n.useState)(!1),[e9,e7]=(0,n.useState)([]),te=(0,n.useRef)(t),tt=(0,n.useRef)(!1),tr=(0,n.useRef)(null),ts=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!q&&tt.current&&t!==te.current&&""!==te.current){tt.current=!1;let e=(0,ec.m)(te.current,t),r=[],s=1;for(let t of e)"insert"===t.type?(r.push(s),s++):"equal"===t.type&&s++;r.length>0&&(e7(r),tr.current&&clearTimeout(tr.current),tr.current=setTimeout(()=>e7([]),6e3),setTimeout(()=>{let e=document.querySelector("[data-highlight-line]");e&&e.scrollIntoView({block:"center",behavior:"smooth"})},100))}te.current=t},[t,q]),(0,n.useEffect)(()=>{let e=null,t=()=>{q||(e&&clearTimeout(e),e=setTimeout(()=>{tt.current=!0,Y.refresh(),e8(!0),ts.current&&clearTimeout(ts.current),ts.current=setTimeout(()=>e8(!1),3e3)},300))};return window.addEventListener("mindos:files-changed",t),()=>{window.removeEventListener("mindos:files-changed",t),e&&clearTimeout(e)}},[q,Y]),(0,s.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,s.jsx)("div",{className:"sticky top-[52px] md:top-0 z-20 border-b border-border px-4 md:px-6 py-2.5",style:{background:"var(--background)"},children:(0,s.jsxs)("div",{className:"content-width flex items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1 flex items-center gap-1.5",children:[(0,s.jsx)("button",{onClick:()=>Y.back(),className:"md:hidden p-1 -ml-1 rounded text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Go back",children:(0,s.jsx)(o.A,{size:16})}),(0,s.jsx)(V.A,{filePath:e})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 md:gap-2 shrink-0",children:[e6&&!q&&(0,s.jsxs)("span",{className:"text-xs flex items-center gap-1.5 text-[var(--amber)] animate-in fade-in-0 duration-200",children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)]"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"updated"})]}),eg&&(0,s.jsxs)("span",{className:"text-xs flex items-center gap-1.5",style:{color:"var(--success)"},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--success)"}}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"saved"})]}),ep&&(0,s.jsx)("span",{className:"text-xs text-error hidden sm:inline",children:ep}),eG&&!q&&!A&&!eJ&&!_&&(0,s.jsxs)("button",{onClick:eq,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors",style:{background:e_?"var(--amber)22":"var(--muted)",color:e_?"var(--amber)":"var(--muted-foreground)"},title:e_?`Switch to ${eG?.name}`:"View raw",children:[e_?(0,s.jsx)(l.A,{size:13}):(0,s.jsx)(d,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:e_?eG.name:"Raw"})]}),!q&&!eQ&&!A&&!_&&(0,s.jsxs)("button",{onClick:e1,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors",style:{background:"var(--muted)",color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.color="var(--foreground)",e.currentTarget.style.background="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--muted-foreground)",e.currentTarget.style.background="var(--muted)"},children:[(0,s.jsx)(c.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Edit"})]}),q&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:e2,disabled:em,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors disabled:opacity-50",style:{background:"var(--muted)",color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.background="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--muted)"},children:[(0,s.jsx)(u.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Cancel"})]}),(0,s.jsxs)("button",{onClick:A&&eI?e5:e3,disabled:em,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium disabled:opacity-50",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[em?(0,s.jsx)(m.A,{size:13,className:"animate-spin"}):(0,s.jsx)(x.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Save"})]})]}),!A&&(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>L(e),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:T?z.fileTree.removeFromFavorites:z.fileTree.pinToFavorites,children:(0,s.jsx)(p.A,{size:16,className:T?"fill-[var(--amber)] text-[var(--amber)]":""})}),(0,s.jsx)("button",{ref:eA,type:"button",onClick:()=>eC(e=>!e),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:z.view?.more??"More",children:(0,s.jsx)(h.A,{size:16})}),ek&&(0,s.jsxs)("div",{ref:eE,className:"absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-border bg-card shadow-lg py-1",children:["md"===r&&!q&&!A&&(0,es.pl)("graph")&&(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{eC(!1),eK()},children:[U?(0,s.jsx)(f.A,{size:14,className:"shrink-0"}):(0,s.jsx)(g,{size:14,className:"shrink-0"}),U?z.view?.switchToDoc??"Document view":z.view?.switchToGraph??"Wiki Graph"]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{eC(!1),$(!0)},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",z.fileTree?.export??"Export"]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:eW,children:[(0,s.jsx)(b.A,{size:14,className:"shrink-0"})," ",z.view?.copyPath??z.fileTree?.copyPath??"Copy Path"]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:eU,children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"})," ",z.view?.rename??"Rename"]}),(0,s.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",onClick:()=>{eC(!1),ez(!0)},children:[(0,s.jsx)(j.A,{size:14,className:"shrink-0"})," ",z.view?.delete??"Delete"]})]})]})]})]})}),(0,s.jsx)("div",{className:"flex-1 px-4 md:px-6 py-6 md:py-8",children:q?(0,s.jsxs)("div",{className:"content-width",children:[A&&eI&&(0,s.jsxs)("div",{className:"mb-3 rounded-lg border border-border bg-card p-3 flex flex-col gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:z.view?.saveDirectory??"Directory"}),(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(en.A,{dirPaths:E,value:eF,onChange:eO,rootLabel:z.home?.rootLevel??"Root"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:z.view?.saveFileName??"File name"}),(0,s.jsx)("input",{value:eH,onChange:e=>eV(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e5()},className:"mt-1 w-full px-2.5 py-1.5 text-sm bg-background border border-border rounded-lg text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:"Untitled.md"})]})]}),eX?(0,s.jsx)(R,{content:J,filePath:e,appendAction:k,saveAction:async e=>{await i(e),Z(e),et(e)}}):(0,s.jsx)(G,{value:J,onChange:Z,viewMode:eb,onViewModeChange:ey})]}):eQ&&e0?(0,s.jsxs)("div",{ref:eN,className:"content-width",children:[ej&&(0,s.jsx)(er,{containerRef:eN,onClose:()=>ew(!1)}),(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(m.A,{size:20,className:"animate-spin text-muted-foreground"})}),children:(0,s.jsx)(e0,{filePath:e,content:ee,extension:r,saveAction:e4})}),(0,s.jsx)(O,{filePath:e})]}):(0,s.jsxs)("div",{ref:eN,className:"content-width",children:[ej&&(0,s.jsx)(er,{containerRef:eN,onClose:()=>ew(!1)}),"csv"===r?(0,s.jsx)(R,{content:ee,filePath:e}):"json"===r?(0,s.jsx)(N,{content:ee}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.default,{content:ee,highlightLines:e9,onDismissHighlight:()=>e7([]),emptyPlaceholder:z.view?.emptyNote}),(0,s.jsx)(Q,{content:ee})]}),(0,s.jsx)(O,{filePath:e})]})}),eM&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-sm",children:(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-lg p-4 w-80",children:[(0,s.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Rename"}),(0,s.jsx)("input",{autoFocus:!0,value:eT,onChange:e=>eR(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eB(),"Escape"===e.key&&eL(!1)},className:"w-full bg-muted border border-border rounded-md px-3 py-1.5 text-sm text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,s.jsx)("button",{onClick:()=>eL(!1),className:"px-3 py-1.5 rounded-md text-xs bg-muted text-muted-foreground hover:bg-accent transition-colors",children:z.view?.cancel??"Cancel"}),(0,s.jsx)("button",{onClick:eB,className:"px-3 py-1.5 rounded-md text-xs bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:z.view?.rename??"Rename"})]})]})}),(0,s.jsx)(ed.TM,{open:eS,title:z.view?.delete??"Delete",message:z.view?.deleteConfirm?.(e.split("/").pop()??"")??`Delete "${e.split("/").pop()}"?`,confirmLabel:z.view?.delete??"Delete",cancelLabel:z.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>ez(!1),onConfirm:eY}),(0,s.jsx)(eh,{open:P,onClose:()=>$(!1),filePath:e,isDirectory:!1,fileName:e.split("/").pop()??e})]})}},21362:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},22356:(e,t,r)=>{"use strict";r.d(t,{h:()=>s,n:()=>n});class s extends Error{constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.code=r}}async function n(e,t={}){let r,a,o,{timeout:l=3e4,signal:i,...d}=t;if((l>0||i)&&(r=new AbortController),l>0&&r&&(a=setTimeout(()=>{r.abort(Error(`Request timed out after ${Math.round(l/1e3)}s`))},l)),i&&r)if(i.aborted)r.abort();else{let e=()=>r?.abort();i.addEventListener("abort",e,{once:!0}),o=()=>{i.removeEventListener("abort",e)}}let c=r?.signal??i;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,r=`Request failed (${t.status})`;try{let s=await t.json();s?.error?.code&&s?.error?.message?(r=s.error.message,e=s.error.code):s?.error&&(r="string"==typeof s.error?s.error:s.error.message??r)}catch{}throw new s(r,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),o&&o()}}},24332:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]])},33210:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},34367:(e,t,r)=>{"use strict";r.d(t,{default:()=>I});var s=r(95155),n=r(12115),a=r(98500),o=r.n(a),l=r(38798),i=r(33078),d=r(48368),c=r(42129),u=r(997),m=r(97810),x=r(67635),p=r(41585),h=r(49387),f=r(89363),g=r(33210),v=r(93631),b=r(37595);let y=(0,r(90425).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);var j=r(44406),w=r(91337),N=r(82125),k=r(35581);async function C(e){try{await navigator.clipboard.writeText(e)}catch{}}function A({node:e}){return"directory"===e.type?(0,s.jsx)(l.A,{size:16,className:"text-yellow-400 shrink-0"}):".csv"===e.extension?(0,s.jsx)(i.A,{size:16,className:"text-success shrink-0"}):(0,s.jsx)(d.A,{size:16,className:"text-muted-foreground shrink-0"})}function E({node:e}){return"directory"===e.type?(0,s.jsx)(c.A,{size:28,className:"text-yellow-400"}):".csv"===e.extension?(0,s.jsx)(i.A,{size:28,className:"text-success"}):(0,s.jsx)(d.A,{size:28,className:"text-muted-foreground"})}let S="mindos-dir-view",z="show-hidden-files";function M(e){let t=t=>{t.key===z&&e()},r=()=>e();return window.addEventListener("storage",t),window.addEventListener("mindos:hidden-files-changed",r),()=>{window.removeEventListener("storage",t),window.removeEventListener("mindos:hidden-files-changed",r)}}function L(){return"true"===localStorage.getItem(z)}function T({icon:e,title:t,lines:r,viewAllHref:n,viewAllLabel:a}){return 0===r.length?null:(0,s.jsxs)("div",{className:"bg-muted/30 border border-border/40 rounded-lg px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[e,(0,s.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:t})]}),(0,s.jsx)("div",{className:"space-y-1",children:r.map((e,t)=>(0,s.jsxs)("p",{className:"text-sm text-muted-foreground/80 leading-relaxed",suppressHydrationWarning:!0,children:["\xb7 ",e]},t))}),(0,s.jsx)("div",{className:"flex justify-end mt-2",children:(0,s.jsx)(o(),{href:n,className:"text-xs hover:underline transition-colors text-[var(--amber)]",children:a})})]})}function R({preview:e,dirPath:t}){let{t:r}=(0,k.Y)(),n=e.instructionLines.length>0,a=e.readmeLines.length>0;return n||a?(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[n&&(0,s.jsx)(T,{icon:(0,s.jsx)(u.A,{size:14,className:"text-muted-foreground shrink-0"}),title:r.fileTree.rules,lines:e.instructionLines,viewAllHref:`/view/${(0,w.O0)(`${t}/INSTRUCTION.md`)}`,viewAllLabel:r.fileTree.viewAll}),a&&(0,s.jsx)(T,{icon:(0,s.jsx)(m.A,{size:14,className:"text-muted-foreground shrink-0"}),title:r.fileTree.about,lines:e.readmeLines,viewAllHref:`/view/${(0,w.O0)(`${t}/README.md`)}`,viewAllLabel:r.fileTree.viewAll})]}):null}function P({x:e,y:t,path:r,label:a,onClose:o}){let l=(0,n.useRef)(null),{t:i}=(0,k.Y)();(0,n.useEffect)(()=>{let e=e=>{l.current&&!l.current.contains(e.target)&&o()},t=e=>{"Escape"===e.key&&o()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]);let d=Math.min(e,window.innerWidth-200),c=Math.min(t,window.innerHeight-60);return(0,s.jsx)("div",{ref:l,className:"fixed z-50 min-w-[160px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:c,left:d},children:(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{C(r),o()},children:[(0,s.jsx)(x.A,{size:14,className:"shrink-0"})," ",i.fileTree.copyPath]})})}function $({dirPath:e}){let{t}=(0,k.Y)(),r="mindos-space-uninit-dismissed:"+e,[a,l]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{"1"===localStorage.getItem(r)&&l(!0)},[r]),a)?null:(0,s.jsx)("div",{className:"mb-4 rounded-lg border border-error/40 bg-error/5 px-4 py-3",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(p.A,{size:18,className:"text-error shrink-0 mt-0.5"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:t.dirView.uninitTitle}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:t.dirView.uninitDesc}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-2.5",children:[(0,s.jsxs)(o(),{href:`/view/${(0,w.O0)(`${e}/README.md`)}`,className:"inline-flex items-center gap-1 text-xs text-[var(--amber)] hover:underline",children:[(0,s.jsx)(h.A,{size:12})," ",t.dirView.uninitEditReadme]}),(0,s.jsxs)(o(),{href:`/view/${(0,w.O0)(`${e}/INSTRUCTION.md`)}`,className:"inline-flex items-center gap-1 text-xs text-[var(--amber)] hover:underline",children:[(0,s.jsx)(h.A,{size:12})," ",t.dirView.uninitEditInstruction]}),(0,s.jsxs)(o(),{href:"/settings",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,s.jsx)(f.A,{size:12})," ",t.dirView.uninitSettings]})]})]}),(0,s.jsx)("button",{onClick:()=>{localStorage.setItem(r,"1"),l(!0)},className:"text-muted-foreground hover:text-foreground transition-colors p-0.5 shrink-0","aria-label":"Dismiss",children:(0,s.jsx)(g.A,{size:14})})]})})}function I({dirPath:e,entries:t,spacePreview:r}){let[a,l]=[(0,n.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("mindos-dir-view-change",t),()=>window.removeEventListener("mindos-dir-view-change",t)},()=>{let e=localStorage.getItem(S);return"list"===e||"grid"===e?e:"grid"},()=>"grid"),e=>{localStorage.setItem(S,e),window.dispatchEvent(new Event("mindos-dir-view-change"))}],i=(0,n.useSyncExternalStore)(M,L,()=>!1),{t:d}=(0,k.Y)(),u=e=>(0,w.KW)(e,d.home.relativeTime),[m,x]=(0,n.useState)(null),p=(0,n.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),x({x:e.clientX,y:e.clientY,path:t})},[]),h=(0,n.useMemo)(()=>i?t:t.filter(e=>"file"!==e.type||!N.C.has(e.name)),[t,i]),f=(0,n.useMemo)(()=>{let e=new Map;for(let t of h)e.set(t.path,function e(t){return"file"===t.type?1:(t.children||[]).reduce((t,r)=>t+e(r),0)}(t));return e},[h]);return(0,s.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,s.jsx)("div",{className:"sticky top-[52px] md:top-0 z-20 border-b border-border px-4 md:px-6 py-2.5 bg-background",children:(0,s.jsxs)("div",{className:"max-w-[860px] mx-auto flex items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"min-w-0 flex-1",children:(0,s.jsx)(j.A,{filePath:e})}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)(o(),{href:`/view/${(0,w.O0)(e?`${e}/Untitled.md`:"Untitled.md")}`,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,s.jsx)(v.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.dirView.newFile})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 p-1 bg-muted rounded-lg",children:[(0,s.jsx)("button",{onClick:()=>l("grid"),className:`p-1.5 rounded transition-colors ${"grid"===a?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,title:d.dirView.gridView,children:(0,s.jsx)(b.A,{size:14})}),(0,s.jsx)("button",{onClick:()=>l("list"),className:`p-1.5 rounded transition-colors ${"list"===a?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,title:d.dirView.listView,children:(0,s.jsx)(y,{size:14})})]})]})]})}),(0,s.jsx)("div",{className:"flex-1 px-4 md:px-6 py-6",children:(0,s.jsxs)("div",{className:"max-w-[860px] mx-auto",children:[r?.isTemplate&&(0,s.jsx)($,{dirPath:e}),r&&!r.isTemplate&&(0,s.jsx)(R,{preview:r,dirPath:e}),0===h.length?(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:d.dirView.emptyFolder}):"grid"===a?(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-5 gap-3",children:h.map(e=>(0,s.jsxs)(o(),{href:`/view/${(0,w.O0)(e.path)}`,onContextMenu:t=>p(t,e.path),className:"directory"===e.type?"flex flex-col items-center gap-1.5 p-3 rounded-xl border border-border bg-card hover:bg-accent hover:border-border/80 transition-all duration-100 text-center":"flex flex-col items-center gap-2 p-4 rounded-xl border border-border bg-card hover:bg-accent hover:border-border/80 transition-all duration-100 text-center",children:["directory"===e.type?(0,s.jsx)(c.A,{size:22,className:"text-yellow-400"}):(0,s.jsx)(E,{node:e}),(0,s.jsx)("span",{className:"text-xs text-foreground leading-snug line-clamp-2 w-full",title:e.name,suppressHydrationWarning:!0,children:e.name}),"directory"===e.type&&(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",children:d.dirView.fileCount(f.get(e.path)??0)}),"file"===e.type&&e.mtime&&(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",suppressHydrationWarning:!0,children:u(e.mtime)})]},e.path))}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-border border border-border rounded-xl overflow-hidden",children:h.map(e=>(0,s.jsxs)(o(),{href:`/view/${(0,w.O0)(e.path)}`,onContextMenu:t=>p(t,e.path),className:"flex items-center gap-3 px-4 py-3 bg-card hover:bg-accent transition-colors duration-100",children:[(0,s.jsx)(A,{node:e}),(0,s.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",title:e.name,suppressHydrationWarning:!0,children:e.name}),"directory"===e.type?(0,s.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:d.dirView.fileCount(f.get(e.path)??0)}):e.mtime?(0,s.jsx)("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums",suppressHydrationWarning:!0,children:u(e.mtime)}):null]},e.path))})]})}),m&&(0,s.jsx)(P,{x:m.x,y:m.y,path:m.path,label:d.fileTree.copyPath,onClose:()=>x(null)})]})}},41585:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},44406:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var s=r(95155),n=r(98500),a=r.n(n),o=r(33078),l=r(48368),i=r(38798),d=r(66614),c=r(21362);function u({name:e}){let t=e.includes(".")?e.slice(e.lastIndexOf(".")).toLowerCase():"";return".csv"===t?(0,s.jsx)(o.A,{size:13,className:"text-success shrink-0"}):t?(0,s.jsx)(l.A,{size:13,className:"text-muted-foreground shrink-0"}):(0,s.jsx)(i.A,{size:13,className:"text-yellow-400 shrink-0"})}function m({filePath:e}){let t=e.split("/");return(0,s.jsxs)("nav",{className:"flex items-center gap-0.5 text-xs text-muted-foreground flex-wrap",children:[(0,s.jsx)(a(),{href:"/",className:"p-1.5 rounded-md hover:bg-muted/50 hover:text-foreground transition-colors",title:"Home",children:(0,s.jsx)(d.A,{size:14})}),t.map((e,r)=>{let n=r===t.length-1,o="/view/"+t.slice(0,r+1).map(encodeURIComponent).join("/");return(0,s.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,s.jsx)(c.A,{size:12,className:"text-muted-foreground/50 shrink-0"}),n?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 px-2 py-1 text-foreground font-medium",children:[(0,s.jsx)(u,{name:e}),(0,s.jsx)("span",{suppressHydrationWarning:!0,children:e})]}):(0,s.jsx)(a(),{href:o,className:"px-2 py-1 rounded-md hover:bg-muted/50 hover:text-foreground transition-colors truncate max-w-[200px]",title:e,children:(0,s.jsx)("span",{suppressHydrationWarning:!0,children:e})})]},r)})]})}},46838:(e,t,r)=>{"use strict";r.d(t,{$7:()=>o,MZ:()=>c,TS:()=>i,UG:()=>a,YB:()=>d,pl:()=>l});let s=[],n=new Set;function a(){try{let e=localStorage.getItem("mindos-disabled-renderers");n=new Set(e?JSON.parse(e):[])}catch{n=new Set}}function o(e,t){let r=s.find(t=>t.id===e);r?.core||(t?n.delete(e):n.add(e),localStorage.setItem("mindos-disabled-renderers",JSON.stringify([...n])))}function l(e){let t=s.find(t=>t.id===e);return!!t?.core||!n.has(e)}function i(e){s.find(t=>t.id===e.id)||s.push(e)}function d(e,t,r){if(r){let e=s.find(e=>e.id===r);return e&&l(e.id)?e:void 0}return s.find(r=>l(r.id)&&r.match({filePath:e,extension:t}))}function c(){return s.filter(e=>!e.appBuiltinFeature)}},51914:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},55243:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},56699:(e,t,r)=>{Promise.resolve().then(r.bind(r,16416)),Promise.resolve().then(r.bind(r,34367))},60285:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},60802:(e,t,r)=>{"use strict";r.d(t,{f:()=>n});var s=r(9339);let n=(0,s.createServerReference)("60caab788d0a97f69cb3a7a7f69dd321d69d6025d1",s.callServer,void 0,s.findSourceMapURL,"renameFileAction")},63637:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var s=r(95155),n=r(66804),a=r(32957),o=r(98076),l=r(96182),i=r(16535),d=r(12115),c=r(94514),u=r(67635),m=r(33210),x=r(7834),p=r(4235),h=r(7337);function f({code:e}){let[t,r]=(0,d.useState)(!1),n=(0,d.useCallback)(()=>{(0,x.l)(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),2e3),p.oR.copy())})},[e]);return(0,s.jsx)("button",{onClick:n,className:" absolute top-2.5 right-2.5 p-1.5 rounded-md bg-muted hover:bg-accent text-muted-foreground hover:text-foreground transition-colors duration-100 opacity-0 group-hover:opacity-100 ",title:"Copy code",children:t?(0,s.jsx)(c.A,{size:13}):(0,s.jsx)(u.A,{size:13})})}function g(e){let{node:t,inline:r,ordered:s,depth:n,isHeader:a,...o}=e;return o}function v(e){let t=({children:t,...r})=>(0,s.jsx)(e,{...g(r),suppressHydrationWarning:!0,children:t});return t.displayName=e,t}let b={h1:v("h1"),h2:v("h2"),h3:v("h3"),h4:v("h4"),h5:v("h5"),h6:v("h6"),code:({children:e,node:t,...r})=>(0,s.jsx)("code",{...g(r),suppressHydrationWarning:!0,children:e}),pre({children:e,node:t,...r}){let n="";return e&&"object"==typeof e&&"props"in e&&(n=function e(t){return"string"==typeof t?t:Array.isArray(t)?t.map(e).join(""):t&&"object"==typeof t&&"props"in t?e(t.props?.children):""}(e.props?.children)),(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)("pre",{...g(r),suppressHydrationWarning:!0,children:e}),(0,s.jsx)(f,{code:n})]})},li:({children:e,node:t,...r})=>(0,s.jsx)("li",{...g(r),suppressHydrationWarning:!0,children:e}),p:({children:e,node:t,...r})=>(0,s.jsx)("p",{...g(r),suppressHydrationWarning:!0,children:e}),a({href:e,children:t,node:r,...n}){let a=e?.startsWith("http");return(0,s.jsx)("a",{href:e,target:a?"_blank":void 0,rel:a?"noopener noreferrer":void 0,...g(n),children:t})},img({src:e,alt:t,node:r,...n}){if(!e)return null;let a="string"==typeof e?(0,h.X)(e):e;return(0,s.jsx)("img",{src:a,alt:t??"",...g(n)})}};function y({content:e,highlightLines:t,onDismissHighlight:r,emptyPlaceholder:d}){let c=t&&t.length>0;return!e.trim()&&d?(0,s.jsx)("div",{className:"py-12 text-center text-sm text-muted-foreground/50",children:d}):(0,s.jsxs)("div",{children:[c&&(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-2 rounded-md border px-3 py-2 text-xs animate-in fade-in-0 duration-300",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",background:"color-mix(in srgb, var(--amber) 8%, var(--card))",color:"var(--amber)"},"data-highlight-line":!0,children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)] animate-pulse shrink-0"}),(0,s.jsxs)("span",{className:"font-display font-medium flex-1",children:[t.length," line",1!==t.length?"s":""," updated by AI"]}),r&&(0,s.jsx)("button",{type:"button",onClick:r,className:"p-0.5 rounded hover:bg-[var(--amber)]/15 transition-colors shrink-0","aria-label":"Dismiss",children:(0,s.jsx)(m.A,{size:12})})]}),(0,s.jsx)("div",{className:"prose max-w-none",children:(0,s.jsx)(n.oz,{remarkPlugins:[a.A],rehypePlugins:[i.A,o.A,l.A],components:b,children:e})})]})}},66614:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]])},67635:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},68459:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},70620:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(95155),n=r(12115),a=r(47650),o=r(21362),l=r(38798),i=r(94514),d=r(66088),c=r(91337);function u({dirPaths:e,value:t,onChange:r,rootLabel:u="Root"}){let[m,x]=(0,n.useState)(!1),[p,h]=(0,n.useState)(t),[f,g]=(0,n.useState)(null),v=(0,n.useRef)(null),b=(0,n.useRef)(null);(0,n.useEffect)(()=>{h(t)},[t]);let y=(0,n.useCallback)(()=>{if(!v.current)return;let e=v.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top,s=t<208&&r>t;g({top:s?e.top:e.bottom,left:e.left,width:e.width,flipUp:s})},[]);(0,n.useEffect)(()=>m?(y(),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}):void g(null),[m,y]);let j=(0,n.useCallback)(()=>x(!1),[]);(0,n.useEffect)(()=>{if(!m)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),j())},t=e=>{let t=e.target;v.current?.contains(t)||b.current?.contains(t)||j()};return document.addEventListener("keydown",e),document.addEventListener("mousedown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t)}},[m,j]);let w=(0,n.useMemo)(()=>{let t=p?p+"/":"";return e.filter(e=>{if(!e.startsWith(t))return!1;let r=e.slice(t.length);return r.length>0&&!r.includes("/")}).sort()},[e,p]),N=(0,n.useMemo)(()=>p?p.split("/"):[],[p]),k=e=>{if(e<0)h(""),r("");else{let t=N.slice(0,e+1).join("/");h(t),r(t)}},C=t?t.split("/").map(e=>(0,c.vr)(e)).join(" / "):"/ "+u,A=m&&f&&(0,a.createPortal)((0,s.jsxs)("div",{ref:b,className:"fixed z-[9999] rounded-lg border border-[var(--amber)] bg-card shadow-lg overflow-hidden flex flex-col",style:{left:f.left,width:f.width,maxHeight:200,...f.flipUp?{bottom:window.innerHeight-f.top+4}:{top:f.top+4}},children:[(0,s.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1.5 bg-muted/30 border-b border-border overflow-x-auto text-xs shrink-0",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>k(-1),className:`shrink-0 px-1.5 py-0.5 rounded transition-colors ${""===p?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:["/ ",u]}),N.map((e,t)=>(0,s.jsxs)("span",{className:"flex items-center gap-0.5 shrink-0",children:[(0,s.jsx)(o.A,{size:10,className:"text-muted-foreground/50"}),(0,s.jsx)("button",{type:"button",onClick:()=>k(t),className:`px-1.5 py-0.5 rounded transition-colors truncate max-w-[100px] ${t===N.length-1?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:e})]},t))]}),w.length>0?(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:w.map(t=>{let n=t.split("/").pop()||t,a=e.some(e=>e.startsWith(t+"/"));return(0,s.jsxs)("button",{type:"button",onClick:()=>{h(t),r(t)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-muted/60 transition-colors",children:[(0,s.jsx)(l.A,{size:12,className:"shrink-0 text-[var(--amber)]"}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:n}),a&&(0,s.jsx)(o.A,{size:11,className:"shrink-0 text-muted-foreground/40"})]},t)})}):(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground/50 text-center",children:"—"}),(0,s.jsx)("button",{type:"button",onClick:j,className:"w-full py-1.5 flex items-center justify-center gap-1 text-xs font-medium text-[var(--amber)] border-t border-border hover:bg-muted/30 transition-colors shrink-0",children:(0,s.jsx)(i.A,{size:12})})]}),document.body);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{ref:v,type:"button",onClick:()=>x(e=>!e),"aria-haspopup":"true","aria-expanded":m,className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg border bg-background text-foreground transition-colors text-left focus-visible:ring-1 focus-visible:ring-ring outline-none ${m?"border-[var(--amber)]":"border-border hover:border-[var(--amber)]/40"}`,children:[(0,s.jsx)(l.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,s.jsx)("span",{className:"flex-1 truncate",children:C}),(0,s.jsx)(d.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${m?"rotate-180":""}`})]}),A]})}},71496:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});var s=r(9339);let n=(0,s.createServerReference)("40c86ac21ee661ed9d62ce7c5af52049cbaeca26a2",s.callServer,void 0,s.findSourceMapURL,"deleteFileAction")},73321:(e,t,r)=>{"use strict";var s=r(74645);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},77148:(e,t,r)=>{"use strict";r.d(t,{Un:()=>a});var s=r(12115);let n="mindos-renderer-state-change";function a(e,t,r){let a=`mindos-renderer:${e}:${t}`,o=(0,s.useRef)({key:a,raw:null,parsed:r});return o.current.key!==a&&(o.current={key:a,raw:null,parsed:r}),[(0,s.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("storage",t),window.addEventListener(n,t),()=>{window.removeEventListener("storage",t),window.removeEventListener(n,t)}},()=>{try{let e=localStorage.getItem(a);if(e===o.current.raw)return o.current.parsed;if(null===e)return o.current={key:a,raw:null,parsed:r},r;let t=JSON.parse(e);return o.current={key:a,raw:e,parsed:t},t}catch{return r}},()=>r),(0,s.useCallback)(e=>{try{let t=(()=>{try{let e=localStorage.getItem(a);return null!==e?JSON.parse(e):r}catch{return r}})(),s="function"==typeof e?e(t):e,n=JSON.stringify(s);localStorage.setItem(a,n),o.current={key:a,raw:n,parsed:s}}catch{}window.dispatchEvent(new Event(n))},[a,r])]}},80723:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},82125:(e,t,r)=>{"use strict";r.d(t,{A:()=>n,C:()=>s});let s=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"]),n=new Set(["TODO.md"])},91337:(e,t,r)=>{"use strict";r.d(t,{IX:()=>i,KW:()=>l,O0:()=>o,cn:()=>a,vr:()=>d});var s=r(29722),n=r(622);function a(...e){return(0,n.QP)((0,s.$)(e))}function o(e){return e.split("/").map(encodeURIComponent).join("/")}function l(e,t){let r=Date.now()-e,s=Math.floor(r/6e4),n=Math.floor(r/36e5),a=Math.floor(r/864e5);return s<1?t.justNow:s<60?t.minutesAgo(s):n<24?t.hoursAgo(n):a<7?t.daysAgo(a):new Date(e).toLocaleDateString()}function i(e){let t=e.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return t?.[0]??""}function d(e){return e.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||e}},92451:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},92534:(e,t,r)=>{"use strict";r.d(t,{Y:()=>n});var s=r(9339);let n=(0,s.createServerReference)("40e068f238ad6b0c3c038043142db432d430be10bf",s.callServer,void 0,s.findSourceMapURL,"undoDeleteAction")},93631:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]])},97631:(e,t,r)=>{"use strict";function s(e,t){let r=e.split("\n"),s=t.split("\n"),n=r.length,a=s.length,o=Array.from({length:n+1},()=>Array(a+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=a-1;t>=0;t--)o[e][t]=r[e]===s[t]?1+o[e+1][t+1]:Math.max(o[e+1][t],o[e][t+1]);let l=[],i=0,d=0;for(;i<n||d<a;){if(i<n&&d<a&&r[i]===s[d]){l.push({type:"equal",text:r[i]}),i+=1,d+=1;continue}if(d<a&&(i>=n||o[i][d+1]>=o[i+1][d])){l.push({type:"insert",text:s[d]}),d+=1;continue}l.push({type:"delete",text:r[i]}),i+=1}return l}function n(e,t=2){let r=new Set;e.forEach((s,n)=>{if("equal"!==s.type)for(let s=Math.max(0,n-t);s<=Math.min(e.length-1,n+t);s++)r.add(s)});let s=[],a=-1;for(let t=0;t<e.length;t++){if(r.has(t)){-1!==a&&(s.push({type:"gap",count:t-a}),a=-1),s.push(e[t]);continue}-1===a&&(a=t)}return -1!==a&&s.push({type:"gap",count:e.length-a}),s}r.d(t,{S:()=>n,m:()=>s})},97810:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(90425).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])}},e=>{e.O(0,[4237,8409,9286,3013,9905,5581,8252,8441,3794,7358],()=>e(e.s=56699)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6023],{4235:(e,t,s)=>{"use strict";s.d(t,{B1:()=>o,X8:()=>d,dV:()=>l,oR:()=>u});let r=[],n=[],a=0;function i(){for(let e of n)e()}function o(e){return n=[...n,e],()=>{n=n.filter(t=>t!==e)}}function l(){return r}function d(e){r=r.filter(t=>t.id!==e),i()}function c(e){let t=`toast-${++a}`,s={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};r=[...r,s].slice(-3),i(),s.duration>0&&setTimeout(()=>d(t),s.duration)}function u(e,t){c({message:e,...t})}u.success=(e,t)=>c({message:e,type:"success",duration:t}),u.undo=(e,t,s)=>c({message:e,type:"info",duration:s?.duration??5e3,action:{label:s?.label??"Undo",onClick:t}}),u.error=(e,t)=>c({message:e,type:"error",duration:t}),u.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},6296:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},10377:(e,t,s)=>{"use strict";s.d(t,{Z:()=>p});var r=s(12115);let n="mindos-pinned-files",a="mindos:pins-changed";function i(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):[]}catch{return[]}}function o(){return c}let l=[];function d(){return l}let c=[],u=!1;function m(){u||(c=i(),u=!0)}function x(e){m();let t=t=>{t.key===n&&(c=i(),e())},s=()=>{c=i(),e()};return window.addEventListener("storage",t),window.addEventListener(a,s),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,s)}}function h(e){c=e;try{localStorage.setItem(n,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function p(){m();let e=(0,r.useSyncExternalStore)(x,o,d),t=(0,r.useCallback)(t=>e.includes(t),[e]),s=(0,r.useCallback)(e=>{let t=i(),s=t.indexOf(e);s>=0?t.splice(s,1):t.unshift(e),h(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:s,reorderPins:(0,r.useCallback)(e=>{h(e)},[]),removePin:(0,r.useCallback)(e=>{h(i().filter(t=>t!==e))},[])}}},13545:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},15282:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},19257:(e,t,s)=>{"use strict";s.d(t,{default:()=>R});var r=s(95155),n=s(12115),a=s(98500),i=s.n(a),o=s(86901),l=s(61878),d=s(93631),c=s(21628),u=s(90718),m=s(51914),x=s(42129),h=s(66088),p=s(94290),f=s(33078),g=s(48368),b=s(33210),v=s(84980),y=s(50538),j=s(10377),N=s(35581),k=s(91337),w=s(15282),A=s(21975),z=s(6296),M=s(21362),E=s(59511),C=s(13545),$=s(94514),S=s(29494),L=s(78520);function F({isOrganizing:e=!1}){let{t}=(0,N.Y)(),[s,a]=(0,n.useState)([]),[l,d]=(0,n.useState)(!0),[c,u]=(0,n.useState)(!1),[m,x]=(0,n.useState)(!1),[h,p]=(0,n.useState)([]),f=(0,n.useRef)(null),g=(0,n.useRef)(0),b=e||c,y=(0,n.useCallback)(()=>{0===s.length||b||(u(!0),window.dispatchEvent(new CustomEvent("mindos:inbox-organize",{detail:{files:s}})))},[s,b]),j=(0,n.useCallback)(e=>{e&&0!==e.length&&((0,S.Q)(Array.from(e),t),f.current&&(f.current.value=""))},[t]),k=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),g.current=0,x(!1),e.dataTransfer.files.length>0&&(0,S.Q)(Array.from(e.dataTransfer.files),t)},[t]),C=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/inbox");if(!e.ok)return;let t=await e.json();Array.isArray(t.files)&&a(t.files)}catch(e){console.warn("[InboxSection] Failed to fetch inbox:",e)}finally{d(!1)}},[]),$=(0,n.useCallback)(()=>{p((0,L.FB)().slice(0,3))},[]),F=(0,n.useRef)(void 0),O=(0,n.useCallback)(()=>{clearTimeout(F.current),F.current=setTimeout(()=>{C(),$()},80)},[C,$]);(0,n.useEffect)(()=>{let e=()=>{g.current=0,x(!1)};return window.addEventListener("drop",e,!0),window.addEventListener("dragend",e,!0),()=>{window.removeEventListener("drop",e,!0),window.removeEventListener("dragend",e,!0)}},[]),(0,n.useEffect)(()=>{C(),$();let e=()=>{u(!1),O()};return window.addEventListener("mindos:files-changed",O),window.addEventListener("mindos:inbox-updated",O),window.addEventListener("mindos:organize-done",e),window.addEventListener("mindos:organize-history-update",$),()=>{clearTimeout(F.current),window.removeEventListener("mindos:files-changed",O),window.removeEventListener("mindos:inbox-updated",O),window.removeEventListener("mindos:organize-done",e),window.removeEventListener("mindos:organize-history-update",$)}},[C,O,$]);let W=(0,n.useMemo)(()=>s.slice(0,5),[s]),T=Math.max(0,s.length-5),I=s.length>0,[R,P]=(0,n.useState)(0);return((0,n.useEffect)(()=>{P((0,L.FB)().length)},[h]),l)?(0,r.jsxs)("section",{className:"mb-10 animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 w-24 bg-muted rounded mb-3"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"}),(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"})]})]}):(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 mb-5",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-md bg-[var(--amber-subtle)] text-[var(--amber)]",children:(0,r.jsx)(w.A,{size:13})}),(0,r.jsx)("h2",{className:"text-[13px] font-semibold text-foreground tracking-wide",children:t.inbox.title}),I&&(0,r.jsx)("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-[10px] font-semibold rounded-full bg-muted text-muted-foreground tabular-nums",children:t.inbox.count(s.length)}),I&&(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>f.current?.click(),className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground cursor-pointer",title:t.inbox.uploadButton,children:[(0,r.jsx)(A.A,{size:12}),(0,r.jsx)("span",{className:"hidden sm:inline",children:t.inbox.uploadButton})]}),(0,r.jsxs)("button",{onClick:y,disabled:b,className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:b?t.inbox.organizing:void 0,children:[b?(0,r.jsx)(z.A,{size:12,className:"animate-spin"}):(0,r.jsx)(o.A,{size:12}),(0,r.jsx)("span",{children:b?t.inbox.organizing:t.inbox.organizeButton})]})]})]}),(0,r.jsx)("input",{ref:f,type:"file",multiple:!0,accept:".md,.txt,.csv,.json,.pdf",className:"hidden",onChange:e=>j(e.target.files)}),I&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex flex-col gap-0.5 mb-3",children:W.map(e=>(0,r.jsx)(H,{file:e},e.path))}),T>0&&(0,r.jsxs)(i(),{href:"/view/Inbox/",className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground hover:text-[var(--amber)] transition-colors",children:[(0,r.jsx)(M.A,{size:12}),t.inbox.viewAllFiles(s.length)]})]}),(0,r.jsx)("div",{className:`rounded-xl border-2 border-dashed transition-all duration-200 cursor-pointer ${m?"border-[var(--amber)] bg-[var(--amber-subtle)]":I?"border-border/60 hover:border-[var(--amber)]/40":"border-border hover:border-[var(--amber)]/40"} ${I?"px-4 py-4":"px-4 py-8"}`,role:"button",tabIndex:0,"aria-label":t.inbox.uploadButton,onClick:()=>f.current?.click(),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),f.current?.click())},onDragEnter:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),g.current++,1===g.current&&x(!0))},onDragOver:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation())},onDragLeave:e=>{e.stopPropagation(),g.current=Math.max(0,g.current-1),0===g.current&&x(!1)},onDrop:k,children:I?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-center",children:[(0,r.jsx)(E.A,{size:16,className:`shrink-0 ${m?"text-[var(--amber)]":"text-muted-foreground/40"}`}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[t.fileImport.dropzoneCompact," ",(0,r.jsx)("span",{className:"text-[var(--amber)] hover:underline",children:t.fileImport.dropzoneCompactButton})]})]}):(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,r.jsx)(E.A,{size:28,className:`${m?"text-[var(--amber)]":"text-muted-foreground/20"}`}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground/70",children:t.inbox.emptyTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40",children:t.inbox.emptyDesc}),(0,r.jsx)("p",{className:"text-2xs text-muted-foreground/30",children:t.inbox.dropOverlayFormats}),(0,r.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),f.current?.click()},className:"mt-1 inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors bg-muted text-muted-foreground hover:text-foreground hover:bg-muted/80",children:[(0,r.jsx)(A.A,{size:12}),t.inbox.uploadButton]})]})}),h.length>0&&(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(v.A,{size:11,className:"text-muted-foreground/40"}),(0,r.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/60 uppercase tracking-wider",children:t.importHistory.title}),(0,r.jsx)(i(),{href:"/inbox/history",className:"ml-auto text-2xs text-muted-foreground/50 hover:text-[var(--amber)] transition-colors",children:t.inbox.viewAllHistory(R)})]}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:h.map(e=>(0,r.jsx)(D,{entry:e},e.id))})]})]})}function H({file:e}){let{t}=(0,N.Y)(),s=e.name.endsWith(".csv"),n=O(e.modifiedAt,t.home.relativeTime);return(0,r.jsxs)(i(),{href:`/view/${(0,k.O0)(e.path)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group",children:[(0,r.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.isAging?"bg-[var(--amber)]/60":"bg-[var(--amber)]"}`}),s?(0,r.jsx)(f.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(g.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-sm truncate flex-1 text-foreground",title:e.name,suppressHydrationWarning:!0,children:e.name}),(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/50 tabular-nums shrink-0",children:n}),e.isAging&&(0,r.jsx)("span",{title:"7+ days",children:(0,r.jsx)(C.A,{size:11,className:"shrink-0 text-[var(--amber)]/60"})})]})}function D({entry:e}){let[t,s]=(0,n.useState)(!1),a="undone"===e.status,o=function(e){switch(e){case"drag-drop":return{label:"drop",className:"bg-muted/50 text-muted-foreground/50"};case"inbox-organize":return{label:"inbox",className:"bg-[var(--amber)]/10 text-[var(--amber)]/70"};case"import-modal":return{label:"import",className:"bg-blue-500/10 text-blue-500/70"};case"plugin":return{label:"plugin",className:"bg-violet-500/10 text-violet-500/70"};case"upload":return{label:"upload",className:"bg-teal-500/10 text-teal-500/70"};case"web-clipper":return{label:"clip",className:"bg-emerald-500/10 text-emerald-500/70"};default:return null}}(e.source),l=e.durationMs?function(e){let t=Math.round(e/1e3);if(t<60)return`${t}s`;let s=Math.floor(t/60),r=t%60;return`${s}m${r>0?`${r}s`:""}`}(e.durationMs):null,d=O(new Date(e.timestamp).toISOString(),{justNow:"just now",minutesAgo:e=>`${e}m ago`,hoursAgo:e=>`${e}h ago`,daysAgo:e=>`${e}d ago`});return(0,r.jsxs)("div",{className:"rounded-lg border border-border/30 overflow-hidden",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>s(e=>!e),className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-muted/20 transition-colors",children:[a?(0,r.jsx)(C.A,{size:12,className:"text-muted-foreground/40 shrink-0"}):(0,r.jsx)($.A,{size:12,className:"text-success/70 shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:`text-xs truncate ${a?"text-muted-foreground/50 line-through":"text-foreground/80"}`,children:1===e.sourceFiles.length?e.sourceFiles[0]:`${e.sourceFiles.length} files`}),o&&(0,r.jsx)("span",{className:`text-2xs px-1.5 py-0.5 rounded shrink-0 ${o.className}`,children:o.label})]}),(0,r.jsxs)("span",{className:"text-2xs text-muted-foreground/40 tabular-nums shrink-0",children:[l&&`${l} \xb7 `,d]}),e.files.length>0&&(0,r.jsx)(h.A,{size:10,className:`text-muted-foreground/30 shrink-0 transition-transform duration-150 ${t?"rotate-180":""}`})]}),t&&e.files.length>0&&(0,r.jsx)("div",{className:"border-t border-border/20 px-3 py-1.5 space-y-0.5",children:e.files.map((e,t)=>{let s=e.path.split("/"),n=s.pop()??e.path,a=s.length>0?s.join("/"):null,o=!e.undone&&e.ok,l=`flex items-center gap-2 py-1 text-2xs${e.undone?" opacity-40":""}${o?" rounded -mx-1 px-1 hover:bg-muted/20 transition-colors":""}`,d=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:`w-1 h-1 rounded-full shrink-0 ${e.ok&&!e.undone?"bg-success/60":"bg-muted-foreground/30"}`}),(0,r.jsxs)("span",{className:`truncate flex-1 min-w-0 ${e.undone?"line-through text-muted-foreground":""}`,children:[a&&(0,r.jsxs)("span",{className:"text-muted-foreground/30",children:[a,"/"]}),(0,r.jsx)("span",{className:e.undone?"":"text-foreground/70",children:n})]}),(0,r.jsx)("span",{className:"text-muted-foreground/40 shrink-0",children:e.undone?"undone":"create"===e.action?"created":"updated"})]});return o?(0,r.jsx)(i(),{href:`/view/${(0,k.O0)(e.path)}`,className:l,children:d},`${e.path}-${t}`):(0,r.jsx)("div",{className:l,children:d},`${e.path}-${t}`)})})]})}function O(e,t){let s=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(s<1)return t.justNow;if(s<60)return t.minutesAgo(s);let r=Math.floor(s/60);if(r<24)return t.hoursAgo(r);let n=Math.floor(r/24);return t.daysAgo(n)}function W(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0}))}function T(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"/",metaKey:!0,bubbles:!0}))}function I(e,t){let s=0;for(let r of t)r.path.startsWith(`${e}/`)&&(s=Math.max(s,r.mtime));return s}function R({spaces:e,recent:t}){let{t:s}=(0,N.Y)(),[a,p]=(0,n.useState)("recent"),[f,g]=(0,n.useState)(!1),[b,v]=(0,n.useState)(0),y=s.ask?.suggestions??["Summarize this document","List all action items","What are the key points?","Find related notes"];(0,n.useEffect)(()=>{let e=setInterval(()=>{v(e=>(e+1)%y.length)},4e3);return()=>clearInterval(e)},[y.length]);let j=(0,n.useMemo)(()=>{let s=[...e];return"recent"===a?s.sort((e,s)=>{let r=I(e.name,t);return I(s.name,t)-r}):"name"===a?s.sort((e,t)=>e.name.localeCompare(t.name)):"fileCount"===a&&s.sort((e,t)=>t.fileCount-e.fileCount),s},[e,t,a]),w=f?j:j.slice(0,6),A=e=>(0,k.KW)(e,s.home.relativeTime),z=t[0];return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14",children:[(0,r.jsxs)("div",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"w-1 h-7 rounded-full bg-gradient-to-b from-[var(--amber)] to-[var(--amber)]/20"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:s.sidebar.files})]}),(0,r.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 pl-4",children:[(0,r.jsxs)("button",{onClick:T,title:"⌘/",className:"flex-1 flex items-center gap-3 px-4 py-3.5 rounded-xl border border-border/50 shadow-sm bg-card/80 backdrop-blur-sm transition-all duration-200 hover:border-[var(--amber)]/40 hover:shadow-md hover:-translate-y-0.5 group",children:[(0,r.jsx)(o.A,{size:16,className:"shrink-0 text-[var(--amber)] group-hover:scale-110 transition-transform duration-150"}),(0,r.jsx)("div",{className:"flex-1 min-h-[1.5rem] flex items-center",children:(0,r.jsx)("span",{className:"text-sm text-left text-muted-foreground animate-in fade-in duration-300",children:y[b].label},b)}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-mono font-medium bg-[var(--amber-dim)] text-[var(--amber-text)]",children:"⌘/"})]}),(0,r.jsxs)("button",{onClick:W,title:"⌘K",className:"flex items-center gap-2 px-3.5 py-3 rounded-xl border border-border/50 text-sm text-muted-foreground transition-all duration-200 shrink-0 hover:bg-muted/60 hover:shadow-sm hover:-translate-y-0.5",children:[(0,r.jsx)(l.A,{size:14}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono bg-muted",children:"⌘K"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-4 pl-4",children:[(0,r.jsxs)(i(),{href:"/view/Untitled.md",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 hover:shadow-md hover:-translate-y-0.5 bg-[var(--amber)] text-[var(--amber-foreground)]",children:[(0,r.jsx)(d.A,{size:14}),(0,r.jsx)("span",{children:s.home.newNote})]}),z&&(0,r.jsxs)(i(),{href:`/view/${(0,k.O0)(z.path)}`,className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,r.jsx)(c.A,{size:14,className:"text-[var(--amber)]/60"}),(0,r.jsx)("span",{children:s.home.continueEditing}),(0,r.jsx)("span",{className:"text-xs opacity-40 truncate max-w-32",suppressHydrationWarning:!0,children:z.path.split("/").pop()})]})]})]}),(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 mb-5",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-md bg-[var(--amber-subtle)] text-[var(--amber)]",children:(0,r.jsx)(u.A,{size:14})}),(0,r.jsx)("h2",{className:"text-[13px] font-semibold text-foreground tracking-wide",children:s.home.spaces}),e.length>0&&(0,r.jsx)("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-[10px] font-semibold rounded-full bg-muted text-muted-foreground tabular-nums",children:e.length}),(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-3",children:[e.length>0&&(0,r.jsxs)("select",{value:a,onChange:e=>p(e.target.value),className:"text-xs font-medium text-muted-foreground hover:text-foreground cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded px-2 py-1 transition-colors bg-transparent",children:[(0,r.jsx)("option",{value:"recent",children:s.home.sortRecent??"Recent"}),(0,r.jsx)("option",{value:"name",children:s.home.sortName??"A-Z"}),(0,r.jsx)("option",{value:"fileCount",children:s.home.sortCount??"File Count"})]}),(0,r.jsxs)("button",{onClick:()=>window.dispatchEvent(new Event("mindos:create-space")),className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display",children:[(0,r.jsx)(m.A,{size:12}),(0,r.jsx)("span",{children:s.home.newSpace})]})]})]}),0===e.length?(0,r.jsxs)("div",{className:"rounded-xl border border-border/40 bg-card/30 px-6 py-12 text-center",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-[var(--amber-subtle)] mb-4",children:(0,r.jsx)(u.A,{size:22,className:"text-[var(--amber)]/60"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-muted-foreground/70 mb-1",children:s.home.noSpacesYet??"No spaces yet"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/60 mb-4",children:"Create your first space to organize your knowledge"}),(0,r.jsxs)("button",{onClick:()=>window.dispatchEvent(new Event("mindos:create-space")),className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-colors bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-80",children:[(0,r.jsx)(m.A,{size:14}),"Create Space"]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:w.map(e=>{let n=(0,k.IX)(e.name),a=(0,k.vr)(e.name),o=I(e.name,t),l=0===e.fileCount;return(0,r.jsxs)(i(),{href:`/view/${(0,k.O0)(e.path)}`,className:`flex items-start gap-3 px-4 py-3.5 rounded-xl border transition-all duration-200 ${l?"border-dashed border-border/50 opacity-50 hover:opacity-70":"border-border/60 hover:border-[var(--amber)]/30 hover:shadow-md hover:-translate-y-0.5 bg-card/40"}`,children:[n?(0,r.jsx)("span",{className:"text-lg leading-none shrink-0 mt-0.5",suppressHydrationWarning:!0,children:n}):(0,r.jsx)(x.A,{size:16,className:"shrink-0 text-[var(--amber)] mt-0.5"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate block text-foreground",children:a}),e.description&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-0.5",suppressHydrationWarning:!0,children:e.description}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/50 mt-0.5 block tabular-nums",children:[s.home.nFiles(e.fileCount),o>0&&` \xb7 ${A(o)}`]})]})]},e.name)})}),j.length>6&&(0,r.jsxs)("button",{onClick:()=>g(!f),"aria-expanded":f,className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display mt-3",children:[(0,r.jsx)(h.A,{size:12,className:`transition-transform duration-200 ${f?"rotate-180":""}`}),(0,r.jsx)("span",{children:f?s.home.showLess:s.home.showMore})]})]})]}),(0,r.jsx)(F,{}),(0,r.jsx)(B,{formatTime:A}),(0,r.jsx)("div",{className:"border-t border-border/30 mb-8"}),t.length>0&&(0,r.jsx)(q,{recent:t,formatTime:A}),(0,r.jsxs)("div",{className:"py-6 border-t border-border/20 flex items-center gap-1.5 text-xs font-display text-muted-foreground/30",children:[(0,r.jsx)(o.A,{size:10,className:"text-[var(--amber)]/40"}),(0,r.jsx)("span",{children:s.app.footer})]})]})}function P({icon:e,children:t,count:s,action:n}){return(0,r.jsxs)("div",{className:"flex items-center gap-2.5 mb-4",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-md bg-[var(--amber-subtle)] text-[var(--amber)]",children:e}),(0,r.jsx)("h2",{className:"text-[13px] font-semibold text-foreground tracking-wide",children:t}),null!=s&&s>0&&(0,r.jsx)("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-[10px] font-semibold rounded-full bg-muted text-muted-foreground tabular-nums",children:s}),n?(0,r.jsx)("div",{className:"ml-auto",children:n}):null]})}function B({formatTime:e}){let{t}=(0,N.Y)(),{pinnedFiles:s,removePin:n}=(0,j.Z)();return 0===s.length?null:(0,r.jsxs)("section",{className:"mb-8",children:[(0,r.jsx)(P,{icon:(0,r.jsx)(p.A,{size:14}),count:s.length,children:t.pinnedFiles.title}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:s.map(e=>{let s=e.split("/").pop()||e,a=e.split("/").slice(0,-1).join("/"),o=e.endsWith(".csv");return(0,r.jsxs)("div",{className:"group/pin relative",children:[(0,r.jsxs)(i(),{href:`/view/${(0,k.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted overflow-hidden",children:[(0,r.jsx)(p.A,{size:12,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)]"}),o?(0,r.jsx)(f.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(g.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:s}),a&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:a})]})]}),(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(e)},className:"absolute right-2 top-1/2 -translate-y-1/2 hidden group-hover/pin:flex p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:t.pinnedFiles.removedToast,children:(0,r.jsx)(b.A,{size:12})})]},e)})})]})}function q({recent:e,formatTime:t}){let{t:s}=(0,N.Y)(),[a,o]=(0,n.useState)(!1);return(0,r.jsxs)("section",{className:"mb-8",children:[(0,r.jsx)(P,{icon:(0,r.jsx)(v.A,{size:14}),count:e.length,action:(0,r.jsxs)(i(),{href:"/changes",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80",children:[(0,r.jsx)(y.A,{size:12}),(0,r.jsx)("span",{children:s.home.changeHistory})]}),children:s.home.recentlyEdited}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:(a?e:e.slice(0,8)).map(({path:e,mtime:s})=>{let n=e.split("/").pop()||e,a=e.split("/").slice(0,-1).join("/"),o=e.endsWith(".csv");return(0,r.jsxs)(i(),{href:`/view/${(0,k.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group overflow-hidden",children:[o?(0,r.jsx)(f.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(g.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:n}),a&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:a})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums text-muted-foreground/40",suppressHydrationWarning:!0,children:t(s)})]},e)})}),e.length>8&&(0,r.jsxs)("button",{onClick:()=>o(e=>!e),"aria-expanded":a,className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer mt-2 ml-1",children:[(0,r.jsx)(h.A,{size:12,className:`transition-transform duration-200 ${a?"rotate-180":""}`}),(0,r.jsx)("span",{children:a?s.home.showLess:s.home.showMore})]})]})}},21362:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},21628:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},21975:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},29494:(e,t,s)=>{"use strict";s.d(t,{Q:()=>n});var r=s(4235);async function n(e,t){let s=[],n=0;for(let t of e){if(t.size>0xa00000){n++;continue}try{if(t.name.toLowerCase().endsWith(".pdf")){let e=await t.arrayBuffer();s.push({name:t.name,content:function(e){let t=new Uint8Array(e),s=[];for(let e=0;e<t.length;e+=8192)s.push(String.fromCharCode(...t.subarray(e,e+8192)));return btoa(s.join(""))}(e),encoding:"base64"})}else{let e=await t.text();s.push({name:t.name,content:e})}}catch{}}if(0===s.length)return void(n>0?r.oR.error(t.inbox.tooLarge(n),4e3):e.length>0&&r.oR.error(t.inbox.saveFailed,4e3));try{var a;let e=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:s})});if(!e.ok){let s=await e.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",s.error),r.oR.error(t.inbox.saveFailed,4e3);return}let i=await e.json(),o=i.saved?.length??0,l=i.skipped?.length??0;a=n,o>0&&a>0&&0===l?r.oR.success(t.inbox.savedWithOversized(o,a),4e3):o>0&&l+a>0?r.oR.success(t.inbox.savedWithSkipped(o,l+a),4e3):o>0?r.oR.success(t.inbox.savedToast(o),3e3):(a>0&&r.oR.error(t.inbox.tooLarge(a),4e3),l>0&&r.oR.error(t.inbox.savedWithSkipped(0,l),4e3),0===a&&0===l&&r.oR.error(t.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(e){console.error("[QuickDrop] Network error:",e),r.oR.error(t.inbox.saveFailed,4e3)}}},33078:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]])},33210:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},38549:(e,t,s)=>{Promise.resolve().then(s.bind(s,19257))},42129:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},48368:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},50538:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},51914:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},59511:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("folder-input",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]])},61878:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},78520:(e,t,s)=>{"use strict";s.d(t,{D4:()=>i,FB:()=>n,W8:()=>o,g4:()=>l,jQ:()=>c});let r="mindos:organize-history";function n(){try{let e=localStorage.getItem(r);if(!e)return[];return JSON.parse(e)}catch{return[]}}function a(e){try{localStorage.setItem(r,JSON.stringify(e.slice(0,50)))}catch{}}function i(e){let t=n();t.unshift(e);let s=t.slice(0,50);return a(s),s}function o(e,t){let s=n(),r=s.findIndex(t=>t.id===e);return r>=0&&(s[r]={...s[r],...t},a(s)),s}function l(){try{localStorage.removeItem(r)}catch{}}let d=0;function c(){return`org-${Date.now()}-${++d}`}},84980:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},86901:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])},90718:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]])},91337:(e,t,s)=>{"use strict";s.d(t,{IX:()=>l,KW:()=>o,O0:()=>i,cn:()=>a,vr:()=>d});var r=s(29722),n=s(622);function a(...e){return(0,n.QP)((0,r.$)(e))}function i(e){return e.split("/").map(encodeURIComponent).join("/")}function o(e,t){let s=Date.now()-e,r=Math.floor(s/6e4),n=Math.floor(s/36e5),a=Math.floor(s/864e5);return r<1?t.justNow:r<60?t.minutesAgo(r):n<24?t.hoursAgo(n):a<7?t.daysAgo(a):new Date(e).toLocaleDateString()}function l(e){let t=e.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return t?.[0]??""}function d(e){return e.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||e}},93631:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]])},94290:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(90425).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])}},e=>{e.O(0,[4237,8409,5581,8441,3794,7358],()=>e(e.s=38549)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44,160,165,635,706,910,1124,1131,1165,1212,1288,2036,2287,2437,2522,2772,2920,2950,3358,3390,3757,3896,3945,4048,4209,4230,4473,4503,4558,4888,4896,5177,5245,5411,5620,5684,5704,5931,6202,6306,6819,6828,6988,7330,7538,7581,7607,7646,7711,7822,7839,7851,8167,8181,8232,8616,8641,9120,9188,9303,9491,9596,9725,9861,9968],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);