@decocms/mesh 2.14.1 → 2.15.1

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 (171) hide show
  1. package/dist/client/assets/{AlertCircle-CMyS46jH.js → AlertCircle-DlBo4Xw9.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Dsh9IWd-.js → ArrowLeft-CCqPW2JN.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CXsDJznS.js → ArrowUp-KvHCnFh3.js} +1 -1
  4. package/dist/client/assets/{Check-BEhtk6Py.js → Check-D4dBNJmC.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BRxtl0-A.js → ChevronDown-CJaS1NVA.js} +1 -1
  6. package/dist/client/assets/{Clock-BSrN61cb.js → Clock-ljBuaWDA.js} +1 -1
  7. package/dist/client/assets/{Code01-Bu5zpyWd.js → Code01-CMazpegY.js} +1 -1
  8. package/dist/client/assets/{Copy01-B7vmVdHF.js → Copy01-Rf_P7R5F.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-B0iNa4YA.js → DotsHorizontal-Nj82ZW12.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CdUtOOoG.js → DotsVertical-f9rnazjX.js} +1 -1
  11. package/dist/client/assets/{Download01-D1VGE3pA.js → Download01-Cnas0PSW.js} +1 -1
  12. package/dist/client/assets/{Edit01-CGqnOdlK.js → Edit01-MWKLkbpZ.js} +1 -1
  13. package/dist/client/assets/{File06-De52zO32.js → File06-Dir7h2_j.js} +1 -1
  14. package/dist/client/assets/{FilterLines-ClFUJXZP.js → FilterLines-BgxUhbig.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-B4GimHkg.js → FlipBackward-B1KVh_65.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-B40VcD0l.js → GitBranch01-CA4KhZZx.js} +1 -1
  17. package/dist/client/assets/{Grid01-CoHgfBeE.js → Grid01-BgBQwtBY.js} +1 -1
  18. package/dist/client/assets/{Home02-Dax6TXzJ.js → Home02-CR-W2ctm.js} +1 -1
  19. package/dist/client/assets/{Image01-D_Oad7Fi.js → Image01-B8cj-qoF.js} +1 -1
  20. package/dist/client/assets/{Inbox01-DU8gyK-F.js → Inbox01-Bh5pMKE1.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-Na8jygcw.js → InfoCircle-CVdyaBb8.js} +1 -1
  22. package/dist/client/assets/{Key01-BbSMVBZS.js → Key01-BcxLAym0.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-5OOaoko1.js → LinkExternal01-D41WE0Cl.js} +1 -1
  24. package/dist/client/assets/{List-BXC8ldIg.js → List-hTdqyLGB.js} +1 -1
  25. package/dist/client/assets/{Loading01-DxDL3s7X.js → Loading01-Bq_7Os6T.js} +1 -1
  26. package/dist/client/assets/{Lock01-C1zaHQP8.js → Lock01-DOJDUqUZ.js} +1 -1
  27. package/dist/client/assets/{Play-ClPvjsPL.js → Play-CoxjBx7-.js} +1 -1
  28. package/dist/client/assets/{Plus-WrA7kzKa.js → Plus-C4F6mby2.js} +1 -1
  29. package/dist/client/assets/{SearchMd-JSFwoON0.js → SearchMd-B_A85eif.js} +1 -1
  30. package/dist/client/assets/{Terminal-BtV_FLPF.js → Terminal-BWurH474.js} +1 -1
  31. package/dist/client/assets/{Trash01-MX6mkM7g.js → Trash01-GrzirNvV.js} +1 -1
  32. package/dist/client/assets/{Upload01-BGvogcXt.js → Upload01-Ba_zCXbQ.js} +1 -1
  33. package/dist/client/assets/{X-q5bh176U.js → X-D09jV0HO.js} +1 -1
  34. package/dist/client/assets/{XClose-D_dGSZ7W.js → XClose-D9UXYoHK.js} +1 -1
  35. package/dist/client/assets/{alert-dialog-ocEz50Se.js → alert-dialog-Df8ZsItX.js} +2 -2
  36. package/dist/client/assets/{auth-catchall-BJS8UgWt.js → auth-catchall-Bu_AmzqF.js} +1 -1
  37. package/dist/client/assets/{avatar-Dtkx4Tl-.js → avatar-CrVRRbJ7.js} +1 -1
  38. package/dist/client/assets/{badge-BkSn2oaB.js → badge-BPKvq16e.js} +1 -1
  39. package/dist/client/assets/{binder-BVHRVoIY.js → binder-BtPpbY4I.js} +1 -1
  40. package/dist/client/assets/{button-CICpj3wE.js → button-Co_HOc3E.js} +1 -1
  41. package/dist/client/assets/{card-BMkFh6vi.js → card-Rz2C5-Lx.js} +1 -1
  42. package/dist/client/assets/{checkbox-DTTIHxXg.js → checkbox-DGIT6WZ3.js} +1 -1
  43. package/dist/client/assets/{collection-detail-CDCE926k.js → collection-detail-CIorpvYQ.js} +2 -2
  44. package/dist/client/assets/{collection-display-button-3hmFOeDC.js → collection-display-button-C_GfVLwh.js} +1 -1
  45. package/dist/client/assets/{collection-header-B6vJy14N.js → collection-header-Dl8Ii13M.js} +1 -1
  46. package/dist/client/assets/{collection-page-Dt6I6Mr4.js → collection-page-C75JriCh.js} +1 -1
  47. package/dist/client/assets/{collection-search-ClK_cOgs.js → collection-search-D67e9ppe.js} +1 -1
  48. package/dist/client/assets/{collection-tab-D8CKnWEB.js → collection-tab-DVmiR956.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-CUsQQB3S.js → collection-table-wrapper-DDHrDWif.js} +1 -1
  50. package/dist/client/assets/{connection-Mp3hTHGP.js → connection-CmMMEDBY.js} +2 -2
  51. package/dist/client/assets/{connection-card-Cm6sQJt-.js → connection-card-BuCHeT4K.js} +1 -1
  52. package/dist/client/assets/connection-detail-BsC5t8hY.js +1 -0
  53. package/dist/client/assets/{connections-BXBUh1-5.js → connections-B3RW87mz.js} +1 -1
  54. package/dist/client/assets/constants-B5NZDm4s.js +1 -0
  55. package/dist/client/assets/create-organization-dialog-DQ5uy2r0.js +1 -0
  56. package/dist/client/assets/{dialog-CuzZhGeu.js → dialog-bW33A1d_.js} +1 -1
  57. package/dist/client/assets/{dropdown-menu-D1uHrxpy.js → dropdown-menu-dsr_wyw0.js} +1 -1
  58. package/dist/client/assets/{dynamic-plugin-layout-BWtm_52W.js → dynamic-plugin-layout-IH0Gl52A.js} +1 -1
  59. package/dist/client/assets/{empty-state-B8LlErgw.js → empty-state-B1DU5702.js} +1 -1
  60. package/dist/client/assets/{empty-state-BhACvnGF.js → empty-state-By_kA__m.js} +1 -1
  61. package/dist/client/assets/env-vars-editor-BjH5KdVc.js +1 -0
  62. package/dist/client/assets/{error-boundary-u4ffWLYf.js → error-boundary-BOBkDZ1Y.js} +1 -1
  63. package/dist/client/assets/{extract-connection-data-DSV8dsp9.js → extract-connection-data-CNcw3HV2.js} +1 -1
  64. package/dist/client/assets/{file-browser-CZ1PEthx.js → file-browser-BDyBPrc6.js} +2 -2
  65. package/dist/client/assets/{form-f0_t6ok_.js → form-ChO7tWCF.js} +1 -1
  66. package/dist/client/assets/{gateway-detail-D4FxMVxj.js → gateway-detail-CzuSbsFr.js} +1 -1
  67. package/dist/client/assets/{gateways-DjekxeB3.js → gateways-ckyn_Uas.js} +1 -1
  68. package/dist/client/assets/{grid-view-BYe4Rwz4.js → grid-view-CTAOtRDs.js} +1 -1
  69. package/dist/client/assets/{home-C6GUJREk.js → home-CpIhQ8D8.js} +1 -1
  70. package/dist/client/assets/{index-DB3GMPX_.js → index-BUdiVz6f.js} +1 -1
  71. package/dist/client/assets/index-Bc30BcYv.js +88 -0
  72. package/dist/client/assets/{index-BrOzWsZC.js → index-CH2G6_zW.js} +1 -1
  73. package/dist/client/assets/{index-CFMXrMRQ.js → index-ChF3uWl9.js} +1 -1
  74. package/dist/client/assets/index-JAPwCHXJ.css +1 -0
  75. package/dist/client/assets/{index-pvGhQBw9.js → index-ZiFjEqyT.js} +2 -2
  76. package/dist/client/assets/{infiniteQueryObserver-DjOTL7tS.js → infiniteQueryObserver-DEh2zauU.js} +1 -1
  77. package/dist/client/assets/{input-Chnnz9Uq.js → input-DEsmZ6es.js} +1 -1
  78. package/dist/client/assets/{layout-CE7L7dZF.js → layout-tF7tb_Qc.js} +1 -1
  79. package/dist/client/assets/{lazy-highlighter-HM0cmsZA.js → lazy-highlighter-B2TKQCpQ.js} +1 -1
  80. package/dist/client/assets/{localstorage-keys-CdhAbc7P.js → localstorage-keys-DhdYpXZj.js} +1 -1
  81. package/dist/client/assets/{login-D-qtMr1_.js → login-DtC787Hg.js} +1 -1
  82. package/dist/client/assets/{mcp-oauth-Bkju1UsK.js → mcp-oauth-D8a9d38x.js} +1 -1
  83. package/dist/client/assets/{mcp-server-card-CsdbMsCj.js → mcp-server-card-DSQZ-b3I.js} +1 -1
  84. package/dist/client/assets/{mcp-server-detail-BI6WT6NT.js → mcp-server-detail-rW4PqaOO.js} +1 -1
  85. package/dist/client/assets/members-C4HTAJHG.js +3 -0
  86. package/dist/client/assets/{monaco-editor--HoIUuQe.js → monaco-editor-BYgR7J38.js} +4 -4
  87. package/dist/client/assets/{monitoring-Gwgg901f.js → monitoring-BGY0w02b.js} +2 -2
  88. package/dist/client/assets/{oauth-callback-C8OVySGi.js → oauth-callback-BSZdPTYI.js} +1 -1
  89. package/dist/client/assets/page-DcQoSvJk.js +35 -0
  90. package/dist/client/assets/{page-rpmGCt1t.js → page-DxMYdFSw.js} +1 -1
  91. package/dist/client/assets/{pin-to-sidebar-button--fqmK37a.js → pin-to-sidebar-button-BahvsjHH.js} +1 -1
  92. package/dist/client/assets/{plugin-empty-state-BPlieumE.js → plugin-empty-state-CIiB0IAw.js} +1 -1
  93. package/dist/client/assets/{plugin-header-CcEHY2ra.js → plugin-header-CvDO4WmD.js} +1 -1
  94. package/dist/client/assets/{plugins-BR7M1iih.js → plugins-CyUBsABC.js} +1 -1
  95. package/dist/client/assets/{popover-Cq8T_QGa.js → popover-DW05feED.js} +1 -1
  96. package/dist/client/assets/{project-context-provider-CUiGxKJp.js → project-context-provider-BPo-49FO.js} +1 -1
  97. package/dist/client/assets/{registry-utils-h9Ud__h7.js → registry-utils-DzI73csj.js} +1 -1
  98. package/dist/client/assets/{resizable-S6LzYu6C.js → resizable-BAPLF4RD.js} +1 -1
  99. package/dist/client/assets/{resource-tabs-Blq_ajNW.js → resource-tabs-CC5dHHUl.js} +1 -1
  100. package/dist/client/assets/select-CVEPeRAQ.js +1 -0
  101. package/dist/client/assets/{settings-C0Cv06sV.js → settings-BfbdOKrl.js} +1 -1
  102. package/dist/client/assets/shell-layout-DJjajsTY.js +3 -0
  103. package/dist/client/assets/{spinner-BSgPnpsR.js → spinner-DqooIng7.js} +1 -1
  104. package/dist/client/assets/{standalone-Cva4pL7v.js → standalone-Cutp_BhH.js} +1 -1
  105. package/dist/client/assets/{switch-CkVmNhCD.js → switch-dZML6kqo.js} +1 -1
  106. package/dist/client/assets/{textarea-BgUJNVXI.js → textarea-DFRypKCQ.js} +1 -1
  107. package/dist/client/assets/{tool-set-selector-BVPKiJOI.js → tool-set-selector-DRx4AOzy.js} +1 -1
  108. package/dist/client/assets/{tools-list-DsOacuX3.js → tools-list-C8nSsOKD.js} +1 -1
  109. package/dist/client/assets/{tooltip-DySBr2SY.js → tooltip-BJO9sFhZ.js} +1 -1
  110. package/dist/client/assets/use-binding-C8KxuIY6.js +23 -0
  111. package/dist/client/assets/{use-collections-JQXbZBdV.js → use-collections-g067BPxP.js} +1 -1
  112. package/dist/client/assets/{use-connection-BF1UFzlw.js → use-connection-BskZam-G.js} +1 -1
  113. package/dist/client/assets/{use-connection-resources-D5d-M6jn.js → use-connection-resources-YXIBGXnm.js} +1 -1
  114. package/dist/client/assets/{use-create-gateway-DLr-GNpv.js → use-create-gateway-CCmt4GT8.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-K6FCpGjs.js → use-gateway-system-prompt-DoCpWoeh.js} +1 -1
  116. package/dist/client/assets/{use-gateway-B5GGqvj7.js → use-gateway-v7etejE8.js} +1 -1
  117. package/dist/client/assets/{use-list-state-BkPjBg3I.js → use-list-state-C5pgFF_z.js} +1 -1
  118. package/dist/client/assets/{use-mcp-C-3NLCFo.js → use-mcp-ZNQ-iMEF.js} +1 -1
  119. package/dist/client/assets/{use-members-B9HW4lZd.js → use-members-dVasH0ez.js} +1 -1
  120. package/dist/client/assets/{use-mobile-zhrv6Pzr.js → use-mobile-Co7MtEW-.js} +1 -1
  121. package/dist/client/assets/use-model-state-B8hL-q1r.js +20 -0
  122. package/dist/client/assets/{use-organization-settings-DTSCQFPr.js → use-organization-settings-K7SU43aD.js} +1 -1
  123. package/dist/client/assets/{use-tool-call-BMUEJvVc.js → use-tool-call-BbfSyOCz.js} +1 -1
  124. package/dist/client/assets/useInfiniteQuery-Dbq7IS1q.js +1 -0
  125. package/dist/client/assets/{useMutation-B64mCwly.js → useMutation-4fnzP4bc.js} +1 -1
  126. package/dist/client/assets/useQuery-Bn2Wcch_.js +1 -0
  127. package/dist/client/assets/{value-DvmerOpY.js → value-zEqR5KPg.js} +1 -1
  128. package/dist/client/assets/{view-mode-toggle-DXknlAX3.js → view-mode-toggle-tlrhMsiy.js} +1 -1
  129. package/dist/client/assets/{workflow-Bi0pfrEf.js → workflow-B8_jtBci.js} +1 -1
  130. package/dist/client/index.html +2 -2
  131. package/dist/server/cli.js +227 -220
  132. package/dist/server/migrate.js +160 -143
  133. package/dist/server/server.js +223 -216
  134. package/package.json +1 -1
  135. package/dist/client/assets/connection-detail-CS7YtOxG.js +0 -1
  136. package/dist/client/assets/constants-DsV2FGIq.js +0 -1
  137. package/dist/client/assets/create-organization-dialog-Kd2yuwpA.js +0 -1
  138. package/dist/client/assets/env-vars-editor-BSBPtnyc.js +0 -1
  139. package/dist/client/assets/index-BZk2eMPx.js +0 -88
  140. package/dist/client/assets/index-fFpUC2Bx.css +0 -1
  141. package/dist/client/assets/members-DIF2fQ00.js +0 -3
  142. package/dist/client/assets/page-BthOOB1S.js +0 -35
  143. package/dist/client/assets/select-BOEg6aAK.js +0 -1
  144. package/dist/client/assets/shell-layout-BRSb3To9.js +0 -3
  145. package/dist/client/assets/thread-history-popover-SCaQRi-L.js +0 -20
  146. package/dist/client/assets/use-binding-s4bqKdJA.js +0 -23
  147. package/dist/client/assets/useInfiniteQuery-qVzxuL4i.js +0 -1
  148. package/dist/client/assets/useQuery-Dr4r_H_i.js +0 -1
  149. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +0 -47
  150. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +0 -82
  151. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +0 -11
  152. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +0 -43
  153. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +0 -45
  154. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +0 -46
  155. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +0 -11
  156. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +0 -11
  157. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +0 -46
  158. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
  159. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +0 -83
  160. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +0 -83
  161. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +0 -2
  162. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +0 -1
  163. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +0 -2
  164. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +0 -1
  165. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +0 -20
  166. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +0 -20
  167. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +0 -2
  168. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +0 -1
  169. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +0 -2
  170. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +0 -1
  171. package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +0 -61
@@ -1 +1 @@
1
- import{c as ge,j as e,r as M,f as xe,b as je,a as fe,u as ye,z as ve,y as _e,w as se,X as Ce,x as y,a1 as ke}from"./index-pvGhQBw9.js";import{C as Ne}from"./collection-header-B6vJy14N.js";import{C as Se}from"./collection-page-Dt6I6Mr4.js";import{C as we}from"./collection-search-ClK_cOgs.js";import{C as Te}from"./collection-table-wrapper-CUsQQB3S.js";import{C as De}from"./connection-card-Cm6sQJt-.js";import{n as O,E as z,I as be}from"./empty-state-B8LlErgw.js";import{E as Pe}from"./error-boundary-u4ffWLYf.js";import{a as Ie,u as Ve}from"./use-connection-BF1UFzlw.js";import{a as $e}from"./use-binding-s4bqKdJA.js";import{u as Ee,s as Q}from"./use-list-state-BkPjBg3I.js";import{u as Ae}from"./project-context-provider-CUiGxKJp.js";import{f as Fe,a as He,b as Oe,c as ze,d as Be,e as Me,A as Re,g as Ue}from"./alert-dialog-ocEz50Se.js";import{B as Xe}from"./badge-BkSn2oaB.js";import{B as _}from"./button-CICpj3wE.js";import{d as Le,c as We,a as Ke,D as Ge,g as qe,f as Ye}from"./dialog-CuzZhGeu.js";import{b as J,D as Z,a as ee,c as $}from"./dropdown-menu-D1uHrxpy.js";import{a as Qe,F as h,b as g,c as x,d as j,f}from"./form-f0_t6ok_.js";import{i as te}from"./DotsVertical-CdUtOOoG.js";import{f as Je,e as Ze,s as B}from"./registry-utils-h9Ud__h7.js";import{i as et}from"./Loading01-DxDL3s7X.js";import{i as tt}from"./Terminal-BtV_FLPF.js";import{s as ne}from"./Trash01-MX6mkM7g.js";import{I as k}from"./input-Chnnz9Uq.js";import{S as nt,a as ot,b as st,c as rt,d as P}from"./select-BOEg6aAK.js";import{T as it}from"./textarea-BgUJNVXI.js";import{g as at}from"./generate-id-Dyweu44Y.js";import{a as ct}from"./use-tool-call-BMUEJvVc.js";import{c as lt}from"./connection-Mp3hTHGP.js";import{i as dt,r as mt,E as ut,e as re}from"./env-vars-editor-BSBPtnyc.js";import"./collection-display-button-3hmFOeDC.js";import"./ArrowUp-CXsDJznS.js";import"./Check-BEhtk6Py.js";import"./Grid01-CoHgfBeE.js";import"./List-BXC8ldIg.js";import"./tooltip-DySBr2SY.js";import"./view-mode-toggle-DXknlAX3.js";import"./SearchMd-JSFwoON0.js";import"./card-BMkFh6vi.js";import"./use-collections-JQXbZBdV.js";import"./useMutation-B64mCwly.js";import"./binder-BVHRVoIY.js";import"./use-mobile-zhrv6Pzr.js";import"./X-q5bh176U.js";import"./ChevronDown-BRxtl0-A.js";import"./useQuery-Dr4r_H_i.js";import"./Plus-WrA7kzKa.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function A(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const u=s.slice(1).find(a=>!a.startsWith("-"));return u?{packageName:u}:null}function E(n){const{uiType:s}=n,i=A(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===A("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=A(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",u=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:u}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const u={command:n};s.trim()&&(u.args=s.trim().split(/\s+/)),i?.trim()&&(u.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(u.envVars=a),u}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=Ae(),s=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:u}=ye(),a=Ee({namespace:n.slug,resource:"connections"}),I=Ie(),N=Ve(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=$e(N)[0],F=R?.id??"",U=Je(R?.tools),ie=lt(F||void 0),{data:ae}=ct({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=Ze(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),D=E({uiType:m,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:m,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=mt(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},me=async t=>{let o,c=null,w=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",w=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...w&&{connection_token:w},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const T=at("conn");await I.create.mutateAsync({id:T,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:T}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,T=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(b=>b.key)),Y=p.envVarKeys.filter(b=>!he.has(b));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},H=gt(o);if(H&&u){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),T(E({uiType:"NPX",npxPackage:H.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),T(E({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}m==="NPX"&&T(E({uiType:"NPX",npxPackage:o}))},ue=[{id:"icon",header:"",render:t=>e.jsx(be,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(Xe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Le,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(We,{className:"sm:max-w-[525px]",children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:l?"Edit Connection":"Create Connection"}),e.jsx(qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Qe,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(nt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(ot,{children:e.jsx(st,{})})}),e.jsxs(rt,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"w-4 h-4"}),"Websocket"]})}),u&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),m==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),m==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(m==="NPX"||m==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(ut,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),m!=="NPX"&&m!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(it,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Ye,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Fe,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(He,{children:[e.jsxs(Oe,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Be,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Me,{children:[e.jsx(Re,{children:"Cancel"}),e.jsx(Ue,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(we,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(z,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(De,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs($,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(Te,{columns:ue,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(z,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(z,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function jn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Pe,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(et,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{jn as default};
1
+ import{c as ge,j as e,r as M,f as xe,b as je,a as fe,u as ye,E as ve,B as _e,y as se,Z as Ce,z as y,a3 as ke}from"./index-ZiFjEqyT.js";import{C as Ne}from"./collection-header-Dl8Ii13M.js";import{C as Se}from"./collection-page-C75JriCh.js";import{C as Te}from"./collection-search-D67e9ppe.js";import{C as we}from"./collection-table-wrapper-DDHrDWif.js";import{C as De}from"./connection-card-BuCHeT4K.js";import{n as O,E as B,I as be}from"./empty-state-B1DU5702.js";import{E as Pe}from"./error-boundary-BOBkDZ1Y.js";import{a as Ie,u as Ve}from"./use-connection-BskZam-G.js";import{u as Ee}from"./use-binding-C8KxuIY6.js";import{u as $e,s as Q}from"./use-list-state-C5pgFF_z.js";import{u as Ae}from"./project-context-provider-BPo-49FO.js";import{f as Fe,a as He,b as Oe,c as Be,d as ze,e as Me,A as Re,g as Ue}from"./alert-dialog-Df8ZsItX.js";import{B as Xe}from"./badge-BPKvq16e.js";import{B as _}from"./button-Co_HOc3E.js";import{d as Le,c as We,a as Ke,D as Ge,g as qe,f as Ye}from"./dialog-bW33A1d_.js";import{b as Z,D as J,a as ee,c as E}from"./dropdown-menu-dsr_wyw0.js";import{a as Qe,F as h,b as g,c as x,d as j,f}from"./form-ChO7tWCF.js";import{i as te}from"./DotsVertical-f9rnazjX.js";import{f as Ze,e as Je,s as z}from"./registry-utils-DzI73csj.js";import{i as et}from"./Loading01-Bq_7Os6T.js";import{i as tt}from"./Terminal-BWurH474.js";import{s as ne}from"./Trash01-GrzirNvV.js";import{I as k}from"./input-DEsmZ6es.js";import{S as nt,a as ot,b as st,c as rt,d as P}from"./select-CVEPeRAQ.js";import{T as it}from"./textarea-DFRypKCQ.js";import{g as at}from"./generate-id-Dyweu44Y.js";import{a as ct}from"./use-tool-call-BbfSyOCz.js";import{c as lt}from"./connection-CmMMEDBY.js";import{i as dt,r as mt,E as ut,e as re}from"./env-vars-editor-BjH5KdVc.js";import"./collection-display-button-C_GfVLwh.js";import"./ArrowUp-KvHCnFh3.js";import"./Check-D4dBNJmC.js";import"./Grid01-BgBQwtBY.js";import"./List-hTdqyLGB.js";import"./tooltip-BJO9sFhZ.js";import"./view-mode-toggle-tlrhMsiy.js";import"./SearchMd-B_A85eif.js";import"./card-Rz2C5-Lx.js";import"./use-collections-g067BPxP.js";import"./useMutation-4fnzP4bc.js";import"./binder-BtPpbY4I.js";import"./use-mobile-Co7MtEW-.js";import"./X-D09jV0HO.js";import"./ChevronDown-CJaS1NVA.js";import"./useQuery-Bn2Wcch_.js";import"./Plus-C4F6mby2.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function A(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const u=s.slice(1).find(a=>!a.startsWith("-"));return u?{packageName:u}:null}function $(n){const{uiType:s}=n,i=A(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===A("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=A(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",u=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:u}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const u={command:n};s.trim()&&(u.args=s.trim().split(/\s+/)),i?.trim()&&(u.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(u.envVars=a),u}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=Ae(),s=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:u}=ye(),a=$e({namespace:n.slug,resource:"connections"}),I=Ie(),N=Ve(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=Ze(R?.tools),ie=lt(F||void 0),{data:ae}=ct({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=Je(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),D=$({uiType:m,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:m,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=mt(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},me=async t=>{let o,c=null,T=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",T=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...T&&{connection_token:T},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const w=at("conn");await I.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:T,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,T=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!T&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(b=>b.key)),Y=p.envVarKeys.filter(b=>!he.has(b));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},H=gt(o);if(H&&u){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w($({uiType:"NPX",npxPackage:H.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),w($({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}m==="NPX"&&w($({uiType:"NPX",npxPackage:o}))},ue=[{id:"icon",header:"",render:t=>e.jsx(be,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(Xe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(Z,{children:[e.jsx(J,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Le,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(We,{className:"sm:max-w-[525px]",children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:l?"Edit Connection":"Create Connection"}),e.jsx(qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Qe,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(nt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(ot,{children:e.jsx(st,{})})}),e.jsxs(rt,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),u&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),m==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),m==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(m==="NPX"||m==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(ut,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),m!=="NPX"&&m!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(it,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Ye,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Fe,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(He,{children:[e.jsxs(Oe,{children:[e.jsx(Be,{children:"Delete Connection?"}),e.jsxs(ze,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Me,{children:[e.jsx(Re,{children:"Cancel"}),e.jsx(Ue,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(Te,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(De,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(Z,{children:[e.jsx(J,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(we,{columns:ue,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function jn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Pe,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(et,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{jn as default};
@@ -0,0 +1 @@
1
+ import{L as t,bm as a}from"./index-ZiFjEqyT.js";const e="mcp.mesh",s=t(a,{target:"draft-7"});export{s as B,e as M};
@@ -0,0 +1 @@
1
+ import{y as A,z as D,c as O,B as v,E,j as r,a as N}from"./index-ZiFjEqyT.js";import{A as I,a as M,b as B,c as L,d as R,e as T,f as $}from"./alert-dialog-Df8ZsItX.js";import{B as V}from"./button-Co_HOc3E.js";import{F as k,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-ChO7tWCF.js";import{I as P}from"./input-DEsmZ6es.js";import{S as Q}from"./spinner-DqooIng7.js";import{u as W}from"./useMutation-4fnzP4bc.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let z;e[1]===Symbol.for("react.memo_cache_sentinel")?(z={mutationFn:Z,onSuccess:Y},e[1]=z):z=e[1];const i=W(z),w=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(B,{children:[r.jsx(L,{children:"Create a new organization"}),r.jsx(R,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(k,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==w?(c=w&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:w}),e[13]=w,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(V,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs(T,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx($,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
@@ -1 +1 @@
1
- import{c as n,j as i,R as u,C as m,T as x,D as j,P as N,O as D,a$ as b,g as p}from"./index-pvGhQBw9.js";import{i as h}from"./X-q5bh176U.js";import{c}from"./button-CICpj3wE.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function y(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx($,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx(y,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,O as a,T as b,R as c,k as d,w as e,P as f,E as g};
1
+ import{c as n,j as i,R as u,C as m,T as x,D as j,P as N,O as D,a$ as b,g as p}from"./index-ZiFjEqyT.js";import{i as h}from"./X-D09jV0HO.js";import{c}from"./button-Co_HOc3E.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function y(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx($,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx(y,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,O as a,T as b,R as c,k as d,w as e,P as f,E as g};
@@ -1 +1 @@
1
- import{c,j as i,bv as p,bw as f,bx as m,by as g,bz as b,bA as x,bB as v,bC as w,bD as h}from"./index-pvGhQBw9.js";import{i as j}from"./Grid01-CoHgfBeE.js";import{c as u}from"./button-CICpj3wE.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(b,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(x,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,R as g};
1
+ import{c,j as i,bv as p,bw as f,bx as m,by as g,bz as b,bA as x,bB as v,bC as w,bD as h}from"./index-ZiFjEqyT.js";import{i as j}from"./Grid01-BgBQwtBY.js";import{c as u}from"./button-Co_HOc3E.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(b,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(x,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,R as g};
@@ -1 +1 @@
1
- import{c as I,d as P,a as O,j as n,bE as N,r as b,s as H,a4 as R}from"./index-pvGhQBw9.js";import{i as _}from"./Loading01-DxDL3s7X.js";import{a as T}from"./binder-BVHRVoIY.js";import{u as A}from"./use-connection-BF1UFzlw.js";import{L as $,u as D}from"./localstorage-keys-CdhAbc7P.js";import{u as G}from"./project-context-provider-CUiGxKJp.js";import{c as K}from"./connection-Mp3hTHGP.js";import"./use-collections-JQXbZBdV.js";import"./useMutation-B64mCwly.js";import"./useQuery-Dr4r_H_i.js";function Y(e,t){return e?e.filter(d=>T(d,t)):[]}function L(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function q(e){const t=I.c(13),{binding:d,renderHeader:m,renderEmptyState:s}=e,{org:l}=G();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{pluginId:a}=P(r),i=A(),{data:o}=O.useSession(),p=Y(i,d);let x;t[1]!==l.slug||t[2]!==a?(x=$.pluginConnection(l.slug,a),t[1]=l.slug,t[2]=a,t[3]=x):x=t[3];const[y,k]=D(x,F);let g;t[4]!==y?(g=f=>f.id===y,t[4]=y,t[5]=g):g=t[5];const u=p.find(g)??p[0]??null,v=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,E={id:l.id,slug:l.slug,name:l.name};if(p.length===0||!u){const f={connectionId:null,connection:null,toolCaller:null,org:E,session:v};let c;t[6]!==s?(c=s(),t[6]=s,t[7]=c):c=t[7];let C;return t[8]!==c?(C=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),t[8]=c,t[9]=C):C=t[9],n.jsx(N,{value:f,children:C})}const w=K(u.id),z={connectionId:u.id,connection:L(u),toolCaller:((f,c)=>w(f,c)),org:E,session:v},B="h-full flex flex-col overflow-hidden",S=m({connections:p.map(L),selectedConnectionId:u.id,onConnectionChange:k});let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(b.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(H,{})})}),t[10]=h):h=t[10];let j;return t[11]!==S?(j=n.jsxs("div",{className:B,children:[S,h]}),t[11]=S,t[12]=j):j=t[12],n.jsx(N,{value:z,children:j})}function F(e){return e??""}function se(){const e=I.c(12);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{pluginId:d}=P(t);let m;e[1]!==d?(m=R.find(i=>i.id===d),e[1]=d,e[2]=m):m=e[2];const s=m;if(s?.renderHeader&&s?.renderEmptyState){let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=i):i=e[3];let o;return e[4]!==s.binding||e[5]!==s.renderEmptyState||e[6]!==s.renderHeader?(o=n.jsx(b.Suspense,{fallback:i,children:n.jsx(q,{binding:s.binding,renderHeader:s.renderHeader,renderEmptyState:s.renderEmptyState})}),e[4]=s.binding,e[5]=s.renderEmptyState,e[6]=s.renderHeader,e[7]=o):o=e[7],o}const l=s?.LayoutComponent;if(!l){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(H,{}),e[8]=i):i=e[8],i}let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=r):r=e[9];let a;return e[10]!==l?(a=n.jsx(b.Suspense,{fallback:r,children:n.jsx(l,{})}),e[10]=l,e[11]=a):a=e[11],a}export{se as default};
1
+ import{c as I,d as P,a as O,j as n,bE as N,r as b,w as H,a6 as R}from"./index-ZiFjEqyT.js";import{i as _}from"./Loading01-Bq_7Os6T.js";import{a as T}from"./binder-BtPpbY4I.js";import{u as A}from"./use-connection-BskZam-G.js";import{L as $,u as D}from"./localstorage-keys-DhdYpXZj.js";import{u as G}from"./project-context-provider-BPo-49FO.js";import{c as K}from"./connection-CmMMEDBY.js";import"./use-collections-g067BPxP.js";import"./useMutation-4fnzP4bc.js";import"./useQuery-Bn2Wcch_.js";function Y(e,t){return e?e.filter(d=>T(d,t)):[]}function L(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function q(e){const t=I.c(13),{binding:d,renderHeader:m,renderEmptyState:s}=e,{org:l}=G();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{pluginId:a}=P(r),i=A(),{data:o}=O.useSession(),p=Y(i,d);let x;t[1]!==l.slug||t[2]!==a?(x=$.pluginConnection(l.slug,a),t[1]=l.slug,t[2]=a,t[3]=x):x=t[3];const[y,w]=D(x,F);let g;t[4]!==y?(g=f=>f.id===y,t[4]=y,t[5]=g):g=t[5];const u=p.find(g)??p[0]??null,v=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,E={id:l.id,slug:l.slug,name:l.name};if(p.length===0||!u){const f={connectionId:null,connection:null,toolCaller:null,org:E,session:v};let c;t[6]!==s?(c=s(),t[6]=s,t[7]=c):c=t[7];let C;return t[8]!==c?(C=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),t[8]=c,t[9]=C):C=t[9],n.jsx(N,{value:f,children:C})}const k=K(u.id),z={connectionId:u.id,connection:L(u),toolCaller:((f,c)=>k(f,c)),org:E,session:v},B="h-full flex flex-col overflow-hidden",S=m({connections:p.map(L),selectedConnectionId:u.id,onConnectionChange:w});let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(b.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(H,{})})}),t[10]=h):h=t[10];let j;return t[11]!==S?(j=n.jsxs("div",{className:B,children:[S,h]}),t[11]=S,t[12]=j):j=t[12],n.jsx(N,{value:z,children:j})}function F(e){return e??""}function se(){const e=I.c(12);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{pluginId:d}=P(t);let m;e[1]!==d?(m=R.find(i=>i.id===d),e[1]=d,e[2]=m):m=e[2];const s=m;if(s?.renderHeader&&s?.renderEmptyState){let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=i):i=e[3];let o;return e[4]!==s.binding||e[5]!==s.renderEmptyState||e[6]!==s.renderHeader?(o=n.jsx(b.Suspense,{fallback:i,children:n.jsx(q,{binding:s.binding,renderHeader:s.renderHeader,renderEmptyState:s.renderEmptyState})}),e[4]=s.binding,e[5]=s.renderEmptyState,e[6]=s.renderHeader,e[7]=o):o=e[7],o}const l=s?.LayoutComponent;if(!l){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(H,{}),e[8]=i):i=e[8],i}let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=r):r=e[9];let a;return e[10]!==l?(a=n.jsx(b.Suspense,{fallback:r,children:n.jsx(l,{})}),e[10]=l,e[11]=a):a=e[11],a}export{se as default};
@@ -1 +1 @@
1
- import{r as y,c as C,j as l}from"./index-pvGhQBw9.js";import{c as I}from"./button-CICpj3wE.js";const _=({size:o=24,color:e="currentColor",...t})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},y.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));_.displayName="Container";const L={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},$={"2xs":8,xs:12,sm:16,md:24,lg:32};function R(o){const e=C.c(7),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,g=t??"no-icon";let s;return e[0]!==a||e[1]!==m||e[2]!==t||e[3]!==r||e[4]!==n||e[5]!==g?(s=l.jsx(M,{icon:t,name:r,size:n,className:a,fallbackIcon:m},g),e[0]=a,e[1]=m,e[2]=t,e[3]=r,e[4]=n,e[5]=g,e[6]=s):s=e[6],s}function M(o){const e=C.c(24),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,[g,s]=y.useState(!1),j=!!t&&g,d=L[n],f=z[n];let c;e[0]!==a||e[1]!==d||e[2]!==f?(c=I("rounded-lg border border-border shrink-0 overflow-hidden",d,f,a),e[0]=a,e[1]=d,e[2]=f,e[3]=c):c=e[3];const x=t||void 0,u=!j&&"hidden";let i;e[4]!==u?(i=I("h-full w-full object-cover",u),e[4]=u,e[5]=i):i=e[5];let p,E;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=()=>s(!1),E=()=>s(!0),e[6]=p,e[7]=E):(p=e[6],E=e[7]);let N;e[8]!==r||e[9]!==x||e[10]!==i?(N=l.jsx("img",{src:x,alt:r,className:i,onError:p,onLoad:E}),e[8]=r,e[9]=x,e[10]=i,e[11]=N):N=e[11];const k=j&&"hidden";let w;e[12]!==k?(w=I("h-full w-full flex items-center justify-center bg-muted/20",k),e[12]=k,e[13]=w):w=e[13];let v;e[14]!==m||e[15]!==n?(v=m??l.jsx(_,{size:$[n],className:"text-muted-foreground"}),e[14]=m,e[15]=n,e[16]=v):v=e[16];let S;e[17]!==w||e[18]!==v?(S=l.jsx("div",{className:w,children:v}),e[17]=w,e[18]=v,e[19]=S):S=e[19];let b;return e[20]!==N||e[21]!==S||e[22]!==c?(b=l.jsxs("div",{className:c,children:[N,S]}),e[20]=N,e[21]=S,e[22]=c,e[23]=b):b=e[23],b}function Z(){const o=C.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),o[0]=e):e=o[0],e}function W(o){const e=C.c(24),{image:t,title:r,description:h,actions:a,className:m,descriptionClassName:n,actionsClassName:g}=o;let s;e[0]!==m?(s=I("flex flex-1 flex-col items-center justify-center gap-8 p-4",m),e[0]=m,e[1]=s):s=e[1];let j;e[2]!==t?(j=t!==null&&l.jsx("div",{className:"flex items-center justify-center",children:t??l.jsx(Z,{})}),e[2]=t,e[3]=j):j=e[3];let d;e[4]!==r?(d=l.jsx("h3",{className:"text-lg font-medium text-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let f;e[6]!==n?(f=I("text-sm text-muted-foreground text-center max-w-[300px]",n),e[6]=n,e[7]=f):f=e[7];let c;e[8]!==h||e[9]!==f?(c=l.jsx("div",{className:f,children:h}),e[8]=h,e[9]=f,e[10]=c):c=e[10];let x;e[11]!==d||e[12]!==c?(x=l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d,c]}),e[11]=d,e[12]=c,e[13]=x):x=e[13];let u;e[14]!==a||e[15]!==g?(u=a&&l.jsx("div",{className:I("flex items-center gap-2",g),children:a}),e[14]=a,e[15]=g,e[16]=u):u=e[16];let i;e[17]!==x||e[18]!==u?(i=l.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,u]}),e[17]=x,e[18]=u,e[19]=i):i=e[19];let p;return e[20]!==s||e[21]!==j||e[22]!==i?(p=l.jsxs("div",{className:s,children:[j,i]}),e[20]=s,e[21]=j,e[22]=i,e[23]=p):p=e[23],p}export{W as E,R as I,_ as n};
1
+ import{r as y,c as C,j as l}from"./index-ZiFjEqyT.js";import{c as I}from"./button-Co_HOc3E.js";const _=({size:o=24,color:e="currentColor",...t})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},y.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));_.displayName="Container";const L={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},$={"2xs":8,xs:12,sm:16,md:24,lg:32};function R(o){const e=C.c(7),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,g=t??"no-icon";let s;return e[0]!==a||e[1]!==m||e[2]!==t||e[3]!==r||e[4]!==n||e[5]!==g?(s=l.jsx(M,{icon:t,name:r,size:n,className:a,fallbackIcon:m},g),e[0]=a,e[1]=m,e[2]=t,e[3]=r,e[4]=n,e[5]=g,e[6]=s):s=e[6],s}function M(o){const e=C.c(24),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,[g,s]=y.useState(!1),j=!!t&&g,d=L[n],f=z[n];let c;e[0]!==a||e[1]!==d||e[2]!==f?(c=I("rounded-lg border border-border shrink-0 overflow-hidden",d,f,a),e[0]=a,e[1]=d,e[2]=f,e[3]=c):c=e[3];const x=t||void 0,u=!j&&"hidden";let i;e[4]!==u?(i=I("h-full w-full object-cover",u),e[4]=u,e[5]=i):i=e[5];let p,E;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=()=>s(!1),E=()=>s(!0),e[6]=p,e[7]=E):(p=e[6],E=e[7]);let N;e[8]!==r||e[9]!==x||e[10]!==i?(N=l.jsx("img",{src:x,alt:r,className:i,onError:p,onLoad:E}),e[8]=r,e[9]=x,e[10]=i,e[11]=N):N=e[11];const k=j&&"hidden";let w;e[12]!==k?(w=I("h-full w-full flex items-center justify-center bg-muted/20",k),e[12]=k,e[13]=w):w=e[13];let v;e[14]!==m||e[15]!==n?(v=m??l.jsx(_,{size:$[n],className:"text-muted-foreground"}),e[14]=m,e[15]=n,e[16]=v):v=e[16];let S;e[17]!==w||e[18]!==v?(S=l.jsx("div",{className:w,children:v}),e[17]=w,e[18]=v,e[19]=S):S=e[19];let b;return e[20]!==N||e[21]!==S||e[22]!==c?(b=l.jsxs("div",{className:c,children:[N,S]}),e[20]=N,e[21]=S,e[22]=c,e[23]=b):b=e[23],b}function Z(){const o=C.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),o[0]=e):e=o[0],e}function W(o){const e=C.c(24),{image:t,title:r,description:h,actions:a,className:m,descriptionClassName:n,actionsClassName:g}=o;let s;e[0]!==m?(s=I("flex flex-1 flex-col items-center justify-center gap-8 p-4",m),e[0]=m,e[1]=s):s=e[1];let j;e[2]!==t?(j=t!==null&&l.jsx("div",{className:"flex items-center justify-center",children:t??l.jsx(Z,{})}),e[2]=t,e[3]=j):j=e[3];let d;e[4]!==r?(d=l.jsx("h3",{className:"text-lg font-medium text-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let f;e[6]!==n?(f=I("text-sm text-muted-foreground text-center max-w-[300px]",n),e[6]=n,e[7]=f):f=e[7];let c;e[8]!==h||e[9]!==f?(c=l.jsx("div",{className:f,children:h}),e[8]=h,e[9]=f,e[10]=c):c=e[10];let x;e[11]!==d||e[12]!==c?(x=l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d,c]}),e[11]=d,e[12]=c,e[13]=x):x=e[13];let u;e[14]!==a||e[15]!==g?(u=a&&l.jsx("div",{className:I("flex items-center gap-2",g),children:a}),e[14]=a,e[15]=g,e[16]=u):u=e[16];let i;e[17]!==x||e[18]!==u?(i=l.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,u]}),e[17]=x,e[18]=u,e[19]=i):i=e[19];let p;return e[20]!==s||e[21]!==j||e[22]!==i?(p=l.jsxs("div",{className:s,children:[j,i]}),e[20]=s,e[21]=j,e[22]=i,e[23]=p):p=e[23],p}export{W as E,R as I,_ as n};
@@ -1 +1 @@
1
- import{c as p,j as t}from"./index-pvGhQBw9.js";import{B as j,c as b}from"./button-CICpj3wE.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
1
+ import{c as p,j as t}from"./index-ZiFjEqyT.js";import{B as j,c as b}from"./button-Co_HOc3E.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
@@ -0,0 +1 @@
1
+ import{y as k,a3 as D,Z as v,z as t,Y as m,a0 as T,M as O,c as R,j as c}from"./index-ZiFjEqyT.js";import{B as z}from"./button-Co_HOc3E.js";import{I as N}from"./input-DEsmZ6es.js";import{s as W}from"./Plus-C4F6mby2.js";import{s as H}from"./Trash01-GrzirNvV.js";const U=k({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:v(t()),grantType:D(["authorization_code","client_credentials"])}),L=k({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),B=k({headers:m(t(),t()).optional()}),K=k({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:v(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),V=k({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:O([K,B]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:U.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:v(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:v(L).nullable().describe("Discovered tools from MCP"),bindings:v(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});V.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});V.partial();function G(r){return r!=null&&"command"in r}function M(r){const e=r.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function J(r){const e=R.c(34),{value:n,onChange:o,keyPlaceholder:j,valuePlaceholder:l,className:I}=r,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let x;e[0]!==o||e[1]!==n?(x=()=>{o([...n,{key:"",value:""}])},e[0]=o,e[1]=n,e[2]=x):x=e[2];const A=x;let w;e[3]!==o||e[4]!==n?(w=s=>{o(n.filter((u,i)=>i!==s))},e[3]=o,e[4]=n,e[5]=w):w=e[5];const b=w;let S;e[6]!==o||e[7]!==n?(S=(s,u)=>{const i=[...n],a=i[s];a&&(i[s]={key:u,value:a.value},o(i))},e[6]=o,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==o||e[10]!==n?(C=(s,u)=>{const i=[...n],a=i[s];a&&(i[s]={key:a.key,value:u},o(i))},e[9]=o,e[10]=n,e[11]=C):C=e[11];const y=C;let d;if(e[12]!==g||e[13]!==b||e[14]!==y||e[15]!==f||e[16]!==n||e[17]!==_){let s;e[19]!==g||e[20]!==b||e[21]!==y||e[22]!==f||e[23]!==_?(s=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(N,{placeholder:f,value:u.key,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(N,{type:M(u.key)?"password":"text",placeholder:_,value:u.value,onChange:a=>y(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(i),children:c.jsx(H,{size:16})})]},i),e[19]=g,e[20]=b,e[21]=y,e[22]=f,e[23]=_,e[24]=s):s=e[24],d=n.map(s),e[12]=g,e[13]=b,e[14]=y,e[15]=f,e[16]=n,e[17]=_,e[18]=d}else d=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(W,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(z,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==d||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[d,p]}),e[28]=d,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function Q(r){const e={};for(const{key:n,value:o}of r)n.trim()&&(e[n.trim()]=o);return e}function X(r){return r?Object.entries(r).map(([e,n])=>({key:e,value:n})):[]}export{J as E,Q as e,G as i,X as r};
@@ -1 +1 @@
1
- import{r as o,j as e}from"./index-pvGhQBw9.js";import{B as n}from"./button-CICpj3wE.js";const a=({size:t=24,color:r="currentColor",...s})=>o.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},o.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));a.displayName="AlertTriangle";class l extends o.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(a,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{l as E,a as i};
1
+ import{r as o,j as e}from"./index-ZiFjEqyT.js";import{B as n}from"./button-Co_HOc3E.js";const a=({size:t=24,color:r="currentColor",...s})=>o.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},o.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));a.displayName="AlertTriangle";class l extends o.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(a,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{l as E,a as i};
@@ -1 +1 @@
1
- import{r as v}from"./index-pvGhQBw9.js";import{M as D}from"./constants-DsV2FGIq.js";import{g as R}from"./github-icon-Dp3wHhYE.js";import{g as A}from"./registry-utils-h9Ud__h7.js";import{g as O}from"./generate-id-Dyweu44Y.js";const z=({size:e=24,color:r="currentColor",...c})=>v.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...c},v.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));z.displayName="CheckCircle";function H(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function L(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function B(e,r,c,i){const n=e.server,t=e._meta?.[D],m=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",C=n?.description||null,x=n?.icons?.[0]?.src||R(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,S=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,p=n?.packages??[],f=n?.remotes??[],w=i?.packageIndex??0,P=i?.remoteIndex??0,y=p.length>0&&i?.packageIndex!==void 0,a=y?p[w]:null,s=y?null:f[P];let l,u,h=null;if(a){const _=a.identifier||a.name;l="STDIO",u="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(l=A(s.type)||"HTTP",u=s.url||""):(l="HTTP",u="");const E=f.length>1,M=p.length>1;let d="";a&&M?d=` (${L(a)})`:s&&E&&(d=` (${H(s)})`);const U=b+d;return{id:O("conn"),title:U,description:C,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:l,connection_url:u,connection_token:null,connection_headers:h,oauth_config:I,configuration_state:N??null,configuration_scopes:S??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:m,updated_at:m,created_by:c,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{B as e,z as i};
1
+ import{r as v}from"./index-ZiFjEqyT.js";import{M as D}from"./constants-B5NZDm4s.js";import{g as R}from"./github-icon-Dp3wHhYE.js";import{g as A}from"./registry-utils-DzI73csj.js";import{g as O}from"./generate-id-Dyweu44Y.js";const z=({size:e=24,color:r="currentColor",...c})=>v.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...c},v.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));z.displayName="CheckCircle";function H(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function L(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function B(e,r,c,i){const n=e.server,t=e._meta?.[D],m=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",C=n?.description||null,x=n?.icons?.[0]?.src||R(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,S=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,p=n?.packages??[],f=n?.remotes??[],w=i?.packageIndex??0,P=i?.remoteIndex??0,y=p.length>0&&i?.packageIndex!==void 0,a=y?p[w]:null,s=y?null:f[P];let l,u,h=null;if(a){const _=a.identifier||a.name;l="STDIO",u="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(l=A(s.type)||"HTTP",u=s.url||""):(l="HTTP",u="");const E=f.length>1,M=p.length>1;let d="";a&&M?d=` (${L(a)})`:s&&E&&(d=` (${H(s)})`);const U=b+d;return{id:O("conn"),title:U,description:C,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:l,connection_url:u,connection_token:null,connection_headers:h,oauth_config:I,configuration_state:N??null,configuration_scopes:S??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:m,updated_at:m,created_by:c,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{B as e,z as i};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-BYe4Rwz4.js","assets/index-pvGhQBw9.js","assets/index-fFpUC2Bx.css","assets/button-CICpj3wE.js","assets/AlertCircle-CMyS46jH.js","assets/Download01-D1VGE3pA.js","assets/File06-De52zO32.js","assets/Image01-D_Oad7Fi.js","assets/Loading01-DxDL3s7X.js","assets/Trash01-MX6mkM7g.js","assets/Upload01-BGvogcXt.js","assets/useMutation-B64mCwly.js","assets/useQuery-Dr4r_H_i.js","assets/useInfiniteQuery-qVzxuL4i.js","assets/infiniteQueryObserver-DjOTL7tS.js","assets/checkbox-DTTIHxXg.js","assets/Check-BEhtk6Py.js","assets/Grid01-CoHgfBeE.js","assets/Home02-Dax6TXzJ.js","assets/List-BXC8ldIg.js"])))=>i.map(i=>d[i]);
2
- import{r as M,c as K,bK as J,bL as A,v as Y,j as t,t as B,aT as X,bJ as ee}from"./index-pvGhQBw9.js";import{u as te}from"./useInfiniteQuery-qVzxuL4i.js";import{B as _}from"./button-CICpj3wE.js";import{C as D}from"./checkbox-DTTIHxXg.js";import{i as se}from"./AlertCircle-CMyS46jH.js";import{c as H,i as ae}from"./Grid01-CoHgfBeE.js";import{n as ie}from"./Download01-D1VGE3pA.js";import{a as re}from"./Home02-Dax6TXzJ.js";import{i as V}from"./List-BXC8ldIg.js";import{i as $}from"./Loading01-DxDL3s7X.js";import{s as Q}from"./Trash01-MX6mkM7g.js";import{i as U}from"./Upload01-BGvogcXt.js";import{u as G}from"./useMutation-B64mCwly.js";const W=({size:s=24,color:e="currentColor",...a})=>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",...a},M.createElement("path",{d:"M14 11H8m2 4H8m8-8H8m12-.2v10.4c0 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 2h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C20 4.28 20 5.12 20 6.8Z"}));W.displayName="File02";const Z=({size:s=24,color:e="currentColor",...a})=>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",...a},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,a=!1,o=100)=>["object-storage","objects",s,e,{flat:a,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},oe=100;function ne(s){const e=K.c(30);let a;e[0]!==s?(a=s===void 0?{}:s,e[0]=s,e[1]=a):a=e[1];const o=a,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?oe: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 i=>{const{pageParam:r}=i;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:he,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:w,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:z}=te(E);let v;if(l){let i;e[15]!==p?.pages?(i=p?.pages.flatMap(pe).filter(xe).map(ue)??[],e[15]=p?.pages,e[16]=i):i=e[16],v=i}else{let i;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(fe)??[],j=p?.pages.flatMap(ce)??[];i=[...r.sort(le),...j],e[17]=p?.pages,e[18]=i}else i=e[18];v=i}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,P=y??!1,F=z;let k;return e[23]!==g||e[24]!==w||e[25]!==C||e[26]!==v||e[27]!==F||e[28]!==P?(k={objects:v,isLoading:w,isFetchingMore:g,hasMore:P,loadMore:C,error:F},e[23]=g,e[24]=w,e[25]=C,e[26]=v,e[27]=F,e[28]=P,e[29]=k):k=e[29],k}function le(s,e){return s.key.localeCompare(e.key)}function ce(s){return s.objects.filter(me).map(de)}function de(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function me(s){return!s.key.endsWith("/")}function fe(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function ue(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function xe(s){return!s.key.endsWith("/")}function pe(s){return s.objects}function he(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function ge(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],a=1024,o=Math.floor(Math.log(s)/Math.log(a));return`${parseFloat((s/Math.pow(a,o)).toFixed(1))} ${e[o]}`}function je(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ye(s){const e=[],a=s.split("/").filter(Boolean);let o="";for(const n of a)o+=n+"/",e.push({name:n,path:o});return e}function $e(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 ve=M.lazy(()=>X(()=>import("./grid-view-BYe4Rwz4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])));function Ne(s){const e=K.c(48),{item:a,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==a.key||e[1]!==c?(b=c?a.key:I(a.key),e[0]=a.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(D,{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]!==a.isFolder||e[7]!==a.key||e[8]!==d?(u=()=>a.isFolder?d(a.key):void 0,e[6]=a.isFolder,e[7]=a.key,e[8]=d,e[9]=u):u=e[9];const E=`flex items-center gap-2 flex-1 min-w-0 text-left ${a.isFolder?"cursor-pointer hover:text-primary":""}`;let p;e[10]!==a.isFolder?(p=a.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(W,{size:18,className:"text-muted-foreground shrink-0"}),e[10]=a.isFolder,e[11]=p):p=e[11];let w;e[12]!==S?(w=t.jsx("span",{className:"truncate",children:S}),e[12]=S,e[13]=w):w=e[13];let g;e[14]!==u||e[15]!==E||e[16]!==p||e[17]!==w?(g=t.jsxs("button",{type:"button",onClick:u,className:E,children:[p,w]}),e[14]=u,e[15]=E,e[16]=p,e[17]=w,e[18]=g):g=e[18];let y;e[19]!==a.isFolder||e[20]!==a.size?(y=a.isFolder?"-":ge(a.size),e[19]=a.isFolder,e[20]=a.size,e[21]=y):y=e[21];let h;e[22]!==y?(h=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:y}),e[22]=y,e[23]=h):h=e[23];let z;e[24]!==a.isFolder||e[25]!==a.lastModified?(z=a.isFolder?"-":je(a.lastModified),e[24]=a.isFolder,e[25]=a.lastModified,e[26]=z):z=e[26];let v;e[27]!==z?(v=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:z}),e[27]=z,e[28]=v):v=e[28];let N;e[29]!==a.isFolder||e[30]!==a.key||e[31]!==m?(N=!a.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(a.key),children:t.jsx(ie,{size:14})}),e[29]=a.isFolder,e[30]=a.key,e[31]=m,e[32]=N):N=e[32];let C;e[33]!==a.key||e[34]!==l?(C=()=>l(a.key),e[33]=a.key,e[34]=l,e[35]=C):C=e[35];let P;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Q,{size:14}),e[36]=P):P=e[36];let F;e[37]!==C?(F=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:C,children:P}),e[37]=C,e[38]=F):F=e[38];let k;e[39]!==N||e[40]!==F?(k=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[N,F]}),e[39]=N,e[40]=F,e[41]=k):k=e[41];let i;return e[42]!==h||e[43]!==v||e[44]!==k||e[45]!==f||e[46]!==g?(i=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,g,h,v,k]}),e[42]=h,e[43]=v,e[44]=k,e[45]=f,e[46]=g,e[47]=i):i=e[47],i}function q(s){const e=K.c(8),{prefix:a,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==a){const x=ye(a);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(re,{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:`hover:text-primary ${b===x.length-1?"font-medium text-foreground":"text-muted-foreground"}`,children:c.name})]},c.path))]}),e[0]=o,e[1]=a,e[2]=n}else n=e[2];return n}function be(){const{path:s="",flat:e=!1,view:a="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=i=>{x(new Set),o({to:"/",search:{path:i||void 0,flat:e,view:a}})},m=i=>{x(new Set),o({to:"/",search:{path:i?void 0:s||void 0,flat:i,view:a}})},l=i=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:i}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=J(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:w,loadMore:g,error:y}=ne({prefix:s,flat:e}),h=G({mutationFn:async i=>{const r=s+i.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:i.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:i=>{B.success(`Uploaded ${I(i)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Upload failed: ${i.message}`)}}),z=G({mutationFn:async i=>i.length===1&&i[0]?f("DELETE_OBJECT",{key:i[0]}):f("DELETE_OBJECTS",{keys:i}),onSuccess:()=>{B.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Delete failed: ${i.message}`)}}),v=async i=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:i}),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),L=document.createElement("a");L.href=O,L.download=I(i),document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(O)}catch(r){B.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=i=>{const r=i.target.files;if(r){for(const j of Array.from(r))h.mutate(j);i.target.value=""}},C=(i,r)=>{const j=new Set(n);r?j.add(i):j.delete(i),x(j)},P=i=>{x(i?new Set(u.map(r=>r.key)):new Set)},F=()=>{n.size!==0&&z.mutate(Array.from(n))},k=i=>{if(!w||p)return;const r=i.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})]}):a==="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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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($,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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:F,disabled:z.isPending,children:[t.jsx(Q,{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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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(D,{checked:n.size>0&&n.size===u.length,onCheckedChange:P}),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($,{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(U,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(i=>t.jsx(Ne,{item:i,selected:n.has(i.key),showFullPath:e,onSelect:r=>C(i.key,r),onNavigate:d,onDownload:v,onDelete:r=>z.mutate([r])},i.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx($,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{R as K,$e as a,De as b,ge as f,I as g,W as i,Z as s,ne as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-CTAOtRDs.js","assets/index-ZiFjEqyT.js","assets/index-JAPwCHXJ.css","assets/button-Co_HOc3E.js","assets/AlertCircle-DlBo4Xw9.js","assets/Download01-Cnas0PSW.js","assets/File06-Dir7h2_j.js","assets/Image01-B8cj-qoF.js","assets/Loading01-Bq_7Os6T.js","assets/Trash01-GrzirNvV.js","assets/Upload01-Ba_zCXbQ.js","assets/useMutation-4fnzP4bc.js","assets/useQuery-Bn2Wcch_.js","assets/useInfiniteQuery-Dbq7IS1q.js","assets/infiniteQueryObserver-DEh2zauU.js","assets/checkbox-DGIT6WZ3.js","assets/Check-D4dBNJmC.js","assets/Grid01-BgBQwtBY.js","assets/Home02-CR-W2ctm.js","assets/List-hTdqyLGB.js"])))=>i.map(i=>d[i]);
2
+ import{r as M,c as K,bK as J,bL as A,x as Y,j as t,t as B,aT as X,bJ as ee}from"./index-ZiFjEqyT.js";import{u as te}from"./useInfiniteQuery-Dbq7IS1q.js";import{B as _}from"./button-Co_HOc3E.js";import{C as D}from"./checkbox-DGIT6WZ3.js";import{i as se}from"./AlertCircle-DlBo4Xw9.js";import{c as H,i as ae}from"./Grid01-BgBQwtBY.js";import{n as ie}from"./Download01-Cnas0PSW.js";import{a as re}from"./Home02-CR-W2ctm.js";import{i as V}from"./List-hTdqyLGB.js";import{i as $}from"./Loading01-Bq_7Os6T.js";import{s as Q}from"./Trash01-GrzirNvV.js";import{i as U}from"./Upload01-Ba_zCXbQ.js";import{u as G}from"./useMutation-4fnzP4bc.js";const W=({size:s=24,color:e="currentColor",...a})=>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",...a},M.createElement("path",{d:"M14 11H8m2 4H8m8-8H8m12-.2v10.4c0 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 2h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C20 4.28 20 5.12 20 6.8Z"}));W.displayName="File02";const Z=({size:s=24,color:e="currentColor",...a})=>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",...a},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,a=!1,o=100)=>["object-storage","objects",s,e,{flat:a,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},oe=100;function ne(s){const e=K.c(30);let a;e[0]!==s?(a=s===void 0?{}:s,e[0]=s,e[1]=a):a=e[1];const o=a,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?oe: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 i=>{const{pageParam:r}=i;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:he,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:w,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:z}=te(E);let v;if(l){let i;e[15]!==p?.pages?(i=p?.pages.flatMap(pe).filter(xe).map(ue)??[],e[15]=p?.pages,e[16]=i):i=e[16],v=i}else{let i;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(fe)??[],j=p?.pages.flatMap(ce)??[];i=[...r.sort(le),...j],e[17]=p?.pages,e[18]=i}else i=e[18];v=i}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,P=y??!1,F=z;let k;return e[23]!==g||e[24]!==w||e[25]!==C||e[26]!==v||e[27]!==F||e[28]!==P?(k={objects:v,isLoading:w,isFetchingMore:g,hasMore:P,loadMore:C,error:F},e[23]=g,e[24]=w,e[25]=C,e[26]=v,e[27]=F,e[28]=P,e[29]=k):k=e[29],k}function le(s,e){return s.key.localeCompare(e.key)}function ce(s){return s.objects.filter(me).map(de)}function de(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function me(s){return!s.key.endsWith("/")}function fe(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function ue(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function xe(s){return!s.key.endsWith("/")}function pe(s){return s.objects}function he(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function ge(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],a=1024,o=Math.floor(Math.log(s)/Math.log(a));return`${parseFloat((s/Math.pow(a,o)).toFixed(1))} ${e[o]}`}function je(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ye(s){const e=[],a=s.split("/").filter(Boolean);let o="";for(const n of a)o+=n+"/",e.push({name:n,path:o});return e}function $e(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 ve=M.lazy(()=>X(()=>import("./grid-view-CTAOtRDs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])));function Ne(s){const e=K.c(48),{item:a,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==a.key||e[1]!==c?(b=c?a.key:I(a.key),e[0]=a.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(D,{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]!==a.isFolder||e[7]!==a.key||e[8]!==d?(u=()=>a.isFolder?d(a.key):void 0,e[6]=a.isFolder,e[7]=a.key,e[8]=d,e[9]=u):u=e[9];const E=`flex items-center gap-2 flex-1 min-w-0 text-left ${a.isFolder?"cursor-pointer hover:text-primary":""}`;let p;e[10]!==a.isFolder?(p=a.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(W,{size:18,className:"text-muted-foreground shrink-0"}),e[10]=a.isFolder,e[11]=p):p=e[11];let w;e[12]!==S?(w=t.jsx("span",{className:"truncate",children:S}),e[12]=S,e[13]=w):w=e[13];let g;e[14]!==u||e[15]!==E||e[16]!==p||e[17]!==w?(g=t.jsxs("button",{type:"button",onClick:u,className:E,children:[p,w]}),e[14]=u,e[15]=E,e[16]=p,e[17]=w,e[18]=g):g=e[18];let y;e[19]!==a.isFolder||e[20]!==a.size?(y=a.isFolder?"-":ge(a.size),e[19]=a.isFolder,e[20]=a.size,e[21]=y):y=e[21];let h;e[22]!==y?(h=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:y}),e[22]=y,e[23]=h):h=e[23];let z;e[24]!==a.isFolder||e[25]!==a.lastModified?(z=a.isFolder?"-":je(a.lastModified),e[24]=a.isFolder,e[25]=a.lastModified,e[26]=z):z=e[26];let v;e[27]!==z?(v=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:z}),e[27]=z,e[28]=v):v=e[28];let N;e[29]!==a.isFolder||e[30]!==a.key||e[31]!==m?(N=!a.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(a.key),children:t.jsx(ie,{size:14})}),e[29]=a.isFolder,e[30]=a.key,e[31]=m,e[32]=N):N=e[32];let C;e[33]!==a.key||e[34]!==l?(C=()=>l(a.key),e[33]=a.key,e[34]=l,e[35]=C):C=e[35];let P;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Q,{size:14}),e[36]=P):P=e[36];let F;e[37]!==C?(F=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:C,children:P}),e[37]=C,e[38]=F):F=e[38];let k;e[39]!==N||e[40]!==F?(k=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[N,F]}),e[39]=N,e[40]=F,e[41]=k):k=e[41];let i;return e[42]!==h||e[43]!==v||e[44]!==k||e[45]!==f||e[46]!==g?(i=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,g,h,v,k]}),e[42]=h,e[43]=v,e[44]=k,e[45]=f,e[46]=g,e[47]=i):i=e[47],i}function q(s){const e=K.c(8),{prefix:a,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==a){const x=ye(a);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(re,{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:`hover:text-primary ${b===x.length-1?"font-medium text-foreground":"text-muted-foreground"}`,children:c.name})]},c.path))]}),e[0]=o,e[1]=a,e[2]=n}else n=e[2];return n}function be(){const{path:s="",flat:e=!1,view:a="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=i=>{x(new Set),o({to:"/",search:{path:i||void 0,flat:e,view:a}})},m=i=>{x(new Set),o({to:"/",search:{path:i?void 0:s||void 0,flat:i,view:a}})},l=i=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:i}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=J(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:w,loadMore:g,error:y}=ne({prefix:s,flat:e}),h=G({mutationFn:async i=>{const r=s+i.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:i.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:i=>{B.success(`Uploaded ${I(i)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Upload failed: ${i.message}`)}}),z=G({mutationFn:async i=>i.length===1&&i[0]?f("DELETE_OBJECT",{key:i[0]}):f("DELETE_OBJECTS",{keys:i}),onSuccess:()=>{B.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Delete failed: ${i.message}`)}}),v=async i=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:i}),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),L=document.createElement("a");L.href=O,L.download=I(i),document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(O)}catch(r){B.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=i=>{const r=i.target.files;if(r){for(const j of Array.from(r))h.mutate(j);i.target.value=""}},C=(i,r)=>{const j=new Set(n);r?j.add(i):j.delete(i),x(j)},P=i=>{x(i?new Set(u.map(r=>r.key)):new Set)},F=()=>{n.size!==0&&z.mutate(Array.from(n))},k=i=>{if(!w||p)return;const r=i.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})]}):a==="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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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($,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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:F,disabled:z.isPending,children:[t.jsx(Q,{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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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(D,{checked:n.size>0&&n.size===u.length,onCheckedChange:P}),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($,{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(U,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(i=>t.jsx(Ne,{item:i,selected:n.has(i.key),showFullPath:e,onSelect:r=>C(i.key,r),onNavigate:d,onDownload:v,onDelete:r=>z.mutate([r])},i.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx($,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{R as K,$e as a,De as b,ge as f,I as g,W as i,Z as s,ne as u};
@@ -1 +1 @@
1
- import{c as d,j as m,aP as $,bf as j,bg as C,r as f,i as v,bh as N,bi as h}from"./index-pvGhQBw9.js";import{c as u}from"./button-CICpj3wE.js";function S(t){const e=d.c(8);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]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,b=f.createContext({}),E=t=>{const e=d.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 l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(b.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(b),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);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 n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.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 l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.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:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function L(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function R(t){const e=d.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:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function k(t){const e=d.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:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,S as L,D as a,M as b,P as c,L as d,R as e,k as f};
1
+ import{c as d,j as m,aQ as $,bf as j,bg as C,r as f,i as v,bh as N,bi as h}from"./index-ZiFjEqyT.js";import{c as u}from"./button-Co_HOc3E.js";function S(t){const e=d.c(8);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]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,b=f.createContext({}),E=t=>{const e=d.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 l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(b.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(b),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);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 n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.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 l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function L(t){const e=d.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:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function R(t){const e=d.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:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function Q(t){const e=d.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:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,S as L,D as a,M as b,L as c,P as d,R as e,Q as f};