decocms 2.138.1 → 2.158.0

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 (275) hide show
  1. package/README.md +417 -40
  2. package/dist/README.md +295 -0
  3. package/dist/client/assets/AlertCircle-DsQlVvig.js +1 -0
  4. package/dist/client/assets/AlignLeft-Cvo6EEA1.js +1 -0
  5. package/dist/client/assets/ArrowDown-KTP4HONB.js +1 -0
  6. package/dist/client/assets/ArrowLeft-CR3SWku2.js +1 -0
  7. package/dist/client/assets/ArrowUp-BfaawFDM.js +1 -0
  8. package/dist/client/assets/Check-OSWZCZf9.js +1 -0
  9. package/dist/client/assets/CheckCircle-B2wkNkz_.js +1 -0
  10. package/dist/client/assets/CheckDone01-j6DaSyTU.js +1 -0
  11. package/dist/client/assets/CheckVerified02-D6qy17me.js +1 -0
  12. package/dist/client/assets/ChevronDown-BR4cCk-W.js +1 -0
  13. package/dist/client/assets/ChevronLeft-D4Ua6sXw.js +1 -0
  14. package/dist/client/assets/ChevronRight-ByOuE_Vi.js +1 -0
  15. package/dist/client/assets/Clock-BEpmd0mM.js +1 -0
  16. package/dist/client/assets/Code01-BsBlwdG0.js +1 -0
  17. package/dist/client/assets/CommitMono-VariableFont-ytizKI8U.woff2 +0 -0
  18. package/dist/client/assets/Container-BVSlDn4p.js +1 -0
  19. package/dist/client/assets/Copy01-B595Thpy.js +1 -0
  20. package/dist/client/assets/Dataflow03-DW4Gd5sB.js +1 -0
  21. package/dist/client/assets/DotsHorizontal-0eyRqScK.js +1 -0
  22. package/dist/client/assets/DotsVertical-Cshw63SI.js +1 -0
  23. package/dist/client/assets/Download01-DFmX-SGA.js +1 -0
  24. package/dist/client/assets/Edit01-BzJXGmI-.js +1 -0
  25. package/dist/client/assets/Edit05-BKDqgNc4.js +1 -0
  26. package/dist/client/assets/Eye-CHYeRDXI.js +1 -0
  27. package/dist/client/assets/File02-ZK3-99s4.js +1 -0
  28. package/dist/client/assets/File06-B7IZdrgj.js +1 -0
  29. package/dist/client/assets/FilterLines-pJtef_Pv.js +1 -0
  30. package/dist/client/assets/Globe01-p5f8j_mm.js +1 -0
  31. package/dist/client/assets/Globe02-D7s1ULQJ.js +1 -0
  32. package/dist/client/assets/Grid01-DIGu5eh8.js +1 -0
  33. package/dist/client/assets/Hash02-CkWXLlvG.js +1 -0
  34. package/dist/client/assets/Home02-DiSPSdMx.js +1 -0
  35. package/dist/client/assets/Image01-4wUrHqw6.js +1 -0
  36. package/dist/client/assets/Inbox01-csEiEq63.js +1 -0
  37. package/dist/client/assets/InfoCircle-s0XyUQYC.js +1 -0
  38. package/dist/client/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
  39. package/dist/client/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
  40. package/dist/client/assets/Key01-BP2mhRrj.js +1 -0
  41. package/dist/client/assets/LayersTwo01-C4CgBsBK.js +1 -0
  42. package/dist/client/assets/LayoutLeft-DzzE993C.js +1 -0
  43. package/dist/client/assets/Link01-CHaReCKl.js +1 -0
  44. package/dist/client/assets/LinkExternal01-Cj5yLC8K.js +1 -0
  45. package/dist/client/assets/List-BnvhY7Nh.js +1 -0
  46. package/dist/client/assets/Loading01-aMp99RZI.js +1 -0
  47. package/dist/client/assets/Lock01-STjQUMU6.js +1 -0
  48. package/dist/client/assets/Play-Dr8AlTmi.js +1 -0
  49. package/dist/client/assets/Plus-Dp8Rr75G.js +1 -0
  50. package/dist/client/assets/RefreshCcw01-DDGad8lb.js +1 -0
  51. package/dist/client/assets/Save01-36pjbcKA.js +1 -0
  52. package/dist/client/assets/SearchMd-r7i5BQk7.js +1 -0
  53. package/dist/client/assets/Settings01-DKTz1YSf.js +1 -0
  54. package/dist/client/assets/Shield01-J7QygUij.js +1 -0
  55. package/dist/client/assets/Terminal-CtjH6zFY.js +1 -0
  56. package/dist/client/assets/Trash01-DJTe1fKw.js +1 -0
  57. package/dist/client/assets/Upload01-BEhQSPeB.js +1 -0
  58. package/dist/client/assets/Users03-CG_islph.js +1 -0
  59. package/dist/client/assets/X-DjDetE_c.js +1 -0
  60. package/dist/client/assets/XCircle-CSLSI6pa.js +1 -0
  61. package/dist/client/assets/XClose-dSJ6zVxj.js +1 -0
  62. package/dist/client/assets/Zap-BdJ17pmL.js +1 -0
  63. package/dist/client/assets/agent-connections-preview-DB81vdUX.js +1 -0
  64. package/dist/client/assets/agent-detail-BAru2zv4.js +2 -0
  65. package/dist/client/assets/agents-DTLxCfRX.js +1 -0
  66. package/dist/client/assets/alert-dialog-Bbrwo05x.js +7 -0
  67. package/dist/client/assets/auth-catchall-BETKUynS.js +1 -0
  68. package/dist/client/assets/avatar-D94UEcg7.js +1 -0
  69. package/dist/client/assets/badge-DxYG_XB9.js +1 -0
  70. package/dist/client/assets/binder-wDmRPNL2.js +1 -0
  71. package/dist/client/assets/breadcrumb-BrsAPde7.js +1 -0
  72. package/dist/client/assets/card-CkYe6Ikt.js +1 -0
  73. package/dist/client/assets/chart-DnUFHI2d.js +15 -0
  74. package/dist/client/assets/checkbox-DhgSL5Cz.js +1 -0
  75. package/dist/client/assets/circle-alert-CgP-qNn-.js +1 -0
  76. package/dist/client/assets/collapsible-DYgsVB3N.js +1 -0
  77. package/dist/client/assets/collection-detail-D5XIUYKg.js +26 -0
  78. package/dist/client/assets/collection-display-button-DEx37m4V.js +1 -0
  79. package/dist/client/assets/collection-search-DXvW2iQG.js +1 -0
  80. package/dist/client/assets/collection-tab-CNXNROrc.js +1 -0
  81. package/dist/client/assets/collection-table-wrapper-xKuLiuQ5.js +1 -0
  82. package/dist/client/assets/collection-tabs-BEqvkJum.js +1 -0
  83. package/dist/client/assets/command-wAVHsF2T.js +1 -0
  84. package/dist/client/assets/connect-yoERnUTv.js +1 -0
  85. package/dist/client/assets/connection-card--y0YdfEA.js +1 -0
  86. package/dist/client/assets/connection-detail-1Ku6b0Wl.js +1 -0
  87. package/dist/client/assets/connection-status-Cq0AmCwK.js +1 -0
  88. package/dist/client/assets/connections-Cih6wM0L.js +1 -0
  89. package/dist/client/assets/constants-BBAQxhFl.js +1 -0
  90. package/dist/client/assets/constants-_xTq0aTt.js +1 -0
  91. package/dist/client/assets/context-Bk-UzwLO.js +29 -0
  92. package/dist/client/assets/create-organization-dialog-D50lIYTQ.js +1 -0
  93. package/dist/client/assets/create-project-dialog-B3BGNP1R.js +1 -0
  94. package/dist/client/assets/danger-DuT5kBaU.js +1 -0
  95. package/dist/client/assets/danger-zone-Cjq5A9rY.js +1 -0
  96. package/dist/client/assets/decopilot-events-BrbCILIn.js +1 -0
  97. package/dist/client/assets/dependencies-BXhkBUyi.js +1 -0
  98. package/dist/client/assets/dialog-B-Kp8Cuq.js +1 -0
  99. package/dist/client/assets/differenceInSeconds-NQ4PDo0z.js +1 -0
  100. package/dist/client/assets/dropdown-menu-DjhC4m2a.js +1 -0
  101. package/dist/client/assets/dynamic-plugin-layout-DRpqAaco.js +1 -0
  102. package/dist/client/assets/editable-task-title-CWlhOc5Q.js +16 -0
  103. package/dist/client/assets/empty-state-680W7nUY.js +1 -0
  104. package/dist/client/assets/env-vars-editor-BRxwCr-L.js +1 -0
  105. package/dist/client/assets/estree-CwOGYdhi.js +44 -0
  106. package/dist/client/assets/extract-connection-data-DUglufvW.js +1 -0
  107. package/dist/client/assets/file-browser-BLB4FkOU.js +2 -0
  108. package/dist/client/assets/form-DK8WrQI3.js +1 -0
  109. package/dist/client/assets/format-time-CMKyl-GC.js +1 -0
  110. package/dist/client/assets/formatDistanceToNow-Cb2QZZJn.js +1 -0
  111. package/dist/client/assets/general-DonW35nE.js +1 -0
  112. package/dist/client/assets/generate-id-Dyweu44Y.js +1 -0
  113. package/dist/client/assets/github-icon-Dp3wHhYE.js +1 -0
  114. package/dist/client/assets/grid-view-CqJSMZVQ.js +1 -0
  115. package/dist/client/assets/home-DIVCSvrl.js +1 -0
  116. package/dist/client/assets/icon-picker-DvkCVh_W.js +1 -0
  117. package/dist/client/assets/index-B84Dx7nI.js +218 -0
  118. package/dist/client/assets/index-BGwf3l_M.js +1 -0
  119. package/dist/client/assets/index-BPI27S5s.js +25 -0
  120. package/dist/client/assets/index-BmSASrPR.js +1 -0
  121. package/dist/client/assets/index-C8u6axf-.js +1 -0
  122. package/dist/client/assets/index-CcaZ2Rhp.css +1 -0
  123. package/dist/client/assets/index-CmH5OQnm.js +1 -0
  124. package/dist/client/assets/index-D9XxJ5Op.js +1 -0
  125. package/dist/client/assets/index-DA_JOtb0.js +1 -0
  126. package/dist/client/assets/index-SKwvOtlz.js +184 -0
  127. package/dist/client/assets/infiniteQueryObserver-DenS4T97.js +1 -0
  128. package/dist/client/assets/input-NIbTU7RU.js +1 -0
  129. package/dist/client/assets/integration-icon-DNJkhUIt.js +1 -0
  130. package/dist/client/assets/label-B6R7vHKQ.js +1 -0
  131. package/dist/client/assets/layout-CECSvrhq.js +1 -0
  132. package/dist/client/assets/layout-CMdmqG4j.js +1 -0
  133. package/dist/client/assets/localstorage-keys-BckSA5cs.js +1 -0
  134. package/dist/client/assets/login-BfEg3qXN.js +1 -0
  135. package/dist/client/assets/markdown-Cqv1T19z.js +29 -0
  136. package/dist/client/assets/marked.esm-BaswSlok.js +56 -0
  137. package/dist/client/assets/mcp-app-renderer-gG-wM7zZ.js +11 -0
  138. package/dist/client/assets/mcp-server-card-M7WdUx8I.js +1 -0
  139. package/dist/client/assets/mcp-server-detail-D73ue2Yz.js +2 -0
  140. package/dist/client/assets/members-Buq9RcXv.js +3 -0
  141. package/dist/client/assets/monaco-editor-BXv0Xqkq.js +19 -0
  142. package/dist/client/assets/monitoring-CEhjsxOM.js +31 -0
  143. package/dist/client/assets/monitoring-dashboard-edit-BntH-KiR.js +1 -0
  144. package/dist/client/assets/monitoring-dashboard-view-Bw3iwoxc.js +4 -0
  145. package/dist/client/assets/oauth-callback-D455SJn4.js +1 -0
  146. package/dist/client/assets/page-C-6ciKw-.js +1 -0
  147. package/dist/client/assets/page-DrITT5mj.js +1 -0
  148. package/dist/client/assets/plugin-empty-state-BLzOpmuv.js +1 -0
  149. package/dist/client/assets/plugin-empty-state-D73E0OXs.js +1 -0
  150. package/dist/client/assets/plugin-header-DkXBoQof.js +1 -0
  151. package/dist/client/assets/plugin-header-_N_-KJkN.js +1 -0
  152. package/dist/client/assets/plugins-D4w2xHCL.js +1 -0
  153. package/dist/client/assets/popover-D7xgfP4W.js +1 -0
  154. package/dist/client/assets/project-app-view-DWi5m8l8.js +1 -0
  155. package/dist/client/assets/project-layout-CWEThOiP.js +1 -0
  156. package/dist/client/assets/project-plugins-BKPLJXFp.js +1 -0
  157. package/dist/client/assets/projects-list-Y8k15POh.js +1 -0
  158. package/dist/client/assets/purify.es-C0_7NiBM.js +2 -0
  159. package/dist/client/assets/readme-viewer-DWnTz46N.css +1 -0
  160. package/dist/client/assets/readme-viewer-WWU4z7Xg.js +1 -0
  161. package/dist/client/assets/registry-layout-D_LH6ewr.js +5 -0
  162. package/dist/client/assets/registry-utils-CMqg9IHN.js +1 -0
  163. package/dist/client/assets/reports-layout-B3u5OkMC.js +3 -0
  164. package/dist/client/assets/reset-password-Cm7BWULq.js +1 -0
  165. package/dist/client/assets/resizable-pH8vbRAI.js +1 -0
  166. package/dist/client/assets/save-actions-CTDUNaiW.js +1 -0
  167. package/dist/client/assets/scroll-area-DOWQyO2m.js +1 -0
  168. package/dist/client/assets/select-1y3LRFgk.js +1 -0
  169. package/dist/client/assets/shell-layout-B6SbKq-6.js +3 -0
  170. package/dist/client/assets/sidebar-settings-BZx3Z8UA.js +1 -0
  171. package/dist/client/assets/skeleton-CMw17Qjd.js +1 -0
  172. package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
  173. package/dist/client/assets/spinner-DiXeE5Xk.js +1 -0
  174. package/dist/client/assets/standalone-DS4gw9AE.js +29 -0
  175. package/dist/client/assets/store-invite-BdRmGVAy.js +1 -0
  176. package/dist/client/assets/switch-BA80KxP2.js +1 -0
  177. package/dist/client/assets/table-vuF1fVQ6.js +1 -0
  178. package/dist/client/assets/tabs-D3RTRDyW.js +1 -0
  179. package/dist/client/assets/tasks-C_CW4iPq.js +1 -0
  180. package/dist/client/assets/tasks-panel-D3YXt5j8.js +1 -0
  181. package/dist/client/assets/textarea-BW2ziFqJ.js +1 -0
  182. package/dist/client/assets/time-range-picker-CZg_Yx1g.js +5 -0
  183. package/dist/client/assets/toggle-group-DO86EMeS.js +1 -0
  184. package/dist/client/assets/tools-list-BzLGkrz5.js +1 -0
  185. package/dist/client/assets/tooltip-CHJhCJL3.js +1 -0
  186. package/dist/client/assets/topbar-portal-BomQ7YMR.js +1 -0
  187. package/dist/client/assets/types-DibruoFW.js +155 -0
  188. package/dist/client/assets/typescript-Ca_eWjgL.js +21 -0
  189. package/dist/client/assets/unwrap-tool-result-BYXdCQMg.js +1 -0
  190. package/dist/client/assets/usage-B8eRkRZY.js +1 -0
  191. package/dist/client/assets/use-binding-Bdb-0lwc.js +1 -0
  192. package/dist/client/assets/use-collections-BoFyuDa6.js +1 -0
  193. package/dist/client/assets/use-connection-DSPQNIQD.js +1 -0
  194. package/dist/client/assets/use-copy-Ba97e-kV.js +1 -0
  195. package/dist/client/assets/use-create-virtual-mcp-Cf71AE6l.js +1 -0
  196. package/dist/client/assets/use-install-from-registry-B6NE77_0.js +1 -0
  197. package/dist/client/assets/use-list-state-kborONTL.js +1 -0
  198. package/dist/client/assets/use-llm-CKGJlXuC.js +1 -0
  199. package/dist/client/assets/use-mcp-prompts-C___IsDE.js +1 -0
  200. package/dist/client/assets/use-mcp-tools-K2l5CqFr.js +1 -0
  201. package/dist/client/assets/use-members-DajocvHM.js +1 -0
  202. package/dist/client/assets/use-mobile-DznYZ63b.js +1 -0
  203. package/dist/client/assets/use-preferences-BfaOwWT4.js +1 -0
  204. package/dist/client/assets/use-project-DZlIfmd3.js +1 -0
  205. package/dist/client/assets/use-settings-modal-C2h2dbTq.js +1 -0
  206. package/dist/client/assets/use-view-mode-3gfyljcZ.js +1 -0
  207. package/dist/client/assets/use-virtual-mcp-5EdNqvyH.js +1 -0
  208. package/dist/client/assets/useInfiniteQuery-CFRJ66U9.js +1 -0
  209. package/dist/client/assets/useMutation-Be5QSQym.js +1 -0
  210. package/dist/client/assets/useQuery-CIRdCYZz.js +1 -0
  211. package/dist/client/assets/useSuspenseInfiniteQuery-CQgxvKZn.js +1 -0
  212. package/dist/client/assets/user-CY9QFLJr.js +1 -0
  213. package/dist/client/assets/workflow-Db4yuI9S.js +1 -0
  214. package/dist/client/empty-state-cards.png +0 -0
  215. package/dist/client/empty-state-error.svg +19 -0
  216. package/dist/client/empty-state-home.png +0 -0
  217. package/dist/client/empty-state-logs.svg +80 -0
  218. package/dist/client/empty-state-openrouter.svg +320 -0
  219. package/dist/client/empty-state-success-muted.svg +19 -0
  220. package/dist/client/empty-state-success.svg +19 -0
  221. package/dist/client/emptystate-mcp.svg +33 -0
  222. package/dist/client/favicon.svg +5 -0
  223. package/dist/client/globe.svg +4 -0
  224. package/dist/client/icons/capy-0.png +0 -0
  225. package/dist/client/icons/capy-1.png +0 -0
  226. package/dist/client/icons/capy-10.png +0 -0
  227. package/dist/client/icons/capy-11.png +0 -0
  228. package/dist/client/icons/capy-12.png +0 -0
  229. package/dist/client/icons/capy-13.png +0 -0
  230. package/dist/client/icons/capy-14.png +0 -0
  231. package/dist/client/icons/capy-15.png +0 -0
  232. package/dist/client/icons/capy-16.png +0 -0
  233. package/dist/client/icons/capy-17.png +0 -0
  234. package/dist/client/icons/capy-18.png +0 -0
  235. package/dist/client/icons/capy-19.png +0 -0
  236. package/dist/client/icons/capy-2.png +0 -0
  237. package/dist/client/icons/capy-20.png +0 -0
  238. package/dist/client/icons/capy-21.png +0 -0
  239. package/dist/client/icons/capy-22.png +0 -0
  240. package/dist/client/icons/capy-23.png +0 -0
  241. package/dist/client/icons/capy-24.png +0 -0
  242. package/dist/client/icons/capy-25.png +0 -0
  243. package/dist/client/icons/capy-26.png +0 -0
  244. package/dist/client/icons/capy-27.png +0 -0
  245. package/dist/client/icons/capy-28.png +0 -0
  246. package/dist/client/icons/capy-29.png +0 -0
  247. package/dist/client/icons/capy-3.png +0 -0
  248. package/dist/client/icons/capy-30.png +0 -0
  249. package/dist/client/icons/capy-31.png +0 -0
  250. package/dist/client/icons/capy-32.png +0 -0
  251. package/dist/client/icons/capy-33.png +0 -0
  252. package/dist/client/icons/capy-34.png +0 -0
  253. package/dist/client/icons/capy-35.png +0 -0
  254. package/dist/client/icons/capy-36.png +0 -0
  255. package/dist/client/icons/capy-37.png +0 -0
  256. package/dist/client/icons/capy-38.png +0 -0
  257. package/dist/client/icons/capy-4.png +0 -0
  258. package/dist/client/icons/capy-5.png +0 -0
  259. package/dist/client/icons/capy-6.png +0 -0
  260. package/dist/client/icons/capy-7.png +0 -0
  261. package/dist/client/icons/capy-8.png +0 -0
  262. package/dist/client/icons/capy-9.png +0 -0
  263. package/dist/client/index.html +12 -0
  264. package/dist/client/logos/Claude Code.svg +3 -0
  265. package/dist/client/logos/Windsurf.svg +3 -0
  266. package/dist/client/logos/cursor.svg +3 -0
  267. package/dist/client/logos/deco logo.svg +4 -0
  268. package/dist/client/sounds/notification.mp3 +0 -0
  269. package/dist/client/store-empty-state.svg +109 -0
  270. package/dist/client/verified-badge.svg +4 -0
  271. package/dist/server/cli.js +2143 -0
  272. package/dist/server/migrate.js +2001 -0
  273. package/dist/server/server.js +1922 -0
  274. package/package.json +141 -24
  275. package/bin/deco.js +0 -33
@@ -0,0 +1 @@
1
+ import"./constants-BBAQxhFl.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-CMqg9IHN.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-CqJSMZVQ.js","assets/index-B84Dx7nI.js","assets/index-CcaZ2Rhp.css","assets/topbar-portal-BomQ7YMR.js","assets/AlertCircle-DsQlVvig.js","assets/Download01-DFmX-SGA.js","assets/File02-ZK3-99s4.js","assets/File06-B7IZdrgj.js","assets/Image01-4wUrHqw6.js","assets/Loading01-aMp99RZI.js","assets/Trash01-DJTe1fKw.js","assets/Upload01-BEhQSPeB.js","assets/useMutation-Be5QSQym.js","assets/useQuery-CIRdCYZz.js","assets/useInfiniteQuery-CFRJ66U9.js","assets/infiniteQueryObserver-DenS4T97.js","assets/checkbox-DhgSL5Cz.js","assets/Check-OSWZCZf9.js","assets/ChevronRight-ByOuE_Vi.js","assets/Grid01-DIGu5eh8.js","assets/Home02-DiSPSdMx.js","assets/List-BnvhY7Nh.js"])))=>i.map(i=>d[i]);
2
+ import{r as M,c as K,bY as A,w as Y,x as D,j as t,B as _,z as Q,bZ as X,ar as ee}from"./index-B84Dx7nI.js";import{u as J}from"./topbar-portal-BomQ7YMR.js";import{u as te}from"./useInfiniteQuery-CFRJ66U9.js";import{C as U}from"./checkbox-DhgSL5Cz.js";import{i as se}from"./AlertCircle-DsQlVvig.js";import{i as ae}from"./ChevronRight-ByOuE_Vi.js";import{n as ie}from"./Download01-DFmX-SGA.js";import{i as re}from"./File02-ZK3-99s4.js";import{c as G}from"./Grid01-DIGu5eh8.js";import{a as oe}from"./Home02-DiSPSdMx.js";import{i as V}from"./List-BnvhY7Nh.js";import{i as L}from"./Loading01-aMp99RZI.js";import{s as W}from"./Trash01-DJTe1fKw.js";import{i as $}from"./Upload01-BEhQSPeB.js";import{u as q}from"./useMutation-Be5QSQym.js";const Z=({size:s=24,color:e="currentColor",...i})=>M.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},M.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,i=!1,o=100)=>["object-storage","objects",s,e,{flat:i,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},ne=100;function le(s){const e=K.c(30);let i;e[0]!==s?(i=s===void 0?{}:s,e[0]=s,e[1]=i):i=e[1];const o=i,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?ne:d,{connectionId:b,toolCaller:S}=J();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async a=>{const{pageParam:r}=a;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:ge,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:z,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:w}=te(E);let v;if(l){let a;e[15]!==p?.pages?(a=p?.pages.flatMap(he).filter(pe).map(xe)??[],e[15]=p?.pages,e[16]=a):a=e[16],v=a}else{let a;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(ue)??[],j=p?.pages.flatMap(de)??[];a=[...r.sort(ce),...j],e[17]=p?.pages,e[18]=a}else a=e[18];v=a}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,F=y??!1,P=w;let k;return e[23]!==g||e[24]!==z||e[25]!==C||e[26]!==v||e[27]!==P||e[28]!==F?(k={objects:v,isLoading:z,isFetchingMore:g,hasMore:F,loadMore:C,error:P},e[23]=g,e[24]=z,e[25]=C,e[26]=v,e[27]=P,e[28]=F,e[29]=k):k=e[29],k}function ce(s,e){return s.key.localeCompare(e.key)}function de(s){return(s.objects??[]).filter(fe).map(me)}function me(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function fe(s){return!s.key.endsWith("/")}function ue(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function xe(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function pe(s){return!s.key.endsWith("/")}function he(s){return s.objects??[]}function ge(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function je(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(s)/Math.log(i));return`${parseFloat((s/Math.pow(i,o)).toFixed(1))} ${e[o]}`}function ye(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ve(s){const e=[],i=s.split("/").filter(Boolean);let o="";for(const n of i)o+=n+"/",e.push({name:n,path:o});return e}function Re(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const Ne=M.lazy(()=>X(()=>import("./grid-view-CqJSMZVQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])));function be(s){const e=K.c(50),{item:i,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==i.key||e[1]!==c?(b=c?i.key:I(i.key),e[0]=i.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(U,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==i.isFolder||e[7]!==i.key||e[8]!==d?(u=()=>i.isFolder?d(i.key):void 0,e[6]=i.isFolder,e[7]=i.key,e[8]=d,e[9]=u):u=e[9];const E=i.isFolder&&"cursor-pointer hover:text-primary";let p;e[10]!==E?(p=Q("flex items-center gap-2 flex-1 min-w-0 text-left",E),e[10]=E,e[11]=p):p=e[11];let z;e[12]!==i.isFolder?(z=i.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(re,{size:18,className:"text-muted-foreground shrink-0"}),e[12]=i.isFolder,e[13]=z):z=e[13];let g;e[14]!==S?(g=t.jsx("span",{className:"truncate",children:S}),e[14]=S,e[15]=g):g=e[15];let y;e[16]!==u||e[17]!==p||e[18]!==z||e[19]!==g?(y=t.jsxs("button",{type:"button",onClick:u,className:p,children:[z,g]}),e[16]=u,e[17]=p,e[18]=z,e[19]=g,e[20]=y):y=e[20];let h;e[21]!==i.isFolder||e[22]!==i.size?(h=i.isFolder?"-":je(i.size),e[21]=i.isFolder,e[22]=i.size,e[23]=h):h=e[23];let w;e[24]!==h?(w=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:h}),e[24]=h,e[25]=w):w=e[25];let v;e[26]!==i.isFolder||e[27]!==i.lastModified?(v=i.isFolder?"-":ye(i.lastModified),e[26]=i.isFolder,e[27]=i.lastModified,e[28]=v):v=e[28];let N;e[29]!==v?(N=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:v}),e[29]=v,e[30]=N):N=e[30];let C;e[31]!==i.isFolder||e[32]!==i.key||e[33]!==m?(C=!i.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(i.key),children:t.jsx(ie,{size:14})}),e[31]=i.isFolder,e[32]=i.key,e[33]=m,e[34]=C):C=e[34];let F;e[35]!==i.key||e[36]!==l?(F=()=>l(i.key),e[35]=i.key,e[36]=l,e[37]=F):F=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[38]=P):P=e[38];let k;e[39]!==F?(k=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F,children:P}),e[39]=F,e[40]=k):k=e[40];let a;e[41]!==C||e[42]!==k?(a=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[C,k]}),e[41]=C,e[42]=k,e[43]=a):a=e[43];let r;return e[44]!==w||e[45]!==N||e[46]!==a||e[47]!==f||e[48]!==y?(r=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,y,w,N,a]}),e[44]=w,e[45]=N,e[46]=a,e[47]=f,e[48]=y,e[49]=r):r=e[49],r}function H(s){const e=K.c(8),{prefix:i,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==i){const x=ve(i);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(oe,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:Q("hover:text-primary",b===x.length-1?"font-medium text-foreground":"text-muted-foreground"),children:c.name})]},c.path))]}),e[0]=o,e[1]=i,e[2]=n}else n=e[2];return n}function ke(){const{path:s="",flat:e=!1,view:i="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=a=>{x(new Set),o({to:"/",search:{path:a||void 0,flat:e,view:i}})},m=a=>{x(new Set),o({to:"/",search:{path:a?void 0:s||void 0,flat:a,view:i}})},l=a=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:a}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=J(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:z,loadMore:g,error:y}=le({prefix:s,flat:e}),h=q({mutationFn:async a=>{const r=s+a.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:a.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:a,headers:{"Content-Type":a.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:a=>{D.success(`Uploaded ${I(a)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Upload failed: ${a.message}`)}}),w=q({mutationFn:async a=>a.length===1&&a[0]?f("DELETE_OBJECT",{key:a[0]}):f("DELETE_OBJECTS",{keys:a}),onSuccess:()=>{D.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Delete failed: ${a.message}`)}}),v=async a=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:a}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),B=document.createElement("a");B.href=O,B.download=I(a),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(O)}catch(r){D.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=a=>{const r=a.target.files;if(r){for(const j of Array.from(r))h.mutate(j);a.target.value=""}},C=(a,r)=>{const j=new Set(n);r?j.add(a):j.delete(a),x(j)},F=a=>{x(a?new Set(u.map(r=>r.key)):new Set)},P=()=>{n.size!==0&&w.mutate(Array.from(n))},k=a=>{if(!z||p)return;const r=a.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):i==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(M.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ne,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(_,{variant:"outline",size:"sm",className:"text-destructive",onClick:P,disabled:w.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(U,{checked:n.size>0&&n.size===u.length,onCheckedChange:F}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx(L,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(_,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx($,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(a=>t.jsx(be,{item:a,selected:n.has(a.key),showFullPath:e,onSelect:r=>C(a.key,r),onNavigate:d,onDownload:v,onDelete:r=>w.mutate([r])},a.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(L,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const Ie=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{R as K,Re as a,Ie as b,je as f,I as g,Z as s,le as u};
@@ -0,0 +1 @@
1
+ import{F as C,c as f,j as c,G as j,r as d,z as p,H as v,I as b,J as h}from"./index-B84Dx7nI.js";import{L as N}from"./label-B6R7vHKQ.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=b();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(v,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
@@ -0,0 +1 @@
1
+ import{d as e}from"./differenceInSeconds-NQ4PDo0z.js";function f(r){const o=e(new Date,r);return o<60?"<1m":o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:o<604800?`${Math.floor(o/86400)}d ago`:o<2592e3?`${Math.floor(o/604800)}w ago`:o<31536e3?`${Math.floor(o/2592e3)}mo ago`:`${Math.floor(o/31536e3)}y ago`}export{f};
@@ -0,0 +1 @@
1
+ import{t as f,c as S,d as k,m as P,a as M}from"./differenceInSeconds-NQ4PDo0z.js";let F={};function x(){return F}function W(t){const n=f(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function p(t,...n){const e=S.bind(null,t||n.find(r=>typeof r=="object"));return n.map(e)}function w(t,n){const e=+f(t)-+f(n);return e<0?-1:e>0?1:e}function T(t){return S(t,Date.now())}function C(t,n,e){const[r,a]=p(e?.in,t,n),s=r.getFullYear()-a.getFullYear(),i=r.getMonth()-a.getMonth();return s*12+i}function X(t,n){const e=f(t);return e.setHours(23,59,59,999),e}function A(t,n){const e=f(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function O(t,n){const e=f(t);return+X(e)==+A(e)}function Y(t,n,e){const[r,a,s]=p(e?.in,t,t,n),i=w(a,s),o=Math.abs(C(a,s));if(o<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-i*o);let d=w(a,s)===-i;O(r)&&o===1&&w(r,s)===1&&(d=!1);const c=i*(o-+d);return c===0?0:c}const j={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},_=(t,n,e)=>{let r;const a=j[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+r:r+" ago":r};function D(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const N={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},z={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},I={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},V={date:D({formats:N,defaultWidth:"full"}),time:D({formats:z,defaultWidth:"full"}),dateTime:D({formats:I,defaultWidth:"full"})},q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},J=(t,n,e,r)=>q[t];function g(t){return(n,e)=>{const r=e?.context?String(e.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,o=e?.width?String(e.width):i;a=t.formattingValues[o]||t.formattingValues[i]}else{const i=t.defaultWidth,o=e?.width?String(e.width):t.defaultWidth;a=t.values[o]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const L={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},E={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},H={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},R={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Q={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},U={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},B=(t,n)=>{const e=Number(t),r=e%100;if(r>20||r<10)switch(r%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},K={ordinalNumber:B,era:g({values:L,defaultWidth:"wide"}),quarter:g({values:E,defaultWidth:"wide",argumentCallback:t=>t-1}),month:g({values:H,defaultWidth:"wide"}),day:g({values:R,defaultWidth:"wide"}),dayPeriod:g({values:Q,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})};function b(t){return(n,e={})=>{const r=e.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(o)?G(o,y=>y.test(i)):$(o,y=>y.test(i));let c;c=t.valueCallback?t.valueCallback(d):d,c=e.valueCallback?e.valueCallback(c):c;const l=n.slice(i.length);return{value:c,rest:l}}}function $(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function G(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Z(t){return(n,e={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=e.valueCallback?e.valueCallback(i):i;const o=n.slice(a.length);return{value:i,rest:o}}}const tt=/^(\d+)(th|st|nd|rd)?/i,et=/\d+/i,nt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},at={any:[/^b/i,/^(a|c)/i]},rt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ot={any:[/1/i,/2/i,/3/i,/4/i]},it={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},st={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ut={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ct={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},dt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},lt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},mt={ordinalNumber:Z({matchPattern:tt,parsePattern:et,valueCallback:t=>parseInt(t,10)}),era:b({matchPatterns:nt,defaultMatchWidth:"wide",parsePatterns:at,defaultParseWidth:"any"}),quarter:b({matchPatterns:rt,defaultMatchWidth:"wide",parsePatterns:ot,defaultParseWidth:"any",valueCallback:t=>t+1}),month:b({matchPatterns:it,defaultMatchWidth:"wide",parsePatterns:st,defaultParseWidth:"any"}),day:b({matchPatterns:ut,defaultMatchWidth:"wide",parsePatterns:ct,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:dt,defaultMatchWidth:"any",parsePatterns:lt,defaultParseWidth:"any"})},ht={code:"en-US",formatDistance:_,formatLong:V,formatRelative:J,localize:K,match:mt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ft(t,n,e){const r=x(),a=e?.locale??r.locale??ht,s=2520,i=w(t,n);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:i}),[d,c]=p(e?.in,...i>0?[n,t]:[t,n]),l=k(c,d),y=(W(c)-W(d))/1e3,u=Math.round((l-y)/60);let h;if(u<2)return e?.includeSeconds?l<5?a.formatDistance("lessThanXSeconds",5,o):l<10?a.formatDistance("lessThanXSeconds",10,o):l<20?a.formatDistance("lessThanXSeconds",20,o):l<40?a.formatDistance("halfAMinute",0,o):l<60?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",1,o):u===0?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",u,o);if(u<45)return a.formatDistance("xMinutes",u,o);if(u<90)return a.formatDistance("aboutXHours",1,o);if(u<P){const m=Math.round(u/60);return a.formatDistance("aboutXHours",m,o)}else{if(u<s)return a.formatDistance("xDays",1,o);if(u<M){const m=Math.round(u/P);return a.formatDistance("xDays",m,o)}else if(u<M*2)return h=Math.round(u/M),a.formatDistance("aboutXMonths",h,o)}if(h=Y(c,d),h<12){const m=Math.round(u/M);return a.formatDistance("xMonths",m,o)}else{const m=h%12,v=Math.trunc(h/12);return m<3?a.formatDistance("aboutXYears",v,o):m<9?a.formatDistance("overXYears",v,o):a.formatDistance("almostXYears",v+1,o)}}function gt(t,n){return ft(t,T(t),n)}export{gt as f};
@@ -0,0 +1 @@
1
+ import{o as V,n as K,c as Q,u as Y,w as Z,O as H,q as W,t as X,j as n,K as U,x as ee}from"./index-B84Dx7nI.js";import{u as ne}from"./useMutation-Be5QSQym.js";import{a as oe,u as te}from"./constants-_xTq0aTt.js";import{I as $}from"./input-NIbTU7RU.js";import{T as re}from"./textarea-BW2ziFqJ.js";import{F as L,d as B,a as se,b as O,c as A,e as z,f as k}from"./form-DK8WrQI3.js";import{D as le}from"./danger-zone-Cjq5A9rY.js";import"./label-B6R7vHKQ.js";import"./alert-dialog-Bbrwo05x.js";const ie=V({name:K().min(1,"Name is required").max(200,"Name is too long"),description:K().max(1e3,"Description is too long").nullable(),themeColor:K().nullable()});function ae(){const e=Q.c(63),{org:r,project:o}=Y(),y=Z(),P=o.slug===H;let v;e[0]!==r.id?(v={connectionId:oe,orgId:r.id},e[0]=r.id,e[1]=v):v=e[1];const G=te(v);let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=W(ie),e[2]=S):S=e[2];const M=o.name??"",q=o.description??"",R=o.ui?.themeColor??"#60a5fa";let F;e[3]!==M||e[4]!==q||e[5]!==R?(F={resolver:S,values:{name:M,description:q,themeColor:R}},e[3]=M,e[4]=q,e[5]=R,e[6]=F):F=e[6];const t=X(F);let c;e[7]!==G||e[8]!==o.id||e[9]!==o.ui?.banner||e[10]!==o.ui?.bannerColor||e[11]!==o.ui?.icon?(c=async l=>{const s=await G.callTool({name:"PROJECT_UPDATE",arguments:{projectId:o.id,name:l.name,description:l.description||null,ui:{themeColor:l.themeColor||null,banner:o.ui?.banner??null,bannerColor:o.ui?.bannerColor??null,icon:o.ui?.icon??null}}});return s.structuredContent??s},e[7]=G,e[8]=o.id,e[9]=o.ui?.banner,e[10]=o.ui?.bannerColor,e[11]=o.ui?.icon,e[12]=c):c=e[12];let d;e[13]!==t||e[14]!==r.id||e[15]!==o.slug||e[16]!==y?(d=()=>{y.invalidateQueries({queryKey:U.project(r.id,o.slug)}),y.invalidateQueries({queryKey:U.projects(r.id)}),t.reset(t.getValues())},e[13]=t,e[14]=r.id,e[15]=o.slug,e[16]=y,e[17]=d):d=e[17];let N;e[18]!==c||e[19]!==d?(N={mutationFn:c,onSuccess:d,onError:ce},e[18]=c,e[19]=d,e[20]=N):N=e[20];const i=ne(N);let E;e[21]!==i?(E=async l=>{await i.mutateAsync(l)},e[21]=i,e[22]=E):E=e[22];const m=E;let I;e[23]!==t||e[24]!==m?(I=l=>{l(),t.handleSubmit(m)()},e[23]=t,e[24]=m,e[25]=I):I=e[25];const a=I;let u;e[26]!==t||e[27]!==m?(u=t.handleSubmit(m),e[26]=t,e[27]=m,e[28]=u):u=e[28];let f;e[29]!==P||e[30]!==i.isPending||e[31]!==a?(f=l=>{const{field:s}=l;return n.jsxs(O,{children:[n.jsx(A,{children:"Project Name"}),n.jsx(B,{children:n.jsx($,{placeholder:"My Project",...s,onBlur:()=>a(s.onBlur),disabled:P||i.isPending})}),P&&n.jsx(z,{children:"The organization admin project name cannot be changed."}),n.jsx(k,{})]})},e[29]=P,e[30]=i.isPending,e[31]=a,e[32]=f):f=e[32];let x;e[33]!==t.control||e[34]!==f?(x=n.jsx(L,{control:t.control,name:"name",render:f}),e[33]=t.control,e[34]=f,e[35]=x):x=e[35];let D;e[36]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(A,{children:"Slug"}),e[36]=D):D=e[36];let j;e[37]!==o.slug?(j=n.jsx(B,{children:n.jsx($,{value:o.slug,disabled:!0,className:"bg-muted"})}),e[37]=o.slug,e[38]=j):j=e[38];let T;e[39]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(z,{children:"The project slug cannot be changed after creation."}),e[39]=T):T=e[39];let p;e[40]!==j?(p=n.jsxs(O,{children:[D,j,T]}),e[40]=j,e[41]=p):p=e[41];let h;e[42]!==i.isPending||e[43]!==a?(h=l=>{const{field:s}=l;return n.jsxs(O,{children:[n.jsx(A,{children:"Description"}),n.jsx(B,{children:n.jsx(re,{placeholder:"Optional project description...",rows:3,...s,value:s.value??"",onBlur:()=>a(s.onBlur),disabled:i.isPending})}),n.jsx(k,{})]})},e[42]=i.isPending,e[43]=a,e[44]=h):h=e[44];let g;e[45]!==t.control||e[46]!==h?(g=n.jsx(L,{control:t.control,name:"description",render:h}),e[45]=t.control,e[46]=h,e[47]=g):g=e[47];let b;e[48]!==i.isPending||e[49]!==a?(b=l=>{const{field:s}=l;return n.jsxs(O,{children:[n.jsx(A,{children:"Color"}),n.jsx(B,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"size-9 rounded-md border border-input overflow-hidden cursor-pointer shrink-0",style:{backgroundColor:s.value??"#60a5fa"},children:n.jsx("input",{type:"color",value:s.value??"#60a5fa",onChange:J=>s.onChange(J.target.value),onBlur:()=>a(s.onBlur),disabled:i.isPending,className:"opacity-0 w-full h-full cursor-pointer"})}),n.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:s.value??"#60a5fa"})]})}),n.jsx(k,{})]})},e[48]=i.isPending,e[49]=a,e[50]=b):b=e[50];let C;e[51]!==t.control||e[52]!==b?(C=n.jsx(L,{control:t.control,name:"themeColor",render:b}),e[51]=t.control,e[52]=b,e[53]=C):C=e[53];let _;e[54]!==u||e[55]!==x||e[56]!==p||e[57]!==g||e[58]!==C?(_=n.jsxs("form",{onSubmit:u,className:"space-y-6",children:[x,p,g,C]}),e[54]=u,e[55]=x,e[56]=p,e[57]=g,e[58]=C,e[59]=_):_=e[59];let w;return e[60]!==t||e[61]!==_?(w=n.jsx("div",{className:"flex flex-col",children:n.jsx(se,{...t,children:_})}),e[60]=t,e[61]=_,e[62]=w):w=e[62],w}function ce(e){ee.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function de(){const e=Q.c(2);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"General"}),e[0]=r):r=e[0];let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"flex flex-col",children:[r,n.jsxs("div",{className:"pt-6 flex flex-col gap-6",children:[n.jsx(ae,{}),n.jsx(le,{})]})]}),e[1]=o):o=e[1],o}function Ce(){const e=Q.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(de,{}),e[0]=r):r=e[0],r}export{Ce as default};
@@ -0,0 +1 @@
1
+ const r="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let a=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=r[n[e]&63];return t};function l(e){return`${e}_${a()}`}export{l as g};
@@ -0,0 +1 @@
1
+ function r(t){if(!t)return null;const n=typeof t=="string"?t:t.url;if(!n)return null;const u=n.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return u?{owner:u[1]||"",repo:u[2]||""}:null}function a(t){const n=r(t);if(!n)return null;const u=`https://github.com/${n.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(u)}&output=webp`}export{r as e,a as g};
@@ -0,0 +1 @@
1
+ import{r as v,c as M,z as L,j as s,w as q,x as w,B as E,ar as H}from"./index-B84Dx7nI.js";import{u as D}from"./topbar-portal-BomQ7YMR.js";import{K as R,u as Z,g as I,s as Q,a as W,f as U}from"./file-browser-BLB4FkOU.js";import{i as S}from"./AlertCircle-DsQlVvig.js";import{n as A}from"./Download01-DFmX-SGA.js";import{i as $}from"./File02-ZK3-99s4.js";import{i as J}from"./File06-B7IZdrgj.js";import{a as P}from"./Image01-4wUrHqw6.js";import{i as T}from"./Loading01-aMp99RZI.js";import{s as V}from"./Trash01-DJTe1fKw.js";import{i as Y}from"./Upload01-BEhQSPeB.js";import{u as _}from"./useMutation-Be5QSQym.js";import{u as X}from"./useQuery-CIRdCYZz.js";import"./useInfiniteQuery-CFRJ66U9.js";import"./infiniteQueryObserver-DenS4T97.js";import"./checkbox-DhgSL5Cz.js";import"./Check-OSWZCZf9.js";import"./ChevronRight-ByOuE_Vi.js";import"./Grid01-DIGu5eh8.js";import"./Home02-DiSPSdMx.js";import"./List-BnvhY7Nh.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));K.displayName="FileCode01";const O=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));O.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),c=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{c.current&&(c.current.disconnect(),c.current=null),u&&!d.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!d.current&&(d.current=!0,g(!0),c.current?.disconnect(),c.current=null)},i),c.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:c}=i,d=c===void 0?"":c,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let a;e[1]!==n||e[2]!==t?(a=R.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==a||e[9]!==f?(k={queryKey:a,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=a,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=L("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:O,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:K,Folder:H};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:c,onDelete:d}=i;let n;e[0]!==t.key?(n=I(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!a&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=L("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==a||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:L(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=a,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==a||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=a,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==c?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),c(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=c,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function we({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),c=q(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:a,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${I(r)}`),c.invalidateQueries({queryKey:R.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),c.invalidateQueries({queryKey:R.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=I(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&a()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{we as default};
@@ -0,0 +1 @@
1
+ import{c as f,z as y,j as s,f as _,r as C,B as $,bD as O,e as E,w as F,x as w,y as D,S as R,N as H}from"./index-B84Dx7nI.js";import{C as k}from"./card-CkYe6Ikt.js";import{A as G}from"./avatar-D94UEcg7.js";import{i as Q}from"./AlertCircle-DsQlVvig.js";import{i as q}from"./Check-OSWZCZf9.js";import{s as B}from"./Plus-Dp8Rr75G.js";import{i as T}from"./SearchMd-r7i5BQk7.js";import{s as M}from"./XClose-dSJ6zVxj.js";import{I as U}from"./input-NIbTU7RU.js";import{C as P}from"./create-organization-dialog-D50lIYTQ.js";import"./alert-dialog-Bbrwo05x.js";import"./form-DK8WrQI3.js";import"./label-B6R7vHKQ.js";import"./spinner-DiXeE5Xk.js";import"./useMutation-Be5QSQym.js";function V(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:a}=t,c=a===void 0?!1:a;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",r=c&&"hover:ring-2 hover:ring-primary";let d;e[2]!==l||e[3]!==x||e[4]!==r?(d=y("group transition-all flex flex-col gap-0",x,r,l),e[2]=l,e[3]=x,e[4]=r,e[5]=d):d=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==d?(g=s.jsx(k,{className:d,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=d,e[9]=g):g=e[9],g}function X(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:a,objectFit:c,className:o}=t,m=i===void 0?"square":i,x=a===void 0?"lg":a,r=c===void 0?"contain":c;let d;return e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==m||e[4]!==x||e[5]!==n?(d=s.jsx(G,{url:n,fallback:l,shape:m,size:x,objectFit:r,className:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=m,e[4]=x,e[5]=n,e[6]=d):d=e[6],d}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Z(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function ee(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function te(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function se(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(V,{Avatar:X,AvatarSection:Z,Header:Y,Title:J,Subtitle:K,Content:W,Footer:ee,Badge:te,Skeleton:se}),ie={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},le={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},ne={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ae={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},re={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},oe={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:a}=t;let c;e[0]!==l?(c=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=c):c=e[1];const o=c,x=ie[i===void 0?4:i],r=o.sm&&le[o.sm],d=o.md&&ne[o.md],g=o.lg&&ae[o.lg],p=o.xl&&re[o.xl],v=o["2xl"]&&oe[o["2xl"]];let N;e[2]!==a||e[3]!==x||e[4]!==r||e[5]!==d||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,r,d,g,p,v,a),e[2]=a,e[3]=x,e[4]=r,e[5]=d,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function ce(t){const e=f.c(9),{count:n,columns:l,gap:i,className:a}=t,c=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let r;e[2]!==c?(r=Array.from({length:c}).map(de),e[2]=c,e[3]=r):r=e[3];let d;return e[4]!==a||e[5]!==m||e[6]!==x||e[7]!==r?(d=s.jsx(L,{columns:m,gap:x,className:a,children:r}),e[4]=a,e[5]=m,e[6]=x,e[7]=r,e[8]=d):d=e[8],d}function de(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const I=Object.assign(L,{Skeleton:ce});function me({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),a=F(),c=E(),o=async()=>{n(!0);try{const r=await _.organization.acceptInvitation({invitationId:t.id});if(r.error)w.error(r.error.message),n(!1);else{const d=await _.organization.setActive({organizationId:t.organizationId});d?.data?.slug?(w.success("Invitation accepted!"),c({to:"/$org",params:{org:d.data.slug}})):(w.success("Invitation accepted! Redirecting..."),c({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const r=await _.organization.rejectInvitation({invitationId:t.id});r.error?(w.error(r.error.message),i(!1)):(w.success("Invitation rejected"),await a.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(M,{size:16}),"Decline"]})})]})})]})}function xe({query:t}){const e=C.useContext(O),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(c=>c.status==="pending"&&new Date(c.expiresAt)>new Date),a=t?(()=>{const c=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(c)||o.organizationId.toLowerCase().includes(c))})():i;return a.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(I,{columns:{sm:2,md:3,lg:4},children:a.map(c=>s.jsx(me,{invitation:c},c.id))})]})}function ue(t){const e=f.c(14),{query:n}=t,{data:l}=_.useListOrganizations(),i=E();let a;e[0]!==l||e[1]!==n?(a=l?n?(()=>{const r=n.toLowerCase();return l.filter(d=>d.name.toLowerCase().includes(r)||d.slug.toLowerCase().includes(r))})():l:[],e[0]=l,e[1]=n,e[2]=a):a=e[2];const c=a;if(!l||l.length===0){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=r):r=e[3],r}if(c.length===0){let r;return e[4]!==n?(r=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=r):r=e[5],r}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==c||e[8]!==i){let r;e[10]!==i?(r=d=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:d.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:d.logo||"",fallback:d.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",d.slug]}),s.jsx(u.Title,{children:d.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(d.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},d.id),e[10]=i,e[11]=r):r=e[11],m=c.map(r),e[7]=c,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(I,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function fe(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Q,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function ge(){const t=f.c(27),{error:e,isPending:n}=_.useListOrganizations(),[l,i]=C.useState(""),[a,c]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(I.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(fe,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(xe,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let r;t[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(T,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=r):r=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=j=>i(j.target.value),t[7]=d):d=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[r,s.jsx(U,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:d})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>c(!0),children:[s.jsx(B,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(I.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(ue,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==a?(z=s.jsx(P,{open:a,onOpenChange:c}),t[22]=a,t[23]=z):z=t[23];let A;return t[24]!==S||t[25]!==z?(A=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=A):A=t[26],A}function Ee(){const t=f.c(4),e=D(),{data:n,isPending:l}=_.useListOrganizations();if(e.localMode){if(l){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(R,{}),t[0]=c):c=t[0],c}const a=n?.[0];if(a?.slug){const c=`/${a.slug}/org-admin`;let o;return t[1]!==c?(o=s.jsx(H,{to:c,replace:!0}),t[1]=c,t[2]=o):o=t[2],o}}let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"min-h-full",children:s.jsx(ge,{})}),t[3]=i):i=t[3],i}export{Ee as default};
@@ -0,0 +1 @@
1
+ import{c as X,r as F,z as K,j as t,B as T}from"./index-B84Dx7nI.js";import{I as Z}from"./input-NIbTU7RU.js";import{b as q,P as G,a as H}from"./popover-D7xgfP4W.js";import{S as J}from"./scroll-area-DOWQyO2m.js";import{n as Q}from"./Container-BVSlDn4p.js";import{i as V}from"./Edit05-BKDqgNc4.js";import{i as W}from"./Link01-CHaReCKl.js";import{s as ee}from"./XClose-dSJ6zVxj.js";const te=0,se=38;function re(){const i=[];for(let e=te;e<=se;e++)i.push(`/icons/capy-${e}.png`);return i}const le={sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},oe=re();function xe(i){const e=X.c(53),{value:r,onChange:o,name:c,size:S,className:I,fallbackIcon:a}=i,m=S===void 0?"lg":S,[s,n]=F.useState(""),[U,w]=F.useState(!1);let A;e[0]!==o?(A=l=>{o(l),w(!1),n("")},e[0]=o,e[1]=A):A=e[1];const $=A;let _;e[2]!==s||e[3]!==o?(_=()=>{const l=s.trim();l&&(o(l),w(!1),n(""))},e[2]=s,e[3]=o,e[4]=_):_=e[4];const f=_;let k;e[5]!==o?(k=()=>{o(null),w(!1),n("")},e[5]=o,e[6]=k):k=e[6];const D=k,L=le[m];let d;e[7]!==I||e[8]!==L?(d=K("relative group rounded-lg border border-border shrink-0 overflow-hidden cursor-pointer",L,I),e[7]=I,e[8]=L,e[9]=d):d=e[9];const M=r??"no-icon";let u;e[10]!==a||e[11]!==c||e[12]!==M||e[13]!==r?(u=t.jsx(ie,{icon:r,name:c,fallbackIcon:a},M),e[10]=a,e[11]=c,e[12]=M,e[13]=r,e[14]=u):u=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(V,{size:16,className:"text-white"})}),e[15]=z):z=e[15];let p;e[16]!==d||e[17]!==u?(p=t.jsx(q,{asChild:!0,children:t.jsxs("button",{type:"button",className:d,children:[u,z]})}),e[16]=d,e[17]=u,e[18]=p):p=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("span",{className:"text-sm font-medium",children:"Choose icon"}),e[19]=P):P=e[19];let h;e[20]!==D||e[21]!==r?(h=r&&t.jsxs(T,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs text-muted-foreground",onClick:D,children:[t.jsx(ee,{size:12}),"Remove"]}),e[20]=D,e[21]=r,e[22]=h):h=e[22];let x;e[23]!==h?(x=t.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[P,h]}),e[23]=h,e[24]=x):x=e[24];let b;e[25]!==$||e[26]!==r?(b=oe.map(l=>t.jsx("button",{type:"button",onClick:()=>$(l),className:K("h-9 w-9 rounded-md overflow-hidden border transition-colors hover:border-primary cursor-pointer",r===l?"border-primary ring-1 ring-primary":"border-transparent"),children:t.jsx("img",{src:l,alt:"",className:"h-full w-full object-cover",loading:"lazy"})},l)),e[25]=$,e[26]=r,e[27]=b):b=e[27];let g;e[28]!==b?(g=t.jsx(J,{className:"h-48",children:t.jsx("div",{className:"grid grid-cols-7 gap-1 p-2",children:b})}),e[28]=b,e[29]=g):g=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(W,{size:14,className:"text-muted-foreground shrink-0"}),e[30]=E):E=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=l=>n(l.target.value),e[31]=R):R=e[31];let j;e[32]!==f?(j=l=>{l.key==="Enter"&&(l.preventDefault(),f())},e[32]=f,e[33]=j):j=e[33];let v;e[34]!==s||e[35]!==j?(v=t.jsx(Z,{value:s,onChange:R,placeholder:"Paste image URL...",className:"h-7 text-xs",onKeyDown:j}),e[34]=s,e[35]=j,e[36]=v):v=e[36];let O;e[37]!==s?(O=s.trim(),e[37]=s,e[38]=O):O=e[38];const Y=!O;let y;e[39]!==f||e[40]!==Y?(y=t.jsx(T,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs shrink-0",onClick:f,disabled:Y,children:"Apply"}),e[39]=f,e[40]=Y,e[41]=y):y=e[41];let N;e[42]!==v||e[43]!==y?(N=t.jsxs("div",{className:"flex items-center gap-1.5 p-2 border-t border-border",children:[E,v,y]}),e[42]=v,e[43]=y,e[44]=N):N=e[44];let C;e[45]!==x||e[46]!==g||e[47]!==N?(C=t.jsx(G,{align:"start",className:"w-80 p-0",onOpenAutoFocus:ne,children:t.jsxs("div",{className:"flex flex-col",children:[x,g,N]})}),e[45]=x,e[46]=g,e[47]=N,e[48]=C):C=e[48];let B;return e[49]!==U||e[50]!==p||e[51]!==C?(B=t.jsxs(H,{open:U,onOpenChange:w,children:[p,C]}),e[49]=U,e[50]=p,e[51]=C,e[52]=B):B=e[52],B}function ne(i){return i.preventDefault()}function ie(i){const e=X.c(8),{icon:r,name:o,fallbackIcon:c}=i,[S,I]=F.useState(!1);if(!r||S){let s;e[0]!==c?(s=c??t.jsx(Q,{size:24,className:"text-muted-foreground"}),e[0]=c,e[1]=s):s=e[1];let n;return e[2]!==s?(n=t.jsx("div",{className:"h-full w-full flex items-center justify-center bg-muted/20",children:s}),e[2]=s,e[3]=n):n=e[3],n}let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=()=>I(!0),e[4]=a):a=e[4];let m;return e[5]!==r||e[6]!==o?(m=t.jsx("img",{src:r,alt:o,className:"h-full w-full object-cover",onError:a}),e[5]=r,e[6]=o,e[7]=m):m=e[7],m}export{xe as I};